skillfed

Flask-SQLAlchemy

Add SQLAlchemy support to your Flask application.

flask-sqlalchemy Permissive license Active 4,311 v3.1.1 released

Install

flask-sqlalchemy on PyPI

pip

pip install flask-sqlalchemy

uv

uv add flask-sqlalchemy

poetry

poetry add flask-sqlalchemy

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 2 — flask, sqlalchemy
Maintenance actively maintained — 1,067 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: flask_sqlalchemy-3.1.1-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonTopic :: Internet :: WWW/HTTP :: Dynamic Content

About Flask-SQLAlchemy

from the package's own PyPI description — quoted content, verbatim

Flask-SQLAlchemy

Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application. It aims to simplify using SQLAlchemy with Flask by providing useful defaults and extra helpers that make it easier to accomplish common tasks.

.. _Flask: https://palletsprojects.com/p/flask/ .. _SQLAlchemy: https://www.sqlalchemy.org

Installing

Install and update using pip_:

.. code-block:: text

$ pip install -U Flask-SQLAlchemy

.. _pip: https://pip.pypa.io/en/stable/getting-started/

A Simple Example

.. code-block:: python

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column

app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///example.sqlite"

class Base(DeclarativeBase):
  pass

db = SQLAlchemy(app, model_class=Base)

class User(db.Model):
    id: Mapped[int] = mapped_column(db.Integer, primary_key=True)
    username: Mapped[str] = mapped_column(db.String, unique=True, nullable=False)

with app.app_context():
    db.create_all()...

Read as markdown · JSON record · Source repository · Docs

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

Flask-SQLAlchemy integrates SQLAlchemy database support into Flask applications, providing simplified configuration, session management, and model helpers for common web application database tasks.

Low friction: pure Python wheel with only two runtime dependencies (flask and sqlalchemy). Active maintenance status signals ongoing community support.

Permissive BSD license allows commercial and private use with minimal restrictions, making it suitable for most project contexts.

Usage

pip install Flask-SQLAlchemy

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.orm import DeclarativeBase

app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///example.sqlite"

class Base(DeclarativeBase):
    pass

db = SQLAlchemy(app, model_class=Base)

Requires Python 3.8 or later; a database URI must be configured via SQLALCHEMY_DATABASE_URI.

Verdict: Production-stable extension with active maintenance and no known vulnerabilities. Permissive licensing and low installation friction make it well-suited for Flask applications needing ORM support.

Needs verification

  • Repository star count and its significance for assessing community adoption.
  • Performance characteristics and scalability limits for high-concurrency applications.
  • Whether 1067 days since last release reflects a stable API or potential staleness.
flask database ormsqlalchemy flask integrationflask sql modelsweb app database layerflask db session managementpython web ormflask declarative models

Similar packages