Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: add latency to query result message (#6792)
Danny Xuf60f3e06aaa6
diff --git a/backend/plugin/db/clickhouse/clickhouse.go b/backend/plugin/db/clickhouse/clickhouse.goindex 8462ed9cda..f6c88c5edf 100644--- a/backend/plugin/db/clickhouse/clickhouse.go+++ b/backend/plugin/db/clickhouse/clickhouse.go@@ -17,6 +17,7 @@ import ("github.com/pkg/errors""github.com/shopspring/decimal""go.uber.org/zap"+ "google.golang.org/protobuf/types/known/durationpb""google.golang.org/protobuf/types/known/structpb""github.com/bytebase/bytebase/backend/common"@@ -170,6 +171,7 @@ func (driver *Driver) QueryConn(ctx context.Context, conn *sql.Conn, statement sfunc (*Driver) RunStatement(ctx context.Context, conn *sql.Conn, statement string) ([]*v1pb.QueryResult, error) {var results []*v1pb.QueryResultif err := util.ApplyMultiStatements(strings.NewReader(statement), func(stmt string) error {+ startTime := time.Now()rows, err := conn.QueryContext(ctx, statement)if err != nil {// TODO(d): ClickHouse will return "driver: bad connection" if we use non-SELECT statement for Query(). We need to ignore the error.@@ -178,7 +180,7 @@ func (*Driver) RunStatement(ctx context.Context, conn *sql.Conn, statement strin}defer rows.Close()- result, err := convertRowsToQueryResult(rows)+ result, err := convertRowsToQueryResult(rows, startTime)if err != nil {result = &v1pb.QueryResult{Error: err.Error(),@@ -215,6 +217,7 @@ func getStatementWithResultLimit(stmt string, limit int) string {}func (*Driver) querySingleSQL(ctx context.Context, conn *sql.Conn, statement string, queryContext *db.QueryContext) (*v1pb.QueryResult, error) {+ startTime := time.Now()statement = strings.TrimRight(statement, " \n\t;")if !strings.HasPrefix(statement, "EXPLAIN") && queryContext.Limit > 0 {@@ -238,10 +241,10 @@ func (*Driver) querySingleSQL(ctx context.Context, conn *sql.Conn, statement str}defer rows.Close()- return convertRowsToQueryResult(rows)+ return convertRowsToQueryResult(rows, startTime)}-func convertRowsToQueryResult(rows *sql.Rows) (*v1pb.QueryResult, error) {+func convertRowsToQueryResult(rows *sql.Rows, startTime time.Time) (*v1pb.QueryResult, error) {columnNames, err := rows.Columns()if err != nil {return nil, err@@ -272,6 +275,7 @@ func convertRowsToQueryResult(rows *sql.Rows) (*v1pb.QueryResult, error) {ColumnNames: columnNames,ColumnTypeNames: columnTypeNames,Rows: data,+ Latency: durationpb.New(time.Since(startTime)),}, nil}diff --git a/backend/plugin/db/mongodb/mongodb.go b/backend/plugin/db/mongodb/mongodb.goindex 0790e1b4f3..4ed1622f7f 100644--- a/backend/plugin/db/mongodb/mongodb.go+++ b/backend/plugin/db/mongodb/mongodb.go@@ -10,9 +10,11 @@ import ("os""os/exec""strings"+ "time""go.mongodb.org/mongo-driver/mongo""go.mongodb.org/mongo-driver/mongo/options"+ "google.golang.org/protobuf/types/known/durationpb""github.com/pkg/errors"@@ -215,6 +217,7 @@ func replaceCharacterWithPercentEncoding(s string) string {// QueryConn2 queries a SQL statement in a given connection.func (driver *Driver) QueryConn2(ctx context.Context, _ *sql.Conn, statement string, _ *db.QueryContext) ([]*v1pb.QueryResult, error) {+ startTime := time.Now()connectionURI := getMongoDBConnectionURI(driver.connCfg)// For MongoDB query, we execute the statement in mongosh with flag --eval for the following reasons:// 1. Query always short, so it's safe to execute in the command line.@@ -246,6 +249,7 @@ func (driver *Driver) QueryConn2(ctx context.Context, _ *sql.Conn, statement strColumnNames: field,ColumnTypeNames: types,Rows: rows,+ Latency: durationpb.New(time.Since(startTime)),}}, nil}diff --git a/backend/plugin/db/redis/redis.go b/backend/plugin/db/redis/redis.goindex b1f7e94463..7f26d1adc7 100644--- a/backend/plugin/db/redis/redis.go+++ b/backend/plugin/db/redis/redis.go@@ -16,6 +16,7 @@ import ("go.uber.org/multierr""go.uber.org/zap""golang.org/x/crypto/ssh"+ "google.golang.org/protobuf/types/known/durationpb""github.com/bytebase/bytebase/backend/common/log""github.com/bytebase/bytebase/backend/plugin/db"@@ -232,6 +233,7 @@ func (*Driver) Restore(context.Context, io.Reader) error {// QueryConn2 queries a SQL statement in a given connection.func (d *Driver) QueryConn2(ctx context.Context, _ *sql.Conn, statement string, _ *db.QueryContext) ([]*v1pb.QueryResult, error) {+ startTime := time.Now()lines := strings.Split(statement, "\n")for i := range lines {lines[i] = strings.Trim(lines[i], " \n\t\r")@@ -272,6 +274,7 @@ func (d *Driver) QueryConn2(ctx context.Context, _ *sql.Conn, statement string,ColumnNames: []string{"result"},ColumnTypeNames: []string{"TEXT"},Rows: data,+ Latency: durationpb.New(time.Since(startTime)),}}, nil}diff --git a/backend/plugin/db/spanner/spanner.go b/backend/plugin/db/spanner/spanner.goindex 7290fcd5c1..421f09cb47 100644--- a/backend/plugin/db/spanner/spanner.go+++ b/backend/plugin/db/spanner/spanner.go@@ -7,6 +7,7 @@ import ("fmt""regexp""strings"+ "time"spanner "cloud.google.com/go/spanner"spannerdb "cloud.google.com/go/spanner/admin/database/apiv1"@@ -20,6 +21,7 @@ import ("google.golang.org/api/iterator""google.golang.org/api/option"+ "google.golang.org/protobuf/types/known/durationpb")var (@@ -520,6 +522,7 @@ func (d *Driver) QueryConn2(ctx context.Context, _ *sql.Conn, statement string,}func (d *Driver) querySingleSQL(ctx context.Context, statement string) (*v1pb.QueryResult, error) {+ startTime := time.Now()iter := d.client.Single().Query(ctx, spanner.NewStatement(statement))defer iter.Stop()@@ -563,6 +566,7 @@ func (d *Driver) querySingleSQL(ctx context.Context, statement string) (*v1pb.QuColumnTypeNames: columnTypeNames,Rows: data,Masked: sensitiveInfo,+ Latency: durationpb.New(time.Since(startTime)),}, nil}@@ -588,6 +592,7 @@ func (d *Driver) RunStatement(ctx context.Context, _ *sql.Conn, statement stringvar results []*v1pb.QueryResultfor _, statement := range stmts {+ startTime := time.Now()if isSelect(statement) {result, err := d.querySingleSQL(ctx, statement)if err != nil {@@ -651,6 +656,7 @@ func (d *Driver) RunStatement(ctx context.Context, _ *sql.Conn, statement stringColumnNames: field,ColumnTypeNames: types,Rows: rows,+ Latency: durationpb.New(time.Since(startTime)),})}diff --git a/backend/plugin/db/util/driverutil.go b/backend/plugin/db/util/driverutil.goindex f9e0481399..a6d85b1a9d 100644--- a/backend/plugin/db/util/driverutil.go+++ b/backend/plugin/db/util/driverutil.go@@ -21,6 +21,7 @@ import ("github.com/pkg/errors""github.com/shopspring/decimal""go.uber.org/zap"+ "google.golang.org/protobuf/types/known/durationpb""google.golang.org/protobuf/types/known/structpb""github.com/bytebase/bytebase/backend/common"@@ -217,6 +218,7 @@ func Query(ctx context.Context, dbType db.Type, conn *sql.Conn, statement string// Query2 will execute a readonly / SELECT query.// TODO(rebelice): remove Query function and rename Query2 to Query after frontend is ready to use the new API.func Query2(ctx context.Context, dbType db.Type, conn *sql.Conn, statement string, queryContext *db.QueryContext) (*v1pb.QueryResult, error) {+ startTime := time.Now()tx, err := conn.BeginTx(ctx, &sql.TxOptions{ReadOnly: queryContext.ReadOnly})if err != nil {return nil, err@@ -281,6 +283,7 @@ func Query2(ctx context.Context, dbType db.Type, conn *sql.Conn, statement strinColumnTypeNames: columnTypeNames,Rows: data,Masked: fieldMaskInfo,+ Latency: durationpb.New(time.Since(startTime)),}, nil}@@ -296,6 +299,7 @@ func RunStatement(ctx context.Context, engineType parser.EngineType, conn *sql.Cvar results []*v1pb.QueryResultfor _, singleSQL := range singleSQLs {+ startTime := time.Now()if singleSQL.Empty {continue}@@ -326,6 +330,7 @@ func RunStatement(ctx context.Context, engineType parser.EngineType, conn *sql.CColumnNames: field,ColumnTypeNames: types,Rows: rows,+ Latency: durationpb.New(time.Since(startTime)),})continue}@@ -336,6 +341,7 @@ func RunStatement(ctx context.Context, engineType parser.EngineType, conn *sql.C}func adminQuery(ctx context.Context, conn *sql.Conn, statement string) *v1pb.QueryResult {+ startTime := time.Now()rows, err := conn.QueryContext(ctx, statement)if err != nil {return &v1pb.QueryResult{@@ -344,7 +350,7 @@ func adminQuery(ctx context.Context, conn *sql.Conn, statement string) *v1pb.Que}defer rows.Close()- result, err := rowsToQueryResult(rows)+ result, err := rowsToQueryResult(rows, startTime)if err != nil {return &v1pb.QueryResult{Error: err.Error(),@@ -353,7 +359,7 @@ func adminQuery(ctx context.Context, conn *sql.Conn, statement string) *v1pb.Quereturn result}-func rowsToQueryResult(rows *sql.Rows) (*v1pb.QueryResult, error) {+func rowsToQueryResult(rows *sql.Rows, startTime time.Time) (*v1pb.QueryResult, error) {columnNames, err := rows.Columns()if err != nil {return nil, err@@ -384,6 +390,7 @@ func rowsToQueryResult(rows *sql.Rows) (*v1pb.QueryResult, error) {ColumnNames: columnNames,ColumnTypeNames: columnTypeNames,Rows: data,+ Latency: durationpb.New(time.Since(startTime)),}, nil}diff --git a/backend/tests/schema_update_test.go b/backend/tests/schema_update_test.goindex 6fb0ae9db2..c49f5722be 100644--- a/backend/tests/schema_update_test.go+++ b/backend/tests/schema_update_test.go@@ -20,6 +20,7 @@ import ("google.golang.org/protobuf/encoding/protojson""google.golang.org/protobuf/proto""google.golang.org/protobuf/testing/protocmp"+ "google.golang.org/protobuf/types/known/durationpb""google.golang.org/protobuf/types/known/structpb"api "github.com/bytebase/bytebase/backend/legacyapi"@@ -252,7 +253,7 @@ func TestSchemaAndDataUpdate(t *testing.T) {})a.NoError(err)a.Equal(1, len(queryResp.Results))- diff := cmp.Diff(bookDataSQLResult, queryResp.Results[0], protocmp.Transform())+ diff := cmp.Diff(bookDataSQLResult, queryResp.Results[0], protocmp.Transform(), protocmp.IgnoreMessages(&durationpb.Duration{}))a.Equal("", diff)// Query clone migration history.diff --git a/backend/tests/sensitive_data_test.go b/backend/tests/sensitive_data_test.goindex 394704d9dd..f270bf8ce1 100644--- a/backend/tests/sensitive_data_test.go+++ b/backend/tests/sensitive_data_test.go@@ -12,6 +12,7 @@ import ("github.com/google/go-cmp/cmp""github.com/stretchr/testify/require""google.golang.org/protobuf/testing/protocmp"+ "google.golang.org/protobuf/types/known/durationpb"api "github.com/bytebase/bytebase/backend/legacyapi""github.com/bytebase/bytebase/backend/plugin/db"@@ -270,7 +271,7 @@ func TestSensitiveData(t *testing.T) {})a.NoError(err)a.Equal(1, len(queryResp.Results))- diff := cmp.Diff(maskedData, queryResp.Results[0], protocmp.Transform())+ diff := cmp.Diff(maskedData, queryResp.Results[0], protocmp.Transform(), protocmp.IgnoreMessages(&durationpb.Duration{}))a.Equal("", diff)// Query origin data.@@ -279,6 +280,6 @@ func TestSensitiveData(t *testing.T) {a.Len(singleSQLResults, 1)result := singleSQLResults[0]a.Equal("", result.Error)- diff = cmp.Diff(originData, result, protocmp.Transform())+ diff = cmp.Diff(originData, result, protocmp.Transform(), protocmp.IgnoreMessages(&durationpb.Duration{}))a.Equal("", diff)}diff --git a/backend/tests/sql_editor_test.go b/backend/tests/sql_editor_test.goindex 10b98a8052..5cfe948dc1 100644--- a/backend/tests/sql_editor_test.go+++ b/backend/tests/sql_editor_test.go@@ -11,6 +11,7 @@ import ("github.com/google/go-cmp/cmp""github.com/stretchr/testify/require""google.golang.org/protobuf/testing/protocmp"+ "google.golang.org/protobuf/types/known/durationpb"api "github.com/bytebase/bytebase/backend/legacyapi""github.com/bytebase/bytebase/backend/plugin/db"@@ -228,7 +229,8 @@ func TestAdminQueryAffectedRows(t *testing.T) {a.Equal(len(tt.affectedRows), len(results))for idx, result := range results {a.Equal("", result.Error)- diff := cmp.Diff(tt.affectedRows[idx], result, protocmp.Transform())+ result.Latency = nil+ diff := cmp.Diff(tt.affectedRows[idx], result, protocmp.Transform(), protocmp.IgnoreMessages(&durationpb.Duration{}))a.Equal("", diff)}}diff --git a/backend/tests/sql_review_test.go b/backend/tests/sql_review_test.goindex 7a2179eb56..ee6ea3462d 100644--- a/backend/tests/sql_review_test.go+++ b/backend/tests/sql_review_test.go@@ -21,6 +21,7 @@ import (_ "github.com/jackc/pgx/v4/stdlib""github.com/stretchr/testify/require""google.golang.org/protobuf/testing/protocmp"+ "google.golang.org/protobuf/types/known/durationpb""google.golang.org/protobuf/types/known/fieldmaskpb""gopkg.in/yaml.v3"@@ -416,7 +417,7 @@ func TestSQLReviewForMySQL(t *testing.T) {})a.NoError(err)a.Equal(1, len(originQueryResp.Results))- diff := cmp.Diff(wantQueryResult, originQueryResp.Results[0], protocmp.Transform())+ diff := cmp.Diff(wantQueryResult, originQueryResp.Results[0], protocmp.Transform(), protocmp.IgnoreMessages(&durationpb.Duration{}))a.Equal("", diff)createIssueAndReturnSQLReviewResult(ctx, a, ctl, databaseUID, projectUID, project.Name, dmlSQL, false /* wait */)@@ -426,7 +427,7 @@ func TestSQLReviewForMySQL(t *testing.T) {})a.NoError(err)a.Equal(1, len(finalQueryResp.Results))- diff = cmp.Diff(wantQueryResult, finalQueryResp.Results[0], protocmp.Transform())+ diff = cmp.Diff(wantQueryResult, finalQueryResp.Results[0], protocmp.Transform(), protocmp.IgnoreMessages(&durationpb.Duration{}))a.Equal("", diff)// disable the SQL review policydiff --git a/frontend/src/types/proto/v1/sql_service.ts b/frontend/src/types/proto/v1/sql_service.tsindex 9b552a988b..aa2d47cf03 100644--- a/frontend/src/types/proto/v1/sql_service.ts+++ b/frontend/src/types/proto/v1/sql_service.ts@@ -2,6 +2,7 @@import * as Long from "long";import type { CallContext, CallOptions } from "nice-grpc-common";import * as _m0 from "protobufjs/minimal";+import { Duration } from "../google/protobuf/duration";import { NullValue, nullValueFromJSON, nullValueToJSON, Value } from "../google/protobuf/struct";import { Engine, engineFromJSON, engineToJSON } from "./common";@@ -133,6 +134,8 @@ export interface QueryResult {masked: boolean[];/** The error message if the query failed. */error: string;+ /** The time it takes to execute the query. */+ latency?: Duration;}export interface QueryRow {@@ -737,7 +740,7 @@ export const QueryResponse = {};function createBaseQueryResult(): QueryResult {- return { columnNames: [], columnTypeNames: [], rows: [], masked: [], error: "" };+ return { columnNames: [], columnTypeNames: [], rows: [], masked: [], error: "", latency: undefined };}export const QueryResult = {@@ -759,6 +762,9 @@ export const QueryResult = {if (message.error !== "") {writer.uint32(42).string(message.error);}+ if (message.latency !== undefined) {+ Duration.encode(message.latency, writer.uint32(50).fork()).ldelim();+ }return writer;},@@ -814,6 +820,13 @@ export const QueryResult = {message.error = reader.string();continue;+ case 6:+ if (tag !== 50) {+ break;+ }++ message.latency = Duration.decode(reader, reader.uint32());+ continue;}if ((tag & 7) === 4 || tag === 0) {break;@@ -830,6 +843,7 @@ export const QueryResult = {rows: Array.isArray(object?.rows) ? object.rows.map((e: any) => QueryRow.fromJSON(e)) : [],masked: Array.isArray(object?.masked) ? object.masked.map((e: any) => Boolean(e)) : [],error: isSet(object.error) ? String(object.error) : "",+ latency: isSet(object.latency) ? Duration.fromJSON(object.latency) : undefined,};},@@ -856,6 +870,7 @@ export const QueryResult = {obj.masked = [];}message.error !== undefined && (obj.error = message.error);+ message.latency !== undefined && (obj.latency = message.latency ? Duration.toJSON(message.latency) : undefined);return obj;},@@ -870,6 +885,9 @@ export const QueryResult = {message.rows = object.rows?.map((e) => QueryRow.fromPartial(e)) || [];message.masked = object.masked?.map((e) => e) || [];message.error = object.error ?? "";+ message.latency = (object.latency !== undefined && object.latency !== null)+ ? Duration.fromPartial(object.latency)+ : undefined;return message;},};diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex a94a4a72b7..a5bec92078 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -8099,6 +8099,7 @@ The sheet's `name` field is used to identify the sheet to update. Format: pr| rows | [QueryRow](#bytebase-v1-QueryRow) | repeated | Rows of the query result. || masked | [bool](#bool) | repeated | Columns are masked or not. || error | [string](#string) | | The error message if the query failed. |+| latency | [google.protobuf.Duration](#google-protobuf-Duration) | | The time it takes to execute the query. |diff --git a/proto/generated-go/v1/sql_service.pb.go b/proto/generated-go/v1/sql_service.pb.goindex 50c1ccf30b..9550a370c9 100644--- a/proto/generated-go/v1/sql_service.pb.go+++ b/proto/generated-go/v1/sql_service.pb.go@@ -10,6 +10,7 @@ import (_ "google.golang.org/genproto/googleapis/api/annotations"protoreflect "google.golang.org/protobuf/reflect/protoreflect"protoimpl "google.golang.org/protobuf/runtime/protoimpl"+ durationpb "google.golang.org/protobuf/types/known/durationpb"structpb "google.golang.org/protobuf/types/known/structpb"reflect "reflect"sync "sync"@@ -536,6 +537,8 @@ type QueryResult struct {Masked []bool `protobuf:"varint,4,rep,packed,name=masked,proto3" json:"masked,omitempty"`// The error message if the query failed.Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`+ // The time it takes to execute the query.+ Latency *durationpb.Duration `protobuf:"bytes,6,opt,name=latency,proto3" json:"latency,omitempty"`}func (x *QueryResult) Reset() {@@ -605,6 +608,13 @@ func (x *QueryResult) GetError() string {return ""}+func (x *QueryResult) GetLatency() *durationpb.Duration {+ if x != nil {+ return x.Latency+ }+ return nil+}+type QueryRow struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -1086,6 +1096,8 @@ var file_v1_sql_service_proto_rawDesc = []byte{0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69,0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f,+ 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,+ 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f,0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,0x1a, 0x0f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,@@ -1137,7 +1149,7 @@ var file_v1_sql_service_proto_rawDesc = []byte{0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x2d,0x0a, 0x07, 0x61, 0x64, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64,- 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x61, 0x64, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0xb5, 0x01,+ 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x61, 0x64, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0xea, 0x01,0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a,0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20,0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73,@@ -1149,99 +1161,102 @@ var file_v1_sql_service_proto_rawDesc = []byte{0x77, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x73, 0x6b, 0x65,0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x08, 0x52, 0x06, 0x6d, 0x61, 0x73, 0x6b, 0x65, 0x64, 0x12,0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,- 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x39, 0x0a, 0x08, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x6f,- 0x77, 0x12, 0x2d, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,- 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,- 0x52, 0x6f, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73,- 0x22, 0xcb, 0x03, 0x0a, 0x08, 0x52, 0x6f, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a,- 0x0a, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,- 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,- 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52,- 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f,- 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00,- 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x62,- 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c,- 0x48, 0x00, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23,- 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04,- 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61,- 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, 0x6c,- 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61,- 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f,- 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x0a, 0x69,- 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74,- 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00,- 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c,- 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01,- 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75,- 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75,- 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33,- 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34,- 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b,- 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x76,- 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b,- 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,- 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75,- 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0xf3,- 0x01, 0x0a, 0x06, 0x41, 0x64, 0x76, 0x69, 0x63, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, 0x61,- 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53,- 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a,- 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64,- 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,- 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,- 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52,- 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18,- 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x45, 0x0a,- 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55,- 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,- 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07,- 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52,- 0x4f, 0x52, 0x10, 0x03, 0x22, 0x8c, 0x01, 0x0a, 0x0d, 0x50, 0x72, 0x65, 0x74, 0x74, 0x79, 0x52,- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65,- 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x52, 0x06, 0x65, 0x6e, 0x67,- 0x69, 0x6e, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73,- 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, 0x72,- 0x72, 0x65, 0x6e, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78,- 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20,- 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x53, 0x63, 0x68,- 0x65, 0x6d, 0x61, 0x22, 0x60, 0x0a, 0x0e, 0x50, 0x72, 0x65, 0x74, 0x74, 0x79, 0x52, 0x65, 0x73,- 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74,- 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63,- 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x27, 0x0a, 0x0f,- 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18,- 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x53,- 0x63, 0x68, 0x65, 0x6d, 0x61, 0x32, 0xb6, 0x03, 0x0a, 0x0a, 0x53, 0x51, 0x4c, 0x53, 0x65, 0x72,- 0x76, 0x69, 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x06, 0x50, 0x72, 0x65, 0x74, 0x74, 0x79, 0x12, 0x1a,- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65,- 0x74, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x62, 0x79, 0x74,- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x74, 0x74, 0x79, 0x52,- 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a,- 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x71, 0x6c, 0x2f, 0x70, 0x72, 0x65, 0x74,- 0x74, 0x79, 0x12, 0x67, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x19, 0x2e, 0x62, 0x79,+ 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79,+ 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,+ 0x6e, 0x52, 0x07, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x22, 0x39, 0x0a, 0x08, 0x51, 0x75,+ 0x65, 0x72, 0x79, 0x52, 0x6f, 0x77, 0x12, 0x2d, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73,+ 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76,+ 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xcb, 0x03, 0x0a, 0x08, 0x52, 0x6f, 0x77, 0x56, 0x61, 0x6c,+ 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65,+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c,+ 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12,+ 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,+ 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65,+ 0x12, 0x21, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,+ 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61,+ 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61,+ 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75,+ 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61,+ 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x48, 0x00, 0x52,+ 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69,+ 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05,+ 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21,+ 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20,+ 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75,+ 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75,+ 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e,+ 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32,+ 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0b,+ 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75,+ 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28,+ 0x04, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65,+ 0x12, 0x39, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,+ 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,+ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52,+ 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6b,+ 0x69, 0x6e, 0x64, 0x22, 0xf3, 0x01, 0x0a, 0x06, 0x41, 0x64, 0x76, 0x69, 0x63, 0x65, 0x12, 0x32,+ 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a,+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x76,+ 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74,+ 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,+ 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,+ 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07,+ 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63,+ 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x05,+ 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65,+ 0x74, 0x61, 0x69, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61,+ 0x69, 0x6c, 0x22, 0x45, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12,+ 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,+ 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10,+ 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x09,+ 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x22, 0x8c, 0x01, 0x0a, 0x0d, 0x50, 0x72,+ 0x65, 0x74, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x65,+ 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x62, 0x79,+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65,+ 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75, 0x72, 0x72,+ 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,+ 0x52, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12,+ 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x63, 0x68, 0x65,+ 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74,+ 0x65, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x60, 0x0a, 0x0e, 0x50, 0x72, 0x65, 0x74,+ 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75,+ 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d,+ 0x61, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x63,+ 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x65,+ 0x63, 0x74, 0x65, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x32, 0xb6, 0x03, 0x0a, 0x0a, 0x53,+ 0x51, 0x4c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x06, 0x50, 0x72, 0x65,+ 0x74, 0x74, 0x79, 0x12, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,+ 0x31, 0x2e, 0x50, 0x72, 0x65, 0x74, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,+ 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72,+ 0x65, 0x74, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3,+ 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x71, 0x6c,+ 0x2f, 0x70, 0x72, 0x65, 0x74, 0x74, 0x79, 0x12, 0x67, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79,+ 0x12, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51,+ 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x62, 0x79,0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52,- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,- 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f,- 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,- 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x6b, 0x0a, 0x06, 0x45,- 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,- 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,- 0x74, 0x1a, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,- 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28,- 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x7b,- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a,- 0x7d, 0x3a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x74, 0x0a, 0x0c, 0x41, 0x64, 0x6d, 0x69,- 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63,- 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74,- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78,- 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82,- 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x3a, 0x61, 0x64,- 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x11,- 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76,- 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a,+ 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e,+ 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x71, 0x75, 0x65, 0x72, 0x79,+ 0x12, 0x6b, 0x0a, 0x06, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x2e, 0x62, 0x79, 0x74,+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52,+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,+ 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d,+ 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,+ 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x74, 0x0a,+ 0x0c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x20, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x6d, 0x69,+ 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,+ 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64,+ 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,+ 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f,+ 0x76, 0x31, 0x3a, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x28,+ 0x01, 0x30, 0x01, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64,+ 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,}var (@@ -1273,9 +1288,10 @@ var file_v1_sql_service_proto_goTypes = []interface{}{(*Advice)(nil), // 11: bytebase.v1.Advice(*PrettyRequest)(nil), // 12: bytebase.v1.PrettyRequest(*PrettyResponse)(nil), // 13: bytebase.v1.PrettyResponse- (structpb.NullValue)(0), // 14: google.protobuf.NullValue- (*structpb.Value)(nil), // 15: google.protobuf.Value- (Engine)(0), // 16: bytebase.v1.Engine+ (*durationpb.Duration)(nil), // 14: google.protobuf.Duration+ (structpb.NullValue)(0), // 15: google.protobuf.NullValue+ (*structpb.Value)(nil), // 16: google.protobuf.Value+ (Engine)(0), // 17: bytebase.v1.Engine}var file_v1_sql_service_proto_depIdxs = []int32{8, // 0: bytebase.v1.AdminExecuteResponse.results:type_name -> bytebase.v1.QueryResult@@ -1283,24 +1299,25 @@ var file_v1_sql_service_proto_depIdxs = []int32{8, // 2: bytebase.v1.QueryResponse.results:type_name -> bytebase.v1.QueryResult11, // 3: bytebase.v1.QueryResponse.advices:type_name -> bytebase.v1.Advice9, // 4: bytebase.v1.QueryResult.rows:type_name -> bytebase.v1.QueryRow- 10, // 5: bytebase.v1.QueryRow.values:type_name -> bytebase.v1.RowValue- 14, // 6: bytebase.v1.RowValue.null_value:type_name -> google.protobuf.NullValue- 15, // 7: bytebase.v1.RowValue.value_value:type_name -> google.protobuf.Value- 1, // 8: bytebase.v1.Advice.status:type_name -> bytebase.v1.Advice.Status- 16, // 9: bytebase.v1.PrettyRequest.engine:type_name -> bytebase.v1.Engine- 12, // 10: bytebase.v1.SQLService.Pretty:input_type -> bytebase.v1.PrettyRequest- 6, // 11: bytebase.v1.SQLService.Query:input_type -> bytebase.v1.QueryRequest- 4, // 12: bytebase.v1.SQLService.Export:input_type -> bytebase.v1.ExportRequest- 2, // 13: bytebase.v1.SQLService.AdminExecute:input_type -> bytebase.v1.AdminExecuteRequest- 13, // 14: bytebase.v1.SQLService.Pretty:output_type -> bytebase.v1.PrettyResponse- 7, // 15: bytebase.v1.SQLService.Query:output_type -> bytebase.v1.QueryResponse- 5, // 16: bytebase.v1.SQLService.Export:output_type -> bytebase.v1.ExportResponse- 3, // 17: bytebase.v1.SQLService.AdminExecute:output_type -> bytebase.v1.AdminExecuteResponse- 14, // [14:18] is the sub-list for method output_type- 10, // [10:14] is the sub-list for method input_type- 10, // [10:10] is the sub-list for extension type_name- 10, // [10:10] is the sub-list for extension extendee- 0, // [0:10] is the sub-list for field type_name+ 14, // 5: bytebase.v1.QueryResult.latency:type_name -> google.protobuf.Duration+ 10, // 6: bytebase.v1.QueryRow.values:type_name -> bytebase.v1.RowValue+ 15, // 7: bytebase.v1.RowValue.null_value:type_name -> google.protobuf.NullValue+ 16, // 8: bytebase.v1.RowValue.value_value:type_name -> google.protobuf.Value+ 1, // 9: bytebase.v1.Advice.status:type_name -> bytebase.v1.Advice.Status+ 17, // 10: bytebase.v1.PrettyRequest.engine:type_name -> bytebase.v1.Engine+ 12, // 11: bytebase.v1.SQLService.Pretty:input_type -> bytebase.v1.PrettyRequest+ 6, // 12: bytebase.v1.SQLService.Query:input_type -> bytebase.v1.QueryRequest+ 4, // 13: bytebase.v1.SQLService.Export:input_type -> bytebase.v1.ExportRequest+ 2, // 14: bytebase.v1.SQLService.AdminExecute:input_type -> bytebase.v1.AdminExecuteRequest+ 13, // 15: bytebase.v1.SQLService.Pretty:output_type -> bytebase.v1.PrettyResponse+ 7, // 16: bytebase.v1.SQLService.Query:output_type -> bytebase.v1.QueryResponse+ 5, // 17: bytebase.v1.SQLService.Export:output_type -> bytebase.v1.ExportResponse+ 3, // 18: bytebase.v1.SQLService.AdminExecute:output_type -> bytebase.v1.AdminExecuteResponse+ 15, // [15:19] is the sub-list for method output_type+ 11, // [11:15] is the sub-list for method input_type+ 11, // [11:11] is the sub-list for extension type_name+ 11, // [11:11] is the sub-list for extension extendee+ 0, // [0:11] is the sub-list for field type_name}func init() { file_v1_sql_service_proto_init() }diff --git a/proto/v1/sql_service.proto b/proto/v1/sql_service.protoindex fc656a23b8..ff56ae797d 100644--- a/proto/v1/sql_service.proto+++ b/proto/v1/sql_service.proto@@ -4,6 +4,7 @@ package bytebase.v1;import "google/api/annotations.proto";import "google/api/field_behavior.proto";+import "google/protobuf/duration.proto";import "google/protobuf/struct.proto";import "v1/common.proto";@@ -129,6 +130,9 @@ message QueryResult {// The error message if the query failed.string error = 5;++ // The time it takes to execute the query.+ google.protobuf.Duration latency = 6;}message QueryRow {