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.

C#: Retrieve one row of data

Retrieves only one row from the result. Returns null when no row matches, the model when exactly one row matches, and throws a PostgrestException (status 406) when more than one row matches. Constrain the query (for example, filter on a primary key or unique column) so it can only match a single row.

Examples

With `Select()`

var result = await supabase.From<City>()
  .Select(x => new object[] { x.Name, x.CountryId })
  .Single();