Question: When doing a bulk insert https://supabas...
# javascript
m
Question: When doing a bulk insert https://supabase.com/docs/reference/javascript/insert#bulk-create is it guaranteed that the response array in
data
will always be in the same order as the original insert data? Eg:
Copy code
const { data, error } = await supabase.from("table").insert([{name: 'a'}, {name: 'b'}, {name: 'c'}])
console.log(data)
// data: {data: [{id: 1, name: 'a'}, {id: 2, name: 'b'}, {id: 3, name: 'c'}]}
s
By default it isn't guaranteed, but you can do:
Copy code
js
supabase.from("table").insert({..}).order("name")
To guarantee an order on the returned data.
m
Wow! Didn't even know that's a thing, how cool! Thanks so much @User 😄