AnnotatedCSVResponse provides various ways of how to process data from an annotated CSV response stream, which is returned as a result of a flux script execution.

interface AnnotatedCSVResponse {
    collectLines(): Promise<string[]>;
    collectRows<T>(
        rowMapper?: (
            values: string[],
            tableMeta: FluxTableMetaData,
        ) => undefined | T,
    ): Promise<T[]>;
    consumeLines(consumer: CommunicationObserver<string>): void;
    consumeRows(consumer: FluxResultObserver<string[]>): void;
    iterateLines(): AsyncIterable<string>;
    iterateRows(): AsyncIterable<Row>;
    lines(): Observable<string>;
    rows(): Observable<Row>;
}

Methods

  • CollectLines collects all result lines in the returned Promise. This method is suitable to collect simple results. Use with caution, a possibly huge stream of lines is copied to memory.

    Returns Promise<string[]>

    Promise of returned csv lines

  • CollectRows collects all the result rows in the returned Promise. This method is suitable to collect simple results. Use with caution, a possibly huge stream of results is copied to memory.

    Type Parameters

    • T

    Parameters

    • OptionalrowMapper: (values: string[], tableMeta: FluxTableMetaData) => undefined | T

      maps the supplied row to an item that is then collected, undefined return values are not collected. If no rowMapper is supplied, row => tableMeta.toObject(row.values) is used.

    Returns Promise<T[]>

    Promise of mapped results

MMNEPVFCICPMFPCPTTAAATR