update multiple fields
Hi is there a other way to update multiple fields
currently i do it like this
9 Replies
You can pass an array to the set if I remember it correctly.
yes but i have diffet idΒ΄s
Maybe do that in a transaction if you are concerned about consistency (all or nothing).
This code is π until you have hundreds poll options. (Batch update)
How would you do that in SQL?
I like Drizzle bacause it doesn't abstract away too much, very close to sql and type safe
If you want to update different rows in SQL with different data, you need to write different queries, right?
i dont know
@RaphaΓ«l M (@rphlmr) β‘ is right then. As long as you're not updating a whole lot of rows. I would do it in a transaction just to be safe, remember that
Promise.all
is not great if some of your promises reject.
Maybe use Promise.allSettle
So you know what rejected and what workedLike so:
I believe you will have to explicitly put all the columns in the set: {}
This is a great way!
We will also make an
excluded
object available in callback, so you'll have a native suppoort for it