python-dependency-injector
python-dependency-injector copied to clipboard
best setup with sqlalchemy and connection pooling
Will this example (https://github.com/ets-labs/python-dependency-injector/tree/master/examples/miniapps/fastapi-sqlalchemy) be a production ready setup with connection pooling etc?
I'm not completely certain, but based on my intuition, it seems that the solution may not be production-ready. This is because FastAPI is an asynchronous framework, but in this example, SQLAlchemy is used in a synchronous manner. As a result, any database calls made will block the event loop.
See https://docs.sqlalchemy.org/en/20/orm/extensions/asyncio.html
Can anyone provide clarification or correct me if I'm mistaken?