4 ms·
> so basically, two sources of truth. As I understood you don't, as SQLModel inherits from sqlalchemy ORM base classes. From the user guide, this is an example
by smoe 5y ago
> so basically, two sources of truth.
As I understood you don't, as SQLModel inherits from sqlalchemy ORM base classes. From the user guide, this is an example how to define the model and generate the table.
class Hero(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str
secret_name: str
age: Optional[int] = None
engine = create_engine(sqlite_url, echo=True)
SQLModel.metadata.create_all(engine)
- shroompasta 5y agoYeah, that was my bad. Went by a bit too quickly. looks good.