Moved show sql query setting to config
the build was successful
Details
the build was successful
Details
This commit is contained in:
parent
df0ad4adeb
commit
19852d0b6a
|
@ -8,6 +8,7 @@ User = root
|
||||||
Password = jup2000
|
Password = jup2000
|
||||||
Host = 127.0.0.1
|
Host = 127.0.0.1
|
||||||
Database = library2
|
Database = library2
|
||||||
|
ShowQueries = true
|
||||||
|
|
||||||
; First user to be created, on every startup the program checks if he exists, if not it creates it
|
; First user to be created, on every startup the program checks if he exists, if not it creates it
|
||||||
[User]
|
[User]
|
||||||
|
|
|
@ -8,14 +8,15 @@ import (
|
||||||
// ConfigStruct holds the config struct
|
// ConfigStruct holds the config struct
|
||||||
type ConfigStruct struct {
|
type ConfigStruct struct {
|
||||||
Database struct {
|
Database struct {
|
||||||
Host string
|
Host string
|
||||||
User string
|
User string
|
||||||
Password string
|
Password string
|
||||||
Database string
|
Database string
|
||||||
|
ShowQueries bool
|
||||||
}
|
}
|
||||||
|
|
||||||
JWTLoginSecret []byte
|
JWTLoginSecret []byte
|
||||||
Interface string
|
Interface string
|
||||||
|
|
||||||
FirstUser User `ini:"User"`
|
FirstUser User `ini:"User"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ func SetEngine() (err error) {
|
||||||
x.Sync(&Status{})
|
x.Sync(&Status{})
|
||||||
x.Sync(&Quantity{})
|
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
|
// Check if the first user already exists, aka a user with the ID = 1. If not, insert it
|
||||||
_, exists, err := GetUserByID(1)
|
_, exists, err := GetUserByID(1)
|
||||||
|
|
Loading…
Reference in New Issue