bigquery@1.1.2
Functions
- execute(operations) ⇒
Operation
Execute a sequence of operations. Wraps
language-common/execute
, and prepends initial state for http.- load(dirPath, projectId, datasetId, tableId, loadOptions, callback) ⇒
Operation
Load files to BigQuery
- parseCSV(target, config) ⇒
Operation
CSV-Parse for CSV conversion to JSON
execute(operations) ⇒ Operation
Execute a sequence of operations.
Wraps language-common/execute
, and prepends initial state for http.
Kind: global function
Param | Type | Description |
---|---|---|
operations | Operations | Operations to be performed. |
Example
execute(
create('foo'),
delete('bar')
)(state)
load(dirPath, projectId, datasetId, tableId, loadOptions, callback) ⇒ Operation
Load files to BigQuery
Kind: global function
Access: public
Param | Type | Description |
---|---|---|
dirPath | string | the path to your local directory |
projectId | string | your bigquery project id |
datasetId | string | your bigquery dataset id |
tableId | string | the name of the table you'd like to load |
loadOptions | object | options to pass to the bigquery.load() API |
callback | function | and optional callback |
Example
load(
'./tmp/files',
'my-bg-project',
'test01',
'product-codes',
{
schema: 'FREQ:STRING,DATATYPE:STRING,PRODUCTCODE:STRING,PARTNER:STRING',
writeDisposition: 'WRITE_APPEND',
skipLeadingRows: 1,
schemaUpdateOptions: ['ALLOW_FIELD_ADDITION'],
createDisposition: 'CREATE_IF_NEEDED',
}
)
parseCSV(target, config) ⇒ Operation
CSV-Parse for CSV conversion to JSON
Kind: global function
Access: public
Param | Type | Description |
---|---|---|
target | String | string or local file with CSV data |
config | Object | csv-parse config object |
Example
parseCSV("/home/user/someData.csv", {
quoteChar: '"',
header: false,
});