Registry / database / psqlpy

psqlpy

JSON →
library0.11.12pypypi✓ verified 82d ago

psqlpy is an async PostgreSQL driver for Python written in Rust, offering high performance and full async/await support. Current version is 0.11.12, with active development and regular releases.

pip install psqlpy
INSTALL
IMPORT
SIG · PSQLPY
P
psqlpy
databasepythonv0.11.12
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.

Connection
from psqlpy import Connection
from psqlpy import AsyncPool
connect
from psqlpy import connect
from psqlpy import AsyncPool
ConnectionPool
from psqlpy import ConnectionPool
from psqlpy import AsyncPool

Basic async query using connection pool.

import asyncio import os from psqlpy import AsyncPool async def main(): pool = AsyncPool( dsn=os.environ.get("DATABASE_URL", "postgresql://user:pass@localhost/db"), max_size=10 ) result = await pool.execute("SELECT 1") print(result) await pool.close() asyncio.run(main())
Debug
Known issues
breakingRenamed ConnectionPool to AsyncPool in 0.10.0; old name no longer works.
fix
Use from psqlpy import AsyncPool instead.
affects: >=0.10.0
gotchaPool must be explicitly closed or used as async context manager to avoid hanging connections.
fix
Use 'async with pool' or ensure pool.close() is called after use.
affects: all
gotchaAll queries must be awaited; forgetting await returns a coroutine object, not results.
fix
Always 'await pool.execute(...)' or 'await conn.fetch(...)'.
affects: all
Upgrade
Version history
0.11.12latest on PyPI · released Apr 5, 2026
Audit
Dependencies
uvloopoptionalOptional dependency for event loop optimization; install via extra.
Agent activity
10 hits · last 30 days
node
10
Resources