You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered: