
- 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
12 lines
231 B
Python
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() |