From 6585a4aebaebb04054122f8a89643afe702995e4 Mon Sep 17 00:00:00 2001 From: Patrick Wang Date: Mon, 16 Nov 2020 12:05:33 -0500 Subject: [PATCH] Add FastAPI db dependency --- dependencies.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 dependencies.py diff --git a/dependencies.py b/dependencies.py new file mode 100644 index 00000000..a96561de --- /dev/null +++ b/dependencies.py @@ -0,0 +1,6 @@ +import db + +async def get_db(): + """Get database connection.""" + with db.DBConnection() as conn: + yield conn