mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-30 03:26:47 -05:00
Replace dashes when using the default directory in sql-client
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user