Skip to content

Releases: googleapis/nodejs-bigquery

v0.8.0

15 Nov 21:32
Compare
Choose a tag to compare
$ npm install @google-cloud/bigquery@0.8.0

Fixes

v0.6.0

15 Nov 21:32
Compare
Choose a tag to compare

Update

$ npm install @google-cloud/bigquery@0.6.0

Features

Fixes

v0.5.0

15 Nov 21:31
Compare
Choose a tag to compare

Update

$ npm install @google-cloud/bigquery@0.5.0

⚠️ Breaking Changes!

Partial failures are now treated as errors

(#1644, #1760)

Previously, when inserting multiple rows of data into a table, if any of them failed to insert, the failed insertion errors were passed in a separate argument to the callback. We've since introduced a custom error type called PartialFailureError, which is returned as the first err argument to your callback.

Before

table.insert(data, function(err, insertErrors, apiResponse) {
  if (err) {
    // An API error occurred.
  }

  if (insertErrors.length > 0) {
    // Some rows failed to insert, while others may have succeeded.
    //
    // insertErrors[].row (original row object passed to `insert`)
    // insertErrors[].errors[].reason
    // insertErrors[].errors[].message
  }
});

After

table.insert(data, function(err, apiResponse) {
  if (err) {
    // An API error or partial failure occurred.

    if (err.name === 'PartialFailureError') {
      // Some rows failed to insert, while others may have succeeded.

      // err.errors[].row (original row object passed to `insert`)
      // err.errors[].errors[].reason
      // err.errors[].errors[].message
    }
  }
});

Fixes

  • (#1747, #1748): Properly honor sourceFormat option on table.import().

v0.4.0

15 Nov 21:30
Compare
Choose a tag to compare

Updating

$ npm install @google-cloud/bigquery@0.4.0

⚠️ Breaking Changes

Promises have arrived!

Issue: #551
PR: #1701

It's been a long time coming, but we're finally here. We've shipped promise support in the Google Cloud BigQuery module!

Do I have to use promises?

Nope, carry on. (But keep reading if you use streams)

How do I use promises?

Don't pass a callback:

var bigquery = require('@google-cloud/bigquery')();

bigquery.getDatasets()
  .then(function(data) {
    var datasets = data[0];
  })
  .catch(function(err) {});

How do I use a method as a stream?

All of the streaming functionality from our methods have been moved to their own method.

var bigquery = require('@google-cloud/bigquery')();

- bigquery.getDatasets()
+ bigquery.getDatasetsStream()
    .on('data', function(dataset) {})

- bigquery.getJobs()
+ bigquery.getJobsStream()
    .on('data', function(job) {})

- bigquery.query('SELECT ...')
+ bigquery.createQueryStream('SELECT ...')
    .on('data', function(row) {})
var dataset = bigquery.dataset('my-dataset-name');

- dataset.getTables()
+ dataset.getTablesStream()
    .on('data', function(table) {})

- dataset.query('SELECT ...')
+ dataset.createQueryStream('SELECT ...')
    .on('data', function(row) {})
var table = dataset.table('my-table-name');

- table.getRows()
+ table.createReadStream()
    .on('data', function(row) {})

- table.query('SELECT ...')
+ table.createQueryStream('SELECT ...')
    .on('data', function(row) {})

v0.3.0

15 Nov 21:29
Compare
Choose a tag to compare

Updating

$ npm install @google-cloud/bigquery@0.3.0

Features

  • (#1535, #1590, #1605): Sync dependencies with other service modules to minimize download and installation time as much as possible.

v0.2.0

15 Nov 21:29
Compare
Choose a tag to compare

Updating

$ npm install @google-cloud/bigquery@0.2.0

Features

  • (#1422, #1564): Automatically assign record type for nested schemas.

v0.1.2

15 Nov 21:28
Compare
Choose a tag to compare

Updating

$ npm install @google-cloud/bigquery@0.1.2

Fixes