I'm using the supabase js client. I have an array of records I'd like to insert into my table and return. The records must be unique, so if they already exists in the table they should be ignored, but all the records (regardless of whether they already existed or were newly created) should be returned.
Currently I have:
const values = await supabase.from(user_reftext)
.upsert(dataArray, {
onConflict: 'col_a, col_b', // these two columns must be unique
ignoreDuplicates: true
})
.select()
This only returns rows if they were inserted, but does not return them if they already existed in the table. Is there a way to have all rows returned in a concise way?