How to use the @google-cloud/bigquery.dataset function in @google-cloud/bigquery

To help you get started, we’ve selected a few @google-cloud/bigquery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github firebase / functions-samples / bigquery-import / functions / index.js View on Github external
exports.addtobigquery = functions.database.ref('/logs/$logid').onWrite(event => {
  // TODO: Make sure you set the `bigquery.datasetName` Google Cloud environment variable.
  const dataset = bigquery.dataset(functions.config().bigquery.datasetname);
  // TODO: Make sure you set the `bigquery.tableName` Google Cloud environment variable.
  const table = dataset.table(functions.config().bigquery.tablename);

  return table.insert({
    ID: event.data.key,
    MESSAGE: event.data.val().message,
    NUMBER: event.data.val().number
  });
});

@google-cloud/bigquery

Google BigQuery Client Library for Node.js

Apache-2.0
Latest version published 3 months ago

Package Health Score

86 / 100
Full package analysis