Registry / database / asyncdb

asyncdb

JSON →
library2.15.8pypypi✓ verified 84d ago

Asynchronous database connection library for multiple backends (PostgreSQL, MySQL, SQLite, MongoDB, Redis, etc.). Current version: 2.15.8. Requires Python >=3.10. Release cadence: irregular, several releases per year.

pip install asyncdb
INSTALL
IMPORT
SIG · ASYNCDB
A
asyncdb
databasepythonv2.15.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AsyncDB
from asyncdb import AsyncDB
from asyncdb import asyncdb
The module name is asyncDB, but class is AsyncDB.
AsyncPool
from asyncdb import AsyncPool
from asyncdb.pool import AsyncPool
Pool is re‐exported from top-level.

Basic PostgreSQL connection and query.

import asyncio from asyncdb import AsyncDB async def main(): # Requires a running PostgreSQL instance db = AsyncDB('pg', dsn='postgresql://user:pass@localhost/dbname') async with await db.connection() as conn: result = await conn.fetch('SELECT version()') print(result) asyncio.run(main())
Debug
Known issues
breakingIn version 2.x, the driver names changed to lowercase (e.g., 'pg' instead of 'PG').
fix
Use lowercase driver names: 'pg', 'mysql', 'sqlite', etc.
affects: >=2.0.0
deprecatedThe 'asyncdb.pool' module is deprecated; use AsyncPool from 'asyncdb' directly.
fix
Import AsyncPool from 'asyncdb'.
affects: >=2.15.0
gotchaConnection context manager returns the connection, not a cursor. Use conn.fetch(), conn.execute() directly.
fix
Use async with await db.connection() as conn: then conn.fetch() etc.
affects: all
gotchaMany backends require extra dependencies (e.g., 'asyncpg', 'aiomysql'). Install with extras: pip install asyncdb[pg].
fix
Install the appropriate extra for each backend.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'asyncpg'
Missing dependency for PostgreSQL backend.
fix
pip install asyncdb[pg]
AttributeError: module 'asyncdb' has no attribute 'AsyncDB'
Old installation or wrong import path.
fix
Upgrade to version >=2.0.0 and use 'from asyncdb import AsyncDB'.
TypeError: object AsyncDB can't be used in 'await' expression
Calling AsyncDB() without await when using connection() method.
fix
Use 'await db.connection()' to get the connection.
Upgrade
Version history
2.15.8latest on PyPI · released Jun 4, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
asyncdb — pip install asyncdb · libregistry