{"id":13484302,"url":"https://github.com/pallets-eco/flask-sqlalchemy","last_synced_at":"2025-12-14T06:33:32.938Z","repository":{"id":928535,"uuid":"697361","full_name":"pallets-eco/flask-sqlalchemy","owner":"pallets-eco","description":"Adds SQLAlchemy support to Flask","archived":false,"fork":false,"pushed_at":"2025-03-06T03:34:11.000Z","size":1616,"stargazers_count":4281,"open_issues_count":25,"forks_count":900,"subscribers_count":112,"default_branch":"main","last_synced_at":"2025-05-05T20:50:10.812Z","etag":null,"topics":["flask","flask-sqlalchemy","python","sqlalchemy"],"latest_commit_sha":null,"homepage":"https://flask-sqlalchemy.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pallets-eco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"pallets","custom":"https://palletsprojects.com/donate","tidelift":"pypi/Flask"}},"created_at":"2010-06-01T15:01:50.000Z","updated_at":"2025-05-05T14:41:59.000Z","dependencies_parsed_at":"2023-07-13T19:13:55.624Z","dependency_job_id":"7994b9fc-2e9f-44af-aa14-99669c61ef8a","html_url":"https://github.com/pallets-eco/flask-sqlalchemy","commit_stats":{"total_commits":757,"total_committers":123,"mean_commits":6.154471544715447,"dds":0.6948480845442536,"last_synced_commit":"3e3e92ba557649ab5251eda860a67656cc8c10af"},"previous_names":["mitsuhiko/flask-sqlalchemy","pallets/flask-sqlalchemy"],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-sqlalchemy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-sqlalchemy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-sqlalchemy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-sqlalchemy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pallets-eco","download_url":"https://codeload.github.com/pallets-eco/flask-sqlalchemy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253463614,"owners_count":21912858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","flask-sqlalchemy","python","sqlalchemy"],"created_at":"2024-07-31T17:01:22.134Z","updated_at":"2025-12-11T21:03:33.404Z","avatar_url":"https://github.com/pallets-eco.png","language":"Python","readme":"# Flask-SQLAlchemy\n\nFlask-SQLAlchemy is an extension for [Flask][] that adds support for\n[SQLAlchemy][] to your application. It aims to simplify using SQLAlchemy\nwith Flask by providing useful defaults and extra helpers that make it\neasier to accomplish common tasks.\n\n[Flask]: https://flask.palletsprojects.com\n[SQLAlchemy]: https://www.sqlalchemy.org\n\n## Pallets Community Ecosystem\n\n\u003e [!IMPORTANT]\\\n\u003e This project is part of the Pallets Community Ecosystem. Pallets is the open\n\u003e source organization that maintains Flask; Pallets-Eco enables community\n\u003e maintenance of Flask extensions. If you are interested in helping maintain\n\u003e this project, please reach out on [the Pallets Discord server][discord].\n\u003e\n\u003e [discord]: https://discord.gg/pallets\n\n## A Simple Example\n\n```python\nfrom flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\nfrom sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column\n\napp = Flask(__name__)\napp.config[\"SQLALCHEMY_DATABASE_URI\"] = \"sqlite:///example.sqlite\"\n\nclass Base(DeclarativeBase):\n  pass\n\ndb = SQLAlchemy(app, model_class=Base)\n\nclass User(db.Model):\n    id: Mapped[int] = mapped_column(primary_key=True)\n    username: Mapped[str] = mapped_column(unique=True)\n\nwith app.app_context():\n    db.create_all()\n\n    db.session.add(User(username=\"example\"))\n    db.session.commit()\n\n    users = db.session.scalars(db.select(User))\n```\n","funding_links":["https://github.com/sponsors/pallets","https://palletsprojects.com/donate","https://tidelift.com/funding/github/pypi/Flask"],"categories":["Python","Flask Utilities","Database, ORM \u0026 Migrations"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallets-eco%2Fflask-sqlalchemy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpallets-eco%2Fflask-sqlalchemy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallets-eco%2Fflask-sqlalchemy/lists"}