1

I have this SQL query, which in isolation works fine with 2 rows affected absolutely fine

update chores set life_status ='Processing' where life_status = 'Active' and chore_type ='Shared' and money_assigned > 0

But when I try gorm's execution variant statements in golang i.e.

err := h.db.Raw("update chores set life_status ='Processing' where life_status = 'Active' and chore_type ='Shared' and money_assigned > ? ", 0).Error

OR

numRecsToProcess := h.db.Raw("update chores set life_status ='Processing' where life_status = 'Active' and chore_type ='Shared' and money_assigned > ? ", 0).RowsAffected

None of these update statements are affecting any change in underlying DB. Is there something I am missing from Gorm usage functionality ?

4

1 に答える 1