-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: multi-database configurations #151
Conversation
|
Documentation preview will be available shortly at https://jolt-org.github.io/advanced-alchemy-docs-preview/151 |
Signed-off-by: Cody Fincher <[email protected]>
* feat: services accept BaseModels and Structs * fix: adds tests for converting struct and basemodel classes * fix: correct configuration * feat: tweak to_dict
* feat: services accept BaseModels and Structs * fix: adds tests for converting struct and basemodel classes * fix: correct configuration * feat: tweak to_dict * feat: add a `to_schema` parameter to services * chore: linting * fix: type checking * feat: assert model --------- Signed-off-by: Cody Fincher <[email protected]>
Signed-off-by: Cody Fincher <[email protected]>
* feat: improved typing * chore: bump version * feat: i think this is better for linters * chore: revert changes * feat: use type guard * feat: type ignore * feat: precommit hook * fix: updated dict type signature * chore: linting fixes * chore: limit concurrency per branch * feat: lint fix * fix: add missing returns * fix: don't assign an extra variable * feat: allow filters in single row queries (#222) * wip * feat: allow single row operations to filter * fix: remove deprecation test
- Reverts the previous `to_schema` implementation in the service layer. This will need to be rethought as it requires too many overloads to any customized service function. - Ensures that the filter values for `upsert_many` is a unique list. This is useful when you are merging a large amount of objects on a foreign key. The lookup will only contain a single unique entry for each key instead of one for each row. - Adds a `schema_to_dict` method to convert incoming Pydantic or Msgspec models to dictionaries - Adds additional type guard helpers to check for a field in a dictionary, Struct, or BaseModel
* feat: additional tests and helper methods * feat: re-use functions * feat: simplify logic further
Signed-off-by: Cody Fincher <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
One idea though: Since the session scope key is only used internally, how about, instead requiring the user to define one for multiple configs, we simply keep track of all the ones we have created (e.g. via a class var on the base config) and then ensure they are unique? That would make it a bit more "it just works"
advanced_alchemy/extensions/litestar/plugins/init/config/asyncio.py
Outdated
Show resolved
Hide resolved
* feat(cli): Adds drop-all option to the litestar cli * fix(mypy): CI failure * tests(cli): Add tests for drop-all * chore: remove unnecessary import * feat: updated tests * fix: 3.8 and 3.9 support * chore: revert later * revert: "chore: revert later" This reverts commit 4091abd. * chore: 3.8/3.9 support * chore: add eval type check * chore: fix lint * feat: updated linting --------- Co-authored-by: Alc-Alc <alc@localhost> Co-authored-by: Cody Fincher <[email protected]>
Signed-off-by: Cody Fincher <[email protected]>
|
Documentation preview will be available shortly at https://litestar-org.github.io/advanced-alchemy-docs-preview/151 |
* feat: multi-database configurations --------- Signed-off-by: Cody Fincher <[email protected]> Co-authored-by: Alc-Alc <[email protected]> Co-authored-by: Alc-Alc <alc@localhost>
Allows the Litestar plugin to be configured with multiple databases