Open rakeshbala opened 4 years ago
I realized that I can do a find and then call Update
on the model struct. So that is a workaround. That is still 2 queries I guess and also wouldn't work when I want to update a bunch of rows.
Changing this issue to a feature request to add type-safe columns to UpdateAll
call. 🙂
Yep. Currently there's no way to do this. I'm not sure how you would accomplish it either (otherwise we probably would have done it!).
Perhaps you could pass in a single model to the UpdateAll call? And then also a boil.Columns?
Are type-safe updates possible? So far I've seen only an
UpdateAll
method which takes amap[string] interface{}
(as opposed to the type-specific columns in the where clauses).Apologies if I missed something in the documentation.