{"id":15294028,"url":"https://github.com/pallets-eco/flask-sqlalchemy-lite","last_synced_at":"2025-04-09T07:08:13.907Z","repository":{"id":243283673,"uuid":"812006928","full_name":"pallets-eco/flask-sqlalchemy-lite","owner":"pallets-eco","description":"Integrate SQLAlchemy with Flask.","archived":false,"fork":false,"pushed_at":"2025-03-05T21:32:29.000Z","size":83,"stargazers_count":40,"open_issues_count":3,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-30T09:01:54.244Z","etag":null,"topics":["flask","flask-sqlalchemy","flask-sqlalchemy-lite","pallets","pallets-eco","python","sqlalchemy"],"latest_commit_sha":null,"homepage":"https://flask-sqlalchemy-lite.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pallets-eco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"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":"2024-06-07T18:52:35.000Z","updated_at":"2025-03-18T12:01:46.000Z","dependencies_parsed_at":"2024-06-07T20:13:33.781Z","dependency_job_id":"68cce880-2980-42b7-b9d4-ab41029d2f3c","html_url":"https://github.com/pallets-eco/flask-sqlalchemy-lite","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":0.08695652173913049,"last_synced_commit":"67f3092880d3b3fcc05b2170ae1701e150503a2b"},"previous_names":["pallets-eco/flask-sqlalchemy-lite"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-sqlalchemy-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-sqlalchemy-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-sqlalchemy-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-sqlalchemy-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pallets-eco","download_url":"https://codeload.github.com/pallets-eco/flask-sqlalchemy-lite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994121,"owners_count":21030050,"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","flask-sqlalchemy-lite","pallets","pallets-eco","python","sqlalchemy"],"created_at":"2024-09-30T16:55:59.300Z","updated_at":"2025-04-09T07:08:13.875Z","avatar_url":"https://github.com/pallets-eco.png","language":"Python","readme":"# Flask-SQLAlchemy-Lite\n\nIntegrate [SQLAlchemy] with [Flask]. Use Flask's config to define SQLAlchemy\ndatabase engines. Create SQLAlchemy ORM sessions that are cleaned up\nautomatically after requests.\n\nIntended to be a replacement for [Flask-SQLAlchemy]. Unlike the prior extension,\nthis one does not attempt to manage the model base class, tables, metadata, or\nmultiple binds for sessions. This makes the extension much simpler, letting the\ndeveloper use standard SQLAlchemy instead.\n\n[SQLAlchemy]: https://sqlalchemy.org\n[Flask]: https://flask.palletsprojects.com\n[Flask-SQLAlchemy]: https://flask-sqlalchemy.readthedocs.io\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_lite import SQLAlchemy\nfrom sqlalchemy import select\nfrom sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column\n\n\nclass Base(DeclarativeBase):\n    pass\n\n\nclass User(Base):\n    __tablename__ = \"user\"\n    id: Mapped[int] = mapped_column(primary_key=True)\n    username: Mapped[str] = mapped_column(unique=True)\n\n\napp = Flask(__name__)\napp.config[\"SQLALCHEMY_ENGINES\"] = {\"default\": \"sqlite:///default.sqlite\"}\ndb = SQLAlchemy(app)\n\nwith app.app_context():\n    Base.metadata.create_all(db.engine)\n\n    db.session.add(User(username=\"example\"))\n    db.session.commit()\n\n    users = db.session.scalars(select(User))\n```\n","funding_links":["https://github.com/sponsors/pallets","https://palletsprojects.com/donate","https://tidelift.com/funding/github/pypi/Flask"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallets-eco%2Fflask-sqlalchemy-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpallets-eco%2Fflask-sqlalchemy-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallets-eco%2Fflask-sqlalchemy-lite/lists"}