Skip to content
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

Encapsulate sqlalchemy models further to support dynamic config #220

Open
signebedi opened this issue May 23, 2024 · 0 comments
Open

Encapsulate sqlalchemy models further to support dynamic config #220

signebedi opened this issue May 23, 2024 · 0 comments

Comments

@signebedi
Copy link
Owner

I was able to encapsulate the app config using a context manager, and then a kind of hackish child function that yields the config for dependency injections in the FastAPI routes.
Right now, I have a pretty large with statement at the top of the script that's used to instantiate a number of core objects from factory functions. This includes the application SMTP mailer object, the SQLAlchemy models, and the document database.
Over time, I'd like to encapsulate these and yield them as well as dependency injections. This will carry with it some challenges, especially for the SQLAlchemy dependency injection, because it yields a tuple of somewhat complex values, so that might break assumptions unless I clean it up a little bit.

Originally posted by @signebedi in #5 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant