fastapi-sqlalchemy
fastapi-sqlalchemy copied to clipboard
Multiple DBs
Is there a way to add two database connections via the middleware? Slighty edge case, but I'll dealing with a psql and a MySQL for my project
I'm afraid not directly at present, but I'd be happy to go along with it if someone were willing to write up a pull request.
Thanks for the reply. I'll try the main doc's get_db()
approach first & see how it suites me, and if I end up wanting to go the fastapi-sqlalchemy path I'll submit a PR. Hopefully someone gets to it before me
Pull request #47 adds this functionality.
Pull request #47 adds this functionality.
God, this warehouse seems to have been out of maintenance for 3 years, and it's really difficult to find middleware for FASTAPI+sqlalchemy. I found one in the past two days, but there is also a bug
Maybe you can try fork one and publish it to pypi. I guess many people will use it
The official way of using fastapi requires adding a parameter to the view, which is very inconvenient. I have to pass that parameter layer by layer before I can use database connection. Then I found this middleware. Unfortunately, it has not been maintained for a long time. If there is a useful fastapi+sqlalchemy, please remind me
This is another middleware I found.
https://github.com/h0rn3t/fastapi-async-sqlalchemy/issues/17
Hey, so I have actually packaged it and it's available using fastapi-sqlalchemy-improved on pypi.