Skip to main content

parse_query_response_borrowed

Function parse_query_response_borrowed 

Source
pub fn parse_query_response_borrowed(
    payload: &[u8],
    capabilities: ClientCapabilities,
    columns: &[ColumnMetadata],
    previous_row: Option<&[Option<QueryValue>]>,
) -> Result<BorrowedFetchResult>
Expand description

Walk a fetch/query response payload and produce a BorrowedFetchResult whose rows borrow payload (the caller must keep the owned buffer alive — BorrowedRowBatch owns it). This is the zero-copy companion to parse_fetch_response_with_context: it walks the exact same message framing (DESCRIBE_INFO / ROW_HEADER / BIT_VECTOR / ROW_DATA / ERROR / END_OF_RESPONSE) but, instead of materializing owned rows, records each row’s byte offset and bit vector so BorrowedRowBatch::for_each_row_ref can decode them lazily and without per-cell allocation.

Scope: the plain query-row case (the fetch path). Out-bind / DML-returning rows are not part of a fetch response and are left to the owned path.