aboutsummaryrefslogtreecommitdiff
path: root/src/utils/db.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/db.py')
-rw-r--r--src/utils/db.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils/db.py b/src/utils/db.py
new file mode 100644
index 0000000..a6734ea
--- /dev/null
+++ b/src/utils/db.py
@@ -0,0 +1,9 @@
+from database import SessionLocal
+
+
+def get_db():
+ db = SessionLocal()
+ try:
+ yield db
+ finally:
+ db.close()