From 0de6241e757b5cde78c6def1a8f7641b55eb4dc3 Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Thu, 9 Jan 2025 10:07:37 -0800 Subject: [PATCH] Implementing new methods from servercfg.DoltgresConfig --- server/server.go | 2 +- servercfg/config.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index 2b25e3b2e2..4486ceebff 100644 --- a/server/server.go +++ b/server/server.go @@ -156,7 +156,7 @@ func runServer(ctx context.Context, cfg *servercfg.DoltgresConfig, dEnv *env.Dol } }() - sqlserver.ConfigureServices(ssCfg, controller, Version, dEnv) + sqlserver.ConfigureServices(ssCfg, controller, Version, dEnv, false) go controller.Start(newCtx) err = controller.WaitForStart() diff --git a/servercfg/config.go b/servercfg/config.go index 5264a81668..e6d0b0f184 100755 --- a/servercfg/config.go +++ b/servercfg/config.go @@ -169,6 +169,8 @@ type DoltgresConfig struct { PostgresReplicationConfig *PostgresReplicationConfig `yaml:"postgres_replication,omitempty" minver:"0.7.4"` } +var _ servercfg.ServerConfig = (*DoltgresConfig)(nil) + // Ptr is a helper function that returns a pointer to the value passed in. This is necessary to e.g. get a pointer to // a const value without assigning to an intermediate variable. func Ptr[T any](v T) *T { @@ -227,6 +229,10 @@ func (cfg *DoltgresConfig) User() string { return *cfg.UserConfig.Name } +func (cfg *DoltgresConfig) UserIsSpecified() bool { + return cfg.UserConfig != nil && cfg.UserConfig.Name != nil +} + func (cfg *DoltgresConfig) Password() string { if cfg.UserConfig == nil || cfg.UserConfig.Password == nil { return "password"