From f43b29056db99849f48f5c87c37ee42dfbc93e0d Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 7 Aug 2017 11:33:52 +0800 Subject: [PATCH] fix bug on new engine (#679) --- xorm.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xorm.go b/xorm.go index 36895a9d..4434c7ff 100644 --- a/xorm.go +++ b/xorm.go @@ -50,10 +50,13 @@ func close(engine *Engine) { engine.Close() } +func init() { + regDrvsNDialects() +} + // NewEngine new a db manager according to the parameter. Currently support four // drivers func NewEngine(driverName string, dataSourceName string) (*Engine, error) { - regDrvsNDialects() driver := core.QueryDriver(driverName) if driver == nil { return nil, fmt.Errorf("Unsupported driver name: %v", driverName)