import duckdb from '@duckdb/node-bindings'; import { DuckDBType } from './DuckDBType'; import { DuckDBValueConverter } from './DuckDBValueConverter'; import { ToDuckDBValueConverter } from './ToDuckDBValueConverter'; import { DuckDBVector } from './DuckDBVector'; import { DuckDBValue } from './values'; export declare class DuckDBDataChunk { readonly chunk: duckdb.DataChunk; private readonly vectors; constructor(chunk: duckdb.DataChunk); static create(types: readonly DuckDBType[], rowCount?: number): DuckDBDataChunk; reset(): void; get columnCount(): number; get rowCount(): number; set rowCount(count: number); /** * Refuses a column count that does not match the chunk's. * * A short array would leave the remaining vectors never written and never * flushed while the chunk reports a non-zero row count, and reading or * appending it then crashes the process instead of raising. */ private assertColumnCount; getColumnVector(columnIndex: number): DuckDBVector; visitColumnValues(columnIndex: number, visitValue: (value: DuckDBValue, rowIndex: number, columnIndex: number, type: DuckDBType) => void): void; appendColumnValues(columnIndex: number, values: DuckDBValue[]): void; getColumnValues(columnIndex: number): DuckDBValue[]; convertColumnValues(columnIndex: number, converter: DuckDBValueConverter): (T | null)[]; setColumnValues(columnIndex: number, values: readonly DuckDBValue[]): void; /** * `setColumnValues` with each value converted on the way in: the write * counterpart of `convertColumnValues`. * * The column's type comes from its vector, so the converter is the only * thing the caller supplies. */ setColumnValuesConverted(columnIndex: number, values: readonly (T | null)[], converter: ToDuckDBValueConverter): void; visitColumns(visitColumn: (column: DuckDBValue[], columnIndex: number, type: DuckDBType) => void): void; appendToColumns(columns: (DuckDBValue[] | undefined)[]): void; getColumns(): DuckDBValue[][]; convertColumns(converter: DuckDBValueConverter): (T | null)[][]; setColumns(columns: readonly (readonly DuckDBValue[])[]): void; /** * `setColumns` with each value converted on the way in: the write * counterpart of `convertColumns`. */ setColumnsConverted(columns: readonly (readonly (T | null)[])[], converter: ToDuckDBValueConverter): void; appendToColumnsObject(columnNames: readonly string[], columnsObject: Record): void; getColumnsObject(columnNames: readonly string[]): Record; visitColumnMajor(visitValue: (value: DuckDBValue, rowIndex: number, columnIndex: number, type: DuckDBType) => void): void; visitRowValues(rowIndex: number, visitValue: (value: DuckDBValue, rowIndex: number, columnIndex: number, type: DuckDBType) => void): void; appendRowValues(rowIndex: number, values: DuckDBValue[]): void; getRowValues(rowIndex: number): DuckDBValue[]; convertRowValues(rowIndex: number, converter: DuckDBValueConverter): (T | null)[]; visitRows(visitRow: (row: DuckDBValue[], rowIndex: number) => void): void; appendToRows(rows: DuckDBValue[][]): void; getRows(): DuckDBValue[][]; convertRows(converter: DuckDBValueConverter): (T | null)[][]; setRows(rows: readonly (readonly DuckDBValue[])[]): void; /** * `setRows` with each value converted on the way in: the write counterpart * of `convertRows`. * * Each column's type comes from its vector, so the converter is the only * thing the caller supplies. */ setRowsConverted(rows: readonly (readonly (T | null)[])[], converter: ToDuckDBValueConverter): void; appendToRowObjects(columnNames: readonly string[], rowObjects: Record[]): void; getRowObjects(columnNames: readonly string[]): Record[]; visitRowMajor(visitValue: (value: DuckDBValue, rowIndex: number, columnIndex: number, type: DuckDBType) => void): void; }