Automated Action e1b1b89511 Create FastAPI REST API with SQLite
Features:
- Project structure with FastAPI framework
- SQLAlchemy models with SQLite database
- Alembic migrations system
- CRUD operations for items
- API routers with endpoints for items
- Health endpoint for monitoring
- Error handling and validation
- Comprehensive documentation
2025-05-18 05:45:33 +00:00

15 lines
309 B
Python

from typing import Any
from sqlalchemy.ext.declarative import as_declarative, declared_attr
@as_declarative()
class Base:
id: Any
__name__: str
# Generate __tablename__ automatically based on class name
@declared_attr
def __tablename__(cls) -> str:
return cls.__name__.lower()