mirror of
https://github.com/owncast/owncast.git
synced 2024-11-23 21:28:29 +03:00
2ccd3aad87
* It builds with the new user repository * fix(test): fix broken test * fix(api): fix registration endpoint that was broken after the change * fix(test): update test to reflect new user repository * fix: use interface type instead of concrete type * fix: restore commented out code
20 lines
337 B
Go
20 lines
337 B
Go
package utils
|
|
|
|
import (
|
|
"database/sql"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// MustExec will execute a SQL statement on a provided database instance.
|
|
func MustExec(s string, db *sql.DB) {
|
|
stmt, err := db.Prepare(s)
|
|
if err != nil {
|
|
log.Panic(err)
|
|
}
|
|
defer stmt.Close()
|
|
_, err = stmt.Exec()
|
|
if err != nil {
|
|
log.Warnln(err)
|
|
}
|
|
}
|