1
0
forked from MTSR/mapserver
mapserver/db/postgres/util.go
Buckaroo Banzai be38c83fd8
db cleanup (#341)
* db cleanup

* dev

* pg setup

* postgres uuid migration

* cleanup

* fk

* sqlite migration

* cleanup

* wal

* max open conns = 1

* fix panic

---------

Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
2023-12-27 10:35:24 +01:00

23 lines
329 B
Go

package postgres
func (a *PostgresAccessor) intQuery(q string, params ...interface{}) int {
rows, err := a.db.Query(q, params...)
if err != nil {
panic(err)
}
defer rows.Close()
if rows.Next() {
var result int
err = rows.Scan(&result)
if err != nil {
panic(err)
}
return result
}
panic("no result!")
}