Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up
the issue with a local PostgreSQL install?:
uvloop?:
Latest version of asyncpg
No PGBouncer
Python 3.8.2
Hi, I am using fast API but I have no idea how to maintain DB connection and pool. I am switching from Django ORM but still, it is hard for me to get a good grasp on this. Please guide me on how can I improve this and also add this to your documentation.
My questions:
How to maintain a constant database connection?
How to maintain a pool of connections?
How to use the same connection out of the pool for every query in the same request?
Is my naive solution correct? How can I improve this and make this production-ready?
db_connection.py
db_session.py
main.py
user.py