
- 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)
16 lines
289 B
Python
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() |