aboutsummaryrefslogtreecommitdiff
path: root/order-service/app/api/deps.py
diff options
context:
space:
mode:
authoralex <[email protected]>2026-07-15 20:24:31 +0200
committeralex <[email protected]>2026-07-15 20:24:31 +0200
commit8e12cb9bb66adc7adaf6d276133d6f235d294d23 (patch)
tree31aa3f6a06407b39bb23d7cc724c70899795a788 /order-service/app/api/deps.py
downloadorder-inventory-system-8e12cb9bb66adc7adaf6d276133d6f235d294d23.tar.xz
order-inventory-system-8e12cb9bb66adc7adaf6d276133d6f235d294d23.zip
init
Diffstat (limited to 'order-service/app/api/deps.py')
-rw-r--r--order-service/app/api/deps.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/order-service/app/api/deps.py b/order-service/app/api/deps.py
new file mode 100644
index 0000000..d8dd349
--- /dev/null
+++ b/order-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()