Perform a SELECT query on the table or view.
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.The columns to retrieve, separated by commas. Columns can be renamed when returned with `customName:columnName`
Named parameters
const \{ data, error \} = await supabase
.from('characters')
.select()
const \{ data, error \} = await supabase
.from('characters')
.select('name')
const \{ data, error \} = await supabase
.from('orchestal_sections')
.select(`
name,
instruments (
name
)
`)
const \{ data, error \} = await supabase
.from('users')
.select(`
name,
teams (
name
)
`)
const \{ data, error \} = await supabase
.from('messages')
.select(`
content,
from:sender_id(name),
to:receiver_id(name)
`)
// To infer types, use the name of the table (in this case `users`) and
// the name of the foreign key constraint.
const \{ data, error \} = await supabase
.from('messages')
.select(`
content,
from:users!messages_sender_id_fkey(name),
to:users!messages_receiver_id_fkey(name)
`)
const \{ data, error \} = await supabase
.from('games')
.select(`
game_id:id,
away_team:teams!games_away_team_fkey (
users (
id,
name
)
)
`)
const \{ data, error \} = await supabase
.from('instruments')
.select('name, orchestral_sections(*)')
.eq('orchestral_sections.name', 'percussion')
const \{ data, error \} = await supabase
.from('orchestral_sections')
.select(`*, instruments(count)`)
const \{ count, error \} = await supabase
.from('characters')
.select('*', \{ count: 'exact', head: true \})
const \{ data, error \} = await supabase
.from('users')
.select(`
id, name,
address->city
`)
const \{ data, error \} = await supabase
.from('instruments')
.select('name, orchestral_sections!inner(name)')
.eq('orchestral_sections.name', 'woodwinds')
.limit(1)
const \{ data, error \} = await supabase
.schema('myschema')
.from('mytable')
.select()