mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-28 12:40:16 -05:00
clean up comments, error message
This commit is contained in:
@@ -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
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user