{"id":23552250,"url":"https://github.com/taskiq-python/taskiq-psqlpy","last_synced_at":"2025-04-28T13:32:17.599Z","repository":{"id":229796248,"uuid":"777432863","full_name":"taskiq-python/taskiq-psqlpy","owner":"taskiq-python","description":"Result backend for TaskIQ with PostgreSQL and PSQLPy","archived":false,"fork":false,"pushed_at":"2025-01-04T06:37:10.000Z","size":205,"stargazers_count":8,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T04:35:00.262Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taskiq-python.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-03-25T20:57:11.000Z","updated_at":"2025-03-18T18:38:28.000Z","dependencies_parsed_at":"2024-11-08T20:23:11.774Z","dependency_job_id":"ebd94c58-2b1c-45c5-9de4-01d1ed5a24ca","html_url":"https://github.com/taskiq-python/taskiq-psqlpy","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":0.4444444444444444,"last_synced_commit":"ecc360401b79e7e924a3e2d07acef7f67383e03d"},"previous_names":["taskiq-python/taskiq-psqlpy"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskiq-python%2Ftaskiq-psqlpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskiq-python%2Ftaskiq-psqlpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskiq-python%2Ftaskiq-psqlpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskiq-python%2Ftaskiq-psqlpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taskiq-python","download_url":"https://codeload.github.com/taskiq-python/taskiq-psqlpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251129479,"owners_count":21540663,"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":[],"created_at":"2024-12-26T11:09:46.174Z","updated_at":"2025-04-28T13:32:17.441Z","avatar_url":"https://github.com/taskiq-python.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TaskIQ - PSQLPy\n\nTaskIQ-PSQLPy is a plugin for taskiq that adds a new result backend based on PostgreSQL and [PSQLPy](https://github.com/qaspen-python/psqlpy).\n\n## Installation\nTo use this project you must have installed core taskiq library:\n```bash\npip install taskiq\n```\n\nThis project can be installed using pip:\n```bash\npip install taskiq-psqlpy\n```\n\nOr using poetry:\n```\npoetry add taskiq-psqlpy\n```\n\n## Usage\nLet's see the example with the redis broker and PostgreSQL PSQLPy result backend:\n```python\n# broker.py\nimport asyncio\n\nfrom taskiq_redis import ListQueueBroker\nfrom taskiq_psqlpy import PSQLPyResultBackend\n\npsqlpy_result_backend = PSQLPyResultBackend(\n    dsn=\"postgres://postgres:postgres@localhost:5432/postgres\",\n)\n\n# Or you can use PubSubBroker if you need broadcasting\nbroker = ListQueueBroker(\n    url=\"redis://localhost:6379\",\n    result_backend=psqlpy_result_backend,\n)\n\n\n@broker.task\nasync def best_task_ever() -\u003e None:\n    \"\"\"Solve all problems in the world.\"\"\"\n    await asyncio.sleep(5.5)\n    print(\"All problems are solved!\")\n\n\nasync def main():\n    await broker.startup()\n    task = await best_task_ever.kiq()\n    print(await task.wait_result())\n    await broker.shutdown()\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## PSQLPyResultBackend configuration\n- `dsn`: connection string to PostgreSQL.\n- `keep_results`: flag to not remove results from Redis after reading.\n- `table_name`: name of the table in PostgreSQL to store TaskIQ results.\n- `field_for_task_id`: type of a field for `task_id`, you may need it if you want to have length of task_id more than 255 symbols.\n- `**connect_kwargs`: additional connection parameters, you can read more about it in [PSQLPy](https://github.com/qaspen-python/psqlpy) repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaskiq-python%2Ftaskiq-psqlpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaskiq-python%2Ftaskiq-psqlpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaskiq-python%2Ftaskiq-psqlpy/lists"}