@google-cloud/spanner 8.6.0 → 8.7.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.
- package/README.md +2 -0
- package/build/protos/google/spanner/executor/v1/cloud_executor.proto +88 -4
- package/build/protos/google/spanner/v1/change_stream.proto +1 -1
- 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/location.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 +9 -1
- package/build/protos/google/spanner/v1/spanner.proto +17 -10
- package/build/protos/google/spanner/v1/transaction.proto +1 -1
- package/build/protos/google/spanner/v1/type.proto +1 -1
- package/build/protos/protos.d.ts +322 -2
- package/build/protos/protos.js +1099 -5
- package/build/protos/protos.json +143 -4
- package/build/src/database.d.ts +1 -0
- package/build/src/metrics/interceptor.js +1 -3
- package/build/src/v1/spanner_client.d.ts +7 -6
- package/package.json +29 -8
package/README.md
CHANGED
|
@@ -233,6 +233,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
|
|
|
233
233
|
| Queryoptions | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/queryoptions.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/queryoptions.js,samples/README.md) |
|
|
234
234
|
| Quickstart | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/quickstart.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/quickstart.js,samples/README.md) |
|
|
235
235
|
| Read data with database role | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-data-with-database-role.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/read-data-with-database-role.js,samples/README.md) |
|
|
236
|
+
| Performs a read-write transaction with read lock mode option | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-lock-mode.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/read-lock-mode.js,samples/README.md) |
|
|
236
237
|
| Performs a read-write transaction with isolation level option | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/repeatable-reads.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/repeatable-reads.js,samples/README.md) |
|
|
237
238
|
| Sets a request tag for a single query | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/request-tag.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/request-tag.js,samples/README.md) |
|
|
238
239
|
| Run Batch update with RPC priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/rpc-priority-batch-dml.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/rpc-priority-batch-dml.js,samples/README.md) |
|
|
@@ -326,3 +327,4 @@ See [LICENSE](https://github.com/googleapis/nodejs-spanner/blob/main/LICENSE)
|
|
|
326
327
|
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
|
|
327
328
|
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com
|
|
328
329
|
[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
|
|
330
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 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.
|
|
@@ -135,6 +135,9 @@ message SpannerAction {
|
|
|
135
135
|
|
|
136
136
|
// Query cancellation action for testing the cancellation of a query.
|
|
137
137
|
QueryCancellationAction query_cancellation = 51;
|
|
138
|
+
|
|
139
|
+
// Action to adapt a message.
|
|
140
|
+
AdaptMessageAction adapt_message = 52;
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
|
|
@@ -185,12 +188,22 @@ message DmlAction {
|
|
|
185
188
|
// Whether to autocommit the transaction after executing the DML statement,
|
|
186
189
|
// if the Executor supports autocommit.
|
|
187
190
|
optional bool autocommit_if_supported = 2;
|
|
191
|
+
|
|
192
|
+
// Whether to set this DML statement as the last statement in the
|
|
193
|
+
// transaction. The transaction should be committed after processing this DML
|
|
194
|
+
// statement.
|
|
195
|
+
optional bool last_statement = 3;
|
|
188
196
|
}
|
|
189
197
|
|
|
190
198
|
// Batch of DML statements invoked using batched execution.
|
|
191
199
|
message BatchDmlAction {
|
|
192
200
|
// DML statements.
|
|
193
201
|
repeated QueryAction updates = 1;
|
|
202
|
+
|
|
203
|
+
// Whether to set this request with the last statement option in the
|
|
204
|
+
// transaction. The transaction should be committed after processing this
|
|
205
|
+
// request.
|
|
206
|
+
optional bool last_statements = 2;
|
|
194
207
|
}
|
|
195
208
|
|
|
196
209
|
// Value represents a single value that can be read or written to/from
|
|
@@ -396,7 +409,8 @@ message StartTransactionAction {
|
|
|
396
409
|
// testing.
|
|
397
410
|
string transaction_seed = 3;
|
|
398
411
|
|
|
399
|
-
// Execution options (e.g., whether transaction is opaque, optimistic
|
|
412
|
+
// Execution options (e.g., whether transaction is opaque, optimistic,
|
|
413
|
+
// excluded from change streams).
|
|
400
414
|
optional TransactionExecutionOptions execution_options = 4;
|
|
401
415
|
}
|
|
402
416
|
|
|
@@ -460,10 +474,29 @@ message ColumnMetadata {
|
|
|
460
474
|
google.spanner.v1.Type type = 2;
|
|
461
475
|
}
|
|
462
476
|
|
|
463
|
-
// Options for executing the transaction.
|
|
464
477
|
message TransactionExecutionOptions {
|
|
465
478
|
// Whether optimistic concurrency should be used to execute this transaction.
|
|
466
479
|
bool optimistic = 1;
|
|
480
|
+
|
|
481
|
+
// Whether traffic from this transaction will be excluded from tracking change
|
|
482
|
+
// streams with allow_txn_exclusion=true.
|
|
483
|
+
bool exclude_from_change_streams = 2;
|
|
484
|
+
|
|
485
|
+
// Whether serializable isolation with optimistic mode concurrency should be
|
|
486
|
+
// used to execute this transaction.
|
|
487
|
+
bool serializable_optimistic = 3;
|
|
488
|
+
|
|
489
|
+
// Whether snapshot isolation with optimistic mode concurrency should be used
|
|
490
|
+
// to execute this transaction.
|
|
491
|
+
bool snapshot_isolation_optimistic = 4;
|
|
492
|
+
|
|
493
|
+
// Whether snapshot isolation with pessimistic mode concurrency should be used
|
|
494
|
+
// to execute this transaction.
|
|
495
|
+
bool snapshot_isolation_pessimistic = 5;
|
|
496
|
+
|
|
497
|
+
// Whether to exclude mutations of this transaction from the allowed tracking
|
|
498
|
+
// change streams.
|
|
499
|
+
bool exclude_txn_from_change_streams = 6;
|
|
467
500
|
}
|
|
468
501
|
|
|
469
502
|
// FinishTransactionAction defines an action of finishing a transaction.
|
|
@@ -573,6 +606,9 @@ message AdminAction {
|
|
|
573
606
|
|
|
574
607
|
// Action that changes quorum of a Cloud Spanner database.
|
|
575
608
|
ChangeQuorumCloudDatabaseAction change_quorum_cloud_database = 28;
|
|
609
|
+
|
|
610
|
+
// Action that adds splits to a Cloud Spanner database.
|
|
611
|
+
AddSplitPointsAction add_split_points = 29;
|
|
576
612
|
}
|
|
577
613
|
}
|
|
578
614
|
|
|
@@ -663,6 +699,9 @@ message CreateCloudInstanceAction {
|
|
|
663
699
|
|
|
664
700
|
// labels.
|
|
665
701
|
map<string, string> labels = 5;
|
|
702
|
+
|
|
703
|
+
// The edition of the instance.
|
|
704
|
+
google.spanner.admin.instance.v1.Instance.Edition edition = 8;
|
|
666
705
|
}
|
|
667
706
|
|
|
668
707
|
// Action that updates a Cloud Spanner instance.
|
|
@@ -693,6 +732,9 @@ message UpdateCloudInstanceAction {
|
|
|
693
732
|
|
|
694
733
|
// labels.
|
|
695
734
|
map<string, string> labels = 6;
|
|
735
|
+
|
|
736
|
+
// The edition of the instance.
|
|
737
|
+
google.spanner.admin.instance.v1.Instance.Edition edition = 8;
|
|
696
738
|
}
|
|
697
739
|
|
|
698
740
|
// Action that deletes a Cloud Spanner instance.
|
|
@@ -787,6 +829,29 @@ message ChangeQuorumCloudDatabaseAction {
|
|
|
787
829
|
repeated string serving_locations = 2;
|
|
788
830
|
}
|
|
789
831
|
|
|
832
|
+
// A single Adapt message request.
|
|
833
|
+
message AdaptMessageAction {
|
|
834
|
+
// The fully qualified uri of the database to send AdaptMessage to.
|
|
835
|
+
string database_uri = 1;
|
|
836
|
+
|
|
837
|
+
// The protocol to use for the request.
|
|
838
|
+
string protocol = 2;
|
|
839
|
+
|
|
840
|
+
// The payload of the request.
|
|
841
|
+
bytes payload = 3;
|
|
842
|
+
|
|
843
|
+
// Attachments to be sent with the request.
|
|
844
|
+
map<string, string> attachments = 4;
|
|
845
|
+
|
|
846
|
+
// The query to be sent with the request.
|
|
847
|
+
string query = 5;
|
|
848
|
+
|
|
849
|
+
// If true, the action will send a Prepare request first and then an
|
|
850
|
+
// Execute request right after to execute the query. This is only supported
|
|
851
|
+
// for Cloud Client path.
|
|
852
|
+
bool prepare_then_execute = 6;
|
|
853
|
+
}
|
|
854
|
+
|
|
790
855
|
// Action that lists Cloud Spanner databases.
|
|
791
856
|
message ListCloudDatabasesAction {
|
|
792
857
|
// Cloud project ID, e.g. "spanner-cloud-systest".
|
|
@@ -805,7 +870,7 @@ message ListCloudDatabasesAction {
|
|
|
805
870
|
string page_token = 4;
|
|
806
871
|
}
|
|
807
872
|
|
|
808
|
-
// Action that lists Cloud Spanner
|
|
873
|
+
// Action that lists Cloud Spanner instances.
|
|
809
874
|
message ListCloudInstancesAction {
|
|
810
875
|
// Cloud project ID, e.g. "spanner-cloud-systest".
|
|
811
876
|
string project_id = 1;
|
|
@@ -1067,6 +1132,21 @@ message CancelOperationAction {
|
|
|
1067
1132
|
string operation = 1;
|
|
1068
1133
|
}
|
|
1069
1134
|
|
|
1135
|
+
// Action that adds a split point to a Cloud Spanner database.
|
|
1136
|
+
message AddSplitPointsAction {
|
|
1137
|
+
// Cloud project ID, e.g. "spanner-cloud-systest".
|
|
1138
|
+
string project_id = 1;
|
|
1139
|
+
|
|
1140
|
+
// Cloud instance ID (not path), e.g. "test-instance".
|
|
1141
|
+
string instance_id = 2;
|
|
1142
|
+
|
|
1143
|
+
// Cloud database ID (not full path), e.g. "db0".
|
|
1144
|
+
string database_id = 3;
|
|
1145
|
+
|
|
1146
|
+
// The split points to add.
|
|
1147
|
+
repeated google.spanner.admin.database.v1.SplitPoints split_points = 4;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1070
1150
|
// Starts a batch read-only transaction in executor. Successful outcomes of this
|
|
1071
1151
|
// action will contain batch_txn_id--the identificator that can be used to start
|
|
1072
1152
|
// the same transaction in other Executors to parallelize partition processing.
|
|
@@ -1260,6 +1340,10 @@ message SpannerActionOutcome {
|
|
|
1260
1340
|
|
|
1261
1341
|
// Change stream records returned by a change stream query.
|
|
1262
1342
|
repeated ChangeStreamRecord change_stream_records = 10;
|
|
1343
|
+
|
|
1344
|
+
// If not zero, it indicates the read timestamp to use for validating
|
|
1345
|
+
// the SnapshotIsolation transaction.
|
|
1346
|
+
optional int64 snapshot_isolation_txn_read_timestamp = 11;
|
|
1263
1347
|
}
|
|
1264
1348
|
|
|
1265
1349
|
// AdminResult contains admin action results, for database/backup/operation.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 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.
|
|
@@ -61,6 +61,14 @@ message ResultSet {
|
|
|
61
61
|
// [Commit][google.spanner.v1.Spanner.Commit] request for this transaction.
|
|
62
62
|
MultiplexedSessionPrecommitToken precommit_token = 5
|
|
63
63
|
[(google.api.field_behavior) = OPTIONAL];
|
|
64
|
+
|
|
65
|
+
// Optional. A cache update expresses a set of changes the client should
|
|
66
|
+
// incorporate into its location cache. The client should discard the changes
|
|
67
|
+
// if they are older than the data it already has. This data can be obtained
|
|
68
|
+
// in response to requests that included a `RoutingHint` field, but may also
|
|
69
|
+
// be obtained by explicit location-fetching RPCs which may be added in the
|
|
70
|
+
// future.
|
|
71
|
+
CacheUpdate cache_update = 6 [(google.api.field_behavior) = OPTIONAL];
|
|
64
72
|
}
|
|
65
73
|
|
|
66
74
|
// Partial results from a streaming read or SQL query. Streaming reads and
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 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.
|
|
@@ -544,8 +544,9 @@ message RequestOptions {
|
|
|
544
544
|
// A tag used for statistics collection about this transaction.
|
|
545
545
|
// Both `request_tag` and `transaction_tag` can be specified for a read or
|
|
546
546
|
// query that belongs to a transaction.
|
|
547
|
-
//
|
|
548
|
-
// to the same transaction
|
|
547
|
+
// To enable tagging on a transaction, `transaction_tag` must be set to the
|
|
548
|
+
// same value for all requests belonging to the same transaction, including
|
|
549
|
+
// [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction].
|
|
549
550
|
// If this request doesn't belong to any transaction, `transaction_tag` is
|
|
550
551
|
// ignored.
|
|
551
552
|
// Legal characters for `transaction_tag` values are all printable characters
|
|
@@ -1018,7 +1019,8 @@ message PartitionQueryRequest {
|
|
|
1018
1019
|
// operations.
|
|
1019
1020
|
string sql = 3 [(google.api.field_behavior) = REQUIRED];
|
|
1020
1021
|
|
|
1021
|
-
// Parameter names and values that bind to placeholders in the SQL
|
|
1022
|
+
// Optional. Parameter names and values that bind to placeholders in the SQL
|
|
1023
|
+
// string.
|
|
1022
1024
|
//
|
|
1023
1025
|
// A parameter placeholder consists of the `@` character followed by the
|
|
1024
1026
|
// parameter name (for example, `@firstName`). Parameter names can contain
|
|
@@ -1030,18 +1032,18 @@ message PartitionQueryRequest {
|
|
|
1030
1032
|
// `"WHERE id > @msg_id AND id < @msg_id + 100"`
|
|
1031
1033
|
//
|
|
1032
1034
|
// It's an error to execute a SQL statement with unbound parameters.
|
|
1033
|
-
google.protobuf.Struct params = 4;
|
|
1035
|
+
google.protobuf.Struct params = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
1034
1036
|
|
|
1035
|
-
// It isn't always possible for Cloud Spanner to infer the right SQL
|
|
1036
|
-
// from a JSON value. For example, values of type `BYTES` and values
|
|
1037
|
-
//
|
|
1037
|
+
// Optional. It isn't always possible for Cloud Spanner to infer the right SQL
|
|
1038
|
+
// type from a JSON value. For example, values of type `BYTES` and values of
|
|
1039
|
+
// type `STRING` both appear in
|
|
1038
1040
|
// [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings.
|
|
1039
1041
|
//
|
|
1040
1042
|
// In these cases, `param_types` can be used to specify the exact
|
|
1041
1043
|
// SQL type for some or all of the SQL query parameters. See the
|
|
1042
1044
|
// definition of [Type][google.spanner.v1.Type] for more information
|
|
1043
1045
|
// about SQL types.
|
|
1044
|
-
map<string, Type> param_types = 5;
|
|
1046
|
+
map<string, Type> param_types = 5 [(google.api.field_behavior) = OPTIONAL];
|
|
1045
1047
|
|
|
1046
1048
|
// Additional options that affect how many partitions are created.
|
|
1047
1049
|
PartitionOptions partition_options = 6;
|
|
@@ -1407,6 +1409,11 @@ message BatchWriteResponse {
|
|
|
1407
1409
|
google.rpc.Status status = 2;
|
|
1408
1410
|
|
|
1409
1411
|
// The commit timestamp of the transaction that applied this batch.
|
|
1410
|
-
// Present if
|
|
1412
|
+
// Present if status is OK and the mutation groups were applied, absent
|
|
1413
|
+
// otherwise.
|
|
1414
|
+
//
|
|
1415
|
+
// For mutation groups with conditions, a status=OK and missing
|
|
1416
|
+
// commit_timestamp means that the mutation groups were not applied due to the
|
|
1417
|
+
// condition not being satisfied after evaluation.
|
|
1411
1418
|
google.protobuf.Timestamp commit_timestamp = 3;
|
|
1412
1419
|
}
|