Standard row queue used for inserting rows.
Package
@google-cloud/bigqueryConstructors
(constructor)(table, dup, options)
constructor(table: Table, dup: Stream, options?: InsertStreamOptions);Constructs a new instance of the RowQueue class
| Parameters | |
|---|---|
| Name | Description |
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 | |
|---|---|
| Name | Description |
rows |
RowMetadata | RowMetadata[]
The rows to insert. |
callbacks |
InsertRowsCallback_2[]
The corresponding callback functions. |
cb |
InsertRowsCallback
|
| Returns | |
|---|---|
| Type | Description |
void |
|
add(row, callback)
add(row: RowMetadata, callback: InsertRowsCallback): void;Adds a row to the queue.
| Parameters | |
|---|---|
| Name | Description |
row |
RowMetadata
The row to insert. |
callback |
InsertRowsCallback
The insert callback. |
| Returns | |
|---|---|
| Type | Description |
void |
|
getOptionDefaults()
getOptionDefaults(): RowBatchOptions;| Returns | |
|---|---|
| Type | Description |
RowBatchOptions |
|
insert(callback)
insert(callback?: InsertRowsCallback): void;Cancels any pending inserts and calls _insert immediately.
| Parameter | |
|---|---|
| Name | Description |
callback |
InsertRowsCallback
|
| Returns | |
|---|---|
| Type | Description |
void |
|
setOptions(options)
setOptions(options?: RowBatchOptions): void;Sets the batching options.
| Parameter | |
|---|---|
| Name | Description |
options |
RowBatchOptions
The batching options. |
| Returns | |
|---|---|
| Type | Description |
void |
|