Skip to content

Releases: googleapis/nodejs-spanner

v4.3.0

05 Nov 19:32

Choose a tag to compare

Features

Bug Fixes

  • deps: bump google-gax to 1.7.5 (#712) (03384d4)
  • don't wrap SpannerDate so timezone does not affect results (#711) (86c0ae5)

v4.2.0

07 Oct 22:02

Choose a tag to compare

Bug Fixes

Features

v4.1.0

16 Sep 14:01

Choose a tag to compare

Bug Fixes

  • deps: update dependency yargs to v14 (#680) (add2f05)
  • types: import request types from teeny-request (#682) (a1ecd80)
  • set proper version # for x-goog-api-client (#681) (f300fad)

Features

  • load protos from JSON, grpc-fallback support (0b3fb90)
  • support batch create sessions (#685) (7bc58cf)
  • use JSON proto for transaction-runner (#690) (279fc97)

v4.0.2

09 Aug 15:32

Choose a tag to compare

Bug Fixes

  • allow calls with no request, add JSON proto (4a478a7)
  • deps: use the latest extend (#678) (a094fdd)

v4.0.1

29 Jul 15:47

Choose a tag to compare

Bug Fixes

  • deps: update dependency @google-cloud/paginator to v2 (#668) (86d3638)
  • deps: update dependency google-auth-library to v5 (#669) (c6d165e)
  • docs: move docs under overloads to be picked up by JSDoc (#666) (be10eb1)

v4.0.0

19 Jul 18:31

Choose a tag to compare

⚠ BREAKING CHANGES

  • deps: this will ship async/await in the generated code
  • upgrade engines field to >=8.10.0 (#587)

Bug Fixes

  • deps: update dependency @google-cloud/common-grpc to v1 (#607) (084dc8c)
  • deps: update dependency @google-cloud/paginator to ^0.2.0 (#560) (8fe33a1)
  • deps: update dependency @google-cloud/paginator to v1 (#593) (bfb2255)
  • deps: update dependency @google-cloud/precise-date to v1 (#600) (f52494f)
  • deps: update dependency @google-cloud/projectify to v1 (#591) (22713c1)
  • deps: update dependency @google-cloud/promisify to v1 (#592) (cb76922)
  • deps: update dependency arrify to v2 (#577) (6e0ddc8)
  • deps: update dependency google-auth-library to v4 (#599) (21b9995)
  • deps: update dependency google-gax to ^0.26.0 (#586) (0f88be2)
  • deps: update dependency merge-stream to v2 (#624) (3aa676d)
  • deps: update dependency p-queue to v4 (#558) (7547e21)
  • deps: update dependency p-queue to v5 (#578) (7827fb4)
  • deps: update dependency p-queue to v6.0.2 (#643) (ace1359)
  • deps: upgrade to google-gax 1.x (#651) (a32e838)
  • docs: add google.type namespace (#605) (5cc6dc1)
  • docs: link to reference docs section on googleapis.dev (#654) (2379dc2)
  • docs: move to new client docs URL (#647) (7dec1bd)
  • transaction: set/update seqno for all sql requests (#661) (102cae1)
  • DEADLINE_EXCEEDED is no longer retried (#598) (1cac4fc)
  • include 'x-goog-request-params' header in requests (#573) (e0cb9dc)
  • treat deadline errors as idempotent (#602) (b3d494a)
  • update retry config (#650) (f1e8104)

Build System

Features

  • add .repo-metadata.json and move to new README template (#636) (11007cf)
  • support apiEndpoint override (#634) (6a5eb36)
  • support apiEndpoint override in client constructor (#639) (f6ebb27)

Miscellaneous Chores

v3.1.0

07 Mar 21:47
de0772c

Choose a tag to compare

03-06-2019 20:13 PST

New Features

  • feat(transaction): batch dml (#550)

Dependencies

  • chore(deps): update dependency @types/sinon to v7.0.9 (#553)
  • chore(deps): fix broken dep types (#549)

Documentation

  • docs: Update grammar (#544)

Internal / Testing Changes

  • chore: update proto docs and code style
  • chore(deps): use bundled p-queue types (#547)
  • build: update release configuration (#545)
  • build: use node10 to run samples-test, system-test etc (#551)

v3.0.0

25 Feb 22:16

Choose a tag to compare

02-25-2019 12:38 PST

Breaking Changes

  • breaking: refactor(transaction): split logic into new classes (#506)
  • breaking: feat(timestamp): create new date/timestamp classes (#517)
  • fix: run generator to bring in streaming retry configs (#448)

Read-only Transactions (Snapshots) are no longer runnable via Database#runTransaction (#506)

Database#runTransaction is useful if want to replay a Transaction in its entirety in case you run into an ABORTED error. This should never happen with Snapshots, so it felt like it was time to create a new method just for them. This change also means that runTransaction will only ever return read-write transactions.

Before

const bounds = {
  readOnly: true,
  strong: true,
};

database.runTransaction(bounds, (err, transaction) => {
  // ...
});

After

const bounds = {
  strong: true,
};

database.getSnapshot(bounds, (err, snapshot) => {
  // ...
});

Timestamp bounds now offer nanosecond precision (#506)

This change allows you to specify a Snapshot read timestamp with more precision. Previously one could only specify in seconds, but now we support both milliseconds and nanoseconds.

Before

const bounds = {
  exactStaleness: 5
};

const bounds = {
  readTimestamp: Date.now()
};

After

const bounds = {
  // millisecond precision for staleness
  exactStaleness: 5000,

  // or if you need nano/micro precision for staleness
  exactStaleness: {seconds: 5, nanos: 321} // => 5000000321 nanoseconds
};

const bounds = {
  readTimestamp: Spanner.timestamp('2019-01-12T00:30:35.381101032Z')
};

Transaction#end changes. (#506)

Transactions saw a sizeable refactor with this version, previously end() performed a number of asynchronous tasks when called, however this is no longer true. Because of this, there isn't much of a need to track when end is finished, so we've dropped the callback parameter.

Additionally, end() will now be called automatically for failed calls to Transaction#commit() and Transaction#rollback(). If your code calls end after a failed commit/rollback, it will simply no-op.

Before

transaction.end(callback);

After

transaction.end();
callback();

Session#beginTransaction was removed (#506)

Spanner supports 4 different types of Transactions:

  • ReadWrite
  • ReadOnly
  • PartitionedDml
  • Batch

Using one method for all types became cumbersome when trying to manage the various options available to each, now each type has its own method.

Before

const transaction = await session.beginTransaction({readWrite: true});
const snapshot = await session.beginTransaction({readOnly: true});

After

const transaction = session.transaction();
await transaction.begin();

const snapshot = session.snapshot({strong: true});
await snapshot.begin();

Timestamps now represented by @google-cloud/precise-time (#517)

While Spanner supports timestamps with nanosecond precision, JavaScript Dates do not. So we created the PreciseDate object which extends the native Date and adds both microsecond and nanosecond support.

Before

const timestamp = Spanner.timestamp('2019-01-12T00:30:35.381101032Z');
// => {value: '2019-01-12T00:30:35.381Z'}

After

// PreciseDate object
const timestamp = Spanner.timestamp('2019-01-12T00:30:35.381101032Z');
timestamp.toJSON(); // => '2019-01-12T00:30:35.381101032Z'
timestamp.toFullTimeString(); // => '1547253035381101032' (nanoseconds)

SpannerDate now extends the native Date object. (#517)

Since Timestamps saw an update, it made sense to give Spanner Date objects a similar update. The Spanner.date() method now returns a native Date object.

Before

const date = Spanner.date('3-22-2018');
// => {value: '2018-3-22'}

After

// Date object
const date = Spanner.date('3-22-2018');
date.toJSON(); // => '2018-3-22'

New Features

  • refactor(types): enable noImplicitAny in session-pool.ts (#508)
  • refactor(table): improve typescript defs (#495)
  • refactor(ts): partial-result-stream types/refactor (#488)
  • refactor(codec): improve typescript defs (#490)
  • chore(SessionPool): improve typescript types (#479)
  • chore(typescript): add types for spanner gapic (#487)
  • refactor(ts): enable noImplicitAny on src/session.ts (#457)

Bug Fixes

  • fix: throw on invalid credentials (#522)
  • fix(transaction): re-use session in transaction runners (#540)

Dependencies

  • chore(deps): update dependency mocha to v6 (#532)
  • fix(deps): update dependency @google-cloud/promisify to ^0.4.0 (#524)
  • chore(deps): update dependency @types/p-retry to v3 (#521)
  • fix(deps): update dependency yargs to v13 (#520)
  • fix(deps): update dependency @google-cloud/common-grpc to ^0.10.0 (#504)
  • fix(deps): update dependency google-gax to ^0.25.0 (#505)
  • chore(deps): update dependency eslint-config-prettier to v4 (#502)
  • fix(deps): update dependency google-gax to ^0.24.0 (#501)
  • fix(deps): update dependency google-auth-library to v3 (#498)
  • fix(deps): update dependency google-gax to ^0.23.0 (#496)
  • chore(deps): update dependency concat-stream to v2 (#489)
  • refactor: removed async from dependency list (#449)
  • chore(deps): update dependency @types/sinon to v7 (#480)
  • fix(deps): update dependency p-retry to v3 (#481)
  • chore(deps): update dependency typescript to ~3.2.0 (#459)

Documentation

  • docs: fixed example for table.upsert() (#533)
  • docs: update links in contrib guide (#525)
  • docs: update contributing path in README (#515)
  • docs: add lint/fix example to contributing guide (#512)
  • docs: fix example comments (#511)
  • chore: update proto licenses
  • build: check broken links in generated docs (#491)
  • fix(docs): remove unused long running operations and IAM types
  • refactor: modernize sample tests (#484)
  • docs: fix links in docstrings (#467)
  • docs: fix typo (#465)
  • chore: update license file (#464)
  • docs: update readme badges (#462)
  • docs(samples): Add sample to delete using a mutation. (#458)

Internal / Testing Changes

  • chore: add spanner_grpc_config.json and enable grpc-gcp support for spanner (#503)
  • build: use linkinator for docs test (#523)
  • build: create docs test npm scripts (#519)
  • build: test using @grpc/grpc-js in CI (#516)
  • chore: move CONTRIBUTING.md to root (#514)
  • refactor: improve generated code style. (#510)
  • build: ignore googleapis.com in doc link check (#500)
  • fix: fix the sample tests (#486)
  • chore(build): inject yoshi automation key (#478)
  • chore: update nyc and eslint configs (#477)
  • chore: fix publish.sh permission +x (#475)
  • fix(build): fix Kokoro release script (#474)
  • build: add Kokoro configs for autorelease ([#473...
Read more

v2.2.1

28 Nov 19:08
9d8ff4a

Choose a tag to compare

11-28-2018 10:43 PST

Implementation Changes

  • Update package.json to include the build directory (#454)

v2.2.0

27 Nov 21:26

Choose a tag to compare

11-27-2018 09:13 PST

Implementation Changes

  • fix: transaction async error handling that not thrown the full error (#447)
  • fix(transaction): accept json options in run/runStream (#446)
  • refactor(transaction): error handling (#360)
  • refactor(ts): enable noImplicitThis in the tsconfig (#411)
  • refactor(ts): use import/export for local files (#408)
  • refactor(ts): add type packages for many things (#406)
  • refactor(ts): convert tests to typescript (#404)
  • refactor(typescript): rename src and system-test files to *.ts (#402)
  • refactor(typescript): perform initial TypeScript conversion (#384)
  • fix: Only run mutations inside of a transaction. (#361)

New Features

  • feat(session): add label support (#373)

Dependencies

  • chore(deps): update dependency @types/sinon to v5.0.7 (#444)
  • fix: Pin @types/sinon to last compatible version (#443)
  • chore(deps): update dependency @types/p-queue to v3 (#440)
  • fix(deps): update dependency google-gax to ^0.22.0 (#435)
  • chore(deps): update dependency gts to ^0.9.0 (#434)
  • chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 (#429)
  • chore(deps): update dependency @types/is to v0.0.21 (#426)
  • fix(deps): update dependency through2 to v3 (#423)
  • chore: remove unused google-proto-files dep (#421)
  • chore(deps): update dependency eslint-plugin-node to v8 (#407)
  • refactor: drop dependency on delay (#383)
  • fix(deps): update dependency google-proto-files to ^0.17.0 (#369)
  • chore(deps): update dependency sinon to v7 (#371)

Documentation

  • docs(samples): updated samples code to use async await (#385)
  • Add Cloud Spanner DML/PDML samples. (#366)

Internal / Testing Changes

  • chore: add synth.metadata
  • test: fix broken tests (#441)
  • refactor(samples): convert ava tests to mocha (#400)
  • chore: update eslintignore config (#433)
  • chore(build): fix lint rules and build for generated code (#430)
  • chore: drop contributors from multiple places (#427)
  • chore: use latest npm on Windows (#425)
  • fix: update source location for synth (#422)
  • fix: re-enable linting and formatting (#420)
  • chore: improve typescript config and types (#417)
  • chore: update CircleCI config (#416)
  • chore: run gts fix (#413)
  • chore: remove old issue template (#397)
  • chore: update issue templates (#401)
  • build: run tests on node11 (#395)
  • chores(build): do not collect sponge.xml from windows builds (#389)
  • chores(build): run codecov on continuous builds (#386)
  • chore: update new issue template (#382)
  • fix(tests): use unique label for tests (#367)
  • build: fix codecov uploading on Kokoro (#372)
  • build(kokoro): test with spanner key (#364)