// the find
pallets-eco/flask-sqlalchemy
Adds SQLAlchemy support to Flask
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.