Skip to content
Adds SQLAlchemy support to Flask
Python
Branch: master
Clone or download

Latest commit

dependabot-preview Bump pip-tools from 5.1.2 to 5.2.0 (#831)
Bumps [pip-tools](https://github.com/jazzband/pip-tools) from 5.1.2 to 5.2.0.
- [Release notes](https://github.com/jazzband/pip-tools/releases)
- [Changelog](https://github.com/jazzband/pip-tools/blob/master/CHANGELOG.md)
- [Commits](jazzband/pip-tools@5.1.2...5.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Latest commit 3a23d0e May 28, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github update contributing doc May 26, 2020
artwork Committed new artwork Mar 18, 2011
docs Merge branch '2.x' May 26, 2020
examples apply flake8 May 25, 2020
requirements Bump pip-tools from 5.1.2 to 5.2.0 (#831) May 28, 2020
src/flask_sqlalchemy Merge branch '2.x' May 26, 2020
tests Merge branch '2.x' May 26, 2020
.editorconfig add editorconfig May 25, 2020
.gitignore update project data for Pallets Apr 18, 2019
.pre-commit-config.yaml add pre-commit config and style test env May 25, 2020
.readthedocs.yaml use pip-compile to pin dev requirements May 25, 2020
CHANGES.rst Merge branch '2.x' May 26, 2020
CODE_OF_CONDUCT.md Addition of COC in reference to other Pallet Projects (#734) May 31, 2019
CONTRIBUTING.rst update contributing doc May 26, 2020
LICENSE.rst update project data for Pallets Apr 18, 2019
MANIFEST.in use pip-compile to pin dev requirements May 25, 2020
README.rst update contributing doc May 26, 2020
setup.cfg apply flake8 May 25, 2020
setup.py use setup.cfg for setup metadata May 25, 2020
tox.ini add pre-commit config and style test env May 25, 2020

README.rst

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.

Installing

Install and update using pip:

$ pip install -U Flask-SQLAlchemy

A Simple Example

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

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


class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String, unique=True, nullable=False)
    email = db.Column(db.String, unique=True, nullable=False)


db.session.add(User(username="Flask", email="example@example.com"))
db.session.commit()

users = User.query.all()

Contributing

For guidance on setting up a development environment and how to make a contribution to Flask-SQLAlchemy, see the contributing guidelines.

Donate

The Pallets organization develops and supports Flask-SQLAlchemy. In order to grow the community of contributors and users, and allow the maintainers to devote more time to the projects, please donate today.

Links

You can’t perform that action at this time.