@google-cloud/spanner 7.18.1 → 7.19.1

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 CHANGED
@@ -4,6 +4,36 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
6
6
 
7
+ ## [7.19.1](https://github.com/googleapis/nodejs-spanner/compare/v7.19.0...v7.19.1) (2025-03-13)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * CreateQueryPartition with query params ([91f5afd](https://github.com/googleapis/nodejs-spanner/commit/91f5afda53bd9c46fcd1a1fe33f579b6aed5223a))
13
+
14
+ ## [7.19.0](https://github.com/googleapis/nodejs-spanner/compare/v7.18.1...v7.19.0) (2025-02-26)
15
+
16
+
17
+ ### Features
18
+
19
+ * Add AddSplitPoints API ([e4d389a](https://github.com/googleapis/nodejs-spanner/commit/e4d389a23ff4b73b2d0774ad31a84c9a6c19e306))
20
+ * Paging changes for bigquery ([e4d389a](https://github.com/googleapis/nodejs-spanner/commit/e4d389a23ff4b73b2d0774ad31a84c9a6c19e306))
21
+ * **spanner:** A new enum `IsolationLevel` is added ([#2225](https://github.com/googleapis/nodejs-spanner/issues/2225)) ([e4d389a](https://github.com/googleapis/nodejs-spanner/commit/e4d389a23ff4b73b2d0774ad31a84c9a6c19e306))
22
+ * **spanner:** A new field `isolation_level` is added to message `.google.spanner.v1.TransactionOptions` ([e4d389a](https://github.com/googleapis/nodejs-spanner/commit/e4d389a23ff4b73b2d0774ad31a84c9a6c19e306))
23
+ * **spanner:** Add instance partitions field in backup proto ([e4d389a](https://github.com/googleapis/nodejs-spanner/commit/e4d389a23ff4b73b2d0774ad31a84c9a6c19e306))
24
+ * **spanner:** Add support for Multiplexed Session for Read Only Tran… ([#2214](https://github.com/googleapis/nodejs-spanner/issues/2214)) ([3a7a51b](https://github.com/googleapis/nodejs-spanner/commit/3a7a51bee00730c2daf1b9791b45f75531c14a2c))
25
+ * **x-goog-spanner-request-id:** Add bases ([#2211](https://github.com/googleapis/nodejs-spanner/issues/2211)) ([0008038](https://github.com/googleapis/nodejs-spanner/commit/000803812e670ce0f4bac4a6460351f2b08ec660))
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * Add x-goog-request params to headers for LRO-polling methods ([e4d389a](https://github.com/googleapis/nodejs-spanner/commit/e4d389a23ff4b73b2d0774ad31a84c9a6c19e306))
31
+ * Error from fill method should not be emitted ([#2233](https://github.com/googleapis/nodejs-spanner/issues/2233)) ([2cc44cf](https://github.com/googleapis/nodejs-spanner/commit/2cc44cf238bd18f5a456c76ddb8280c2252c2e87)), closes [#2103](https://github.com/googleapis/nodejs-spanner/issues/2103)
32
+ * Finalize fixing typings for headers in generator ([e4d389a](https://github.com/googleapis/nodejs-spanner/commit/e4d389a23ff4b73b2d0774ad31a84c9a6c19e306))
33
+ * Fix typings for headers in generator ([e4d389a](https://github.com/googleapis/nodejs-spanner/commit/e4d389a23ff4b73b2d0774ad31a84c9a6c19e306))
34
+ * Remove extra protos in ESM & capture ESM in headers ([e4d389a](https://github.com/googleapis/nodejs-spanner/commit/e4d389a23ff4b73b2d0774ad31a84c9a6c19e306))
35
+ * Rollback with no id ([#2231](https://github.com/googleapis/nodejs-spanner/issues/2231)) ([a6919b1](https://github.com/googleapis/nodejs-spanner/commit/a6919b15bd01ed93c62d32533d78181cbd333f5e)), closes [#2103](https://github.com/googleapis/nodejs-spanner/issues/2103)
36
+
7
37
  ## [7.18.1](https://github.com/googleapis/nodejs-spanner/compare/v7.18.0...v7.18.1) (2025-02-05)
8
38
 
9
39
 
package/README.md CHANGED
@@ -157,6 +157,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
157
157
  | Numeric-add-column | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-add-column.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-add-column.js,samples/README.md) |
158
158
  | Numeric-query-parameter | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-query-parameter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-query-parameter.js,samples/README.md) |
159
159
  | Numeric-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-update-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-update-data.js,samples/README.md) |
160
+ | Observability (Tracing) with OpenTelemetry using OTLP | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/observability-traces-otlp.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/observability-traces-otlp.js,samples/README.md) |
160
161
  | Observability (Tracing) with OpenTelemetry | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/observability-traces.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/observability-traces.js,samples/README.md) |
161
162
  | Adds a column to an existing table in a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-add-column.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-add-column.js,samples/README.md) |
162
163
  | Showcase the rules for case-sensitivity and case folding for a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-case-sensitivity.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-case-sensitivity.js,samples/README.md) |
@@ -207,6 +207,13 @@ message Backup {
207
207
  // retained by the backup system.
208
208
  google.protobuf.Timestamp oldest_version_time = 18
209
209
  [(google.api.field_behavior) = OUTPUT_ONLY];
210
+
211
+ // Output only. The instance partition(s) storing the backup.
212
+ //
213
+ // This is the same as the list of the instance partition(s) that the database
214
+ // had footprint in at the backup's `version_time`.
215
+ repeated BackupInstancePartition instance_partitions = 19
216
+ [(google.api.field_behavior) = OUTPUT_ONLY];
210
217
  }
211
218
 
212
219
  // The request for
@@ -755,3 +762,12 @@ message FullBackupSpec {}
755
762
  // successive incremental backups. The first backup created for an
756
763
  // incremental backup chain is always a full backup.
757
764
  message IncrementalBackupSpec {}
765
+
766
+ // Instance partition information for the backup.
767
+ message BackupInstancePartition {
768
+ // A unique identifier for the instance partition. Values are of the form
769
+ // `projects/<project>/instances/<instance>/instancePartitions/<instance_partition_id>`
770
+ string instance_partition = 1 [(google.api.resource_reference) = {
771
+ type: "spanner.googleapis.com/InstancePartition"
772
+ }];
773
+ }
@@ -25,6 +25,7 @@ import "google/iam/v1/policy.proto";
25
25
  import "google/longrunning/operations.proto";
26
26
  import "google/protobuf/empty.proto";
27
27
  import "google/protobuf/field_mask.proto";
28
+ import "google/protobuf/struct.proto";
28
29
  import "google/protobuf/timestamp.proto";
29
30
  import "google/spanner/admin/database/v1/backup.proto";
30
31
  import "google/spanner/admin/database/v1/backup_schedule.proto";
@@ -41,6 +42,10 @@ option (google.api.resource_definition) = {
41
42
  type: "spanner.googleapis.com/Instance"
42
43
  pattern: "projects/{project}/instances/{instance}"
43
44
  };
45
+ option (google.api.resource_definition) = {
46
+ type: "spanner.googleapis.com/InstancePartition"
47
+ pattern: "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}"
48
+ };
44
49
 
45
50
  // Cloud Spanner Database Admin API
46
51
  //
@@ -425,6 +430,15 @@ service DatabaseAdmin {
425
430
  option (google.api.method_signature) = "parent";
426
431
  }
427
432
 
433
+ // Adds split points to specified tables, indexes of a database.
434
+ rpc AddSplitPoints(AddSplitPointsRequest) returns (AddSplitPointsResponse) {
435
+ option (google.api.http) = {
436
+ post: "/v1/{database=projects/*/instances/*/databases/*}:addSplitPoints"
437
+ body: "*"
438
+ };
439
+ option (google.api.method_signature) = "database,split_points";
440
+ }
441
+
428
442
  // Creates a new backup schedule.
429
443
  rpc CreateBackupSchedule(CreateBackupScheduleRequest)
430
444
  returns (BackupSchedule) {
@@ -1207,3 +1221,59 @@ message ListDatabaseRolesResponse {
1207
1221
  // call to fetch more of the matching roles.
1208
1222
  string next_page_token = 2;
1209
1223
  }
1224
+
1225
+ // The request for
1226
+ // [AddSplitPoints][google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints].
1227
+ message AddSplitPointsRequest {
1228
+ // Required. The database on whose tables/indexes split points are to be
1229
+ // added. Values are of the form
1230
+ // `projects/<project>/instances/<instance>/databases/<database>`.
1231
+ string database = 1 [
1232
+ (google.api.field_behavior) = REQUIRED,
1233
+ (google.api.resource_reference) = {
1234
+ type: "spanner.googleapis.com/Database"
1235
+ }
1236
+ ];
1237
+
1238
+ // Required. The split points to add.
1239
+ repeated SplitPoints split_points = 2
1240
+ [(google.api.field_behavior) = REQUIRED];
1241
+
1242
+ // Optional. A user-supplied tag associated with the split points.
1243
+ // For example, "intital_data_load", "special_event_1".
1244
+ // Defaults to "CloudAddSplitPointsAPI" if not specified.
1245
+ // The length of the tag must not exceed 50 characters,else will be trimmed.
1246
+ // Only valid UTF8 characters are allowed.
1247
+ string initiator = 3 [(google.api.field_behavior) = OPTIONAL];
1248
+ }
1249
+
1250
+ // The response for
1251
+ // [AddSplitPoints][google.spanner.admin.database.v1.DatabaseAdmin.AddSplitPoints].
1252
+ message AddSplitPointsResponse {}
1253
+
1254
+ // The split points of a table/index.
1255
+ message SplitPoints {
1256
+ // A split key.
1257
+ message Key {
1258
+ // Required. The column values making up the split key.
1259
+ google.protobuf.ListValue key_parts = 1
1260
+ [(google.api.field_behavior) = REQUIRED];
1261
+ }
1262
+
1263
+ // The table to split.
1264
+ string table = 1;
1265
+
1266
+ // The index to split.
1267
+ // If specified, the `table` field must refer to the index's base table.
1268
+ string index = 2;
1269
+
1270
+ // Required. The list of split keys, i.e., the split boundaries.
1271
+ repeated Key keys = 3 [(google.api.field_behavior) = REQUIRED];
1272
+
1273
+ // Optional. The expiration timestamp of the split points.
1274
+ // A timestamp in the past means immediate expiration.
1275
+ // The maximum value can be 30 days in the future.
1276
+ // Defaults to 10 days in the future if not specified.
1277
+ google.protobuf.Timestamp expire_time = 5
1278
+ [(google.api.field_behavior) = OPTIONAL];
1279
+ }
@@ -361,12 +361,23 @@ message TransactionOptions {
361
361
  enum ReadLockMode {
362
362
  // Default value.
363
363
  //
364
- // If the value is not specified, the pessimistic read lock is used.
364
+ // * If isolation level is `REPEATABLE_READ`, then it is an error to
365
+ // specify `read_lock_mode`. Locking semantics default to `OPTIMISTIC`.
366
+ // No validation checks are done for reads, except for:
367
+ // 1. reads done as part of queries that use `SELECT FOR UPDATE`
368
+ // 2. reads done as part of statements with a `LOCK_SCANNED_RANGES`
369
+ // hint
370
+ // 3. reads done as part of DML statements
371
+ // to validate that the data that was served at the snapshot time is
372
+ // unchanged at commit time.
373
+ // * At all other isolation levels, if `read_lock_mode` is the default
374
+ // value, then pessimistic read lock is used.
365
375
  READ_LOCK_MODE_UNSPECIFIED = 0;
366
376
 
367
377
  // Pessimistic lock mode.
368
378
  //
369
379
  // Read locks are acquired immediately on read.
380
+ // Semantics described only applies to `SERIALIZABLE` isolation.
370
381
  PESSIMISTIC = 1;
371
382
 
372
383
  // Optimistic lock mode.
@@ -374,6 +385,7 @@ message TransactionOptions {
374
385
  // Locks for reads within the transaction are not acquired on read.
375
386
  // Instead the locks are acquired on a commit to validate that
376
387
  // read/queried data has not changed since the transaction started.
388
+ // Semantics described only applies to `SERIALIZABLE` isolation.
377
389
  OPTIMISTIC = 2;
378
390
  }
379
391
 
@@ -461,6 +473,38 @@ message TransactionOptions {
461
473
  bool return_read_timestamp = 6;
462
474
  }
463
475
 
476
+ // `IsolationLevel` is used when setting `isolation_level` for a transaction.
477
+ enum IsolationLevel {
478
+ // Default value.
479
+ //
480
+ // If the value is not specified, the `SERIALIZABLE` isolation level is
481
+ // used.
482
+ ISOLATION_LEVEL_UNSPECIFIED = 0;
483
+
484
+ // All transactions appear as if they executed in a serial order, even if
485
+ // some of the reads, writes, and other operations of distinct transactions
486
+ // actually occurred in parallel. Spanner assigns commit timestamps that
487
+ // reflect the order of committed transactions to implement this property.
488
+ // Spanner offers a stronger guarantee than serializability called external
489
+ // consistency. For further details, please refer to
490
+ // https://cloud.google.com/spanner/docs/true-time-external-consistency#serializability.
491
+ SERIALIZABLE = 1;
492
+
493
+ // All reads performed during the transaction observe a consistent snapshot
494
+ // of the database, and the transaction will only successfully commit in the
495
+ // absence of conflicts between its updates and any concurrent updates that
496
+ // have occurred since that snapshot. Consequently, in contrast to
497
+ // `SERIALIZABLE` transactions, only write-write conflicts are detected in
498
+ // snapshot transactions.
499
+ //
500
+ // This isolation level does not support Read-only and Partitioned DML
501
+ // transactions.
502
+ //
503
+ // When `REPEATABLE_READ` is specified on a read-write transaction, the
504
+ // locking semantics default to `OPTIMISTIC`.
505
+ REPEATABLE_READ = 2;
506
+ }
507
+
464
508
  // Required. The type of transaction.
465
509
  oneof mode {
466
510
  // Transaction may write.
@@ -500,6 +544,9 @@ message TransactionOptions {
500
544
  // partitioned-dml transactions, otherwise the API will return an
501
545
  // `INVALID_ARGUMENT` error.
502
546
  bool exclude_txn_from_change_streams = 5;
547
+
548
+ // Isolation level for the transaction.
549
+ IsolationLevel isolation_level = 6;
503
550
  }
504
551
 
505
552
  // A transaction.