Fetch data: select()

Performs vertical filtering with SELECT.

const { data, error } = await supabase


  • columnsrequiredstring

    The columns to retrieve, separated by commas.

  • __namedParametersrequiredobject

    No description provided.

    • headrequiredboolean

      When set to true, select will void data.

    • countrequirednull | exact | planned | estimated

      Count algorithm to use to count rows in a table.


  • By default, Supabase projects will return a maximum of 1,000 rows. This setting can be changed Project API Settings. It's recommended that you keep it low to limit the payload size of accidental or malicious requests. You can use range() queries to paginate through your data.
  • select() can be combined with Modifiers
  • select() can be combined with Filters


Getting your data

const { data, error } = await supabase

Selecting specific columns

You can select specific fields from your tables.

const { data, error } = await supabase

Query foreign tables

If your database has relationships, you can query related tables too.

const { data, error } = await supabase
cities (

Query the same foreign table multiple times

Sometimes you will need to query the same foreign table twice. In this case, you can use the name of the joined column to identify which join you intend to use. For convenience, you can also give an alias for each column. For example, if we had a shop of products, and we wanted to get the supplier and the purchaser at the same time (both in the users) table:

const { data, error } = await supabase
supplier:supplier_id ( name ),
purchaser:purchaser_id ( name )

Querying with count option

You can get the number of rows by using the count option. Allowed values for count option are null, exact, planned and estimated.

const { data, error, count } = await postgrest
.select('name', { count: 'exact' })

Quering JSON data

If you have data inside of a JSONB column, you can apply select and query filters to the data values. Postgres offers a number of operators for querying JSON data. Also see PostgREST docs for more details.

const { data, error } = await supabase
id, name,
.eq('address->postcode', 90210)