
- Set up project structure - Configure SQLite database with SQLAlchemy - Create item model and schema - Set up Alembic for database migrations - Implement CRUD operations for items - Add health check endpoint - Add API documentation - Configure Ruff for linting - Update README with project information
14 lines
245 B
Python
14 lines
245 B
Python
from typing 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() |