func goSqlDriverOpener(username, password, dbName, host string, port int, connVars adapters.ConnVariables) (*sqlx.DB, error) { sourceString := fmt.Sprintf( "%s:%s@tcp(%s:%d)/%s?%s", username, password, host, port, dbName, connVars.Join("&")) db, err := sqlx.Connect("mysql", sourceString) if err != nil { return nil, errs.Wrap(err, errs.Info{}) } return db, nil }
func mymysqlDriverOpener(username, password, dbName, host string, port int, connVars adapters.ConnVariables) (*sqlx.DB, error) { sourceString := fmt.Sprintf( "tcp:%s:%d,%s*%s/%s/%s", host, port, connVars.Join(","), dbName, username, password) db, stdErr := sqlx.Connect("mymysql", sourceString) if stdErr != nil { return nil, errs.Wrap(stdErr, errs.Info{}) } return db, nil }