我有这个 SQL 查询,它在隔离的情况下工作正常,2 行受影响绝对正常
update chores set life_status ='Processing' where life_status = 'Active' and chore_type ='Shared' and money_assigned > 0
但是当我在 golang 中尝试 gorm 的执行变体语句时,即
err := h.db.Raw("update chores set life_status ='Processing' where life_status = 'Active' and chore_type ='Shared' and money_assigned > ? ", 0).Error
或者
numRecsToProcess := h.db.Raw("update chores set life_status ='Processing' where life_status = 'Active' and chore_type ='Shared' and money_assigned > ? ", 0).RowsAffected
这些更新语句都不会影响基础数据库中的任何更改。Gorm 使用功能有什么我遗漏的吗?