@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.
Files changed (49) hide show
  1. package/README.md +111 -0
  2. package/build/protos/google/spanner/admin/database/v1/backup.proto +773 -0
  3. package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +230 -0
  4. package/build/protos/google/spanner/admin/database/v1/common.proto +132 -0
  5. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +1314 -0
  6. package/build/protos/google/spanner/admin/instance/v1/common.proto +64 -0
  7. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +2184 -0
  8. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +1610 -0
  9. package/build/protos/google/spanner/v1/change_stream.proto +451 -0
  10. package/build/protos/google/spanner/v1/commit_response.proto +80 -0
  11. package/build/protos/google/spanner/v1/keys.proto +163 -0
  12. package/build/protos/google/spanner/v1/location.proto +388 -0
  13. package/build/protos/google/spanner/v1/mutation.proto +156 -0
  14. package/build/protos/google/spanner/v1/query_plan.proto +156 -0
  15. package/build/protos/google/spanner/v1/result_set.proto +260 -0
  16. package/build/protos/google/spanner/v1/spanner.proto +1472 -0
  17. package/build/protos/google/spanner/v1/transaction.proto +329 -0
  18. package/build/protos/google/spanner/v1/type.proto +214 -0
  19. package/build/protos/protos.d.ts +42547 -0
  20. package/build/protos/protos.js +1 -0
  21. package/build/protos/protos.json +1 -0
  22. package/build/src/index.d.ts +20 -0
  23. package/build/src/index.js +34 -0
  24. package/build/src/index.js.map +1 -0
  25. package/build/src/v1/database_admin_client.d.ts +2433 -0
  26. package/build/src/v1/database_admin_client.js +2938 -0
  27. package/build/src/v1/database_admin_client.js.map +1 -0
  28. package/build/src/v1/database_admin_client_config.json +169 -0
  29. package/build/src/v1/database_admin_proto_list.json +6 -0
  30. package/build/src/v1/gapic_metadata.json +253 -0
  31. package/build/src/v1/index.d.ts +4 -0
  32. package/build/src/v1/index.js +29 -0
  33. package/build/src/v1/index.js.map +1 -0
  34. package/build/src/v1/instance_admin_client.d.ts +2162 -0
  35. package/build/src/v1/instance_admin_client.js +2411 -0
  36. package/build/src/v1/instance_admin_client.js.map +1 -0
  37. package/build/src/v1/instance_admin_client_config.json +129 -0
  38. package/build/src/v1/instance_admin_proto_list.json +4 -0
  39. package/build/src/v1/spanner_client.d.ts +1353 -0
  40. package/build/src/v1/spanner_client.js +1456 -0
  41. package/build/src/v1/spanner_client.js.map +1 -0
  42. package/build/src/v1/spanner_client_config.json +123 -0
  43. package/build/src/v1/spanner_executor_proxy_client.d.ts +419 -0
  44. package/build/src/v1/spanner_executor_proxy_client.js +730 -0
  45. package/build/src/v1/spanner_executor_proxy_client.js.map +1 -0
  46. package/build/src/v1/spanner_executor_proxy_client_config.json +30 -0
  47. package/build/src/v1/spanner_executor_proxy_proto_list.json +15 -0
  48. package/build/src/v1/spanner_proto_list.json +12 -0
  49. package/package.json +65 -0
@@ -0,0 +1,1610 @@
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.executor.v1;
18
+
19
+ import "google/api/client.proto";
20
+ import "google/api/field_behavior.proto";
21
+ import "google/longrunning/operations.proto";
22
+ import "google/protobuf/timestamp.proto";
23
+ import "google/rpc/status.proto";
24
+ import "google/spanner/admin/database/v1/backup.proto";
25
+ import "google/spanner/admin/database/v1/common.proto";
26
+ import "google/spanner/admin/database/v1/spanner_database_admin.proto";
27
+ import "google/spanner/admin/instance/v1/spanner_instance_admin.proto";
28
+ import "google/spanner/v1/spanner.proto";
29
+ import "google/spanner/v1/type.proto";
30
+
31
+ option go_package = "cloud.google.com/go/spanner/executor/apiv1/executorpb;executorpb";
32
+ option java_multiple_files = true;
33
+ option java_outer_classname = "CloudExecutorProto";
34
+ option java_package = "com.google.spanner.executor.v1";
35
+
36
+ // Service that executes SpannerActions asynchronously.
37
+ service SpannerExecutorProxy {
38
+ option (google.api.default_host) = "spanner-cloud-executor.googleapis.com";
39
+
40
+ // ExecuteActionAsync is a streaming call that starts executing a new Spanner
41
+ // action.
42
+ //
43
+ // For each request, the server will reply with one or more responses, but
44
+ // only the last response will contain status in the outcome.
45
+ //
46
+ // Responses can be matched to requests by action_id. It is allowed to have
47
+ // multiple actions in flight--in that case, actions are be executed in
48
+ // parallel.
49
+ rpc ExecuteActionAsync(stream SpannerAsyncActionRequest)
50
+ returns (stream SpannerAsyncActionResponse) {}
51
+ }
52
+
53
+ // Request to executor service that start a new Spanner action.
54
+ message SpannerAsyncActionRequest {
55
+ // Action id to uniquely identify this action request.
56
+ int32 action_id = 1;
57
+
58
+ // The actual SpannerAction to perform.
59
+ SpannerAction action = 2;
60
+ }
61
+
62
+ // Response from executor service.
63
+ message SpannerAsyncActionResponse {
64
+ // Action id corresponds to the request.
65
+ int32 action_id = 1;
66
+
67
+ // If action results are split into multiple responses, only the last response
68
+ // can and should contain status.
69
+ SpannerActionOutcome outcome = 2;
70
+ }
71
+
72
+ // SpannerAction defines a primitive action that can be performed against
73
+ // Spanner, such as begin or commit a transaction, or perform a read or
74
+ // mutation.
75
+ message SpannerAction {
76
+ // Database against which to perform action.
77
+ // In a context where a series of actions take place, an action may omit
78
+ // database path if it applies to the same database as the previous action.
79
+ string database_path = 1;
80
+
81
+ // Configuration options for Spanner backend
82
+ SpannerOptions spanner_options = 2;
83
+
84
+ // Action represents a spanner action kind, there will only be one action kind
85
+ // per SpannerAction.
86
+ oneof action {
87
+ // Action to start a transaction.
88
+ StartTransactionAction start = 10;
89
+
90
+ // Action to finish a transaction.
91
+ FinishTransactionAction finish = 11;
92
+
93
+ // Action to do a normal read.
94
+ ReadAction read = 20;
95
+
96
+ // Action to do a query.
97
+ QueryAction query = 21;
98
+
99
+ // Action to buffer a mutation.
100
+ MutationAction mutation = 22;
101
+
102
+ // Action to a DML.
103
+ DmlAction dml = 23;
104
+
105
+ // Action to a batch DML.
106
+ BatchDmlAction batch_dml = 24;
107
+
108
+ // Action to write a mutation.
109
+ WriteMutationsAction write = 25;
110
+
111
+ // Action to a partitioned update.
112
+ PartitionedUpdateAction partitioned_update = 27;
113
+
114
+ // Action that contains any administrative operation, like database,
115
+ // instance manipulation.
116
+ AdminAction admin = 30;
117
+
118
+ // Action to start a batch transaction.
119
+ StartBatchTransactionAction start_batch_txn = 40;
120
+
121
+ // Action to close a batch transaction.
122
+ CloseBatchTransactionAction close_batch_txn = 41;
123
+
124
+ // Action to generate database partitions for batch read.
125
+ GenerateDbPartitionsForReadAction generate_db_partitions_read = 42;
126
+
127
+ // Action to generate database partitions for batch query.
128
+ GenerateDbPartitionsForQueryAction generate_db_partitions_query = 43;
129
+
130
+ // Action to execute batch actions on generated partitions.
131
+ ExecutePartitionAction execute_partition = 44;
132
+
133
+ // Action to execute change stream query.
134
+ ExecuteChangeStreamQuery execute_change_stream_query = 50;
135
+
136
+ // Query cancellation action for testing the cancellation of a query.
137
+ QueryCancellationAction query_cancellation = 51;
138
+
139
+ // Action to adapt a message.
140
+ AdaptMessageAction adapt_message = 52;
141
+ }
142
+ }
143
+
144
+ // A single read request.
145
+ message ReadAction {
146
+ // The table to read at.
147
+ string table = 1;
148
+
149
+ // The index to read at if it's an index read.
150
+ optional string index = 2;
151
+
152
+ // List of columns must begin with the key columns used for the read.
153
+ repeated string column = 3;
154
+
155
+ // Keys for performing this read.
156
+ KeySet keys = 4;
157
+
158
+ // Limit on number of rows to read. If set, must be positive.
159
+ int32 limit = 5;
160
+ }
161
+
162
+ // A SQL query request.
163
+ message QueryAction {
164
+ // Parameter that bind to placeholders in the SQL string
165
+ message Parameter {
166
+ // Name of the parameter (with no leading @).
167
+ string name = 1;
168
+
169
+ // Type of the parameter.
170
+ google.spanner.v1.Type type = 2;
171
+
172
+ // Value of the parameter.
173
+ Value value = 3;
174
+ }
175
+
176
+ // The SQL string.
177
+ string sql = 1;
178
+
179
+ // Parameters for the SQL string.
180
+ repeated Parameter params = 2;
181
+
182
+ // Secure context parameters.
183
+ map<string, Value> secure_context = 3;
184
+ }
185
+
186
+ // A single DML statement.
187
+ message DmlAction {
188
+ // DML statement.
189
+ QueryAction update = 1;
190
+
191
+ // Whether to autocommit the transaction after executing the DML statement,
192
+ // if the Executor supports autocommit.
193
+ optional bool autocommit_if_supported = 2;
194
+
195
+ // Whether to set this DML statement as the last statement in the
196
+ // transaction. The transaction should be committed after processing this DML
197
+ // statement.
198
+ optional bool last_statement = 3;
199
+ }
200
+
201
+ // Batch of DML statements invoked using batched execution.
202
+ message BatchDmlAction {
203
+ // DML statements.
204
+ repeated QueryAction updates = 1;
205
+
206
+ // Whether to set this request with the last statement option in the
207
+ // transaction. The transaction should be committed after processing this
208
+ // request.
209
+ optional bool last_statements = 2;
210
+ }
211
+
212
+ // Value represents a single value that can be read or written to/from
213
+ // Spanner.
214
+ message Value {
215
+ // Exactly one of the following fields will be present.
216
+ oneof value_type {
217
+ // If is_null is set, then this value is null.
218
+ bool is_null = 1;
219
+
220
+ // Int type value. It's used for all integer number types, like int32 and
221
+ // int64.
222
+ int64 int_value = 2;
223
+
224
+ // Bool type value.
225
+ bool bool_value = 3;
226
+
227
+ // Double type value. It's used for all float point types, like float and
228
+ // double.
229
+ double double_value = 4;
230
+
231
+ // Bytes type value, stored in CORD. It's also used for PROTO type value.
232
+ bytes bytes_value = 5;
233
+
234
+ // String type value, stored in CORD.
235
+ string string_value = 6;
236
+
237
+ // Struct type value. It contains a ValueList representing the values in
238
+ // this struct.
239
+ ValueList struct_value = 7;
240
+
241
+ // Timestamp type value.
242
+ google.protobuf.Timestamp timestamp_value = 8;
243
+
244
+ // Date type value. Date is specified as a number of days since Unix epoch.
245
+ int32 date_days_value = 9;
246
+
247
+ // If set, holds the sentinel value for the transaction CommitTimestamp.
248
+ bool is_commit_timestamp = 10;
249
+
250
+ // Array type value. The underlying Valuelist should have values that have
251
+ // the same type.
252
+ ValueList array_value = 11;
253
+ }
254
+
255
+ // Type of array element. Only set if value is an array.
256
+ optional google.spanner.v1.Type array_type = 12;
257
+ }
258
+
259
+ // KeyRange represents a range of rows in a table or index.
260
+ //
261
+ // A range has a start key and an end key. These keys can be open or
262
+ // closed, indicating if the range includes rows with that key.
263
+ //
264
+ // Keys are represented by "ValueList", where the ith value in the list
265
+ // corresponds to the ith component of the table or index primary key.
266
+ message KeyRange {
267
+ // Type controls whether "start" and "limit" are open or closed. By default,
268
+ // "start" is closed, and "limit" is open.
269
+ enum Type {
270
+ // "TYPE_UNSPECIFIED" is equivalent to "CLOSED_OPEN".
271
+ TYPE_UNSPECIFIED = 0;
272
+
273
+ // [start,limit]
274
+ CLOSED_CLOSED = 1;
275
+
276
+ // [start,limit)
277
+ CLOSED_OPEN = 2;
278
+
279
+ // (start,limit]
280
+ OPEN_CLOSED = 3;
281
+
282
+ // (start,limit)
283
+ OPEN_OPEN = 4;
284
+ }
285
+
286
+ // "start" and "limit" must have the same number of key parts,
287
+ // though they may name only a prefix of the table or index key.
288
+ // The start key of this KeyRange.
289
+ ValueList start = 1;
290
+
291
+ // The end key of this KeyRange.
292
+ ValueList limit = 2;
293
+
294
+ // "start" and "limit" type for this KeyRange.
295
+ optional Type type = 3;
296
+ }
297
+
298
+ // KeySet defines a collection of Spanner keys and/or key ranges. All
299
+ // the keys are expected to be in the same table. The keys need not be
300
+ // sorted in any particular way.
301
+ message KeySet {
302
+ // A list of specific keys. Entries in "keys" should have exactly as
303
+ // many elements as there are columns in the primary or index key
304
+ // with which this "KeySet" is used.
305
+ repeated ValueList point = 1;
306
+
307
+ // A list of key ranges.
308
+ repeated KeyRange range = 2;
309
+
310
+ // For convenience "all" can be set to "true" to indicate that this
311
+ // "KeySet" matches all keys in the table or index. Note that any keys
312
+ // specified in "keys" or "ranges" are only yielded once.
313
+ bool all = 3;
314
+ }
315
+
316
+ // List of values.
317
+ message ValueList {
318
+ // Values contained in this ValueList.
319
+ repeated Value value = 1;
320
+ }
321
+
322
+ // A single mutation request.
323
+ message MutationAction {
324
+ // Arguments to Insert, InsertOrUpdate, and Replace operations.
325
+ message InsertArgs {
326
+ // The names of the columns to be written.
327
+ repeated string column = 1;
328
+
329
+ // Type information for the "values" entries below.
330
+ repeated google.spanner.v1.Type type = 2;
331
+
332
+ // The values to be written.
333
+ repeated ValueList values = 3;
334
+ }
335
+
336
+ // Arguments to Update.
337
+ message UpdateArgs {
338
+ // The columns to be updated. Identical to InsertArgs.column.
339
+ repeated string column = 1;
340
+
341
+ // Type information for "values". Identical to InsertArgs.type.
342
+ repeated google.spanner.v1.Type type = 2;
343
+
344
+ // The values to be updated. Identical to InsertArgs.values.
345
+ repeated ValueList values = 3;
346
+ }
347
+
348
+ // Mod represents the write action that will be perform to a table. Each mod
349
+ // will specify exactly one action, from insert, update, insert_or_update,
350
+ // replace and delete.
351
+ message Mod {
352
+ // The table to write.
353
+ string table = 1;
354
+
355
+ // Exactly one of the remaining elements may be present.
356
+ // Insert new rows into "table".
357
+ InsertArgs insert = 2;
358
+
359
+ // Update columns stored in existing rows of "table".
360
+ UpdateArgs update = 3;
361
+
362
+ // Insert or update existing rows of "table".
363
+ InsertArgs insert_or_update = 4;
364
+
365
+ // Replace existing rows of "table".
366
+ InsertArgs replace = 5;
367
+
368
+ // Delete rows from "table".
369
+ KeySet delete_keys = 6;
370
+ }
371
+
372
+ // Mods that contained in this mutation.
373
+ repeated Mod mod = 1;
374
+ }
375
+
376
+ // WriteMutationAction defines an action of flushing the mutation so they
377
+ // are visible to subsequent operations in the transaction.
378
+ message WriteMutationsAction {
379
+ // The mutation to write.
380
+ MutationAction mutation = 1;
381
+ }
382
+
383
+ // PartitionedUpdateAction defines an action to execute a partitioned DML
384
+ // which runs different partitions in parallel.
385
+ message PartitionedUpdateAction {
386
+ message ExecutePartitionedUpdateOptions {
387
+ // RPC Priority
388
+ optional google.spanner.v1.RequestOptions.Priority rpc_priority = 1;
389
+
390
+ // Transaction tag
391
+ optional string tag = 2;
392
+ }
393
+
394
+ // Options for partitioned update.
395
+ optional ExecutePartitionedUpdateOptions options = 1;
396
+
397
+ // Partitioned dml query.
398
+ QueryAction update = 2;
399
+ }
400
+
401
+ // StartTransactionAction defines an action of initializing a transaction.
402
+ message StartTransactionAction {
403
+ // Concurrency is for read-only transactions and must be omitted for
404
+ // read-write transactions.
405
+ optional Concurrency concurrency = 1;
406
+
407
+ // Metadata about tables and columns that will be involved in this
408
+ // transaction. It is to convert values of key parts correctly.
409
+ repeated TableMetadata table = 2;
410
+
411
+ // Transaction_seed contains workid and op pair for this transaction, used for
412
+ // testing.
413
+ string transaction_seed = 3;
414
+
415
+ // Execution options (e.g., whether transaction is opaque, optimistic,
416
+ // excluded from change streams).
417
+ optional TransactionExecutionOptions execution_options = 4;
418
+ }
419
+
420
+ // Concurrency for read-only transactions.
421
+ message Concurrency {
422
+ // Concurrency mode set for read-only transactions, exactly one mode below
423
+ // should be set.
424
+ oneof concurrency_mode {
425
+ // Indicates a read at a consistent timestamp that is specified relative to
426
+ // now. That is, if the caller has specified an exact staleness of s
427
+ // seconds, we will read at now - s.
428
+ double staleness_seconds = 1;
429
+
430
+ // Indicates a boundedly stale read that reads at a timestamp >= T.
431
+ int64 min_read_timestamp_micros = 2;
432
+
433
+ // Indicates a boundedly stale read that is at most N seconds stale.
434
+ double max_staleness_seconds = 3;
435
+
436
+ // Indicates a read at a consistent timestamp.
437
+ int64 exact_timestamp_micros = 4;
438
+
439
+ // Indicates a strong read, must only be set to true, or unset.
440
+ bool strong = 5;
441
+
442
+ // Indicates a batch read, must only be set to true, or unset.
443
+ bool batch = 6;
444
+ }
445
+
446
+ // True if exact_timestamp_micros is set, and the chosen timestamp is that of
447
+ // a snapshot epoch.
448
+ bool snapshot_epoch_read = 7;
449
+
450
+ // If set, this is a snapshot epoch read constrained to read only the
451
+ // specified log scope root table, and its children. Will not be set for full
452
+ // database epochs.
453
+ string snapshot_epoch_root_table = 8;
454
+
455
+ // Set only when batch is true.
456
+ int64 batch_read_timestamp_micros = 9;
457
+ }
458
+
459
+ // TableMetadata contains metadata of a single table.
460
+ message TableMetadata {
461
+ // Table name.
462
+ string name = 1;
463
+
464
+ // Columns, in the same order as in the schema.
465
+ repeated ColumnMetadata column = 2;
466
+
467
+ // Keys, in order. Column name is currently not populated.
468
+ repeated ColumnMetadata key_column = 3;
469
+ }
470
+
471
+ // ColumnMetadata represents metadata of a single column.
472
+ message ColumnMetadata {
473
+ // Column name.
474
+ string name = 1;
475
+
476
+ // Column type.
477
+ google.spanner.v1.Type type = 2;
478
+ }
479
+
480
+ message TransactionExecutionOptions {
481
+ // Whether optimistic concurrency should be used to execute this transaction.
482
+ bool optimistic = 1;
483
+
484
+ // Whether traffic from this transaction will be excluded from tracking change
485
+ // streams with allow_txn_exclusion=true.
486
+ bool exclude_from_change_streams = 2;
487
+
488
+ // Whether serializable isolation with optimistic mode concurrency should be
489
+ // used to execute this transaction.
490
+ bool serializable_optimistic = 3;
491
+
492
+ // Whether snapshot isolation with optimistic mode concurrency should be used
493
+ // to execute this transaction.
494
+ bool snapshot_isolation_optimistic = 4;
495
+
496
+ // Whether snapshot isolation with pessimistic mode concurrency should be used
497
+ // to execute this transaction.
498
+ bool snapshot_isolation_pessimistic = 5;
499
+
500
+ // Whether to exclude mutations of this transaction from the allowed tracking
501
+ // change streams.
502
+ bool exclude_txn_from_change_streams = 6;
503
+ }
504
+
505
+ // FinishTransactionAction defines an action of finishing a transaction.
506
+ message FinishTransactionAction {
507
+ // Mode indicates how the transaction should be finished.
508
+ enum Mode {
509
+ // "MODE_UNSPECIFIED" is equivalent to "COMMIT".
510
+ MODE_UNSPECIFIED = 0;
511
+
512
+ // Commit the transaction.
513
+ COMMIT = 1;
514
+
515
+ // Drop the transaction without committing it.
516
+ ABANDON = 2;
517
+ }
518
+
519
+ // Defines how exactly the transaction should be completed, e.g. with
520
+ // commit or abortion.
521
+ Mode mode = 1;
522
+ }
523
+
524
+ // AdminAction defines all the cloud spanner admin actions, including
525
+ // instance/database admin ops, backup ops and operation actions.
526
+ message AdminAction {
527
+ // Exactly one of the actions below will be performed in AdminAction.
528
+ oneof action {
529
+ // Action that creates a user instance config.
530
+ CreateUserInstanceConfigAction create_user_instance_config = 1;
531
+
532
+ // Action that updates a user instance config.
533
+ UpdateUserInstanceConfigAction update_user_instance_config = 2;
534
+
535
+ // Action that deletes a user instance config.
536
+ DeleteUserInstanceConfigAction delete_user_instance_config = 3;
537
+
538
+ // Action that gets a user instance config.
539
+ GetCloudInstanceConfigAction get_cloud_instance_config = 4;
540
+
541
+ // Action that lists user instance configs.
542
+ ListCloudInstanceConfigsAction list_instance_configs = 5;
543
+
544
+ // Action that creates a Cloud Spanner instance.
545
+ CreateCloudInstanceAction create_cloud_instance = 6;
546
+
547
+ // Action that updates a Cloud Spanner instance.
548
+ UpdateCloudInstanceAction update_cloud_instance = 7;
549
+
550
+ // Action that deletes a Cloud Spanner instance.
551
+ DeleteCloudInstanceAction delete_cloud_instance = 8;
552
+
553
+ // Action that lists Cloud Spanner instances.
554
+ ListCloudInstancesAction list_cloud_instances = 9;
555
+
556
+ // Action that retrieves a Cloud Spanner instance.
557
+ GetCloudInstanceAction get_cloud_instance = 10;
558
+
559
+ // Action that creates a Cloud Spanner database.
560
+ CreateCloudDatabaseAction create_cloud_database = 11;
561
+
562
+ // Action that updates the schema of a Cloud Spanner database.
563
+ UpdateCloudDatabaseDdlAction update_cloud_database_ddl = 12;
564
+
565
+ // Action that updates the schema of a Cloud Spanner database.
566
+ UpdateCloudDatabaseAction update_cloud_database = 27;
567
+
568
+ // Action that drops a Cloud Spanner database.
569
+ DropCloudDatabaseAction drop_cloud_database = 13;
570
+
571
+ // Action that lists Cloud Spanner databases.
572
+ ListCloudDatabasesAction list_cloud_databases = 14;
573
+
574
+ // Action that lists Cloud Spanner database operations.
575
+ ListCloudDatabaseOperationsAction list_cloud_database_operations = 15;
576
+
577
+ // Action that restores a Cloud Spanner database from a backup.
578
+ RestoreCloudDatabaseAction restore_cloud_database = 16;
579
+
580
+ // Action that gets a Cloud Spanner database.
581
+ GetCloudDatabaseAction get_cloud_database = 17;
582
+
583
+ // Action that creates a Cloud Spanner database backup.
584
+ CreateCloudBackupAction create_cloud_backup = 18;
585
+
586
+ // Action that copies a Cloud Spanner database backup.
587
+ CopyCloudBackupAction copy_cloud_backup = 19;
588
+
589
+ // Action that gets a Cloud Spanner database backup.
590
+ GetCloudBackupAction get_cloud_backup = 20;
591
+
592
+ // Action that updates a Cloud Spanner database backup.
593
+ UpdateCloudBackupAction update_cloud_backup = 21;
594
+
595
+ // Action that deletes a Cloud Spanner database backup.
596
+ DeleteCloudBackupAction delete_cloud_backup = 22;
597
+
598
+ // Action that lists Cloud Spanner database backups.
599
+ ListCloudBackupsAction list_cloud_backups = 23;
600
+
601
+ // Action that lists Cloud Spanner database backup operations.
602
+ ListCloudBackupOperationsAction list_cloud_backup_operations = 24;
603
+
604
+ // Action that gets an operation.
605
+ GetOperationAction get_operation = 25;
606
+
607
+ // Action that cancels an operation.
608
+ CancelOperationAction cancel_operation = 26;
609
+
610
+ // Action that changes quorum of a Cloud Spanner database.
611
+ ChangeQuorumCloudDatabaseAction change_quorum_cloud_database = 28;
612
+
613
+ // Action that adds splits to a Cloud Spanner database.
614
+ AddSplitPointsAction add_split_points = 29;
615
+ }
616
+ }
617
+
618
+ // Action that creates a user instance config.
619
+ message CreateUserInstanceConfigAction {
620
+ // User instance config ID (not path), e.g. "custom-config".
621
+ string user_config_id = 1;
622
+
623
+ // Cloud project ID, e.g. "spanner-cloud-systest".
624
+ string project_id = 2;
625
+
626
+ // Base config ID, e.g. "test-config".
627
+ string base_config_id = 3;
628
+
629
+ // Replicas that should be included in the user config.
630
+ repeated google.spanner.admin.instance.v1.ReplicaInfo replicas = 4;
631
+ }
632
+
633
+ // Action that updates a user instance config.
634
+ message UpdateUserInstanceConfigAction {
635
+ // User instance config ID (not path), e.g. "custom-config".
636
+ string user_config_id = 1;
637
+
638
+ // Cloud project ID, e.g. "spanner-cloud-systest".
639
+ string project_id = 2;
640
+
641
+ // The descriptive name for this instance config as it appears in UIs.
642
+ optional string display_name = 3;
643
+
644
+ // labels.
645
+ map<string, string> labels = 4;
646
+ }
647
+
648
+ // Action that gets a user instance config.
649
+ message GetCloudInstanceConfigAction {
650
+ // Instance config ID (not path), e.g. "custom-config".
651
+ string instance_config_id = 1;
652
+
653
+ // Cloud project ID, e.g. "spanner-cloud-systest".
654
+ string project_id = 2;
655
+ }
656
+
657
+ // Action that deletes a user instance configs.
658
+ message DeleteUserInstanceConfigAction {
659
+ // User instance config ID (not path), e.g. "custom-config".
660
+ string user_config_id = 1;
661
+
662
+ // Cloud project ID, e.g. "spanner-cloud-systest".
663
+ string project_id = 2;
664
+ }
665
+
666
+ // Action that lists user instance configs.
667
+ message ListCloudInstanceConfigsAction {
668
+ // Cloud project ID, e.g. "spanner-cloud-systest".
669
+ string project_id = 1;
670
+
671
+ // Number of instance configs to be returned in the response. If 0 or
672
+ // less, defaults to the server's maximum allowed page size.
673
+ optional int32 page_size = 2;
674
+
675
+ // If non-empty, "page_token" should contain a next_page_token
676
+ // from a previous ListInstanceConfigsResponse to the same "parent".
677
+ optional string page_token = 3;
678
+ }
679
+
680
+ // Action that creates a Cloud Spanner instance.
681
+ message CreateCloudInstanceAction {
682
+ // Cloud instance ID (not path), e.g. "test-instance".
683
+ string instance_id = 1;
684
+
685
+ // Cloud project ID, e.g. "spanner-cloud-systest".
686
+ string project_id = 2;
687
+
688
+ // Instance config ID, e.g. "test-config".
689
+ string instance_config_id = 3;
690
+
691
+ // Number of nodes (processing_units should not be set or set to 0 if used).
692
+ optional int32 node_count = 4;
693
+
694
+ // Number of processing units (node_count should be set to 0 if used).
695
+ optional int32 processing_units = 6;
696
+
697
+ // The autoscaling config for this instance. If non-empty, an autoscaling
698
+ // instance will be created (processing_units and node_count should be set to
699
+ // 0 if used).
700
+ optional google.spanner.admin.instance.v1.AutoscalingConfig
701
+ autoscaling_config = 7;
702
+
703
+ // labels.
704
+ map<string, string> labels = 5;
705
+
706
+ // The edition of the instance.
707
+ google.spanner.admin.instance.v1.Instance.Edition edition = 8;
708
+ }
709
+
710
+ // Action that updates a Cloud Spanner instance.
711
+ message UpdateCloudInstanceAction {
712
+ // Cloud instance ID (not path), e.g. "test-instance".
713
+ string instance_id = 1;
714
+
715
+ // Cloud project ID, e.g. "spanner-cloud-systest".
716
+ string project_id = 2;
717
+
718
+ // The descriptive name for this instance as it appears in UIs.
719
+ // Must be unique per project and between 4 and 30 characters in length.
720
+ optional string display_name = 3;
721
+
722
+ // The number of nodes allocated to this instance. At most one of either
723
+ // node_count or processing_units should be present in the message.
724
+ optional int32 node_count = 4;
725
+
726
+ // The number of processing units allocated to this instance. At most one of
727
+ // processing_units or node_count should be present in the message.
728
+ optional int32 processing_units = 5;
729
+
730
+ // The autoscaling config for this instance. If non-empty, this instance is
731
+ // using autoscaling (processing_units and node_count should be set to
732
+ // 0 if used).
733
+ optional google.spanner.admin.instance.v1.AutoscalingConfig
734
+ autoscaling_config = 7;
735
+
736
+ // labels.
737
+ map<string, string> labels = 6;
738
+
739
+ // The edition of the instance.
740
+ google.spanner.admin.instance.v1.Instance.Edition edition = 8;
741
+ }
742
+
743
+ // Action that deletes a Cloud Spanner instance.
744
+ message DeleteCloudInstanceAction {
745
+ // Cloud instance ID (not path), e.g. "test-instance".
746
+ string instance_id = 1;
747
+
748
+ // Cloud project ID, e.g. "spanner-cloud-systest".
749
+ string project_id = 2;
750
+ }
751
+
752
+ // Action that creates a Cloud Spanner database.
753
+ message CreateCloudDatabaseAction {
754
+ // Cloud instance ID (not path), e.g. "test-instance".
755
+ string instance_id = 1;
756
+
757
+ // Cloud project ID, e.g. "spanner-cloud-systest".
758
+ string project_id = 2;
759
+
760
+ // Cloud database ID (not full path), e.g. "db0".
761
+ string database_id = 3;
762
+
763
+ // SDL statements to apply to the new database.
764
+ repeated string sdl_statement = 4;
765
+
766
+ // The KMS key used to encrypt the database to be created if the database
767
+ // should be CMEK protected.
768
+ google.spanner.admin.database.v1.EncryptionConfig encryption_config = 5;
769
+
770
+ // Optional SQL dialect (GOOGLESQL or POSTGRESQL). Default: GOOGLESQL.
771
+ optional string dialect = 6;
772
+
773
+ optional bytes proto_descriptors = 7;
774
+ }
775
+
776
+ // Action that updates the schema of a Cloud Spanner database.
777
+ message UpdateCloudDatabaseDdlAction {
778
+ // Cloud instance ID (not path), e.g. "test-instance".
779
+ string instance_id = 1;
780
+
781
+ // Cloud project ID, e.g. "spanner-cloud-systest".
782
+ string project_id = 2;
783
+
784
+ // Cloud database ID (not full path), e.g. "db0".
785
+ string database_id = 3;
786
+
787
+ // SDL statements to apply to the database.
788
+ repeated string sdl_statement = 4;
789
+
790
+ // Op ID can be used to track progress of the update. If set, it must be
791
+ // unique per database. If not set, Cloud Spanner will generate operation ID
792
+ // automatically.
793
+ string operation_id = 5;
794
+
795
+ optional bytes proto_descriptors = 6;
796
+ }
797
+
798
+ // Action that updates a Cloud Spanner database.
799
+ message UpdateCloudDatabaseAction {
800
+ // Cloud instance ID (not path), e.g. "test-instance".
801
+ string instance_id = 1;
802
+
803
+ // Cloud project ID, e.g. "spanner-cloud-systest".
804
+ string project_id = 2;
805
+
806
+ // Cloud database name (not full path), e.g. "db0".
807
+ string database_name = 3;
808
+
809
+ // Updated value of enable_drop_protection, this is the only field that has
810
+ // supported to be updated.
811
+ bool enable_drop_protection = 4;
812
+ }
813
+
814
+ // Action that drops a Cloud Spanner database.
815
+ message DropCloudDatabaseAction {
816
+ // Cloud instance ID (not path), e.g. "test-instance".
817
+ string instance_id = 1;
818
+
819
+ // Cloud project ID, e.g. "spanner-cloud-systest".
820
+ string project_id = 2;
821
+
822
+ // Cloud database ID (not full path), e.g. "db0".
823
+ string database_id = 3;
824
+ }
825
+
826
+ // Action that changes quorum of a Cloud Spanner database.
827
+ message ChangeQuorumCloudDatabaseAction {
828
+ // The fully qualified uri of the database whose quorum has to be changed.
829
+ optional string database_uri = 1;
830
+
831
+ // The locations of the serving regions, e.g. "asia-south1".
832
+ repeated string serving_locations = 2;
833
+ }
834
+
835
+ // A single Adapt message request.
836
+ message AdaptMessageAction {
837
+ // The fully qualified uri of the database to send AdaptMessage to.
838
+ string database_uri = 1;
839
+
840
+ // The protocol to use for the request.
841
+ string protocol = 2;
842
+
843
+ // The payload of the request.
844
+ bytes payload = 3;
845
+
846
+ // Attachments to be sent with the request.
847
+ map<string, string> attachments = 4;
848
+
849
+ // The query to be sent with the request.
850
+ string query = 5;
851
+
852
+ // If true, the action will send a Prepare request first and then an
853
+ // Execute request right after to execute the query. This is only supported
854
+ // for Cloud Client path.
855
+ bool prepare_then_execute = 6;
856
+ }
857
+
858
+ // Action that lists Cloud Spanner databases.
859
+ message ListCloudDatabasesAction {
860
+ // Cloud project ID, e.g. "spanner-cloud-systest".
861
+ string project_id = 1;
862
+
863
+ // Cloud instance ID (not path) to list databases from, e.g. "test-instance".
864
+ string instance_id = 2;
865
+
866
+ // Number of databases to be returned in the response. If 0 or
867
+ // less, defaults to the server's maximum allowed page size.
868
+ int32 page_size = 3;
869
+
870
+ // If non-empty, "page_token" should contain a next_page_token
871
+ // from a previous ListDatabasesResponse to the same "parent"
872
+ // and with the same "filter".
873
+ string page_token = 4;
874
+ }
875
+
876
+ // Action that lists Cloud Spanner instances.
877
+ message ListCloudInstancesAction {
878
+ // Cloud project ID, e.g. "spanner-cloud-systest".
879
+ string project_id = 1;
880
+
881
+ // A filter expression that filters what operations are returned in the
882
+ // response.
883
+ // The expression must specify the field name, a comparison operator,
884
+ // and the value that you want to use for filtering.
885
+ // Refer spanner_instance_admin.proto.ListInstancesRequest for
886
+ // detail.
887
+ optional string filter = 2;
888
+
889
+ // Number of instances to be returned in the response. If 0 or
890
+ // less, defaults to the server's maximum allowed page size.
891
+ optional int32 page_size = 3;
892
+
893
+ // If non-empty, "page_token" should contain a next_page_token
894
+ // from a previous ListInstancesResponse to the same "parent"
895
+ // and with the same "filter".
896
+ optional string page_token = 4;
897
+ }
898
+
899
+ // Action that retrieves a Cloud Spanner instance.
900
+ message GetCloudInstanceAction {
901
+ // Cloud project ID, e.g. "spanner-cloud-systest".
902
+ string project_id = 1;
903
+
904
+ // Cloud instance ID (not path) to retrieve the instance from,
905
+ // e.g. "test-instance".
906
+ string instance_id = 2;
907
+ }
908
+
909
+ // Action that lists Cloud Spanner database operations.
910
+ message ListCloudDatabaseOperationsAction {
911
+ // Cloud project ID, e.g. "spanner-cloud-systest".
912
+ string project_id = 1;
913
+
914
+ // Cloud instance ID (not path) to list database operations from,
915
+ // e.g. "test-instance".
916
+ string instance_id = 2;
917
+
918
+ // A filter expression that filters what operations are returned in the
919
+ // response.
920
+ // The expression must specify the field name, a comparison operator,
921
+ // and the value that you want to use for filtering.
922
+ // Refer spanner_database_admin.proto.ListDatabaseOperationsRequest for
923
+ // detail.
924
+ string filter = 3;
925
+
926
+ // Number of databases to be returned in the response. If 0 or
927
+ // less, defaults to the server's maximum allowed page size.
928
+ int32 page_size = 4;
929
+
930
+ // If non-empty, "page_token" should contain a next_page_token
931
+ // from a previous ListDatabaseOperationsResponse to the same "parent"
932
+ // and with the same "filter".
933
+ string page_token = 5;
934
+ }
935
+
936
+ // Action that restores a Cloud Spanner database from a backup.
937
+ message RestoreCloudDatabaseAction {
938
+ // Cloud project ID, e.g. "spanner-cloud-systest".
939
+ string project_id = 1;
940
+
941
+ // Cloud instance ID (not path) containing the backup, e.g. "backup-instance".
942
+ string backup_instance_id = 2;
943
+
944
+ // The id of the backup from which to restore, e.g. "test-backup".
945
+ string backup_id = 3;
946
+
947
+ // Cloud instance ID (not path) containing the database, e.g.
948
+ // "database-instance".
949
+ string database_instance_id = 4;
950
+
951
+ // The id of the database to create and restore to, e.g. "db0". Note that this
952
+ // database must not already exist.
953
+ string database_id = 5;
954
+
955
+ // The KMS key(s) used to encrypt the restored database to be created if the
956
+ // restored database should be CMEK protected.
957
+ google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7;
958
+ }
959
+
960
+ // Action that gets a Cloud Spanner database.
961
+ message GetCloudDatabaseAction {
962
+ // Cloud project ID, e.g. "spanner-cloud-systest".
963
+ string project_id = 1;
964
+
965
+ // Cloud instance ID (not path), e.g. "test-instance".
966
+ string instance_id = 2;
967
+
968
+ // The id of the database to get, e.g. "db0".
969
+ string database_id = 3;
970
+ }
971
+
972
+ // Action that creates a Cloud Spanner database backup.
973
+ message CreateCloudBackupAction {
974
+ // Cloud project ID, e.g. "spanner-cloud-systest".
975
+ string project_id = 1;
976
+
977
+ // Cloud instance ID (not path), e.g. "test-instance".
978
+ string instance_id = 2;
979
+
980
+ // The id of the backup to be created, e.g. "test-backup".
981
+ string backup_id = 3;
982
+
983
+ // The id of the database from which this backup was
984
+ // created, e.g. "db0". Note that this needs to be in the
985
+ // same instance as the backup.
986
+ string database_id = 4;
987
+
988
+ // Output only. The expiration time of the backup, which must be at least 6
989
+ // hours and at most 366 days from the time the request is received.
990
+ google.protobuf.Timestamp expire_time = 5
991
+ [(google.api.field_behavior) = OUTPUT_ONLY];
992
+
993
+ // The version time of the backup, which must be within the time range of
994
+ // [earliest_version_time, NOW], where earliest_version_time is retrieved by
995
+ // cloud spanner frontend API (See details: go/cs-pitr-lite-design).
996
+ optional google.protobuf.Timestamp version_time = 6;
997
+
998
+ // The KMS key(s) used to encrypt the backup to be created if the backup
999
+ // should be CMEK protected.
1000
+ google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7;
1001
+ }
1002
+
1003
+ // Action that copies a Cloud Spanner database backup.
1004
+ message CopyCloudBackupAction {
1005
+ // Cloud project ID, e.g. "spanner-cloud-systest".
1006
+ string project_id = 1;
1007
+
1008
+ // Cloud instance ID (not path), e.g. "test-instance".
1009
+ string instance_id = 2;
1010
+
1011
+ // The id of the backup to be created, e.g. "test-backup".
1012
+ string backup_id = 3;
1013
+
1014
+ // The fully qualified uri of the source backup from which this
1015
+ // backup was copied. eg.
1016
+ // "projects/<project_id>/instances/<instance_id>/backups/<backup_id>".
1017
+ string source_backup = 4;
1018
+
1019
+ // Output only. The expiration time of the backup, which must be at least 6
1020
+ // hours and at most 366 days from the time the request is received.
1021
+ google.protobuf.Timestamp expire_time = 5
1022
+ [(google.api.field_behavior) = OUTPUT_ONLY];
1023
+ }
1024
+
1025
+ // Action that gets a Cloud Spanner database backup.
1026
+ message GetCloudBackupAction {
1027
+ // Cloud project ID, e.g. "spanner-cloud-systest".
1028
+ string project_id = 1;
1029
+
1030
+ // Cloud instance ID (not path), e.g. "test-instance".
1031
+ string instance_id = 2;
1032
+
1033
+ // The id of the backup to get, e.g. "test-backup".
1034
+ string backup_id = 3;
1035
+ }
1036
+
1037
+ // Action that updates a Cloud Spanner database backup.
1038
+ message UpdateCloudBackupAction {
1039
+ // Cloud project ID, e.g. "spanner-cloud-systest".
1040
+ string project_id = 1;
1041
+
1042
+ // Cloud instance ID (not path), e.g. "test-instance".
1043
+ string instance_id = 2;
1044
+
1045
+ // The id of the backup to update, e.g. "test-backup".
1046
+ string backup_id = 3;
1047
+
1048
+ // Output only. Updated value of expire_time, this is the only field
1049
+ // that supported to be updated.
1050
+ google.protobuf.Timestamp expire_time = 4
1051
+ [(google.api.field_behavior) = OUTPUT_ONLY];
1052
+ }
1053
+
1054
+ // Action that deletes a Cloud Spanner database backup.
1055
+ message DeleteCloudBackupAction {
1056
+ // Cloud project ID, e.g. "spanner-cloud-systest".
1057
+ string project_id = 1;
1058
+
1059
+ // Cloud instance ID (not path), e.g. "test-instance".
1060
+ string instance_id = 2;
1061
+
1062
+ // The id of the backup to delete, e.g. "test-backup".
1063
+ string backup_id = 3;
1064
+ }
1065
+
1066
+ // Action that lists Cloud Spanner database backups.
1067
+ message ListCloudBackupsAction {
1068
+ // Cloud project ID, e.g. "spanner-cloud-systest".
1069
+ string project_id = 1;
1070
+
1071
+ // Cloud instance ID (not path) to list backups from, e.g. "test-instance".
1072
+ string instance_id = 2;
1073
+
1074
+ // A filter expression that filters backups listed in the response.
1075
+ // The expression must specify the field name, a comparison operator,
1076
+ // and the value that you want to use for filtering.
1077
+ // Refer backup.proto.ListBackupsRequest for detail.
1078
+ string filter = 3;
1079
+
1080
+ // Number of backups to be returned in the response. If 0 or
1081
+ // less, defaults to the server's maximum allowed page size.
1082
+ int32 page_size = 4;
1083
+
1084
+ // If non-empty, "page_token" should contain a next_page_token
1085
+ // from a previous ListBackupsResponse to the same "parent"
1086
+ // and with the same "filter".
1087
+ string page_token = 5;
1088
+ }
1089
+
1090
+ // Action that lists Cloud Spanner database backup operations.
1091
+ message ListCloudBackupOperationsAction {
1092
+ // Cloud project ID, e.g. "spanner-cloud-systest".
1093
+ string project_id = 1;
1094
+
1095
+ // Cloud instance ID (not path) to list backup operations from,
1096
+ // e.g. "test-instance".
1097
+ string instance_id = 2;
1098
+
1099
+ // A filter expression that filters what operations are returned in the
1100
+ // response.
1101
+ // The expression must specify the field name, a comparison operator,
1102
+ // and the value that you want to use for filtering.
1103
+ // Refer backup.proto.ListBackupOperationsRequest for detail.
1104
+ string filter = 3;
1105
+
1106
+ // Number of backups to be returned in the response. If 0 or
1107
+ // less, defaults to the server's maximum allowed page size.
1108
+ int32 page_size = 4;
1109
+
1110
+ // If non-empty, "page_token" should contain a next_page_token
1111
+ // from a previous ListBackupOperationsResponse to the same "parent"
1112
+ // and with the same "filter".
1113
+ string page_token = 5;
1114
+ }
1115
+
1116
+ // Action that gets an operation.
1117
+ message GetOperationAction {
1118
+ // The name of the operation resource.
1119
+ string operation = 1;
1120
+ }
1121
+
1122
+ // Query cancellation action defines the long running query and the cancel query
1123
+ // format depening on the Cloud database dialect.
1124
+ message QueryCancellationAction {
1125
+ // Long running query.
1126
+ string long_running_sql = 1;
1127
+
1128
+ // Format of the cancel query for the cloud database dialect.
1129
+ string cancel_query = 2;
1130
+ }
1131
+
1132
+ // Action that cancels an operation.
1133
+ message CancelOperationAction {
1134
+ // The name of the operation resource to be cancelled.
1135
+ string operation = 1;
1136
+ }
1137
+
1138
+ // Action that adds a split point to a Cloud Spanner database.
1139
+ message AddSplitPointsAction {
1140
+ // Cloud project ID, e.g. "spanner-cloud-systest".
1141
+ string project_id = 1;
1142
+
1143
+ // Cloud instance ID (not path), e.g. "test-instance".
1144
+ string instance_id = 2;
1145
+
1146
+ // Cloud database ID (not full path), e.g. "db0".
1147
+ string database_id = 3;
1148
+
1149
+ // The split points to add.
1150
+ repeated google.spanner.admin.database.v1.SplitPoints split_points = 4;
1151
+ }
1152
+
1153
+ // Starts a batch read-only transaction in executor. Successful outcomes of this
1154
+ // action will contain batch_txn_id--the identificator that can be used to start
1155
+ // the same transaction in other Executors to parallelize partition processing.
1156
+ //
1157
+ // Example of a batch read flow:
1158
+ // 1. Start batch transaction with a timestamp (StartBatchTransactionAction)
1159
+ // 2. Generate database partitions for a read or query
1160
+ // (GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction)
1161
+ // 3. Call ExecutePartitionAction for some or all partitions, process rows
1162
+ // 4. Clean up the transaction (CloseBatchTransactionAction).
1163
+ //
1164
+ // More sophisticated example, with parallel processing:
1165
+ // 1. Start batch transaction with a timestamp (StartBatchTransactionAction),
1166
+ // note the returned BatchTransactionId
1167
+ // 2. Generate database partitions for a read or query
1168
+ // (GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction)
1169
+ // 3. Distribute the partitions over a pool of workers, along with the
1170
+ // transaction ID.
1171
+ //
1172
+ // In each worker:
1173
+ // 4-1. StartBatchTransactionAction with the given transaction ID
1174
+ // 4-2. ExecutePartitionAction for each partition it got, process read results
1175
+ // 4-3. Close (not cleanup) the transaction (CloseBatchTransactionAction).
1176
+ //
1177
+ // When all workers are done:
1178
+ // 5. Cleanup the transaction (CloseBatchTransactionAction). This can be done
1179
+ // either by the last worker to finish the job, or by the main Executor that
1180
+ // initialized this transaction in the first place. It is also possible to clean
1181
+ // it up with a brand new Executor -- just execute StartBatchTransactionAction
1182
+ // with the ID, then clean it up right away.
1183
+ //
1184
+ // Cleaning up is optional, but recommended.
1185
+ message StartBatchTransactionAction {
1186
+ // To start a new transaction, specify an exact timestamp. Alternatively, an
1187
+ // existing batch transaction ID can be used. Either one of two must be
1188
+ // set.
1189
+ oneof param {
1190
+ // The exact timestamp to start the batch transaction.
1191
+ google.protobuf.Timestamp batch_txn_time = 1;
1192
+
1193
+ // ID of a batch read-only transaction. It can be used to start the same
1194
+ // batch transaction on multiple executors and parallelize partition
1195
+ // processing.
1196
+ bytes tid = 2;
1197
+ }
1198
+
1199
+ // Database role to assume while performing this action. Setting the
1200
+ // database_role will enforce additional role-based access checks on this
1201
+ // action.
1202
+ string cloud_database_role = 3;
1203
+ }
1204
+
1205
+ // Closes or cleans up the currently opened batch read-only transaction.
1206
+ //
1207
+ // Once a transaction is closed, the Executor can be disposed of or used to
1208
+ // start start another transaction. Closing a batch transaction in one Executor
1209
+ // doesn't affect the transaction's state in other Executors that also read from
1210
+ // it.
1211
+ //
1212
+ // When a transaction is cleaned up, it becomes globally invalid. Cleaning up is
1213
+ // optional, but recommended.
1214
+ message CloseBatchTransactionAction {
1215
+ // Indicates whether the transaction needs to be cleaned up.
1216
+ bool cleanup = 1;
1217
+ }
1218
+
1219
+ // Generate database partitions for the given read. Successful outcomes will
1220
+ // contain database partitions in the db_partition field.
1221
+ message GenerateDbPartitionsForReadAction {
1222
+ // Read to generate partitions for.
1223
+ ReadAction read = 1;
1224
+
1225
+ // Metadata related to the tables involved in the read.
1226
+ repeated TableMetadata table = 2;
1227
+
1228
+ // Desired size of data in each partition. Spanner doesn't guarantee to
1229
+ // respect this value.
1230
+ optional int64 desired_bytes_per_partition = 3;
1231
+
1232
+ // If set, the desired max number of partitions. Spanner doesn't guarantee to
1233
+ // respect this value.
1234
+ optional int64 max_partition_count = 4;
1235
+ }
1236
+
1237
+ // Generate database partitions for the given query. Successful outcomes will
1238
+ // contain database partitions in the db_partition field.
1239
+ message GenerateDbPartitionsForQueryAction {
1240
+ // Query to generate partitions for.
1241
+ QueryAction query = 1;
1242
+
1243
+ // Desired size of data in each partition. Spanner doesn't guarantee to
1244
+ // respect this value.
1245
+ optional int64 desired_bytes_per_partition = 2;
1246
+ }
1247
+
1248
+ // Identifies a database partition generated for a particular read or query. To
1249
+ // read rows from the partition, use ExecutePartitionAction.
1250
+ message BatchPartition {
1251
+ // Serialized Partition instance.
1252
+ bytes partition = 1;
1253
+
1254
+ // The partition token decrypted from partition.
1255
+ bytes partition_token = 2;
1256
+
1257
+ // Table name is set iff the partition was generated for a read (as opposed to
1258
+ // a query).
1259
+ optional string table = 3;
1260
+
1261
+ // Index name if the partition was generated for an index read.
1262
+ optional string index = 4;
1263
+ }
1264
+
1265
+ // Performs a read or query for the given partitions. This action must be
1266
+ // executed in the context of the same transaction that was used to generate
1267
+ // given partitions.
1268
+ message ExecutePartitionAction {
1269
+ // Batch partition to execute on.
1270
+ BatchPartition partition = 1;
1271
+
1272
+ // Secure context parameters.
1273
+ map<string, Value> secure_context = 2;
1274
+ }
1275
+
1276
+ // Execute a change stream TVF query.
1277
+ message ExecuteChangeStreamQuery {
1278
+ // Name for this change stream.
1279
+ string name = 1;
1280
+
1281
+ // Specifies that records with commit_timestamp greater than or equal to
1282
+ // start_time should be returned.
1283
+ google.protobuf.Timestamp start_time = 2;
1284
+
1285
+ // Specifies that records with commit_timestamp less than or equal to
1286
+ // end_time should be returned.
1287
+ optional google.protobuf.Timestamp end_time = 3;
1288
+
1289
+ // Specifies which change stream partition to query, based on the content of
1290
+ // child partitions records.
1291
+ optional string partition_token = 4;
1292
+
1293
+ // Read options for this change stream query.
1294
+ repeated string read_options = 5;
1295
+
1296
+ // Determines how frequently a heartbeat ChangeRecord will be returned in case
1297
+ // there are no transactions committed in this partition, in milliseconds.
1298
+ optional int32 heartbeat_milliseconds = 6;
1299
+
1300
+ // Deadline for this change stream query, in seconds.
1301
+ optional int64 deadline_seconds = 7;
1302
+
1303
+ // Database role to assume while performing this action. This should only be
1304
+ // set for cloud requests. Setting the database role will enforce additional
1305
+ // role-based access checks on this action.
1306
+ optional string cloud_database_role = 8;
1307
+ }
1308
+
1309
+ // SpannerActionOutcome defines a result of execution of a single SpannerAction.
1310
+ message SpannerActionOutcome {
1311
+ // If an outcome is split into multiple parts, status will be set only in the
1312
+ // last part.
1313
+ optional google.rpc.Status status = 1;
1314
+
1315
+ // Transaction timestamp. It must be set for successful committed actions.
1316
+ optional google.protobuf.Timestamp commit_time = 2;
1317
+
1318
+ // Result of a ReadAction. This field must be set for ReadActions even if
1319
+ // no rows were read.
1320
+ optional ReadResult read_result = 3;
1321
+
1322
+ // Result of a Query. This field must be set for Queries even if no rows were
1323
+ // read.
1324
+ optional QueryResult query_result = 4;
1325
+
1326
+ // This bit indicates that Spanner has restarted the current transaction. It
1327
+ // means that the client should replay all the reads and writes.
1328
+ // Setting it to true is only valid in the context of a read-write
1329
+ // transaction, as an outcome of a committing FinishTransactionAction.
1330
+ optional bool transaction_restarted = 5;
1331
+
1332
+ // In successful StartBatchTransactionAction outcomes, this contains the ID of
1333
+ // the transaction.
1334
+ optional bytes batch_txn_id = 6;
1335
+
1336
+ // Generated database partitions (result of a
1337
+ // GenetageDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction).
1338
+ repeated BatchPartition db_partition = 7;
1339
+
1340
+ // Result of admin related actions.
1341
+ optional AdminResult admin_result = 8;
1342
+
1343
+ // Stores rows modified by query in single DML or batch DML action.
1344
+ // In case of batch DML action, stores 0 as row count of errored DML query.
1345
+ repeated int64 dml_rows_modified = 9;
1346
+
1347
+ // Change stream records returned by a change stream query.
1348
+ repeated ChangeStreamRecord change_stream_records = 10;
1349
+
1350
+ // If not zero, it indicates the read timestamp to use for validating
1351
+ // the SnapshotIsolation transaction.
1352
+ optional int64 snapshot_isolation_txn_read_timestamp = 11;
1353
+ }
1354
+
1355
+ // AdminResult contains admin action results, for database/backup/operation.
1356
+ message AdminResult {
1357
+ // Results of cloud backup related actions.
1358
+ CloudBackupResponse backup_response = 1;
1359
+
1360
+ // Results of operation related actions.
1361
+ OperationResponse operation_response = 2;
1362
+
1363
+ // Results of database related actions.
1364
+ CloudDatabaseResponse database_response = 3;
1365
+
1366
+ // Results of instance related actions.
1367
+ CloudInstanceResponse instance_response = 4;
1368
+
1369
+ // Results of instance config related actions.
1370
+ CloudInstanceConfigResponse instance_config_response = 5;
1371
+ }
1372
+
1373
+ // CloudBackupResponse contains results returned by cloud backup related
1374
+ // actions.
1375
+ message CloudBackupResponse {
1376
+ // List of backups returned by ListCloudBackupsAction.
1377
+ repeated google.spanner.admin.database.v1.Backup listed_backups = 1;
1378
+
1379
+ // List of operations returned by ListCloudBackupOperationsAction.
1380
+ repeated google.longrunning.Operation listed_backup_operations = 2;
1381
+
1382
+ // "next_page_token" can be sent in a subsequent list action
1383
+ // to fetch more of the matching data.
1384
+ string next_page_token = 3;
1385
+
1386
+ // Backup returned by GetCloudBackupAction/UpdateCloudBackupAction.
1387
+ google.spanner.admin.database.v1.Backup backup = 4;
1388
+ }
1389
+
1390
+ // OperationResponse contains results returned by operation related actions.
1391
+ message OperationResponse {
1392
+ // List of operations returned by ListOperationsAction.
1393
+ repeated google.longrunning.Operation listed_operations = 1;
1394
+
1395
+ // "next_page_token" can be sent in a subsequent list action
1396
+ // to fetch more of the matching data.
1397
+ string next_page_token = 2;
1398
+
1399
+ // Operation returned by GetOperationAction.
1400
+ google.longrunning.Operation operation = 3;
1401
+ }
1402
+
1403
+ // CloudInstanceResponse contains results returned by cloud instance related
1404
+ // actions.
1405
+ message CloudInstanceResponse {
1406
+ // List of instances returned by ListCloudInstancesAction.
1407
+ repeated google.spanner.admin.instance.v1.Instance listed_instances = 1;
1408
+
1409
+ // "next_page_token" can be sent in a subsequent list action
1410
+ // to fetch more of the matching data.
1411
+ string next_page_token = 2;
1412
+
1413
+ // Instance returned by GetCloudInstanceAction
1414
+ google.spanner.admin.instance.v1.Instance instance = 3;
1415
+ }
1416
+
1417
+ // CloudInstanceConfigResponse contains results returned by cloud instance
1418
+ // config related actions.
1419
+ message CloudInstanceConfigResponse {
1420
+ // List of instance configs returned by ListCloudInstanceConfigsAction.
1421
+ repeated google.spanner.admin.instance.v1.InstanceConfig
1422
+ listed_instance_configs = 1;
1423
+
1424
+ // "next_page_token" can be sent in a subsequent list action
1425
+ // to fetch more of the matching data.
1426
+ string next_page_token = 2;
1427
+
1428
+ // Instance config returned by GetCloudInstanceConfigAction.
1429
+ google.spanner.admin.instance.v1.InstanceConfig instance_config = 3;
1430
+ }
1431
+
1432
+ // CloudDatabaseResponse contains results returned by cloud database related
1433
+ // actions.
1434
+ message CloudDatabaseResponse {
1435
+ // List of databases returned by ListCloudDatabasesAction.
1436
+ repeated google.spanner.admin.database.v1.Database listed_databases = 1;
1437
+
1438
+ // List of operations returned by ListCloudDatabaseOperationsAction.
1439
+ repeated google.longrunning.Operation listed_database_operations = 2;
1440
+
1441
+ // "next_page_token" can be sent in a subsequent list action
1442
+ // to fetch more of the matching data.
1443
+ string next_page_token = 3;
1444
+
1445
+ // Database returned by GetCloudDatabaseAction
1446
+ google.spanner.admin.database.v1.Database database = 4;
1447
+ }
1448
+
1449
+ // ReadResult contains rows read.
1450
+ message ReadResult {
1451
+ // Table name.
1452
+ string table = 1;
1453
+
1454
+ // Index name, if read from an index.
1455
+ optional string index = 2;
1456
+
1457
+ // Request index (multiread only).
1458
+ optional int32 request_index = 3;
1459
+
1460
+ // Rows read. Each row is a struct with multiple fields, one for each column
1461
+ // in read result. All rows have the same type.
1462
+ repeated ValueList row = 4;
1463
+
1464
+ // The type of rows read. It must be set if at least one row was read.
1465
+ optional google.spanner.v1.StructType row_type = 5;
1466
+ }
1467
+
1468
+ // QueryResult contains result of a Query.
1469
+ message QueryResult {
1470
+ // Rows read. Each row is a struct with multiple fields, one for each column
1471
+ // in read result. All rows have the same type.
1472
+ repeated ValueList row = 1;
1473
+
1474
+ // The type of rows read. It must be set if at least one row was read.
1475
+ optional google.spanner.v1.StructType row_type = 2;
1476
+ }
1477
+
1478
+ // Raw ChangeStream records.
1479
+ // Encodes one of: DataChangeRecord, HeartbeatRecord, ChildPartitionsRecord
1480
+ // returned from the ChangeStream API.
1481
+ message ChangeStreamRecord {
1482
+ // Record represents one type of the change stream record.
1483
+ oneof record {
1484
+ // Data change record.
1485
+ DataChangeRecord data_change = 1;
1486
+
1487
+ // Child partitions record.
1488
+ ChildPartitionsRecord child_partition = 2;
1489
+
1490
+ // Heartbeat record.
1491
+ HeartbeatRecord heartbeat = 3;
1492
+ }
1493
+ }
1494
+
1495
+ // ChangeStream data change record.
1496
+ message DataChangeRecord {
1497
+ // Column types.
1498
+ message ColumnType {
1499
+ // Column name.
1500
+ string name = 1;
1501
+
1502
+ // Column type in JSON.
1503
+ string type = 2;
1504
+
1505
+ // Whether the column is a primary key column.
1506
+ bool is_primary_key = 3;
1507
+
1508
+ // The position of the column as defined in the schema.
1509
+ int64 ordinal_position = 4;
1510
+ }
1511
+
1512
+ // Describes the changes that were made.
1513
+ message Mod {
1514
+ // The primary key values in JSON.
1515
+ string keys = 1;
1516
+
1517
+ // The new values of the changed columns in JSON. Only contain the non-key
1518
+ // columns.
1519
+ string new_values = 2;
1520
+
1521
+ // The old values of the changed columns in JSON. Only contain the non-key
1522
+ // columns.
1523
+ string old_values = 3;
1524
+ }
1525
+
1526
+ // The timestamp in which the change was committed.
1527
+ google.protobuf.Timestamp commit_time = 1;
1528
+
1529
+ // The sequence number for the record within the transaction.
1530
+ string record_sequence = 2;
1531
+
1532
+ // A globally unique string that represents the transaction in which the
1533
+ // change was committed.
1534
+ string transaction_id = 3;
1535
+
1536
+ // Indicates whether this is the last record for a transaction in the current
1537
+ // partition.
1538
+ bool is_last_record = 4;
1539
+
1540
+ // Name of the table affected by the change.
1541
+ string table = 5;
1542
+
1543
+ // Column types defined in the schema.
1544
+ repeated ColumnType column_types = 6;
1545
+
1546
+ // Changes made in the transaction.
1547
+ repeated Mod mods = 7;
1548
+
1549
+ // Describes the type of change. One of INSERT, UPDATE or DELETE.
1550
+ string mod_type = 8;
1551
+
1552
+ // One of value capture type: NEW_VALUES, OLD_VALUES, OLD_AND_NEW_VALUES.
1553
+ string value_capture_type = 9;
1554
+
1555
+ // Number of records in transactions.
1556
+ int64 record_count = 10;
1557
+
1558
+ // Number of partitions in transactions.
1559
+ int64 partition_count = 11;
1560
+
1561
+ // Transaction tag info.
1562
+ string transaction_tag = 12;
1563
+
1564
+ // Whether the transaction is a system transactionn.
1565
+ bool is_system_transaction = 13;
1566
+ }
1567
+
1568
+ // ChangeStream child partition record.
1569
+ message ChildPartitionsRecord {
1570
+ // A single child partition.
1571
+ message ChildPartition {
1572
+ // Partition token string used to identify the child partition in queries.
1573
+ string token = 1;
1574
+
1575
+ // Parent partition tokens of this child partition.
1576
+ repeated string parent_partition_tokens = 2;
1577
+ }
1578
+
1579
+ // Data change records returned from child partitions in this child partitions
1580
+ // record will have a commit timestamp greater than or equal to start_time.
1581
+ google.protobuf.Timestamp start_time = 1;
1582
+
1583
+ // A monotonically increasing sequence number that can be used to define the
1584
+ // ordering of the child partitions record when there are multiple child
1585
+ // partitions records returned with the same start_time in a particular
1586
+ // partition.
1587
+ string record_sequence = 2;
1588
+
1589
+ // A set of child partitions and their associated information.
1590
+ repeated ChildPartition child_partitions = 3;
1591
+ }
1592
+
1593
+ // ChangeStream heartbeat record.
1594
+ message HeartbeatRecord {
1595
+ // Timestamp for this heartbeat check.
1596
+ google.protobuf.Timestamp heartbeat_time = 1;
1597
+ }
1598
+
1599
+ // Options for Cloud Spanner Service.
1600
+ message SpannerOptions {
1601
+ // Options for configuring the session pool
1602
+ SessionPoolOptions session_pool_options = 1;
1603
+ }
1604
+
1605
+ // Options for the session pool used by the DatabaseClient.
1606
+ message SessionPoolOptions {
1607
+ // passing this as true, will make applicable RPCs use multiplexed sessions
1608
+ // instead of regular sessions
1609
+ bool use_multiplexed = 1;
1610
+ }