qmetrics.net

aiomysql

Asyncio MySQL and MariaDB database driver for Python

aiomysql screenshot

aiomysql is a Python library that accesses MySQL databases from asyncio code, reusing PyMySQL APIs with async I/O and optional SQLAlchemy integration.

Overview

aiomysql provides a driver for talking to MySQL from the asyncio framework. It builds on PyMySQL internals with async calls added at the I/O boundary, and aims to mirror the aiopg style so methods are awaited instead of called synchronously while properties behave the same as in PyMySQL.

The library exposes asyncio DBAPI-like Connection, Cursor, and Pool objects for direct SQL use. An optional aiomysql.sa module ports SQLAlchemy functional SQL support from aiopg, including engine creation, inserts, selects, and async iteration over rows.

Installation is via pip and requires PyMySQL; the SQLAlchemy layer needs sqlalchemy installed separately. Documentation covers basic connection and pool examples, requirements of Python 3.9 or newer, and parity with PyMySQL calling conventions for application code.

The project is maintained on GitHub under the aio-libs ecosystem, uses continuous integration and coverage reporting, and is MIT licensed like PyMySQL.

Key features

  • Async MySQL connections and pools
  • PyMySQL-compatible method surface
  • Asyncio DBAPI-style cursor API
  • Optional SQLAlchemy engine integration
  • MIT license aligned with PyMySQL
  • Documented install via pip
  • GitHub Actions CI and coverage
  • Coroutine-based I/O on PyMySQL core

Use cases

  • Async web apps querying MySQL
  • High-concurrency database access in asyncio
  • SQLAlchemy async workloads on MySQL
  • Migrating synchronous PyMySQL call sites
  • Connection pooling in asyncio services

Tags

Similar software

Supabase

Open-source Postgres platform with auth, APIs, and storage

Supabase bundles a dedicated Postgres database with authentication, auto-generated REST and GraphQL APIs, realtime, functions, file storage, and vector tooling.

★ 115.6k⟳ todayApache-2.0
Open Source Alternative to:FirebaseFirebase Realtime Database

GORM

Feature-rich ORM library for Go applications

GORM maps Go structs to SQL databases with migrations, associations, hooks, and a fluent query API. It targets developer-friendly access patterns for common CRUD and relationship modeling.

★ 40k⟳ 1 month agoMIT
Frameworks & PlatformsDesktop/CLI app

TypeORM

TypeScript and JavaScript ORM for many SQL and NoSQL databases

TypeORM maps objects to relational and document databases from Node.js, browsers, and mobile shells. It supports TypeScript and JavaScript with both Data Mapper and Active Record styles.

★ 36.7k⟳ 3 days agoMIT
Frameworks & PlatformsDesktop/CLI app

MyBatis 3

Java SQL mapper with XML or annotation config

MyBatis links Java objects to SQL and stored procedures via XML or annotations. It trims repetitive JDBC parameter and result handling.

★ 20.4k⟳ yesterdayApache-2.0

Node Redis

High-performance Redis client for Node.js

node-redis connects Node.js applications to Redis with typed commands, clustering, pub/sub, transactions, and optional client-side caching.

★ 17.6k⟳ yesterdayMIT
Frameworks & PlatformsDesktop/CLI app

MyBatis-Plus

Enhanced MyBatis toolkit for Java database access

MyBatis-Plus extends MyBatis with code generation, conditional query builders, and pagination helpers. It stays compatible with MyBatis while adding convenience APIs for common CRUD work.

★ 17.5k⟳ todayApache-2.0
Frameworks & PlatformsDesktop/CLI app