Skip to content

@google-cloud/bigtable v0.5.0

Compare
Choose a tag to compare
@stephenplusplus stephenplusplus released this 18 Oct 00:18
· 22381 commits to main since this release

Updating

$ npm install @google-cloud/bigtable@0.5.0

⚠️ Breaking Changes

Promises have arrived!

Issue: #551
PR: #1713

It's been a long time coming, but we're finally here. We've shipped promise support in the Google Cloud Bigtable 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 bigtable = require('@google-cloud/bigtable')();

bigtable.getTables()
  .then(function(data) {
    var tables = 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 bigtable = require('@google-cloud/bigtable')();

- bigtable.getInstances()
+ bigtable.getInstancesStream()
   .on('data', function(instance) {})
var instance = bigtable.instance('my-instance-name');

- instance.getClusters()
+ instance.getClustersStream()
   .on('data', function(cluster) {})

- instance.getTables()
+ instance.getTablesStream()
   .on('data', function(table) {})
var table = instance.table('my-table-name');

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

- table.sampleRowKeys()
+ table.sampleRowKeysStream()
   .on('data', function(key) {})