Fixed a bug when using sqlite

This commit is contained in:
Pär Karlsson 2015-08-02 01:35:22 +02:00
parent 9e131e5ec0
commit 335f09749b

View File

@ -60,10 +60,6 @@ func Open(dialect string, args ...interface{}) (DB, error) {
}
dbSql, err = sql.Open(driver, source)
if err == nil {
err = db.DB().Ping() // Send a ping to make sure the database connection is alive.
}
case sqlCommon:
source = reflect.Indirect(reflect.ValueOf(value)).FieldByName("dsn").String()
dbSql = value
@ -80,6 +76,10 @@ func Open(dialect string, args ...interface{}) (DB, error) {
db.parent = &db
}
if err == nil {
err = db.DB().Ping() // Send a ping to make sure the database connection is alive.
}
return db, err
}