diff --git a/insert.go b/insert.go index cfcf307..878a531 100644 --- a/insert.go +++ b/insert.go @@ -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 { diff --git a/query.go b/query.go index 4aef703..1442c9b 100644 --- a/query.go +++ b/query.go @@ -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 {