select()

Perform a SELECT on the query result.

By default, .insert(), .update(), .upsert(), and .delete() do not return modified rows. By calling this method, modified rows are returned in data.

1const { data, error } = await supabase
2  .from('countries')
3  .upsert({ id: 1, name: 'Algeria' })
4  .select()

Parameters#

  • columnsoptional
    Query

    The columns to retrieve, separated by commas

Examples#

With upsert()#

1create table
2  countries (id int8 primary key, name text);
3
4insert into
5  countries (id, name)
6values
7  (1, 'Afghanistan');
1const { data, error } = await supabase
2  .from('countries')
3  .upsert({ id: 1, name: 'Algeria' })
4  .select()