Skip to content

Commit e7d385b

Browse files
authored
Merge branch 'googleapis:main' into main
2 parents c62584c + f12e295 commit e7d385b

File tree

139 files changed

+11842
-2791
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+11842
-2791
lines changed

.github/.OwlBot.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ deep-copy-regex:
2525
dest: /owl-bot-staging/$1/$2
2626
- source: /google/spanner/(admin/instance/v.*)/.*-nodejs/(.*)
2727
dest: /owl-bot-staging/$1/$2
28+
- source: /google/spanner/(executor/v.*)/.*-nodejs/(.*)
29+
dest: /owl-bot-staging/$1/$2
2830

2931
begin-after-commit-hash: 46f25fb1121747b994ff5818963fda84b5e6bfd3
3032

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
**/node_modules
33
/.coverage
44
/coverage
5-
/.idea
6-
/.vscode
75
/.nyc_output
86
/docs/
97
/out/
@@ -14,3 +12,5 @@ system-test/*key.json
1412
.DS_Store
1513
package-lock.json
1614
__pycache__
15+
.idea
16+
.vscode

.jsdoc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ module.exports = {
4040
includePattern: '\\.js$'
4141
},
4242
templates: {
43-
copyright: 'Copyright 2023 Google LLC',
43+
copyright: 'Copyright 2024 Google LLC',
4444
includeDate: false,
4545
sourceFiles: false,
4646
systemName: '@google-cloud/spanner',

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,50 @@
44

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

7+
## [7.4.0](https://github.com/googleapis/nodejs-spanner/compare/v7.3.0...v7.4.0) (2024-02-23)
8+
9+
10+
### Features
11+
12+
* **spanner:** Add PG.OID support ([#1948](https://github.com/googleapis/nodejs-spanner/issues/1948)) ([cf9df7a](https://github.com/googleapis/nodejs-spanner/commit/cf9df7a54c21ac995bbea9ad82c3544e4aff41b6))
13+
* Untyped param types ([#1869](https://github.com/googleapis/nodejs-spanner/issues/1869)) ([6ef44c3](https://github.com/googleapis/nodejs-spanner/commit/6ef44c383a90bf6ae95de531c83e21d2d58da159))
14+
* 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))
15+
16+
17+
### Bug Fixes
18+
19+
* **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))
20+
* 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)
21+
22+
## [7.3.0](https://github.com/googleapis/nodejs-spanner/compare/v7.2.0...v7.3.0) (2024-02-08)
23+
24+
25+
### Features
26+
27+
* **spanner:** Add maxCommitDelay support ([#1992](https://github.com/googleapis/nodejs-spanner/issues/1992)) ([9f84408](https://github.com/googleapis/nodejs-spanner/commit/9f8440843fd8926a37ec300a318dad33b83b4f97))
28+
29+
30+
### Bug Fixes
31+
32+
* **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))
33+
* **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))
34+
* **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))
35+
* **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))
36+
37+
## [7.2.0](https://github.com/googleapis/nodejs-spanner/compare/v7.1.0...v7.2.0) (2024-01-11)
38+
39+
40+
### Features
41+
42+
* Support for Directed Reads ([#1966](https://github.com/googleapis/nodejs-spanner/issues/1966)) ([c0a4363](https://github.com/googleapis/nodejs-spanner/commit/c0a43638c81dd769cc55e021cc4cf1d93db8a72a))
43+
44+
45+
### Bug Fixes
46+
47+
* **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))
48+
* **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))
49+
* **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))
50+
751
## [7.1.0](https://github.com/googleapis/nodejs-spanner/compare/v7.0.0...v7.1.0) (2023-11-16)
852

953

owlbot.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@
5353
_tracked_paths.add(library)
5454
s.copy([library], excludes=excludes)
5555

56+
# Copy the spanner/executor library.
57+
for version in ['v1']:
58+
library = staging / 'executor' / version
59+
_tracked_paths.add(library)
60+
s.copy([library], excludes=excludes)
61+
5662
# The staging directory should never be merged into the main branch.
5763
shutil.rmtree(staging)
5864

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@google-cloud/spanner",
33
"description": "Cloud Spanner Client Library for Node.js",
4-
"version": "7.1.0",
4+
"version": "7.4.0",
55
"license": "Apache-2.0",
66
"author": "Google Inc.",
77
"engines": {
@@ -65,7 +65,7 @@
6565
"events-intercept": "^2.0.0",
6666
"extend": "^3.0.2",
6767
"google-auth-library": "^9.0.0",
68-
"google-gax": "4.0.5",
68+
"google-gax": "4.3.1",
6969
"grpc-gcp": "^1.0.0",
7070
"is": "^3.2.1",
7171
"lodash.snakecase": "^4.1.1",
@@ -90,7 +90,7 @@
9090
"@types/ncp": "^2.0.1",
9191
"@types/proxyquire": "^1.3.28",
9292
"@types/request": "^2.48.3",
93-
"@types/sinon": "^10.0.0",
93+
"@types/sinon": "^17.0.0",
9494
"@types/through2": "^2.0.34",
9595
"@types/uuid": "^9.0.0",
9696
"binary-search-bounds": "^2.0.4",
@@ -99,7 +99,7 @@
9999
"concat-stream": "^2.0.0",
100100
"dedent": "^1.0.0",
101101
"execa": "^5.0.0",
102-
"gapic-tools": "^0.2.0",
102+
"gapic-tools": "^0.4.0",
103103
"gts": "^5.0.0",
104104
"jsdoc": "^4.0.0",
105105
"jsdoc-fresh": "^3.0.0",
@@ -111,7 +111,7 @@
111111
"ncp": "^2.0.0",
112112
"p-limit": "^3.0.1",
113113
"proxyquire": "^2.0.1",
114-
"sinon": "^15.0.0",
114+
"sinon": "^17.0.0",
115115
"stats-lite": "^2.1.1",
116116
"time-span": "^4.0.0",
117117
"tmp": "^0.2.0",

protos/google/spanner/admin/database/v1/spanner_database_admin.proto

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,23 @@ message CreateDatabaseRequest {
572572

573573
// Optional. The dialect of the Cloud Spanner Database.
574574
DatabaseDialect database_dialect = 5 [(google.api.field_behavior) = OPTIONAL];
575+
576+
// Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in
577+
// 'extra_statements' above.
578+
// Contains a protobuf-serialized
579+
// [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
580+
// To generate it, [install](https://grpc.io/docs/protoc-installation/) and
581+
// run `protoc` with --include_imports and --descriptor_set_out. For example,
582+
// to generate for moon/shot/app.proto, run
583+
// ```
584+
// $protoc --proto_path=/app_path --proto_path=/lib_path \
585+
// --include_imports \
586+
// --descriptor_set_out=descriptors.data \
587+
// moon/shot/app.proto
588+
// ```
589+
// For more details, see protobuffer [self
590+
// description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
591+
bytes proto_descriptors = 6 [(google.api.field_behavior) = OPTIONAL];
575592
}
576593

577594
// Metadata type for the operation returned by
@@ -674,6 +691,22 @@ message UpdateDatabaseDdlRequest {
674691
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns
675692
// `ALREADY_EXISTS`.
676693
string operation_id = 3;
694+
695+
// Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements.
696+
// Contains a protobuf-serialized
697+
// [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
698+
// To generate it, [install](https://grpc.io/docs/protoc-installation/) and
699+
// run `protoc` with --include_imports and --descriptor_set_out. For example,
700+
// to generate for moon/shot/app.proto, run
701+
// ```
702+
// $protoc --proto_path=/app_path --proto_path=/lib_path \
703+
// --include_imports \
704+
// --descriptor_set_out=descriptors.data \
705+
// moon/shot/app.proto
706+
// ```
707+
// For more details, see protobuffer [self
708+
// description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
709+
bytes proto_descriptors = 4 [(google.api.field_behavior) = OPTIONAL];
677710
}
678711

679712
// Action information extracted from a DDL statement. This proto is used to
@@ -762,6 +795,13 @@ message GetDatabaseDdlResponse {
762795
// A list of formatted DDL statements defining the schema of the database
763796
// specified in the request.
764797
repeated string statements = 1;
798+
799+
// Proto descriptors stored in the database.
800+
// Contains a protobuf-serialized
801+
// [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
802+
// For more details, see protobuffer [self
803+
// description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
804+
bytes proto_descriptors = 2;
765805
}
766806

767807
// The request for

protos/google/spanner/v1/spanner.proto

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import "google/api/annotations.proto";
2222
import "google/api/client.proto";
2323
import "google/api/field_behavior.proto";
2424
import "google/api/resource.proto";
25+
import "google/protobuf/duration.proto";
2526
import "google/protobuf/empty.proto";
2627
import "google/protobuf/struct.proto";
2728
import "google/protobuf/timestamp.proto";
@@ -401,6 +402,15 @@ message Session {
401402

402403
// The database role which created this session.
403404
string creator_role = 5;
405+
406+
// Optional. If true, specifies a multiplexed session. A multiplexed session
407+
// may be used for multiple, concurrent read-only operations but can not be
408+
// used for read-write transactions, partitioned reads, or partitioned
409+
// queries. Multiplexed sessions can be created via
410+
// [CreateSession][google.spanner.v1.Spanner.CreateSession] but not via
411+
// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
412+
// Multiplexed sessions may not be deleted nor listed.
413+
bool multiplexed = 6 [(google.api.field_behavior) = OPTIONAL];
404414
}
405415

406416
// The request for [GetSession][google.spanner.v1.Spanner.GetSession].
@@ -545,7 +555,7 @@ message DirectedReadOptions {
545555
// * `location:us-east1` --> The "us-east1" replica(s) of any available type
546556
// will be used to process the request.
547557
// * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in nearest
548-
// . available location will be used to process the
558+
// available location will be used to process the
549559
// request.
550560
// * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s)
551561
// in location "us-east1" will be used to process
@@ -589,8 +599,7 @@ message DirectedReadOptions {
589599
repeated ReplicaSelection replica_selections = 1;
590600
}
591601

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

603-
// Exclude_replicas indicates that should be excluded from serving
604-
// requests. Spanner will not route requests to the replicas in this list.
612+
// Exclude_replicas indicates that specified replicas should be excluded
613+
// from serving requests. Spanner will not route requests to the replicas
614+
// in this list.
605615
ExcludeReplicas exclude_replicas = 2;
606616
}
607617
}
@@ -927,9 +937,10 @@ message PartitionQueryRequest {
927937

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

1177+
// Optional. The amount of latency this request is willing to incur in order
1178+
// to improve throughput. If this field is not set, Spanner assumes requests
1179+
// are relatively latency sensitive and automatically determines an
1180+
// appropriate delay time. You can specify a batching delay value between 0
1181+
// and 500 ms.
1182+
google.protobuf.Duration max_commit_delay = 8
1183+
[(google.api.field_behavior) = OPTIONAL];
1184+
11661185
// Common options for this request.
11671186
RequestOptions request_options = 6;
11681187
}
@@ -1201,6 +1220,21 @@ message BatchWriteRequest {
12011220
// Required. The groups of mutations to be applied.
12021221
repeated MutationGroup mutation_groups = 4
12031222
[(google.api.field_behavior) = REQUIRED];
1223+
1224+
// Optional. When `exclude_txn_from_change_streams` is set to `true`:
1225+
// * Mutations from all transactions in this batch write operation will not
1226+
// be recorded in change streams with DDL option `allow_txn_exclusion=true`
1227+
// that are tracking columns modified by these transactions.
1228+
// * Mutations from all transactions in this batch write operation will be
1229+
// recorded in change streams with DDL option `allow_txn_exclusion=false or
1230+
// not set` that are tracking columns modified by these transactions.
1231+
//
1232+
// When `exclude_txn_from_change_streams` is set to `false` or not set,
1233+
// mutations from all transactions in this batch write operation will be
1234+
// recorded in all change streams that are tracking columns modified by these
1235+
// transactions.
1236+
bool exclude_txn_from_change_streams = 5
1237+
[(google.api.field_behavior) = OPTIONAL];
12041238
}
12051239

12061240
// The result of applying a batch of mutations.

protos/google/spanner/v1/transaction.proto

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -475,6 +475,22 @@ message TransactionOptions {
475475
// on the `session` resource.
476476
ReadOnly read_only = 2;
477477
}
478+
479+
// When `exclude_txn_from_change_streams` is set to `true`:
480+
// * Mutations from this transaction will not be recorded in change streams
481+
// with DDL option `allow_txn_exclusion=true` that are tracking columns
482+
// modified by these transactions.
483+
// * Mutations from this transaction will be recorded in change streams with
484+
// DDL option `allow_txn_exclusion=false or not set` that are tracking
485+
// columns modified by these transactions.
486+
//
487+
// When `exclude_txn_from_change_streams` is set to `false` or not set,
488+
// mutations from this transaction will be recorded in all change streams that
489+
// are tracking columns modified by these transactions.
490+
// `exclude_txn_from_change_streams` may only be specified for read-write or
491+
// partitioned-dml transactions, otherwise the API will return an
492+
// `INVALID_ARGUMENT` error.
493+
bool exclude_txn_from_change_streams = 5;
478494
}
479495

480496
// A transaction.

protos/google/spanner/v1/type.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ message Type {
4747
// typically is not needed to process the content of a value (it doesn't
4848
// affect serialization) and clients can ignore it on the read path.
4949
TypeAnnotationCode type_annotation = 4;
50+
51+
// If [code][google.spanner.v1.Type.code] ==
52+
// [PROTO][google.spanner.v1.TypeCode.PROTO] or
53+
// [code][google.spanner.v1.Type.code] ==
54+
// [ENUM][google.spanner.v1.TypeCode.ENUM], then `proto_type_fqn` is the fully
55+
// qualified name of the proto type representing the proto/enum definition.
56+
string proto_type_fqn = 5;
5057
}
5158

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

106+
// Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or
107+
// `"-Infinity"`.
108+
FLOAT32 = 15;
109+
99110
// Encoded as `string` in RFC 3339 timestamp format. The time zone
100111
// must be present, and must be `"Z"`.
101112
//
@@ -145,6 +156,13 @@ enum TypeCode {
145156
// preserved.
146157
// - JSON array elements will have their order preserved.
147158
JSON = 11;
159+
160+
// Encoded as a base64-encoded `string`, as described in RFC 4648,
161+
// section 4.
162+
PROTO = 13;
163+
164+
// Encoded as `string`, in decimal format.
165+
ENUM = 14;
148166
}
149167

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

0 commit comments

Comments
 (0)