be38c83fd8
* 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>
23 lines
329 B
Go
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!")
|
|
}
|