Rename conflicted column (postgres)

I am having a bit of trouble getting this to work.
await db
.insert(schema.listings)
.values(listings)
.onConflictDoUpdate({
target: schema.listings.SKU,
set: {
SKU: sql`CONCAT(EXCLUDED.${schema.listings.SKU.name}, '-duplicate')`,
},
});
await db
.insert(schema.listings)
.values(listings)
.onConflictDoUpdate({
target: schema.listings.SKU,
set: {
SKU: sql`CONCAT(EXCLUDED.${schema.listings.SKU.name}, '-duplicate')`,
},
});
Error I get
Uncaught (in promise) PostgresError: syntax error at or near "$601"
Uncaught (in promise) PostgresError: syntax error at or near "$601"
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server