{"id":18474429,"url":"https://github.com/pgjones/quart-db","last_synced_at":"2025-04-06T13:09:20.568Z","repository":{"id":38617702,"uuid":"473941001","full_name":"pgjones/quart-db","owner":"pgjones","description":"Quart extension that provides managed connection(s) to postgresql database(s).","archived":false,"fork":false,"pushed_at":"2024-12-31T20:06:11.000Z","size":89,"stargazers_count":39,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T12:06:47.372Z","etag":null,"topics":["quart"],"latest_commit_sha":null,"homepage":"","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/pgjones.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-03-25T09:11:51.000Z","updated_at":"2025-03-22T10:46:32.000Z","dependencies_parsed_at":"2023-02-08T08:01:49.914Z","dependency_job_id":"f2382ff3-1d2a-4d58-84c1-bb073bd422b2","html_url":"https://github.com/pgjones/quart-db","commit_stats":{"total_commits":35,"total_committers":4,"mean_commits":8.75,"dds":"0.11428571428571432","last_synced_commit":"ffcb2c032747aeb1da8a21f39be1fbc90675fb06"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgjones%2Fquart-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgjones%2Fquart-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgjones%2Fquart-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgjones%2Fquart-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgjones","download_url":"https://codeload.github.com/pgjones/quart-db/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485287,"owners_count":20946398,"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":["quart"],"created_at":"2024-11-06T10:29:26.388Z","updated_at":"2025-04-06T13:09:20.542Z","avatar_url":"https://github.com/pgjones.png","language":"Python","readme":"Quart-DB\n========\n\n|Build Status| |docs| |pypi| |python| |license|\n\nQuart-DB is a Quart extension that provides managed connection(s) to\npostgresql or sqlite database(s).\n\nQuickstart\n----------\n\nQuart-DB is used by associating it with an app and a DB (via a URL)\nand then utilising the ``g.connection`` connection,\n\n.. code-block:: python\n\n   from quart import g, Quart, websocket\n   from quart_db import QuartDB\n\n   app = Quart(__name__)\n   db = QuartDB(app, url=\"postgresql://user:pass@localhost:5432/db_name\")\n\n   @app.get(\"/\u003cint:id\u003e\")\n   async def get_count(id: int):\n       result = await g.connection.fetch_val(\n           \"SELECT COUNT(*) FROM tbl WHERE id = :id\",\n           {\"id\": id},\n       )\n       return {\"count\": result}\n\n   @app.post(\"/\")\n   async def set_with_transaction():\n       async with g.connection.transaction():\n           await db.execute(\"UPDATE tbl SET done = :done\", {\"done\": True})\n           ...\n       return {}\n\n   @app.get(\"/explicit\")\n   async def explicit_usage():\n        async with db.connection() as connection:\n            ...\n\nContributing\n------------\n\nQuart-DB is developed on `GitHub\n\u003chttps://github.com/pgjones/quart-db\u003e`_. If you come across an issue,\nor have a feature request please open an `issue\n\u003chttps://github.com/pgjones/quart-db/issues\u003e`_. If you want to\ncontribute a fix or the feature-implementation please do (typo fixes\nwelcome), by proposing a `merge request\n\u003chttps://github.com/pgjones/quart-db/merge_requests\u003e`_.\n\nTesting\n~~~~~~~\n\nThe best way to test Quart-DB is with `Tox\n\u003chttps://tox.readthedocs.io\u003e`_,\n\n.. code-block:: console\n\n    $ pip install tox\n    $ tox\n\nthis will check the code style and run the tests.\n\nHelp\n----\n\nThe Quart-DB `documentation\n\u003chttps://quart-db.readthedocs.io/en/latest/\u003e`_ is the best places to\nstart, after that try searching `stack overflow\n\u003chttps://stackoverflow.com/questions/tagged/quart\u003e`_ or ask for help\n`on gitter \u003chttps://gitter.im/python-quart/lobby\u003e`_. If you still\ncan't find an answer please `open an issue\n\u003chttps://github.com/pgjones/quart-db/issues\u003e`_.\n\n\n.. |Build Status| image:: https://github.com/pgjones/quart-db/actions/workflows/ci.yml/badge.svg\n   :target: https://github.com/pgjones/quart-db/commits/main\n\n.. |docs| image:: https://readthedocs.org/projects/quart-db/badge/?version=latest\u0026style=flat\n   :target: https://quart-db.readthedocs.io/en/latest/\n\n.. |pypi| image:: https://img.shields.io/pypi/v/quart-db.svg\n   :target: https://pypi.python.org/pypi/Quart-DB/\n\n.. |python| image:: https://img.shields.io/pypi/pyversions/quart-db.svg\n   :target: https://pypi.python.org/pypi/Quart-DB/\n\n.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg\n   :target: https://github.com/pgjones/quart-db/blob/main/LICENSE\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgjones%2Fquart-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgjones%2Fquart-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgjones%2Fquart-db/lists"}