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