
- Set up project structure with app modules - Configure SQLite database connection - Set up Alembic for database migrations - Implement Item model with CRUD operations - Create API endpoints for items management - Add health check endpoint - Add API documentation - Add comprehensive README
20 lines
299 B
Python
20 lines
299 B
Python
"""
|
|
API dependencies.
|
|
"""
|
|
from typing import Generator
|
|
|
|
from app.db.session import SessionLocal
|
|
|
|
|
|
def get_db() -> Generator:
|
|
"""
|
|
Get database session.
|
|
|
|
Yields:
|
|
Session: Database session
|
|
"""
|
|
db = SessionLocal()
|
|
try:
|
|
yield db
|
|
finally:
|
|
db.close() |