Skip to main content

Module stream

Module stream 

Source
Expand description

True PG-level streaming query results.

QueryStream uses the extended query protocol’s Execute(max_rows=N) to fetch rows in chunks from PostgreSQL. Only one chunk is in memory at a time — the arena is reset between chunks.

The connection is held for the lifetime of the stream. When the stream is dropped (whether fully consumed or not), the connection returns to the pool. If the stream is dropped mid-iteration, the connection is discarded (not returned to the pool) because the portal may still be open on the server.

Structs§

QueryStream
A stream of rows backed by true PG-level chunked fetching.