{"id":28065,"library":"psqlpy","title":"psqlpy","description":"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.","status":"active","version":"0.11.12","language":"python","source_language":"en","source_url":"https://github.com/nickolay/psqlpy","tags":["postgresql","async","rust","driver"],"install":[{"cmd":"pip install psqlpy","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install psqlpy[uvloop]","lang":"bash","label":"Install with uvloop support"}],"dependencies":[{"reason":"Optional dependency for event loop optimization; install via extra.","package":"uvloop","optional":true}],"imports":[{"note":"Pre-0.10 naming; renamed in 0.10.0","wrong":"from psqlpy import ConnectionPool","symbol":"AsyncPool","correct":"from psqlpy import AsyncPool"},{"note":"Top-level module; fine to import directly.","wrong":"","symbol":"psqlpy","correct":"import psqlpy"}],"quickstart":{"code":"import asyncio\nimport os\nfrom psqlpy import AsyncPool\n\nasync def main():\n    pool = AsyncPool(\n        dsn=os.environ.get(\"DATABASE_URL\", \"postgresql://user:pass@localhost/db\"),\n        max_size=10\n    )\n    result = await pool.execute(\"SELECT 1\")\n    print(result)\n    await pool.close()\n\nasyncio.run(main())","lang":"python","description":"Basic async query using connection pool."},"warnings":[{"fix":"Use from psqlpy import AsyncPool instead.","message":"Renamed ConnectionPool to AsyncPool in 0.10.0; old name no longer works.","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"Use 'async with pool' or ensure pool.close() is called after use.","message":"Pool must be explicitly closed or used as async context manager to avoid hanging connections.","severity":"gotcha","affected_versions":"all"},{"fix":"Always 'await pool.execute(...)' or 'await conn.fetch(...)'.","message":"All queries must be awaited; forgetting await returns a coroutine object, not results.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Add await before the call, e.g., await pool.execute('SELECT 1')","cause":"Missing await on async function call.","error":"TypeError: 'coroutine' object is not subscriptable"},{"fix":"Use 'from psqlpy import AsyncPool'","cause":"ConnectionPool renamed to AsyncPool in version 0.10.0.","error":"ImportError: cannot import name 'ConnectionPool' from 'psqlpy'"},{"fix":"Ensure pool is still open before queries; use context manager to handle lifecycle.","cause":"Attempting to use the pool after it has been closed.","error":"psqlpy.exceptions.PoolError: Pool is closed"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}