Automated Action 3bed1d0510 Create Todo API with FastAPI and SQLite
- Implement Todo CRUD API endpoints
- Set up SQLite database with SQLAlchemy
- Create Todo model and schemas
- Configure Alembic migrations
- Add comprehensive documentation

🤖 Generated with and Co-Authored by [BackendIM](https://backend.im)
2025-05-11 18:30:32 +00:00

16 lines
289 B
Python

from typing import Generator
from sqlalchemy.orm import Session
from app.db.session import SessionLocal
def get_db() -> Generator[Session, None, None]:
"""
Get database session dependency
"""
db = SessionLocal()
try:
yield db
finally:
db.close()