|
@@ -43,7 +43,7 @@ func (db *DBData) Create() {
|
|
|
}
|
|
|
|
|
|
func (db *DBData) GetSetting(setting string, ifMissing string) string {
|
|
|
- rows, err := db.DB.Query("SELECT value FROM settings WHERE username=? AND setting=?", db.User, setting)
|
|
|
+ rows, err := db.DB.Query("SELECT value FROM settings WHERE username=? AND setting=?;", db.User, setting)
|
|
|
if err != nil {
|
|
|
log.Panicln("Query GetSetting", err)
|
|
|
}
|
|
@@ -54,14 +54,17 @@ func (db *DBData) GetSetting(setting string, ifMissing string) string {
|
|
|
if err != nil {
|
|
|
log.Panicln("Scan GetSetting", err)
|
|
|
}
|
|
|
+ // log.Printf("GetSetting %s %s : %s\n", db.User, setting, value)
|
|
|
return value
|
|
|
}
|
|
|
+ // log.Printf("GetSetting %s %s :(", db.User, setting)
|
|
|
return ifMissing
|
|
|
}
|
|
|
|
|
|
func (db *DBData) SetSetting(setting string, value string) {
|
|
|
- _, err := db.DB.Query("REPLACE INTO settings(username, setting, value) VALUES(?,?,?)", db.User, setting, value)
|
|
|
+ _, err := db.DB.Exec("REPLACE INTO settings(username, setting, value) VALUES(?,?,?);", db.User, setting, value)
|
|
|
if err != nil {
|
|
|
log.Panicln("Query SetSetting", err)
|
|
|
}
|
|
|
+ // log.Printf("SetSetting %s %s = %s\n", db.User, setting, value)
|
|
|
}
|