{"id":28854213,"url":"https://github.com/commaai/aiomysql","last_synced_at":"2026-01-20T16:25:19.149Z","repository":{"id":65984933,"uuid":"196653537","full_name":"commaai/aiomysql","owner":"commaai","description":"Fork of aiomysql supporting Python 3.7","archived":false,"fork":false,"pushed_at":"2019-07-12T23:08:45.000Z","size":986,"stargazers_count":0,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-19T22:09:11.744Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commaai.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.txt","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-12T22:34:26.000Z","updated_at":"2023-07-25T14:27:24.000Z","dependencies_parsed_at":"2023-02-19T18:45:27.652Z","dependency_job_id":null,"html_url":"https://github.com/commaai/aiomysql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/commaai/aiomysql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commaai%2Faiomysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commaai%2Faiomysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commaai%2Faiomysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commaai%2Faiomysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commaai","download_url":"https://codeload.github.com/commaai/aiomysql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commaai%2Faiomysql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28606996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-06-19T22:09:11.842Z","updated_at":"2026-01-20T16:25:19.137Z","avatar_url":"https://github.com/commaai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"aiomysql\n========\n.. image:: https://travis-ci.com/aio-libs/aiomysql.svg?branch=master\n    :target: https://travis-ci.com/aio-libs/aiomysql\n.. image:: https://codecov.io/gh/aio-libs/aiomysql/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/aio-libs/aiomysql\n    :alt: Code coverage\n.. image:: https://badge.fury.io/py/aiomysql.svg\n    :target: https://badge.fury.io/py/aiomysql\n    :alt: Latest Version\n.. image:: https://readthedocs.org/projects/aiomysql/badge/?version=latest\n    :target: https://aiomysql.readthedocs.io/\n    :alt: Documentation Status\n.. image:: https://badges.gitter.im/Join%20Chat.svg\n    :target: https://gitter.im/aio-libs/Lobby\n    :alt: Chat on Gitter\n\n**aiomysql** is a \"driver\" for accessing a `MySQL` database\nfrom the asyncio_ (PEP-3156/tulip) framework. It depends on and reuses most\nparts of PyMySQL_ . *aiomysql* tries to be like awesome aiopg_ library and\npreserve same api, look and feel.\n\nInternally **aiomysql** is copy of PyMySQL, underlying io calls switched\nto async, basically ``yield from`` and ``asyncio.coroutine`` added in\nproper places)). `sqlalchemy` support ported from aiopg_.\n\n\nDocumentation\n-------------\nhttps://aiomysql.readthedocs.io/\n\n\nMailing List\n------------\nhttps://groups.google.com/forum/#!forum/aio-libs\n\n\nBasic Example\n-------------\n\n**aiomysql** based on PyMySQL_ , and provides same api, you just need\nto use  ``await conn.f()`` or ``yield from conn.f()`` instead of calling\n``conn.f()`` for every method.\n\nProperties are unchanged, so ``conn.prop`` is correct as well as\n``conn.prop = val``.\n\n.. code:: python\n\n    import asyncio\n    import aiomysql\n\n\n    async def test_example(loop):\n        pool = await aiomysql.create_pool(host='127.0.0.1', port=3306,\n                                          user='root', password='',\n                                          db='mysql', loop=loop)\n        async with pool.acquire() as conn:\n            async with conn.cursor() as cur:\n                await cur.execute(\"SELECT 42;\")\n                print(cur.description)\n                (r,) = await cur.fetchone()\n                assert r == 42\n        pool.close()\n        await pool.wait_closed()\n\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(test_example(loop))\n\n\nExample of SQLAlchemy optional integration\n------------------------------------------\nSqlalchemy support has been ported from aiopg_ so api should be very familiar\nfor aiopg_ user.:\n\n.. code:: python\n\n    import asyncio\n    import sqlalchemy as sa\n\n    from aiomysql.sa import create_engine\n\n\n    metadata = sa.MetaData()\n\n    tbl = sa.Table('tbl', metadata,\n                   sa.Column('id', sa.Integer, primary_key=True),\n                   sa.Column('val', sa.String(255)))\n\n\n    async def go(loop):\n        engine = await create_engine(user='root', db='test_pymysql',\n                                     host='127.0.0.1', password='', loop=loop)\n        async with engine.acquire() as conn:\n            await conn.execute(tbl.insert().values(val='abc'))\n            await conn.execute(tbl.insert().values(val='xyz'))\n\n            async for row in conn.execute(tbl.select()):\n                print(row.id, row.val)\n\n        engine.close()\n        await engine.wait_closed()\n\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(go(loop))\n\n\nRequirements\n------------\n\n* Python_ 3.5.3+\n* PyMySQL_\n\n\n.. _Python: https://www.python.org\n.. _asyncio: http://docs.python.org/3.4/library/asyncio.html\n.. _aiopg: https://github.com/aio-libs/aiopg\n.. _PyMySQL: https://github.com/PyMySQL/PyMySQL\n.. _Tornado-MySQL: https://github.com/PyMySQL/Tornado-MySQL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommaai%2Faiomysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommaai%2Faiomysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommaai%2Faiomysql/lists"}