@google-cloud/spanner 6.0.0 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +22 -10
- package/build/protos/google/spanner/v1/commit_response.proto +1 -1
- package/build/protos/google/spanner/v1/keys.proto +1 -1
- package/build/protos/google/spanner/v1/mutation.proto +1 -1
- package/build/protos/google/spanner/v1/query_plan.proto +1 -1
- package/build/protos/google/spanner/v1/result_set.proto +1 -2
- package/build/protos/google/spanner/v1/spanner.proto +4 -1
- package/build/protos/google/spanner/v1/transaction.proto +73 -21
- package/build/protos/google/spanner/v1/type.proto +1 -1
- package/build/protos/protos.d.ts +18 -0
- package/build/protos/protos.js +76 -0
- package/build/protos/protos.json +18 -0
- package/build/src/codec.d.ts +1 -1
- package/build/src/codec.js +5 -11
- package/build/src/session-pool.js +6 -2
- package/build/src/v1/database_admin_client.d.ts +5 -6
- package/build/src/v1/database_admin_client.js +42 -9
- package/build/src/v1/instance_admin_client.d.ts +6 -7
- package/build/src/v1/instance_admin_client.js +42 -9
- package/build/src/v1/spanner_client.d.ts +5 -6
- package/build/src/v1/spanner_client.js +5 -6
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,35 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [6.1.2](https://github.com/googleapis/nodejs-spanner/compare/v6.1.1...v6.1.2) (2022-07-07)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **deps:** update dependency @google-cloud/kms to v3 ([#1664](https://github.com/googleapis/nodejs-spanner/issues/1664)) ([42f41e9](https://github.com/googleapis/nodejs-spanner/commit/42f41e99f3cba9c3bdb981f70d6423c48adbc0d6))
|
|
13
|
+
|
|
14
|
+
## [6.1.1](https://github.com/googleapis/nodejs-spanner/compare/v6.1.0...v6.1.1) (2022-07-06)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* call Promise.race without a long pending promise to prevent memory leak ([#1657](https://github.com/googleapis/nodejs-spanner/issues/1657)) ([768acb6](https://github.com/googleapis/nodejs-spanner/commit/768acb6279914dfe84e372afc1d83dd76ca3dd4d))
|
|
20
|
+
* **deps:** update dependency yargs to v17 ([#1537](https://github.com/googleapis/nodejs-spanner/issues/1537)) ([1039f68](https://github.com/googleapis/nodejs-spanner/commit/1039f68c7b459c2abeef4388fd8541576d374b66))
|
|
21
|
+
|
|
22
|
+
## [6.1.0](https://github.com/googleapis/nodejs-spanner/compare/v6.0.0...v6.1.0) (2022-07-04)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* add Session creator role ([91ef6d3](https://github.com/googleapis/nodejs-spanner/commit/91ef6d373a1ed2c7e191de4003571270bfc4e895))
|
|
28
|
+
* Adding two new fields for Instance create_time and update_time ([#1641](https://github.com/googleapis/nodejs-spanner/issues/1641)) ([91ef6d3](https://github.com/googleapis/nodejs-spanner/commit/91ef6d373a1ed2c7e191de4003571270bfc4e895))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **deps:** update dependency @google-cloud/promisify to v3 ([#1629](https://github.com/googleapis/nodejs-spanner/issues/1629)) ([1467956](https://github.com/googleapis/nodejs-spanner/commit/1467956314c77f66034fa3db166ba68d7c2aba2d))
|
|
34
|
+
* Improve spanner.date handling of years before 1000AD ([#1654](https://github.com/googleapis/nodejs-spanner/issues/1654)) ([fd89a29](https://github.com/googleapis/nodejs-spanner/commit/fd89a294dcab017dbbe7000bce613b0d4ed60f96))
|
|
35
|
+
|
|
7
36
|
## [6.0.0](https://github.com/googleapis/nodejs-spanner/compare/v5.18.0...v6.0.0) (2022-06-07)
|
|
8
37
|
|
|
9
38
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2022 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -179,7 +179,7 @@ service InstanceAdmin {
|
|
|
179
179
|
// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
|
|
180
180
|
//
|
|
181
181
|
// Authorization requires `spanner.instances.update` permission on
|
|
182
|
-
// resource [name][google.spanner.admin.instance.v1.Instance.name].
|
|
182
|
+
// the resource [name][google.spanner.admin.instance.v1.Instance.name].
|
|
183
183
|
rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) {
|
|
184
184
|
option (google.api.http) = {
|
|
185
185
|
patch: "/v1/{instance.name=projects/*/instances/*}"
|
|
@@ -309,7 +309,7 @@ message InstanceConfig {
|
|
|
309
309
|
|
|
310
310
|
// A unique identifier for the instance configuration. Values
|
|
311
311
|
// are of the form
|
|
312
|
-
// `projects/<project>/instanceConfigs/[a-z][-a-z0-9]
|
|
312
|
+
// `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
|
|
313
313
|
string name = 1;
|
|
314
314
|
|
|
315
315
|
// The name of this instance configuration as it appears in UIs.
|
|
@@ -319,7 +319,7 @@ message InstanceConfig {
|
|
|
319
319
|
// replication properties.
|
|
320
320
|
repeated ReplicaInfo replicas = 3;
|
|
321
321
|
|
|
322
|
-
// Allowed values of the
|
|
322
|
+
// Allowed values of the "default_leader" schema option for databases in
|
|
323
323
|
// instances that use this instance configuration.
|
|
324
324
|
repeated string leader_options = 4;
|
|
325
325
|
}
|
|
@@ -367,17 +367,23 @@ message Instance {
|
|
|
367
367
|
// Must be unique per project and between 4 and 30 characters in length.
|
|
368
368
|
string display_name = 3 [(google.api.field_behavior) = REQUIRED];
|
|
369
369
|
|
|
370
|
-
//
|
|
371
|
-
//
|
|
370
|
+
// The number of nodes allocated to this instance. At most one of either
|
|
371
|
+
// node_count or processing_units should be present in the message. This
|
|
372
|
+
// may be zero in API responses for instances that are not yet in state
|
|
373
|
+
// `READY`.
|
|
372
374
|
//
|
|
373
375
|
// See [the
|
|
374
|
-
// documentation](https://cloud.google.com/spanner/docs/
|
|
375
|
-
// for more information about nodes.
|
|
376
|
+
// documentation](https://cloud.google.com/spanner/docs/compute-capacity)
|
|
377
|
+
// for more information about nodes and processing units.
|
|
376
378
|
int32 node_count = 5;
|
|
377
379
|
|
|
378
380
|
// The number of processing units allocated to this instance. At most one of
|
|
379
381
|
// processing_units or node_count should be present in the message. This may
|
|
380
382
|
// be zero in API responses for instances that are not yet in state `READY`.
|
|
383
|
+
//
|
|
384
|
+
// See [the
|
|
385
|
+
// documentation](https://cloud.google.com/spanner/docs/compute-capacity)
|
|
386
|
+
// for more information about nodes and processing units.
|
|
381
387
|
int32 processing_units = 9;
|
|
382
388
|
|
|
383
389
|
// Output only. The current instance state. For
|
|
@@ -395,9 +401,9 @@ message Instance {
|
|
|
395
401
|
// firewall, load balancing, etc.).
|
|
396
402
|
//
|
|
397
403
|
// * Label keys must be between 1 and 63 characters long and must conform to
|
|
398
|
-
// the following regular expression: `[a-z]
|
|
404
|
+
// the following regular expression: `[a-z][a-z0-9_-]{0,62}`.
|
|
399
405
|
// * Label values must be between 0 and 63 characters long and must conform
|
|
400
|
-
// to the regular expression `
|
|
406
|
+
// to the regular expression `[a-z0-9_-]{0,63}`.
|
|
401
407
|
// * No more than 64 labels can be associated with a given resource.
|
|
402
408
|
//
|
|
403
409
|
// See https://goo.gl/xmQnxf for more information on and examples of labels.
|
|
@@ -412,6 +418,12 @@ message Instance {
|
|
|
412
418
|
|
|
413
419
|
// Deprecated. This field is not populated.
|
|
414
420
|
repeated string endpoint_uris = 8;
|
|
421
|
+
|
|
422
|
+
// Output only. The time at which the instance was created.
|
|
423
|
+
google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
424
|
+
|
|
425
|
+
// Output only. The time at which the instance was most recently updated.
|
|
426
|
+
google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
415
427
|
}
|
|
416
428
|
|
|
417
429
|
// The request for [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs].
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2022 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -17,7 +17,6 @@ syntax = "proto3";
|
|
|
17
17
|
package google.spanner.v1;
|
|
18
18
|
|
|
19
19
|
import "google/protobuf/struct.proto";
|
|
20
|
-
import "google/spanner/v1/commit_response.proto";
|
|
21
20
|
import "google/spanner/v1/query_plan.proto";
|
|
22
21
|
import "google/spanner/v1/transaction.proto";
|
|
23
22
|
import "google/spanner/v1/type.proto";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2022 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -358,6 +358,9 @@ message Session {
|
|
|
358
358
|
// Output only. The approximate timestamp when the session is last used. It is
|
|
359
359
|
// typically earlier than the actual last use time.
|
|
360
360
|
google.protobuf.Timestamp approximate_last_use_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
361
|
+
|
|
362
|
+
// The database role which created this session.
|
|
363
|
+
string creator_role = 5;
|
|
361
364
|
}
|
|
362
365
|
|
|
363
366
|
// The request for [GetSession][google.spanner.v1.Spanner.GetSession].
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2022 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -35,7 +35,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
35
35
|
// completed, the session can immediately be re-used for the next transaction.
|
|
36
36
|
// It is not necessary to create a new session for each transaction.
|
|
37
37
|
//
|
|
38
|
-
// Transaction
|
|
38
|
+
// Transaction modes:
|
|
39
|
+
//
|
|
39
40
|
// Cloud Spanner supports three transaction modes:
|
|
40
41
|
//
|
|
41
42
|
// 1. Locking read-write. This type of transaction is the only way
|
|
@@ -44,11 +45,18 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
44
45
|
// Locking read-write transactions may abort, requiring the
|
|
45
46
|
// application to retry.
|
|
46
47
|
//
|
|
47
|
-
// 2. Snapshot read-only.
|
|
48
|
-
// consistency across several reads, but
|
|
49
|
-
// writes. Snapshot read-only transactions can be configured to
|
|
50
|
-
//
|
|
51
|
-
//
|
|
48
|
+
// 2. Snapshot read-only. Snapshot read-only transactions provide guaranteed
|
|
49
|
+
// consistency across several reads, but do not allow
|
|
50
|
+
// writes. Snapshot read-only transactions can be configured to read at
|
|
51
|
+
// timestamps in the past, or configured to perform a strong read
|
|
52
|
+
// (where Spanner will select a timestamp such that the read is
|
|
53
|
+
// guaranteed to see the effects of all transactions that have committed
|
|
54
|
+
// before the start of the read). Snapshot read-only transactions do not
|
|
55
|
+
// need to be committed.
|
|
56
|
+
//
|
|
57
|
+
// Queries on change streams must be performed with the snapshot read-only
|
|
58
|
+
// transaction mode, specifying a strong read. Please see
|
|
59
|
+
// [TransactionOptions.ReadOnly.strong][google.spanner.v1.TransactionOptions.ReadOnly.strong] for more details.
|
|
52
60
|
//
|
|
53
61
|
// 3. Partitioned DML. This type of transaction is used to execute
|
|
54
62
|
// a single Partitioned DML statement. Partitioned DML partitions
|
|
@@ -63,11 +71,12 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
63
71
|
// not conflict with read-write transactions. As a consequence of not
|
|
64
72
|
// taking locks, they also do not abort, so retry loops are not needed.
|
|
65
73
|
//
|
|
66
|
-
// Transactions may only read
|
|
67
|
-
// may, however, read
|
|
74
|
+
// Transactions may only read-write data in a single database. They
|
|
75
|
+
// may, however, read-write data in different tables within that
|
|
68
76
|
// database.
|
|
69
77
|
//
|
|
70
|
-
// Locking
|
|
78
|
+
// Locking read-write transactions:
|
|
79
|
+
//
|
|
71
80
|
// Locking transactions may be used to atomically read-modify-write
|
|
72
81
|
// data anywhere in a database. This type of transaction is externally
|
|
73
82
|
// consistent.
|
|
@@ -78,7 +87,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
78
87
|
// active as long as the transaction continues to do reads, and the
|
|
79
88
|
// transaction has not been terminated by
|
|
80
89
|
// [Commit][google.spanner.v1.Spanner.Commit] or
|
|
81
|
-
// [Rollback][google.spanner.v1.Spanner.Rollback].
|
|
90
|
+
// [Rollback][google.spanner.v1.Spanner.Rollback]. Long periods of
|
|
82
91
|
// inactivity at the client may cause Cloud Spanner to release a
|
|
83
92
|
// transaction's locks and abort it.
|
|
84
93
|
//
|
|
@@ -90,6 +99,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
90
99
|
// transaction.
|
|
91
100
|
//
|
|
92
101
|
// Semantics:
|
|
102
|
+
//
|
|
93
103
|
// Cloud Spanner can commit the transaction if all read locks it acquired
|
|
94
104
|
// are still valid at commit time, and it is able to acquire write
|
|
95
105
|
// locks for all writes. Cloud Spanner can abort the transaction for any
|
|
@@ -101,7 +111,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
101
111
|
// use Cloud Spanner locks for any sort of mutual exclusion other than
|
|
102
112
|
// between Cloud Spanner transactions themselves.
|
|
103
113
|
//
|
|
104
|
-
// Retrying
|
|
114
|
+
// Retrying aborted transactions:
|
|
115
|
+
//
|
|
105
116
|
// When a transaction aborts, the application can choose to retry the
|
|
106
117
|
// whole transaction again. To maximize the chances of successfully
|
|
107
118
|
// committing the retry, the client should execute the retry in the
|
|
@@ -116,7 +127,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
116
127
|
// instead, it is better to limit the total amount of time spent
|
|
117
128
|
// retrying.
|
|
118
129
|
//
|
|
119
|
-
// Idle
|
|
130
|
+
// Idle transactions:
|
|
131
|
+
//
|
|
120
132
|
// A transaction is considered idle if it has no outstanding reads or
|
|
121
133
|
// SQL queries and has not started a read or SQL query within the last 10
|
|
122
134
|
// seconds. Idle transactions can be aborted by Cloud Spanner so that they
|
|
@@ -127,7 +139,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
127
139
|
// SQL query in the transaction (for example, `SELECT 1`) prevents the
|
|
128
140
|
// transaction from becoming idle.
|
|
129
141
|
//
|
|
130
|
-
// Snapshot
|
|
142
|
+
// Snapshot read-only transactions:
|
|
143
|
+
//
|
|
131
144
|
// Snapshot read-only transactions provides a simpler method than
|
|
132
145
|
// locking read-write transactions for doing several consistent
|
|
133
146
|
// reads. However, this type of transaction does not support writes.
|
|
@@ -159,13 +172,12 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
159
172
|
//
|
|
160
173
|
// If the Cloud Spanner database to be read is geographically distributed,
|
|
161
174
|
// stale read-only transactions can execute more quickly than strong
|
|
162
|
-
// or read-write
|
|
175
|
+
// or read-write transactions, because they are able to execute far
|
|
163
176
|
// from the leader replica.
|
|
164
177
|
//
|
|
165
178
|
// Each type of timestamp bound is discussed in detail below.
|
|
166
179
|
//
|
|
167
|
-
// Strong:
|
|
168
|
-
// Strong reads are guaranteed to see the effects of all transactions
|
|
180
|
+
// Strong: Strong reads are guaranteed to see the effects of all transactions
|
|
169
181
|
// that have committed before the start of the read. Furthermore, all
|
|
170
182
|
// rows yielded by a single read are consistent with each other -- if
|
|
171
183
|
// any part of the read observes a transaction, all parts of the read
|
|
@@ -177,9 +189,13 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
177
189
|
// reads should be executed within a transaction or at an exact read
|
|
178
190
|
// timestamp.
|
|
179
191
|
//
|
|
192
|
+
// Queries on change streams (see below for more details) must also specify
|
|
193
|
+
// the strong read timestamp bound.
|
|
194
|
+
//
|
|
180
195
|
// See [TransactionOptions.ReadOnly.strong][google.spanner.v1.TransactionOptions.ReadOnly.strong].
|
|
181
196
|
//
|
|
182
|
-
// Exact
|
|
197
|
+
// Exact staleness:
|
|
198
|
+
//
|
|
183
199
|
// These timestamp bounds execute reads at a user-specified
|
|
184
200
|
// timestamp. Reads at a timestamp are guaranteed to see a consistent
|
|
185
201
|
// prefix of the global transaction history: they observe
|
|
@@ -200,7 +216,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
200
216
|
// See [TransactionOptions.ReadOnly.read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.read_timestamp] and
|
|
201
217
|
// [TransactionOptions.ReadOnly.exact_staleness][google.spanner.v1.TransactionOptions.ReadOnly.exact_staleness].
|
|
202
218
|
//
|
|
203
|
-
// Bounded
|
|
219
|
+
// Bounded staleness:
|
|
220
|
+
//
|
|
204
221
|
// Bounded staleness modes allow Cloud Spanner to pick the read timestamp,
|
|
205
222
|
// subject to a user-provided staleness bound. Cloud Spanner chooses the
|
|
206
223
|
// newest timestamp within the staleness bound that allows execution
|
|
@@ -229,7 +246,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
229
246
|
// See [TransactionOptions.ReadOnly.max_staleness][google.spanner.v1.TransactionOptions.ReadOnly.max_staleness] and
|
|
230
247
|
// [TransactionOptions.ReadOnly.min_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.min_read_timestamp].
|
|
231
248
|
//
|
|
232
|
-
// Old
|
|
249
|
+
// Old read timestamps and garbage collection:
|
|
250
|
+
//
|
|
233
251
|
// Cloud Spanner continuously garbage collects deleted and overwritten data
|
|
234
252
|
// in the background to reclaim storage space. This process is known
|
|
235
253
|
// as "version GC". By default, version GC reclaims versions after they
|
|
@@ -239,7 +257,41 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
239
257
|
// timestamp become too old while executing. Reads and SQL queries with
|
|
240
258
|
// too-old read timestamps fail with the error `FAILED_PRECONDITION`.
|
|
241
259
|
//
|
|
242
|
-
//
|
|
260
|
+
// You can configure and extend the `VERSION_RETENTION_PERIOD` of a
|
|
261
|
+
// database up to a period as long as one week, which allows Cloud Spanner
|
|
262
|
+
// to perform reads up to one week in the past.
|
|
263
|
+
//
|
|
264
|
+
// Querying change Streams:
|
|
265
|
+
//
|
|
266
|
+
// A Change Stream is a schema object that can be configured to watch data
|
|
267
|
+
// changes on the entire database, a set of tables, or a set of columns
|
|
268
|
+
// in a database.
|
|
269
|
+
//
|
|
270
|
+
// When a change stream is created, Spanner automatically defines a
|
|
271
|
+
// corresponding SQL Table-Valued Function (TVF) that can be used to query
|
|
272
|
+
// the change records in the associated change stream using the
|
|
273
|
+
// ExecuteStreamingSql API. The name of the TVF for a change stream is
|
|
274
|
+
// generated from the name of the change stream: READ_<change_stream_name>.
|
|
275
|
+
//
|
|
276
|
+
// All queries on change stream TVFs must be executed using the
|
|
277
|
+
// ExecuteStreamingSql API with a single-use read-only transaction with a
|
|
278
|
+
// strong read-only timestamp_bound. The change stream TVF allows users to
|
|
279
|
+
// specify the start_timestamp and end_timestamp for the time range of
|
|
280
|
+
// interest. All change records within the retention period is accessible
|
|
281
|
+
// using the strong read-only timestamp_bound. All other TransactionOptions
|
|
282
|
+
// are invalid for change stream queries.
|
|
283
|
+
//
|
|
284
|
+
// In addition, if TransactionOptions.read_only.return_read_timestamp is set
|
|
285
|
+
// to true, a special value of 2^63 - 2 will be returned in the
|
|
286
|
+
// [Transaction][google.spanner.v1.Transaction] message that describes the
|
|
287
|
+
// transaction, instead of a valid read timestamp. This special value should be
|
|
288
|
+
// discarded and not used for any subsequent queries.
|
|
289
|
+
//
|
|
290
|
+
// Please see https://cloud.google.com/spanner/docs/change-streams
|
|
291
|
+
// for more details on how to query the change stream TVFs.
|
|
292
|
+
//
|
|
293
|
+
// Partitioned DML transactions:
|
|
294
|
+
//
|
|
243
295
|
// Partitioned DML transactions are used to execute DML statements with a
|
|
244
296
|
// different execution strategy that provides different, and often better,
|
|
245
297
|
// scalability properties for large, table-wide operations than DML in a
|
package/build/protos/protos.d.ts
CHANGED
|
@@ -10085,6 +10085,12 @@ export namespace google {
|
|
|
10085
10085
|
|
|
10086
10086
|
/** Instance endpointUris */
|
|
10087
10087
|
endpointUris?: (string[]|null);
|
|
10088
|
+
|
|
10089
|
+
/** Instance createTime */
|
|
10090
|
+
createTime?: (google.protobuf.ITimestamp|null);
|
|
10091
|
+
|
|
10092
|
+
/** Instance updateTime */
|
|
10093
|
+
updateTime?: (google.protobuf.ITimestamp|null);
|
|
10088
10094
|
}
|
|
10089
10095
|
|
|
10090
10096
|
/** Represents an Instance. */
|
|
@@ -10120,6 +10126,12 @@ export namespace google {
|
|
|
10120
10126
|
/** Instance endpointUris. */
|
|
10121
10127
|
public endpointUris: string[];
|
|
10122
10128
|
|
|
10129
|
+
/** Instance createTime. */
|
|
10130
|
+
public createTime?: (google.protobuf.ITimestamp|null);
|
|
10131
|
+
|
|
10132
|
+
/** Instance updateTime. */
|
|
10133
|
+
public updateTime?: (google.protobuf.ITimestamp|null);
|
|
10134
|
+
|
|
10123
10135
|
/**
|
|
10124
10136
|
* Creates a new Instance instance using the specified properties.
|
|
10125
10137
|
* @param [properties] Properties to set
|
|
@@ -14429,6 +14441,9 @@ export namespace google {
|
|
|
14429
14441
|
|
|
14430
14442
|
/** Session approximateLastUseTime */
|
|
14431
14443
|
approximateLastUseTime?: (google.protobuf.ITimestamp|null);
|
|
14444
|
+
|
|
14445
|
+
/** Session creatorRole */
|
|
14446
|
+
creatorRole?: (string|null);
|
|
14432
14447
|
}
|
|
14433
14448
|
|
|
14434
14449
|
/** Represents a Session. */
|
|
@@ -14452,6 +14467,9 @@ export namespace google {
|
|
|
14452
14467
|
/** Session approximateLastUseTime. */
|
|
14453
14468
|
public approximateLastUseTime?: (google.protobuf.ITimestamp|null);
|
|
14454
14469
|
|
|
14470
|
+
/** Session creatorRole. */
|
|
14471
|
+
public creatorRole: string;
|
|
14472
|
+
|
|
14455
14473
|
/**
|
|
14456
14474
|
* Creates a new Session instance using the specified properties.
|
|
14457
14475
|
* @param [properties] Properties to set
|
package/build/protos/protos.js
CHANGED
|
@@ -24900,6 +24900,8 @@
|
|
|
24900
24900
|
* @property {google.spanner.admin.instance.v1.Instance.State|null} [state] Instance state
|
|
24901
24901
|
* @property {Object.<string,string>|null} [labels] Instance labels
|
|
24902
24902
|
* @property {Array.<string>|null} [endpointUris] Instance endpointUris
|
|
24903
|
+
* @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime
|
|
24904
|
+
* @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime
|
|
24903
24905
|
*/
|
|
24904
24906
|
|
|
24905
24907
|
/**
|
|
@@ -24983,6 +24985,22 @@
|
|
|
24983
24985
|
*/
|
|
24984
24986
|
Instance.prototype.endpointUris = $util.emptyArray;
|
|
24985
24987
|
|
|
24988
|
+
/**
|
|
24989
|
+
* Instance createTime.
|
|
24990
|
+
* @member {google.protobuf.ITimestamp|null|undefined} createTime
|
|
24991
|
+
* @memberof google.spanner.admin.instance.v1.Instance
|
|
24992
|
+
* @instance
|
|
24993
|
+
*/
|
|
24994
|
+
Instance.prototype.createTime = null;
|
|
24995
|
+
|
|
24996
|
+
/**
|
|
24997
|
+
* Instance updateTime.
|
|
24998
|
+
* @member {google.protobuf.ITimestamp|null|undefined} updateTime
|
|
24999
|
+
* @memberof google.spanner.admin.instance.v1.Instance
|
|
25000
|
+
* @instance
|
|
25001
|
+
*/
|
|
25002
|
+
Instance.prototype.updateTime = null;
|
|
25003
|
+
|
|
24986
25004
|
/**
|
|
24987
25005
|
* Creates a new Instance instance using the specified properties.
|
|
24988
25006
|
* @function create
|
|
@@ -25025,6 +25043,10 @@
|
|
|
25025
25043
|
writer.uint32(/* id 8, wireType 2 =*/66).string(message.endpointUris[i]);
|
|
25026
25044
|
if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits"))
|
|
25027
25045
|
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.processingUnits);
|
|
25046
|
+
if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
|
|
25047
|
+
$root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
|
|
25048
|
+
if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
|
|
25049
|
+
$root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
|
|
25028
25050
|
return writer;
|
|
25029
25051
|
};
|
|
25030
25052
|
|
|
@@ -25104,6 +25126,12 @@
|
|
|
25104
25126
|
message.endpointUris = [];
|
|
25105
25127
|
message.endpointUris.push(reader.string());
|
|
25106
25128
|
break;
|
|
25129
|
+
case 11:
|
|
25130
|
+
message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
25131
|
+
break;
|
|
25132
|
+
case 12:
|
|
25133
|
+
message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
25134
|
+
break;
|
|
25107
25135
|
default:
|
|
25108
25136
|
reader.skipType(tag & 7);
|
|
25109
25137
|
break;
|
|
@@ -25178,6 +25206,16 @@
|
|
|
25178
25206
|
if (!$util.isString(message.endpointUris[i]))
|
|
25179
25207
|
return "endpointUris: string[] expected";
|
|
25180
25208
|
}
|
|
25209
|
+
if (message.createTime != null && message.hasOwnProperty("createTime")) {
|
|
25210
|
+
var error = $root.google.protobuf.Timestamp.verify(message.createTime);
|
|
25211
|
+
if (error)
|
|
25212
|
+
return "createTime." + error;
|
|
25213
|
+
}
|
|
25214
|
+
if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
|
|
25215
|
+
var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
|
|
25216
|
+
if (error)
|
|
25217
|
+
return "updateTime." + error;
|
|
25218
|
+
}
|
|
25181
25219
|
return null;
|
|
25182
25220
|
};
|
|
25183
25221
|
|
|
@@ -25231,6 +25269,16 @@
|
|
|
25231
25269
|
for (var i = 0; i < object.endpointUris.length; ++i)
|
|
25232
25270
|
message.endpointUris[i] = String(object.endpointUris[i]);
|
|
25233
25271
|
}
|
|
25272
|
+
if (object.createTime != null) {
|
|
25273
|
+
if (typeof object.createTime !== "object")
|
|
25274
|
+
throw TypeError(".google.spanner.admin.instance.v1.Instance.createTime: object expected");
|
|
25275
|
+
message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
|
|
25276
|
+
}
|
|
25277
|
+
if (object.updateTime != null) {
|
|
25278
|
+
if (typeof object.updateTime !== "object")
|
|
25279
|
+
throw TypeError(".google.spanner.admin.instance.v1.Instance.updateTime: object expected");
|
|
25280
|
+
message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
|
|
25281
|
+
}
|
|
25234
25282
|
return message;
|
|
25235
25283
|
};
|
|
25236
25284
|
|
|
@@ -25258,6 +25306,8 @@
|
|
|
25258
25306
|
object.nodeCount = 0;
|
|
25259
25307
|
object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
|
|
25260
25308
|
object.processingUnits = 0;
|
|
25309
|
+
object.createTime = null;
|
|
25310
|
+
object.updateTime = null;
|
|
25261
25311
|
}
|
|
25262
25312
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
25263
25313
|
object.name = message.name;
|
|
@@ -25282,6 +25332,10 @@
|
|
|
25282
25332
|
}
|
|
25283
25333
|
if (message.processingUnits != null && message.hasOwnProperty("processingUnits"))
|
|
25284
25334
|
object.processingUnits = message.processingUnits;
|
|
25335
|
+
if (message.createTime != null && message.hasOwnProperty("createTime"))
|
|
25336
|
+
object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
|
|
25337
|
+
if (message.updateTime != null && message.hasOwnProperty("updateTime"))
|
|
25338
|
+
object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
|
|
25285
25339
|
return object;
|
|
25286
25340
|
};
|
|
25287
25341
|
|
|
@@ -35385,6 +35439,7 @@
|
|
|
35385
35439
|
* @property {Object.<string,string>|null} [labels] Session labels
|
|
35386
35440
|
* @property {google.protobuf.ITimestamp|null} [createTime] Session createTime
|
|
35387
35441
|
* @property {google.protobuf.ITimestamp|null} [approximateLastUseTime] Session approximateLastUseTime
|
|
35442
|
+
* @property {string|null} [creatorRole] Session creatorRole
|
|
35388
35443
|
*/
|
|
35389
35444
|
|
|
35390
35445
|
/**
|
|
@@ -35435,6 +35490,14 @@
|
|
|
35435
35490
|
*/
|
|
35436
35491
|
Session.prototype.approximateLastUseTime = null;
|
|
35437
35492
|
|
|
35493
|
+
/**
|
|
35494
|
+
* Session creatorRole.
|
|
35495
|
+
* @member {string} creatorRole
|
|
35496
|
+
* @memberof google.spanner.v1.Session
|
|
35497
|
+
* @instance
|
|
35498
|
+
*/
|
|
35499
|
+
Session.prototype.creatorRole = "";
|
|
35500
|
+
|
|
35438
35501
|
/**
|
|
35439
35502
|
* Creates a new Session instance using the specified properties.
|
|
35440
35503
|
* @function create
|
|
@@ -35468,6 +35531,8 @@
|
|
|
35468
35531
|
$root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
35469
35532
|
if (message.approximateLastUseTime != null && Object.hasOwnProperty.call(message, "approximateLastUseTime"))
|
|
35470
35533
|
$root.google.protobuf.Timestamp.encode(message.approximateLastUseTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
|
35534
|
+
if (message.creatorRole != null && Object.hasOwnProperty.call(message, "creatorRole"))
|
|
35535
|
+
writer.uint32(/* id 5, wireType 2 =*/42).string(message.creatorRole);
|
|
35471
35536
|
return writer;
|
|
35472
35537
|
};
|
|
35473
35538
|
|
|
@@ -35533,6 +35598,9 @@
|
|
|
35533
35598
|
case 4:
|
|
35534
35599
|
message.approximateLastUseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
35535
35600
|
break;
|
|
35601
|
+
case 5:
|
|
35602
|
+
message.creatorRole = reader.string();
|
|
35603
|
+
break;
|
|
35536
35604
|
default:
|
|
35537
35605
|
reader.skipType(tag & 7);
|
|
35538
35606
|
break;
|
|
@@ -35589,6 +35657,9 @@
|
|
|
35589
35657
|
if (error)
|
|
35590
35658
|
return "approximateLastUseTime." + error;
|
|
35591
35659
|
}
|
|
35660
|
+
if (message.creatorRole != null && message.hasOwnProperty("creatorRole"))
|
|
35661
|
+
if (!$util.isString(message.creatorRole))
|
|
35662
|
+
return "creatorRole: string expected";
|
|
35592
35663
|
return null;
|
|
35593
35664
|
};
|
|
35594
35665
|
|
|
@@ -35623,6 +35694,8 @@
|
|
|
35623
35694
|
throw TypeError(".google.spanner.v1.Session.approximateLastUseTime: object expected");
|
|
35624
35695
|
message.approximateLastUseTime = $root.google.protobuf.Timestamp.fromObject(object.approximateLastUseTime);
|
|
35625
35696
|
}
|
|
35697
|
+
if (object.creatorRole != null)
|
|
35698
|
+
message.creatorRole = String(object.creatorRole);
|
|
35626
35699
|
return message;
|
|
35627
35700
|
};
|
|
35628
35701
|
|
|
@@ -35645,6 +35718,7 @@
|
|
|
35645
35718
|
object.name = "";
|
|
35646
35719
|
object.createTime = null;
|
|
35647
35720
|
object.approximateLastUseTime = null;
|
|
35721
|
+
object.creatorRole = "";
|
|
35648
35722
|
}
|
|
35649
35723
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
35650
35724
|
object.name = message.name;
|
|
@@ -35658,6 +35732,8 @@
|
|
|
35658
35732
|
object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
|
|
35659
35733
|
if (message.approximateLastUseTime != null && message.hasOwnProperty("approximateLastUseTime"))
|
|
35660
35734
|
object.approximateLastUseTime = $root.google.protobuf.Timestamp.toObject(message.approximateLastUseTime, options);
|
|
35735
|
+
if (message.creatorRole != null && message.hasOwnProperty("creatorRole"))
|
|
35736
|
+
object.creatorRole = message.creatorRole;
|
|
35661
35737
|
return object;
|
|
35662
35738
|
};
|
|
35663
35739
|
|
package/build/protos/protos.json
CHANGED
|
@@ -2949,6 +2949,20 @@
|
|
|
2949
2949
|
"rule": "repeated",
|
|
2950
2950
|
"type": "string",
|
|
2951
2951
|
"id": 8
|
|
2952
|
+
},
|
|
2953
|
+
"createTime": {
|
|
2954
|
+
"type": "google.protobuf.Timestamp",
|
|
2955
|
+
"id": 11,
|
|
2956
|
+
"options": {
|
|
2957
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
2958
|
+
}
|
|
2959
|
+
},
|
|
2960
|
+
"updateTime": {
|
|
2961
|
+
"type": "google.protobuf.Timestamp",
|
|
2962
|
+
"id": 12,
|
|
2963
|
+
"options": {
|
|
2964
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
2965
|
+
}
|
|
2952
2966
|
}
|
|
2953
2967
|
},
|
|
2954
2968
|
"nested": {
|
|
@@ -4025,6 +4039,10 @@
|
|
|
4025
4039
|
"options": {
|
|
4026
4040
|
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
4027
4041
|
}
|
|
4042
|
+
},
|
|
4043
|
+
"creatorRole": {
|
|
4044
|
+
"type": "string",
|
|
4045
|
+
"id": 5
|
|
4028
4046
|
}
|
|
4029
4047
|
}
|
|
4030
4048
|
},
|
package/build/src/codec.d.ts
CHANGED
package/build/src/codec.js
CHANGED
|
@@ -67,21 +67,15 @@ class SpannerDate extends Date {
|
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* Returns the date in ISO date format.
|
|
70
|
-
* `YYYY-
|
|
70
|
+
* `YYYY-MM-DD`
|
|
71
71
|
*
|
|
72
72
|
* @returns {string}
|
|
73
73
|
*/
|
|
74
74
|
toJSON() {
|
|
75
|
-
const year = this.getFullYear();
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
month = `0${month}`;
|
|
80
|
-
}
|
|
81
|
-
if (date.length === 1) {
|
|
82
|
-
date = `0${date}`;
|
|
83
|
-
}
|
|
84
|
-
return `${year}-${month}-${date}`;
|
|
75
|
+
const year = this.getFullYear().toString();
|
|
76
|
+
const month = (this.getMonth() + 1).toString();
|
|
77
|
+
const date = this.getDate().toString();
|
|
78
|
+
return `${year.padStart(4, '0')}-${month.padStart(2, '0')}-${date.padStart(2, '0')}`;
|
|
85
79
|
}
|
|
86
80
|
}
|
|
87
81
|
exports.SpannerDate = SpannerDate;
|
|
@@ -701,12 +701,15 @@ class SessionPool extends events_1.EventEmitter {
|
|
|
701
701
|
if (this.isFull && this.options.fail) {
|
|
702
702
|
throw new SessionPoolExhaustedError(this._getLeaks());
|
|
703
703
|
}
|
|
704
|
+
let removeOnceCloseListener;
|
|
704
705
|
let removeListener;
|
|
705
706
|
// Wait for the requested type of session to become available.
|
|
706
707
|
const availableEvent = type + '-available';
|
|
707
708
|
const promises = [
|
|
708
|
-
|
|
709
|
-
|
|
709
|
+
new Promise((_, reject) => {
|
|
710
|
+
const onceCloseListener = () => reject(new google_gax_1.GoogleError("Database is closed." /* errors.Closed */));
|
|
711
|
+
this.once('close', onceCloseListener);
|
|
712
|
+
removeOnceCloseListener = this.removeListener.bind(this, 'close', onceCloseListener);
|
|
710
713
|
}),
|
|
711
714
|
new Promise(resolve => {
|
|
712
715
|
this.once(availableEvent, resolve);
|
|
@@ -758,6 +761,7 @@ class SessionPool extends events_1.EventEmitter {
|
|
|
758
761
|
}
|
|
759
762
|
finally {
|
|
760
763
|
this._waiters[type]--;
|
|
764
|
+
removeOnceCloseListener();
|
|
761
765
|
removeListener();
|
|
762
766
|
removeErrorListener();
|
|
763
767
|
removeTimeoutListener();
|
|
@@ -40,7 +40,7 @@ export declare class DatabaseAdminClient {
|
|
|
40
40
|
*
|
|
41
41
|
* @param {object} [options] - The configuration object.
|
|
42
42
|
* The options accepted by the constructor are described in detail
|
|
43
|
-
* in [this document](https://github.com/googleapis/gax-nodejs/blob/
|
|
43
|
+
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
|
44
44
|
* The common options are:
|
|
45
45
|
* @param {object} [options.credentials] - Credentials object.
|
|
46
46
|
* @param {string} [options.credentials.client_email]
|
|
@@ -63,11 +63,10 @@ export declare class DatabaseAdminClient {
|
|
|
63
63
|
* API remote host.
|
|
64
64
|
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
65
65
|
* Follows the structure of {@link gapicConfig}.
|
|
66
|
-
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* if you need to override this behavior.
|
|
66
|
+
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
|
|
67
|
+
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
|
68
|
+
* For more information, please check the
|
|
69
|
+
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
71
70
|
*/
|
|
72
71
|
constructor(opts?: ClientOptions);
|
|
73
72
|
/**
|
|
@@ -46,7 +46,7 @@ class DatabaseAdminClient {
|
|
|
46
46
|
*
|
|
47
47
|
* @param {object} [options] - The configuration object.
|
|
48
48
|
* The options accepted by the constructor are described in detail
|
|
49
|
-
* in [this document](https://github.com/googleapis/gax-nodejs/blob/
|
|
49
|
+
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
|
50
50
|
* The common options are:
|
|
51
51
|
* @param {object} [options.credentials] - Credentials object.
|
|
52
52
|
* @param {string} [options.credentials.client_email]
|
|
@@ -69,11 +69,10 @@ class DatabaseAdminClient {
|
|
|
69
69
|
* API remote host.
|
|
70
70
|
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
71
71
|
* Follows the structure of {@link gapicConfig}.
|
|
72
|
-
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* if you need to override this behavior.
|
|
72
|
+
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
|
|
73
|
+
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
|
74
|
+
* For more information, please check the
|
|
75
|
+
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
77
76
|
*/
|
|
78
77
|
constructor(opts) {
|
|
79
78
|
var _a, _b;
|
|
@@ -153,11 +152,45 @@ class DatabaseAdminClient {
|
|
|
153
152
|
// This API contains "long-running operations", which return a
|
|
154
153
|
// an Operation object that allows for tracking of the operation,
|
|
155
154
|
// rather than holding a request open.
|
|
156
|
-
|
|
157
|
-
.lro({
|
|
155
|
+
const lroOptions = {
|
|
158
156
|
auth: this.auth,
|
|
159
157
|
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
|
|
160
|
-
}
|
|
158
|
+
};
|
|
159
|
+
if (opts.fallback === 'rest') {
|
|
160
|
+
lroOptions.protoJson = protoFilesRoot;
|
|
161
|
+
lroOptions.httpRules = [
|
|
162
|
+
{
|
|
163
|
+
selector: 'google.longrunning.Operations.GetOperation',
|
|
164
|
+
get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
|
|
165
|
+
additional_bindings: [
|
|
166
|
+
{ get: '/v1/{name=projects/*/instances/*/operations/*}' },
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
selector: 'google.longrunning.Operations.ListOperations',
|
|
171
|
+
get: '/v1/{name=projects/*/instances/*/databases/*/operations}',
|
|
172
|
+
additional_bindings: [
|
|
173
|
+
{ get: '/v1/{name=projects/*/instances/*/operations}' },
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
selector: 'google.longrunning.Operations.CancelOperation',
|
|
178
|
+
post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',
|
|
179
|
+
additional_bindings: [
|
|
180
|
+
{ post: '/v1/{name=projects/*/instances/*/operations/*}:cancel' },
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
selector: 'google.longrunning.Operations.DeleteOperation',
|
|
185
|
+
delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
|
|
186
|
+
additional_bindings: [
|
|
187
|
+
{ delete: '/v1/{name=projects/*/instances/*/operations/*}' },
|
|
188
|
+
],
|
|
189
|
+
},
|
|
190
|
+
];
|
|
191
|
+
}
|
|
192
|
+
this.operationsClient = this._gaxModule
|
|
193
|
+
.lro(lroOptions)
|
|
161
194
|
.operationsClient(opts);
|
|
162
195
|
const createDatabaseResponse = protoFilesRoot.lookup('.google.spanner.admin.database.v1.Database');
|
|
163
196
|
const createDatabaseMetadata = protoFilesRoot.lookup('.google.spanner.admin.database.v1.CreateDatabaseMetadata');
|
|
@@ -54,7 +54,7 @@ export declare class InstanceAdminClient {
|
|
|
54
54
|
*
|
|
55
55
|
* @param {object} [options] - The configuration object.
|
|
56
56
|
* The options accepted by the constructor are described in detail
|
|
57
|
-
* in [this document](https://github.com/googleapis/gax-nodejs/blob/
|
|
57
|
+
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
|
58
58
|
* The common options are:
|
|
59
59
|
* @param {object} [options.credentials] - Credentials object.
|
|
60
60
|
* @param {string} [options.credentials.client_email]
|
|
@@ -77,11 +77,10 @@ export declare class InstanceAdminClient {
|
|
|
77
77
|
* API remote host.
|
|
78
78
|
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
79
79
|
* Follows the structure of {@link gapicConfig}.
|
|
80
|
-
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* if you need to override this behavior.
|
|
80
|
+
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
|
|
81
|
+
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
|
82
|
+
* For more information, please check the
|
|
83
|
+
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
85
84
|
*/
|
|
86
85
|
constructor(opts?: ClientOptions);
|
|
87
86
|
/**
|
|
@@ -438,7 +437,7 @@ export declare class InstanceAdminClient {
|
|
|
438
437
|
* {@link google.spanner.admin.instance.v1.Instance|Instance}, if successful.
|
|
439
438
|
*
|
|
440
439
|
* Authorization requires `spanner.instances.update` permission on
|
|
441
|
-
* resource {@link google.spanner.admin.instance.v1.Instance.name|name}.
|
|
440
|
+
* the resource {@link google.spanner.admin.instance.v1.Instance.name|name}.
|
|
442
441
|
*
|
|
443
442
|
* @param {Object} request
|
|
444
443
|
* The request object that will be sent.
|
|
@@ -60,7 +60,7 @@ class InstanceAdminClient {
|
|
|
60
60
|
*
|
|
61
61
|
* @param {object} [options] - The configuration object.
|
|
62
62
|
* The options accepted by the constructor are described in detail
|
|
63
|
-
* in [this document](https://github.com/googleapis/gax-nodejs/blob/
|
|
63
|
+
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
|
64
64
|
* The common options are:
|
|
65
65
|
* @param {object} [options.credentials] - Credentials object.
|
|
66
66
|
* @param {string} [options.credentials.client_email]
|
|
@@ -83,11 +83,10 @@ class InstanceAdminClient {
|
|
|
83
83
|
* API remote host.
|
|
84
84
|
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
85
85
|
* Follows the structure of {@link gapicConfig}.
|
|
86
|
-
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* if you need to override this behavior.
|
|
86
|
+
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
|
|
87
|
+
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
|
88
|
+
* For more information, please check the
|
|
89
|
+
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
91
90
|
*/
|
|
92
91
|
constructor(opts) {
|
|
93
92
|
var _a, _b;
|
|
@@ -164,11 +163,45 @@ class InstanceAdminClient {
|
|
|
164
163
|
// This API contains "long-running operations", which return a
|
|
165
164
|
// an Operation object that allows for tracking of the operation,
|
|
166
165
|
// rather than holding a request open.
|
|
167
|
-
|
|
168
|
-
.lro({
|
|
166
|
+
const lroOptions = {
|
|
169
167
|
auth: this.auth,
|
|
170
168
|
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
|
|
171
|
-
}
|
|
169
|
+
};
|
|
170
|
+
if (opts.fallback === 'rest') {
|
|
171
|
+
lroOptions.protoJson = protoFilesRoot;
|
|
172
|
+
lroOptions.httpRules = [
|
|
173
|
+
{
|
|
174
|
+
selector: 'google.longrunning.Operations.GetOperation',
|
|
175
|
+
get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
|
|
176
|
+
additional_bindings: [
|
|
177
|
+
{ get: '/v1/{name=projects/*/instances/*/operations/*}' },
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
selector: 'google.longrunning.Operations.ListOperations',
|
|
182
|
+
get: '/v1/{name=projects/*/instances/*/databases/*/operations}',
|
|
183
|
+
additional_bindings: [
|
|
184
|
+
{ get: '/v1/{name=projects/*/instances/*/operations}' },
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
selector: 'google.longrunning.Operations.CancelOperation',
|
|
189
|
+
post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',
|
|
190
|
+
additional_bindings: [
|
|
191
|
+
{ post: '/v1/{name=projects/*/instances/*/operations/*}:cancel' },
|
|
192
|
+
],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
selector: 'google.longrunning.Operations.DeleteOperation',
|
|
196
|
+
delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
|
|
197
|
+
additional_bindings: [
|
|
198
|
+
{ delete: '/v1/{name=projects/*/instances/*/operations/*}' },
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
];
|
|
202
|
+
}
|
|
203
|
+
this.operationsClient = this._gaxModule
|
|
204
|
+
.lro(lroOptions)
|
|
172
205
|
.operationsClient(opts);
|
|
173
206
|
const createInstanceResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.Instance');
|
|
174
207
|
const createInstanceMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.CreateInstanceMetadata');
|
|
@@ -36,7 +36,7 @@ export declare class SpannerClient {
|
|
|
36
36
|
*
|
|
37
37
|
* @param {object} [options] - The configuration object.
|
|
38
38
|
* The options accepted by the constructor are described in detail
|
|
39
|
-
* in [this document](https://github.com/googleapis/gax-nodejs/blob/
|
|
39
|
+
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
|
40
40
|
* The common options are:
|
|
41
41
|
* @param {object} [options.credentials] - Credentials object.
|
|
42
42
|
* @param {string} [options.credentials.client_email]
|
|
@@ -59,11 +59,10 @@ export declare class SpannerClient {
|
|
|
59
59
|
* API remote host.
|
|
60
60
|
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
61
61
|
* Follows the structure of {@link gapicConfig}.
|
|
62
|
-
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* if you need to override this behavior.
|
|
62
|
+
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
|
|
63
|
+
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
|
64
|
+
* For more information, please check the
|
|
65
|
+
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
67
66
|
*/
|
|
68
67
|
constructor(opts?: ClientOptions);
|
|
69
68
|
/**
|
|
@@ -44,7 +44,7 @@ class SpannerClient {
|
|
|
44
44
|
*
|
|
45
45
|
* @param {object} [options] - The configuration object.
|
|
46
46
|
* The options accepted by the constructor are described in detail
|
|
47
|
-
* in [this document](https://github.com/googleapis/gax-nodejs/blob/
|
|
47
|
+
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
|
48
48
|
* The common options are:
|
|
49
49
|
* @param {object} [options.credentials] - Credentials object.
|
|
50
50
|
* @param {string} [options.credentials.client_email]
|
|
@@ -67,11 +67,10 @@ class SpannerClient {
|
|
|
67
67
|
* API remote host.
|
|
68
68
|
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
69
69
|
* Follows the structure of {@link gapicConfig}.
|
|
70
|
-
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* if you need to override this behavior.
|
|
70
|
+
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
|
|
71
|
+
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
|
72
|
+
* For more information, please check the
|
|
73
|
+
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
75
74
|
*/
|
|
76
75
|
constructor(opts) {
|
|
77
76
|
var _a, _b;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-cloud/spanner",
|
|
3
3
|
"description": "Cloud Spanner Client Library for Node.js",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.1.2",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Google Inc.",
|
|
7
7
|
"engines": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@google-cloud/common": "^3.0.0",
|
|
54
54
|
"@google-cloud/precise-date": "^2.0.0",
|
|
55
55
|
"@google-cloud/projectify": "^2.0.0",
|
|
56
|
-
"@google-cloud/promisify": "^
|
|
56
|
+
"@google-cloud/promisify": "^3.0.0",
|
|
57
57
|
"@types/big.js": "^6.0.0",
|
|
58
58
|
"@types/stack-trace": "0.0.29",
|
|
59
59
|
"arrify": "^2.0.0",
|
|
@@ -110,11 +110,11 @@
|
|
|
110
110
|
"retry-request": "^5.0.0",
|
|
111
111
|
"sinon": "^14.0.0",
|
|
112
112
|
"stats-lite": "^2.1.1",
|
|
113
|
-
"teeny-request": "^
|
|
113
|
+
"teeny-request": "^8.0.0",
|
|
114
114
|
"time-span": "^4.0.0",
|
|
115
115
|
"tmp": "^0.2.0",
|
|
116
116
|
"typescript": "^4.6.4",
|
|
117
117
|
"uuid": "^8.0.0",
|
|
118
|
-
"yargs": "^
|
|
118
|
+
"yargs": "^17.0.0"
|
|
119
119
|
}
|
|
120
120
|
}
|