We were using drizzle orm but We implemented by ourselves a "multi-update" query to update fields based on different primary keys using the
CASE ... THEN
CASE ... THEN
postgres syntax, this forced us to use the sql magic operator. Is there a way to integrate the sql magic operator with the
timestamp
timestamp
type or with other custom types?
sql`WHEN ${where} THEN ${value}`
sql`WHEN ${where} THEN ${value}`
It seems that doing something like this does not apply the correct parsing on timestamps or defined custom types. Date in javascript doesnt use the correct toString function and the update expects a string so we had to manually check for a date object and apply