for onConflict parameter in upsert, what if we wan...
# help
s
for onConflict parameter in upsert, what if we want to check on composite unique columns?
n
Hello @STILLWATER;! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
s
Copy code
js
const { data, error } = await supabase
  .from('users')
  .upsert({ username: 'supabot' }, { onConflict: 'username' })
can we pass array of colums there?
f
can u try with
{ onConflict: 'col1,col2' }
?
n
STILLWATER; (2022-04-07)
s
ill check that out
s
Yes, you can specify a comma-separated list of columns on on_conflict: https://postgrest.org/en/stable/api.html#on-conflict
s
Thanks
n
Thread was archived by @STILLWATER;. Anyone can send a message to unarchive it.