For AI agents: the documentation index is at llms.txt. Guide pages have a markdown version at the same path with .md appended, before any query string or fragment.

Swift: Retrieve one row of data

By default PostgREST returns all JSON results in an array, even when there is only one item. Use single() to return the object without the array.

The query must match exactly one row. Otherwise the call throws a PostgrestError with code PGRST116.

Examples

With `select()`

try await supabase
  .from("instruments")
  .select("name")
  .limit(1)
  .single()
  .execute()