Skip to content

Commit 8d30990

Browse files
Google APIscopybara-github
authored andcommitted
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
1 parent 760ef85 commit 8d30990

File tree

11 files changed

+45
-19
lines changed

11 files changed

+45
-19
lines changed

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.

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.

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.

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.

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.

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.

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

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
}

google/spanner/v1/spanner.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ title: Cloud Spanner API
66
apis:
77
- name: google.spanner.v1.Spanner
88

9+
types:
10+
- name: google.spanner.v1.ChangeStreamRecord
11+
912
documentation:
1013
summary: |-
1114
Cloud Spanner is a managed, mission-critical, globally consistent and
@@ -25,25 +28,33 @@ http:
2528
additional_bindings:
2629
- post: '/v1/{name=projects/*/instances/*/operations/*}:cancel'
2730
- post: '/v1/{name=projects/*/instances/*/backups/*/operations/*}:cancel'
31+
- post: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}:cancel'
2832
- post: '/v1/{name=projects/*/instanceConfigs/*/operations/*}:cancel'
33+
- post: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}:cancel'
2934
- selector: google.longrunning.Operations.DeleteOperation
3035
delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}'
3136
additional_bindings:
3237
- delete: '/v1/{name=projects/*/instances/*/operations/*}'
3338
- delete: '/v1/{name=projects/*/instances/*/backups/*/operations/*}'
39+
- delete: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}'
3440
- delete: '/v1/{name=projects/*/instanceConfigs/*/operations/*}'
41+
- delete: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}'
3542
- selector: google.longrunning.Operations.GetOperation
3643
get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}'
3744
additional_bindings:
3845
- get: '/v1/{name=projects/*/instances/*/operations/*}'
3946
- get: '/v1/{name=projects/*/instances/*/backups/*/operations/*}'
47+
- get: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations/*}'
4048
- get: '/v1/{name=projects/*/instanceConfigs/*/operations/*}'
49+
- get: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations/*}'
4150
- selector: google.longrunning.Operations.ListOperations
4251
get: '/v1/{name=projects/*/instances/*/databases/*/operations}'
4352
additional_bindings:
4453
- get: '/v1/{name=projects/*/instances/*/operations}'
4554
- get: '/v1/{name=projects/*/instances/*/backups/*/operations}'
55+
- get: '/v1/{name=projects/*/instances/*/instancePartitions/*/operations}'
4656
- get: '/v1/{name=projects/*/instanceConfigs/*/operations}'
57+
- get: '/v1/{name=projects/*/instanceConfigs/*/ssdCaches/*/operations}'
4758

4859
authentication:
4960
rules:

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)