Skip to content

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

feat: add ghost flags (#9199)

p0ny307f5258cabc
diff --git a/backend/component/ghost/config.go b/backend/component/ghost/config.go
index f944999892..02e0917113 100644
--- a/backend/component/ghost/config.go
+++ b/backend/component/ghost/config.go
@@ -58,6 +58,9 @@ type UserFlags struct {
assumeRBR *bool
heartbeatIntervalMillis *int64
niceRatio *float64
+ aliyunRDS *bool
+ azure *bool
+ gcp *bool
}
var knownKeys = map[string]bool{
@@ -73,6 +76,9 @@ var knownKeys = map[string]bool{
"assume-rbr": true,
"heartbeat-interval-millis": true,
"nice-ratio": true,
+ "aliyun-rds": true,
+ "azure": true,
+ "gcp": true,
}
func GetUserFlags(flags map[string]string) (*UserFlags, error) {
@@ -170,6 +176,27 @@ func GetUserFlags(flags map[string]string) (*UserFlags, error) {
}
f.niceRatio = &niceRatio
}
+ if v, ok := flags["aliyun-rds"]; ok {
+ aliyunRDS, err := strconv.ParseBool(v)
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to convert aliyun-rds %q to bool", v)
+ }
+ f.aliyunRDS = &aliyunRDS
+ }
+ if v, ok := flags["azure"]; ok {
+ azure, err := strconv.ParseBool(v)
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to convert azure %q to bool", v)
+ }
+ f.azure = &azure
+ }
+ if v, ok := flags["gcp"]; ok {
+ gcp, err := strconv.ParseBool(v)
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to convert gcp %q to bool", v)
+ }
+ f.gcp = &gcp
+ }
return f, nil
}
@@ -302,6 +329,15 @@ func NewMigrationContext(taskID int, database *store.DatabaseMessage, dataSource
if v := userFlags.niceRatio; v != nil {
migrationContext.SetNiceRatio(*v)
}
+ if v := userFlags.aliyunRDS; v != nil {
+ migrationContext.AliyunRDS = *v
+ }
+ if v := userFlags.azure; v != nil {
+ migrationContext.AzureMySQL = *v
+ }
+ if v := userFlags.gcp; v != nil {
+ migrationContext.GoogleCloudPlatform = *v
+ }
if migrationContext.SwitchToRowBinlogFormat && migrationContext.AssumeRBR {
return nil, errors.Errorf("switchToRBR and assumeRBR are mutually exclusive")
diff --git a/frontend/src/components/IssueV1/components/StageSection/Actions/GhostSection/FlagsForm/constants.ts b/frontend/src/components/IssueV1/components/StageSection/Actions/GhostSection/FlagsForm/constants.ts
index 9c8b0fac39..742a6c54b3 100644
--- a/frontend/src/components/IssueV1/components/StageSection/Actions/GhostSection/FlagsForm/constants.ts
+++ b/frontend/src/components/IssueV1/components/StageSection/Actions/GhostSection/FlagsForm/constants.ts
@@ -19,6 +19,9 @@ export const SupportedGhostParameters: GhostParameter[] = [
{ key: "assume-rbr", type: "bool", defaults: "false" },
{ key: "heart-beat-interval-millis", type: "int", defaults: "100" },
{ key: "nice-ratio", type: "float", defaults: "0" },
+ { key: "aliyun-rds", type: "bool", defaults: "false" },
+ { key: "azure", type: "bool", defaults: "false" },
+ { key: "gcp", type: "bool", defaults: "false" },
];
export const isBoolParameter = (