Skip to content

Commit

Permalink
Implementing new methods from servercfg.DoltgresConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
fulghum committed Jan 9, 2025
1 parent 7f91aea commit 727538e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions servercfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -227,6 +229,14 @@ 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) SkipRootUserInitialization() bool {
return false
}

func (cfg *DoltgresConfig) Password() string {
if cfg.UserConfig == nil || cfg.UserConfig.Password == nil {
return "password"
Expand Down

0 comments on commit 727538e

Please sign in to comment.