New storage API#276
Merged
Merged
Conversation
Member
Author
Member
Author
|
And cc @ttldtor also :3 |
Contributor
There was a problem hiding this comment.
Several calls of .map in a row is discouraged and may lead to unexpected behaviour.
Member
Author
There was a problem hiding this comment.
What kind of unexpected behavior may happen?
Member
|
Nothing critical was noticed. I approve that shit! \o/ |
Member
Author
|
Thanks for the review, guys, we're moving that shit to production! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I've created the more safe storage API. It uses the new flexible and safe paradigm: DAOs (now they're called "repositories") may implement any number of any methods they want (previously they have to implement predefined generic method set:
store,read,delete). Callers should pass lambdas to the storage and it will execute these lambdas against newly created repository objects.To bind repositories to
DBSessions I've implemented all of them as case classes acceptingDBSessionas parameter. It also helps to better isolate query contexts and to eliminate any possible DAO pool poisoning.This pull request also eliminates many compiler warnings on generic type casting.
Closes #139.