Automated Action 53566813bd Complete Todo API implementation with FastAPI and SQLite
- Add SQLite database configuration
- Create Todo model, schemas, and CRUD operations
- Implement Todo API endpoints
- Add Alembic migration for todo table
- Set up database initialization in main.py
- Update README with project details and instructions
- Add pyproject.toml with Ruff configuration
2025-06-10 15:40:42 +00:00

14 lines
254 B
Python

from collections.abc import Generator
from app.db.session import SessionLocal
def get_db() -> Generator:
"""
Dependency for getting the database session.
"""
db = SessionLocal()
try:
yield db
finally:
db.close()