clean up comments, error message

This commit is contained in:
Stephanie You
2023-07-24 15:38:06 -07:00
parent f73d3e4141
commit 2eee7b1022
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -476,20 +476,20 @@ func (c ConnectionQueryist) Query(ctx *sql.Context, query string) (sql.Schema, s
// BuildConnectionStringQueryist returns a Queryist that connects to the server specified by the given server config. Presence in this
// module isn't ideal, but it's the only way to get the server config into the queryist.
func BuildConnectionStringQueryist(ctx context.Context, cwdFS filesys.Filesys, creds *cli.UserPassword, apr *argparser.ArgParseResults, host string, port int, useTLS bool, database string) (cli.LateBindQueryist, error) {
func BuildConnectionStringQueryist(ctx context.Context, cwdFS filesys.Filesys, creds *cli.UserPassword, apr *argparser.ArgParseResults, host string, port int, useTLS bool, dbRev string) (cli.LateBindQueryist, error) {
clientConfig, err := GetClientConfig(cwdFS, creds, apr)
if err != nil {
return nil, err
}
dbName, _ := dsess.SplitRevisionDbName(database)
// ParseDSN currently doesn't support `/` in the db name
dbName, _ := dsess.SplitRevisionDbName(dbRev)
parsedMySQLConfig, err := mysqlDriver.ParseDSN(ConnectionString(clientConfig, dbName))
if err != nil {
return nil, err
}
// ParseDSN currently doesn't support `/` in the db name
parsedMySQLConfig.DBName = database
parsedMySQLConfig.DBName = dbRev
parsedMySQLConfig.Addr = fmt.Sprintf("%s:%d", host, port)
if useTLS {
@@ -507,7 +507,7 @@ func BuildConnectionStringQueryist(ctx context.Context, cwdFS filesys.Filesys, c
var lateBind cli.LateBindQueryist = func(ctx context.Context) (cli.Queryist, *sql.Context, func(), error) {
sqlCtx := sql.NewContext(ctx)
sqlCtx.SetCurrentDatabase(database)
sqlCtx.SetCurrentDatabase(dbRev)
return queryist, sqlCtx, func() { conn.Conn(ctx) }, nil
}
+1 -1
View File
@@ -590,7 +590,7 @@ func buildLateBinder(ctx context.Context, cwdFS filesys.Filesys, mrEnv *env.Mult
dbName, _ := dsess.SplitRevisionDbName(useDb)
targetEnv = mrEnv.GetEnv(dbName)
if targetEnv == nil {
return nil, fmt.Errorf("The provided --use-db %s does not exist or is not a directory.", dbName)
return nil, fmt.Errorf("The provided --use-db %s does not exist.", dbName)
}
} else {
useDb = mrEnv.GetFirstDatabase()