Replies: 1 comment 3 replies
-
@JonoPrest you can do something like this: await db.insert(users)
.values([{ id: 1, name: 'Dan' }, { id: 2, name: 'John' }])
.onConflictDoUpdate((user) => { target: users.id, set: { name: sql`EXCLUDED.name` } });
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
We would love to be able to perform an "Upsert" on an array of values. In the docs all the demos are for single values passed in.
Current docs:
It would be great to be able to do something like this:
That way we can set values based on the specific user that caused the conflict. I'm not sure if there is a way to handle this use case currently but a callback might be the easiest way to implement something like this.
Beta Was this translation helpful? Give feedback.
All reactions