1
0
forked from MTSR/mapserver
mapserver/server/db/postgres/util.go

23 lines
335 B
Go
Raw Normal View History

2019-02-15 00:20:56 +03:00
package postgres
func (this *PostgresAccessor) intQuery(q string, params ...interface{}) int {
rows, err := this.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!")
}