Automated Action 3efcd88ffa Create Calculator API with FastAPI and SQLAlchemy
- Setup FastAPI project structure
- Add database models for calculations
- Create API endpoints for basic math operations
- Add health endpoint
- Configure SQLite and Alembic for database management
- Update README with usage instructions

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

11 lines
439 B
Python

from sqlalchemy import Column, Integer, String, Float, DateTime
from sqlalchemy.sql import func
from app.db.base_class import Base
class Calculation(Base):
id = Column(Integer, primary_key=True, index=True)
operation = Column(String, index=True)
first_number = Column(Float)
second_number = Column(Float, nullable=True)
result = Column(Float)
created_at = Column(DateTime(timezone=True), server_default=func.now())