@google-cloud/spanner-api 0.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.
- package/README.md +111 -0
- package/build/protos/google/spanner/admin/database/v1/backup.proto +773 -0
- package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +230 -0
- package/build/protos/google/spanner/admin/database/v1/common.proto +132 -0
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +1314 -0
- package/build/protos/google/spanner/admin/instance/v1/common.proto +64 -0
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +2184 -0
- package/build/protos/google/spanner/executor/v1/cloud_executor.proto +1610 -0
- package/build/protos/google/spanner/v1/change_stream.proto +451 -0
- package/build/protos/google/spanner/v1/commit_response.proto +80 -0
- package/build/protos/google/spanner/v1/keys.proto +163 -0
- package/build/protos/google/spanner/v1/location.proto +388 -0
- package/build/protos/google/spanner/v1/mutation.proto +156 -0
- package/build/protos/google/spanner/v1/query_plan.proto +156 -0
- package/build/protos/google/spanner/v1/result_set.proto +260 -0
- package/build/protos/google/spanner/v1/spanner.proto +1472 -0
- package/build/protos/google/spanner/v1/transaction.proto +329 -0
- package/build/protos/google/spanner/v1/type.proto +214 -0
- package/build/protos/protos.d.ts +42547 -0
- package/build/protos/protos.js +1 -0
- package/build/protos/protos.json +1 -0
- package/build/src/index.d.ts +20 -0
- package/build/src/index.js +34 -0
- package/build/src/index.js.map +1 -0
- package/build/src/v1/database_admin_client.d.ts +2433 -0
- package/build/src/v1/database_admin_client.js +2938 -0
- package/build/src/v1/database_admin_client.js.map +1 -0
- package/build/src/v1/database_admin_client_config.json +169 -0
- package/build/src/v1/database_admin_proto_list.json +6 -0
- package/build/src/v1/gapic_metadata.json +253 -0
- package/build/src/v1/index.d.ts +4 -0
- package/build/src/v1/index.js +29 -0
- package/build/src/v1/index.js.map +1 -0
- package/build/src/v1/instance_admin_client.d.ts +2162 -0
- package/build/src/v1/instance_admin_client.js +2411 -0
- package/build/src/v1/instance_admin_client.js.map +1 -0
- package/build/src/v1/instance_admin_client_config.json +129 -0
- package/build/src/v1/instance_admin_proto_list.json +4 -0
- package/build/src/v1/spanner_client.d.ts +1353 -0
- package/build/src/v1/spanner_client.js +1456 -0
- package/build/src/v1/spanner_client.js.map +1 -0
- package/build/src/v1/spanner_client_config.json +123 -0
- package/build/src/v1/spanner_executor_proxy_client.d.ts +419 -0
- package/build/src/v1/spanner_executor_proxy_client.js +730 -0
- package/build/src/v1/spanner_executor_proxy_client.js.map +1 -0
- package/build/src/v1/spanner_executor_proxy_client_config.json +30 -0
- package/build/src/v1/spanner_executor_proxy_proto_list.json +15 -0
- package/build/src/v1/spanner_proto_list.json +12 -0
- package/package.json +65 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.spanner.v1;
|
|
18
|
+
|
|
19
|
+
import "google/protobuf/struct.proto";
|
|
20
|
+
import "google/protobuf/timestamp.proto";
|
|
21
|
+
import "google/spanner/v1/type.proto";
|
|
22
|
+
|
|
23
|
+
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
24
|
+
option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb";
|
|
25
|
+
option java_multiple_files = true;
|
|
26
|
+
option java_outer_classname = "ChangeStreamProto";
|
|
27
|
+
option java_package = "com.google.spanner.v1";
|
|
28
|
+
option php_namespace = "Google\\Cloud\\Spanner\\V1";
|
|
29
|
+
option ruby_package = "Google::Cloud::Spanner::V1";
|
|
30
|
+
|
|
31
|
+
// Spanner Change Streams enable customers to capture and stream out changes to
|
|
32
|
+
// their Spanner databases in real-time. A change stream
|
|
33
|
+
// can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or
|
|
34
|
+
// partition_mode='MUTABLE_KEY_RANGE'.
|
|
35
|
+
//
|
|
36
|
+
// This message is only used in Change Streams created with the option
|
|
37
|
+
// partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special
|
|
38
|
+
// Table-Valued Function (TVF) along with each Change Streams. The function
|
|
39
|
+
// provides access to the change stream's records. The function is named
|
|
40
|
+
// READ_<change_stream_name> (where <change_stream_name> is the
|
|
41
|
+
// name of the change stream), and it returns a table with only one column
|
|
42
|
+
// called ChangeRecord.
|
|
43
|
+
message ChangeStreamRecord {
|
|
44
|
+
// A data change record contains a set of changes to a table with the same
|
|
45
|
+
// modification type (insert, update, or delete) committed at the same commit
|
|
46
|
+
// timestamp in one change stream partition for the same transaction. Multiple
|
|
47
|
+
// data change records can be returned for the same transaction across
|
|
48
|
+
// multiple change stream partitions.
|
|
49
|
+
message DataChangeRecord {
|
|
50
|
+
// Metadata for a column.
|
|
51
|
+
message ColumnMetadata {
|
|
52
|
+
// Name of the column.
|
|
53
|
+
string name = 1;
|
|
54
|
+
|
|
55
|
+
// Type of the column.
|
|
56
|
+
Type type = 2;
|
|
57
|
+
|
|
58
|
+
// Indicates whether the column is a primary key column.
|
|
59
|
+
bool is_primary_key = 3;
|
|
60
|
+
|
|
61
|
+
// Ordinal position of the column based on the original table definition
|
|
62
|
+
// in the schema starting with a value of 1.
|
|
63
|
+
int64 ordinal_position = 4;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Returns the value and associated metadata for a particular field of the
|
|
67
|
+
// [Mod][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod].
|
|
68
|
+
message ModValue {
|
|
69
|
+
// Index within the repeated
|
|
70
|
+
// [column_metadata][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.column_metadata]
|
|
71
|
+
// field, to obtain the column metadata for the column that was modified.
|
|
72
|
+
int32 column_metadata_index = 1;
|
|
73
|
+
|
|
74
|
+
// The value of the column.
|
|
75
|
+
google.protobuf.Value value = 2;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// A mod describes all data changes in a watched table row.
|
|
79
|
+
message Mod {
|
|
80
|
+
// Returns the value of the primary key of the modified row.
|
|
81
|
+
repeated ModValue keys = 1;
|
|
82
|
+
|
|
83
|
+
// Returns the old values before the change for the modified columns.
|
|
84
|
+
// Always empty for
|
|
85
|
+
// [INSERT][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.INSERT],
|
|
86
|
+
// or if old values are not being captured specified by
|
|
87
|
+
// [value_capture_type][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType].
|
|
88
|
+
repeated ModValue old_values = 2;
|
|
89
|
+
|
|
90
|
+
// Returns the new values after the change for the modified columns.
|
|
91
|
+
// Always empty for
|
|
92
|
+
// [DELETE][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType.DELETE].
|
|
93
|
+
repeated ModValue new_values = 3;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Mod type describes the type of change Spanner applied to the data. For
|
|
97
|
+
// example, if the client submits an INSERT_OR_UPDATE request, Spanner will
|
|
98
|
+
// perform an insert if there is no existing row and return ModType INSERT.
|
|
99
|
+
// Alternatively, if there is an existing row, Spanner will perform an
|
|
100
|
+
// update and return ModType UPDATE.
|
|
101
|
+
enum ModType {
|
|
102
|
+
// Not specified.
|
|
103
|
+
MOD_TYPE_UNSPECIFIED = 0;
|
|
104
|
+
|
|
105
|
+
// Indicates data was inserted.
|
|
106
|
+
INSERT = 10;
|
|
107
|
+
|
|
108
|
+
// Indicates existing data was updated.
|
|
109
|
+
UPDATE = 20;
|
|
110
|
+
|
|
111
|
+
// Indicates existing data was deleted.
|
|
112
|
+
DELETE = 30;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Value capture type describes which values are recorded in the data
|
|
116
|
+
// change record.
|
|
117
|
+
enum ValueCaptureType {
|
|
118
|
+
// Not specified.
|
|
119
|
+
VALUE_CAPTURE_TYPE_UNSPECIFIED = 0;
|
|
120
|
+
|
|
121
|
+
// Records both old and new values of the modified watched columns.
|
|
122
|
+
OLD_AND_NEW_VALUES = 10;
|
|
123
|
+
|
|
124
|
+
// Records only new values of the modified watched columns.
|
|
125
|
+
NEW_VALUES = 20;
|
|
126
|
+
|
|
127
|
+
// Records new values of all watched columns, including modified and
|
|
128
|
+
// unmodified columns.
|
|
129
|
+
NEW_ROW = 30;
|
|
130
|
+
|
|
131
|
+
// Records the new values of all watched columns, including modified and
|
|
132
|
+
// unmodified columns. Also records the old values of the modified
|
|
133
|
+
// columns.
|
|
134
|
+
NEW_ROW_AND_OLD_VALUES = 40;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Indicates the timestamp in which the change was committed.
|
|
138
|
+
// DataChangeRecord.commit_timestamps,
|
|
139
|
+
// PartitionStartRecord.start_timestamps,
|
|
140
|
+
// PartitionEventRecord.commit_timestamps, and
|
|
141
|
+
// PartitionEndRecord.end_timestamps can have the same value in the same
|
|
142
|
+
// partition.
|
|
143
|
+
google.protobuf.Timestamp commit_timestamp = 1;
|
|
144
|
+
|
|
145
|
+
// Record sequence numbers are unique and monotonically increasing (but not
|
|
146
|
+
// necessarily contiguous) for a specific timestamp across record
|
|
147
|
+
// types in the same partition. To guarantee ordered processing, the reader
|
|
148
|
+
// should process records (of potentially different types) in
|
|
149
|
+
// record_sequence order for a specific timestamp in the same partition.
|
|
150
|
+
//
|
|
151
|
+
// The record sequence number ordering across partitions is only meaningful
|
|
152
|
+
// in the context of a specific transaction. Record sequence numbers are
|
|
153
|
+
// unique across partitions for a specific transaction. Sort the
|
|
154
|
+
// DataChangeRecords for the same
|
|
155
|
+
// [server_transaction_id][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.server_transaction_id]
|
|
156
|
+
// by
|
|
157
|
+
// [record_sequence][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.record_sequence]
|
|
158
|
+
// to reconstruct the ordering of the changes within the transaction.
|
|
159
|
+
string record_sequence = 2;
|
|
160
|
+
|
|
161
|
+
// Provides a globally unique string that represents the transaction in
|
|
162
|
+
// which the change was committed. Multiple transactions can have the same
|
|
163
|
+
// commit timestamp, but each transaction has a unique
|
|
164
|
+
// server_transaction_id.
|
|
165
|
+
string server_transaction_id = 3;
|
|
166
|
+
|
|
167
|
+
// Indicates whether this is the last record for a transaction in the
|
|
168
|
+
// current partition. Clients can use this field to determine when all
|
|
169
|
+
// records for a transaction in the current partition have been received.
|
|
170
|
+
bool is_last_record_in_transaction_in_partition = 4;
|
|
171
|
+
|
|
172
|
+
// Name of the table affected by the change.
|
|
173
|
+
string table = 5;
|
|
174
|
+
|
|
175
|
+
// Provides metadata describing the columns associated with the
|
|
176
|
+
// [mods][google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods] listed
|
|
177
|
+
// below.
|
|
178
|
+
repeated ColumnMetadata column_metadata = 6;
|
|
179
|
+
|
|
180
|
+
// Describes the changes that were made.
|
|
181
|
+
repeated Mod mods = 7;
|
|
182
|
+
|
|
183
|
+
// Describes the type of change.
|
|
184
|
+
ModType mod_type = 8;
|
|
185
|
+
|
|
186
|
+
// Describes the value capture type that was specified in the change stream
|
|
187
|
+
// configuration when this change was captured.
|
|
188
|
+
ValueCaptureType value_capture_type = 9;
|
|
189
|
+
|
|
190
|
+
// Indicates the number of data change records that are part of this
|
|
191
|
+
// transaction across all change stream partitions. This value can be used
|
|
192
|
+
// to assemble all the records associated with a particular transaction.
|
|
193
|
+
int32 number_of_records_in_transaction = 10;
|
|
194
|
+
|
|
195
|
+
// Indicates the number of partitions that return data change records for
|
|
196
|
+
// this transaction. This value can be helpful in assembling all records
|
|
197
|
+
// associated with a particular transaction.
|
|
198
|
+
int32 number_of_partitions_in_transaction = 11;
|
|
199
|
+
|
|
200
|
+
// Indicates the transaction tag associated with this transaction.
|
|
201
|
+
string transaction_tag = 12;
|
|
202
|
+
|
|
203
|
+
// Indicates whether the transaction is a system transaction. System
|
|
204
|
+
// transactions include those issued by time-to-live (TTL), column backfill,
|
|
205
|
+
// etc.
|
|
206
|
+
bool is_system_transaction = 13;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// A heartbeat record is returned as a progress indicator, when there are no
|
|
210
|
+
// data changes or any other partition record types in the change stream
|
|
211
|
+
// partition.
|
|
212
|
+
message HeartbeatRecord {
|
|
213
|
+
// Indicates the timestamp at which the query has returned all the records
|
|
214
|
+
// in the change stream partition with timestamp <= heartbeat timestamp.
|
|
215
|
+
// The heartbeat timestamp will not be the same as the timestamps of other
|
|
216
|
+
// record types in the same partition.
|
|
217
|
+
google.protobuf.Timestamp timestamp = 1;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// A partition start record serves as a notification that the client should
|
|
221
|
+
// schedule the partitions to be queried. PartitionStartRecord returns
|
|
222
|
+
// information about one or more partitions.
|
|
223
|
+
message PartitionStartRecord {
|
|
224
|
+
// Start timestamp at which the partitions should be queried to return
|
|
225
|
+
// change stream records with timestamps >= start_timestamp.
|
|
226
|
+
// DataChangeRecord.commit_timestamps,
|
|
227
|
+
// PartitionStartRecord.start_timestamps,
|
|
228
|
+
// PartitionEventRecord.commit_timestamps, and
|
|
229
|
+
// PartitionEndRecord.end_timestamps can have the same value in the same
|
|
230
|
+
// partition.
|
|
231
|
+
google.protobuf.Timestamp start_timestamp = 1;
|
|
232
|
+
|
|
233
|
+
// Record sequence numbers are unique and monotonically increasing (but not
|
|
234
|
+
// necessarily contiguous) for a specific timestamp across record
|
|
235
|
+
// types in the same partition. To guarantee ordered processing, the reader
|
|
236
|
+
// should process records (of potentially different types) in
|
|
237
|
+
// record_sequence order for a specific timestamp in the same partition.
|
|
238
|
+
string record_sequence = 2;
|
|
239
|
+
|
|
240
|
+
// Unique partition identifiers to be used in queries.
|
|
241
|
+
repeated string partition_tokens = 3;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// A partition end record serves as a notification that the client should stop
|
|
245
|
+
// reading the partition. No further records are expected to be retrieved on
|
|
246
|
+
// it.
|
|
247
|
+
message PartitionEndRecord {
|
|
248
|
+
// End timestamp at which the change stream partition is terminated. All
|
|
249
|
+
// changes generated by this partition will have timestamps <=
|
|
250
|
+
// end_timestamp. DataChangeRecord.commit_timestamps,
|
|
251
|
+
// PartitionStartRecord.start_timestamps,
|
|
252
|
+
// PartitionEventRecord.commit_timestamps, and
|
|
253
|
+
// PartitionEndRecord.end_timestamps can have the same value in the same
|
|
254
|
+
// partition. PartitionEndRecord is the last record returned for a
|
|
255
|
+
// partition.
|
|
256
|
+
google.protobuf.Timestamp end_timestamp = 1;
|
|
257
|
+
|
|
258
|
+
// Record sequence numbers are unique and monotonically increasing (but not
|
|
259
|
+
// necessarily contiguous) for a specific timestamp across record
|
|
260
|
+
// types in the same partition. To guarantee ordered processing, the reader
|
|
261
|
+
// should process records (of potentially different types) in
|
|
262
|
+
// record_sequence order for a specific timestamp in the same partition.
|
|
263
|
+
string record_sequence = 2;
|
|
264
|
+
|
|
265
|
+
// Unique partition identifier describing the terminated change stream
|
|
266
|
+
// partition.
|
|
267
|
+
// [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.partition_token]
|
|
268
|
+
// is equal to the partition token of the change stream partition currently
|
|
269
|
+
// queried to return this PartitionEndRecord.
|
|
270
|
+
string partition_token = 3;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// A partition event record describes key range changes for a change stream
|
|
274
|
+
// partition. The changes to a row defined by its primary key can be captured
|
|
275
|
+
// in one change stream partition for a specific time range, and then be
|
|
276
|
+
// captured in a different change stream partition for a different time range.
|
|
277
|
+
// This movement of key ranges across change stream partitions is a reflection
|
|
278
|
+
// of activities, such as Spanner's dynamic splitting and load balancing, etc.
|
|
279
|
+
// Processing this event is needed if users want to guarantee processing of
|
|
280
|
+
// the changes for any key in timestamp order. If time ordered processing of
|
|
281
|
+
// changes for a primary key is not needed, this event can be ignored.
|
|
282
|
+
// To guarantee time ordered processing for each primary key, if the event
|
|
283
|
+
// describes move-ins, the reader of this partition needs to wait until the
|
|
284
|
+
// readers of the source partitions have processed all records with timestamps
|
|
285
|
+
// <= this PartitionEventRecord.commit_timestamp, before advancing beyond this
|
|
286
|
+
// PartitionEventRecord. If the event describes move-outs, the reader can
|
|
287
|
+
// notify the readers of the destination partitions that they can continue
|
|
288
|
+
// processing.
|
|
289
|
+
message PartitionEventRecord {
|
|
290
|
+
// Describes move-in of the key ranges into the change stream partition
|
|
291
|
+
// identified by
|
|
292
|
+
// [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
|
|
293
|
+
//
|
|
294
|
+
// To maintain processing the changes for a particular key in timestamp
|
|
295
|
+
// order, the query processing the change stream partition identified by
|
|
296
|
+
// [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
|
|
297
|
+
// should not advance beyond the partition event record commit timestamp
|
|
298
|
+
// until the queries processing the source change stream partitions have
|
|
299
|
+
// processed all change stream records with timestamps <= the partition
|
|
300
|
+
// event record commit timestamp.
|
|
301
|
+
message MoveInEvent {
|
|
302
|
+
// An unique partition identifier describing the source change stream
|
|
303
|
+
// partition that recorded changes for the key range that is moving
|
|
304
|
+
// into this partition.
|
|
305
|
+
string source_partition_token = 1;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Describes move-out of the key ranges out of the change stream partition
|
|
309
|
+
// identified by
|
|
310
|
+
// [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
|
|
311
|
+
//
|
|
312
|
+
// To maintain processing the changes for a particular key in timestamp
|
|
313
|
+
// order, the query processing the
|
|
314
|
+
// [MoveOutEvent][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent]
|
|
315
|
+
// in the partition identified by
|
|
316
|
+
// [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
|
|
317
|
+
// should inform the queries processing the destination partitions that
|
|
318
|
+
// they can unblock and proceed processing records past the
|
|
319
|
+
// [commit_timestamp][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.commit_timestamp].
|
|
320
|
+
message MoveOutEvent {
|
|
321
|
+
// An unique partition identifier describing the destination change
|
|
322
|
+
// stream partition that will record changes for the key range that is
|
|
323
|
+
// moving out of this partition.
|
|
324
|
+
string destination_partition_token = 1;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Indicates the commit timestamp at which the key range change occurred.
|
|
328
|
+
// DataChangeRecord.commit_timestamps,
|
|
329
|
+
// PartitionStartRecord.start_timestamps,
|
|
330
|
+
// PartitionEventRecord.commit_timestamps, and
|
|
331
|
+
// PartitionEndRecord.end_timestamps can have the same value in the same
|
|
332
|
+
// partition.
|
|
333
|
+
google.protobuf.Timestamp commit_timestamp = 1;
|
|
334
|
+
|
|
335
|
+
// Record sequence numbers are unique and monotonically increasing (but not
|
|
336
|
+
// necessarily contiguous) for a specific timestamp across record
|
|
337
|
+
// types in the same partition. To guarantee ordered processing, the reader
|
|
338
|
+
// should process records (of potentially different types) in
|
|
339
|
+
// record_sequence order for a specific timestamp in the same partition.
|
|
340
|
+
string record_sequence = 2;
|
|
341
|
+
|
|
342
|
+
// Unique partition identifier describing the partition this event
|
|
343
|
+
// occurred on.
|
|
344
|
+
// [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token]
|
|
345
|
+
// is equal to the partition token of the change stream partition currently
|
|
346
|
+
// queried to return this PartitionEventRecord.
|
|
347
|
+
string partition_token = 3;
|
|
348
|
+
|
|
349
|
+
// Set when one or more key ranges are moved into the change stream
|
|
350
|
+
// partition identified by
|
|
351
|
+
// [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
|
|
352
|
+
//
|
|
353
|
+
// Example: Two key ranges are moved into partition (P1) from partition (P2)
|
|
354
|
+
// and partition (P3) in a single transaction at timestamp T.
|
|
355
|
+
//
|
|
356
|
+
// The PartitionEventRecord returned in P1 will reflect the move as:
|
|
357
|
+
//
|
|
358
|
+
// PartitionEventRecord {
|
|
359
|
+
// commit_timestamp: T
|
|
360
|
+
// partition_token: "P1"
|
|
361
|
+
// move_in_events {
|
|
362
|
+
// source_partition_token: "P2"
|
|
363
|
+
// }
|
|
364
|
+
// move_in_events {
|
|
365
|
+
// source_partition_token: "P3"
|
|
366
|
+
// }
|
|
367
|
+
// }
|
|
368
|
+
//
|
|
369
|
+
// The PartitionEventRecord returned in P2 will reflect the move as:
|
|
370
|
+
//
|
|
371
|
+
// PartitionEventRecord {
|
|
372
|
+
// commit_timestamp: T
|
|
373
|
+
// partition_token: "P2"
|
|
374
|
+
// move_out_events {
|
|
375
|
+
// destination_partition_token: "P1"
|
|
376
|
+
// }
|
|
377
|
+
// }
|
|
378
|
+
//
|
|
379
|
+
// The PartitionEventRecord returned in P3 will reflect the move as:
|
|
380
|
+
//
|
|
381
|
+
// PartitionEventRecord {
|
|
382
|
+
// commit_timestamp: T
|
|
383
|
+
// partition_token: "P3"
|
|
384
|
+
// move_out_events {
|
|
385
|
+
// destination_partition_token: "P1"
|
|
386
|
+
// }
|
|
387
|
+
// }
|
|
388
|
+
repeated MoveInEvent move_in_events = 4;
|
|
389
|
+
|
|
390
|
+
// Set when one or more key ranges are moved out of the change stream
|
|
391
|
+
// partition identified by
|
|
392
|
+
// [partition_token][google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.partition_token].
|
|
393
|
+
//
|
|
394
|
+
// Example: Two key ranges are moved out of partition (P1) to partition (P2)
|
|
395
|
+
// and partition (P3) in a single transaction at timestamp T.
|
|
396
|
+
//
|
|
397
|
+
// The PartitionEventRecord returned in P1 will reflect the move as:
|
|
398
|
+
//
|
|
399
|
+
// PartitionEventRecord {
|
|
400
|
+
// commit_timestamp: T
|
|
401
|
+
// partition_token: "P1"
|
|
402
|
+
// move_out_events {
|
|
403
|
+
// destination_partition_token: "P2"
|
|
404
|
+
// }
|
|
405
|
+
// move_out_events {
|
|
406
|
+
// destination_partition_token: "P3"
|
|
407
|
+
// }
|
|
408
|
+
// }
|
|
409
|
+
//
|
|
410
|
+
// The PartitionEventRecord returned in P2 will reflect the move as:
|
|
411
|
+
//
|
|
412
|
+
// PartitionEventRecord {
|
|
413
|
+
// commit_timestamp: T
|
|
414
|
+
// partition_token: "P2"
|
|
415
|
+
// move_in_events {
|
|
416
|
+
// source_partition_token: "P1"
|
|
417
|
+
// }
|
|
418
|
+
// }
|
|
419
|
+
//
|
|
420
|
+
// The PartitionEventRecord returned in P3 will reflect the move as:
|
|
421
|
+
//
|
|
422
|
+
// PartitionEventRecord {
|
|
423
|
+
// commit_timestamp: T
|
|
424
|
+
// partition_token: "P3"
|
|
425
|
+
// move_in_events {
|
|
426
|
+
// source_partition_token: "P1"
|
|
427
|
+
// }
|
|
428
|
+
// }
|
|
429
|
+
repeated MoveOutEvent move_out_events = 5;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// One of the change stream subrecords.
|
|
433
|
+
oneof record {
|
|
434
|
+
// Data change record describing a data change for a change stream
|
|
435
|
+
// partition.
|
|
436
|
+
DataChangeRecord data_change_record = 1;
|
|
437
|
+
|
|
438
|
+
// Heartbeat record describing a heartbeat for a change stream partition.
|
|
439
|
+
HeartbeatRecord heartbeat_record = 2;
|
|
440
|
+
|
|
441
|
+
// Partition start record describing a new change stream partition.
|
|
442
|
+
PartitionStartRecord partition_start_record = 3;
|
|
443
|
+
|
|
444
|
+
// Partition end record describing a terminated change stream partition.
|
|
445
|
+
PartitionEndRecord partition_end_record = 4;
|
|
446
|
+
|
|
447
|
+
// Partition event record describing key range changes for a change stream
|
|
448
|
+
// partition.
|
|
449
|
+
PartitionEventRecord partition_event_record = 5;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.spanner.v1;
|
|
18
|
+
|
|
19
|
+
import "google/api/field_behavior.proto";
|
|
20
|
+
import "google/protobuf/timestamp.proto";
|
|
21
|
+
import "google/spanner/v1/location.proto";
|
|
22
|
+
import "google/spanner/v1/transaction.proto";
|
|
23
|
+
|
|
24
|
+
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
25
|
+
option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb";
|
|
26
|
+
option java_multiple_files = true;
|
|
27
|
+
option java_outer_classname = "CommitResponseProto";
|
|
28
|
+
option java_package = "com.google.spanner.v1";
|
|
29
|
+
option php_namespace = "Google\\Cloud\\Spanner\\V1";
|
|
30
|
+
option ruby_package = "Google::Cloud::Spanner::V1";
|
|
31
|
+
|
|
32
|
+
// The response for [Commit][google.spanner.v1.Spanner.Commit].
|
|
33
|
+
message CommitResponse {
|
|
34
|
+
// Additional statistics about a commit.
|
|
35
|
+
message CommitStats {
|
|
36
|
+
// The total number of mutations for the transaction. Knowing the
|
|
37
|
+
// `mutation_count` value can help you maximize the number of mutations
|
|
38
|
+
// in a transaction and minimize the number of API round trips. You can
|
|
39
|
+
// also monitor this value to prevent transactions from exceeding the system
|
|
40
|
+
// [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
|
|
41
|
+
// If the number of mutations exceeds the limit, the server returns
|
|
42
|
+
// [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
|
|
43
|
+
int64 mutation_count = 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// The Cloud Spanner timestamp at which the transaction committed.
|
|
47
|
+
google.protobuf.Timestamp commit_timestamp = 1;
|
|
48
|
+
|
|
49
|
+
// The statistics about this `Commit`. Not returned by default.
|
|
50
|
+
// For more information, see
|
|
51
|
+
// [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
|
|
52
|
+
CommitStats commit_stats = 2;
|
|
53
|
+
|
|
54
|
+
// You must examine and retry the commit if the following is populated.
|
|
55
|
+
oneof MultiplexedSessionRetry {
|
|
56
|
+
// If specified, transaction has not committed yet.
|
|
57
|
+
// You must retry the commit with the new precommit token.
|
|
58
|
+
MultiplexedSessionPrecommitToken precommit_token = 4;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// If `TransactionOptions.isolation_level` is set to
|
|
62
|
+
// `IsolationLevel.REPEATABLE_READ`, then the snapshot timestamp is the
|
|
63
|
+
// timestamp at which all reads in the transaction ran. This timestamp is
|
|
64
|
+
// never returned.
|
|
65
|
+
google.protobuf.Timestamp snapshot_timestamp = 5;
|
|
66
|
+
|
|
67
|
+
// Optional. A cache update expresses a set of changes the client should
|
|
68
|
+
// incorporate into its location cache. The client should discard the changes
|
|
69
|
+
// if they are older than the data it already has. This data can be obtained
|
|
70
|
+
// in response to requests that included a `RoutingHint` field, but may also
|
|
71
|
+
// be obtained by explicit location-fetching RPCs which may be added in the
|
|
72
|
+
// future.
|
|
73
|
+
CacheUpdate cache_update = 6 [(google.api.field_behavior) = OPTIONAL];
|
|
74
|
+
|
|
75
|
+
// The isolation level used for the read-write transaction.
|
|
76
|
+
TransactionOptions.IsolationLevel isolation_level = 7;
|
|
77
|
+
|
|
78
|
+
// The read lock mode used for the read-write transaction.
|
|
79
|
+
TransactionOptions.ReadWrite.ReadLockMode read_lock_mode = 8;
|
|
80
|
+
}
|