Skip to content

Commit

Permalink
fix yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cor committed Dec 13, 2024
1 parent 0f239c8 commit a4823b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go/cmd/dolt/commands/sqlserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ func portInUse(hostPort string) bool {
}

func newSessionBuilder(se *engine.SqlEngine, config servercfg.ServerConfig) server.SessionBuilder {
userToSessionVars := make(map[string]map[string]string)
userToSessionVars := make(map[string]map[string]interface{})
userVars := config.UserVars()
for _, curr := range userVars {
userToSessionVars[curr.Name] = curr.Vars
Expand Down
4 changes: 2 additions & 2 deletions go/libraries/doltcore/servercfg/yaml_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ func (r RemotesapiYAMLConfig) ReadOnly() bool {
}

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

// YAMLConfig is a ServerConfig implementation which is read from a yaml file
Expand Down
4 changes: 4 additions & 0 deletions integration-tests/bats/sql-server.bats
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ user_session_vars:
vars:
aws_credentials_file: /Users/user0/.aws/config
aws_credentials_profile: default
autocommit: 0
- name: user1
vars:
aws_credentials_file: /Users/user1/.aws/config
Expand All @@ -202,6 +203,9 @@ user_session_vars:

start_sql_server_with_config "" server.yaml

run dolt --host=127.0.0.1 --port=$PORT --no-tls --user=user0 --password=pass0 sql -q "SELECT @@autocommit;"
[[ "$output" =~ "1" ]] || false

run dolt --host=127.0.0.1 --port=$PORT --no-tls --user=user0 --password=pass0 sql -q "SELECT @@aws_credentials_file, @@aws_credentials_profile;"
[[ "$output" =~ /Users/user0/.aws/config.*default ]] || false

Expand Down

0 comments on commit a4823b5

Please sign in to comment.