Swift: Match the filter

filter() expects you to use the raw PostgREST syntax for the filter values.

.filter("id", operator: .in, value: "(5,6,7)")  // Use `()` for `in` filter
.filter("arraycol", operator: .cs, value: #"\{"a","b"\}"#)  // Use `cs` for `contains()`, `\{\}` for array values

Examples

With `select()`

try await supabase
  .from("countries")
  .select()
  .filter("name", operator: .in, value: #"("Algeria","Japan")"#)

On a foreign table

try await supabase
  .from("countries")
  .select(
    """
      name,
      cities!inner (
        name
      )
    """
  )
  .filter("cities.name", operator: .eq, value: "Bali")