Fetch data
Perform a SELECT query on the table or view.
- By default, Supabase projects return a maximum of 1,000 rows. This setting can be changed in your project's 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 Filtersselect()
can be combined with Modifiersapikey
is a reserved keyword if you're using the Supabase Platform and should be avoided as a column name.
Parameters
- columnsOptionalQuery
The columns to retrieve, separated by commas. Columns can be renamed when returned with `customName:columnName`
- optionsOptionalobject
Named parameters
countOptional"exact" | "planned" | "estimated"Count algorithm to use to count rows in the table or view. `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the hood. `"planned"`: Approximated but fast count algorithm. Uses the Postgres statistics under the hood. `"estimated"`: Uses exact count for low numbers and planned count for high numbers.
headOptionalbooleanWhen set to `true`, `data` will not be returned. Useful if you only need the count.
const { data, error } = await supabase
.from('countries')
.select()