Skip to content

Commit 184684f

Browse files
feat(spanner): include cache updates into the ResultSet response (#2519)
* feat(spanner): include cache updates into the ResultSet response docs: A comment for field `transaction_tag` in message `.google.spanner.v1.RequestOptions` is changed docs: A comment for field `params` in message `.google.spanner.v1.PartitionQueryRequest` is changed docs: A comment for field `param_types` in message `.google.spanner.v1.PartitionQueryRequest` is changed docs: A comment for field `commit_timestamp` in message `.google.spanner.v1.BatchWriteResponse` is changed PiperOrigin-RevId: 865546011 Source-Link: googleapis/googleapis@8d30990 Source-Link: googleapis/googleapis-gen@3dd1533 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2RkMTUzMzFlZjhkNGY3Mzc2OTkwYmI1NTFlYTU3YWUxOTFmZmM5MCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent d2e4319 commit 184684f

15 files changed

Lines changed: 91 additions & 28 deletions

handwritten/spanner/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
233233
| 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) |
234234
| 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) |
235235
| 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 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) |
237236
| 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) |
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) |
238238
| 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) |
239239
| 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) |
240240
| Run partitioned update with RPC priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/rpc-priority-partitioned-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-partitioned-dml.js,samples/README.md) |

handwritten/spanner/protos/google/spanner/v1/change_stream.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

handwritten/spanner/protos/google/spanner/v1/commit_response.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

handwritten/spanner/protos/google/spanner/v1/keys.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

handwritten/spanner/protos/google/spanner/v1/location.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

handwritten/spanner/protos/google/spanner/v1/mutation.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

handwritten/spanner/protos/google/spanner/v1/query_plan.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

handwritten/spanner/protos/google/spanner/v1/result_set.proto

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -61,6 +61,14 @@ message ResultSet {
6161
// [Commit][google.spanner.v1.Spanner.Commit] request for this transaction.
6262
MultiplexedSessionPrecommitToken precommit_token = 5
6363
[(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];
6472
}
6573

6674
// Partial results from a streaming read or SQL query. Streaming reads and

handwritten/spanner/protos/google/spanner/v1/spanner.proto

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -544,8 +544,9 @@ message RequestOptions {
544544
// A tag used for statistics collection about this transaction.
545545
// Both `request_tag` and `transaction_tag` can be specified for a read or
546546
// query that belongs to a transaction.
547-
// The value of transaction_tag should be the same for all requests belonging
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].
549550
// If this request doesn't belong to any transaction, `transaction_tag` is
550551
// ignored.
551552
// Legal characters for `transaction_tag` values are all printable characters
@@ -1018,7 +1019,8 @@ message PartitionQueryRequest {
10181019
// operations.
10191020
string sql = 3 [(google.api.field_behavior) = REQUIRED];
10201021

1021-
// Parameter names and values that bind to placeholders in the SQL string.
1022+
// Optional. Parameter names and values that bind to placeholders in the SQL
1023+
// string.
10221024
//
10231025
// A parameter placeholder consists of the `@` character followed by the
10241026
// parameter name (for example, `@firstName`). Parameter names can contain
@@ -1030,18 +1032,18 @@ message PartitionQueryRequest {
10301032
// `"WHERE id > @msg_id AND id < @msg_id + 100"`
10311033
//
10321034
// 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];
10341036

1035-
// It isn't always possible for Cloud Spanner to infer the right SQL type
1036-
// from a JSON value. For example, values of type `BYTES` and values
1037-
// of type `STRING` both appear in
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
10381040
// [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings.
10391041
//
10401042
// In these cases, `param_types` can be used to specify the exact
10411043
// SQL type for some or all of the SQL query parameters. See the
10421044
// definition of [Type][google.spanner.v1.Type] for more information
10431045
// about SQL types.
1044-
map<string, Type> param_types = 5;
1046+
map<string, Type> param_types = 5 [(google.api.field_behavior) = OPTIONAL];
10451047

10461048
// Additional options that affect how many partitions are created.
10471049
PartitionOptions partition_options = 6;
@@ -1407,6 +1409,11 @@ message BatchWriteResponse {
14071409
google.rpc.Status status = 2;
14081410

14091411
// The commit timestamp of the transaction that applied this batch.
1410-
// Present if `status` is `OK`, absent otherwise.
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.
14111418
google.protobuf.Timestamp commit_timestamp = 3;
14121419
}

handwritten/spanner/protos/google/spanner/v1/transaction.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)