Skip to content

Commit 3e86f36

Browse files
feat(spanner): add DdlStatementActionInfo and add actions to UpdateDatabaseDdlMetadata (#1860)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 536483675 Source-Link: https://togithub.com/googleapis/googleapis/commit/9b1c2530092fb47ebdfdc8bf88060282a5ca71c9 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/b90140645d4e1cfa7b56f6083a43cfdd872558ba Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjkwMTQwNjQ1ZDRlMWNmYTdiNTZmNjA4M2E0M2NmZGQ4NzI1NThiYSJ9
1 parent c48945f commit 3e86f36

File tree

4 files changed

+480
-8
lines changed

4 files changed

+480
-8
lines changed

protos/google/spanner/admin/database/v1/spanner_database_admin.proto

+32-8
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,27 @@ message UpdateDatabaseDdlRequest {
676676
string operation_id = 3;
677677
}
678678

679+
// Action information extracted from a DDL statement. This proto is used to
680+
// display the brief info of the DDL statement for the operation
681+
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl].
682+
message DdlStatementActionInfo {
683+
// The action for the DDL statement, e.g. CREATE, ALTER, DROP, GRANT, etc.
684+
// This field is a non-empty string.
685+
string action = 1;
686+
687+
// The entity type for the DDL statement, e.g. TABLE, INDEX, VIEW, etc.
688+
// This field can be empty string for some DDL statement,
689+
// e.g. for statement "ANALYZE", `entity_type` = "".
690+
string entity_type = 2;
691+
692+
// The entity name(s) being operated on the DDL statement.
693+
// E.g.
694+
// 1. For statement "CREATE TABLE t1(...)", `entity_names` = ["t1"].
695+
// 2. For statement "GRANT ROLE r1, r2 ...", `entity_names` = ["r1", "r2"].
696+
// 3. For statement "ANALYZE", `entity_names` = [].
697+
repeated string entity_names = 3;
698+
}
699+
679700
// Metadata type for the operation returned by
680701
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl].
681702
message UpdateDatabaseDdlMetadata {
@@ -693,20 +714,23 @@ message UpdateDatabaseDdlMetadata {
693714
// timestamp for the statement `statements[i]`.
694715
repeated google.protobuf.Timestamp commit_timestamps = 3;
695716

696-
// Output only. When true, indicates that the operation is throttled e.g
717+
// Output only. When true, indicates that the operation is throttled e.g.
697718
// due to resource constraints. When resources become available the operation
698719
// will resume and this field will be false again.
699720
bool throttled = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
700721

701722
// The progress of the
702-
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] operations.
703-
// Currently, only index creation statements will have a continuously
704-
// updating progress.
705-
// For non-index creation statements, `progress[i]` will have start time
706-
// and end time populated with commit timestamp of operation,
707-
// as well as a progress of 100% once the operation has completed.
708-
// `progress[i]` is the operation progress for `statements[i]`.
723+
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]
724+
// operations. All DDL statements will have continuously updating progress,
725+
// and `progress[i]` is the operation progress for `statements[i]`. Also,
726+
// `progress[i]` will have start time and end time populated with commit
727+
// timestamp of operation, as well as a progress of 100% once the operation
728+
// has completed.
709729
repeated OperationProgress progress = 5;
730+
731+
// The brief action info for the DDL statements.
732+
// `actions[i]` is the brief info for `statements[i]`.
733+
repeated DdlStatementActionInfo actions = 6;
710734
}
711735

712736
// The request for [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase].

protos/protos.d.ts

+115
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)