Open
Description
Improve documentation
Link
https://supabase.com/docs/reference/javascript/upsert?example=upserting-into-tables-with-constraints
Describe the problem
The example says that an error will be thrown. But the operation would actually successfully update the row to (42, 'saoirse', 'Saoirse')
. Because ignoreDuplicates
defaults to false. and the example operation specifies { onConflict: 'handle' }
. Therefore it should find row (1, 'saoirse', null)
and merge into it.
Describe the improvement
Update the example. I think the example was meant to refer to the case when { onConflict: 'handle' }
is NOT specified.
Also the doc currently doesn't say what the optional parameters default to.
P.S
I hope I am right about this - otherwise I would be very confused about how upsert
works with the client!