|
|
|
@ -748,7 +748,7 @@ func connectToDatabase(app *App) { |
|
|
|
|
var db *sql.DB |
|
|
|
|
var err error |
|
|
|
|
if app.cfg.Database.Type == driverMySQL { |
|
|
|
|
db, err = sql.Open(app.cfg.Database.Type, fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=true&loc=%s", app.cfg.Database.User, app.cfg.Database.Password, app.cfg.Database.Host, app.cfg.Database.Port, app.cfg.Database.Database, url.QueryEscape(time.Local.String()))) |
|
|
|
|
db, err = sql.Open(app.cfg.Database.Type, fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=true&loc=%s&tls=%t", app.cfg.Database.User, app.cfg.Database.Password, app.cfg.Database.Host, app.cfg.Database.Port, app.cfg.Database.Database, url.QueryEscape(time.Local.String()), app.cfg.Database.TLS)) |
|
|
|
|
db.SetMaxOpenConns(50) |
|
|
|
|
} else if app.cfg.Database.Type == driverSQLite { |
|
|
|
|
if !SQLiteEnabled { |
|
|
|
|