Fluent builder for postgres_changes filter strings.
Each fn appends one column=operator.value condition; conditions are
joined with commas, which the Realtime server applies as AND (OR is not
supported). Pass the builder straight to supabase.realtime/on — it is
serialized to a string automatically — or call build yourself.
Mirrors realtime-js RealtimePostgresFilterBuilder: the operator surface
is the PostgREST subset the Realtime server evaluates (containment, range
and full-text operators are intentionally absent), values containing
reserved characters (, ( ) " \) or surrounding whitespace are
double-quoted and escaped the way PostgREST does, and any operator can be
negated with not.
(require '[supabase.realtime.filters :as f])
(-> (f/gt "amount" 100)
(f/not "status" :in ["draft" "archived"]))
;; builds: amount=gt.100,status=not.in.(draft,archived)
Fluent builder for postgres_changes `filter` strings.
Each fn appends one `column=operator.value` condition; conditions are
joined with commas, which the Realtime server applies as `AND` (OR is not
supported). Pass the builder straight to `supabase.realtime/on` — it is
serialized to a string automatically — or call `build` yourself.
Mirrors realtime-js `RealtimePostgresFilterBuilder`: the operator surface
is the PostgREST subset the Realtime server evaluates (containment, range
and full-text operators are intentionally absent), values containing
reserved characters (`,` `(` `)` `"` `\`) or surrounding whitespace are
double-quoted and escaped the way PostgREST does, and any operator can be
negated with `not`.
(require '[supabase.realtime.filters :as f])
(-> (f/gt "amount" 100)
(f/not "status" :in ["draft" "archived"]))
;; builds: amount=gt.100,status=not.in.(draft,archived)(build builder)Serializes builder into the comma-separated (AND) filter string. An
empty builder serializes to "", which the server treats as no filter.
Serializes `builder` into the comma-separated (AND) filter string. An empty builder serializes to `""`, which the server treats as no filter.
Rows where column equals value (column=eq.value).
Rows where `column` equals `value` (`column=eq.value`).
Rows where column is greater than value (column=gt.value).
Rows where `column` is greater than `value` (`column=gt.value`).
Rows where column is greater than or equal to value (column=gte.value).
Rows where `column` is greater than or equal to `value` (`column=gte.value`).
Rows where column matches the case-insensitive pattern.
Rows where `column` matches the case-insensitive `pattern`.
Rows where column matches the case-insensitive POSIX regex pattern (~*).
Rows where `column` matches the case-insensitive POSIX regex `pattern` (`~*`).
(in column values)(in builder column values)Rows where column is one of values (column=in.(a,b,c)). Duplicates
are removed; at least one value is required; nil elements are rejected
(use is for null checks).
Rows where `column` is one of `values` (`column=in.(a,b,c)`). Duplicates are removed; at least one value is required; nil elements are rejected (use `is` for null checks).
(is column value)(is builder column value)Rows where column IS the given value (column=is.null). Accepts nil,
a boolean, or :null/:true/:false/:unknown (keywords or strings).
Rows where `column` `IS` the given value (`column=is.null`). Accepts nil, a boolean, or `:null`/`:true`/`:false`/`:unknown` (keywords or strings).
Rows where column is distinct from value — NULL-safe inequality
(IS DISTINCT FROM).
Rows where `column` is distinct from `value` — NULL-safe inequality (`IS DISTINCT FROM`).
Rows where column matches the case-sensitive pattern (% wildcards).
Rows where `column` matches the case-sensitive `pattern` (`%` wildcards).
Rows where column is less than value (column=lt.value).
Rows where `column` is less than `value` (`column=lt.value`).
Rows where column is less than or equal to value (column=lte.value).
Rows where `column` is less than or equal to `value` (`column=lte.value`).
Rows where column matches the POSIX regex pattern (~).
Rows where `column` matches the POSIX regex `pattern` (`~`).
Rows where column does not equal value (column=neq.value).
Rows where `column` does not equal `value` (`column=neq.value`).
(not column operator value)(not builder column operator value)Negates any operator with the not. prefix (column=not.operator.value).
(f/not "status" :in ["draft" "archived"]) ;; builds: status=not.in.(draft,archived)
(f/not "deleted_at" :is nil) ;; builds: deleted_at=not.is.null
Negates any operator with the `not.` prefix (`column=not.operator.value`). (f/not "status" :in ["draft" "archived"]) ;; builds: status=not.in.(draft,archived) (f/not "deleted_at" :is nil) ;; builds: deleted_at=not.is.null
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |