Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(spanner): add DdlStatementActionInfo and add actions to UpdateDatabaseDdlMetadata #1860

Merged
merged 3 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,27 @@ message UpdateDatabaseDdlRequest {
string operation_id = 3;
}

// Action information extracted from a DDL statement. This proto is used to
// display the brief info of the DDL statement for the operation
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl].
message DdlStatementActionInfo {
// The action for the DDL statement, e.g. CREATE, ALTER, DROP, GRANT, etc.
// This field is a non-empty string.
string action = 1;

// The entity type for the DDL statement, e.g. TABLE, INDEX, VIEW, etc.
// This field can be empty string for some DDL statement,
// e.g. for statement "ANALYZE", `entity_type` = "".
string entity_type = 2;

// The entity name(s) being operated on the DDL statement.
// E.g.
// 1. For statement "CREATE TABLE t1(...)", `entity_names` = ["t1"].
// 2. For statement "GRANT ROLE r1, r2 ...", `entity_names` = ["r1", "r2"].
// 3. For statement "ANALYZE", `entity_names` = [].
repeated string entity_names = 3;
}

// Metadata type for the operation returned by
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl].
message UpdateDatabaseDdlMetadata {
Expand All @@ -693,20 +714,23 @@ message UpdateDatabaseDdlMetadata {
// timestamp for the statement `statements[i]`.
repeated google.protobuf.Timestamp commit_timestamps = 3;

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

// The progress of the
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] operations.
// Currently, only index creation statements will have a continuously
// updating progress.
// For non-index creation statements, `progress[i]` will have start time
// and end time populated with commit timestamp of operation,
// as well as a progress of 100% once the operation has completed.
// `progress[i]` is the operation progress for `statements[i]`.
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]
// operations. All DDL statements will have continuously updating progress,
// and `progress[i]` is the operation progress for `statements[i]`. Also,
// `progress[i]` will have start time and end time populated with commit
// timestamp of operation, as well as a progress of 100% once the operation
// has completed.
repeated OperationProgress progress = 5;

// The brief action info for the DDL statements.
// `actions[i]` is the brief info for `statements[i]`.
repeated DdlStatementActionInfo actions = 6;
}

// The request for [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase].
Expand Down
115 changes: 115 additions & 0 deletions protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading