-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: db sessions are now explicitly passed as arguments
This helps clarify exactly which functions require the database to be initialized. Also, it helps avoid any potential future issues with relying entirely on a global/thread-local session factory. The following functions/hooks are affected by this change: * `add.add_item` - new `session` parameter * `cli.Hooks.add_command` hook - the sub-command functions are now passed a `session` parameter * `config.Hooks.register_sa_event_listeners` hook - `session` parameter removed * `duplicate.resolve_dup_items` - new `session` parameter * `duplicate.Hooks.resolve_dup_items` hook - new `session` parameter * `duplicate.resolve_duplicates` - new `session` parameter * `duplicate.get_duplicates` - new `session` parameter * `library.lib_item.Hooks.edit_changed_items` hook - new `session` parameter * `library.lib_item.Hooks.edit_new_items` hook - new `session` parameter * `library.lib_item.Hooks.process_removed_items` hook - new `session` parameter * `library.lib_item.Hooks.process_changed_items` hook - new `session` parameter * `library.lib_item.Hooks.process_new_items` hook - new `session` parameter * `query.query` - new `session` parameter * `remove.remove_item` - new `session` parameter * `util.cli.query.cli_query` - new `session` parameter `config.MoeSession` has been replaced with `config.moe_sessionmaker`. Sessions should no longer be created by importing MoeSession, and instead should use a session parameter that is created at the top-level of an application. Refer to the `config.py` docstring as well as `cli.py` on how this effects instantiating a session.
- Loading branch information
Showing
32 changed files
with
350 additions
and
284 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
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
Oops, something went wrong.