{"id":16543175,"url":"https://github.com/codemation/aiopyql","last_synced_at":"2025-03-16T19:32:26.375Z","repository":{"id":46014323,"uuid":"279277966","full_name":"codemation/aiopyql","owner":"codemation","description":"A fast and easy-to-use asyncio ORM(Object-relational Mapper) for performing C.R.U.D. ops within RBDMS tables using python.","archived":false,"fork":false,"pushed_at":"2021-06-05T06:46:23.000Z","size":364,"stargazers_count":34,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-12T18:59:32.757Z","etag":null,"topics":["asyncio","asyncio-orm","database","mysql","orm","orm-framework","postgres","python","python3"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/aiopyql/","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/codemation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.MD","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-13T11:00:53.000Z","updated_at":"2023-03-19T01:53:07.000Z","dependencies_parsed_at":"2022-09-14T11:13:05.581Z","dependency_job_id":null,"html_url":"https://github.com/codemation/aiopyql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemation%2Faiopyql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemation%2Faiopyql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemation%2Faiopyql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemation%2Faiopyql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemation","download_url":"https://codeload.github.com/codemation/aiopyql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221667463,"owners_count":16860621,"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":["asyncio","asyncio-orm","database","mysql","orm","orm-framework","postgres","python","python3"],"created_at":"2024-10-11T18:59:33.705Z","updated_at":"2024-10-27T11:10:48.915Z","avatar_url":"https://github.com/codemation.png","language":"Python","readme":"![](./images/logo.png)\n\n# \n\u003ch3\u003e\nA fast and easy-to-use asyncio ORM(Object-relational Mapper) for performing C.R.U.D. ops within RBDMS tables using python. \n\u003c/h3\u003e\n\n[![Documentation Status](https://readthedocs.org/projects/aiopyql/badge/?version=latest)](https://aiopyql.readthedocs.io/en/latest/?badge=latest)\n [![PyPI version](https://badge.fury.io/py/aiopyql.svg)](https://pypi.org/project/aiopyql/)\n\n#\n## Key Features\n- asyncio ready \n- database / table query cache\n- SQL-like query syntax\n- Automatic schema discovery / migrations\n\n#\n## Documentation\n[https://aiopyql.readthedocs.io/](https://aiopyql.readthedocs.io/)\n\n#\n\n### Instalation\n```bash\n$ virtualenv -p python3.7 aiopyql-env\n\n$ source aiopyql-env/bin/activate\n```\n```bash\n(aiopyql-env)$ pip install aiopyql\n```\n#\n### Compatable Databases\n- postgres - via [asyncpg](https://github.com/MagicStack/asyncpg)\n- mysql - via [aiomysql](https://github.com/aio-libs/aiomysql)\n- sqlite - via [aiosqlite](https://github.com/omnilib/aiosqlite)\n\n#\n## Getting Started \n```python\nimport asyncio\nfrom aiopyql import data\n\nasync def main():\n\n    #sqlite connection\n    sqlite_db = await data.Database.create(\n        database=\"testdb\"\n    )\n    \n    # create table\n    await db.create_table(\n        'keystore',\n        [\n            ('key', str, 'UNIQUE NOT NULL'),\n            ('value', str)\n        ],\n        'key',\n        cache_enabled=True\n    )\n\n    # insert\n    await db.tables['keystore'].insert(\n        key='foo',\n        value={'bar': 30}\n    )\n    \n    # update\n    await db.tables['keystore'].update(\n        value={'bar': 31},\n        where={'key': 'foo'}\n    )\n\n    # delete\n    await db.tables['keystore'].delete(\n        where={'key': 'foo'}\n    )\nloop = asyncio.new_event_loop()\nloop.run_until_complete(main())\n```\n#\n## Recipies\nSee other usage examples in [recipies](https://github.com/codemation/aiopyql/blob/master/recipies).\n\u003cbr\u003e\n- [FastAPI](https://github.com/codemation/aiopyql/blob/master/recipies/fastapi_aiopyql.py)\n\n#\n## Postgres\n\n```python\nimport asyncio\nfrom aiopyql import data\n\nasync def main():\n    mysql_db = await data.Database.create(\n        database='postgres_database',\n        user='postgres',\n        password='my-secret-pw',\n        host='localhost',\n        port=5432,\n        db_type='postgres'\n    )\n\nloop = asyncio.new_event_loop()\nloop.run_until_complete(main())\n```\n#\n## Mysql\n\n```python\nimport asyncio\nfrom aiopyql import data\n\nasync def main():\n    mysql_db = await data.Database.create(\n        database='mysql_database',\n        user='mysqluser',\n        password='my-secret-pw',\n        host='localhost',\n        port=3306,\n        db_type='mysql'\n    )\n\nloop = asyncio.new_event_loop()\nloop.run_until_complete(main())\n```\n#\n## Idea / Suggestion / Issue\n- Submit an Issue\n- Create a Pull request ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemation%2Faiopyql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemation%2Faiopyql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemation%2Faiopyql/lists"}