Swift: Retrieve zero or one row of data

Like single(), this sets the application/vnd.pgrst.object+json accept header so the server enforces a single result. Unlike single(), when the query does not match exactly one row the resulting PGRST116 error is not thrown — the response value is nil instead.

Examples

With `select()`

let todo: Todo? = try await supabase
  .from("todos")
  .select()
  .eq("id", value: 42)
  .maybeSingle()
  .execute()
  .value