@google-cloud/spanner 5.17.0 → 6.1.0

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +16 -0
  3. package/build/protos/google/spanner/admin/database/v1/backup.proto +174 -9
  4. package/build/protos/google/spanner/admin/database/v1/common.proto +1 -2
  5. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +27 -2
  6. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +22 -10
  7. package/build/protos/google/spanner/v1/commit_response.proto +1 -3
  8. package/build/protos/google/spanner/v1/keys.proto +1 -2
  9. package/build/protos/google/spanner/v1/mutation.proto +1 -2
  10. package/build/protos/google/spanner/v1/query_plan.proto +1 -2
  11. package/build/protos/google/spanner/v1/result_set.proto +1 -3
  12. package/build/protos/google/spanner/v1/spanner.proto +4 -1
  13. package/build/protos/google/spanner/v1/transaction.proto +73 -22
  14. package/build/protos/google/spanner/v1/type.proto +1 -2
  15. package/build/protos/protos.d.ts +883 -282
  16. package/build/protos/protos.js +2447 -880
  17. package/build/protos/protos.json +297 -87
  18. package/build/src/backup.d.ts +27 -5
  19. package/build/src/backup.js +62 -31
  20. package/build/src/batch-transaction.js +1 -1
  21. package/build/src/codec.d.ts +12 -1
  22. package/build/src/codec.js +44 -13
  23. package/build/src/common-grpc/service-object.js +1 -1
  24. package/build/src/common-grpc/service.js +2 -2
  25. package/build/src/database.d.ts +26 -6
  26. package/build/src/database.js +8 -8
  27. package/build/src/index.d.ts +18 -3
  28. package/build/src/index.js +26 -7
  29. package/build/src/instance.d.ts +41 -1
  30. package/build/src/instance.js +56 -2
  31. package/build/src/session-pool.d.ts +1 -0
  32. package/build/src/session-pool.js +46 -46
  33. package/build/src/session.js +1 -1
  34. package/build/src/table.d.ts +5 -1
  35. package/build/src/table.js +1 -1
  36. package/build/src/transaction-runner.js +3 -3
  37. package/build/src/transaction.d.ts +10 -2
  38. package/build/src/transaction.js +12 -12
  39. package/build/src/v1/database_admin_client.d.ts +267 -30
  40. package/build/src/v1/database_admin_client.js +148 -13
  41. package/build/src/v1/database_admin_client_config.json +5 -0
  42. package/build/src/v1/index.js +1 -0
  43. package/build/src/v1/instance_admin_client.d.ts +63 -18
  44. package/build/src/v1/instance_admin_client.js +42 -9
  45. package/build/src/v1/spanner_client.d.ts +70 -19
  46. package/build/src/v1/spanner_client.js +7 -8
  47. package/package.json +12 -12
@@ -1,4 +1,4 @@
1
- // Copyright 2021 Google LLC
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.
@@ -16,7 +16,6 @@ syntax = "proto3";
16
16
 
17
17
  package google.spanner.v1;
18
18
 
19
- import "google/api/annotations.proto";
20
19
  import "google/protobuf/duration.proto";
21
20
  import "google/protobuf/timestamp.proto";
22
21
 
@@ -36,7 +35,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
36
35
  // completed, the session can immediately be re-used for the next transaction.
37
36
  // It is not necessary to create a new session for each transaction.
38
37
  //
39
- // Transaction Modes:
38
+ // Transaction modes:
39
+ //
40
40
  // Cloud Spanner supports three transaction modes:
41
41
  //
42
42
  // 1. Locking read-write. This type of transaction is the only way
@@ -45,11 +45,18 @@ option ruby_package = "Google::Cloud::Spanner::V1";
45
45
  // Locking read-write transactions may abort, requiring the
46
46
  // application to retry.
47
47
  //
48
- // 2. Snapshot read-only. This transaction type provides guaranteed
49
- // consistency across several reads, but does not allow
50
- // writes. Snapshot read-only transactions can be configured to
51
- // read at timestamps in the past. Snapshot read-only
52
- // transactions do not need to be committed.
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.
53
60
  //
54
61
  // 3. Partitioned DML. This type of transaction is used to execute
55
62
  // a single Partitioned DML statement. Partitioned DML partitions
@@ -64,11 +71,12 @@ option ruby_package = "Google::Cloud::Spanner::V1";
64
71
  // not conflict with read-write transactions. As a consequence of not
65
72
  // taking locks, they also do not abort, so retry loops are not needed.
66
73
  //
67
- // Transactions may only read/write data in a single database. They
68
- // may, however, read/write data in different tables within that
74
+ // Transactions may only read-write data in a single database. They
75
+ // may, however, read-write data in different tables within that
69
76
  // database.
70
77
  //
71
- // Locking Read-Write Transactions:
78
+ // Locking read-write transactions:
79
+ //
72
80
  // Locking transactions may be used to atomically read-modify-write
73
81
  // data anywhere in a database. This type of transaction is externally
74
82
  // consistent.
@@ -79,7 +87,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
79
87
  // active as long as the transaction continues to do reads, and the
80
88
  // transaction has not been terminated by
81
89
  // [Commit][google.spanner.v1.Spanner.Commit] or
82
- // [Rollback][google.spanner.v1.Spanner.Rollback]. Long periods of
90
+ // [Rollback][google.spanner.v1.Spanner.Rollback]. Long periods of
83
91
  // inactivity at the client may cause Cloud Spanner to release a
84
92
  // transaction's locks and abort it.
85
93
  //
@@ -91,6 +99,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
91
99
  // transaction.
92
100
  //
93
101
  // Semantics:
102
+ //
94
103
  // Cloud Spanner can commit the transaction if all read locks it acquired
95
104
  // are still valid at commit time, and it is able to acquire write
96
105
  // locks for all writes. Cloud Spanner can abort the transaction for any
@@ -102,7 +111,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
102
111
  // use Cloud Spanner locks for any sort of mutual exclusion other than
103
112
  // between Cloud Spanner transactions themselves.
104
113
  //
105
- // Retrying Aborted Transactions:
114
+ // Retrying aborted transactions:
115
+ //
106
116
  // When a transaction aborts, the application can choose to retry the
107
117
  // whole transaction again. To maximize the chances of successfully
108
118
  // committing the retry, the client should execute the retry in the
@@ -117,7 +127,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
117
127
  // instead, it is better to limit the total amount of time spent
118
128
  // retrying.
119
129
  //
120
- // Idle Transactions:
130
+ // Idle transactions:
131
+ //
121
132
  // A transaction is considered idle if it has no outstanding reads or
122
133
  // SQL queries and has not started a read or SQL query within the last 10
123
134
  // seconds. Idle transactions can be aborted by Cloud Spanner so that they
@@ -128,7 +139,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
128
139
  // SQL query in the transaction (for example, `SELECT 1`) prevents the
129
140
  // transaction from becoming idle.
130
141
  //
131
- // Snapshot Read-Only Transactions:
142
+ // Snapshot read-only transactions:
143
+ //
132
144
  // Snapshot read-only transactions provides a simpler method than
133
145
  // locking read-write transactions for doing several consistent
134
146
  // reads. However, this type of transaction does not support writes.
@@ -160,13 +172,12 @@ option ruby_package = "Google::Cloud::Spanner::V1";
160
172
  //
161
173
  // If the Cloud Spanner database to be read is geographically distributed,
162
174
  // stale read-only transactions can execute more quickly than strong
163
- // or read-write transaction, because they are able to execute far
175
+ // or read-write transactions, because they are able to execute far
164
176
  // from the leader replica.
165
177
  //
166
178
  // Each type of timestamp bound is discussed in detail below.
167
179
  //
168
- // Strong:
169
- // Strong reads are guaranteed to see the effects of all transactions
180
+ // Strong: Strong reads are guaranteed to see the effects of all transactions
170
181
  // that have committed before the start of the read. Furthermore, all
171
182
  // rows yielded by a single read are consistent with each other -- if
172
183
  // any part of the read observes a transaction, all parts of the read
@@ -178,9 +189,13 @@ option ruby_package = "Google::Cloud::Spanner::V1";
178
189
  // reads should be executed within a transaction or at an exact read
179
190
  // timestamp.
180
191
  //
192
+ // Queries on change streams (see below for more details) must also specify
193
+ // the strong read timestamp bound.
194
+ //
181
195
  // See [TransactionOptions.ReadOnly.strong][google.spanner.v1.TransactionOptions.ReadOnly.strong].
182
196
  //
183
- // Exact Staleness:
197
+ // Exact staleness:
198
+ //
184
199
  // These timestamp bounds execute reads at a user-specified
185
200
  // timestamp. Reads at a timestamp are guaranteed to see a consistent
186
201
  // prefix of the global transaction history: they observe
@@ -201,7 +216,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
201
216
  // See [TransactionOptions.ReadOnly.read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.read_timestamp] and
202
217
  // [TransactionOptions.ReadOnly.exact_staleness][google.spanner.v1.TransactionOptions.ReadOnly.exact_staleness].
203
218
  //
204
- // Bounded Staleness:
219
+ // Bounded staleness:
220
+ //
205
221
  // Bounded staleness modes allow Cloud Spanner to pick the read timestamp,
206
222
  // subject to a user-provided staleness bound. Cloud Spanner chooses the
207
223
  // newest timestamp within the staleness bound that allows execution
@@ -230,7 +246,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
230
246
  // See [TransactionOptions.ReadOnly.max_staleness][google.spanner.v1.TransactionOptions.ReadOnly.max_staleness] and
231
247
  // [TransactionOptions.ReadOnly.min_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.min_read_timestamp].
232
248
  //
233
- // Old Read Timestamps and Garbage Collection:
249
+ // Old read timestamps and garbage collection:
250
+ //
234
251
  // Cloud Spanner continuously garbage collects deleted and overwritten data
235
252
  // in the background to reclaim storage space. This process is known
236
253
  // as "version GC". By default, version GC reclaims versions after they
@@ -240,7 +257,41 @@ option ruby_package = "Google::Cloud::Spanner::V1";
240
257
  // timestamp become too old while executing. Reads and SQL queries with
241
258
  // too-old read timestamps fail with the error `FAILED_PRECONDITION`.
242
259
  //
243
- // Partitioned DML Transactions:
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
+ //
244
295
  // Partitioned DML transactions are used to execute DML statements with a
245
296
  // different execution strategy that provides different, and often better,
246
297
  // scalability properties for large, table-wide operations than DML in a
@@ -1,4 +1,4 @@
1
- // Copyright 2021 Google LLC
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.
@@ -16,7 +16,6 @@ syntax = "proto3";
16
16
 
17
17
  package google.spanner.v1;
18
18
 
19
- import "google/api/annotations.proto";
20
19
  import "google/api/field_behavior.proto";
21
20
 
22
21
  option csharp_namespace = "Google.Cloud.Spanner.V1";