Fixed a bug when using sqlite
This commit is contained in:
parent
9e131e5ec0
commit
335f09749b
8
main.go
8
main.go
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user