Skip to content

Commit

Permalink
Merge branch 'googleapis:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
surbhigarg92 authored Mar 4, 2024
2 parents c62584c + f12e295 commit e7d385b
Show file tree
Hide file tree
Showing 139 changed files with 11,842 additions and 2,791 deletions.
2 changes: 2 additions & 0 deletions .github/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ deep-copy-regex:
dest: /owl-bot-staging/$1/$2
- source: /google/spanner/(admin/instance/v.*)/.*-nodejs/(.*)
dest: /owl-bot-staging/$1/$2
- source: /google/spanner/(executor/v.*)/.*-nodejs/(.*)
dest: /owl-bot-staging/$1/$2

begin-after-commit-hash: 46f25fb1121747b994ff5818963fda84b5e6bfd3

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
**/node_modules
/.coverage
/coverage
/.idea
/.vscode
/.nyc_output
/docs/
/out/
Expand All @@ -14,3 +12,5 @@ system-test/*key.json
.DS_Store
package-lock.json
__pycache__
.idea
.vscode
4 changes: 2 additions & 2 deletions .jsdoc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,7 +40,7 @@ module.exports = {
includePattern: '\\.js$'
},
templates: {
copyright: 'Copyright 2023 Google LLC',
copyright: 'Copyright 2024 Google LLC',
includeDate: false,
sourceFiles: false,
systemName: '@google-cloud/spanner',
Expand Down
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,50 @@

[1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions

## [7.4.0](https://github.com/googleapis/nodejs-spanner/compare/v7.3.0...v7.4.0) (2024-02-23)


### Features

* **spanner:** Add PG.OID support ([#1948](https://github.com/googleapis/nodejs-spanner/issues/1948)) ([cf9df7a](https://github.com/googleapis/nodejs-spanner/commit/cf9df7a54c21ac995bbea9ad82c3544e4aff41b6))
* Untyped param types ([#1869](https://github.com/googleapis/nodejs-spanner/issues/1869)) ([6ef44c3](https://github.com/googleapis/nodejs-spanner/commit/6ef44c383a90bf6ae95de531c83e21d2d58da159))
* Update TransactionOptions to include new option exclude_txn_from_change_streams ([#1998](https://github.com/googleapis/nodejs-spanner/issues/1998)) ([937a7a1](https://github.com/googleapis/nodejs-spanner/commit/937a7a13f8c7660e21d34ebbaecad426b2bacd99))


### Bug Fixes

* **deps:** Update dependency google-gax to v4.3.1 ([#1995](https://github.com/googleapis/nodejs-spanner/issues/1995)) ([bed4832](https://github.com/googleapis/nodejs-spanner/commit/bed4832445e72c7116fe5495c79d989664220b38))
* Only reset pending value with resume token ([#2000](https://github.com/googleapis/nodejs-spanner/issues/2000)) ([f337089](https://github.com/googleapis/nodejs-spanner/commit/f337089567d7d92c9467e311be7d72b0a7dc8047)), closes [#1959](https://github.com/googleapis/nodejs-spanner/issues/1959)

## [7.3.0](https://github.com/googleapis/nodejs-spanner/compare/v7.2.0...v7.3.0) (2024-02-08)


### Features

* **spanner:** Add maxCommitDelay support ([#1992](https://github.com/googleapis/nodejs-spanner/issues/1992)) ([9f84408](https://github.com/googleapis/nodejs-spanner/commit/9f8440843fd8926a37ec300a318dad33b83b4f97))


### Bug Fixes

* **deps:** Update dependency google-gax to v4.1.0 ([#1981](https://github.com/googleapis/nodejs-spanner/issues/1981)) ([2a36150](https://github.com/googleapis/nodejs-spanner/commit/2a36150cb61e9abeef073724189cc651d29d8776))
* **deps:** Update dependency google-gax to v4.2.0 ([#1988](https://github.com/googleapis/nodejs-spanner/issues/1988)) ([005589a](https://github.com/googleapis/nodejs-spanner/commit/005589a7727ee87948a55a6c7710f5150fc1c6a7))
* **deps:** Update dependency google-gax to v4.2.1 ([#1989](https://github.com/googleapis/nodejs-spanner/issues/1989)) ([d2ae995](https://github.com/googleapis/nodejs-spanner/commit/d2ae9952e7449ce2321e69a6be36c9d50d863095))
* **deps:** Update dependency google-gax to v4.3.0 ([#1990](https://github.com/googleapis/nodejs-spanner/issues/1990)) ([e625753](https://github.com/googleapis/nodejs-spanner/commit/e625753a37393f32d9e449aa7324763082f6c923))

## [7.2.0](https://github.com/googleapis/nodejs-spanner/compare/v7.1.0...v7.2.0) (2024-01-11)


### Features

* Support for Directed Reads ([#1966](https://github.com/googleapis/nodejs-spanner/issues/1966)) ([c0a4363](https://github.com/googleapis/nodejs-spanner/commit/c0a43638c81dd769cc55e021cc4cf1d93db8a72a))


### Bug Fixes

* **deps:** Update dependency @google-cloud/precise-date to v4 ([#1903](https://github.com/googleapis/nodejs-spanner/issues/1903)) ([7464c8b](https://github.com/googleapis/nodejs-spanner/commit/7464c8b2412a9b718cd8981363cb982aebbe3723))
* **deps:** Update dependency @types/stack-trace to v0.0.33 ([#1952](https://github.com/googleapis/nodejs-spanner/issues/1952)) ([45ab751](https://github.com/googleapis/nodejs-spanner/commit/45ab751da1f0f73bc06c8b8e0007b457fa75518f))
* **deps:** Update dependency retry-request to v7 ([#1934](https://github.com/googleapis/nodejs-spanner/issues/1934)) ([c575c80](https://github.com/googleapis/nodejs-spanner/commit/c575c80b17e5fdf2cbba24c806fa21f26c2010dc))

## [7.1.0](https://github.com/googleapis/nodejs-spanner/compare/v7.0.0...v7.1.0) (2023-11-16)


Expand Down
6 changes: 6 additions & 0 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
_tracked_paths.add(library)
s.copy([library], excludes=excludes)

# Copy the spanner/executor library.
for version in ['v1']:
library = staging / 'executor' / version
_tracked_paths.add(library)
s.copy([library], excludes=excludes)

# The staging directory should never be merged into the main branch.
shutil.rmtree(staging)

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@google-cloud/spanner",
"description": "Cloud Spanner Client Library for Node.js",
"version": "7.1.0",
"version": "7.4.0",
"license": "Apache-2.0",
"author": "Google Inc.",
"engines": {
Expand Down Expand Up @@ -65,7 +65,7 @@
"events-intercept": "^2.0.0",
"extend": "^3.0.2",
"google-auth-library": "^9.0.0",
"google-gax": "4.0.5",
"google-gax": "4.3.1",
"grpc-gcp": "^1.0.0",
"is": "^3.2.1",
"lodash.snakecase": "^4.1.1",
Expand All @@ -90,7 +90,7 @@
"@types/ncp": "^2.0.1",
"@types/proxyquire": "^1.3.28",
"@types/request": "^2.48.3",
"@types/sinon": "^10.0.0",
"@types/sinon": "^17.0.0",
"@types/through2": "^2.0.34",
"@types/uuid": "^9.0.0",
"binary-search-bounds": "^2.0.4",
Expand All @@ -99,7 +99,7 @@
"concat-stream": "^2.0.0",
"dedent": "^1.0.0",
"execa": "^5.0.0",
"gapic-tools": "^0.2.0",
"gapic-tools": "^0.4.0",
"gts": "^5.0.0",
"jsdoc": "^4.0.0",
"jsdoc-fresh": "^3.0.0",
Expand All @@ -111,7 +111,7 @@
"ncp": "^2.0.0",
"p-limit": "^3.0.1",
"proxyquire": "^2.0.1",
"sinon": "^15.0.0",
"sinon": "^17.0.0",
"stats-lite": "^2.1.1",
"time-span": "^4.0.0",
"tmp": "^0.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,23 @@ message CreateDatabaseRequest {

// Optional. The dialect of the Cloud Spanner Database.
DatabaseDialect database_dialect = 5 [(google.api.field_behavior) = OPTIONAL];

// Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in
// 'extra_statements' above.
// Contains a protobuf-serialized
// [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
// To generate it, [install](https://grpc.io/docs/protoc-installation/) and
// run `protoc` with --include_imports and --descriptor_set_out. For example,
// to generate for moon/shot/app.proto, run
// ```
// $protoc --proto_path=/app_path --proto_path=/lib_path \
// --include_imports \
// --descriptor_set_out=descriptors.data \
// moon/shot/app.proto
// ```
// For more details, see protobuffer [self
// description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
bytes proto_descriptors = 6 [(google.api.field_behavior) = OPTIONAL];
}

// Metadata type for the operation returned by
Expand Down Expand Up @@ -674,6 +691,22 @@ message UpdateDatabaseDdlRequest {
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns
// `ALREADY_EXISTS`.
string operation_id = 3;

// Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements.
// Contains a protobuf-serialized
// [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
// To generate it, [install](https://grpc.io/docs/protoc-installation/) and
// run `protoc` with --include_imports and --descriptor_set_out. For example,
// to generate for moon/shot/app.proto, run
// ```
// $protoc --proto_path=/app_path --proto_path=/lib_path \
// --include_imports \
// --descriptor_set_out=descriptors.data \
// moon/shot/app.proto
// ```
// For more details, see protobuffer [self
// description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
bytes proto_descriptors = 4 [(google.api.field_behavior) = OPTIONAL];
}

// Action information extracted from a DDL statement. This proto is used to
Expand Down Expand Up @@ -762,6 +795,13 @@ message GetDatabaseDdlResponse {
// A list of formatted DDL statements defining the schema of the database
// specified in the request.
repeated string statements = 1;

// Proto descriptors stored in the database.
// Contains a protobuf-serialized
// [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
// For more details, see protobuffer [self
// description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
bytes proto_descriptors = 2;
}

// The request for
Expand Down
50 changes: 42 additions & 8 deletions protos/google/spanner/v1/spanner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
Expand Down Expand Up @@ -401,6 +402,15 @@ message Session {

// The database role which created this session.
string creator_role = 5;

// Optional. If true, specifies a multiplexed session. A multiplexed session
// may be used for multiple, concurrent read-only operations but can not be
// used for read-write transactions, partitioned reads, or partitioned
// queries. Multiplexed sessions can be created via
// [CreateSession][google.spanner.v1.Spanner.CreateSession] but not via
// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
// Multiplexed sessions may not be deleted nor listed.
bool multiplexed = 6 [(google.api.field_behavior) = OPTIONAL];
}

// The request for [GetSession][google.spanner.v1.Spanner.GetSession].
Expand Down Expand Up @@ -545,7 +555,7 @@ message DirectedReadOptions {
// * `location:us-east1` --> The "us-east1" replica(s) of any available type
// will be used to process the request.
// * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in nearest
// . available location will be used to process the
// available location will be used to process the
// request.
// * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s)
// in location "us-east1" will be used to process
Expand Down Expand Up @@ -589,8 +599,7 @@ message DirectedReadOptions {
repeated ReplicaSelection replica_selections = 1;
}

// Required. Replicas indicates the order in which replicas should be
// considered. At most one of either include_replicas or exclude_replicas
// Required. At most one of either include_replicas or exclude_replicas
// should be present in the message.
oneof replicas {
// Include_replicas indicates the order of replicas (as they appear in
Expand All @@ -600,8 +609,9 @@ message DirectedReadOptions {
// may fail due to `DEADLINE_EXCEEDED` errors.
IncludeReplicas include_replicas = 1;

// Exclude_replicas indicates that should be excluded from serving
// requests. Spanner will not route requests to the replicas in this list.
// Exclude_replicas indicates that specified replicas should be excluded
// from serving requests. Spanner will not route requests to the replicas
// in this list.
ExcludeReplicas exclude_replicas = 2;
}
}
Expand Down Expand Up @@ -927,9 +937,10 @@ message PartitionQueryRequest {

// Required. The query request to generate partitions for. The request will
// fail if the query is not root partitionable. For a query to be root
// partitionable, it needs to satisfy a few conditions. For example, the first
// operator in the query execution plan must be a distributed union operator.
// For more information about other conditions, see [Read data in
// partitionable, it needs to satisfy a few conditions. For example, if the
// query execution plan contains a distributed union operator, then it must be
// the first operator in the plan. For more information about other
// conditions, see [Read data in
// parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel).
//
// The query request must not contain DML commands, such as INSERT, UPDATE, or
Expand Down Expand Up @@ -1163,6 +1174,14 @@ message CommitRequest {
// Default value is `false`.
bool return_commit_stats = 5;

// Optional. The amount of latency this request is willing to incur in order
// to improve throughput. If this field is not set, Spanner assumes requests
// are relatively latency sensitive and automatically determines an
// appropriate delay time. You can specify a batching delay value between 0
// and 500 ms.
google.protobuf.Duration max_commit_delay = 8
[(google.api.field_behavior) = OPTIONAL];

// Common options for this request.
RequestOptions request_options = 6;
}
Expand Down Expand Up @@ -1201,6 +1220,21 @@ message BatchWriteRequest {
// Required. The groups of mutations to be applied.
repeated MutationGroup mutation_groups = 4
[(google.api.field_behavior) = REQUIRED];

// Optional. When `exclude_txn_from_change_streams` is set to `true`:
// * Mutations from all transactions in this batch write operation will not
// be recorded in change streams with DDL option `allow_txn_exclusion=true`
// that are tracking columns modified by these transactions.
// * Mutations from all transactions in this batch write operation will be
// recorded in change streams with DDL option `allow_txn_exclusion=false or
// not set` that are tracking columns modified by these transactions.
//
// When `exclude_txn_from_change_streams` is set to `false` or not set,
// mutations from all transactions in this batch write operation will be
// recorded in all change streams that are tracking columns modified by these
// transactions.
bool exclude_txn_from_change_streams = 5
[(google.api.field_behavior) = OPTIONAL];
}

// The result of applying a batch of mutations.
Expand Down
18 changes: 17 additions & 1 deletion protos/google/spanner/v1/transaction.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -475,6 +475,22 @@ message TransactionOptions {
// on the `session` resource.
ReadOnly read_only = 2;
}

// When `exclude_txn_from_change_streams` is set to `true`:
// * Mutations from this transaction will not be recorded in change streams
// with DDL option `allow_txn_exclusion=true` that are tracking columns
// modified by these transactions.
// * Mutations from this transaction will be recorded in change streams with
// DDL option `allow_txn_exclusion=false or not set` that are tracking
// columns modified by these transactions.
//
// When `exclude_txn_from_change_streams` is set to `false` or not set,
// mutations from this transaction will be recorded in all change streams that
// are tracking columns modified by these transactions.
// `exclude_txn_from_change_streams` may only be specified for read-write or
// partitioned-dml transactions, otherwise the API will return an
// `INVALID_ARGUMENT` error.
bool exclude_txn_from_change_streams = 5;
}

// A transaction.
Expand Down
18 changes: 18 additions & 0 deletions protos/google/spanner/v1/type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ message Type {
// typically is not needed to process the content of a value (it doesn't
// affect serialization) and clients can ignore it on the read path.
TypeAnnotationCode type_annotation = 4;

// If [code][google.spanner.v1.Type.code] ==
// [PROTO][google.spanner.v1.TypeCode.PROTO] or
// [code][google.spanner.v1.Type.code] ==
// [ENUM][google.spanner.v1.TypeCode.ENUM], then `proto_type_fqn` is the fully
// qualified name of the proto type representing the proto/enum definition.
string proto_type_fqn = 5;
}

// `StructType` defines the fields of a [STRUCT][google.spanner.v1.TypeCode.STRUCT] type.
Expand Down Expand Up @@ -96,6 +103,10 @@ enum TypeCode {
// `"-Infinity"`.
FLOAT64 = 3;

// Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or
// `"-Infinity"`.
FLOAT32 = 15;

// Encoded as `string` in RFC 3339 timestamp format. The time zone
// must be present, and must be `"Z"`.
//
Expand Down Expand Up @@ -145,6 +156,13 @@ enum TypeCode {
// preserved.
// - JSON array elements will have their order preserved.
JSON = 11;

// Encoded as a base64-encoded `string`, as described in RFC 4648,
// section 4.
PROTO = 13;

// Encoded as `string`, in decimal format.
ENUM = 14;
}

// `TypeAnnotationCode` is used as a part of [Type][google.spanner.v1.Type] to
Expand Down
Loading

0 comments on commit e7d385b

Please sign in to comment.