
- Set up project structure - Configure SQLAlchemy models and database connection - Set up Alembic for database migrations - Create Pydantic schemas for API data validation - Implement task CRUD operations - Add task filtering and pagination - Include health check endpoint - Update README with setup and usage instructions
15 lines
315 B
Python
15 lines
315 B
Python
from typing import Generator
|
|
from sqlalchemy.orm import Session
|
|
|
|
from app.database.session import SessionLocal
|
|
|
|
|
|
def get_db() -> Generator[Session, None, None]:
|
|
"""
|
|
Dependency function that yields a SQLAlchemy session
|
|
"""
|
|
db = SessionLocal()
|
|
try:
|
|
yield db
|
|
finally:
|
|
db.close() |