{
+
+ db = db.Delete(deleteItems)
+ if db.Error != nil {
+ return noRowsAffected, fmt.Errorf("%s: %w", op, db.Error)
+ }
+ rowsDeleted := int(db.RowsAffected)
+ if rowsDeleted > 0 && opts.WithAfterWrite != nil {
if err := opts.WithAfterWrite(deleteItems, int(rowsDeleted)); err != nil {
return rowsDeleted, fmt.Errorf("%s: error after write: %w", op, err)
}
}
return rowsDeleted, nil
}
+
+type tableNamer interface {
+ TableName() string
+}
// Copyright (c) HashiCorp, Inc.
@@ -1245,7 +1311,7 @@
newRW := &RW{underlying: &DB{newTx}}
if err := handler(newRW, newRW); err != nil