finds.dev← search

// the find

fastapi/sqlmodel

★ 18,053 · Python · MIT · updated Jun 2026

SQL databases in Python, designed for simplicity, compatibility, and robustness.

SQLModel merges SQLAlchemy and Pydantic into a single model class, so you define your table schema once and get both ORM functionality and request/response validation from the same class. It's aimed primarily at FastAPI developers who are tired of maintaining parallel SQLAlchemy models and Pydantic schemas. Works well for straightforward CRUD apps against a single database.

- Eliminating the SQLAlchemy model + Pydantic schema duplication is a real pain point it solves — defining `table=True` vs leaving it off is a clean mechanism for sharing structure between DB and API layers.

- Type annotations drive everything, so you get genuine editor autocomplete and type-checking on query results, not just on the model definition — `session.exec(select(Hero))` returns a typed result.

- Built on top of full SQLAlchemy 2.x, so you're not locked into SQLModel's abstractions; you can drop down to raw SQLAlchemy queries, use `text()`, or mix in regular SQLAlchemy models without friction.

- Test coverage is solid and the docs include working, tested code examples under `docs_src/` that are actually run in CI, reducing the chance of stale documentation.

- The single-model approach breaks down the moment your API shapes diverge non-trivially from your DB schema — partial updates, write-only fields, computed properties. You end up creating separate Pydantic models anyway, which undermines the main selling point.

- Alembic migration support is a known rough edge. SQLModel doesn't generate migrations itself, and the interaction between SQLModel metadata and Alembic autogenerate has historically had quirks around nullable fields and default values that have burned people in production.

- Async support exists but is a second-class citizen — the docs and most tutorials are sync-first, and patterns like `AsyncSession` with proper connection pooling for production use are underexplained.

- Development velocity has been slow relative to star count; PRs pile up for months, and it lagged significantly behind Pydantic v2 compatibility when that shipped, leaving users stuck on older Pydantic versions longer than they'd like.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →