panic on init error

This commit is contained in:
Timon Ringwald 2022-07-09 23:55:22 +02:00
parent 5f85c26d4a
commit 4346466345
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ package advsql
func Insert[T any](db *Database, query string, encoder func(v *T, encode EncodeFunc) error) InsertFunc[T] {
s, err := db.prepare(query)
if err != nil {
return nil
panic(err)
}
return func(value *T) error {

View File

@ -5,7 +5,7 @@ import "context"
func Query[T any](db *Database, query string, decoder func(v *T, decode DecodeFunc) error) QueryManyFunc[T] {
s, err := db.prepare(query)
if err != nil {
return nil
panic(err)
}
return func(args ...interface{}) <-chan *T {