Class RowBatch (7.7.0)

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
Name Description
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
Name Description
row RowMetadata

The row to insert.

callback InsertRowsCallback

The callback function.

Returns
Type Description
void

canFit(row)

canFit(row: RowMetadata): boolean;

Indicates if a given row can fit in the batch.

Parameter
Name Description
row RowMetadata

The row in question.

Returns
Type Description
boolean

{boolean}

isAtMax()

isAtMax(): boolean;

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

Returns
Type Description
boolean

{boolean}

isFull()

isFull(): boolean;

Indicates if the batch is at capacity.

Returns
Type Description
boolean

{boolean}