diff options
author | Parker <contact@pkrm.dev> | 2024-11-10 16:36:16 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-11-10 16:36:16 -0600 |
commit | 691aa744a0398f185b3ca98a36fbd83806c7786c (patch) | |
tree | 7840f31c30bb6eda903abd6bbf4dbfb2ac590966 /api/util/db_dependency.py | |
parent | 8941213c8d94f3ad84e07e467e78105dc7fed734 (diff) |
TOO MUCH STUFF
Diffstat (limited to 'api/util/db_dependency.py')
-rw-r--r-- | api/util/db_dependency.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/api/util/db_dependency.py b/api/util/db_dependency.py new file mode 100644 index 0000000..a6734ea --- /dev/null +++ b/api/util/db_dependency.py @@ -0,0 +1,9 @@ +from database import SessionLocal + + +def get_db(): + db = SessionLocal() + try: + yield db + finally: + db.close() |