Moved show sql query setting to config
the build was successful Details

This commit is contained in:
konrad 2017-11-16 13:09:30 +01:00 committed by kolaente
parent df0ad4adeb
commit 19852d0b6a
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 8 additions and 6 deletions

View File

@ -8,6 +8,7 @@ User = root
Password = jup2000
Host = 127.0.0.1
Database = library2
ShowQueries = true
; First user to be created, on every startup the program checks if he exists, if not it creates it
[User]

View File

@ -8,14 +8,15 @@ import (
// ConfigStruct holds the config struct
type ConfigStruct struct {
Database struct {
Host string
User string
Password string
Database string
Host string
User string
Password string
Database string
ShowQueries bool
}
JWTLoginSecret []byte
Interface string
Interface string
FirstUser User `ini:"User"`
}

View File

@ -33,7 +33,7 @@ func SetEngine() (err error) {
x.Sync(&Status{})
x.Sync(&Quantity{})
x.ShowSQL(true)
x.ShowSQL(Config.Database.ShowQueries)
// Check if the first user already exists, aka a user with the ID = 1. If not, insert it
_, exists, err := GetUserByID(1)