asyncpg
asyncpg copied to clipboard
A fast PostgreSQL Database Client Library for Python/asyncio.
1. please consider inclusion of cluster connection pool with automatic fail-over, i.e. https://gist.github.com/Andrei-Pozolotin/f5be7dec56840428c6245a1cef4a25eb 2. the basic idea is to run per-cluster-member connection ping tasks in background and select next best...
I'm using asyncpg to connect my database in Heroku postgresql, using python: ``` import asyncpg async def create_db_pool(): bot.pg_con = await asyncpg.create_pool(dsn="postgres://....", host="....amazonaws.com", user="xxx", database="yyy", port="5432", password="12345") ``` it was...
The documentation for [`asyncpg.pool.Pool.set_connect_args`](https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.Pool.set_connect_args) makes no mention that there are 2 particular kwargs that are _already_ being passed to [`connect`](https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.connection.connect) by the pool when it creates new connections: https://github.com/MagicStack/asyncpg/blob/92c2d81256a1efd8cab12c0118d74ccd1c18131b/asyncpg/pool.py#L459-L463 Before...
MagicStack is a company of software engineers specializing in modern reactive web technologies, based in Toronto. They focus on building applications and backends using cutting-edge technologies.
``` def _notification_callback(self, _, pid, channel, payload): LOG.info("_notification_callback invoked", channel=channel, pid=pid, payload_preview=str(payload)[:100]) print(f"Notification callback invoked for channel: {channel}, pid: {pid}, payload: {payload}") # Create a task to process this notification...
Address type introspection failures with QuestDB due to its lack of recursive CTE support. This primarily impacts types not built into asyncpg, such as float8[]. This commit: - Automatically registers...
Wouldn't it be natural that executing a script with only comments is a no-op returning OK? Such that for example commenting out the contents of a migration script while developing...
In particular, Python 3.13 is not presently listed in the classifiers in [`pyproject.toml`](https://github.com/MagicStack/asyncpg/blob/master/pyproject.toml#L13-L29). Lack of documented support is preventing updates to Python 3.13 on projects for which `asyncpg` is a...
I have a long-running script which initializes an asyncpg.Pool at the start of the script, then spawns a ton of tasks on an eventloop which occasionally acquire a connection, write...
This PR introduces the `connection_holder_class` parameter to the `Pool` class, enabling developers to plug in custom logic for managing individual connections — including acquisition, release, and lifecycle control. This added...