Replace dashes when using the default directory in sql-client

This commit is contained in:
Daylon Wilkins
2022-11-10 08:32:07 -08:00
parent d95cd6fa7c
commit 3e89cafa48
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ func (cmd SqlClientCmd) Exec(ctx context.Context, commandStr string, args []stri
cli.PrintErrln(color.RedString(err.Error()))
return 1
}
dbToUse = filepath.Base(directory)
dbToUse = strings.Replace(filepath.Base(directory), "-", "_", -1)
}
format := engine.FormatTabular
if hasResultFormat {
+10
View File
@@ -134,3 +134,13 @@ teardown() {
[ $status -ne 0 ]
[[ $output =~ "not found" ]] || false
}
@test "sql-client: handle dashes for implicit database" {
make_repo test-dashes
cd test-dashes
start_sql_server test-dashes
run dolt sql-client -u dolt -P $PORT -q "show databases"
[ $status -eq 0 ]
[[ $output =~ " test_dashes " ]] || false
}