Automated Action a030964e07 Implement REST API with FastAPI and SQLite
- Set up project structure and dependencies
- Implement database models with SQLAlchemy
- Set up Alembic migrations
- Create FastAPI application with CORS support
- Implement API endpoints (CRUD operations)
- Add health check endpoint
- Update README with setup and usage instructions
2025-06-03 12:23:52 +00:00

12 lines
231 B
Python

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