Skip to content

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

chore: disallow using demo mode when using external pg (#9096)

Tianzhou (天舟)bb92410d41bd
diff --git a/backend/bin/server/cmd/root.go b/backend/bin/server/cmd/root.go
index e5d5b099a3..307e45cc8c 100644
--- a/backend/bin/server/cmd/root.go
+++ b/backend/bin/server/cmd/root.go
@@ -198,6 +198,7 @@ func start() {
return
}
}
+
if err := checkDataDir(); err != nil {
slog.Error(err.Error())
return
@@ -208,6 +209,14 @@ func start() {
return
}
+ // A safety measure to prevent accidentally resetting user's actual data with demo data.
+ // For emebeded mode, we control where data is stored and we put demo data in a separate directory
+ // from the non-demo data.
+ if flags.demoName != "" && flags.pgURL != "" {
+ slog.Error("demo mode is disallowed when storing metadata in external PostgreSQL instance")
+ return
+ }
+
profile := activeProfile(flags.dataDir)
// The ideal bootstrap order is: