Repository navigation
v1.0.2 – async-safe PgPool recycling, COPY streaming, cursor chunking
Added
-
High-volume COPY support:
copy_in_start,copy_in_send_chunk,copy_in_finishcopy_out_start,copy_out_read_chunk- New
PgCopyResulttype withrows_affectedand structured error info
-
Server-side cursor streaming:
cursor_declare,cursor_fetch_chunk,cursor_close- New
PgCursorChunktype for incremental FETCH FORWARD - Supports chunked iteration over large result sets without loading them fully
-
Async connection return path:
PgPool::release_connection_async()drains pending libpq results before reusing a connectionPgTransactionnow always uses the async release path oncommit(),rollback(),finish(),abort()
Changed
-
PgPool::release_connection()now enforces "idle or die":- a connection is only recycled if it is fully idle (no pending PGresult / no busy libpq state)
- if not idle, the connection is retired and
live_count_is decremented - this prevents the classic libpq race
"another command is already in progress"when multiple coroutines reuse the same physical PGconn
-
Connection lifecycle is now explicit:
- dirty connections are not put back into the idle queue
- the pool transparently creates a fresh connection later when needed
Docs
-
pool.mdupdated with:- connection lifecycle
- dirty connection retirement
- async vs sync release semantics
- COPY / cursor overview
-
transaction.mdupdated with:- transaction lifecycle
- safe handoff back to the pool via
release_connection_async - subtransaction behavior
-
results.mdupdated with:PgCopyResultPgCursorChunk- structured error reporting for COPY and cursor streaming
-
quickstart.mdupdated with:- COPY IN / COPY OUT examples
- cursor-based chunked fetch example
- transaction usage with coroutines
Impact
- Safer concurrent use of the pool across many coroutines/threads
- No more "in-progress" libpq errors leaking between unrelated tasks
- First-class bulk data ingest/export and incremental result streaming