MCPcopy Index your code
hub / github.com/bytebase/bytebase / adminQuery

Method adminQuery

backend/tests/sql.go:13–29  ·  view source on GitHub ↗
(ctx context.Context, database *v1pb.Database, query string)

Source from the content-addressed store, hash-verified

11)
12
13func (ctl *controller) adminQuery(ctx context.Context, database *v1pb.Database, query string) ([]*v1pb.QueryResult, error) {
14 stream := ctl.sqlServiceClient.AdminExecute(ctx)
15 if err := stream.Send(&v1pb.AdminExecuteRequest{
16 Name: database.Name,
17 Statement: query,
18 }); err != nil {
19 return nil, err
20 }
21 resp, err := stream.Receive()
22 if err != nil {
23 return nil, err
24 }
25 if err := stream.CloseRequest(); err != nil {
26 return nil, err
27 }
28 return resp.Results, nil
29}
30
31// GetSQLReviewResult will wait for next task SQL review task check to finish and return the task check result.
32func (ctl *controller) GetSQLReviewResult(ctx context.Context, plan *v1pb.Plan) (*v1pb.PlanCheckRun, error) {

Callers 4

TestSQLAdminQueryFunction · 0.95
TestSensitiveDataFunction · 0.95

Calls 3

AdminExecuteMethod · 0.65
SendMethod · 0.65
ReceiveMethod · 0.45

Tested by 4

TestSQLAdminQueryFunction · 0.76
TestSensitiveDataFunction · 0.76