Automated Action 00174fd9dc Create REST API with FastAPI and SQLite
- Set up project structure with FastAPI
- Configure SQLite database with SQLAlchemy
- Set up Alembic for migrations
- Create Item model and schema
- Implement CRUD operations
- Add health endpoint

generated with BackendIM... (backend.im)
2025-05-13 21:57:29 +00:00

13 lines
307 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()