Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

refactor: remove Check() RPC and SQL review for SQL Editor (#17774)

Danny Xu6e2769499ada
diff --git a/backend/api/v1/release_service_check.go b/backend/api/v1/release_service_check.go
index bdaf1dc494..8a8d2a4419 100644
--- a/backend/api/v1/release_service_check.go
+++ b/backend/api/v1/release_service_check.go
@@ -503,7 +503,7 @@ func (s *ReleaseService) runSQLReviewCheckForFile(
}
dbMetadata := dbSchema.GetMetadata()
- useDatabaseOwner, err := getUseDatabaseOwner(ctx, s.store, instance, database, changeType)
+ useDatabaseOwner, err := getUseDatabaseOwner(ctx, s.store, instance, database)
if err != nil {
return storepb.Advice_ERROR, nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to get use database owner"))
}
diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.go
index 31542cb069..85b0c9c6b6 100644
--- a/backend/api/v1/sql_service.go
+++ b/backend/api/v1/sql_service.go
@@ -33,11 +33,9 @@ import (
v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"
"github.com/bytebase/bytebase/backend/generated-go/v1/v1connect"
"github.com/bytebase/bytebase/backend/plugin/advisor"
- "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
"github.com/bytebase/bytebase/backend/plugin/db"
parserbase "github.com/bytebase/bytebase/backend/plugin/parser/base"
"github.com/bytebase/bytebase/backend/plugin/schema"
- "github.com/bytebase/bytebase/backend/runner/plancheck"
"github.com/bytebase/bytebase/backend/runner/schemasync"
"github.com/bytebase/bytebase/backend/store"
"github.com/bytebase/bytebase/backend/store/model"
@@ -1596,47 +1594,6 @@ func (*SQLService) getUser(ctx context.Context) (*store.UserMessage, error) {
return user, nil
}
-func (s *SQLService) Check(ctx context.Context, req *connect.Request[v1pb.CheckRequest]) (*connect.Response[v1pb.CheckResponse], error) {
- request := req.Msg
- if len(request.Statement) > common.MaxSheetCheckSize {
- return nil, connect.NewError(connect.CodeFailedPrecondition, errors.Errorf("statement size exceeds maximum allowed size %dKB", common.MaxSheetCheckSize/1024))
- }
-
- database, err := getDatabaseMessage(ctx, s.store, request.Name)
- if err != nil {
- return nil, connect.NewError(connect.CodeInternal, errors.New(err.Error()))
- }
-
- instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
- ResourceID: &database.InstanceID,
- })
- if err != nil {
- return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get instance, error: %v", err))
- }
- if instance == nil {
- return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("instance %q not found", database.InstanceID))
- }
-
- checkResponse := &v1pb.CheckResponse{}
- changeType := convertChangeType(request.ChangeType)
- // Get SQL summary report for the statement and target database.
- // Including affected rows.
- summaryReport, err := plancheck.GetSQLSummaryReport(ctx, s.store, s.sheetManager, s.dbFactory, database, request.Statement)
- if err != nil {
- return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get SQL summary report, error: %v", err))
- }
- if summaryReport != nil {
- checkResponse.AffectedRows = summaryReport.AffectedRows
- }
-
- _, adviceList, err := s.SQLReviewCheck(ctx, request.Statement, changeType, instance, database)
- if err != nil {
- return nil, err
- }
- checkResponse.Advices = adviceList
- return connect.NewResponse(checkResponse), nil
-}
-
func getClassificationByProject(ctx context.Context, stores *store.Store, projectID string) *storepb.DataClassificationSetting_DataClassificationConfig {
project, err := stores.GetProjectV2(ctx, &store.FindProjectMessage{
ResourceID: &projectID,
@@ -1659,113 +1616,8 @@ func getClassificationByProject(ctx context.Context, stores *store.Store, projec
return classificationConfig
}
-// SQLReviewCheck checks the SQL statement against the SQL review policy bind to given environment.
-func (s *SQLService) SQLReviewCheck(
- ctx context.Context,
- statement string,
- changeType storepb.PlanCheckRunConfig_ChangeDatabaseType,
- instance *store.InstanceMessage,
- database *store.DatabaseMessage,
-) (storepb.Advice_Status, []*v1pb.Advice, error) {
- if !common.EngineSupportSQLReview(instance.Metadata.GetEngine()) || database == nil {
- return storepb.Advice_SUCCESS, nil, nil
- }
-
- dbSchema, err := s.store.GetDBSchema(ctx, &store.FindDBSchemaMessage{
- InstanceID: database.InstanceID,
- DatabaseName: database.DatabaseName,
- })
- if err != nil {
- return storepb.Advice_ERROR, nil, errors.Wrapf(err, "failed to fetch database schema for database %s", database.String())
- }
- if dbSchema == nil {
- if err := s.schemaSyncer.SyncDatabaseSchema(ctx, database); err != nil {
- return storepb.Advice_ERROR, nil, errors.Wrapf(err, "failed to sync database schema for database %s", database.String())
- }
- dbSchema, err = s.store.GetDBSchema(ctx, &store.FindDBSchemaMessage{
- InstanceID: database.InstanceID,
- DatabaseName: database.DatabaseName,
- })
- if err != nil {
- return storepb.Advice_ERROR, nil, errors.Wrapf(err, "failed to fetch database schema for database %s", database.String())
- }
- if dbSchema == nil {
- return storepb.Advice_ERROR, nil, errors.Wrapf(err, "cannot found schema for database %s", database.String())
- }
- }
- dbMetadata := dbSchema.GetMetadata()
-
- catalog, err := catalog.NewCatalog(ctx, s.store, database.InstanceID, database.DatabaseName, instance.Metadata.GetEngine(), store.IsObjectCaseSensitive(instance), dbMetadata)
- if err != nil {
- return storepb.Advice_ERROR, nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to create a catalog: %v", err))
- }
-
- useDatabaseOwner, err := getUseDatabaseOwner(ctx, s.store, instance, database, changeType)
- if err != nil {
- return storepb.Advice_ERROR, nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get use database owner: %v", err))
- }
- driver, err := s.dbFactory.GetAdminDatabaseDriver(ctx, instance, database, db.ConnectionContext{UseDatabaseOwner: useDatabaseOwner})
- if err != nil {
- return storepb.Advice_ERROR, nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get database driver: %v", err))
- }
- defer driver.Close(ctx)
- connection := driver.GetDB()
-
- classificationConfig := getClassificationByProject(ctx, s.store, database.ProjectID)
- context := advisor.SQLReviewCheckContext{
- Charset: dbMetadata.CharacterSet,
- Collation: dbMetadata.Collation,
- ChangeType: changeType,
- DBSchema: dbMetadata,
- DBType: instance.Metadata.GetEngine(),
- Catalog: catalog,
- Driver: connection,
- CurrentDatabase: database.DatabaseName,
- ClassificationConfig: classificationConfig,
- UsePostgresDatabaseOwner: useDatabaseOwner,
- ListDatabaseNamesFunc: BuildListDatabaseNamesFunc(s.store),
- InstanceID: instance.ResourceID,
- IsObjectCaseSensitive: store.IsObjectCaseSensitive(instance),
- }
-
- reviewConfig, err := s.store.GetReviewConfigForDatabase(ctx, database)
- if err != nil {
- if e, ok := err.(*common.Error); ok && e.Code == common.NotFound {
- // Continue to check the builtin rules.
- reviewConfig = &storepb.ReviewConfigPayload{}
- } else {
- return storepb.Advice_ERROR, nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get SQL review policy with error: %v", err))
- }
- }
-
- res, err := advisor.SQLReviewCheck(ctx, s.sheetManager, statement, reviewConfig.SqlReviewRules, context)
- if err != nil {
- return storepb.Advice_ERROR, nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to exec SQL review with error: %v", err))
- }
-
- adviceLevel := storepb.Advice_SUCCESS
- var advices []*v1pb.Advice
- for _, advice := range res {
- switch advice.Status {
- case storepb.Advice_WARNING:
- if adviceLevel != storepb.Advice_ERROR {
- adviceLevel = storepb.Advice_WARNING
- }
- case storepb.Advice_ERROR:
- adviceLevel = storepb.Advice_ERROR
- case storepb.Advice_SUCCESS, storepb.Advice_STATUS_UNSPECIFIED:
- continue
- default:
- }
-
- advices = append(advices, convertToV1Advice(advice))
- }
-
- return adviceLevel, advices, nil
-}
-
-func getUseDatabaseOwner(ctx context.Context, stores *store.Store, instance *store.InstanceMessage, database *store.DatabaseMessage, changeType storepb.PlanCheckRunConfig_ChangeDatabaseType) (bool, error) {
- if instance.Metadata.GetEngine() != storepb.Engine_POSTGRES || changeType == storepb.PlanCheckRunConfig_SQL_EDITOR {
+func getUseDatabaseOwner(ctx context.Context, stores *store.Store, instance *store.InstanceMessage, database *store.DatabaseMessage) (bool, error) {
+ if instance.Metadata.GetEngine() != storepb.Engine_POSTGRES {
return false, nil
}
diff --git a/backend/api/v1/sql_service_converter.go b/backend/api/v1/sql_service_converter.go
index 55146bcab1..2bcfcf0e30 100644
--- a/backend/api/v1/sql_service_converter.go
+++ b/backend/api/v1/sql_service_converter.go
@@ -13,21 +13,6 @@ import (
"github.com/bytebase/bytebase/backend/store"
)
-func convertChangeType(t v1pb.CheckRequest_ChangeType) storepb.PlanCheckRunConfig_ChangeDatabaseType {
- switch t {
- case v1pb.CheckRequest_DDL:
- return storepb.PlanCheckRunConfig_DDL
- case v1pb.CheckRequest_DDL_GHOST:
- return storepb.PlanCheckRunConfig_DDL_GHOST
- case v1pb.CheckRequest_DML:
- return storepb.PlanCheckRunConfig_DML
- case v1pb.CheckRequest_SQL_EDITOR:
- return storepb.PlanCheckRunConfig_SQL_EDITOR
- default:
- return storepb.PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED
- }
-}
-
func convertToV1Advice(advice *storepb.Advice) *v1pb.Advice {
return &v1pb.Advice{
Status: convertAdviceStatus(advice.Status),
diff --git a/backend/generated-go/store/plan_check_run.pb.go b/backend/generated-go/store/plan_check_run.pb.go
index 5313605ed6..aad602b4ae 100644
--- a/backend/generated-go/store/plan_check_run.pb.go
+++ b/backend/generated-go/store/plan_check_run.pb.go
@@ -31,7 +31,6 @@ const (
PlanCheckRunConfig_DML PlanCheckRunConfig_ChangeDatabaseType = 2
PlanCheckRunConfig_SDL PlanCheckRunConfig_ChangeDatabaseType = 3
PlanCheckRunConfig_DDL_GHOST PlanCheckRunConfig_ChangeDatabaseType = 4
- PlanCheckRunConfig_SQL_EDITOR PlanCheckRunConfig_ChangeDatabaseType = 5
)
// Enum value maps for PlanCheckRunConfig_ChangeDatabaseType.
@@ -42,7 +41,6 @@ var (
2: "DML",
3: "SDL",
4: "DDL_GHOST",
- 5: "SQL_EDITOR",
}
PlanCheckRunConfig_ChangeDatabaseType_value = map[string]int32{
"CHANGE_DATABASE_TYPE_UNSPECIFIED": 0,
@@ -50,7 +48,6 @@ var (
"DML": 2,
"SDL": 3,
"DDL_GHOST": 4,
- "SQL_EDITOR": 5,
}
)
@@ -460,7 +457,7 @@ var File_store_plan_check_run_proto protoreflect.FileDescriptor
const file_store_plan_check_run_proto_rawDesc = "" +
"\n" +
- "\x1astore/plan_check_run.proto\x12\x0ebytebase.store\x1a\x12store/advice.proto\x1a\x15store/changelog.proto\x1a\x12store/common.proto\"\xe8\x04\n" +
+ "\x1astore/plan_check_run.proto\x12\x0ebytebase.store\x1a\x12store/advice.proto\x1a\x15store/changelog.proto\x1a\x12store/common.proto\"\xd8\x04\n" +
"\x12PlanCheckRunConfig\x12\x1b\n" +
"\tsheet_uid\x18\x01 \x01(\x05R\bsheetUid\x12g\n" +
"\x14change_database_type\x18\x02 \x01(\x0e25.bytebase.store.PlanCheckRunConfig.ChangeDatabaseTypeR\x12changeDatabaseType\x12\x1f\n" +
@@ -473,15 +470,13 @@ const file_store_plan_check_run_proto_rawDesc = "" +
"\x13enable_prior_backup\x18\a \x01(\bR\x11enablePriorBackup\x1a=\n" +
"\x0fGhostFlagsEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
- "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"t\n" +
+ "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"d\n" +
"\x12ChangeDatabaseType\x12$\n" +
" CHANGE_DATABASE_TYPE_UNSPECIFIED\x10\x00\x12\a\n" +
"\x03DDL\x10\x01\x12\a\n" +
"\x03DML\x10\x02\x12\a\n" +
"\x03SDL\x10\x03\x12\r\n" +
- "\tDDL_GHOST\x10\x04\x12\x0e\n" +
- "\n" +
- "SQL_EDITOR\x10\x05B\x15\n" +
+ "\tDDL_GHOST\x10\x04B\x15\n" +
"\x13_database_group_uid\"\xb6\x06\n" +
"\x12PlanCheckRunResult\x12C\n" +
"\aresults\x18\x01 \x03(\v2).bytebase.store.PlanCheckRunResult.ResultR\aresults\x12\x14\n" +
diff --git a/backend/generated-go/v1/sql_service.pb.go b/backend/generated-go/v1/sql_service.pb.go
index 2fd3ac47ea..3c11798c23 100644
--- a/backend/generated-go/v1/sql_service.pb.go
+++ b/backend/generated-go/v1/sql_service.pb.go
@@ -202,61 +202,6 @@ func (Advice_Level) EnumDescriptor() ([]byte, []int) {
return file_v1_sql_service_proto_rawDescGZIP(), []int{9, 0}
}
-type CheckRequest_ChangeType int32
-
-const (
- CheckRequest_CHANGE_TYPE_UNSPECIFIED CheckRequest_ChangeType = 0
- CheckRequest_DDL CheckRequest_ChangeType = 1
- CheckRequest_DDL_GHOST CheckRequest_ChangeType = 2
- CheckRequest_DML CheckRequest_ChangeType = 3
- CheckRequest_SQL_EDITOR CheckRequest_ChangeType = 4
-)
-
-// Enum value maps for CheckRequest_ChangeType.
-var (
- CheckRequest_ChangeType_name = map[int32]string{
- 0: "CHANGE_TYPE_UNSPECIFIED",
- 1: "DDL",
- 2: "DDL_GHOST",
- 3: "DML",
- 4: "SQL_EDITOR",
- }
- CheckRequest_ChangeType_value = map[string]int32{
- "CHANGE_TYPE_UNSPECIFIED": 0,
- "DDL": 1,
- "DDL_GHOST": 2,
- "DML": 3,
- "SQL_EDITOR": 4,
- }
-)
-
-func (x CheckRequest_ChangeType) Enum() *CheckRequest_ChangeType {
- p := new(CheckRequest_ChangeType)
- *p = x
- return p
-}
-
-func (x CheckRequest_ChangeType) String() string {
- return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
-}
-
-func (CheckRequest_ChangeType) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_sql_service_proto_enumTypes[3].Descriptor()
-}
-
-func (CheckRequest_ChangeType) Type() protoreflect.EnumType {
- return &file_v1_sql_service_proto_enumTypes[3]
-}
-
-func (x CheckRequest_ChangeType) Number() protoreflect.EnumNumber {
- return protoreflect.EnumNumber(x)
-}
-
-// Deprecated: Use CheckRequest_ChangeType.Descriptor instead.
-func (CheckRequest_ChangeType) EnumDescriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{12, 0}
-}
-
type QueryHistory_Type int32
const (
@@ -293,11 +238,11 @@ func (x QueryHistory_Type) String() string {
}
func (QueryHistory_Type) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_sql_service_proto_enumTypes[4].Descriptor()
+ return file_v1_sql_service_proto_enumTypes[3].Descriptor()
}
func (QueryHistory_Type) Type() protoreflect.EnumType {
- return &file_v1_sql_service_proto_enumTypes[4]
+ return &file_v1_sql_service_proto_enumTypes[3]
}
func (x QueryHistory_Type) Number() protoreflect.EnumNumber {
@@ -306,7 +251,7 @@ func (x QueryHistory_Type) Number() protoreflect.EnumNumber {
// Deprecated: Use QueryHistory_Type.Descriptor instead.
func (QueryHistory_Type) EnumDescriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{18, 0}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{16, 0}
}
type AdminExecuteRequest struct {
@@ -1458,121 +1403,6 @@ func (x *ExportResponse) GetContent() []byte {
return nil
}
-type CheckRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The database name to check against.
- // Format: instances/{instance}/databases/{database}
- Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
- Statement string `protobuf:"bytes,1,opt,name=statement,proto3" json:"statement,omitempty"`
- ChangeType CheckRequest_ChangeType `protobuf:"varint,4,opt,name=change_type,json=changeType,proto3,enum=bytebase.v1.CheckRequest_ChangeType" json:"change_type,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *CheckRequest) Reset() {
- *x = CheckRequest{}
- mi := &file_v1_sql_service_proto_msgTypes[12]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *CheckRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CheckRequest) ProtoMessage() {}
-
-func (x *CheckRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[12]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.
-func (*CheckRequest) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{12}
-}
-
-func (x *CheckRequest) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-func (x *CheckRequest) GetStatement() string {
- if x != nil {
- return x.Statement
- }
- return ""
-}
-
-func (x *CheckRequest) GetChangeType() CheckRequest_ChangeType {
- if x != nil {
- return x.ChangeType
- }
- return CheckRequest_CHANGE_TYPE_UNSPECIFIED
-}
-
-type CheckResponse struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- Advices []*Advice `protobuf:"bytes,1,rep,name=advices,proto3" json:"advices,omitempty"`
- // The count of affected rows of the statement on the target database.
- AffectedRows int64 `protobuf:"varint,2,opt,name=affected_rows,json=affectedRows,proto3" json:"affected_rows,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *CheckResponse) Reset() {
- *x = CheckResponse{}
- mi := &file_v1_sql_service_proto_msgTypes[13]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *CheckResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CheckResponse) ProtoMessage() {}
-
-func (x *CheckResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[13]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.
-func (*CheckResponse) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{13}
-}
-
-func (x *CheckResponse) GetAdvices() []*Advice {
- if x != nil {
- return x.Advices
- }
- return nil
-}
-
-func (x *CheckResponse) GetAffectedRows() int64 {
- if x != nil {
- return x.AffectedRows
- }
- return 0
-}
-
type DiffMetadataRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The metadata of the source schema.
@@ -1592,7 +1422,7 @@ type DiffMetadataRequest struct {
func (x *DiffMetadataRequest) Reset() {
*x = DiffMetadataRequest{}
- mi := &file_v1_sql_service_proto_msgTypes[14]
+ mi := &file_v1_sql_service_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1604,7 +1434,7 @@ func (x *DiffMetadataRequest) String() string {
func (*DiffMetadataRequest) ProtoMessage() {}
func (x *DiffMetadataRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[14]
+ mi := &file_v1_sql_service_proto_msgTypes[12]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1617,7 +1447,7 @@ func (x *DiffMetadataRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DiffMetadataRequest.ProtoReflect.Descriptor instead.
func (*DiffMetadataRequest) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{14}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{12}
}
func (x *DiffMetadataRequest) GetSourceMetadata() *DatabaseMetadata {
@@ -1672,7 +1502,7 @@ type DiffMetadataResponse struct {
func (x *DiffMetadataResponse) Reset() {
*x = DiffMetadataResponse{}
- mi := &file_v1_sql_service_proto_msgTypes[15]
+ mi := &file_v1_sql_service_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1684,7 +1514,7 @@ func (x *DiffMetadataResponse) String() string {
func (*DiffMetadataResponse) ProtoMessage() {}
func (x *DiffMetadataResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[15]
+ mi := &file_v1_sql_service_proto_msgTypes[13]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1697,7 +1527,7 @@ func (x *DiffMetadataResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DiffMetadataResponse.ProtoReflect.Descriptor instead.
func (*DiffMetadataResponse) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{15}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{13}
}
func (x *DiffMetadataResponse) GetDiff() string {
@@ -1742,7 +1572,7 @@ type SearchQueryHistoriesRequest struct {
func (x *SearchQueryHistoriesRequest) Reset() {
*x = SearchQueryHistoriesRequest{}
- mi := &file_v1_sql_service_proto_msgTypes[16]
+ mi := &file_v1_sql_service_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1754,7 +1584,7 @@ func (x *SearchQueryHistoriesRequest) String() string {
func (*SearchQueryHistoriesRequest) ProtoMessage() {}
func (x *SearchQueryHistoriesRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[16]
+ mi := &file_v1_sql_service_proto_msgTypes[14]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1767,7 +1597,7 @@ func (x *SearchQueryHistoriesRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SearchQueryHistoriesRequest.ProtoReflect.Descriptor instead.
func (*SearchQueryHistoriesRequest) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{16}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{14}
}
func (x *SearchQueryHistoriesRequest) GetPageSize() int32 {
@@ -1805,7 +1635,7 @@ type SearchQueryHistoriesResponse struct {
func (x *SearchQueryHistoriesResponse) Reset() {
*x = SearchQueryHistoriesResponse{}
- mi := &file_v1_sql_service_proto_msgTypes[17]
+ mi := &file_v1_sql_service_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1817,7 +1647,7 @@ func (x *SearchQueryHistoriesResponse) String() string {
func (*SearchQueryHistoriesResponse) ProtoMessage() {}
func (x *SearchQueryHistoriesResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[17]
+ mi := &file_v1_sql_service_proto_msgTypes[15]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1830,7 +1660,7 @@ func (x *SearchQueryHistoriesResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SearchQueryHistoriesResponse.ProtoReflect.Descriptor instead.
func (*SearchQueryHistoriesResponse) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{17}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{15}
}
func (x *SearchQueryHistoriesResponse) GetQueryHistories() []*QueryHistory {
@@ -1867,7 +1697,7 @@ type QueryHistory struct {
func (x *QueryHistory) Reset() {
*x = QueryHistory{}
- mi := &file_v1_sql_service_proto_msgTypes[18]
+ mi := &file_v1_sql_service_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1879,7 +1709,7 @@ func (x *QueryHistory) String() string {
func (*QueryHistory) ProtoMessage() {}
func (x *QueryHistory) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[18]
+ mi := &file_v1_sql_service_proto_msgTypes[16]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1892,7 +1722,7 @@ func (x *QueryHistory) ProtoReflect() protoreflect.Message {
// Deprecated: Use QueryHistory.ProtoReflect.Descriptor instead.
func (*QueryHistory) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{18}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{16}
}
func (x *QueryHistory) GetName() string {
@@ -1960,7 +1790,7 @@ type AICompletionRequest struct {
func (x *AICompletionRequest) Reset() {
*x = AICompletionRequest{}
- mi := &file_v1_sql_service_proto_msgTypes[19]
+ mi := &file_v1_sql_service_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1972,7 +1802,7 @@ func (x *AICompletionRequest) String() string {
func (*AICompletionRequest) ProtoMessage() {}
func (x *AICompletionRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[19]
+ mi := &file_v1_sql_service_proto_msgTypes[17]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1985,7 +1815,7 @@ func (x *AICompletionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use AICompletionRequest.ProtoReflect.Descriptor instead.
func (*AICompletionRequest) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{19}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{17}
}
func (x *AICompletionRequest) GetMessages() []*AICompletionRequest_Message {
@@ -2006,7 +1836,7 @@ type AICompletionResponse struct {
func (x *AICompletionResponse) Reset() {
*x = AICompletionResponse{}
- mi := &file_v1_sql_service_proto_msgTypes[20]
+ mi := &file_v1_sql_service_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2018,7 +1848,7 @@ func (x *AICompletionResponse) String() string {
func (*AICompletionResponse) ProtoMessage() {}
func (x *AICompletionResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[20]
+ mi := &file_v1_sql_service_proto_msgTypes[18]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2031,7 +1861,7 @@ func (x *AICompletionResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use AICompletionResponse.ProtoReflect.Descriptor instead.
func (*AICompletionResponse) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{20}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{18}
}
func (x *AICompletionResponse) GetCandidates() []*AICompletionResponse_Candidate {
@@ -2068,7 +1898,7 @@ type QueryResult_PostgresError struct {
func (x *QueryResult_PostgresError) Reset() {
*x = QueryResult_PostgresError{}
- mi := &file_v1_sql_service_proto_msgTypes[21]
+ mi := &file_v1_sql_service_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2080,7 +1910,7 @@ func (x *QueryResult_PostgresError) String() string {
func (*QueryResult_PostgresError) ProtoMessage() {}
func (x *QueryResult_PostgresError) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[21]
+ mi := &file_v1_sql_service_proto_msgTypes[19]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2225,7 +2055,7 @@ type QueryResult_Message struct {
func (x *QueryResult_Message) Reset() {
*x = QueryResult_Message{}
- mi := &file_v1_sql_service_proto_msgTypes[22]
+ mi := &file_v1_sql_service_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2237,7 +2067,7 @@ func (x *QueryResult_Message) String() string {
func (*QueryResult_Message) ProtoMessage() {}
func (x *QueryResult_Message) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[22]
+ mi := &file_v1_sql_service_proto_msgTypes[20]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2278,7 +2108,7 @@ type RowValue_Timestamp struct {
func (x *RowValue_Timestamp) Reset() {
*x = RowValue_Timestamp{}
- mi := &file_v1_sql_service_proto_msgTypes[23]
+ mi := &file_v1_sql_service_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2290,7 +2120,7 @@ func (x *RowValue_Timestamp) String() string {
func (*RowValue_Timestamp) ProtoMessage() {}
func (x *RowValue_Timestamp) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[23]
+ mi := &file_v1_sql_service_proto_msgTypes[21]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2339,7 +2169,7 @@ type RowValue_TimestampTZ struct {
func (x *RowValue_TimestampTZ) Reset() {
*x = RowValue_TimestampTZ{}
- mi := &file_v1_sql_service_proto_msgTypes[24]
+ mi := &file_v1_sql_service_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2351,7 +2181,7 @@ func (x *RowValue_TimestampTZ) String() string {
func (*RowValue_TimestampTZ) ProtoMessage() {}
func (x *RowValue_TimestampTZ) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[24]
+ mi := &file_v1_sql_service_proto_msgTypes[22]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2405,7 +2235,7 @@ type AICompletionRequest_Message struct {
func (x *AICompletionRequest_Message) Reset() {
*x = AICompletionRequest_Message{}
- mi := &file_v1_sql_service_proto_msgTypes[25]
+ mi := &file_v1_sql_service_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2417,7 +2247,7 @@ func (x *AICompletionRequest_Message) String() string {
func (*AICompletionRequest_Message) ProtoMessage() {}
func (x *AICompletionRequest_Message) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[25]
+ mi := &file_v1_sql_service_proto_msgTypes[23]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2430,7 +2260,7 @@ func (x *AICompletionRequest_Message) ProtoReflect() protoreflect.Message {
// Deprecated: Use AICompletionRequest_Message.ProtoReflect.Descriptor instead.
func (*AICompletionRequest_Message) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{19, 0}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{17, 0}
}
func (x *AICompletionRequest_Message) GetRole() string {
@@ -2456,7 +2286,7 @@ type AICompletionResponse_Candidate struct {
func (x *AICompletionResponse_Candidate) Reset() {
*x = AICompletionResponse_Candidate{}
- mi := &file_v1_sql_service_proto_msgTypes[26]
+ mi := &file_v1_sql_service_proto_msgTypes[24]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2468,7 +2298,7 @@ func (x *AICompletionResponse_Candidate) String() string {
func (*AICompletionResponse_Candidate) ProtoMessage() {}
func (x *AICompletionResponse_Candidate) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[26]
+ mi := &file_v1_sql_service_proto_msgTypes[24]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2481,7 +2311,7 @@ func (x *AICompletionResponse_Candidate) ProtoReflect() protoreflect.Message {
// Deprecated: Use AICompletionResponse_Candidate.ProtoReflect.Descriptor instead.
func (*AICompletionResponse_Candidate) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{20, 0}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{18, 0}
}
func (x *AICompletionResponse_Candidate) GetContent() *AICompletionResponse_Candidate_Content {
@@ -2501,7 +2331,7 @@ type AICompletionResponse_Candidate_Content struct {
func (x *AICompletionResponse_Candidate_Content) Reset() {
*x = AICompletionResponse_Candidate_Content{}
- mi := &file_v1_sql_service_proto_msgTypes[27]
+ mi := &file_v1_sql_service_proto_msgTypes[25]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2513,7 +2343,7 @@ func (x *AICompletionResponse_Candidate_Content) String() string {
func (*AICompletionResponse_Candidate_Content) ProtoMessage() {}
func (x *AICompletionResponse_Candidate_Content) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[27]
+ mi := &file_v1_sql_service_proto_msgTypes[25]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2526,7 +2356,7 @@ func (x *AICompletionResponse_Candidate_Content) ProtoReflect() protoreflect.Mes
// Deprecated: Use AICompletionResponse_Candidate_Content.ProtoReflect.Descriptor instead.
func (*AICompletionResponse_Candidate_Content) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{20, 0, 0}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{18, 0, 0}
}
func (x *AICompletionResponse_Candidate_Content) GetParts() []*AICompletionResponse_Candidate_Content_Part {
@@ -2545,7 +2375,7 @@ type AICompletionResponse_Candidate_Content_Part struct {
func (x *AICompletionResponse_Candidate_Content_Part) Reset() {
*x = AICompletionResponse_Candidate_Content_Part{}
- mi := &file_v1_sql_service_proto_msgTypes[28]
+ mi := &file_v1_sql_service_proto_msgTypes[26]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2557,7 +2387,7 @@ func (x *AICompletionResponse_Candidate_Content_Part) String() string {
func (*AICompletionResponse_Candidate_Content_Part) ProtoMessage() {}
func (x *AICompletionResponse_Candidate_Content_Part) ProtoReflect() protoreflect.Message {
- mi := &file_v1_sql_service_proto_msgTypes[28]
+ mi := &file_v1_sql_service_proto_msgTypes[26]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2570,7 +2400,7 @@ func (x *AICompletionResponse_Candidate_Content_Part) ProtoReflect() protoreflec
// Deprecated: Use AICompletionResponse_Candidate_Content_Part.ProtoReflect.Descriptor instead.
func (*AICompletionResponse_Candidate_Content_Part) Descriptor() ([]byte, []int) {
- return file_v1_sql_service_proto_rawDescGZIP(), []int{20, 0, 0, 0}
+ return file_v1_sql_service_proto_rawDescGZIP(), []int{18, 0, 0, 0}
}
func (x *AICompletionResponse_Candidate_Content_Part) GetText() string {
@@ -2733,24 +2563,7 @@ const file_v1_sql_service_proto_rawDesc = "" +
"\x06schema\x18\t \x01(\tH\x00R\x06schema\x88\x01\x01B\t\n" +
"\a_schemaJ\x04\b\x02\x10\x03\"*\n" +
"\x0eExportResponse\x12\x18\n" +
- "\acontent\x18\x01 \x01(\fR\acontent\"\x82\x02\n" +
- "\fCheckRequest\x121\n" +
- "\x04name\x18\x02 \x01(\tB\x1d\xe0A\x02\xfaA\x17\n" +
- "\x15bytebase.com/DatabaseR\x04name\x12\x1c\n" +
- "\tstatement\x18\x01 \x01(\tR\tstatement\x12E\n" +
- "\vchange_type\x18\x04 \x01(\x0e2$.bytebase.v1.CheckRequest.ChangeTypeR\n" +
- "changeType\"Z\n" +
- "\n" +
- "ChangeType\x12\x1b\n" +
- "\x17CHANGE_TYPE_UNSPECIFIED\x10\x00\x12\a\n" +
- "\x03DDL\x10\x01\x12\r\n" +
- "\tDDL_GHOST\x10\x02\x12\a\n" +
- "\x03DML\x10\x03\x12\x0e\n" +
- "\n" +
- "SQL_EDITOR\x10\x04\"c\n" +
- "\rCheckResponse\x12-\n" +
- "\aadvices\x18\x01 \x03(\v2\x13.bytebase.v1.AdviceR\aadvices\x12#\n" +
- "\raffected_rows\x18\x02 \x01(\x03R\faffectedRows\"\xa4\x03\n" +
+ "\acontent\x18\x01 \x01(\fR\acontent\"\xa4\x03\n" +
"\x13DiffMetadataRequest\x12K\n" +
"\x0fsource_metadata\x18\x01 \x01(\v2\x1d.bytebase.v1.DatabaseMetadataB\x03\xe0A\x02R\x0esourceMetadata\x12K\n" +
"\x0ftarget_metadata\x18\x02 \x01(\v2\x1d.bytebase.v1.DatabaseMetadataB\x03\xe0A\x02R\x0etargetMetadata\x12C\n" +
@@ -2798,14 +2611,13 @@ const file_v1_sql_service_proto_rawDesc = "" +
"\aContent\x12N\n" +
"\x05parts\x18\x01 \x03(\v28.bytebase.v1.AICompletionResponse.Candidate.Content.PartR\x05parts\x1a\x1a\n" +
"\x04Part\x12\x12\n" +
- "\x04text\x18\x01 \x01(\tR\x04text2\xb1\b\n" +
+ "\x04text\x18\x01 \x01(\tR\x04text2\xbd\a\n" +
"\n" +
"SQLService\x12\x8f\x01\n" +
"\x05Query\x12\x19.bytebase.v1.QueryRequest\x1a\x1a.bytebase.v1.QueryResponse\"O\x8a\xea0\x10bb.databases.get\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x02-:\x01*\"(/v1/{name=instances/*/databases/*}:query\x12\x89\x01\n" +
"\fAdminExecute\x12 .bytebase.v1.AdminExecuteRequest\x1a!.bytebase.v1.AdminExecuteResponse\"0\x8a\xea0\fbb.sql.admin\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x02\x12\x12\x10/v1:adminExecute(\x010\x01\x12\x95\x01\n" +
"\x14SearchQueryHistories\x12(.bytebase.v1.SearchQueryHistoriesRequest\x1a).bytebase.v1.SearchQueryHistoriesResponse\"(\x90\xea0\x02\x82\xd3\xe4\x93\x02\x1e:\x01*\"\x19/v1/queryHistories:search\x12\xfa\x01\n" +
- "\x06Export\x12\x1a.bytebase.v1.ExportRequest\x1a\x1b.bytebase.v1.ExportResponse\"\xb6\x01\x8a\xea0\x10bb.databases.get\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x02\x93\x01:\x01*Z,:\x01*\"'/v1/{name=projects/*/rollouts/*}:exportZ5:\x01*\"0/v1/{name=projects/*/rollouts/*/stages/*}:export\")/v1/{name=instances/*/databases/*}:export\x12r\n" +
- "\x05Check\x12\x19.bytebase.v1.CheckRequest\x1a\x1a.bytebase.v1.CheckResponse\"2\x8a\xea0\x12bb.databases.check\x90\xea0\x01\x82\xd3\xe4\x93\x02\x12:\x01*\"\r/v1/sql/check\x12\x81\x01\n" +
+ "\x06Export\x12\x1a.bytebase.v1.ExportRequest\x1a\x1b.bytebase.v1.ExportResponse\"\xb6\x01\x8a\xea0\x10bb.databases.get\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x02\x93\x01:\x01*Z,:\x01*\"'/v1/{name=projects/*/rollouts/*}:exportZ5:\x01*\"0/v1/{name=projects/*/rollouts/*/stages/*}:export\")/v1/{name=instances/*/databases/*}:export\x12\x81\x01\n" +
"\fDiffMetadata\x12 .bytebase.v1.DiffMetadataRequest\x1a!.bytebase.v1.DiffMetadataResponse\",\x80\xea0\x01\x82\xd3\xe4\x93\x02\":\x01*\"\x1d/v1/schemaDesign:diffMetadata\x12x\n" +
"\fAICompletion\x12 .bytebase.v1.AICompletionRequest\x1a!.bytebase.v1.AICompletionResponse\"#\x90\xea0\x02\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/v1/sql/aiCompletionB6Z4github.com/bytebase/bytebase/backend/generated-go/v1b\x06proto3"
@@ -2821,109 +2633,102 @@ func file_v1_sql_service_proto_rawDescGZIP() []byte {
return file_v1_sql_service_proto_rawDescData
}
-var file_v1_sql_service_proto_enumTypes = make([]protoimpl.EnumInfo, 5)
-var file_v1_sql_service_proto_msgTypes = make([]protoimpl.MessageInfo, 29)
+var file_v1_sql_service_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
+var file_v1_sql_service_proto_msgTypes = make([]protoimpl.MessageInfo, 27)
var file_v1_sql_service_proto_goTypes = []any{
(QueryOption_RedisRunCommandsOn)(0), // 0: bytebase.v1.QueryOption.RedisRunCommandsOn
(QueryResult_Message_Level)(0), // 1: bytebase.v1.QueryResult.Message.Level
(Advice_Level)(0), // 2: bytebase.v1.Advice.Level
- (CheckRequest_ChangeType)(0), // 3: bytebase.v1.CheckRequest.ChangeType
- (QueryHistory_Type)(0), // 4: bytebase.v1.QueryHistory.Type
- (*AdminExecuteRequest)(nil), // 5: bytebase.v1.AdminExecuteRequest
- (*AdminExecuteResponse)(nil), // 6: bytebase.v1.AdminExecuteResponse
- (*QueryRequest)(nil), // 7: bytebase.v1.QueryRequest
- (*QueryResponse)(nil), // 8: bytebase.v1.QueryResponse
- (*QueryOption)(nil), // 9: bytebase.v1.QueryOption
- (*QueryResult)(nil), // 10: bytebase.v1.QueryResult
- (*MaskingReason)(nil), // 11: bytebase.v1.MaskingReason
- (*QueryRow)(nil), // 12: bytebase.v1.QueryRow
- (*RowValue)(nil), // 13: bytebase.v1.RowValue
- (*Advice)(nil), // 14: bytebase.v1.Advice
- (*ExportRequest)(nil), // 15: bytebase.v1.ExportRequest
- (*ExportResponse)(nil), // 16: bytebase.v1.ExportResponse
- (*CheckRequest)(nil), // 17: bytebase.v1.CheckRequest
- (*CheckResponse)(nil), // 18: bytebase.v1.CheckResponse
- (*DiffMetadataRequest)(nil), // 19: bytebase.v1.DiffMetadataRequest
- (*DiffMetadataResponse)(nil), // 20: bytebase.v1.DiffMetadataResponse
- (*SearchQueryHistoriesRequest)(nil), // 21: bytebase.v1.SearchQueryHistoriesRequest
- (*SearchQueryHistoriesResponse)(nil), // 22: bytebase.v1.SearchQueryHistoriesResponse
- (*QueryHistory)(nil), // 23: bytebase.v1.QueryHistory
- (*AICompletionRequest)(nil), // 24: bytebase.v1.AICompletionRequest
- (*AICompletionResponse)(nil), // 25: bytebase.v1.AICompletionResponse
- (*QueryResult_PostgresError)(nil), // 26: bytebase.v1.QueryResult.PostgresError
- (*QueryResult_Message)(nil), // 27: bytebase.v1.QueryResult.Message
- (*RowValue_Timestamp)(nil), // 28: bytebase.v1.RowValue.Timestamp
- (*RowValue_TimestampTZ)(nil), // 29: bytebase.v1.RowValue.TimestampTZ
- (*AICompletionRequest_Message)(nil), // 30: bytebase.v1.AICompletionRequest.Message
- (*AICompletionResponse_Candidate)(nil), // 31: bytebase.v1.AICompletionResponse.Candidate
- (*AICompletionResponse_Candidate_Content)(nil), // 32: bytebase.v1.AICompletionResponse.Candidate.Content
- (*AICompletionResponse_Candidate_Content_Part)(nil), // 33: bytebase.v1.AICompletionResponse.Candidate.Content.Part
- (*durationpb.Duration)(nil), // 34: google.protobuf.Duration
- (structpb.NullValue)(0), // 35: google.protobuf.NullValue
- (*structpb.Value)(nil), // 36: google.protobuf.Value
- (*Position)(nil), // 37: bytebase.v1.Position
- (ExportFormat)(0), // 38: bytebase.v1.ExportFormat
- (*DatabaseMetadata)(nil), // 39: bytebase.v1.DatabaseMetadata
- (*DatabaseCatalog)(nil), // 40: bytebase.v1.DatabaseCatalog
- (Engine)(0), // 41: bytebase.v1.Engine
- (*timestamppb.Timestamp)(nil), // 42: google.protobuf.Timestamp
+ (QueryHistory_Type)(0), // 3: bytebase.v1.QueryHistory.Type
+ (*AdminExecuteRequest)(nil), // 4: bytebase.v1.AdminExecuteRequest
+ (*AdminExecuteResponse)(nil), // 5: bytebase.v1.AdminExecuteResponse
+ (*QueryRequest)(nil), // 6: bytebase.v1.QueryRequest
+ (*QueryResponse)(nil), // 7: bytebase.v1.QueryResponse
+ (*QueryOption)(nil), // 8: bytebase.v1.QueryOption
+ (*QueryResult)(nil), // 9: bytebase.v1.QueryResult
+ (*MaskingReason)(nil), // 10: bytebase.v1.MaskingReason
+ (*QueryRow)(nil), // 11: bytebase.v1.QueryRow
+ (*RowValue)(nil), // 12: bytebase.v1.RowValue
+ (*Advice)(nil), // 13: bytebase.v1.Advice
+ (*ExportRequest)(nil), // 14: bytebase.v1.ExportRequest
+ (*ExportResponse)(nil), // 15: bytebase.v1.ExportResponse
+ (*DiffMetadataRequest)(nil), // 16: bytebase.v1.DiffMetadataRequest
+ (*DiffMetadataResponse)(nil), // 17: bytebase.v1.DiffMetadataResponse
+ (*SearchQueryHistoriesRequest)(nil), // 18: bytebase.v1.SearchQueryHistoriesRequest
+ (*SearchQueryHistoriesResponse)(nil), // 19: bytebase.v1.SearchQueryHistoriesResponse
+ (*QueryHistory)(nil), // 20: bytebase.v1.QueryHistory
+ (*AICompletionRequest)(nil), // 21: bytebase.v1.AICompletionRequest
+ (*AICompletionResponse)(nil), // 22: bytebase.v1.AICompletionResponse
+ (*QueryResult_PostgresError)(nil), // 23: bytebase.v1.QueryResult.PostgresError
+ (*QueryResult_Message)(nil), // 24: bytebase.v1.QueryResult.Message
+ (*RowValue_Timestamp)(nil), // 25: bytebase.v1.RowValue.Timestamp
+ (*RowValue_TimestampTZ)(nil), // 26: bytebase.v1.RowValue.TimestampTZ
+ (*AICompletionRequest_Message)(nil), // 27: bytebase.v1.AICompletionRequest.Message
+ (*AICompletionResponse_Candidate)(nil), // 28: bytebase.v1.AICompletionResponse.Candidate
+ (*AICompletionResponse_Candidate_Content)(nil), // 29: bytebase.v1.AICompletionResponse.Candidate.Content
+ (*AICompletionResponse_Candidate_Content_Part)(nil), // 30: bytebase.v1.AICompletionResponse.Candidate.Content.Part
+ (*durationpb.Duration)(nil), // 31: google.protobuf.Duration
+ (structpb.NullValue)(0), // 32: google.protobuf.NullValue
+ (*structpb.Value)(nil), // 33: google.protobuf.Value
+ (*Position)(nil), // 34: bytebase.v1.Position
+ (ExportFormat)(0), // 35: bytebase.v1.ExportFormat
+ (*DatabaseMetadata)(nil), // 36: bytebase.v1.DatabaseMetadata
+ (*DatabaseCatalog)(nil), // 37: bytebase.v1.DatabaseCatalog
+ (Engine)(0), // 38: bytebase.v1.Engine
+ (*timestamppb.Timestamp)(nil), // 39: google.protobuf.Timestamp
}
var file_v1_sql_service_proto_depIdxs = []int32{
- 10, // 0: bytebase.v1.AdminExecuteResponse.results:type_name -> bytebase.v1.QueryResult
- 9, // 1: bytebase.v1.QueryRequest.query_option:type_name -> bytebase.v1.QueryOption
- 10, // 2: bytebase.v1.QueryResponse.results:type_name -> bytebase.v1.QueryResult
+ 9, // 0: bytebase.v1.AdminExecuteResponse.results:type_name -> bytebase.v1.QueryResult
+ 8, // 1: bytebase.v1.QueryRequest.query_option:type_name -> bytebase.v1.QueryOption
+ 9, // 2: bytebase.v1.QueryResponse.results:type_name -> bytebase.v1.QueryResult
0, // 3: bytebase.v1.QueryOption.redis_run_commands_on:type_name -> bytebase.v1.QueryOption.RedisRunCommandsOn
- 12, // 4: bytebase.v1.QueryResult.rows:type_name -> bytebase.v1.QueryRow
- 34, // 5: bytebase.v1.QueryResult.latency:type_name -> google.protobuf.Duration
- 26, // 6: bytebase.v1.QueryResult.postgres_error:type_name -> bytebase.v1.QueryResult.PostgresError
- 27, // 7: bytebase.v1.QueryResult.messages:type_name -> bytebase.v1.QueryResult.Message
- 11, // 8: bytebase.v1.QueryResult.masked:type_name -> bytebase.v1.MaskingReason
- 13, // 9: bytebase.v1.QueryRow.values:type_name -> bytebase.v1.RowValue
- 35, // 10: bytebase.v1.RowValue.null_value:type_name -> google.protobuf.NullValue
- 36, // 11: bytebase.v1.RowValue.value_value:type_name -> google.protobuf.Value
- 28, // 12: bytebase.v1.RowValue.timestamp_value:type_name -> bytebase.v1.RowValue.Timestamp
- 29, // 13: bytebase.v1.RowValue.timestamp_tz_value:type_name -> bytebase.v1.RowValue.TimestampTZ
+ 11, // 4: bytebase.v1.QueryResult.rows:type_name -> bytebase.v1.QueryRow
+ 31, // 5: bytebase.v1.QueryResult.latency:type_name -> google.protobuf.Duration
+ 23, // 6: bytebase.v1.QueryResult.postgres_error:type_name -> bytebase.v1.QueryResult.PostgresError
+ 24, // 7: bytebase.v1.QueryResult.messages:type_name -> bytebase.v1.QueryResult.Message
+ 10, // 8: bytebase.v1.QueryResult.masked:type_name -> bytebase.v1.MaskingReason
+ 12, // 9: bytebase.v1.QueryRow.values:type_name -> bytebase.v1.RowValue
+ 32, // 10: bytebase.v1.RowValue.null_value:type_name -> google.protobuf.NullValue
+ 33, // 11: bytebase.v1.RowValue.value_value:type_name -> google.protobuf.Value
+ 25, // 12: bytebase.v1.RowValue.timestamp_value:type_name -> bytebase.v1.RowValue.Timestamp
+ 26, // 13: bytebase.v1.RowValue.timestamp_tz_value:type_name -> bytebase.v1.RowValue.TimestampTZ
2, // 14: bytebase.v1.Advice.status:type_name -> bytebase.v1.Advice.Level
- 37, // 15: bytebase.v1.Advice.start_position:type_name -> bytebase.v1.Position
- 37, // 16: bytebase.v1.Advice.end_position:type_name -> bytebase.v1.Position
- 38, // 17: bytebase.v1.ExportRequest.format:type_name -> bytebase.v1.ExportFormat
- 3, // 18: bytebase.v1.CheckRequest.change_type:type_name -> bytebase.v1.CheckRequest.ChangeType
- 14, // 19: bytebase.v1.CheckResponse.advices:type_name -> bytebase.v1.Advice
- 39, // 20: bytebase.v1.DiffMetadataRequest.source_metadata:type_name -> bytebase.v1.DatabaseMetadata
- 39, // 21: bytebase.v1.DiffMetadataRequest.target_metadata:type_name -> bytebase.v1.DatabaseMetadata
- 40, // 22: bytebase.v1.DiffMetadataRequest.source_catalog:type_name -> bytebase.v1.DatabaseCatalog
- 40, // 23: bytebase.v1.DiffMetadataRequest.target_catalog:type_name -> bytebase.v1.DatabaseCatalog
- 41, // 24: bytebase.v1.DiffMetadataRequest.engine:type_name -> bytebase.v1.Engine
- 23, // 25: bytebase.v1.SearchQueryHistoriesResponse.query_histories:type_name -> bytebase.v1.QueryHistory
- 42, // 26: bytebase.v1.QueryHistory.create_time:type_name -> google.protobuf.Timestamp
- 34, // 27: bytebase.v1.QueryHistory.duration:type_name -> google.protobuf.Duration
- 4, // 28: bytebase.v1.QueryHistory.type:type_name -> bytebase.v1.QueryHistory.Type
- 30, // 29: bytebase.v1.AICompletionRequest.messages:type_name -> bytebase.v1.AICompletionRequest.Message
- 31, // 30: bytebase.v1.AICompletionResponse.candidates:type_name -> bytebase.v1.AICompletionResponse.Candidate
- 1, // 31: bytebase.v1.QueryResult.Message.level:type_name -> bytebase.v1.QueryResult.Message.Level
- 42, // 32: bytebase.v1.RowValue.Timestamp.google_timestamp:type_name -> google.protobuf.Timestamp
- 42, // 33: bytebase.v1.RowValue.TimestampTZ.google_timestamp:type_name -> google.protobuf.Timestamp
- 32, // 34: bytebase.v1.AICompletionResponse.Candidate.content:type_name -> bytebase.v1.AICompletionResponse.Candidate.Content
- 33, // 35: bytebase.v1.AICompletionResponse.Candidate.Content.parts:type_name -> bytebase.v1.AICompletionResponse.Candidate.Content.Part
- 7, // 36: bytebase.v1.SQLService.Query:input_type -> bytebase.v1.QueryRequest
- 5, // 37: bytebase.v1.SQLService.AdminExecute:input_type -> bytebase.v1.AdminExecuteRequest
- 21, // 38: bytebase.v1.SQLService.SearchQueryHistories:input_type -> bytebase.v1.SearchQueryHistoriesRequest
- 15, // 39: bytebase.v1.SQLService.Export:input_type -> bytebase.v1.ExportRequest
- 17, // 40: bytebase.v1.SQLService.Check:input_type -> bytebase.v1.CheckRequest
- 19, // 41: bytebase.v1.SQLService.DiffMetadata:input_type -> bytebase.v1.DiffMetadataRequest
- 24, // 42: bytebase.v1.SQLService.AICompletion:input_type -> bytebase.v1.AICompletionRequest
- 8, // 43: bytebase.v1.SQLService.Query:output_type -> bytebase.v1.QueryResponse
- 6, // 44: bytebase.v1.SQLService.AdminExecute:output_type -> bytebase.v1.AdminExecuteResponse
- 22, // 45: bytebase.v1.SQLService.SearchQueryHistories:output_type -> bytebase.v1.SearchQueryHistoriesResponse
- 16, // 46: bytebase.v1.SQLService.Export:output_type -> bytebase.v1.ExportResponse
- 18, // 47: bytebase.v1.SQLService.Check:output_type -> bytebase.v1.CheckResponse
- 20, // 48: bytebase.v1.SQLService.DiffMetadata:output_type -> bytebase.v1.DiffMetadataResponse
- 25, // 49: bytebase.v1.SQLService.AICompletion:output_type -> bytebase.v1.AICompletionResponse
- 43, // [43:50] is the sub-list for method output_type
- 36, // [36:43] is the sub-list for method input_type
- 36, // [36:36] is the sub-list for extension type_name
- 36, // [36:36] is the sub-list for extension extendee
- 0, // [0:36] is the sub-list for field type_name
+ 34, // 15: bytebase.v1.Advice.start_position:type_name -> bytebase.v1.Position
+ 34, // 16: bytebase.v1.Advice.end_position:type_name -> bytebase.v1.Position
+ 35, // 17: bytebase.v1.ExportRequest.format:type_name -> bytebase.v1.ExportFormat
+ 36, // 18: bytebase.v1.DiffMetadataRequest.source_metadata:type_name -> bytebase.v1.DatabaseMetadata
+ 36, // 19: bytebase.v1.DiffMetadataRequest.target_metadata:type_name -> bytebase.v1.DatabaseMetadata
+ 37, // 20: bytebase.v1.DiffMetadataRequest.source_catalog:type_name -> bytebase.v1.DatabaseCatalog
+ 37, // 21: bytebase.v1.DiffMetadataRequest.target_catalog:type_name -> bytebase.v1.DatabaseCatalog
+ 38, // 22: bytebase.v1.DiffMetadataRequest.engine:type_name -> bytebase.v1.Engine
+ 20, // 23: bytebase.v1.SearchQueryHistoriesResponse.query_histories:type_name -> bytebase.v1.QueryHistory
+ 39, // 24: bytebase.v1.QueryHistory.create_time:type_name -> google.protobuf.Timestamp
+ 31, // 25: bytebase.v1.QueryHistory.duration:type_name -> google.protobuf.Duration
+ 3, // 26: bytebase.v1.QueryHistory.type:type_name -> bytebase.v1.QueryHistory.Type
+ 27, // 27: bytebase.v1.AICompletionRequest.messages:type_name -> bytebase.v1.AICompletionRequest.Message
+ 28, // 28: bytebase.v1.AICompletionResponse.candidates:type_name -> bytebase.v1.AICompletionResponse.Candidate
+ 1, // 29: bytebase.v1.QueryResult.Message.level:type_name -> bytebase.v1.QueryResult.Message.Level
+ 39, // 30: bytebase.v1.RowValue.Timestamp.google_timestamp:type_name -> google.protobuf.Timestamp
+ 39, // 31: bytebase.v1.RowValue.TimestampTZ.google_timestamp:type_name -> google.protobuf.Timestamp
+ 29, // 32: bytebase.v1.AICompletionResponse.Candidate.content:type_name -> bytebase.v1.AICompletionResponse.Candidate.Content
+ 30, // 33: bytebase.v1.AICompletionResponse.Candidate.Content.parts:type_name -> bytebase.v1.AICompletionResponse.Candidate.Content.Part
+ 6, // 34: bytebase.v1.SQLService.Query:input_type -> bytebase.v1.QueryRequest
+ 4, // 35: bytebase.v1.SQLService.AdminExecute:input_type -> bytebase.v1.AdminExecuteRequest
+ 18, // 36: bytebase.v1.SQLService.SearchQueryHistories:input_type -> bytebase.v1.SearchQueryHistoriesRequest
+ 14, // 37: bytebase.v1.SQLService.Export:input_type -> bytebase.v1.ExportRequest
+ 16, // 38: bytebase.v1.SQLService.DiffMetadata:input_type -> bytebase.v1.DiffMetadataRequest
+ 21, // 39: bytebase.v1.SQLService.AICompletion:input_type -> bytebase.v1.AICompletionRequest
+ 7, // 40: bytebase.v1.SQLService.Query:output_type -> bytebase.v1.QueryResponse
+ 5, // 41: bytebase.v1.SQLService.AdminExecute:output_type -> bytebase.v1.AdminExecuteResponse
+ 19, // 42: bytebase.v1.SQLService.SearchQueryHistories:output_type -> bytebase.v1.SearchQueryHistoriesResponse
+ 15, // 43: bytebase.v1.SQLService.Export:output_type -> bytebase.v1.ExportResponse
+ 17, // 44: bytebase.v1.SQLService.DiffMetadata:output_type -> bytebase.v1.DiffMetadataResponse
+ 22, // 45: bytebase.v1.SQLService.AICompletion:output_type -> bytebase.v1.AICompletionResponse
+ 40, // [40:46] is the sub-list for method output_type
+ 34, // [34:40] is the sub-list for method input_type
+ 34, // [34:34] is the sub-list for extension type_name
+ 34, // [34:34] is the sub-list for extension extendee
+ 0, // [0:34] is the sub-list for field type_name
}
func init() { file_v1_sql_service_proto_init() }
@@ -2956,14 +2761,14 @@ func file_v1_sql_service_proto_init() {
(*RowValue_TimestampTzValue)(nil),
}
file_v1_sql_service_proto_msgTypes[10].OneofWrappers = []any{}
- file_v1_sql_service_proto_msgTypes[18].OneofWrappers = []any{}
+ file_v1_sql_service_proto_msgTypes[16].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_sql_service_proto_rawDesc), len(file_v1_sql_service_proto_rawDesc)),
- NumEnums: 5,
- NumMessages: 29,
+ NumEnums: 4,
+ NumMessages: 27,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/backend/generated-go/v1/sql_service.pb.gw.go b/backend/generated-go/v1/sql_service.pb.gw.go
index 678d72b237..0082160e4d 100644
--- a/backend/generated-go/v1/sql_service.pb.gw.go
+++ b/backend/generated-go/v1/sql_service.pb.gw.go
@@ -285,33 +285,6 @@ func local_request_SQLService_Export_2(ctx context.Context, marshaler runtime.Ma
return msg, metadata, err
}
-func request_SQLService_Check_0(ctx context.Context, marshaler runtime.Marshaler, client SQLServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq CheckRequest
- metadata runtime.ServerMetadata
- )
- if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if req.Body != nil {
- _, _ = io.Copy(io.Discard, req.Body)
- }
- msg, err := client.Check(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-}
-
-func local_request_SQLService_Check_0(ctx context.Context, marshaler runtime.Marshaler, server SQLServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var (
- protoReq CheckRequest
- metadata runtime.ServerMetadata
- )
- if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- msg, err := server.Check(ctx, &protoReq)
- return msg, metadata, err
-}
-
func request_SQLService_DiffMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client SQLServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq DiffMetadataRequest
@@ -479,26 +452,6 @@ func RegisterSQLServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux,
}
forward_SQLService_Export_2(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodPost, pattern_SQLService_Check_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
- ctx, cancel := context.WithCancel(req.Context())
- defer cancel()
- var stream runtime.ServerTransportStream
- ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
- inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.SQLService/Check", runtime.WithHTTPPathPattern("/v1/sql/check"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_SQLService_Check_0(annotatedContext, inboundMarshaler, server, req, pathParams)
- md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_SQLService_Check_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
mux.Handle(http.MethodPost, pattern_SQLService_DiffMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -681,23 +634,6 @@ func RegisterSQLServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux,
}
forward_SQLService_Export_2(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodPost, pattern_SQLService_Check_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
- ctx, cancel := context.WithCancel(req.Context())
- defer cancel()
- inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.SQLService/Check", runtime.WithHTTPPathPattern("/v1/sql/check"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_SQLService_Check_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
- forward_SQLService_Check_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
- })
mux.Handle(http.MethodPost, pattern_SQLService_DiffMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -742,7 +678,6 @@ var (
pattern_SQLService_Export_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "instances", "databases", "name"}, "export"))
pattern_SQLService_Export_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "rollouts", "name"}, "export"))
pattern_SQLService_Export_2 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "projects", "rollouts", "stages", "name"}, "export"))
- pattern_SQLService_Check_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "sql", "check"}, ""))
pattern_SQLService_DiffMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "schemaDesign"}, "diffMetadata"))
pattern_SQLService_AICompletion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "sql", "aiCompletion"}, ""))
)
@@ -754,7 +689,6 @@ var (
forward_SQLService_Export_0 = runtime.ForwardResponseMessage
forward_SQLService_Export_1 = runtime.ForwardResponseMessage
forward_SQLService_Export_2 = runtime.ForwardResponseMessage
- forward_SQLService_Check_0 = runtime.ForwardResponseMessage
forward_SQLService_DiffMetadata_0 = runtime.ForwardResponseMessage
forward_SQLService_AICompletion_0 = runtime.ForwardResponseMessage
)
diff --git a/backend/generated-go/v1/sql_service_equal.pb.go b/backend/generated-go/v1/sql_service_equal.pb.go
index 59a2dd45bb..2b6b45d5d6 100644
--- a/backend/generated-go/v1/sql_service_equal.pb.go
+++ b/backend/generated-go/v1/sql_service_equal.pb.go
@@ -475,46 +475,6 @@ func (x *ExportResponse) Equal(y *ExportResponse) bool {
return true
}
-func (x *CheckRequest) Equal(y *CheckRequest) bool {
- if x == y {
- return true
- }
- if x == nil || y == nil {
- return x == nil && y == nil
- }
- if x.Name != y.Name {
- return false
- }
- if x.Statement != y.Statement {
- return false
- }
- if x.ChangeType != y.ChangeType {
- return false
- }
- return true
-}
-
-func (x *CheckResponse) Equal(y *CheckResponse) bool {
- if x == y {
- return true
- }
- if x == nil || y == nil {
- return x == nil && y == nil
- }
- if len(x.Advices) != len(y.Advices) {
- return false
- }
- for i := 0; i < len(x.Advices); i++ {
- if !x.Advices[i].Equal(y.Advices[i]) {
- return false
- }
- }
- if x.AffectedRows != y.AffectedRows {
- return false
- }
- return true
-}
-
func (x *DiffMetadataRequest) Equal(y *DiffMetadataRequest) bool {
if x == y {
return true
diff --git a/backend/generated-go/v1/sql_service_grpc.pb.go b/backend/generated-go/v1/sql_service_grpc.pb.go
index ed616d6b43..47d7239571 100644
--- a/backend/generated-go/v1/sql_service_grpc.pb.go
+++ b/backend/generated-go/v1/sql_service_grpc.pb.go
@@ -23,7 +23,6 @@ const (
SQLService_AdminExecute_FullMethodName = "/bytebase.v1.SQLService/AdminExecute"
SQLService_SearchQueryHistories_FullMethodName = "/bytebase.v1.SQLService/SearchQueryHistories"
SQLService_Export_FullMethodName = "/bytebase.v1.SQLService/Export"
- SQLService_Check_FullMethodName = "/bytebase.v1.SQLService/Check"
SQLService_DiffMetadata_FullMethodName = "/bytebase.v1.SQLService/DiffMetadata"
SQLService_AICompletion_FullMethodName = "/bytebase.v1.SQLService/AICompletion"
)
@@ -46,9 +45,6 @@ type SQLServiceClient interface {
// Exports query results to a file format.
// Permissions required: bb.databases.get
Export(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (*ExportResponse, error)
- // Validates SQL statements against review rules.
- // Permissions required: bb.databases.check
- Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
// Computes schema differences between two database metadata.
// Permissions required: None
DiffMetadata(ctx context.Context, in *DiffMetadataRequest, opts ...grpc.CallOption) (*DiffMetadataResponse, error)
@@ -108,16 +104,6 @@ func (c *sQLServiceClient) Export(ctx context.Context, in *ExportRequest, opts .
return out, nil
}
-func (c *sQLServiceClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(CheckResponse)
- err := c.cc.Invoke(ctx, SQLService_Check_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
func (c *sQLServiceClient) DiffMetadata(ctx context.Context, in *DiffMetadataRequest, opts ...grpc.CallOption) (*DiffMetadataResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DiffMetadataResponse)
@@ -156,9 +142,6 @@ type SQLServiceServer interface {
// Exports query results to a file format.
// Permissions required: bb.databases.get
Export(context.Context, *ExportRequest) (*ExportResponse, error)
- // Validates SQL statements against review rules.
- // Permissions required: bb.databases.check
- Check(context.Context, *CheckRequest) (*CheckResponse, error)
// Computes schema differences between two database metadata.
// Permissions required: None
DiffMetadata(context.Context, *DiffMetadataRequest) (*DiffMetadataResponse, error)
@@ -187,9 +170,6 @@ func (UnimplementedSQLServiceServer) SearchQueryHistories(context.Context, *Sear
func (UnimplementedSQLServiceServer) Export(context.Context, *ExportRequest) (*ExportResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Export not implemented")
}
-func (UnimplementedSQLServiceServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Check not implemented")
-}
func (UnimplementedSQLServiceServer) DiffMetadata(context.Context, *DiffMetadataRequest) (*DiffMetadataResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DiffMetadata not implemented")
}
@@ -278,24 +258,6 @@ func _SQLService_Export_Handler(srv interface{}, ctx context.Context, dec func(i
return interceptor(ctx, in, info, handler)
}
-func _SQLService_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CheckRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(SQLServiceServer).Check(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: SQLService_Check_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(SQLServiceServer).Check(ctx, req.(*CheckRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
func _SQLService_DiffMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DiffMetadataRequest)
if err := dec(in); err != nil {
@@ -351,10 +313,6 @@ var SQLService_ServiceDesc = grpc.ServiceDesc{
MethodName: "Export",
Handler: _SQLService_Export_Handler,
},
- {
- MethodName: "Check",
- Handler: _SQLService_Check_Handler,
- },
{
MethodName: "DiffMetadata",
Handler: _SQLService_DiffMetadata_Handler,
diff --git a/backend/generated-go/v1/v1connect/sql_service.connect.go b/backend/generated-go/v1/v1connect/sql_service.connect.go
index 8f9978bd62..bc87b14e2d 100644
--- a/backend/generated-go/v1/v1connect/sql_service.connect.go
+++ b/backend/generated-go/v1/v1connect/sql_service.connect.go
@@ -42,8 +42,6 @@ const (
SQLServiceSearchQueryHistoriesProcedure = "/bytebase.v1.SQLService/SearchQueryHistories"
// SQLServiceExportProcedure is the fully-qualified name of the SQLService's Export RPC.
SQLServiceExportProcedure = "/bytebase.v1.SQLService/Export"
- // SQLServiceCheckProcedure is the fully-qualified name of the SQLService's Check RPC.
- SQLServiceCheckProcedure = "/bytebase.v1.SQLService/Check"
// SQLServiceDiffMetadataProcedure is the fully-qualified name of the SQLService's DiffMetadata RPC.
SQLServiceDiffMetadataProcedure = "/bytebase.v1.SQLService/DiffMetadata"
// SQLServiceAICompletionProcedure is the fully-qualified name of the SQLService's AICompletion RPC.
@@ -64,9 +62,6 @@ type SQLServiceClient interface {
// Exports query results to a file format.
// Permissions required: bb.databases.get
Export(context.Context, *connect.Request[v1.ExportRequest]) (*connect.Response[v1.ExportResponse], error)
- // Validates SQL statements against review rules.
- // Permissions required: bb.databases.check
- Check(context.Context, *connect.Request[v1.CheckRequest]) (*connect.Response[v1.CheckResponse], error)
// Computes schema differences between two database metadata.
// Permissions required: None
DiffMetadata(context.Context, *connect.Request[v1.DiffMetadataRequest]) (*connect.Response[v1.DiffMetadataResponse], error)
@@ -110,12 +105,6 @@ func NewSQLServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...
connect.WithSchema(sQLServiceMethods.ByName("Export")),
connect.WithClientOptions(opts...),
),
- check: connect.NewClient[v1.CheckRequest, v1.CheckResponse](
- httpClient,
- baseURL+SQLServiceCheckProcedure,
- connect.WithSchema(sQLServiceMethods.ByName("Check")),
- connect.WithClientOptions(opts...),
- ),
diffMetadata: connect.NewClient[v1.DiffMetadataRequest, v1.DiffMetadataResponse](
httpClient,
baseURL+SQLServiceDiffMetadataProcedure,
@@ -137,7 +126,6 @@ type sQLServiceClient struct {
adminExecute *connect.Client[v1.AdminExecuteRequest, v1.AdminExecuteResponse]
searchQueryHistories *connect.Client[v1.SearchQueryHistoriesRequest, v1.SearchQueryHistoriesResponse]
export *connect.Client[v1.ExportRequest, v1.ExportResponse]
- check *connect.Client[v1.CheckRequest, v1.CheckResponse]
diffMetadata *connect.Client[v1.DiffMetadataRequest, v1.DiffMetadataResponse]
aICompletion *connect.Client[v1.AICompletionRequest, v1.AICompletionResponse]
}
@@ -162,11 +150,6 @@ func (c *sQLServiceClient) Export(ctx context.Context, req *connect.Request[v1.E
return c.export.CallUnary(ctx, req)
}
-// Check calls bytebase.v1.SQLService.Check.
-func (c *sQLServiceClient) Check(ctx context.Context, req *connect.Request[v1.CheckRequest]) (*connect.Response[v1.CheckResponse], error) {
- return c.check.CallUnary(ctx, req)
-}
-
// DiffMetadata calls bytebase.v1.SQLService.DiffMetadata.
func (c *sQLServiceClient) DiffMetadata(ctx context.Context, req *connect.Request[v1.DiffMetadataRequest]) (*connect.Response[v1.DiffMetadataResponse], error) {
return c.diffMetadata.CallUnary(ctx, req)
@@ -191,9 +174,6 @@ type SQLServiceHandler interface {
// Exports query results to a file format.
// Permissions required: bb.databases.get
Export(context.Context, *connect.Request[v1.ExportRequest]) (*connect.Response[v1.ExportResponse], error)
- // Validates SQL statements against review rules.
- // Permissions required: bb.databases.check
- Check(context.Context, *connect.Request[v1.CheckRequest]) (*connect.Response[v1.CheckResponse], error)
// Computes schema differences between two database metadata.
// Permissions required: None
DiffMetadata(context.Context, *connect.Request[v1.DiffMetadataRequest]) (*connect.Response[v1.DiffMetadataResponse], error)
@@ -233,12 +213,6 @@ func NewSQLServiceHandler(svc SQLServiceHandler, opts ...connect.HandlerOption)
connect.WithSchema(sQLServiceMethods.ByName("Export")),
connect.WithHandlerOptions(opts...),
)
- sQLServiceCheckHandler := connect.NewUnaryHandler(
- SQLServiceCheckProcedure,
- svc.Check,
- connect.WithSchema(sQLServiceMethods.ByName("Check")),
- connect.WithHandlerOptions(opts...),
- )
sQLServiceDiffMetadataHandler := connect.NewUnaryHandler(
SQLServiceDiffMetadataProcedure,
svc.DiffMetadata,
@@ -261,8 +235,6 @@ func NewSQLServiceHandler(svc SQLServiceHandler, opts ...connect.HandlerOption)
sQLServiceSearchQueryHistoriesHandler.ServeHTTP(w, r)
case SQLServiceExportProcedure:
sQLServiceExportHandler.ServeHTTP(w, r)
- case SQLServiceCheckProcedure:
- sQLServiceCheckHandler.ServeHTTP(w, r)
case SQLServiceDiffMetadataProcedure:
sQLServiceDiffMetadataHandler.ServeHTTP(w, r)
case SQLServiceAICompletionProcedure:
@@ -292,10 +264,6 @@ func (UnimplementedSQLServiceHandler) Export(context.Context, *connect.Request[v
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.SQLService.Export is not implemented"))
}
-func (UnimplementedSQLServiceHandler) Check(context.Context, *connect.Request[v1.CheckRequest]) (*connect.Response[v1.CheckResponse], error) {
- return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.SQLService.Check is not implemented"))
-}
-
func (UnimplementedSQLServiceHandler) DiffMetadata(context.Context, *connect.Request[v1.DiffMetadataRequest]) (*connect.Response[v1.DiffMetadataResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.SQLService.DiffMetadata is not implemented"))
}
diff --git a/backend/plugin/advisor/change_type.go b/backend/plugin/advisor/change_type.go
deleted file mode 100644
index e33f2c3ef0..0000000000
--- a/backend/plugin/advisor/change_type.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package advisor
-
-import storepb "github.com/bytebase/bytebase/backend/generated-go/store"
-
-var sqlEditorAllowlist = map[SQLReviewRuleType]bool{
- SchemaRuleStatementRequireWhereForSelect: true,
-}
-
-func isRuleAllowed(rule SQLReviewRuleType, changeType storepb.PlanCheckRunConfig_ChangeDatabaseType) bool {
- if changeType == storepb.PlanCheckRunConfig_SQL_EDITOR {
- return sqlEditorAllowlist[rule]
- }
- return true
-}
diff --git a/backend/plugin/advisor/sql_review.go b/backend/plugin/advisor/sql_review.go
index f0e95fea0c..4a9b301ed0 100644
--- a/backend/plugin/advisor/sql_review.go
+++ b/backend/plugin/advisor/sql_review.go
@@ -554,9 +554,6 @@ func SQLReviewCheck(
}
ruleType := SQLReviewRuleType(rule.Type)
- if !isRuleAllowed(ruleType, checkContext.ChangeType) {
- continue
- }
adviceList, err := Check(
ctx,
diff --git a/backend/runner/plancheck/statement_advise_executor.go b/backend/runner/plancheck/statement_advise_executor.go
index 6faa4165d8..571f51775a 100644
--- a/backend/runner/plancheck/statement_advise_executor.go
+++ b/backend/runner/plancheck/statement_advise_executor.go
@@ -154,12 +154,9 @@ func (e *StatementAdviseExecutor) runReview(
return nil, common.Wrapf(err, common.Internal, "failed to create a catalog")
}
- useDatabaseOwner := false
- if changeType != storepb.PlanCheckRunConfig_SQL_EDITOR {
- useDatabaseOwner, err = getUseDatabaseOwner(ctx, e.store, instance, database)
- if err != nil {
- return nil, common.Wrapf(err, common.Internal, "failed to get use database owner")
- }
+ useDatabaseOwner, err := getUseDatabaseOwner(ctx, e.store, instance, database)
+ if err != nil {
+ return nil, common.Wrapf(err, common.Internal, "failed to get use database owner")
}
driver, err := e.dbFactory.GetAdminDatabaseDriver(ctx, instance, database, db.ConnectionContext{UseDatabaseOwner: useDatabaseOwner})
if err != nil {
diff --git a/frontend/src/composables/useExecuteSQL.ts b/frontend/src/composables/useExecuteSQL.ts
index 4f0ad140b5..cc5744b363 100644
--- a/frontend/src/composables/useExecuteSQL.ts
+++ b/frontend/src/composables/useExecuteSQL.ts
@@ -1,13 +1,8 @@
import { create } from "@bufbuild/protobuf";
import { Code } from "@connectrpc/connect";
-import { createContextValues } from "@connectrpc/connect";
-import Emittery from "emittery";
-import { head, isEmpty, cloneDeep } from "lodash-es";
+import { isEmpty, cloneDeep } from "lodash-es";
import { v4 as uuidv4 } from "uuid";
import { markRaw, reactive } from "vue";
-import { STATEMENT_SKIP_CHECK_THRESHOLD } from "@/components/SQLCheck/common";
-import { sqlServiceClientConnect } from "@/grpcweb";
-import { ignoredCodesContextKey } from "@/grpcweb/context-key";
import { t } from "@/plugins/i18n";
import {
pushNotification,
@@ -16,7 +11,6 @@ import {
useSQLEditorTabStore,
useSQLStore,
useSQLEditorQueryHistoryStore,
- useAppFeature,
hasFeature,
batchGetOrFetchDatabases,
useDatabaseV1Store,
@@ -27,7 +21,6 @@ import type {
BBNotificationStyle,
SQLEditorQueryParams,
SQLEditorConnection,
- SQLEditorTab,
QueryContextStatus,
SQLEditorDatabaseQueryContext,
QueryDataSourceType,
@@ -36,13 +29,7 @@ import { isValidDatabaseName } from "@/types";
import { Engine } from "@/types/proto-es/v1/common_pb";
import { DatabaseGroupView } from "@/types/proto-es/v1/database_group_service_pb";
import {
- CheckRequestSchema,
- CheckRequest_ChangeType as NewCheckRequest_ChangeType,
QueryRequestSchema,
-} from "@/types/proto-es/v1/sql_service_pb";
-import type { Advice } from "@/types/proto-es/v1/sql_service_pb";
-import {
- Advice_Level,
QueryOptionSchema,
} from "@/types/proto-es/v1/sql_service_pb";
import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
@@ -50,22 +37,11 @@ import {
getValidDataSourceByPolicy,
hasPermissionToCreateChangeDatabaseIssue,
} from "@/utils";
-import { extractGrpcErrorMessage } from "@/utils/grpcweb";
import { flattenNoSQLResult } from "./utils";
// QUERY_INTERVAL_LIMIT is the minimal gap between two queries
const QUERY_INTERVAL_LIMIT = 1000;
-const events = new Emittery<{
- "update:advices": {
- tab: SQLEditorTab;
- params: SQLEditorQueryParams;
- advices: Advice[];
- };
-}>();
-
-type SQLCheckResult = { passed: boolean; advices?: Advice[] };
-
const useExecuteSQL = () => {
const state = reactive<{
lastQueryTime?: number;
@@ -75,7 +51,6 @@ const useExecuteSQL = () => {
const tabStore = useSQLEditorTabStore();
const sqlEditorStore = useSQLEditorStore();
const queryHistoryStore = useSQLEditorQueryHistoryStore();
- const sqlCheckStyle = useAppFeature("bb.feature.sql-editor.sql-check-style");
const notify = (
type: BBNotificationStyle,
@@ -114,69 +89,6 @@ const useExecuteSQL = () => {
return true;
};
- const check = async (
- abortController: AbortController,
- params: SQLEditorQueryParams
- ): Promise<SQLCheckResult> => {
- const tab = tabStore.currentTab;
- if (!tab) {
- return { passed: false };
- }
-
- if (!params) {
- return { passed: false };
- }
- if (new Blob([params.statement]).size > STATEMENT_SKIP_CHECK_THRESHOLD) {
- return { passed: true };
- }
- const request = create(CheckRequestSchema, {
- name: params.connection.database,
- statement: params.statement,
- changeType: NewCheckRequest_ChangeType.SQL_EDITOR,
- });
- const response = await sqlServiceClientConnect.check(request, {
- contextValues: createContextValues().set(ignoredCodesContextKey, [
- Code.PermissionDenied,
- ]),
- signal: abortController?.signal,
- });
- const advices = response.advices;
- events.emit("update:advices", { tab, params, advices });
- return { passed: advices.length === 0, advices };
- };
-
- const notifyAdvices = (advices: Advice[]) => {
- let adviceStatus: "SUCCESS" | "ERROR" | "WARNING" = "SUCCESS";
- let adviceNotifyMessage = "";
- for (const advice of advices) {
- if (advice.status === Advice_Level.SUCCESS) {
- continue;
- }
-
- if (advice.status === Advice_Level.ERROR) {
- adviceStatus = "ERROR";
- } else if (adviceStatus !== "ERROR") {
- adviceStatus = "WARNING";
- }
-
- adviceNotifyMessage += `${Advice_Level[advice.status]}: ${
- advice.title
- }\n`;
- if (advice.content) {
- adviceNotifyMessage += `${advice.content}\n`;
- }
- }
-
- if (adviceStatus !== "SUCCESS") {
- const notifyStyle = adviceStatus === "ERROR" ? "CRITICAL" : "WARN";
- notify(
- notifyStyle,
- t("sql-editor.sql-review-result"),
- adviceNotifyMessage
- );
- }
- };
-
const getDataSourceId = (
database: ComposedDatabase,
connection: SQLEditorConnection,
@@ -349,58 +261,15 @@ const useExecuteSQL = () => {
changeContextStatus(context, "DONE");
};
- const abort = (error: string, advices: Advice[] = []) => {
- notify("WARN", t("sql-editor.request-cancelled"));
- return finish({
- error,
- results: [],
- advices,
- status: Code.Aborted,
- });
- };
-
const { abortController } = context;
if (!abortController) {
return;
}
const sqlStore = useSQLStore();
- const checkBehavior = context.params.skipCheck
- ? "SKIP"
- : sqlCheckStyle.value;
- let checkResult: SQLCheckResult = { passed: true };
- if (checkBehavior !== "SKIP") {
- try {
- checkResult = await check(abortController, context.params);
- } catch (error) {
- return abort(extractGrpcErrorMessage(error));
- }
- }
- if (checkBehavior === "PREFLIGHT" && !checkResult.passed) {
- return abort(
- head(checkResult.advices)?.content ?? "",
- checkResult.advices
- );
- }
- if (
- checkBehavior === "NOTIFICATION" &&
- !checkResult.passed &&
- checkResult.advices
- ) {
- const { advices } = checkResult;
- const errorAdvice = advices.find(
- (advice) => advice.status === Advice_Level.ERROR
- );
- if (errorAdvice) {
- notifyAdvices(advices);
- return abort(errorAdvice.content, advices);
- }
- }
-
const dataSourceId = context.params.connection.dataSourceId;
if (!dataSourceId) {
return finish({
- advices: [],
error: t("sql-editor.no-data-source"),
results: [],
status: Code.NotFound,
@@ -411,7 +280,6 @@ const useExecuteSQL = () => {
// Once any one of the batch queries is aborted, don't go further
// and mock an "Aborted" result for the rest queries.
return finish({
- advices: [],
error: t("sql-editor.request-aborted"),
results: [],
status: Code.Aborted,
@@ -458,10 +326,6 @@ const useExecuteSQL = () => {
flattenNoSQLResult(resultSet);
}
- if (checkBehavior === "NOTIFICATION") {
- notifyAdvices(checkResult.advices ?? []);
- }
-
if (resultSet.error) {
// The error message should be consistent with the one from the backend.
if (isOnlySelectError(resultSet)) {
@@ -483,7 +347,6 @@ const useExecuteSQL = () => {
};
return {
- events,
execute,
runQuery,
};
diff --git a/frontend/src/customAppProfile.ts b/frontend/src/customAppProfile.ts
index 4a9ff47412..add111d240 100644
--- a/frontend/src/customAppProfile.ts
+++ b/frontend/src/customAppProfile.ts
@@ -42,7 +42,6 @@ const overrideAppFeatures = (
"bb.feature.hide-quick-start": true,
"bb.feature.hide-help": true,
"bb.feature.hide-trial": true,
- "bb.feature.sql-editor.sql-check-style": "PREFLIGHT",
});
}
};
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 224ad37d8e..f16cb80dbe 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1994,7 +1994,6 @@
"notify-empty-statement": "Please input your SQL statements in the editor",
"can-not-execute-query": "Cannot execute query when loading data.",
"invalid-database": "Invalid database {database}",
- "request-cancelled": "Request cancelled",
"request-aborted": "User aborted the request",
"no-data-source": "No queriable data source. Please check the data source query policy on environment or project.",
"rows": "row | rows",
@@ -2024,7 +2023,6 @@
"save-sheet": "Save Sheet",
"save-sheet-input-placeholder": "Please input a sheet name",
"format": "Format",
- "sql-review-result": "SQL review result",
"visualize-explain": "Visualize Explain",
"rows-upper-limit": "reached the limit of query results",
"close-sheet": "Close sheet",
@@ -2119,7 +2117,6 @@
"manage-connections": "Manage connections",
"view-detail": "View detail",
"generate-sql": "Generate SQL",
- "run-anyway": "Run anyway",
"no-project": {
"not-member-of-any-projects": "You are not any member of any projects.",
"go-to-create": "Go to create",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index b8f94f42ea..d39e2b1ec7 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1994,7 +1994,6 @@
"notify-empty-statement": "Ingrese sus declaraciones SQL en el editor",
"can-not-execute-query": "No se puede ejecutar la consulta al cargar datos.",
"invalid-database": "Base de datos no válida {database}",
- "request-cancelled": "Solicitud cancelada",
"request-aborted": "El usuario abortó la solicitud",
"no-data-source": "No se puede consultar ninguna fuente de datos. Consulte la política de consulta de fuentes de datos del entorno o proyecto.",
"rows": "fila | filas",
@@ -2024,7 +2023,6 @@
"save-sheet": "Guardar hoja",
"save-sheet-input-placeholder": "Por favor, ingresa un nombre para la hoja",
"format": "Formato",
- "sql-review-result": "Resultado de la revisión SQL",
"visualize-explain": "Visualizar explicación",
"rows-upper-limit": "se ha alcanzado el límite de resultados de la consulta",
"close-sheet": "Cerrar hoja",
@@ -2119,7 +2117,6 @@
"manage-connections": "Gestionar las conexiones",
"view-detail": "Ver detalle",
"generate-sql": "Generar SQL",
- "run-anyway": "Corre de todos modos",
"no-project": {
"not-member-of-any-projects": "No eres miembro de ningún proyecto.",
"go-to-create": "ir a crear",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 8119f64602..8a8e45c9fb 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1994,7 +1994,6 @@
"notify-empty-statement": "エディターに SQL ステートメントを入力してください",
"can-not-execute-query": "データのロード中にクエリを実行できません",
"invalid-database": "無効なデータベース {database}",
- "request-cancelled": "リクエストはキャンセルされました",
"request-aborted": "ユーザーがリクエストを中止しました",
"no-data-source": "クエリ可能なデータソースがありません。環境またはプロジェクトのデータソースクエリポリシーを確認してください。",
"rows": "記録",
@@ -2024,7 +2023,6 @@
"save-sheet": "ワークシートの保存",
"save-sheet-input-placeholder": "ワークシート名を入力してください",
"format": "フォーマット",
- "sql-review-result": "SQLチェック結果",
"visualize-explain": "視覚化の説明",
"rows-upper-limit": "クエリ結果の数が上限に達しました",
"close-sheet": "ワークシートを閉じる",
@@ -2119,7 +2117,6 @@
"manage-connections": "接続を管理する",
"view-detail": "詳細を見る",
"generate-sql": "SQLの生成",
- "run-anyway": "とにかく走ってください",
"no-project": {
"not-member-of-any-projects": "あなたはどのプロジェクトのメンバーでもありません。",
"go-to-create": "作成に行く",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index d63609c77b..82c2d72fd7 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -1994,7 +1994,6 @@
"notify-empty-statement": "Vui lòng nhập câu lệnh SQL của bạn vào trình soạn thảo",
"can-not-execute-query": "Không thể thực hiện truy vấn khi đang tải dữ liệu.",
"invalid-database": "Cơ sở dữ liệu không hợp lệ {database}",
- "request-cancelled": "Yêu cầu đã bị hủy",
"request-aborted": "Người dùng đã hủy yêu cầu",
"no-data-source": "Không có nguồn dữ liệu có thể truy vấn. Vui lòng kiểm tra chính sách truy vấn nguồn dữ liệu trên môi trường hoặc dự án.",
"rows": "dòng | dòng",
@@ -2024,7 +2023,6 @@
"save-sheet": "Lưu trang tính",
"save-sheet-input-placeholder": "Vui lòng nhập tên trang tính",
"format": "Định dạng",
- "sql-review-result": "Kết quả đánh giá SQL",
"visualize-explain": "Trực quan hóa Giải thích",
"rows-upper-limit": "đã đạt đến giới hạn kết quả truy vấn",
"close-sheet": "Đóng trang tính",
@@ -2119,7 +2117,6 @@
"manage-connections": "Quản lý kết nối",
"view-detail": "Xem chi tiết",
"generate-sql": "Tạo SQL",
- "run-anyway": "Vẫn chạy",
"no-project": {
"not-member-of-any-projects": "Bạn không phải là thành viên của bất kỳ dự án nào.",
"go-to-create": "Đi tới tạo",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 635e7a77c8..372e400949 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1994,7 +1994,6 @@
"notify-empty-statement": "请在编辑器中输入 SQL 语句",
"can-not-execute-query": "加载数据时无法执行查询",
"invalid-database": "数据库 {database} 无效",
- "request-cancelled": "请求已取消",
"request-aborted": "用户中止了请求",
"no-data-source": "没有可查询的数据源。请检查环境或项目的数据源查询策略。",
"rows": "条记录",
@@ -2024,7 +2023,6 @@
"save-sheet": "保存工作表",
"save-sheet-input-placeholder": "请输入工作表名称",
"format": "格式化",
- "sql-review-result": "SQL 检查结果",
"visualize-explain": "可视化 Explain",
"rows-upper-limit": "到达查询结果条数上限",
"close-sheet": "关闭工作表",
@@ -2119,7 +2117,6 @@
"manage-connections": "管理连接",
"view-detail": "查看详情",
"generate-sql": "生成 SQL",
- "run-anyway": "仍要运行",
"no-project": {
"not-member-of-any-projects": "你不是任何项目的成员。",
"go-to-create": "去创建",
diff --git a/frontend/src/store/modules/sqlEditor/webTerminal.ts b/frontend/src/store/modules/sqlEditor/webTerminal.ts
index 52e724042a..a0583be4ee 100644
--- a/frontend/src/store/modules/sqlEditor/webTerminal.ts
+++ b/frontend/src/store/modules/sqlEditor/webTerminal.ts
@@ -196,7 +196,6 @@ const createStreamingQueryController = () => {
});
events.emit("result", {
error: "",
- advices: [],
...response,
});
},
@@ -206,7 +205,6 @@ const createStreamingQueryController = () => {
const result: SQLResultSetV1 = {
error: extractGrpcErrorMessage(error),
status: extractGrpcStatusCode(error),
- advices: [],
results: [],
};
if (result.status === Code.Aborted && !result.error) {
diff --git a/frontend/src/store/modules/v1/sql.ts b/frontend/src/store/modules/v1/sql.ts
index 458d62a08f..ba1e0823bc 100644
--- a/frontend/src/store/modules/v1/sql.ts
+++ b/frontend/src/store/modules/v1/sql.ts
@@ -1,4 +1,3 @@
-import { create as createProto } from "@bufbuild/protobuf";
import { Code, ConnectError, createContextValues } from "@connectrpc/connect";
import { defineStore } from "pinia";
import { sqlServiceClientConnect } from "@/grpcweb";
@@ -7,40 +6,12 @@ import {
ignoredCodesContextKey,
} from "@/grpcweb/context-key";
import type { SQLResultSetV1 } from "@/types";
-import { PlanCheckRun_ResultSchema } from "@/types/proto-es/v1/plan_service_pb";
import type {
ExportRequest,
QueryRequest,
} from "@/types/proto-es/v1/sql_service_pb";
-import {
- type Advice,
- AdviceSchema,
- Advice_Level,
-} from "@/types/proto-es/v1/sql_service_pb";
import { extractGrpcErrorMessage } from "@/utils/grpcweb";
-export const getSqlReviewReports = (err: unknown): Advice[] => {
- const advices: Advice[] = [];
- if (err instanceof ConnectError) {
- for (const report of err.findDetails(PlanCheckRun_ResultSchema)) {
- const startPosition =
- report.report.case === "sqlReviewReport"
- ? report.report.value.startPosition
- : undefined;
- advices.push(
- createProto(AdviceSchema, {
- status: Advice_Level.ERROR,
- code: report.code,
- title: report.title || "SQL Review Failed",
- content: report.content,
- startPosition: startPosition,
- })
- );
- }
- }
- return advices;
-};
-
export const useSQLStore = defineStore("sql", () => {
const query = async (
params: QueryRequest,
@@ -57,14 +28,12 @@ export const useSQLStore = defineStore("sql", () => {
});
return {
error: "",
- advices: [],
results: newResponse.results,
};
} catch (err) {
return {
error: extractGrpcErrorMessage(err),
results: [],
- advices: getSqlReviewReports(err),
status: err instanceof ConnectError ? err.code : Code.Unknown,
};
}
diff --git a/frontend/src/types/appProfile.ts b/frontend/src/types/appProfile.ts
index 6ad002f230..a26c3900df 100644
--- a/frontend/src/types/appProfile.ts
+++ b/frontend/src/types/appProfile.ts
@@ -8,7 +8,6 @@ export type AppFeatures = {
"bb.feature.hide-help": boolean;
"bb.feature.hide-quick-start": boolean;
"bb.feature.hide-trial": boolean;
- "bb.feature.sql-editor.sql-check-style": "PREFLIGHT" | "NOTIFICATION";
};
export type AppProfile = {
@@ -21,6 +20,5 @@ export const defaultAppProfile = (): AppProfile => ({
"bb.feature.hide-help": false,
"bb.feature.hide-quick-start": false,
"bb.feature.hide-trial": false,
- "bb.feature.sql-editor.sql-check-style": "NOTIFICATION",
},
});
diff --git a/frontend/src/types/proto-es/v1/sql_service_pb.d.ts b/frontend/src/types/proto-es/v1/sql_service_pb.d.ts
index 1a0121e533..102e0705e4 100644
--- a/frontend/src/types/proto-es/v1/sql_service_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/sql_service_pb.d.ts
@@ -919,93 +919,6 @@ export declare type ExportResponse = Message<"bytebase.v1.ExportResponse"> & {
*/
export declare const ExportResponseSchema: GenMessage<ExportResponse>;
-/**
- * @generated from message bytebase.v1.CheckRequest
- */
-export declare type CheckRequest = Message<"bytebase.v1.CheckRequest"> & {
- /**
- * The database name to check against.
- * Format: instances/{instance}/databases/{database}
- *
- * @generated from field: string name = 2;
- */
- name: string;
-
- /**
- * @generated from field: string statement = 1;
- */
- statement: string;
-
- /**
- * @generated from field: bytebase.v1.CheckRequest.ChangeType change_type = 4;
- */
- changeType: CheckRequest_ChangeType;
-};
-
-/**
- * Describes the message bytebase.v1.CheckRequest.
- * Use `create(CheckRequestSchema)` to create a new message.
- */
-export declare const CheckRequestSchema: GenMessage<CheckRequest>;
-
-/**
- * @generated from enum bytebase.v1.CheckRequest.ChangeType
- */
-export enum CheckRequest_ChangeType {
- /**
- * @generated from enum value: CHANGE_TYPE_UNSPECIFIED = 0;
- */
- CHANGE_TYPE_UNSPECIFIED = 0,
-
- /**
- * @generated from enum value: DDL = 1;
- */
- DDL = 1,
-
- /**
- * @generated from enum value: DDL_GHOST = 2;
- */
- DDL_GHOST = 2,
-
- /**
- * @generated from enum value: DML = 3;
- */
- DML = 3,
-
- /**
- * @generated from enum value: SQL_EDITOR = 4;
- */
- SQL_EDITOR = 4,
-}
-
-/**
- * Describes the enum bytebase.v1.CheckRequest.ChangeType.
- */
-export declare const CheckRequest_ChangeTypeSchema: GenEnum<CheckRequest_ChangeType>;
-
-/**
- * @generated from message bytebase.v1.CheckResponse
- */
-export declare type CheckResponse = Message<"bytebase.v1.CheckResponse"> & {
- /**
- * @generated from field: repeated bytebase.v1.Advice advices = 1;
- */
- advices: Advice[];
-
- /**
- * The count of affected rows of the statement on the target database.
- *
- * @generated from field: int64 affected_rows = 2;
- */
- affectedRows: bigint;
-};
-
-/**
- * Describes the message bytebase.v1.CheckResponse.
- * Use `create(CheckResponseSchema)` to create a new message.
- */
-export declare const CheckResponseSchema: GenMessage<CheckResponse>;
-
/**
* @generated from message bytebase.v1.DiffMetadataRequest
*/
@@ -1398,17 +1311,6 @@ export declare const SQLService: GenService<{
input: typeof ExportRequestSchema;
output: typeof ExportResponseSchema;
},
- /**
- * Validates SQL statements against review rules.
- * Permissions required: bb.databases.check
- *
- * @generated from rpc bytebase.v1.SQLService.Check
- */
- check: {
- methodKind: "unary";
- input: typeof CheckRequestSchema;
- output: typeof CheckResponseSchema;
- },
/**
* Computes schema differences between two database metadata.
* Permissions required: None
diff --git a/frontend/src/types/proto-es/v1/sql_service_pb.js b/frontend/src/types/proto-es/v1/sql_service_pb.js
index 06cb21b46e..840a233686 100644
--- a/frontend/src/types/proto-es/v1/sql_service_pb.js
+++ b/frontend/src/types/proto-es/v1/sql_service_pb.js
@@ -16,7 +16,7 @@ import { file_v1_database_service } from "./database_service_pb";
* Describes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YxLkNoZWNrUmVzcG9uc2UiMorqMBJiYi5kYXRhYmFzZXMuY2hlY2uQ6jABgtPkkwISOgEqIg0vdjEvc3FsL2NoZWNrEoEBCgxEaWZmTWV0YWRhdGESIC5ieXRlYmFzZS52MS5EaWZmTWV0YWRhdGFSZXF1ZXN0GiEuYnl0ZWJhc2UudjEuRGlmZk1ldGFkYXRhUmVzcG9uc2UiLIDqMAGC0+STAiI6ASoiHS92MS9zY2hlbWFEZXNpZ246ZGlmZk1ldGFkYXRhEngKDEFJQ29tcGxldGlvbhIgLmJ5dGViYXNlLnYxLkFJQ29tcGxldGlvblJlcXVlc3QaIS5ieXRlYmFzZS52MS5BSUNvbXBsZXRpb25SZXNwb25zZSIjkOowAoLT5JMCGToBKiIUL3YxL3NxbC9haUNvbXBsZXRpb25CNlo0Z2l0aHViLmNvbS9ieXRlYmFzZS9ieXRlYmFzZS9iYWNrZW5kL2dlbmVyYXRlZC1nby92MWIGcHJvdG8z", [file_google_api_annotations, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_struct, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_database_catalog_service, file_v1_database_service]);
+ fileDesc("ChR2MS9zcWxfc2VydmljZS5wcm90bxILYnl0ZWJhc2UudjEisAEKE0FkbWluRXhlY3V0ZVJlcXVlc3QSKwoEbmFtZRgBIAEoCUId4EEC+kEXChVieXRlYmFzZS5jb20vRGF0YWJhc2USEQoJc3RhdGVtZW50GAMgASgJEg0KBWxpbWl0GAQgASgFEhMKBnNjaGVtYRgGIAEoCUgAiAEBEhYKCWNvbnRhaW5lchgHIAEoCUgBiAEBQgkKB19zY2hlbWFCDAoKX2NvbnRhaW5lckoECAIQAyJBChRBZG1pbkV4ZWN1dGVSZXNwb25zZRIpCgdyZXN1bHRzGAEgAygLMhguYnl0ZWJhc2UudjEuUXVlcnlSZXN1bHQihwIKDFF1ZXJ5UmVxdWVzdBIrCgRuYW1lGAEgASgJQh3gQQL6QRcKF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jdHMvKi9yb2xsb3V0cy8qL3N0YWdlcy8qfTpleHBvcnQiKS92MS97bmFtZT1pbnN0YW5jZXMvKi9kYXRhYmFzZXMvKn06ZXhwb3J0EoEBCgxEaWZmTWV0YWRhdGESIC5ieXRlYmFzZS52MS5EaWZmTWV0YWRhdGFSZXF1ZXN0GiEuYnl0ZWJhc2UudjEuRGlmZk1ldGFkYXRhUmVzcG9uc2UiLIDqMAGC0+STAiI6ASoiHS92MS9zY2hlbWFEZXNpZ246ZGlmZk1ldGFkYXRhEngKDEFJQ29tcGxldGlvbhIgLmJ5dGViYXNlLnYxLkFJQ29tcGxldGlvblJlcXVlc3QaIS5ieXRlYmFzZS52MS5BSUNvbXBsZXRpb25SZXNwb25zZSIjkOowAoLT5JMCGToBKiIUL3YxL3NxbC9haUNvbXBsZXRpb25CNlo0Z2l0aHViLmNvbS9ieXRlYmFzZS9ieXRlYmFzZS9iYWNrZW5kL2dlbmVyYXRlZC1nby92MWIGcHJvdG8z", [file_google_api_annotations, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_struct, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_database_catalog_service, file_v1_database_service]);
/**
* Describes the message bytebase.v1.AdminExecuteRequest.
@@ -168,72 +168,46 @@ export const ExportRequestSchema = /*@__PURE__*/
export const ExportResponseSchema = /*@__PURE__*/
messageDesc(file_v1_sql_service, 11);
-/**
- * Describes the message bytebase.v1.CheckRequest.
- * Use `create(CheckRequestSchema)` to create a new message.
- */
-export const CheckRequestSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 12);
-
-/**
- * Describes the enum bytebase.v1.CheckRequest.ChangeType.
- */
-export const CheckRequest_ChangeTypeSchema = /*@__PURE__*/
- enumDesc(file_v1_sql_service, 12, 0);
-
-/**
- * @generated from enum bytebase.v1.CheckRequest.ChangeType
- */
-export const CheckRequest_ChangeType = /*@__PURE__*/
- tsEnum(CheckRequest_ChangeTypeSchema);
-
-/**
- * Describes the message bytebase.v1.CheckResponse.
- * Use `create(CheckResponseSchema)` to create a new message.
- */
-export const CheckResponseSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 13);
-
/**
* Describes the message bytebase.v1.DiffMetadataRequest.
* Use `create(DiffMetadataRequestSchema)` to create a new message.
*/
export const DiffMetadataRequestSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 14);
+ messageDesc(file_v1_sql_service, 12);
/**
* Describes the message bytebase.v1.DiffMetadataResponse.
* Use `create(DiffMetadataResponseSchema)` to create a new message.
*/
export const DiffMetadataResponseSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 15);
+ messageDesc(file_v1_sql_service, 13);
/**
* Describes the message bytebase.v1.SearchQueryHistoriesRequest.
* Use `create(SearchQueryHistoriesRequestSchema)` to create a new message.
*/
export const SearchQueryHistoriesRequestSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 16);
+ messageDesc(file_v1_sql_service, 14);
/**
* Describes the message bytebase.v1.SearchQueryHistoriesResponse.
* Use `create(SearchQueryHistoriesResponseSchema)` to create a new message.
*/
export const SearchQueryHistoriesResponseSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 17);
+ messageDesc(file_v1_sql_service, 15);
/**
* Describes the message bytebase.v1.QueryHistory.
* Use `create(QueryHistorySchema)` to create a new message.
*/
export const QueryHistorySchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 18);
+ messageDesc(file_v1_sql_service, 16);
/**
* Describes the enum bytebase.v1.QueryHistory.Type.
*/
export const QueryHistory_TypeSchema = /*@__PURE__*/
- enumDesc(file_v1_sql_service, 18, 0);
+ enumDesc(file_v1_sql_service, 16, 0);
/**
* @generated from enum bytebase.v1.QueryHistory.Type
@@ -246,42 +220,42 @@ export const QueryHistory_Type = /*@__PURE__*/
* Use `create(AICompletionRequestSchema)` to create a new message.
*/
export const AICompletionRequestSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 19);
+ messageDesc(file_v1_sql_service, 17);
/**
* Describes the message bytebase.v1.AICompletionRequest.Message.
* Use `create(AICompletionRequest_MessageSchema)` to create a new message.
*/
export const AICompletionRequest_MessageSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 19, 0);
+ messageDesc(file_v1_sql_service, 17, 0);
/**
* Describes the message bytebase.v1.AICompletionResponse.
* Use `create(AICompletionResponseSchema)` to create a new message.
*/
export const AICompletionResponseSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 20);
+ messageDesc(file_v1_sql_service, 18);
/**
* Describes the message bytebase.v1.AICompletionResponse.Candidate.
* Use `create(AICompletionResponse_CandidateSchema)` to create a new message.
*/
export const AICompletionResponse_CandidateSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 20, 0);
+ messageDesc(file_v1_sql_service, 18, 0);
/**
* Describes the message bytebase.v1.AICompletionResponse.Candidate.Content.
* Use `create(AICompletionResponse_Candidate_ContentSchema)` to create a new message.
*/
export const AICompletionResponse_Candidate_ContentSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 20, 0, 0);
+ messageDesc(file_v1_sql_service, 18, 0, 0);
/**
* Describes the message bytebase.v1.AICompletionResponse.Candidate.Content.Part.
* Use `create(AICompletionResponse_Candidate_Content_PartSchema)` to create a new message.
*/
export const AICompletionResponse_Candidate_Content_PartSchema = /*@__PURE__*/
- messageDesc(file_v1_sql_service, 20, 0, 0, 0);
+ messageDesc(file_v1_sql_service, 18, 0, 0, 0);
/**
* SQLService executes SQL queries and manages query operations.
diff --git a/frontend/src/types/sqlEditor/editor.ts b/frontend/src/types/sqlEditor/editor.ts
index fb71c790bf..016437fd88 100644
--- a/frontend/src/types/sqlEditor/editor.ts
+++ b/frontend/src/types/sqlEditor/editor.ts
@@ -76,5 +76,4 @@ export type SQLEditorQueryParams = {
explain: boolean;
// Use to calculate the advice position.
selection: monaco.Selection | null;
- skipCheck?: boolean;
};
diff --git a/frontend/src/types/v1/sql.ts b/frontend/src/types/v1/sql.ts
index 677b883e8d..17e0e81e28 100644
--- a/frontend/src/types/v1/sql.ts
+++ b/frontend/src/types/v1/sql.ts
@@ -1,8 +1,7 @@
import type { Code } from "@connectrpc/connect";
-import type { Advice, QueryResponse } from "../proto-es/v1/sql_service_pb";
+import type { QueryResponse } from "../proto-es/v1/sql_service_pb";
export interface SQLResultSetV1 extends Omit<QueryResponse, "$typeName"> {
error: string; // empty if no error occurred
- advices: Advice[];
status?: Code;
}
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/ErrorView/ErrorView.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/ErrorView/ErrorView.vue
index e55e7c265e..61d2608b45 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/ErrorView/ErrorView.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/ErrorView/ErrorView.vue
@@ -3,79 +3,26 @@
class="w-full text-md font-normal flex flex-col gap-2 text-sm"
:class="[dark ? 'text-matrix-green-hover' : 'text-control-light']"
>
- <template v-if="resultSet && resultSet.advices.length > 0">
- <AdviceItem
- v-for="(advice, i) in resultSet.advices"
- :key="i"
- :advice="advice"
- :execute-params="executeParams"
- />
- </template>
- <BBAttention v-else class="w-full" type="error">
+ <BBAttention class="w-full" type="error">
{{ error }}
</BBAttention>
<div v-if="$slots.suffix">
<slot name="suffix" />
</div>
<PostgresError v-if="resultSet" :result-set="resultSet" />
- <div v-if="showRunAnywayButton">
- <NButton size="small" type="warning" @click="runAnyway">
- {{ $t("sql-editor.run-anyway") }}
- </NButton>
- </div>
</div>
</template>
<script lang="ts" setup>
-import { Code } from "@connectrpc/connect";
-import { NButton } from "naive-ui";
-import { storeToRefs } from "pinia";
-import { computed } from "vue";
import { BBAttention } from "@/bbkit";
-import { useAppFeature, useSQLEditorTabStore } from "@/store";
-import type { SQLEditorQueryParams, SQLResultSetV1 } from "@/types";
-import { DatabaseChangeMode } from "@/types/proto-es/v1/setting_service_pb";
-import { Advice_Level } from "@/types/proto-es/v1/sql_service_pb";
+import type { SQLResultSetV1 } from "@/types";
import { useSQLResultViewContext } from "../context";
-import AdviceItem from "./AdviceItem.vue";
import PostgresError from "./PostgresError.vue";
-const props = defineProps<{
+defineProps<{
error: string | undefined;
- executeParams?: SQLEditorQueryParams;
resultSet?: SQLResultSetV1;
}>();
-const emit = defineEmits<{
- (event: "execute", params: SQLEditorQueryParams): void;
-}>();
-
-const sqlCheckStyle = useAppFeature("bb.feature.sql-editor.sql-check-style");
-const { currentTab: tab } = storeToRefs(useSQLEditorTabStore());
const { dark } = useSQLResultViewContext();
-const databaseChangeMode = useAppFeature("bb.feature.database-change-mode");
-
-const showRunAnywayButton = computed(() => {
- if (!tab.value) return false;
- if (tab.value?.mode === "ADMIN") return false;
- const { executeParams, resultSet } = props;
- if (!resultSet) return false;
- if (!executeParams) return false;
- if (sqlCheckStyle.value !== "PREFLIGHT") return false;
- if (databaseChangeMode.value !== DatabaseChangeMode.EDITOR) return false;
- if (resultSet.status === Code.PermissionDenied) return false;
- if (resultSet.error.includes("resource not found")) return false;
- return resultSet.advices.some(
- (advice) => advice.status === Advice_Level.WARNING
- );
-});
-
-const runAnyway = () => {
- const params = props.executeParams;
- if (!params) return;
- emit("execute", {
- ...params,
- skipCheck: true,
- });
-};
</script>
diff --git a/frontend/src/views/sql-editor/EditorPanel/StandardPanel/SQLEditor.vue b/frontend/src/views/sql-editor/EditorPanel/StandardPanel/SQLEditor.vue
index 13226dba6c..b1783cafa3 100644
--- a/frontend/src/views/sql-editor/EditorPanel/StandardPanel/SQLEditor.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/StandardPanel/SQLEditor.vue
@@ -47,10 +47,8 @@ import MonacoEditor from "@/components/MonacoEditor/MonacoEditor.vue";
import {
extensionNameOfLanguage,
formatEditorContent,
- positionWithOffset,
} from "@/components/MonacoEditor/utils";
import { useEmitteryEventListener } from "@/composables/useEmitteryEventListener";
-import { useExecuteSQL } from "@/composables/useExecuteSQL";
import { useAIActions } from "@/plugins/ai";
import { useAIContext } from "@/plugins/ai/logic";
import * as promptUtils from "@/plugins/ai/logic/prompt";
@@ -60,9 +58,8 @@ import {
useSQLEditorTabStore,
useConnectionOfCurrentSQLEditorTab,
} from "@/store";
-import type { SQLDialect, SQLEditorQueryParams, SQLEditorTab } from "@/types";
+import type { SQLDialect, SQLEditorQueryParams } from "@/types";
import { dialectOfEngineV1 } from "@/types";
-import { Advice_Level, type Advice } from "@/types/proto-es/v1/sql_service_pb";
import {
nextAnimationFrame,
useInstanceV1EditorLanguage,
@@ -88,7 +85,6 @@ const {
const { currentTab, isSwitchingTab } = storeToRefs(tabStore);
const AIContext = useAIContext();
-const { events: executeSQLEvents } = useExecuteSQL();
const monacoEditorRef = ref<InstanceType<typeof MonacoEditor>>();
const content = computed(() => currentTab.value?.statement ?? "");
@@ -324,44 +320,6 @@ const handleEditorReady = (
);
};
-const updateAdvices = (
- tab: SQLEditorTab,
- params: SQLEditorQueryParams,
- advices: Advice[]
-) => {
- tab.editorState.advices = advices.map<AdviceOption>((advice) => {
- const [startLine, startColumn] = positionWithOffset(
- advice.startPosition?.line ?? 1,
- advice.startPosition?.column ?? Number.MAX_SAFE_INTEGER,
- params.selection
- );
- const [endLine, endColumn] = positionWithOffset(
- advice.endPosition?.line ?? advice.startPosition?.line ?? 1,
- advice.endPosition?.column ??
- advice.startPosition?.column ??
- Number.MAX_SAFE_INTEGER,
- params.selection
- );
- const code = advice.code;
- const source = [`L${startLine}:C${startColumn}`];
- if (code > 0) {
- source.unshift(`(${code})`);
- }
- if (advice.title) {
- source.unshift(advice.title);
- }
- return {
- severity: advice.status === Advice_Level.ERROR ? "ERROR" : "WARNING",
- message: advice.content,
- source: source.join(" "),
- startLineNumber: startLine,
- endLineNumber: endLine,
- startColumn: startColumn,
- endColumn: endColumn,
- };
- });
-};
-
const handleUploadFile = (content: string) => {
const editor = activeSQLEditorRef.value;
if (!editor) return;
@@ -425,15 +383,6 @@ useEmitteryEventListener(
}
);
-useEmitteryEventListener(
- executeSQLEvents,
- "update:advices",
- ({ tab, params, advices }) => {
- if (tab.id !== currentTab.value?.id) return;
- updateAdvices(tab, params, advices);
- }
-);
-
onBeforeUnmount(() => {
activeSQLEditorRef.value = undefined;
});
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 9e995fdd77..ca71253469 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -7600,33 +7600,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
- /v1/sql/check:
- post:
- tags:
- - SQLService
- description: |-
- Validates SQL statements against review rules.
- Permissions required: bb.databases.check
- operationId: SQLService_Check
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CheckRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CheckResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
/v1/subscription:
get:
tags:
@@ -9574,37 +9547,6 @@ components:
description: The risk level of the statement on the target.
format: enum
description: Check result for a single release file on a target database.
- CheckRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The database name to check against.
- Format: instances/{instance}/databases/{database}
- statement:
- type: string
- changeType:
- enum:
- - CHANGE_TYPE_UNSPECIFIED
- - DDL
- - DDL_GHOST
- - DML
- - SQL_EDITOR
- type: string
- format: enum
- CheckResponse:
- type: object
- properties:
- advices:
- type: array
- items:
- $ref: '#/components/schemas/Advice'
- affectedRows:
- type: string
- description: The count of affected rows of the statement on the target database.
ColumnCatalog:
type: object
properties:
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index bf4569aa16..2a78f67889 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -3379,7 +3379,6 @@ Note: DDL, DML, and DDL_GHOST values align with MigrationType enum values.
| DML | 2 | |
| SDL | 3 | |
| DDL_GHOST | 4 | |
-| SQL_EDITOR | 5 | |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 99dc521c27..97105865be 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -9471,12 +9471,6 @@ Leave it empty if there is no need to encrypt the zip file. </p></td>
<td><p></p></td>
</tr>
- <tr>
- <td>SQL_EDITOR</td>
- <td>5</td>
- <td><p></p></td>
- </tr>
-
</tbody>
</table>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 01fb047c92..195aa7dfad 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -438,8 +438,6 @@
- [AdminExecuteRequest](#bytebase-v1-AdminExecuteRequest)
- [AdminExecuteResponse](#bytebase-v1-AdminExecuteResponse)
- [Advice](#bytebase-v1-Advice)
- - [CheckRequest](#bytebase-v1-CheckRequest)
- - [CheckResponse](#bytebase-v1-CheckResponse)
- [DiffMetadataRequest](#bytebase-v1-DiffMetadataRequest)
- [DiffMetadataResponse](#bytebase-v1-DiffMetadataResponse)
- [ExportRequest](#bytebase-v1-ExportRequest)
@@ -460,7 +458,6 @@
- [SearchQueryHistoriesResponse](#bytebase-v1-SearchQueryHistoriesResponse)
- [Advice.Level](#bytebase-v1-Advice-Level)
- - [CheckRequest.ChangeType](#bytebase-v1-CheckRequest-ChangeType)
- [QueryHistory.Type](#bytebase-v1-QueryHistory-Type)
- [QueryOption.RedisRunCommandsOn](#bytebase-v1-QueryOption-RedisRunCommandsOn)
- [QueryResult.Message.Level](#bytebase-v1-QueryResult-Message-Level)
@@ -7317,39 +7314,6 @@ OrgPolicyService manages organizational policies at various resource levels.
-<a name="bytebase-v1-CheckRequest"></a>
-
-### CheckRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The database name to check against. Format: instances/{instance}/databases/{database} |
-| statement | [string](#string) | | |
-| change_type | [CheckRequest.ChangeType](#bytebase-v1-CheckRequest-ChangeType) | | |
-
-
-
-
-
-
-<a name="bytebase-v1-CheckResponse"></a>
-
-### CheckResponse
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| advices | [Advice](#bytebase-v1-Advice) | repeated | |
-| affected_rows | [int64](#int64) | | The count of affected rows of the statement on the target database. |
-
-
-
-
-
-
<a name="bytebase-v1-DiffMetadataRequest"></a>
### DiffMetadataRequest
@@ -7719,21 +7683,6 @@ Level represents the severity level of the advice.
-<a name="bytebase-v1-CheckRequest-ChangeType"></a>
-
-### CheckRequest.ChangeType
-
-
-| Name | Number | Description |
-| ---- | ------ | ----------- |
-| CHANGE_TYPE_UNSPECIFIED | 0 | |
-| DDL | 1 | |
-| DDL_GHOST | 2 | |
-| DML | 3 | |
-| SQL_EDITOR | 4 | |
-
-
-
<a name="bytebase-v1-QueryHistory-Type"></a>
### QueryHistory.Type
@@ -7792,7 +7741,6 @@ SQLService executes SQL queries and manages query operations.
| AdminExecute | [AdminExecuteRequest](#bytebase-v1-AdminExecuteRequest) stream | [AdminExecuteResponse](#bytebase-v1-AdminExecuteResponse) stream | Executes SQL with admin privileges via streaming connection. Permissions required: bb.sql.admin |
| SearchQueryHistories | [SearchQueryHistoriesRequest](#bytebase-v1-SearchQueryHistoriesRequest) | [SearchQueryHistoriesResponse](#bytebase-v1-SearchQueryHistoriesResponse) | SearchQueryHistories searches query histories for the caller. Permissions required: None (only returns caller&#39;s own query histories) |
| Export | [ExportRequest](#bytebase-v1-ExportRequest) | [ExportResponse](#bytebase-v1-ExportResponse) | Exports query results to a file format. Permissions required: bb.databases.get |
-| Check | [CheckRequest](#bytebase-v1-CheckRequest) | [CheckResponse](#bytebase-v1-CheckResponse) | Validates SQL statements against review rules. Permissions required: bb.databases.check |
| DiffMetadata | [DiffMetadataRequest](#bytebase-v1-DiffMetadataRequest) | [DiffMetadataResponse](#bytebase-v1-DiffMetadataResponse) | Computes schema differences between two database metadata. Permissions required: None |
| AICompletion | [AICompletionRequest](#bytebase-v1-AICompletionRequest) | [AICompletionResponse](#bytebase-v1-AICompletionResponse) | Provides AI-powered SQL completion and generation. Permissions required: None (authenticated users only, requires AI to be enabled) |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 0582d6f424..95e1e8f191 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -1851,14 +1851,6 @@
<a href="#bytebase.v1.Advice"><span class="badge">M</span>Advice</a>
</li>
- <li>
- <a href="#bytebase.v1.CheckRequest"><span class="badge">M</span>CheckRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.CheckResponse"><span class="badge">M</span>CheckResponse</a>
- </li>
-
<li>
<a href="#bytebase.v1.DiffMetadataRequest"><span class="badge">M</span>DiffMetadataRequest</a>
</li>
@@ -1936,10 +1928,6 @@
<a href="#bytebase.v1.Advice.Level"><span class="badge">E</span>Advice.Level</a>
</li>
- <li>
- <a href="#bytebase.v1.CheckRequest.ChangeType"><span class="badge">E</span>CheckRequest.ChangeType</a>
- </li>
-
<li>
<a href="#bytebase.v1.QueryHistory.Type"><span class="badge">E</span>QueryHistory.Type</a>
</li>
@@ -20643,76 +20631,6 @@ TODO: use range instead </p></td>
- <h3 id="bytebase.v1.CheckRequest">CheckRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The database name to check against.
-Format: instances/{instance}/databases/{database} </p></td>
- </tr>
-
- <tr>
- <td>statement</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>change_type</td>
- <td><a href="#bytebase.v1.CheckRequest.ChangeType">CheckRequest.ChangeType</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.CheckResponse">CheckResponse</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>advices</td>
- <td><a href="#bytebase.v1.Advice">Advice</a></td>
- <td>repeated</td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>affected_rows</td>
- <td><a href="#int64">int64</a></td>
- <td></td>
- <td><p>The count of affected rows of the statement on the target database. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
<h3 id="bytebase.v1.DiffMetadataRequest">DiffMetadataRequest</h3>
<p></p>
@@ -21780,47 +21698,6 @@ Pass this value in the page_token field in the subsequent call to
</tbody>
</table>
- <h3 id="bytebase.v1.CheckRequest.ChangeType">CheckRequest.ChangeType</h3>
- <p></p>
- <table class="enum-table">
- <thead>
- <tr><td>Name</td><td>Number</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>CHANGE_TYPE_UNSPECIFIED</td>
- <td>0</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>DDL</td>
- <td>1</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>DDL_GHOST</td>
- <td>2</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>DML</td>
- <td>3</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>SQL_EDITOR</td>
- <td>4</td>
- <td><p></p></td>
- </tr>
-
- </tbody>
- </table>
-
<h3 id="bytebase.v1.QueryHistory.Type">QueryHistory.Type</h3>
<p></p>
<table class="enum-table">
@@ -21976,14 +21853,6 @@ Permissions required: None (only returns caller&#39;s own query histories)</p></
Permissions required: bb.databases.get</p></td>
</tr>
- <tr>
- <td>Check</td>
- <td><a href="#bytebase.v1.CheckRequest">CheckRequest</a></td>
- <td><a href="#bytebase.v1.CheckResponse">CheckResponse</a></td>
- <td><p>Validates SQL statements against review rules.
-Permissions required: bb.databases.check</p></td>
- </tr>
-
<tr>
<td>DiffMetadata</td>
<td><a href="#bytebase.v1.DiffMetadataRequest">DiffMetadataRequest</a></td>
@@ -22074,16 +21943,6 @@ Permissions required: None (authenticated users only, requires AI to be enabled)
- <tr>
- <td>Check</td>
- <td>POST</td>
- <td>/v1/sql/check</td>
- <td>*</td>
- </tr>
-
-
-
-
<tr>
<td>DiffMetadata</td>
<td>POST</td>
diff --git a/proto/store/store/plan_check_run.proto b/proto/store/store/plan_check_run.proto
index a4a00163b2..2dca0b6543 100644
--- a/proto/store/store/plan_check_run.proto
+++ b/proto/store/store/plan_check_run.proto
@@ -28,7 +28,6 @@ message PlanCheckRunConfig {
DML = 2;
SDL = 3;
DDL_GHOST = 4;
- SQL_EDITOR = 5;
}
}
diff --git a/proto/v1/v1/sql_service.proto b/proto/v1/v1/sql_service.proto
index 2e30df4ad6..d0ad611b9f 100644
--- a/proto/v1/v1/sql_service.proto
+++ b/proto/v1/v1/sql_service.proto
@@ -70,17 +70,6 @@ service SQLService {
option (bytebase.v1.audit) = true;
}
- // Validates SQL statements against review rules.
- // Permissions required: bb.databases.check
- rpc Check(CheckRequest) returns (CheckResponse) {
- option (google.api.http) = {
- post: "/v1/sql/check"
- body: "*"
- };
- option (bytebase.v1.permission) = "bb.databases.check";
- option (bytebase.v1.auth_method) = IAM;
- }
-
// Computes schema differences between two database metadata.
// Permissions required: None
rpc DiffMetadata(DiffMetadataRequest) returns (DiffMetadataResponse) {
@@ -421,33 +410,6 @@ message ExportResponse {
bytes content = 1;
}
-message CheckRequest {
- // The database name to check against.
- // Format: instances/{instance}/databases/{database}
- string name = 2 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/Database"}
- ];
-
- string statement = 1;
-
- enum ChangeType {
- CHANGE_TYPE_UNSPECIFIED = 0;
- DDL = 1;
- DDL_GHOST = 2;
- DML = 3;
- SQL_EDITOR = 4;
- }
- ChangeType change_type = 4;
-}
-
-message CheckResponse {
- repeated Advice advices = 1;
-
- // The count of affected rows of the statement on the target database.
- int64 affected_rows = 2;
-}
-
message DiffMetadataRequest {
// The metadata of the source schema.
DatabaseMetadata source_metadata = 1 [(google.api.field_behavior) = REQUIRED];