ibs/sql_app/utils.py

9 lines
132 B
Python
Raw Permalink Normal View History

from .database import SessionLocal
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()