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

Populate proto_descriptors in GetDatabaseDdl response #193

Open
silas opened this issue Nov 17, 2024 · 0 comments
Open

Populate proto_descriptors in GetDatabaseDdl response #193

silas opened this issue Nov 17, 2024 · 0 comments

Comments

@silas
Copy link

silas commented Nov 17, 2024

The proto_descriptors field isn't populated in the GetDatabaseDdl response, it'd be great to get that added.

// Returns the schema of a database as a list of formatted DDL statements.
absl::Status GetDatabaseDdl(RequestContext* ctx,
const database_api::GetDatabaseDdlRequest* request,
database_api::GetDatabaseDdlResponse* response) {
ZETASQL_ASSIGN_OR_RETURN(std::shared_ptr<Database> database,
GetDatabase(ctx, request->database()));
absl::StatusOr<std::vector<std::string>> printed_statements =
backend::PrintDDLStatements(database->backend()->GetLatestSchema());
ZETASQL_RETURN_IF_ERROR(printed_statements.status());
for (const auto& statement : *printed_statements) {
response->add_statements(statement);
}
return absl::OkStatus();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant