Skip to content

Commit

Permalink
Add FastAPI db dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Wang committed Nov 16, 2020
1 parent 20c9bb6 commit 6585a4a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import db

async def get_db():
"""Get database connection."""
with db.DBConnection() as conn:
yield conn

0 comments on commit 6585a4a

Please sign in to comment.