MCPcopy Create free account
hub / github.com/cloudspannerecosystem/spanner-cli / executeDdlStatements

Function executeDdlStatements

statement.go:407–422  ·  view source on GitHub ↗
(ctx context.Context, session *Session, ddls []string)

Source from the content-addressed store, hash-verified

405}
406
407func executeDdlStatements(ctx context.Context, session *Session, ddls []string) (*Result, error) {
408 op, err := session.adminClient.UpdateDatabaseDdl(ctx, &adminpb.UpdateDatabaseDdlRequest{
409 Database: session.DatabasePath(),
410 Statements: ddls,
411 // There is no problem to send ProtoDescriptors with any DDL statements
412 ProtoDescriptors: session.protoDescriptor,
413 })
414 if err != nil {
415 return nil, err
416 }
417 if err := op.Wait(ctx); err != nil {
418 return nil, err
419 }
420
421 return &Result{IsMutation: true}, nil
422}
423
424type ShowDatabasesStatement struct {
425}

Callers 2

ExecuteMethod · 0.85
ExecuteMethod · 0.85

Calls 1

DatabasePathMethod · 0.80

Tested by

no test coverage detected