Skip to main content
Version: v2 RC

single()

Return data as a single object instead of an array of objects.

Query result must be one row (e.g. using .limit(1)), otherwise this returns an error.

const { data, error } = await supabase
.from('countries')
.select('name')
.limit(1)
.single()

Examples

With select()

const { data, error } = await supabase
.from('countries')
.select('name')
.limit(1)
.single()