This repository was archived by the owner on May 29, 2024. It is now read-only.
SQLAlchemy related improvements#90
Merged
ThomasJunk merged 6 commits intoringo-framework:masterfrom Sep 12, 2017
g-tom:sqlalchemy_cleanup
Merged
SQLAlchemy related improvements#90ThomasJunk merged 6 commits intoringo-framework:masterfrom g-tom:sqlalchemy_cleanup
ThomasJunk merged 6 commits intoringo-framework:masterfrom
g-tom:sqlalchemy_cleanup
Conversation
added 6 commits
September 7, 2017 10:39
get() takes already loaded objects from the sessions identity map, whereas one() always triggers a database query. Thus, using get() potentially improves performance. Consequently, changed BaseFactory.load() to always return None instead of raising NoResultFound.
At least when importing a list of n objects of the same type, this reduces the queries for modul loading from n to 1.
Adding them again is harmless but superfluous.
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 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.
This PR is mainly about making use of SQLAlchemy's identity map where possible instead of querying the database over and over again (e379021, 3652271). Additionally some error handling (542295f, 1bea2e7) and cleanup of usage of SQLAlchemy's API (9e24eb7, 509cb4b).