A Quart port of Flask SQLAlchemy.
Project description
Quart-SQLAlchemy is an extension for Quart that adds support for SQLAlchemy to your application. It aims to simplify using SQLAlchemy with Quart by providing useful defaults and extra helpers that make it easier to accomplish common tasks.
This work is based on the excellent Flask extension [FlaskSQLAlchemy](https://github.com/pallets-eco/flask-sqlalchemy/tree/main/examples) and is essentialy a port of that to Quart.
Installing
Install and update using pip:
$ pip install -U quart-sqlalchemy
A Simple Example
from quart import Quart
from quart_sqlalchemy import SQLAlchemy
app = Quart(__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)
with app.app_context():
db.create_all()
db.session.add(User(username="example"))
db.session.commit()
users = db.session.execute(db.select(User)).scalars()
Contributing
For guidance on setting up a development environment and how to make a contribution to Quart-SQLAlchemy, see the contributing guidelines.
Donate
The Pallets organization develops and supports Flask-SQLAlchemy and other popular packages. 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
Documentation:
Changes:
PyPI Releases: https://pypi.org/project/
Source Code: https://github.com/joeblackwaslike/quart-sqlalchemy/
Issue Tracker: https://github.com/joeblackwaslike/quart-sqlalchemy/issues/
Website:
Twitter:
Chat:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for quart_sqlalchemy-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9961fac442d6eecfc481c8c460c5e1d7a31ded11618f7ac79aede926780d0415 |
|
MD5 | 3a33aef5835fd887e5aa5a82761c330f |
|
BLAKE2b-256 | e72983d7f5115bf501e3176ea750ec61f7c4bc76793c36109f39acf37ba661af |