
- Set up project structure with FastAPI, SQLAlchemy, and Alembic - Create database models for User and Item - Implement CRUD operations for all models - Create API endpoints with validation - Add health check endpoint - Configure CORS middleware - Set up database migrations - Add comprehensive documentation in README
12 lines
191 B
Python
12 lines
191 B
Python
from typing import Generator
|
|
|
|
|
|
from app.database.session import SessionLocal
|
|
|
|
|
|
def get_db() -> Generator:
|
|
try:
|
|
db = SessionLocal()
|
|
yield db
|
|
finally:
|
|
db.close() |