This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(repository): make abc more general. (#82)
The ABC was typed to accept a sqlalchemy session object. Changed to instead receive arbitrary kwargs, but if the base class actually ever receives kwargs it will error out due to super call to `object.__init__()`. The service object accepts arbitrary kwargs that are passed through to the repository, but doesn't care what they are. This all means that the only thing that knows and cares about the sqlalchemy session, is the sqlalchemy repository, and that feels right. One facet of this approach is that it makes the concept of the transaction an implementation detail. The sqlalchemy repo has the concept of session/transaction, but a repository doesn't _have_ to understand those things. This is consistent with the testing repository implementation, so happy to see how the pattern pans out. Closes #54
- Loading branch information
1 parent
ab5531f
commit 9e89434
Showing
5 changed files
with
12 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
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
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