Automated Action db2997cc83 Create FastAPI todo backend with SQLite
Generated with and Co-Authored by [BackendIM](https://backend.im)
2025-05-11 16:39:38 +00:00

13 lines
220 B
Python

from typing import Generator
from sqlalchemy.orm import Session
from app.db.session import SessionLocal
def get_db() -> Generator:
try:
db = SessionLocal()
yield db
finally:
db.close()