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