Skip to content

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

feat: plan check run config database group target (#7644)

p0nye5f3c99e878d
diff --git a/backend/api/v1/rollout_service_converter.go b/backend/api/v1/rollout_service_converter.go
index abc40b6096..d905756086 100644
--- a/backend/api/v1/rollout_service_converter.go
+++ b/backend/api/v1/rollout_service_converter.go
@@ -325,16 +325,32 @@ func convertToPlanCheckRun(ctx context.Context, s *store.Store, parent string, r
Results: convertToPlanCheckRunResults(run.Result.Results),
Error: run.Result.Error,
}
- if run.Config.DatabaseId != 0 {
- databaseUID := int(run.Config.DatabaseId)
- database, err := s.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: &databaseUID})
+
+ switch config := run.Config.Target.(type) {
+ case *storepb.PlanCheckRunConfig_DatabaseTarget_:
+ instanceUID := int(config.DatabaseTarget.InstanceUid)
+ databaseName := config.DatabaseTarget.DatabaseName
+ instance, err := s.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to get instance")
+ }
+ converted.Target = fmt.Sprintf("%s%s/%s%s", common.InstanceNamePrefix, instance.ResourceID, common.DatabaseIDPrefix, databaseName)
+
+ case *storepb.PlanCheckRunConfig_DatabaseGroupTarget_:
+ databaseGroupUID := int64(config.DatabaseGroupTarget.DatabaseGroupUid)
+ databaseGroup, err := s.GetDatabaseGroup(ctx, &store.FindDatabaseGroupMessage{UID: &databaseGroupUID})
if err != nil {
- return nil, errors.Wrapf(err, "failed to get database")
+ return nil, errors.Wrapf(err, "failed to get database group")
}
- converted.Target = fmt.Sprintf("%s%s/%s%s", common.InstanceNamePrefix, database.InstanceID, common.DatabaseIDPrefix, database.DatabaseName)
+ project, err := s.GetProjectV2(ctx, &store.FindProjectMessage{UID: &databaseGroup.ProjectUID})
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to get project")
+ }
+ converted.Target = fmt.Sprintf("%s%s/%s%s", common.ProjectNamePrefix, project.ResourceID, common.DatabaseGroupNamePrefix, databaseGroup.ResourceID)
}
- if run.Config.SheetId != 0 {
- sheetUID := int(run.Config.SheetId)
+
+ if run.Config.SheetUid != 0 {
+ sheetUID := int(run.Config.SheetUid)
sheet, err := s.GetSheet(ctx, &store.FindSheetMessage{UID: &sheetUID}, api.SystemBotID)
if err != nil {
return nil, errors.Wrapf(err, "failed to get sheet")
diff --git a/backend/api/v1/rollout_service_plan_check.go b/backend/api/v1/rollout_service_plan_check.go
index 91ce5b22f3..a44000f692 100644
--- a/backend/api/v1/rollout_service_plan_check.go
+++ b/backend/api/v1/rollout_service_plan_check.go
@@ -76,9 +76,14 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Pl
Status: store.PlanCheckRunStatusRunning,
Type: store.PlanCheckDatabaseConnect,
Config: &storepb.PlanCheckRunConfig{
- SheetId: 0,
- InstanceId: int32(instance.UID),
- DatabaseId: int32(database.UID),
+ SheetUid: 0,
+ ChangeDatabaseType: storepb.PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED,
+ Target: &storepb.PlanCheckRunConfig_DatabaseTarget_{
+ DatabaseTarget: &storepb.PlanCheckRunConfig_DatabaseTarget{
+ InstanceUid: int32(instance.UID),
+ DatabaseName: database.DatabaseName,
+ },
+ },
},
})
if isStatementTypeCheckSupported(instance.Engine) {
@@ -89,10 +94,14 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Pl
Status: store.PlanCheckRunStatusRunning,
Type: store.PlanCheckDatabaseStatementType,
Config: &storepb.PlanCheckRunConfig{
- SheetId: int32(sheetUID),
- InstanceId: int32(instance.UID),
- DatabaseId: int32(database.UID),
+ SheetUid: int32(sheetUID),
ChangeDatabaseType: convertToChangeDatabaseType(config.ChangeDatabaseConfig.Type),
+ Target: &storepb.PlanCheckRunConfig_DatabaseTarget_{
+ DatabaseTarget: &storepb.PlanCheckRunConfig_DatabaseTarget{
+ InstanceUid: int32(instance.UID),
+ DatabaseName: database.DatabaseName,
+ },
+ },
},
})
}
@@ -104,10 +113,14 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Pl
Status: store.PlanCheckRunStatusRunning,
Type: store.PlanCheckDatabaseStatementAdvise,
Config: &storepb.PlanCheckRunConfig{
- SheetId: int32(sheetUID),
- InstanceId: int32(instance.UID),
- DatabaseId: int32(database.UID),
+ SheetUid: int32(sheetUID),
ChangeDatabaseType: convertToChangeDatabaseType(config.ChangeDatabaseConfig.Type),
+ Target: &storepb.PlanCheckRunConfig_DatabaseTarget_{
+ DatabaseTarget: &storepb.PlanCheckRunConfig_DatabaseTarget{
+ InstanceUid: int32(instance.UID),
+ DatabaseName: database.DatabaseName,
+ },
+ },
},
})
}
@@ -119,10 +132,14 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Pl
Status: store.PlanCheckRunStatusRunning,
Type: store.PlanCheckDatabaseStatementSummaryReport,
Config: &storepb.PlanCheckRunConfig{
- SheetId: int32(sheetUID),
- InstanceId: int32(instance.UID),
- DatabaseId: int32(database.UID),
+ SheetUid: int32(sheetUID),
ChangeDatabaseType: convertToChangeDatabaseType(config.ChangeDatabaseConfig.Type),
+ Target: &storepb.PlanCheckRunConfig_DatabaseTarget_{
+ DatabaseTarget: &storepb.PlanCheckRunConfig_DatabaseTarget{
+ InstanceUid: int32(instance.UID),
+ DatabaseName: database.DatabaseName,
+ },
+ },
},
})
}
@@ -134,10 +151,14 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Pl
Status: store.PlanCheckRunStatusRunning,
Type: store.PlanCheckDatabaseGhostSync,
Config: &storepb.PlanCheckRunConfig{
- SheetId: int32(sheetUID),
- InstanceId: int32(instance.UID),
- DatabaseId: int32(database.UID),
+ SheetUid: int32(sheetUID),
ChangeDatabaseType: convertToChangeDatabaseType(config.ChangeDatabaseConfig.Type),
+ Target: &storepb.PlanCheckRunConfig_DatabaseTarget_{
+ DatabaseTarget: &storepb.PlanCheckRunConfig_DatabaseTarget{
+ InstanceUid: int32(instance.UID),
+ DatabaseName: database.DatabaseName,
+ },
+ },
},
})
}
@@ -166,10 +187,13 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Pl
Status: store.PlanCheckRunStatusRunning,
Type: store.PlanCheckDatabasePITRMySQL,
Config: &storepb.PlanCheckRunConfig{
- InstanceId: int32(targetInstance.UID),
- PitrConfig: &storepb.PlanCheckRunConfig_PitrConfig{
- TargetInstanceId: int32(targetInstance.UID),
- TargetDatabaseName: config.RestoreDatabaseConfig.CreateDatabaseConfig.Database,
+ SheetUid: 0,
+ ChangeDatabaseType: storepb.PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED,
+ Target: &storepb.PlanCheckRunConfig_DatabaseTarget_{
+ DatabaseTarget: &storepb.PlanCheckRunConfig_DatabaseTarget{
+ InstanceUid: int32(targetInstance.UID),
+ DatabaseName: config.RestoreDatabaseConfig.CreateDatabaseConfig.Database,
+ },
},
},
})
@@ -210,8 +234,14 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Pl
Status: store.PlanCheckRunStatusRunning,
Type: store.PlanCheckDatabasePITRMySQL,
Config: &storepb.PlanCheckRunConfig{
- InstanceId: int32(instance.UID),
- DatabaseId: int32(database.UID),
+ SheetUid: 0,
+ ChangeDatabaseType: storepb.PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED,
+ Target: &storepb.PlanCheckRunConfig_DatabaseTarget_{
+ DatabaseTarget: &storepb.PlanCheckRunConfig_DatabaseTarget{
+ InstanceUid: int32(instance.UID),
+ DatabaseName: database.DatabaseName,
+ },
+ },
},
})
}
diff --git a/backend/runner/plancheck/database_connect_executor.go b/backend/runner/plancheck/database_connect_executor.go
index e6d8e801c9..5c0331fc5f 100644
--- a/backend/runner/plancheck/database_connect_executor.go
+++ b/backend/runner/plancheck/database_connect_executor.go
@@ -30,20 +30,26 @@ type DatabaseConnectExecutor struct {
// Run runs the executor.
func (e *DatabaseConnectExecutor) Run(ctx context.Context, planCheckRun *store.PlanCheckRunMessage) ([]*storepb.PlanCheckRunResult_Result, error) {
- databaseID := int(planCheckRun.Config.DatabaseId)
- database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: &databaseID})
+ target := planCheckRun.Config.GetDatabaseTarget()
+ if target == nil {
+ return nil, errors.New("database target is required")
+ }
+
+ instanceUID := int(target.InstanceUid)
+ instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})
if err != nil {
- return nil, errors.Wrapf(err, "failed to get database ID %v", databaseID)
+ return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)
}
- if database == nil {
- return nil, errors.Errorf("database not found %v", databaseID)
+ if instance == nil {
+ return nil, errors.Errorf("instance not found UID %v", instanceUID)
}
- instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})
+
+ database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &target.DatabaseName})
if err != nil {
- return nil, errors.Wrapf(err, "failed to get instance %v", database.InstanceID)
+ return nil, errors.Wrapf(err, "failed to get database %q", target.DatabaseName)
}
- if instance == nil {
- return nil, errors.Errorf("instance not found %v", database.InstanceID)
+ if database == nil {
+ return nil, errors.Errorf("database not found %q", target.DatabaseName)
}
driver, err := e.dbFactory.GetAdminDatabaseDriver(ctx, instance, database)
diff --git a/backend/runner/plancheck/ghost_sync_executor.go b/backend/runner/plancheck/ghost_sync_executor.go
index d182524143..30cba8ee24 100644
--- a/backend/runner/plancheck/ghost_sync_executor.go
+++ b/backend/runner/plancheck/ghost_sync_executor.go
@@ -52,20 +52,26 @@ func (e *GhostSyncExecutor) Run(ctx context.Context, planCheckRun *store.PlanChe
}
}()
- databaseID := int(planCheckRun.Config.DatabaseId)
- database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: &databaseID})
+ target := planCheckRun.Config.GetDatabaseTarget()
+ if target == nil {
+ return nil, errors.New("database target is required")
+ }
+
+ instanceUID := int(target.InstanceUid)
+ instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})
if err != nil {
- return nil, errors.Wrapf(err, "failed to get database ID %v", databaseID)
+ return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)
}
- if database == nil {
- return nil, errors.Errorf("database not found %v", databaseID)
+ if instance == nil {
+ return nil, errors.Errorf("instance not found UID %v", instanceUID)
}
- instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})
+
+ database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &target.DatabaseName})
if err != nil {
- return nil, errors.Wrapf(err, "failed to get instance %v", database.InstanceID)
+ return nil, errors.Wrapf(err, "failed to get database %q", target.DatabaseName)
}
- if instance == nil {
- return nil, errors.Errorf("instance not found %v", database.InstanceID)
+ if database == nil {
+ return nil, errors.Errorf("database not found %q", target.DatabaseName)
}
adminDataSource := utils.DataSourceFromInstanceWithType(instance, api.Admin)
@@ -78,17 +84,17 @@ func (e *GhostSyncExecutor) Run(ctx context.Context, planCheckRun *store.PlanChe
return nil, common.Errorf(common.Internal, "failed to find instance user by instanceID %d", instance.UID)
}
- sheetID := int(planCheckRun.Config.SheetId)
- sheet, err := e.store.GetSheet(ctx, &store.FindSheetMessage{UID: &sheetID}, api.SystemBotID)
+ sheetUID := int(planCheckRun.Config.SheetUid)
+ sheet, err := e.store.GetSheet(ctx, &store.FindSheetMessage{UID: &sheetUID}, api.SystemBotID)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get sheet %d", sheetID)
+ return nil, errors.Wrapf(err, "failed to get sheet %d", sheetUID)
}
if sheet == nil {
- return nil, errors.Errorf("sheet %d not found", sheetID)
+ return nil, errors.Errorf("sheet %d not found", sheetUID)
}
- statement, err := e.store.GetSheetStatementByID(ctx, sheetID)
+ statement, err := e.store.GetSheetStatementByID(ctx, sheetUID)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get sheet statement %d", sheetID)
+ return nil, errors.Wrapf(err, "failed to get sheet statement %d", sheetUID)
}
materials := utils.GetSecretMapFromDatabaseMessage(database)
diff --git a/backend/runner/plancheck/pitr_mysql_executor.go b/backend/runner/plancheck/pitr_mysql_executor.go
index 55c8052a7b..37ff5d3c12 100644
--- a/backend/runner/plancheck/pitr_mysql_executor.go
+++ b/backend/runner/plancheck/pitr_mysql_executor.go
@@ -28,42 +28,20 @@ type PITRMySQLExecutor struct {
// Run runs the PITR MySQL executor.
func (e *PITRMySQLExecutor) Run(ctx context.Context, planCheckRun *store.PlanCheckRunMessage) ([]*storepb.PlanCheckRunResult_Result, error) {
- instance, databaseName, err := func() (*store.InstanceMessage, string, error) {
- if planCheckRun.Config.GetPitrConfig().GetTargetInstanceId() != 0 {
- instanceUID := int(planCheckRun.Config.GetPitrConfig().GetTargetInstanceId())
- databaseName := planCheckRun.Config.GetPitrConfig().GetTargetDatabaseName()
-
- instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})
- if err != nil {
- return nil, "", errors.Wrapf(err, "failed to get instance %v", instanceUID)
- }
- if instance == nil {
- return nil, "", errors.Errorf("instance not found %v", instanceUID)
- }
- return instance, databaseName, nil
- }
-
- databaseID := int(planCheckRun.Config.DatabaseId)
- database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: &databaseID})
- if err != nil {
- return nil, "", errors.Wrapf(err, "failed to get database ID %v", databaseID)
- }
- if database == nil {
- return nil, "", errors.Errorf("database not found %v", databaseID)
- }
- instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})
- if err != nil {
- return nil, "", errors.Wrapf(err, "failed to get instance %v", database.InstanceID)
- }
- if instance == nil {
- return nil, "", errors.Errorf("instance not found %v", database.InstanceID)
- }
+ target := planCheckRun.Config.GetDatabaseTarget()
+ if target == nil {
+ return nil, errors.New("database target is required")
+ }
- return instance, database.DatabaseName, nil
- }()
+ instanceUID := int(target.InstanceUid)
+ instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})
if err != nil {
- return nil, err
+ return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)
+ }
+ if instance == nil {
+ return nil, errors.Errorf("instance not found UID %v", instanceUID)
}
+ databaseName := target.DatabaseName
driver, err := e.dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */)
if err != nil {
diff --git a/backend/runner/plancheck/scheduler.go b/backend/runner/plancheck/scheduler.go
index 2433f2c055..56677d5dad 100644
--- a/backend/runner/plancheck/scheduler.go
+++ b/backend/runner/plancheck/scheduler.go
@@ -103,7 +103,11 @@ func (s *Scheduler) runPlanCheckRun(ctx context.Context, planCheckRun *store.Pla
return
}
- instanceUID := int(planCheckRun.Config.InstanceId)
+ var instanceUID int
+ if target := planCheckRun.Config.GetDatabaseTarget(); target != nil {
+ instanceUID = int(target.InstanceUid)
+ }
+ // DatabaseGroupTarget uses instanceUID = 0
s.stateCfg.Lock()
if s.stateCfg.InstanceOutstandingConnections[instanceUID] >= state.InstanceMaximumConnectionNumber {
diff --git a/backend/runner/plancheck/statement_advise_executor.go b/backend/runner/plancheck/statement_advise_executor.go
index aabd5c174b..eaed256fd8 100644
--- a/backend/runner/plancheck/statement_advise_executor.go
+++ b/backend/runner/plancheck/statement_advise_executor.go
@@ -48,13 +48,26 @@ func (e *StatementAdviseExecutor) Run(ctx context.Context, planCheckRun *store.P
return nil, errors.Errorf("change database type is unspecified")
}
- databaseID := int(planCheckRun.Config.DatabaseId)
- database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: &databaseID})
+ target := planCheckRun.Config.GetDatabaseTarget()
+ if target == nil {
+ return nil, errors.New("database target is required")
+ }
+
+ instanceUID := int(target.InstanceUid)
+ instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})
if err != nil {
- return nil, errors.Wrapf(err, "failed to get database ID %v", databaseID)
+ return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)
+ }
+ if instance == nil {
+ return nil, errors.Errorf("instance not found UID %v", instanceUID)
+ }
+
+ database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &target.DatabaseName})
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to get database %q", target.DatabaseName)
}
if database == nil {
- return nil, errors.Errorf("database not found %v", databaseID)
+ return nil, errors.Errorf("database not found %q", target.DatabaseName)
}
environment, err := e.store.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{ResourceID: &database.EffectiveEnvironmentID})
@@ -64,13 +77,6 @@ func (e *StatementAdviseExecutor) Run(ctx context.Context, planCheckRun *store.P
if environment == nil {
return nil, errors.Errorf("environment %q not found", database.EffectiveEnvironmentID)
}
- instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get instance %v", database.InstanceID)
- }
- if instance == nil {
- return nil, errors.Errorf("instance not found %v", database.InstanceID)
- }
if err := e.licenseService.IsFeatureEnabledForInstance(api.FeatureSQLReview, instance); err != nil {
// nolint:nilerr
@@ -96,13 +102,13 @@ func (e *StatementAdviseExecutor) Run(ctx context.Context, planCheckRun *store.P
return nil, err
}
- sheetID := int(planCheckRun.Config.SheetId)
- sheet, err := e.store.GetSheet(ctx, &store.FindSheetMessage{UID: &sheetID}, api.SystemBotID)
+ sheetUID := int(planCheckRun.Config.SheetUid)
+ sheet, err := e.store.GetSheet(ctx, &store.FindSheetMessage{UID: &sheetUID}, api.SystemBotID)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get sheet %d", sheetID)
+ return nil, errors.Wrapf(err, "failed to get sheet %d", sheetUID)
}
if sheet == nil {
- return nil, errors.Errorf("sheet %d not found", sheetID)
+ return nil, errors.Errorf("sheet %d not found", sheetUID)
}
if sheet.Size > common.MaxSheetSizeForTaskCheck {
return []*storepb.PlanCheckRunResult_Result{
@@ -114,9 +120,9 @@ func (e *StatementAdviseExecutor) Run(ctx context.Context, planCheckRun *store.P
},
}, nil
}
- statement, err := e.store.GetSheetStatementByID(ctx, sheetID)
+ statement, err := e.store.GetSheetStatementByID(ctx, sheetUID)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get sheet statement %d", sheetID)
+ return nil, errors.Wrapf(err, "failed to get sheet statement %d", sheetUID)
}
policy, err := e.store.GetSQLReviewPolicy(ctx, environment.UID)
diff --git a/backend/runner/plancheck/statement_report_executor.go b/backend/runner/plancheck/statement_report_executor.go
index 198f7a512a..2692841448 100644
--- a/backend/runner/plancheck/statement_report_executor.go
+++ b/backend/runner/plancheck/statement_report_executor.go
@@ -41,18 +41,26 @@ type StatementReportExecutor struct {
// Run runs the statement report executor.
func (e *StatementReportExecutor) Run(ctx context.Context, planCheckRun *store.PlanCheckRunMessage) ([]*storepb.PlanCheckRunResult_Result, error) {
- databaseID := int(planCheckRun.Config.DatabaseId)
- database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: &databaseID})
+ target := planCheckRun.Config.GetDatabaseTarget()
+ if target == nil {
+ return nil, errors.New("database target is required")
+ }
+
+ instanceUID := int(target.InstanceUid)
+ instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})
if err != nil {
- return nil, err
+ return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)
}
- if database == nil {
- return nil, errors.Errorf("database not found: %d", databaseID)
+ if instance == nil {
+ return nil, errors.Errorf("instance not found UID %v", instanceUID)
}
- instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})
+ database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &target.DatabaseName})
if err != nil {
- return nil, errors.Wrapf(err, "failed to get instance %v", database.InstanceID)
+ return nil, errors.Wrapf(err, "failed to get database %q", target.DatabaseName)
+ }
+ if database == nil {
+ return nil, errors.Errorf("database not found %q", target.DatabaseName)
}
dbSchema, err := e.store.GetDBSchema(ctx, database.UID)
@@ -65,13 +73,13 @@ func (e *StatementReportExecutor) Run(ctx context.Context, planCheckRun *store.P
charset := dbSchema.Metadata.CharacterSet
collation := dbSchema.Metadata.Collation
- sheetID := int(planCheckRun.Config.SheetId)
- sheet, err := e.store.GetSheet(ctx, &store.FindSheetMessage{UID: &sheetID}, api.SystemBotID)
+ sheetUID := int(planCheckRun.Config.SheetUid)
+ sheet, err := e.store.GetSheet(ctx, &store.FindSheetMessage{UID: &sheetUID}, api.SystemBotID)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get sheet %d", sheetID)
+ return nil, errors.Wrapf(err, "failed to get sheet %d", sheetUID)
}
if sheet == nil {
- return nil, errors.Errorf("sheet %d not found", sheetID)
+ return nil, errors.Errorf("sheet %d not found", sheetUID)
}
if sheet.Size > common.MaxSheetSizeForTaskCheck {
return []*storepb.PlanCheckRunResult_Result{
@@ -84,9 +92,9 @@ func (e *StatementReportExecutor) Run(ctx context.Context, planCheckRun *store.P
}, nil
}
- statement, err := e.store.GetSheetStatementByID(ctx, sheetID)
+ statement, err := e.store.GetSheetStatementByID(ctx, sheetUID)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get sheet statement %d", sheetID)
+ return nil, errors.Wrapf(err, "failed to get sheet statement %d", sheetUID)
}
materials := utils.GetSecretMapFromDatabaseMessage(database)
diff --git a/backend/runner/plancheck/statement_type_executor.go b/backend/runner/plancheck/statement_type_executor.go
index cc4d35115d..a095d4087c 100644
--- a/backend/runner/plancheck/statement_type_executor.go
+++ b/backend/runner/plancheck/statement_type_executor.go
@@ -44,18 +44,26 @@ func (e *StatementTypeExecutor) Run(ctx context.Context, planCheckRun *store.Pla
return nil, errors.Errorf("change database type is unspecified")
}
- databaseID := int(planCheckRun.Config.DatabaseId)
- database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: &databaseID})
+ target := planCheckRun.Config.GetDatabaseTarget()
+ if target == nil {
+ return nil, errors.New("database target is required")
+ }
+
+ instanceUID := int(target.InstanceUid)
+ instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})
if err != nil {
- return nil, err
+ return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)
}
- if database == nil {
- return nil, errors.Errorf("database not found: %d", databaseID)
+ if instance == nil {
+ return nil, errors.Errorf("instance not found UID %v", instanceUID)
}
- instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})
+ database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &target.DatabaseName})
if err != nil {
- return nil, errors.Wrapf(err, "failed to get instance %v", database.InstanceID)
+ return nil, errors.Wrapf(err, "failed to get database %q", target.DatabaseName)
+ }
+ if database == nil {
+ return nil, errors.Errorf("database not found %q", target.DatabaseName)
}
dbSchema, err := e.store.GetDBSchema(ctx, database.UID)
@@ -66,13 +74,13 @@ func (e *StatementTypeExecutor) Run(ctx context.Context, planCheckRun *store.Pla
return nil, errors.Errorf("database schema not found: %d", database.UID)
}
- sheetID := int(planCheckRun.Config.SheetId)
- sheet, err := e.store.GetSheet(ctx, &store.FindSheetMessage{UID: &sheetID}, api.SystemBotID)
+ sheetUID := int(planCheckRun.Config.SheetUid)
+ sheet, err := e.store.GetSheet(ctx, &store.FindSheetMessage{UID: &sheetUID}, api.SystemBotID)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get sheet %d", sheetID)
+ return nil, errors.Wrapf(err, "failed to get sheet %d", sheetUID)
}
if sheet == nil {
- return nil, errors.Errorf("sheet %d not found", sheetID)
+ return nil, errors.Errorf("sheet %d not found", sheetUID)
}
if sheet.Size > common.MaxSheetSizeForTaskCheck {
return []*storepb.PlanCheckRunResult_Result{
@@ -85,9 +93,9 @@ func (e *StatementTypeExecutor) Run(ctx context.Context, planCheckRun *store.Pla
}, nil
}
- statement, err := e.store.GetSheetStatementByID(ctx, sheetID)
+ statement, err := e.store.GetSheetStatementByID(ctx, sheetUID)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get sheet statement %d", sheetID)
+ return nil, errors.Wrapf(err, "failed to get sheet statement %d", sheetUID)
}
materials := backendutils.GetSecretMapFromDatabaseMessage(database)
diff --git a/frontend/src/types/proto/store/plan_check_run.ts b/frontend/src/types/proto/store/plan_check_run.ts
index 67df32d4fd..98822171cc 100644
--- a/frontend/src/types/proto/store/plan_check_run.ts
+++ b/frontend/src/types/proto/store/plan_check_run.ts
@@ -6,11 +6,10 @@ import { ChangedResources } from "./instance_change_history";
export const protobufPackage = "bytebase.store";
export interface PlanCheckRunConfig {
- sheetId: number;
- instanceId: number;
- databaseId: number;
+ sheetUid: number;
changeDatabaseType: PlanCheckRunConfig_ChangeDatabaseType;
- pitrConfig?: PlanCheckRunConfig_PitrConfig | undefined;
+ databaseTarget?: PlanCheckRunConfig_DatabaseTarget | undefined;
+ databaseGroupTarget?: PlanCheckRunConfig_DatabaseGroupTarget | undefined;
}
export enum PlanCheckRunConfig_ChangeDatabaseType {
@@ -58,9 +57,13 @@ export function planCheckRunConfig_ChangeDatabaseTypeToJSON(object: PlanCheckRun
}
}
-export interface PlanCheckRunConfig_PitrConfig {
- targetInstanceId: number;
- targetDatabaseName: string;
+export interface PlanCheckRunConfig_DatabaseTarget {
+ instanceUid: number;
+ databaseName: string;
+}
+
+export interface PlanCheckRunConfig_DatabaseGroupTarget {
+ databaseGroupUid: number;
}
export interface PlanCheckRunResult {
@@ -139,25 +142,22 @@ export interface PlanCheckRunResult_Result_SqlReviewReport {
}
function createBasePlanCheckRunConfig(): PlanCheckRunConfig {
- return { sheetId: 0, instanceId: 0, databaseId: 0, changeDatabaseType: 0, pitrConfig: undefined };
+ return { sheetUid: 0, changeDatabaseType: 0, databaseTarget: undefined, databaseGroupTarget: undefined };
}
export const PlanCheckRunConfig = {
encode(message: PlanCheckRunConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.sheetId !== 0) {
- writer.uint32(8).int32(message.sheetId);
- }
- if (message.instanceId !== 0) {
- writer.uint32(16).int32(message.instanceId);
- }
- if (message.databaseId !== 0) {
- writer.uint32(24).int32(message.databaseId);
+ if (message.sheetUid !== 0) {
+ writer.uint32(8).int32(message.sheetUid);
}
if (message.changeDatabaseType !== 0) {
- writer.uint32(32).int32(message.changeDatabaseType);
+ writer.uint32(16).int32(message.changeDatabaseType);
}
- if (message.pitrConfig !== undefined) {
- PlanCheckRunConfig_PitrConfig.encode(message.pitrConfig, writer.uint32(42).fork()).ldelim();
+ if (message.databaseTarget !== undefined) {
+ PlanCheckRunConfig_DatabaseTarget.encode(message.databaseTarget, writer.uint32(26).fork()).ldelim();
+ }
+ if (message.databaseGroupTarget !== undefined) {
+ PlanCheckRunConfig_DatabaseGroupTarget.encode(message.databaseGroupTarget, writer.uint32(34).fork()).ldelim();
}
return writer;
},
@@ -174,35 +174,28 @@ export const PlanCheckRunConfig = {
break;
}
- message.sheetId = reader.int32();
+ message.sheetUid = reader.int32();
continue;
case 2:
if (tag !== 16) {
break;
}
- message.instanceId = reader.int32();
+ message.changeDatabaseType = reader.int32() as any;
continue;
case 3:
- if (tag !== 24) {
+ if (tag !== 26) {
break;
}
- message.databaseId = reader.int32();
+ message.databaseTarget = PlanCheckRunConfig_DatabaseTarget.decode(reader, reader.uint32());
continue;
case 4:
- if (tag !== 32) {
- break;
- }
-
- message.changeDatabaseType = reader.int32() as any;
- continue;
- case 5:
- if (tag !== 42) {
+ if (tag !== 34) {
break;
}
- message.pitrConfig = PlanCheckRunConfig_PitrConfig.decode(reader, reader.uint32());
+ message.databaseGroupTarget = PlanCheckRunConfig_DatabaseGroupTarget.decode(reader, reader.uint32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -215,25 +208,30 @@ export const PlanCheckRunConfig = {
fromJSON(object: any): PlanCheckRunConfig {
return {
- sheetId: isSet(object.sheetId) ? Number(object.sheetId) : 0,
- instanceId: isSet(object.instanceId) ? Number(object.instanceId) : 0,
- databaseId: isSet(object.databaseId) ? Number(object.databaseId) : 0,
+ sheetUid: isSet(object.sheetUid) ? Number(object.sheetUid) : 0,
changeDatabaseType: isSet(object.changeDatabaseType)
? planCheckRunConfig_ChangeDatabaseTypeFromJSON(object.changeDatabaseType)
: 0,
- pitrConfig: isSet(object.pitrConfig) ? PlanCheckRunConfig_PitrConfig.fromJSON(object.pitrConfig) : undefined,
+ databaseTarget: isSet(object.databaseTarget)
+ ? PlanCheckRunConfig_DatabaseTarget.fromJSON(object.databaseTarget)
+ : undefined,
+ databaseGroupTarget: isSet(object.databaseGroupTarget)
+ ? PlanCheckRunConfig_DatabaseGroupTarget.fromJSON(object.databaseGroupTarget)
+ : undefined,
};
},
toJSON(message: PlanCheckRunConfig): unknown {
const obj: any = {};
- message.sheetId !== undefined && (obj.sheetId = Math.round(message.sheetId));
- message.instanceId !== undefined && (obj.instanceId = Math.round(message.instanceId));
- message.databaseId !== undefined && (obj.databaseId = Math.round(message.databaseId));
+ message.sheetUid !== undefined && (obj.sheetUid = Math.round(message.sheetUid));
message.changeDatabaseType !== undefined &&
(obj.changeDatabaseType = planCheckRunConfig_ChangeDatabaseTypeToJSON(message.changeDatabaseType));
- message.pitrConfig !== undefined &&
- (obj.pitrConfig = message.pitrConfig ? PlanCheckRunConfig_PitrConfig.toJSON(message.pitrConfig) : undefined);
+ message.databaseTarget !== undefined && (obj.databaseTarget = message.databaseTarget
+ ? PlanCheckRunConfig_DatabaseTarget.toJSON(message.databaseTarget)
+ : undefined);
+ message.databaseGroupTarget !== undefined && (obj.databaseGroupTarget = message.databaseGroupTarget
+ ? PlanCheckRunConfig_DatabaseGroupTarget.toJSON(message.databaseGroupTarget)
+ : undefined);
return obj;
},
@@ -243,36 +241,37 @@ export const PlanCheckRunConfig = {
fromPartial(object: DeepPartial<PlanCheckRunConfig>): PlanCheckRunConfig {
const message = createBasePlanCheckRunConfig();
- message.sheetId = object.sheetId ?? 0;
- message.instanceId = object.instanceId ?? 0;
- message.databaseId = object.databaseId ?? 0;
+ message.sheetUid = object.sheetUid ?? 0;
message.changeDatabaseType = object.changeDatabaseType ?? 0;
- message.pitrConfig = (object.pitrConfig !== undefined && object.pitrConfig !== null)
- ? PlanCheckRunConfig_PitrConfig.fromPartial(object.pitrConfig)
+ message.databaseTarget = (object.databaseTarget !== undefined && object.databaseTarget !== null)
+ ? PlanCheckRunConfig_DatabaseTarget.fromPartial(object.databaseTarget)
+ : undefined;
+ message.databaseGroupTarget = (object.databaseGroupTarget !== undefined && object.databaseGroupTarget !== null)
+ ? PlanCheckRunConfig_DatabaseGroupTarget.fromPartial(object.databaseGroupTarget)
: undefined;
return message;
},
};
-function createBasePlanCheckRunConfig_PitrConfig(): PlanCheckRunConfig_PitrConfig {
- return { targetInstanceId: 0, targetDatabaseName: "" };
+function createBasePlanCheckRunConfig_DatabaseTarget(): PlanCheckRunConfig_DatabaseTarget {
+ return { instanceUid: 0, databaseName: "" };
}
-export const PlanCheckRunConfig_PitrConfig = {
- encode(message: PlanCheckRunConfig_PitrConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.targetInstanceId !== 0) {
- writer.uint32(8).int32(message.targetInstanceId);
+export const PlanCheckRunConfig_DatabaseTarget = {
+ encode(message: PlanCheckRunConfig_DatabaseTarget, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.instanceUid !== 0) {
+ writer.uint32(8).int32(message.instanceUid);
}
- if (message.targetDatabaseName !== "") {
- writer.uint32(18).string(message.targetDatabaseName);
+ if (message.databaseName !== "") {
+ writer.uint32(18).string(message.databaseName);
}
return writer;
},
- decode(input: _m0.Reader | Uint8Array, length?: number): PlanCheckRunConfig_PitrConfig {
+ decode(input: _m0.Reader | Uint8Array, length?: number): PlanCheckRunConfig_DatabaseTarget {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBasePlanCheckRunConfig_PitrConfig();
+ const message = createBasePlanCheckRunConfig_DatabaseTarget();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@@ -281,14 +280,14 @@ export const PlanCheckRunConfig_PitrConfig = {
break;
}
- message.targetInstanceId = reader.int32();
+ message.instanceUid = reader.int32();
continue;
case 2:
if (tag !== 18) {
break;
}
- message.targetDatabaseName = reader.string();
+ message.databaseName = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -299,28 +298,84 @@ export const PlanCheckRunConfig_PitrConfig = {
return message;
},
- fromJSON(object: any): PlanCheckRunConfig_PitrConfig {
+ fromJSON(object: any): PlanCheckRunConfig_DatabaseTarget {
return {
- targetInstanceId: isSet(object.targetInstanceId) ? Number(object.targetInstanceId) : 0,
- targetDatabaseName: isSet(object.targetDatabaseName) ? String(object.targetDatabaseName) : "",
+ instanceUid: isSet(object.instanceUid) ? Number(object.instanceUid) : 0,
+ databaseName: isSet(object.databaseName) ? String(object.databaseName) : "",
};
},
- toJSON(message: PlanCheckRunConfig_PitrConfig): unknown {
+ toJSON(message: PlanCheckRunConfig_DatabaseTarget): unknown {
+ const obj: any = {};
+ message.instanceUid !== undefined && (obj.instanceUid = Math.round(message.instanceUid));
+ message.databaseName !== undefined && (obj.databaseName = message.databaseName);
+ return obj;
+ },
+
+ create(base?: DeepPartial<PlanCheckRunConfig_DatabaseTarget>): PlanCheckRunConfig_DatabaseTarget {
+ return PlanCheckRunConfig_DatabaseTarget.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<PlanCheckRunConfig_DatabaseTarget>): PlanCheckRunConfig_DatabaseTarget {
+ const message = createBasePlanCheckRunConfig_DatabaseTarget();
+ message.instanceUid = object.instanceUid ?? 0;
+ message.databaseName = object.databaseName ?? "";
+ return message;
+ },
+};
+
+function createBasePlanCheckRunConfig_DatabaseGroupTarget(): PlanCheckRunConfig_DatabaseGroupTarget {
+ return { databaseGroupUid: 0 };
+}
+
+export const PlanCheckRunConfig_DatabaseGroupTarget = {
+ encode(message: PlanCheckRunConfig_DatabaseGroupTarget, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.databaseGroupUid !== 0) {
+ writer.uint32(8).int64(message.databaseGroupUid);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): PlanCheckRunConfig_DatabaseGroupTarget {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBasePlanCheckRunConfig_DatabaseGroupTarget();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 8) {
+ break;
+ }
+
+ message.databaseGroupUid = longToNumber(reader.int64() as Long);
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): PlanCheckRunConfig_DatabaseGroupTarget {
+ return { databaseGroupUid: isSet(object.databaseGroupUid) ? Number(object.databaseGroupUid) : 0 };
+ },
+
+ toJSON(message: PlanCheckRunConfig_DatabaseGroupTarget): unknown {
const obj: any = {};
- message.targetInstanceId !== undefined && (obj.targetInstanceId = Math.round(message.targetInstanceId));
- message.targetDatabaseName !== undefined && (obj.targetDatabaseName = message.targetDatabaseName);
+ message.databaseGroupUid !== undefined && (obj.databaseGroupUid = Math.round(message.databaseGroupUid));
return obj;
},
- create(base?: DeepPartial<PlanCheckRunConfig_PitrConfig>): PlanCheckRunConfig_PitrConfig {
- return PlanCheckRunConfig_PitrConfig.fromPartial(base ?? {});
+ create(base?: DeepPartial<PlanCheckRunConfig_DatabaseGroupTarget>): PlanCheckRunConfig_DatabaseGroupTarget {
+ return PlanCheckRunConfig_DatabaseGroupTarget.fromPartial(base ?? {});
},
- fromPartial(object: DeepPartial<PlanCheckRunConfig_PitrConfig>): PlanCheckRunConfig_PitrConfig {
- const message = createBasePlanCheckRunConfig_PitrConfig();
- message.targetInstanceId = object.targetInstanceId ?? 0;
- message.targetDatabaseName = object.targetDatabaseName ?? "";
+ fromPartial(object: DeepPartial<PlanCheckRunConfig_DatabaseGroupTarget>): PlanCheckRunConfig_DatabaseGroupTarget {
+ const message = createBasePlanCheckRunConfig_DatabaseGroupTarget();
+ message.databaseGroupUid = object.databaseGroupUid ?? 0;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/rollout_service.ts b/frontend/src/types/proto/v1/rollout_service.ts
index cbdec2a6ea..ce7b71f203 100644
--- a/frontend/src/types/proto/v1/rollout_service.ts
+++ b/frontend/src/types/proto/v1/rollout_service.ts
@@ -369,7 +369,10 @@ export interface PlanCheckRun {
uid: string;
type: PlanCheckRun_Type;
status: PlanCheckRun_Status;
- /** Format: instances/{instance}/databases/{database} */
+ /**
+ * Format: instances/{instance}/databases/{database}
+ * Format: projects/{project}/databaseGroups/{databaseGroup}
+ */
target: string;
/** Format: projects/{project}/sheets/{sheet} */
sheet: string;
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index fc9728a2eb..a8c42553cf 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -107,7 +107,8 @@
- [store/plan_check_run.proto](#store_plan_check_run-proto)
- [PlanCheckRunConfig](#bytebase-store-PlanCheckRunConfig)
- - [PlanCheckRunConfig.PitrConfig](#bytebase-store-PlanCheckRunConfig-PitrConfig)
+ - [PlanCheckRunConfig.DatabaseGroupTarget](#bytebase-store-PlanCheckRunConfig-DatabaseGroupTarget)
+ - [PlanCheckRunConfig.DatabaseTarget](#bytebase-store-PlanCheckRunConfig-DatabaseTarget)
- [PlanCheckRunResult](#bytebase-store-PlanCheckRunResult)
- [PlanCheckRunResult.Result](#bytebase-store-PlanCheckRunResult-Result)
- [PlanCheckRunResult.Result.SqlReviewReport](#bytebase-store-PlanCheckRunResult-Result-SqlReviewReport)
@@ -1653,27 +1654,41 @@ Type is the database change type.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| sheet_id | [int32](#int32) | | |
-| instance_id | [int32](#int32) | | |
-| database_id | [int32](#int32) | | |
+| sheet_uid | [int32](#int32) | | |
| change_database_type | [PlanCheckRunConfig.ChangeDatabaseType](#bytebase-store-PlanCheckRunConfig-ChangeDatabaseType) | | |
-| pitr_config | [PlanCheckRunConfig.PitrConfig](#bytebase-store-PlanCheckRunConfig-PitrConfig) | | |
+| database_target | [PlanCheckRunConfig.DatabaseTarget](#bytebase-store-PlanCheckRunConfig-DatabaseTarget) | | |
+| database_group_target | [PlanCheckRunConfig.DatabaseGroupTarget](#bytebase-store-PlanCheckRunConfig-DatabaseGroupTarget) | | |
-<a name="bytebase-store-PlanCheckRunConfig-PitrConfig"></a>
+<a name="bytebase-store-PlanCheckRunConfig-DatabaseGroupTarget"></a>
-### PlanCheckRunConfig.PitrConfig
+### PlanCheckRunConfig.DatabaseGroupTarget
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| target_instance_id | [int32](#int32) | | |
-| target_database_name | [string](#string) | | |
+| database_group_uid | [int64](#int64) | | |
+
+
+
+
+
+
+<a name="bytebase-store-PlanCheckRunConfig-DatabaseTarget"></a>
+
+### PlanCheckRunConfig.DatabaseTarget
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| instance_uid | [int32](#int32) | | |
+| database_name | [string](#string) | | |
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 62bab95244..05da4698ff 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -7386,7 +7386,7 @@ When paginating, all other parameters provided to `ListRolloutTaskRuns` must mat
| uid | [string](#string) | | The system-assigned, unique identifier for a resource. |
| type | [PlanCheckRun.Type](#bytebase-v1-PlanCheckRun-Type) | | |
| status | [PlanCheckRun.Status](#bytebase-v1-PlanCheckRun-Status) | | |
-| target | [string](#string) | | Format: instances/{instance}/databases/{database} |
+| target | [string](#string) | | Format: instances/{instance}/databases/{database} Format: projects/{project}/databaseGroups/{databaseGroup} |
| sheet | [string](#string) | | Format: projects/{project}/sheets/{sheet} |
| results | [PlanCheckRun.Result](#bytebase-v1-PlanCheckRun-Result) | repeated | |
| error | [string](#string) | | error is set if the Status is FAILED. |
diff --git a/proto/generated-go/store/plan_check_run.pb.go b/proto/generated-go/store/plan_check_run.pb.go
index 0bffe35b46..e86aee732c 100644
--- a/proto/generated-go/store/plan_check_run.pb.go
+++ b/proto/generated-go/store/plan_check_run.pb.go
@@ -129,11 +129,13 @@ type PlanCheckRunConfig struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- SheetId int32 `protobuf:"varint,1,opt,name=sheet_id,json=sheetId,proto3" json:"sheet_id,omitempty"`
- InstanceId int32 `protobuf:"varint,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
- DatabaseId int32 `protobuf:"varint,3,opt,name=database_id,json=databaseId,proto3" json:"database_id,omitempty"`
- ChangeDatabaseType PlanCheckRunConfig_ChangeDatabaseType `protobuf:"varint,4,opt,name=change_database_type,json=changeDatabaseType,proto3,enum=bytebase.store.PlanCheckRunConfig_ChangeDatabaseType" json:"change_database_type,omitempty"`
- PitrConfig *PlanCheckRunConfig_PitrConfig `protobuf:"bytes,5,opt,name=pitr_config,json=pitrConfig,proto3" json:"pitr_config,omitempty"`
+ SheetUid int32 `protobuf:"varint,1,opt,name=sheet_uid,json=sheetUid,proto3" json:"sheet_uid,omitempty"`
+ ChangeDatabaseType PlanCheckRunConfig_ChangeDatabaseType `protobuf:"varint,2,opt,name=change_database_type,json=changeDatabaseType,proto3,enum=bytebase.store.PlanCheckRunConfig_ChangeDatabaseType" json:"change_database_type,omitempty"`
+ // Types that are assignable to Target:
+ //
+ // *PlanCheckRunConfig_DatabaseTarget_
+ // *PlanCheckRunConfig_DatabaseGroupTarget_
+ Target isPlanCheckRunConfig_Target `protobuf_oneof:"target"`
}
func (x *PlanCheckRunConfig) Reset() {
@@ -168,41 +170,57 @@ func (*PlanCheckRunConfig) Descriptor() ([]byte, []int) {
return file_store_plan_check_run_proto_rawDescGZIP(), []int{0}
}
-func (x *PlanCheckRunConfig) GetSheetId() int32 {
+func (x *PlanCheckRunConfig) GetSheetUid() int32 {
if x != nil {
- return x.SheetId
+ return x.SheetUid
}
return 0
}
-func (x *PlanCheckRunConfig) GetInstanceId() int32 {
+func (x *PlanCheckRunConfig) GetChangeDatabaseType() PlanCheckRunConfig_ChangeDatabaseType {
if x != nil {
- return x.InstanceId
+ return x.ChangeDatabaseType
}
- return 0
+ return PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED
}
-func (x *PlanCheckRunConfig) GetDatabaseId() int32 {
- if x != nil {
- return x.DatabaseId
+func (m *PlanCheckRunConfig) GetTarget() isPlanCheckRunConfig_Target {
+ if m != nil {
+ return m.Target
}
- return 0
+ return nil
}
-func (x *PlanCheckRunConfig) GetChangeDatabaseType() PlanCheckRunConfig_ChangeDatabaseType {
- if x != nil {
- return x.ChangeDatabaseType
+func (x *PlanCheckRunConfig) GetDatabaseTarget() *PlanCheckRunConfig_DatabaseTarget {
+ if x, ok := x.GetTarget().(*PlanCheckRunConfig_DatabaseTarget_); ok {
+ return x.DatabaseTarget
}
- return PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED
+ return nil
}
-func (x *PlanCheckRunConfig) GetPitrConfig() *PlanCheckRunConfig_PitrConfig {
- if x != nil {
- return x.PitrConfig
+func (x *PlanCheckRunConfig) GetDatabaseGroupTarget() *PlanCheckRunConfig_DatabaseGroupTarget {
+ if x, ok := x.GetTarget().(*PlanCheckRunConfig_DatabaseGroupTarget_); ok {
+ return x.DatabaseGroupTarget
}
return nil
}
+type isPlanCheckRunConfig_Target interface {
+ isPlanCheckRunConfig_Target()
+}
+
+type PlanCheckRunConfig_DatabaseTarget_ struct {
+ DatabaseTarget *PlanCheckRunConfig_DatabaseTarget `protobuf:"bytes,3,opt,name=database_target,json=databaseTarget,proto3,oneof"`
+}
+
+type PlanCheckRunConfig_DatabaseGroupTarget_ struct {
+ DatabaseGroupTarget *PlanCheckRunConfig_DatabaseGroupTarget `protobuf:"bytes,4,opt,name=database_group_target,json=databaseGroupTarget,proto3,oneof"`
+}
+
+func (*PlanCheckRunConfig_DatabaseTarget_) isPlanCheckRunConfig_Target() {}
+
+func (*PlanCheckRunConfig_DatabaseGroupTarget_) isPlanCheckRunConfig_Target() {}
+
type PlanCheckRunResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -258,17 +276,17 @@ func (x *PlanCheckRunResult) GetError() string {
return ""
}
-type PlanCheckRunConfig_PitrConfig struct {
+type PlanCheckRunConfig_DatabaseTarget struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- TargetInstanceId int32 `protobuf:"varint,1,opt,name=target_instance_id,json=targetInstanceId,proto3" json:"target_instance_id,omitempty"`
- TargetDatabaseName string `protobuf:"bytes,2,opt,name=target_database_name,json=targetDatabaseName,proto3" json:"target_database_name,omitempty"`
+ InstanceUid int32 `protobuf:"varint,1,opt,name=instance_uid,json=instanceUid,proto3" json:"instance_uid,omitempty"`
+ DatabaseName string `protobuf:"bytes,2,opt,name=database_name,json=databaseName,proto3" json:"database_name,omitempty"`
}
-func (x *PlanCheckRunConfig_PitrConfig) Reset() {
- *x = PlanCheckRunConfig_PitrConfig{}
+func (x *PlanCheckRunConfig_DatabaseTarget) Reset() {
+ *x = PlanCheckRunConfig_DatabaseTarget{}
if protoimpl.UnsafeEnabled {
mi := &file_store_plan_check_run_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -276,13 +294,13 @@ func (x *PlanCheckRunConfig_PitrConfig) Reset() {
}
}
-func (x *PlanCheckRunConfig_PitrConfig) String() string {
+func (x *PlanCheckRunConfig_DatabaseTarget) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*PlanCheckRunConfig_PitrConfig) ProtoMessage() {}
+func (*PlanCheckRunConfig_DatabaseTarget) ProtoMessage() {}
-func (x *PlanCheckRunConfig_PitrConfig) ProtoReflect() protoreflect.Message {
+func (x *PlanCheckRunConfig_DatabaseTarget) ProtoReflect() protoreflect.Message {
mi := &file_store_plan_check_run_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -294,25 +312,72 @@ func (x *PlanCheckRunConfig_PitrConfig) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
-// Deprecated: Use PlanCheckRunConfig_PitrConfig.ProtoReflect.Descriptor instead.
-func (*PlanCheckRunConfig_PitrConfig) Descriptor() ([]byte, []int) {
+// Deprecated: Use PlanCheckRunConfig_DatabaseTarget.ProtoReflect.Descriptor instead.
+func (*PlanCheckRunConfig_DatabaseTarget) Descriptor() ([]byte, []int) {
return file_store_plan_check_run_proto_rawDescGZIP(), []int{0, 0}
}
-func (x *PlanCheckRunConfig_PitrConfig) GetTargetInstanceId() int32 {
+func (x *PlanCheckRunConfig_DatabaseTarget) GetInstanceUid() int32 {
if x != nil {
- return x.TargetInstanceId
+ return x.InstanceUid
}
return 0
}
-func (x *PlanCheckRunConfig_PitrConfig) GetTargetDatabaseName() string {
+func (x *PlanCheckRunConfig_DatabaseTarget) GetDatabaseName() string {
if x != nil {
- return x.TargetDatabaseName
+ return x.DatabaseName
}
return ""
}
+type PlanCheckRunConfig_DatabaseGroupTarget struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ DatabaseGroupUid int64 `protobuf:"varint,1,opt,name=database_group_uid,json=databaseGroupUid,proto3" json:"database_group_uid,omitempty"`
+}
+
+func (x *PlanCheckRunConfig_DatabaseGroupTarget) Reset() {
+ *x = PlanCheckRunConfig_DatabaseGroupTarget{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_plan_check_run_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *PlanCheckRunConfig_DatabaseGroupTarget) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*PlanCheckRunConfig_DatabaseGroupTarget) ProtoMessage() {}
+
+func (x *PlanCheckRunConfig_DatabaseGroupTarget) ProtoReflect() protoreflect.Message {
+ mi := &file_store_plan_check_run_proto_msgTypes[3]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use PlanCheckRunConfig_DatabaseGroupTarget.ProtoReflect.Descriptor instead.
+func (*PlanCheckRunConfig_DatabaseGroupTarget) Descriptor() ([]byte, []int) {
+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{0, 1}
+}
+
+func (x *PlanCheckRunConfig_DatabaseGroupTarget) GetDatabaseGroupUid() int64 {
+ if x != nil {
+ return x.DatabaseGroupUid
+ }
+ return 0
+}
+
type PlanCheckRunResult_Result struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -332,7 +397,7 @@ type PlanCheckRunResult_Result struct {
func (x *PlanCheckRunResult_Result) Reset() {
*x = PlanCheckRunResult_Result{}
if protoimpl.UnsafeEnabled {
- mi := &file_store_plan_check_run_proto_msgTypes[3]
+ mi := &file_store_plan_check_run_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -345,7 +410,7 @@ func (x *PlanCheckRunResult_Result) String() string {
func (*PlanCheckRunResult_Result) ProtoMessage() {}
func (x *PlanCheckRunResult_Result) ProtoReflect() protoreflect.Message {
- mi := &file_store_plan_check_run_proto_msgTypes[3]
+ mi := &file_store_plan_check_run_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -441,7 +506,7 @@ type PlanCheckRunResult_Result_SqlSummaryReport struct {
func (x *PlanCheckRunResult_Result_SqlSummaryReport) Reset() {
*x = PlanCheckRunResult_Result_SqlSummaryReport{}
if protoimpl.UnsafeEnabled {
- mi := &file_store_plan_check_run_proto_msgTypes[4]
+ mi := &file_store_plan_check_run_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -454,7 +519,7 @@ func (x *PlanCheckRunResult_Result_SqlSummaryReport) String() string {
func (*PlanCheckRunResult_Result_SqlSummaryReport) ProtoMessage() {}
func (x *PlanCheckRunResult_Result_SqlSummaryReport) ProtoReflect() protoreflect.Message {
- mi := &file_store_plan_check_run_proto_msgTypes[4]
+ mi := &file_store_plan_check_run_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -513,7 +578,7 @@ type PlanCheckRunResult_Result_SqlReviewReport struct {
func (x *PlanCheckRunResult_Result_SqlReviewReport) Reset() {
*x = PlanCheckRunResult_Result_SqlReviewReport{}
if protoimpl.UnsafeEnabled {
- mi := &file_store_plan_check_run_proto_msgTypes[5]
+ mi := &file_store_plan_check_run_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -526,7 +591,7 @@ func (x *PlanCheckRunResult_Result_SqlReviewReport) String() string {
func (*PlanCheckRunResult_Result_SqlReviewReport) ProtoMessage() {}
func (x *PlanCheckRunResult_Result_SqlReviewReport) ProtoReflect() protoreflect.Message {
- mi := &file_store_plan_check_run_proto_msgTypes[5]
+ mi := &file_store_plan_check_run_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -578,94 +643,101 @@ var file_store_plan_check_run_proto_rawDesc = []byte{
0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x23, 0x73, 0x74,
0x6f, 0x72, 0x65, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61,
0x6e, 0x67, 0x65, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x22, 0xef, 0x03, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52,
- 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x65, 0x65,
- 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x68, 0x65, 0x65,
- 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f,
- 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
- 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
- 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x67, 0x0a, 0x14, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f,
- 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20,
+ 0x6f, 0x22, 0xe6, 0x04, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52,
+ 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x65, 0x65,
+ 0x74, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x68, 0x65,
+ 0x65, 0x74, 0x55, 0x69, 0x64, 0x12, 0x67, 0x0a, 0x14, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f,
+ 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75,
0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61,
0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x12, 0x63, 0x68, 0x61, 0x6e,
- 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x4e,
- 0x0a, 0x0b, 0x70, 0x69, 0x74, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75,
- 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x69, 0x74, 0x72, 0x43, 0x6f, 0x6e, 0x66,
- 0x69, 0x67, 0x52, 0x0a, 0x70, 0x69, 0x74, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x6c,
- 0x0a, 0x0a, 0x50, 0x69, 0x74, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2c, 0x0a, 0x12,
- 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f,
- 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
- 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x74, 0x61,
- 0x72, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61,
- 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
- 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x55, 0x0a, 0x12,
- 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79,
- 0x70, 0x65, 0x12, 0x24, 0x0a, 0x20, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x44, 0x41, 0x54,
- 0x41, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
- 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x44, 0x4c, 0x10,
- 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x44,
- 0x4c, 0x10, 0x03, 0x22, 0xdf, 0x06, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63,
- 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x43, 0x0a, 0x07, 0x72, 0x65,
- 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x79,
+ 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x5c,
+ 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65,
+ 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65,
+ 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x44, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x64, 0x61,
+ 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x6c, 0x0a, 0x15,
+ 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x74,
+ 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x62, 0x79,
0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61,
- 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e,
- 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12,
- 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
- 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0xed, 0x05, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
- 0x12, 0x48, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
- 0x32, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65,
- 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74,
- 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69,
- 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
- 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f,
- 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x6a,
- 0x0a, 0x12, 0x73, 0x71, 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x65,
- 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e,
- 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52,
- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79,
- 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x10, 0x73, 0x71, 0x6c, 0x53, 0x75, 0x6d,
- 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x67, 0x0a, 0x11, 0x73, 0x71,
- 0x6c, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18,
- 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b,
- 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
- 0x2e, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74,
- 0x48, 0x00, 0x52, 0x0f, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70,
- 0x6f, 0x72, 0x74, 0x1a, 0xc3, 0x01, 0x0a, 0x10, 0x53, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61,
- 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f,
- 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18,
- 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74,
- 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65,
- 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x61, 0x66,
- 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x4d, 0x0a, 0x11, 0x63, 0x68,
- 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18,
- 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65,
- 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64,
- 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x69, 0x0a, 0x0f, 0x53, 0x71, 0x6c,
- 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04,
- 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65,
- 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
- 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61,
- 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c,
- 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04,
- 0x63, 0x6f, 0x64, 0x65, 0x22, 0x45, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16,
- 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
- 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10,
- 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0b,
- 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x03, 0x42, 0x08, 0x0a, 0x06, 0x72,
- 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
- 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x33,
+ 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e,
+ 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x61, 0x72,
+ 0x67, 0x65, 0x74, 0x48, 0x00, 0x52, 0x13, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x47,
+ 0x72, 0x6f, 0x75, 0x70, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x1a, 0x58, 0x0a, 0x0e, 0x44, 0x61,
+ 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x0c,
+ 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x69, 0x64, 0x12,
+ 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
+ 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x43, 0x0a, 0x13, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
+ 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x64,
+ 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x69,
+ 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
+ 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x55, 0x69, 0x64, 0x22, 0x55, 0x0a, 0x12, 0x43, 0x68, 0x61,
+ 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12,
+ 0x24, 0x0a, 0x20, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41,
+ 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
+ 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x44, 0x4c, 0x10, 0x01, 0x12, 0x07,
+ 0x0a, 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x44, 0x4c, 0x10, 0x03,
+ 0x42, 0x08, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0xdf, 0x06, 0x0a, 0x12, 0x50,
+ 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c,
+ 0x74, 0x12, 0x43, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03,
+ 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,
+ 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e,
+ 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72,
+ 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0xed, 0x05, 0x0a,
+ 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65,
+ 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75,
+ 0x6c, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
+ 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
+ 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52,
+ 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x73, 0x71, 0x6c, 0x5f, 0x73, 0x75, 0x6d,
+ 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
+ 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52,
+ 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c,
+ 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52,
+ 0x10, 0x73, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72,
+ 0x74, 0x12, 0x67, 0x0a, 0x11, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f,
+ 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c,
+ 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
+ 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65,
+ 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x71, 0x6c, 0x52, 0x65,
+ 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0xc3, 0x01, 0x0a, 0x10, 0x53,
+ 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12,
+ 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63,
+ 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x74,
+ 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d,
+ 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20,
+ 0x01, 0x28, 0x03, 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77,
+ 0x73, 0x12, 0x4d, 0x0a, 0x11, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68,
+ 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10,
+ 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
+ 0x1a, 0x69, 0x0a, 0x0f, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70,
+ 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x03, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d,
+ 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12,
+ 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18,
+ 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x45, 0x0a, 0x06, 0x53,
+ 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a,
+ 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e,
+ 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53,
+ 0x10, 0x03, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x14, 0x5a, 0x12,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f,
+ 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -681,31 +753,33 @@ func file_store_plan_check_run_proto_rawDescGZIP() []byte {
}
var file_store_plan_check_run_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
-var file_store_plan_check_run_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
+var file_store_plan_check_run_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_store_plan_check_run_proto_goTypes = []interface{}{
(PlanCheckRunConfig_ChangeDatabaseType)(0), // 0: bytebase.store.PlanCheckRunConfig.ChangeDatabaseType
(PlanCheckRunResult_Result_Status)(0), // 1: bytebase.store.PlanCheckRunResult.Result.Status
(*PlanCheckRunConfig)(nil), // 2: bytebase.store.PlanCheckRunConfig
(*PlanCheckRunResult)(nil), // 3: bytebase.store.PlanCheckRunResult
- (*PlanCheckRunConfig_PitrConfig)(nil), // 4: bytebase.store.PlanCheckRunConfig.PitrConfig
- (*PlanCheckRunResult_Result)(nil), // 5: bytebase.store.PlanCheckRunResult.Result
- (*PlanCheckRunResult_Result_SqlSummaryReport)(nil), // 6: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport
- (*PlanCheckRunResult_Result_SqlReviewReport)(nil), // 7: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport
- (*ChangedResources)(nil), // 8: bytebase.store.ChangedResources
+ (*PlanCheckRunConfig_DatabaseTarget)(nil), // 4: bytebase.store.PlanCheckRunConfig.DatabaseTarget
+ (*PlanCheckRunConfig_DatabaseGroupTarget)(nil), // 5: bytebase.store.PlanCheckRunConfig.DatabaseGroupTarget
+ (*PlanCheckRunResult_Result)(nil), // 6: bytebase.store.PlanCheckRunResult.Result
+ (*PlanCheckRunResult_Result_SqlSummaryReport)(nil), // 7: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport
+ (*PlanCheckRunResult_Result_SqlReviewReport)(nil), // 8: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport
+ (*ChangedResources)(nil), // 9: bytebase.store.ChangedResources
}
var file_store_plan_check_run_proto_depIdxs = []int32{
0, // 0: bytebase.store.PlanCheckRunConfig.change_database_type:type_name -> bytebase.store.PlanCheckRunConfig.ChangeDatabaseType
- 4, // 1: bytebase.store.PlanCheckRunConfig.pitr_config:type_name -> bytebase.store.PlanCheckRunConfig.PitrConfig
- 5, // 2: bytebase.store.PlanCheckRunResult.results:type_name -> bytebase.store.PlanCheckRunResult.Result
- 1, // 3: bytebase.store.PlanCheckRunResult.Result.status:type_name -> bytebase.store.PlanCheckRunResult.Result.Status
- 6, // 4: bytebase.store.PlanCheckRunResult.Result.sql_summary_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport
- 7, // 5: bytebase.store.PlanCheckRunResult.Result.sql_review_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlReviewReport
- 8, // 6: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.store.ChangedResources
- 7, // [7:7] is the sub-list for method output_type
- 7, // [7:7] is the sub-list for method input_type
- 7, // [7:7] is the sub-list for extension type_name
- 7, // [7:7] is the sub-list for extension extendee
- 0, // [0:7] is the sub-list for field type_name
+ 4, // 1: bytebase.store.PlanCheckRunConfig.database_target:type_name -> bytebase.store.PlanCheckRunConfig.DatabaseTarget
+ 5, // 2: bytebase.store.PlanCheckRunConfig.database_group_target:type_name -> bytebase.store.PlanCheckRunConfig.DatabaseGroupTarget
+ 6, // 3: bytebase.store.PlanCheckRunResult.results:type_name -> bytebase.store.PlanCheckRunResult.Result
+ 1, // 4: bytebase.store.PlanCheckRunResult.Result.status:type_name -> bytebase.store.PlanCheckRunResult.Result.Status
+ 7, // 5: bytebase.store.PlanCheckRunResult.Result.sql_summary_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport
+ 8, // 6: bytebase.store.PlanCheckRunResult.Result.sql_review_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlReviewReport
+ 9, // 7: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.store.ChangedResources
+ 8, // [8:8] is the sub-list for method output_type
+ 8, // [8:8] is the sub-list for method input_type
+ 8, // [8:8] is the sub-list for extension type_name
+ 8, // [8:8] is the sub-list for extension extendee
+ 0, // [0:8] is the sub-list for field type_name
}
func init() { file_store_plan_check_run_proto_init() }
@@ -740,7 +814,7 @@ func file_store_plan_check_run_proto_init() {
}
}
file_store_plan_check_run_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PlanCheckRunConfig_PitrConfig); i {
+ switch v := v.(*PlanCheckRunConfig_DatabaseTarget); i {
case 0:
return &v.state
case 1:
@@ -752,7 +826,7 @@ func file_store_plan_check_run_proto_init() {
}
}
file_store_plan_check_run_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PlanCheckRunResult_Result); i {
+ switch v := v.(*PlanCheckRunConfig_DatabaseGroupTarget); i {
case 0:
return &v.state
case 1:
@@ -764,7 +838,7 @@ func file_store_plan_check_run_proto_init() {
}
}
file_store_plan_check_run_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PlanCheckRunResult_Result_SqlSummaryReport); i {
+ switch v := v.(*PlanCheckRunResult_Result); i {
case 0:
return &v.state
case 1:
@@ -776,6 +850,18 @@ func file_store_plan_check_run_proto_init() {
}
}
file_store_plan_check_run_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*PlanCheckRunResult_Result_SqlSummaryReport); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_plan_check_run_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlanCheckRunResult_Result_SqlReviewReport); i {
case 0:
return &v.state
@@ -788,7 +874,11 @@ func file_store_plan_check_run_proto_init() {
}
}
}
- file_store_plan_check_run_proto_msgTypes[3].OneofWrappers = []interface{}{
+ file_store_plan_check_run_proto_msgTypes[0].OneofWrappers = []interface{}{
+ (*PlanCheckRunConfig_DatabaseTarget_)(nil),
+ (*PlanCheckRunConfig_DatabaseGroupTarget_)(nil),
+ }
+ file_store_plan_check_run_proto_msgTypes[4].OneofWrappers = []interface{}{
(*PlanCheckRunResult_Result_SqlSummaryReport_)(nil),
(*PlanCheckRunResult_Result_SqlReviewReport_)(nil),
}
@@ -798,7 +888,7 @@ func file_store_plan_check_run_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_store_plan_check_run_proto_rawDesc,
NumEnums: 2,
- NumMessages: 6,
+ NumMessages: 7,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/proto/generated-go/v1/rollout_service.pb.go b/proto/generated-go/v1/rollout_service.pb.go
index e227a6c87b..063dfa895a 100644
--- a/proto/generated-go/v1/rollout_service.pb.go
+++ b/proto/generated-go/v1/rollout_service.pb.go
@@ -1443,6 +1443,7 @@ type PlanCheckRun struct {
Type PlanCheckRun_Type `protobuf:"varint,3,opt,name=type,proto3,enum=bytebase.v1.PlanCheckRun_Type" json:"type,omitempty"`
Status PlanCheckRun_Status `protobuf:"varint,4,opt,name=status,proto3,enum=bytebase.v1.PlanCheckRun_Status" json:"status,omitempty"`
// Format: instances/{instance}/databases/{database}
+ // Format: projects/{project}/databaseGroups/{databaseGroup}
Target string `protobuf:"bytes,5,opt,name=target,proto3" json:"target,omitempty"`
// Format: projects/{project}/sheets/{sheet}
Sheet string `protobuf:"bytes,6,opt,name=sheet,proto3" json:"sheet,omitempty"`
diff --git a/proto/store/plan_check_run.proto b/proto/store/plan_check_run.proto
index cf4f074566..302d6c3519 100644
--- a/proto/store/plan_check_run.proto
+++ b/proto/store/plan_check_run.proto
@@ -7,15 +7,20 @@ import "store/instance_change_history.proto";
option go_package = "generated-go/store";
message PlanCheckRunConfig {
- int32 sheet_id = 1;
- int32 instance_id = 2;
- int32 database_id = 3;
- ChangeDatabaseType change_database_type = 4;
- PitrConfig pitr_config = 5;
+ int32 sheet_uid = 1;
+ ChangeDatabaseType change_database_type = 2;
- message PitrConfig {
- int32 target_instance_id = 1;
- string target_database_name = 2;
+ oneof target {
+ DatabaseTarget database_target = 3;
+ DatabaseGroupTarget database_group_target = 4;
+ }
+
+ message DatabaseTarget {
+ int32 instance_uid = 1;
+ string database_name = 2;
+ }
+ message DatabaseGroupTarget {
+ int64 database_group_uid = 1;
}
enum ChangeDatabaseType {
diff --git a/proto/v1/rollout_service.proto b/proto/v1/rollout_service.proto
index dd99d1f7ff..240f010cbd 100644
--- a/proto/v1/rollout_service.proto
+++ b/proto/v1/rollout_service.proto
@@ -381,6 +381,7 @@ message PlanCheckRun {
Status status = 4;
// Format: instances/{instance}/databases/{database}
+ // Format: projects/{project}/databaseGroups/{databaseGroup}
string target = 5;
// Format: projects/{project}/sheets/{sheet}
string sheet = 6;