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