--MON--
--MON--
DTDrizzle Team
Created by --MON-- on 9/12/2023 in #help
onDuplicateKeyUpdate
i'm having problems using onDuplicateKeyUpdate, doing it like
// values is an array of entries
await db.insert(myTable).values(values).onDuplicateKeyUpdate({ set: {values } })
// values is an array of entries
await db.insert(myTable).values(values).onDuplicateKeyUpdate({ set: {values } })
causes an error TypeError: Cannot read properties of undefined (reading 'name') and doing it with set: { id: myTable.id } causes an error TypeError: Converting circular structure to JSON my goal is to update the whole entry/row when there's a conflict in the primary key which based on the name onDuplicateKeyUpdate gets triggered with
72 replies