6 Replies
Just use an update statement with
where
in this case it will update all rows by a filter
simple update
will update all rowsthanks for getting back to me. I want do this by row ID as an identifier, not sure how to use the where statement like that.
this is what I currently have..
if you want to update each row with a different value - then it's not possible in SQL and then not possible in drizzle
actually I just searched a bit and it seems to be possible with sql
let me compose a query for that and check
This is how it would look like in sql
this will help you to make only 1 query to database
only case here - we don't have a support for
case when
in drizzle, but we have magical sql
template that may help here
so the only thing left is to properly build case-when statement
done, let me share a small example for that
some references
https://orm.drizzle.team/docs/sql#sqljoin
we have a full docs on advanced sql usage for cases, when drizzle doesn't have support for something
This code looks a bit harder, but you will get 1 query to database instead of multiple
basically we just built case-when
part in safe manner
and put it in update query to drizzleamazing, thank you so much!! Let me give this a go new
you just need to check that
inputs
array is >0
before building this query
and everything should work wellworks perfectly, thank you!!