|
|
@ -134,10 +134,10 @@ func getEngine() (*xorm.Engine, error) { |
|
|
|
switch DbCfg.Type { |
|
|
|
switch DbCfg.Type { |
|
|
|
case "mysql": |
|
|
|
case "mysql": |
|
|
|
if DbCfg.Host[0] == '/' { // looks like a unix socket
|
|
|
|
if DbCfg.Host[0] == '/' { // looks like a unix socket
|
|
|
|
connStr = fmt.Sprintf("%s:%s@unix(%s)/%s%scharset=utf8&parseTime=true", |
|
|
|
connStr = fmt.Sprintf("%s:%s@unix(%s)/%s%scharset=utf8mb4,utf8&parseTime=true", |
|
|
|
DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name, Param) |
|
|
|
DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name, Param) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
connStr = fmt.Sprintf("%s:%s@tcp(%s)/%s%scharset=utf8&parseTime=true", |
|
|
|
connStr = fmt.Sprintf("%s:%s@tcp(%s)/%s%scharset=utf8mb4,utf8&parseTime=true", |
|
|
|
DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name, Param) |
|
|
|
DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name, Param) |
|
|
|
} |
|
|
|
} |
|
|
|
case "postgres": |
|
|
|
case "postgres": |
|
|
|