This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
feat(repository)!: count() & list_and_count() methods #276
Open
peterschutt
wants to merge
11
commits into
0.30
Choose a base branch
from
pagination-enhancements-ps
base: 0.30
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
peterschutt
force-pushed
the
pagination-enhancements-ps
branch
from
January 26, 2023 22:04
3aec8e9
to
8e3f00d
Compare
for more information, see https://pre-commit.ci
- decouple the collection (select statement) from the repo instance E.g., the sqlalchemy select that represents the collection shouldn't need to be bound to `self`. This means that any operation can use the utility methods,like `filter_collection_by_kwargs()` without having to worry about modifying a pre-constructed select to do what it wants. - make `list()` behave the same as it always did - add `count()` methods as standalone service and repo ops. - add `list_and_count()` methods as standalone service and repo ops.
This reverts commit 65e6bfe.
peterschutt
force-pushed
the
pagination-enhancements-ps
branch
from
January 26, 2023 22:22
8e3f00d
to
80a3f3a
Compare
cofin
reviewed
Jan 26, 2023
cofin
reviewed
Jan 28, 2023
SonarCloud Quality Gate failed. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
To support pagination that returns both a subset of the total query, and a count of records in the query.
The a select query is no longer created per repository instance, but rather is constructed per repository operation.
This change supports adding operations to the repository that may use a non-standard select query, while still making
available the utility methods for operating on the select query, e.g.,
filter_select_by_kwargs()
andexecute()
methodsnow require the select to be explicitly passed.
BREAKING CHANGE: select no longer bound to self on sqlalchemy repository.