Expand description
Lazy, cursor-based query result streams.
Today Session::execute drains the entire operator pipeline into a
QueryResult { rows: Vec<Vec<Value>> } before returning. For large result
sets this either exhausts memory or forces the caller to wait until the
final row has been produced before they can see the first one.
ResultStream exposes the pipeline lazily: the consumer pulls one
DataChunk (up to 2048 rows) at a time from the root operator. Dropping
the stream releases the operator tree and decrements the owning session’s
active_streams counter.
§Stability: Experimental
This module is new in 0.5.40. Signatures may change before being promoted
to Beta. Use from embedded callers that want first-row latency or bounded
memory; use Session::execute when you want a fully materialized result.
Structs§
- Owned
Result Stream - Binding-friendly result stream with no lifetime parameter.
- Owned
RowIterator - Row-level iterator over an
OwnedResultStream. - Result
Stream - Lazy, chunk-based result stream bound to a session’s lifetime.
- RowIterator
- Row-level iterator adapter over a
ResultStream.