Class RowQueue (7.5.2)

Standard row queue used for inserting rows.

Package

@google-cloud/bigquery

Constructors

(constructor)(table, dup, options)

constructor(table: Table, dup: Stream, options?: InsertStreamOptions);

Constructs a new instance of the RowQueue class

Parameters
NameDescription
table Table
dup Stream
options InsertStreamOptions

Properties

batch

batch: RowBatch;

batchOptions

batchOptions?: RowBatchOptions;

inFlight

inFlight: boolean;

insertRowsOptions

insertRowsOptions: InsertRowsOptions;

pending

pending?: ReturnType<typeof setTimeout>;

stream

stream: Stream;

table

table: Table;

Methods

_insert(rows, callbacks, cb)

_insert(rows: RowMetadata | RowMetadata[], callbacks: InsertRowsCallback[], cb?: InsertRowsCallback): void;

Accepts a batch of rows and inserts them into table.

Parameters
NameDescription
rows RowMetadata | RowMetadata[]

The rows to insert.

callbacks InsertRowsCallback_2[]

The corresponding callback functions.

cb InsertRowsCallback
Returns
TypeDescription
void

add(row, callback)

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

Adds a row to the queue.

Parameters
NameDescription
row RowMetadata

The row to insert.

callback InsertRowsCallback

The insert callback.

Returns
TypeDescription
void

getOptionDefaults()

getOptionDefaults(): RowBatchOptions;
Returns
TypeDescription
RowBatchOptions

insert(callback)

insert(callback?: InsertRowsCallback): void;

Cancels any pending inserts and calls _insert immediately.

Parameter
NameDescription
callback InsertRowsCallback
Returns
TypeDescription
void

setOptions(options)

setOptions(options?: RowBatchOptions): void;

Sets the batching options.

Parameter
NameDescription
options RowBatchOptions

The batching options.

Returns
TypeDescription
void