Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

StreamingQueryResult

import { StreamingQueryResult } from "https://raw.githubusercontent.com/jakajancar/pgc4d/master/src/mod.ts";

A streaming result.

To free up the connection, an iterator should be retrieved from the response object and either next() called enough times to reach done: true or return()/throw() called to cancel the query.

The for-await-of loop handles this for you automatically.

class StreamingQueryResult extends QueryResult {
constructor(columns: ColumnMetadata[], stream: AsyncGenerator<IndexedRow, CompletionInfo>);
private _unconsumed?: AsyncGenerator<IndexedRow, CompletionInfo>;
completionInfo: CompletionInfo | undefined;
get indexedRowsIterator(): AsyncIterableIterator<IndexedRow>;
 
async buffer(): Promise<BufferedQueryResult>;
}

§Extends

§
QueryResult
[src]

§Constructors

§
new StreamingQueryResult(columns: ColumnMetadata[], stream: AsyncGenerator<IndexedRow, CompletionInfo>)
[src]

§Properties

§
_unconsumed: AsyncGenerator<IndexedRow, CompletionInfo>
[src]
§
completionInfo: CompletionInfo | undefined
[src]
§
indexedRowsIterator: AsyncIterableIterator<IndexedRow> readonly
[src]

§Methods

§
buffer(): Promise<BufferedQueryResult>
[src]

Reads the result to completion and returns a BufferedQueryResult.