Upsert on conflict
mansueli opened this issue · comments
It should be possible to use upsert on conflict
in supabase-py/postgrest-py client:
https://supabase.com/docs/reference/javascript/upsert#upsert-your-data
const { data, error } = await supabase
.from('users')
.upsert({ username: 'supabot' }, { onConflict: 'username' })
Right now, if you are upserting but the ID is auto-generated, then you end up with duplicated entries in the table.
Upsert on conflict allows you to prevent duplicated rows based on other columns.