aboutsummaryrefslogtreecommitdiff
path: root/inventory-service/app/api/deps.py
diff options
context:
space:
mode:
authoralex <[email protected]>2026-07-17 18:16:35 +0200
committeralex <[email protected]>2026-07-17 18:16:35 +0200
commit8e796c9cfcd65f6225a6ae3ec2a4419f265b0ebc (patch)
tree1bf90385144be2e9f350c31da553b1ac306ee60b /inventory-service/app/api/deps.py
parent5f6918db393ed78dd8f038e9e5f1ea85f811dc52 (diff)
downloadorder-inventory-system-main.tar.xz
order-inventory-system-main.zip
inventory-service initHEADmain
Diffstat (limited to 'inventory-service/app/api/deps.py')
-rw-r--r--inventory-service/app/api/deps.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/inventory-service/app/api/deps.py b/inventory-service/app/api/deps.py
new file mode 100644
index 0000000..d8dd349
--- /dev/null
+++ b/inventory-service/app/api/deps.py
@@ -0,0 +1,10 @@
+from typing import Generator
+from app.core.database import SessionLocal
+
+
+def get_db() -> Generator:
+ db = SessionLocal()
+ try:
+ yield db
+ finally:
+ db.close()