SQLModel
noun
say it: “SEE-kwul MOD-ul” /ˈsiːkwəl ˈmɑdəl/
A Python library by FastAPI's author, built on SQLAlchemy and Pydantic, where one class is both a database table and an API model.
What is SQLModel?
SQLModel (by FastAPI's author) combines Pydantic and SQLAlchemy, so one class is both your database table and your API model.
class Recipe(SQLModel, table=True):
id: int | None = Field(default=None, primary_key=True)
title: str
In a sentence
- “With SQLModel, the Workout class is the table and the response model at once.”
- “SQLModel builds on SQLAlchemy and Pydantic.”
Level: Journeyman · More FastAPI terms at this level
Updated