I'll try anything now o.o

This commit is contained in:
Azareal 2018-08-29 13:31:52 +10:00
parent 6839dd5ffb
commit 28ba465c8a

View File

@ -5,7 +5,6 @@ import (
"database/sql"
"errors"
"fmt"
"log"
"runtime"
"strconv"
"strings"
@ -66,11 +65,13 @@ func (adapter *MysqlAdapter) BuildConn(config map[string]string) (*sql.DB, error
}
db, err := sql.Open("mysql", config["username"]+dbpassword+"@unix("+dbsocket+")/"+config["name"]+"?collation="+dbCollation+"&parseTime=true")
log.Print("err: ", err)
if err == nil {
// Make sure that the connection is alive
return db, db.Ping()
}
// Am I supposed to do this? o.O
db, err = nil, nil
}
// Open the database connection