panic on init error
This commit is contained in:
parent
5f85c26d4a
commit
4346466345
@ -3,7 +3,7 @@ package advsql
|
|||||||
func Insert[T any](db *Database, query string, encoder func(v *T, encode EncodeFunc) error) InsertFunc[T] {
|
func Insert[T any](db *Database, query string, encoder func(v *T, encode EncodeFunc) error) InsertFunc[T] {
|
||||||
s, err := db.prepare(query)
|
s, err := db.prepare(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return func(value *T) error {
|
return func(value *T) error {
|
||||||
|
2
query.go
2
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] {
|
func Query[T any](db *Database, query string, decoder func(v *T, decode DecodeFunc) error) QueryManyFunc[T] {
|
||||||
s, err := db.prepare(query)
|
s, err := db.prepare(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return func(args ...interface{}) <-chan *T {
|
return func(args ...interface{}) <-chan *T {
|
||||||
|
Loading…
Reference in New Issue
Block a user