Mr Redactle
Mr Redactle
DTDrizzle Team
Created by Quea on 6/7/2023 in #help
onConflictDoUpdate array
Upserting multiple records where db.insert().values() take an array param rather than a single object.
19 replies
DTDrizzle Team
Created by Quea on 6/7/2023 in #help
onConflictDoUpdate array
Very helpful. Do you think you could update the docs so that there is an array example? The upsert examles there are trivial.
19 replies
DTDrizzle Team
Created by Quea on 6/7/2023 in #help
onConflictDoUpdate array
Late to the party but what you want is
set: { firstName: sql`EXCLUDED.first_name`, ... }
set: { firstName: sql`EXCLUDED.first_name`, ... }
For some reason it didn't work when I used templated column names after the EXCLUDED.
19 replies