mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-09 17:53:59 +00:00
Select must be specific about what fields it wants
This commit is contained in:
parent
201ff39b80
commit
30d0e5d298
@ -414,7 +414,25 @@ func getReport(db *sql.DB) map[string]interface{} {
|
|||||||
var compilers []string
|
var compilers []string
|
||||||
var builders []string
|
var builders []string
|
||||||
|
|
||||||
rows, err := db.Query(`SELECT * FROM Reports WHERE Received > now() - '1 day'::INTERVAL`)
|
fields := []string{
|
||||||
|
"Received",
|
||||||
|
"UniqueID",
|
||||||
|
"Version",
|
||||||
|
"LongVersion",
|
||||||
|
"Platform",
|
||||||
|
"NumFolders",
|
||||||
|
"NumDevices",
|
||||||
|
"TotFiles",
|
||||||
|
"FolderMaxFiles",
|
||||||
|
"TotMiB",
|
||||||
|
"FolderMaxMiB",
|
||||||
|
"MemoryUsageMiB",
|
||||||
|
"SHA256Perf",
|
||||||
|
"MemorySize",
|
||||||
|
"Date",
|
||||||
|
}
|
||||||
|
|
||||||
|
rows, err := db.Query(`SELECT ` + strings.Join(fields, ",") + ` FROM Reports WHERE Received > now() - '1 day'::INTERVAL`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("sql:", err)
|
log.Println("sql:", err)
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user