Is there a way to retrieve the rows deleted when calling Delete()?
I'd like to avoid using 'SELECT ... FOR UPDATE' to first get the list of rows I'm deleting.
type MyModel struct {
gorm.Model
....
}
res := db.Where("updated_at < ?", expirationDate).
Set("gorm:save_associations", false).
Delete(&MyModel{})
I noticed there is a res.Value attribute but it seems to be the empty struct I pass as argument of Delete().