Skip to content

Releases: googleapis/nodejs-spanner

@google-cloud/spanner v0.7.0

24 Oct 05:01

Choose a tag to compare

release level

Beta Release

@google-cloud/spanner is now in the beta release level. Libraries defined at the Beta quality level are expected to be mostly stable, while we work towards their release candidate. We will address issues and requests with a higher priority.

@google-cloud/spanner v0.6.0

24 Oct 04:58

Choose a tag to compare

release level

Bugfixes

  • Database instances are now cached so sessions can be re-used. (#2362))

@google-cloud/spanner v0.5.0

24 Oct 04:56

Choose a tag to compare

release level

Features

  • Introduce getTransaction, allowing more natural Promise usage in a transaction workflow. (#2344)

Bugfixes

  • Properly close a request stream in the event of an error. (#2358)
  • Update parameters under which requests are retried. (#2390)
  • Properly handle multi-row mutations with heterogeneous columns; h/t @jscinoz. (#2426)

@google-cloud/spanner v0.4.4

24 Oct 04:50

Choose a tag to compare

release level

Bugfixes

  • runStream fails for large query result sets. (#2313)

@google-cloud/spanner v0.4.3

24 Oct 04:49

Choose a tag to compare

release level

Bugfixes

  • Default maxSessions to 100. (#2286)

@google-cloud/spanner v0.4.0

24 Oct 04:47

Choose a tag to compare

release level

⚠️ Breaking Changes

Transactional promises are on hold

Our original implementation has been causing confusion, so we decided to re-think our approach. For now, all transactions must be run in "callback-style", which they kind of were already. Please chime in to our issue and help us land on a solution that works for all.

@google-cloud/spanner v0.3.0

24 Oct 04:45

Choose a tag to compare

release level

⚠️ Breaking Changes!

Dropped support for Node v0.12.x

We've officially dropped support for Node v0.12.x in all of our APIs. It may still work, but it is not officially supported and may stop working at any time.

@google-cloud/spanner v0.2.0

24 Oct 04:39

Choose a tag to compare

release level

⚠️ Breaking Changes

Transactional promises removed for a minute

database.runTransaction() no longer natively supports promise uses. Why?

spanner.date() will throw if treated as the Date constructor

Features

  • deleteRows(), read(), and createReadStream() accept composite keys. (#2141)
  • Introduce spanner.double() type. (#2064)

Fixes

  • Fix keep-alive implementation. (#2071)
  • Re-factor session pooling. (#2127)
  • Ensure API requests are made for the correct Transaction. (#2148)

@google-cloud/spanner v0.1.2

24 Oct 04:41

Choose a tag to compare

release level

Bugfixes

  • Fix keepAlive implementation. (#2071)

@google-cloud/spanner v0.1.0

24 Oct 04:34

Choose a tag to compare

release level

Hello, Cloud Spanner!

Cloud Spanner is a highly scalable, transactional, managed, NewSQL database service. Cloud Spanner solves the need for a horizontally-scaling database with consistent global transaction and SQL semantics. With Cloud Spanner you don't need to choose between consistency and horizontal scaling — you get both.

var spanner = require('@google-cloud/spanner')({
  projectId: 'grape-spaceship-123',
  keyFilename: '/path/to/keyfile.json'
});

var instance = spanner.instance('my-instance');
var database = instance.database('my-database');

// Create a table.
var schema =
  'CREATE TABLE Singers (' +
  '  SingerId INT64 NOT NULL,' +
  '  FirstName STRING(1024),' +
  '  LastName STRING(1024),' +
  '  SingerInfo BYTES(MAX),' +
  ') PRIMARY KEY(SingerId)';

database.createTable(schema, function(err, table, operation) {
  if (err) {
    // Error handling omitted.
  }

  operation
    .on('error', function(err) {})
    .on('complete', function() {
      // Table created successfully.
    });
});

// Insert data into the table.
var table = database.table('Singers');

table.insert({
  SingerId: 10,
  FirstName: 'Eddie',
  LastName: 'Wilson'
}, function(err) {
  if (!err) {
    // Row inserted successfully.
  }
});

// Run a query as a readable object stream.
database.runStream('SELECT * FROM Singers')
  .on('error', function(err) {})
  .on('data', function(row) {
    // row.toJSON() = {
    //   SingerId: 10,
    //   FirstName: 'Eddie',
    //   LastName: 'Wilson'
    // }
  }
  })
  .on('end', function() {
    // All results retrieved.
  });