Compare commits

..

No commits in common. "main" and "v0.0.14" have entirely different histories.

2 changed files with 3 additions and 9 deletions

View File

@ -1,11 +1,5 @@
package advsql package advsql
func Delete(db *Database, query string) DeleteFunc { func Delete[T any](db *Database, query string, encoder func(v *T, decode ScanFunc) error) DeleteFunc[T] {
prepareGlobal(db, query) return DeleteFunc[T](Insert(db, query, encoder))
return func(args ...interface{}) error {
s := db.stmt(query)
_, err := s.Exec(args...)
return err
}
} }

View File

@ -11,6 +11,6 @@ type QueryOneContextFunc[T any] func(ctx context.Context, args ...interface{}) *
type InsertFunc[T any] func(v *T) error type InsertFunc[T any] func(v *T) error
type UpdateFunc[T any] func(v *T) error type UpdateFunc[T any] func(v *T) error
type DeleteFunc func(args ...interface{}) error type DeleteFunc[T any] func(v *T) error
type ScanFunc = func(args ...interface{}) error type ScanFunc = func(args ...interface{}) error