Class RowBatch (7.5.2)

Call used to help batch rows.

Package

@google-cloud/bigquery

Constructors

(constructor)(options)

constructor(options: RowBatchOptions);

Constructs a new instance of the RowBatch class

Parameter
NameDescription
options RowBatchOptions

Properties

batchOptions

batchOptions: RowBatchOptions;

bytes

bytes: number;

callbacks

callbacks: InsertRowsCallback[];

created

created: number;

rows

rows: RowMetadata[];

Methods

add(row, callback)

add(row: RowMetadata, callback?: InsertRowsCallback): void;

Adds a row to the current batch.

Parameters
NameDescription
row RowMetadata

The row to insert.

callback InsertRowsCallback

The callback function.

Returns
TypeDescription
void

canFit(row)

canFit(row: RowMetadata): boolean;

Indicates if a given row can fit in the batch.

Parameter
NameDescription
row RowMetadata

The row in question.

Returns
TypeDescription
boolean

{boolean}

isAtMax()

isAtMax(): boolean;

Checks to see if this batch is at the maximum allowed payload size.

Returns
TypeDescription
boolean

{boolean}

isFull()

isFull(): boolean;

Indicates if the batch is at capacity.

Returns
TypeDescription
boolean

{boolean}