Add PaginatorTrait
and CountTrait
for more constrains
#306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I build my web api using sea-orm, I want to constrain my select type to have
paginate()
method. So I added aPaginatorTrait
and move thepaginate()
method to this trait. Meanwhilecount()
method of select type depends onpaginate()
method, but not allpaginate
able select has this method. So I added anotherCountTrait
trait.My use case of
PaginatorTrait
is like this:These traits may be used not so often but needed for me. It will be fine if this PR is merged.
By the way, if this PR will be merged, feel free to modify the docs and variable names, cause i'm not a native english speaker.