genericrestapi-sxso1t/app/db/base_class.py
Automated Action a4ffe78f61 Create REST API with FastAPI and SQLAlchemy
- Set up project structure with FastAPI
- Create SQLite database with SQLAlchemy
- Implement Alembic for database migrations
- Add CRUD operations for items resource
- Create health endpoint
- Update documentation

generated with BackendIM... (backend.im)
2025-05-14 10:26:10 +00:00

12 lines
244 B
Python

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