Relative Content

Tag Archive for pythondependency-injectionfastapi

Async database connection as FastAPI Router dependency

I’m trying to use asyncpg to initialize a Pool and then I’m using this pool to create a connection each time I need to read something from my DB. It was working fine until I moved my SQL endpoints to an APIRouter. I’m a bit lost now since I couldn’t find docs for this specific case.

Fastapi Depends

as far as I have read, what I am requesting is not possible, so maybe you can alternatively provide me with some best practices, that would be awesome!

Fastapi Depends

as far as I have read, what I am requesting is not possible, so maybe you can alternatively provide me with some best practices 🙂