#8080th of 354 in Backends, databases and hosting
sqlmodel
Python library that defines SQL tables and Pydantic models in one class
Run it:RackNerd ↗ (opens in a new tab)RepoCloud ↗ (opens in a new tab)Affiliate links, no effect on a rank.
- Stars
- 18.7k
- License
- MIT
- Last commit
- Nov 2026
- Last release
- Nov 2026
- Language
- Python
17,782 on 6 May 202618,671 on 25 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
SQLModel is a Python library that defines SQL tables and Pydantic data models with one class, built as a thin layer over SQLAlchemy and Pydantic. Models use type annotations and work with sessions, engines and select() queries, including in FastAPI apps. It is not an AI project; it fits here as the database layer for FastAPI-based starters.
Who it is for: Python and FastAPI developers who want one model for DB tables and validation
Strengths
- One class serves as both SQLAlchemy table and Pydantic model, avoiding duplicate definitions
- Full SQLAlchemy underneath, so existing SQLAlchemy models and migrations can be combined with it
- Type-annotated queries give editor autocompletion and inline errors, even on selected rows
- Same author as FastAPI; designed to fit its request and response models
Weaknesses
- Thin wrapper, so advanced use still needs SQLAlchemy knowledge
- Not a backend or server; no auth, storage or API layer included
- Not AI-specific; no model, vector or LLM features in the README
- Migrations tooling is not described in the README
What it needs
- no GPU
- Compose
- Needs Pydantic, SQLAlchemy
What changed
- 0.0.50 ↗ (opens in a new tab)Breaking
“💥 Drop support for Python 3.10. PR #2139 by @tiangolo.”
From the release notes. No flag means the note does not say so, not that the upgrade is safe.
Known problems
Reported, then fixed by a linked change
- SQLModel fails to create DB constraints when using Annotated types after Pydantic 2.12.0 ↗ (opens in a new tab)12 reactions · closed 1 Feb 2026Fixed by 🐛 Fix support for `Annotated` fields with Pydantic 2.12+ ↗ (opens in a new tab)
- `Field(alias="")` doesn't work with Pydantic V2 ↗ (opens in a new tab)10 reactions · closed 23 Dec 2025Fixed by 🐛 Fix `alias` support for Pydantic v2 ↗ (opens in a new tab)
Titles are the reporters' own words, taken from the project's GitHub issues and ranked by reactions. We have not tried to reproduce any of them.
Also in Backends, databases and hosting
See all 354| Rank | Project | Score |
|---|---|---|
| #78 | actix-webRust web framework for HTTP/1.x and HTTP/2 servers on Tokio | 81 out of 100 |
| #79 | doltMySQL-compatible SQL database with Git-style branch, merge, push and pull | 81 out of 100 |
| #81 | questdbTime-series SQL database for high-rate ingestion and queries over live and historical data | 81 out of 100 |
| #82 | dorisMPP analytics database for real-time SQL, lakehouse queries and hybrid search | 81 out of 100 |
| #83 | citusPostgreSQL extension that shards tables across nodes for distributed queries | 81 out of 100 |