Home

Upsert data

Performs an UPSERT into the table.

  • Primary keys should be included in the data payload in order for an update to work correctly.
  • Primary keys must be natural, not surrogate. There are however, workarounds for surrogate primary keys.

final res = await supabase
  .from('messages')
  .upsert({ 'id': 3, 'message': 'foo', 'username': 'supabot' })
  .execute();
Need some help?

Not to worry, our specialist engineers are here to help. Submit a support ticket through the Dashboard.