Only check for username and password if driver type is mysql

This commit is contained in:
Aaron Ogle 2019-01-05 14:59:05 -06:00
parent bf7d422039
commit 3722c6ba79
No known key found for this signature in database
GPG key ID: 87F6DE6202656163

2
app.go
View file

@ -370,7 +370,7 @@ func Serve() {
app.formDecoder.RegisterConverter(sql.NullFloat64{}, converter.ConvertSQLNullFloat64)
// Check database configuration
if app.cfg.Database.User == "" || app.cfg.Database.Password == "" {
if app.cfg.Database.Type == "mysql" && (app.cfg.Database.User == "" || app.cfg.Database.Password == "") {
log.Error("Database user or password not set.")
os.Exit(1)
}