// the find
aio-libs/aiomysql
aiomysql is a library for accessing a MySQL database from the asyncio
aiomysql wraps PyMySQL for asyncio, giving you async/await MySQL access without blocking the event loop. It also ports aiopg's SQLAlchemy integration, so you can use SA core expressions against MySQL asynchronously. Aimed at Python developers who are committed to MySQL and need async I/O in an asyncio-based service.
The PyMySQL lineage means it inherits a mature, well-tested protocol implementation rather than reimplementing the MySQL wire protocol from scratch. SQLAlchemy core integration is a genuine plus — you get parameterized queries and expression building without the full ORM overhead. The test suite is thorough: separate test files per feature (cursors, pool, SSL, SA transactions, bulk inserts) and a docker-compose setup for running against a real MySQL instance. Active maintenance from aio-libs, which has a decent track record of keeping asyncio libraries current.
The implementation is described in the README itself as 'copy of PyMySQL with yield from added in proper places' — that's honest but not flattering; it means async is bolted on rather than designed from the ground up, and you occasionally feel it in edge cases around cancellation and connection state. The SQLAlchemy integration is SA Core only and targets the legacy 1.x-style API, not SQLAlchemy 2.0's async extension — if you're on modern SA, aiomysql's sa module will feel dated compared to asyncpg + SA's native async support. Under 2k stars for a library that's been around since 2015 suggests the ecosystem quietly prefers Postgres for async Python work, which is worth factoring in if you're choosing a database. Documentation is functional but thin on anything beyond the basics — connection pooling tuning, error handling strategies, and MariaDB-specific behavior are largely undocumented.