giants-maps-api/app/dependencies.py

11 lines
146 B
Python
Raw Normal View History

2021-12-22 15:56:35 +01:00
from .database import SessionLocal
# Dependency
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()