Add a way to force update all cols #1465

Closed
opened 2019-10-23 09:38:52 +00:00 by Ghost · 2 comments

My problem is that I have a big table that contains data that can be either null/0/"" or contains actual values and it makes my update function look like this :

return engine.ID(o.ID).Cols("designations", "payement", "conditions", "notes", "planning", "addon", "contact", "custom_id", "object", "status", "date", "real_date", "connection", "validity_number", "validity_type", "total_ht", "total_ttc").Update(o)

Is there an existing way (not in the documentation) or could a function be added to allow the update of all cols ?

My problem is that I have a big table that contains data that can be either null/0/"" or contains actual values and it makes my update function look like this : ```golang return engine.ID(o.ID).Cols("designations", "payement", "conditions", "notes", "planning", "addon", "contact", "custom_id", "object", "status", "date", "real_date", "connection", "validity_number", "validity_type", "total_ht", "total_ttc").Update(o) ``` Is there an existing way (not in the documentation) or could a function be added to allow the update of all cols ?
Owner

you can use AllCols

you can use AllCols
Author

Thanks !

Thanks !
Ghost closed this issue 2019-10-23 13:07:01 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#1465
No description provided.