cfgdetails

package
v0.57.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevel_Trace   = "trace"
	LogLevel_Debug   = "debug"
	LogLevel_Info    = "info"
	LogLevel_Warning = "warn"
	LogLevel_Error   = "error"
	LogLevel_Fatal   = "fatal"
	LogLevel_Panic   = "panic"
)
View Source
const (
	DefaultHost                       = "localhost"
	DefaultPort                       = 5432
	DefaultUser                       = "postgres"
	DefaultPass                       = "password"
	DefaultTimeout                    = 8 * 60 * 60 * 1000 // 8 hours, same as MySQL
	DefaultReadOnly                   = false
	DefaultLogLevel                   = LogLevel_Info
	DefaultDoltTransactionCommit      = false
	DefaultMaxConnections             = 100
	DefaultDataDir                    = "."
	DefaultCfgDir                     = ".doltcfg"
	DefaultPrivilegeFilePath          = "privileges.db"
	DefaultAuthFilePath               = "auth.db"
	DefaultBranchControlFilePath      = "branch_control.db"
	DefaultMetricsHost                = ""
	DefaultMetricsPort                = -1
	DefaultAllowCleartextPasswords    = false
	DefaultPostgresUnixSocketFilePath = "/tmp/.s.PGSQL.5432"
	DefaultMaxLoggedQueryLen          = 0
	DefaultEncodeLoggedQuery          = false
)
View Source
const DOLTGRES_DATA_DIR = "DOLTGRES_DATA_DIR"

DOLTGRES_DATA_DIR is an environment variable that defines the location of DoltgreSQL databases

View Source
const DOLTGRES_DATA_DIR_DEFAULT = "doltgres/databases"

DOLTGRES_DATA_DIR_DEFAULT is the portion to append to the user's home directory if DOLTGRES_DATA_DIR has not been specified

View Source
const (
	OverrideDataDirKey = "data_dir"
)

Variables

View Source
var ConfigHelp = "Supported fields in the config.yaml file, and their default values, " +
	"are as follows:\n\n" + InternalDefaultServerConfig().String()

Functions

func Ptr

func Ptr[T any](v T) *T

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.

Types

type DoltgesMetricsConfig

type DoltgesMetricsConfig struct {
	Labels  map[string]string `yaml:"labels,omitempty" minver:"0.7.4"`
	Host    *string           `yaml:"host,omitempty" minver:"0.7.4"`
	Port    *int              `yaml:"port,omitempty" minver:"0.7.4"`
	TlsCert *string           `yaml:"tls_cert,omitempty" minver:"0.53.5"`
	TlsKey  *string           `yaml:"tls_key,omitempty" minver:"0.53.5"`
	TlsCa   *string           `yaml:"tls_ca,omitempty" minver:"0.53.5"`
}

type DoltgresAutoGCBehavior

type DoltgresAutoGCBehavior struct {
}

DoltgresAutoGCBehavior implements Dolt's doltservercfg.AutoGCBehavior.

func (DoltgresAutoGCBehavior) ArchiveLevel

func (DoltgresAutoGCBehavior) ArchiveLevel() int

func (DoltgresAutoGCBehavior) Enable

func (DoltgresAutoGCBehavior) Enable() bool

func (DoltgresAutoGCBehavior) IncrementalFileSize added in v0.56.3

func (DoltgresAutoGCBehavior) IncrementalFileSize() uint64

type DoltgresBehaviorConfig

type DoltgresBehaviorConfig struct {
	ReadOnly *bool `yaml:"read_only,omitempty" minver:"0.7.4"`
	// Disable processing CLIENT_MULTI_STATEMENTS support on the
	// sql server.  Dolt's handling of CLIENT_MULTI_STATEMENTS is currently
	// broken. If a client advertises to support it (mysql cli client
	// does), and then sends statements that contain embedded unquoted ';'s
	// (such as a CREATE TRIGGER), then those incoming queries will be
	// misprocessed.
	DisableClientMultiStatements *bool `yaml:"disable_client_multi_statements,omitempty" minver:"0.7.4"`
	// DoltTransactionCommit enables the @@dolt_transaction_commit system variable, which
	// automatically creates a Dolt commit when any SQL transaction is committed.
	DoltTransactionCommit *bool `yaml:"dolt_transaction_commit,omitempty" minver:"0.7.4"`
}

DoltgresBehaviorConfig contains server configuration regarding how the server should behave

type DoltgresClusterConfig added in v0.56.5

type DoltgresClusterConfig struct {
	StandbyRemotes []DoltgresStandbyRemoteConfig   `yaml:"standby_remotes"`
	BootstrapRole  string                          `yaml:"bootstrap_role"`
	BootstrapEpoch int                             `yaml:"bootstrap_epoch"`
	RemotesAPI     DoltgresClusterRemotesAPIConfig `yaml:"remotesapi"`
}

DoltgresClusterConfig mirrors Dolt's cluster replication configuration so that ported cluster config files parse under UnmarshalStrict. These fields are accepted but not yet wired into the server.

type DoltgresClusterRemotesAPIConfig added in v0.56.5

type DoltgresClusterRemotesAPIConfig struct {
	Addr       string   `yaml:"address"`
	Port       int      `yaml:"port"`
	TLSKey     string   `yaml:"tls_key"`
	TLSCert    string   `yaml:"tls_cert"`
	TLSCA      string   `yaml:"tls_ca"`
	URLMatches []string `yaml:"server_name_urls"`
	DNSMatches []string `yaml:"server_name_dns"`
}

type DoltgresConfig

type DoltgresConfig struct {
	LogLevelStr       *string                    `yaml:"log_level,omitempty" minver:"0.7.4"`
	MaxLenInLogs      *int                       `yaml:"max_query_len_in_logs,omitempty" minver:"0.7.4"`
	EncodeLoggedQuery *bool                      `yaml:"encode_logged_query,omitempty" minver:"0.7.4"`
	BehaviorConfig    *DoltgresBehaviorConfig    `yaml:"behavior,omitempty" minver:"0.7.4"`
	UserConfig        *DoltgresUserConfig        `yaml:"user,omitempty" minver:"0.7.4"`
	ListenerConfig    *DoltgresListenerConfig    `yaml:"listener,omitempty" minver:"0.7.4"`
	PerformanceConfig *DoltgresPerformanceConfig `yaml:"performance,omitempty" minver:"0.7.4"`
	DataDirStr        *string                    `yaml:"data_dir,omitempty" minver:"0.7.4"`
	CfgDirStr         *string                    `yaml:"cfg_dir,omitempty" minver:"0.7.4"`
	MetricsConfig     *DoltgesMetricsConfig      `yaml:"metrics,omitempty" minver:"0.7.4"`
	RemotesapiConfig  *DoltgresRemotesapiConfig  `yaml:"remotesapi,omitempty" minver:"0.7.4"`
	PrivilegeFile     *string                    `yaml:"privilege_file,omitempty" minver:"0.7.4"`
	AuthFile          *string                    `yaml:"auth_file,omitempty" minver:"0.54.4"`
	BranchControlFile *string                    `yaml:"branch_control_file,omitempty" minver:"0.7.4"`

	// TODO: Rename to UserVars_
	Vars            []DoltgresUserSessionVars  `yaml:"user_session_vars,omitempty" minver:"0.7.4"`
	SystemVariables map[string]interface{}     `yaml:"system_variables,omitempty" minver:"0.7.4"`
	Jwks            []doltservercfg.JwksConfig `yaml:"jwks,omitempty" minver:"0.7.4"`
	GoldenMysqlConn *string                    `yaml:"golden_mysql_conn,omitempty" minver:"0.7.4"`

	PostgresReplicationConfig *PostgresReplicationConfig `yaml:"postgres_replication,omitempty" minver:"0.7.4"`

	// ClusterConfig mirrors Dolt's cluster replication configuration. Cluster
	// replication is not yet implemented in Doltgres; this is accepted so that
	// cluster config files parse (the integration tests for cluster
	// replication are ported but skipped until the feature lands). The shape
	// mirrors Dolt's ClusterYAMLConfig.
	ClusterCfg *DoltgresClusterConfig `yaml:"cluster,omitempty" minver:"TBD"`
}

DoltgresConfig is the internal Doltgres configuration file implementation. This should not be used directly, and instead `servercfg.DoltgresConfig` should be used.

func InternalDefaultServerConfig

func InternalDefaultServerConfig() *DoltgresConfig

InternalDefaultServerConfig should not be called directly. Use `servercfg.DefaultServerConfig` instead.

func (*DoltgresConfig) AllowCleartextPasswords

func (cfg *DoltgresConfig) AllowCleartextPasswords() bool

func (*DoltgresConfig) AuthFilePath

func (cfg *DoltgresConfig) AuthFilePath() string

func (*DoltgresConfig) AutoCommit

func (cfg *DoltgresConfig) AutoCommit() bool

func (*DoltgresConfig) AutoGCBehavior

func (cfg *DoltgresConfig) AutoGCBehavior() doltservercfg.AutoGCBehavior

func (*DoltgresConfig) BranchActivityTracking

func (cfg *DoltgresConfig) BranchActivityTracking() bool

func (*DoltgresConfig) BranchControlFilePath

func (cfg *DoltgresConfig) BranchControlFilePath() string

func (*DoltgresConfig) CACert

func (cfg *DoltgresConfig) CACert() string

func (*DoltgresConfig) CfgDir

func (cfg *DoltgresConfig) CfgDir() string

func (*DoltgresConfig) ClusterConfig

func (cfg *DoltgresConfig) ClusterConfig() doltservercfg.ClusterConfig

func (*DoltgresConfig) DataDir

func (cfg *DoltgresConfig) DataDir() string

func (*DoltgresConfig) DisableClientMultiStatements

func (cfg *DoltgresConfig) DisableClientMultiStatements() bool

func (*DoltgresConfig) DoltTransactionCommit

func (cfg *DoltgresConfig) DoltTransactionCommit() bool

func (*DoltgresConfig) EventSchedulerStatus

func (cfg *DoltgresConfig) EventSchedulerStatus() string

func (*DoltgresConfig) Host

func (cfg *DoltgresConfig) Host() string

func (*DoltgresConfig) JwksConfig

func (cfg *DoltgresConfig) JwksConfig() []doltservercfg.JwksConfig

func (*DoltgresConfig) LogFormat

func (cfg *DoltgresConfig) LogFormat() doltservercfg.LogFormat

func (*DoltgresConfig) LogLevel

func (cfg *DoltgresConfig) LogLevel() doltservercfg.LogLevel

func (*DoltgresConfig) MCPDatabase

func (cfg *DoltgresConfig) MCPDatabase() *string

MCPDatabase returns nil for Doltgres; MCP is not configured here.

func (*DoltgresConfig) MCPPassword

func (cfg *DoltgresConfig) MCPPassword() *string

MCPPassword returns nil for Doltgres; MCP is not configured here.

func (*DoltgresConfig) MCPPort

func (cfg *DoltgresConfig) MCPPort() *int

MCPPort returns nil for Doltgres; MCP HTTP server is not configured here.

func (*DoltgresConfig) MCPUser

func (cfg *DoltgresConfig) MCPUser() *string

MCPUser returns nil for Doltgres; MCP is not configured here.

func (*DoltgresConfig) MaxConnections

func (cfg *DoltgresConfig) MaxConnections() uint64

func (*DoltgresConfig) MaxLoggedQueryLen

func (cfg *DoltgresConfig) MaxLoggedQueryLen() int

func (*DoltgresConfig) MaxWaitConnections

func (cfg *DoltgresConfig) MaxWaitConnections() uint32

func (*DoltgresConfig) MaxWaitConnectionsTimeout

func (cfg *DoltgresConfig) MaxWaitConnectionsTimeout() time.Duration

func (*DoltgresConfig) MetricsHost

func (cfg *DoltgresConfig) MetricsHost() string

func (*DoltgresConfig) MetricsJWTRequiredForLocalhost

func (cfg *DoltgresConfig) MetricsJWTRequiredForLocalhost() bool

func (*DoltgresConfig) MetricsJwksConfig

func (cfg *DoltgresConfig) MetricsJwksConfig() *doltservercfg.JwksConfig

func (*DoltgresConfig) MetricsLabels

func (cfg *DoltgresConfig) MetricsLabels() map[string]string

func (*DoltgresConfig) MetricsPort

func (cfg *DoltgresConfig) MetricsPort() int

func (*DoltgresConfig) MetricsTLSCA

func (cfg *DoltgresConfig) MetricsTLSCA() string

func (*DoltgresConfig) MetricsTLSCert

func (cfg *DoltgresConfig) MetricsTLSCert() string

func (*DoltgresConfig) MetricsTLSKey

func (cfg *DoltgresConfig) MetricsTLSKey() string

func (*DoltgresConfig) Overrides

func (*DoltgresConfig) Overrides() sql.EngineOverrides

func (*DoltgresConfig) Password

func (cfg *DoltgresConfig) Password() string

func (*DoltgresConfig) Port

func (cfg *DoltgresConfig) Port() int

func (*DoltgresConfig) PrivilegeFilePath

func (cfg *DoltgresConfig) PrivilegeFilePath() string

func (*DoltgresConfig) ReadOnly

func (cfg *DoltgresConfig) ReadOnly() bool

func (*DoltgresConfig) ReadTimeout

func (cfg *DoltgresConfig) ReadTimeout() uint64

func (*DoltgresConfig) RemotesapiPort

func (cfg *DoltgresConfig) RemotesapiPort() *int

func (*DoltgresConfig) RemotesapiReadOnly

func (cfg *DoltgresConfig) RemotesapiReadOnly() *bool

func (*DoltgresConfig) RequireClientCert

func (cfg *DoltgresConfig) RequireClientCert() bool

func (*DoltgresConfig) RequireSecureTransport

func (cfg *DoltgresConfig) RequireSecureTransport() bool

func (*DoltgresConfig) ShouldEncodeLoggedQuery

func (cfg *DoltgresConfig) ShouldEncodeLoggedQuery() bool

func (*DoltgresConfig) Socket

func (cfg *DoltgresConfig) Socket() string

func (*DoltgresConfig) String

func (cfg *DoltgresConfig) String() string

func (*DoltgresConfig) SystemVars

func (cfg *DoltgresConfig) SystemVars() map[string]interface{}

func (*DoltgresConfig) TLSCert

func (cfg *DoltgresConfig) TLSCert() string

func (*DoltgresConfig) TLSKey

func (cfg *DoltgresConfig) TLSKey() string

func (*DoltgresConfig) User

func (cfg *DoltgresConfig) User() string

func (*DoltgresConfig) UserIsSpecified

func (cfg *DoltgresConfig) UserIsSpecified() bool

func (*DoltgresConfig) UserVars

func (cfg *DoltgresConfig) UserVars() []doltservercfg.UserSessionVars

func (*DoltgresConfig) ValueSet

func (cfg *DoltgresConfig) ValueSet(value string) bool

func (*DoltgresConfig) WriteTimeout

func (cfg *DoltgresConfig) WriteTimeout() uint64

type DoltgresListenerConfig

type DoltgresListenerConfig struct {
	HostStr            *string `yaml:"host,omitempty" minver:"0.7.4"`
	PortNumber         *int    `yaml:"port,omitempty" minver:"0.7.4"`
	ReadTimeoutMillis  *uint64 `yaml:"read_timeout_millis,omitempty" minver:"0.7.4"`
	WriteTimeoutMillis *uint64 `yaml:"write_timeout_millis,omitempty" minver:"0.7.4"`
	// TLSKey is a file system path to an unencrypted private TLS key in PEM format.
	TLSKey *string `yaml:"tls_key,omitempty" minver:"0.7.4"`
	// TLSCert is a file system path to a TLS certificate chain in PEM format.
	TLSCert *string `yaml:"tls_cert,omitempty" minver:"0.7.4"`
	// RequireSecureTransport can enable a mode where non-TLS connections are turned away.
	RequireSecureTransport *bool `yaml:"require_secure_transport,omitempty" minver:"0.7.4"`
	// AllowCleartextPasswords enables use of cleartext passwords.
	AllowCleartextPasswords *bool `yaml:"allow_cleartext_passwords,omitempty" minver:"0.7.4"`
	// Socket is unix socket file path
	Socket *string `yaml:"socket,omitempty" minver:"0.7.4"`
}

DoltgresListenerConfig contains information on the network connection that the server will open

type DoltgresPerformanceConfig

type DoltgresPerformanceConfig struct {
	QueryParallelism *int `yaml:"query_parallelism,omitempty" minver:"0.7.4"`
}

DoltgresPerformanceConfig contains configuration parameters for performance tweaking

type DoltgresRemotesapiConfig

type DoltgresRemotesapiConfig struct {
	Port     *int  `yaml:"port,omitempty" minver:"0.7.4"`
	ReadOnly *bool `yaml:"read_only,omitempty" minver:"0.7.4"`
}

type DoltgresStandbyRemoteConfig added in v0.56.5

type DoltgresStandbyRemoteConfig struct {
	Name              string `yaml:"name"`
	RemoteURLTemplate string `yaml:"remote_url_template"`
}

type DoltgresUserConfig

type DoltgresUserConfig struct {
	Name     *string `yaml:"name,omitempty" minver:"0.7.4"`
	Password *string `yaml:"password,omitempty" minver:"0.7.4"`
}

type DoltgresUserSessionVars

type DoltgresUserSessionVars struct {
	Name string                 `yaml:"name"`
	Vars map[string]interface{} `yaml:"vars,omitempty"`
}

type PostgresReplicationConfig

type PostgresReplicationConfig struct {
	PostgresServerAddress *string `yaml:"postgres_server_address,omitempty" minver:"0.7.4"`
	PostgresUser          *string `yaml:"postgres_user,omitempty" minver:"0.7.4"`
	PostgresPassword      *string `yaml:"postgres_password,omitempty" minver:"0.7.4"`
	PostgresDatabase      *string `yaml:"postgres_database,omitempty" minver:"0.7.4"`
	PostgresPort          *int    `yaml:"postgres_port,omitempty" minver:"0.7.4"`
	SlotName              *string `yaml:"slot_name,omitempty" minver:"0.7.4"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL