finds.dev

pallets-eco/flask-sqlalchemy

Adds SQLAlchemy support to Flask

View on GitHubHomepage ↗

★ 4,311PythonBSD-3-Clauseupdated May 2026

// the take

Flask-SQLAlchemy wires SQLAlchemy into Flask's application context, handling session scoping per request and engine configuration from Flask config keys. It's the default choice for any Flask app that needs a relational database. Part of the Pallets community ecosystem, so it tracks upstream Flask and SQLAlchemy releases.

Correct session lifecycle management out of the box — sessions are scoped to the request and torn down automatically, which is the thing most people get wrong when using SQLAlchemy directly with Flask. The extension has fully embraced SQLAlchemy 2.0's `Mapped`/`mapped_column` typing style while keeping a legacy query shim for older codebases. Multiple bind support lets you route different models to different databases without wiring it yourself. The pagination helper is small but genuinely useful and saves everyone from writing the same offset/limit boilerplate.

The extension is essentially a thin config adapter at this point — SQLAlchemy 2.0 handles so much natively that the value-add has shrunk considerably, and you may find yourself fighting the abstraction rather than using raw SQLAlchemy. The legacy `db.session.query()` interface is still present and will trip up teams that mix old and new styles without noticing. Community maintenance status means response time on issues and PRs is unpredictable. There's no async support — if you're on Flask with async views or want to move to async IO, this extension leaves you on your own.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
4,311
Forks
907
Language
Python
License
BSD-3-Clause
Last commit
18 May 2026

// nearby

If flask-sqlalchemy isn't quite it.

All repos →