Skip to content

Commit

Permalink
Merge pull request #7673 from dolthub/fulghum/docs
Browse files Browse the repository at this point in the history
CLI Docs: Adding docs for `system_variables` field in config.yaml for sql-server command
  • Loading branch information
fulghum committed Apr 1, 2024
2 parents 053e6ca + ab373eb commit ebbea9a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/cmd/dolt/commands/sqlserver/sqlserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ SUPPORTED CONFIG FILE FIELDS:
{{.EmphasisLeft}}remotesapi.read_only{{.EmphasisRight}}: Boolean flag which disables the ability to perform pushes against the server.
{{.EmphasisLeft}}system_variables{{.EmphasisRight}}: A map of system variable name to desired value for all system variable values to override.
{{.EmphasisLeft}}user_session_vars{{.EmphasisRight}}: A map of user name to a map of session variables to set on connection for each session.
{{.EmphasisLeft}}cluster{{.EmphasisRight}}: Settings related to running this server in a replicated cluster. For information on setting these values, see https://docs.dolthub.com/sql-reference/server/replication
Expand Down
2 changes: 2 additions & 0 deletions go/cmd/dolt/commands/sqlserver/yaml_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ func YamlConfigFromFile(fs filesys.Filesys, path string) (ServerConfig, error) {
}

func ServerConfigAsYAMLConfig(cfg ServerConfig) *YAMLConfig {
systemVars := cfg.SystemVars()
return &YAMLConfig{
LogLevelStr: strPtr(string(cfg.LogLevel())),
MaxQueryLenInLogs: nillableIntPtr(cfg.MaxLoggedQueryLen()),
Expand Down Expand Up @@ -237,6 +238,7 @@ func ServerConfigAsYAMLConfig(cfg ServerConfig) *YAMLConfig {
ClusterCfg: clusterConfigAsYAMLConfig(cfg.ClusterConfig()),
PrivilegeFile: strPtr(cfg.PrivilegeFilePath()),
BranchControlFile: strPtr(cfg.BranchControlFilePath()),
SystemVars_: &systemVars,
Vars: cfg.UserVars(),
Jwks: cfg.JwksConfig(),
}
Expand Down
1 change: 1 addition & 0 deletions go/cmd/dolt/commands/sqlserver/yaml_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ jwks:
},
}
expected.DataDirStr = strPtr("some nonsense")
expected.SystemVars_ = nil
expected.Vars = []UserSessionVars{
{
Name: "user0",
Expand Down

0 comments on commit ebbea9a

Please sign in to comment.