Liking cljdoc? Tell your friends :D

supabase.realtime.filters

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)
raw docstring

buildclj

(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.
sourceraw docstring

eqclj

Rows where column equals value (column=eq.value).

Rows where `column` equals `value` (`column=eq.value`).
sourceraw docstring

gtclj

Rows where column is greater than value (column=gt.value).

Rows where `column` is greater than `value` (`column=gt.value`).
sourceraw docstring

gteclj

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`).
sourceraw docstring

ilikeclj

Rows where column matches the case-insensitive pattern.

Rows where `column` matches the case-insensitive `pattern`.
sourceraw docstring

imatchclj

Rows where column matches the case-insensitive POSIX regex pattern (~*).

Rows where `column` matches the case-insensitive POSIX regex `pattern` (`~*`).
sourceraw docstring

inclj

(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).
sourceraw docstring

isclj

(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).
sourceraw docstring

isdistinctclj

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`).
sourceraw docstring

likeclj

Rows where column matches the case-sensitive pattern (% wildcards).

Rows where `column` matches the case-sensitive `pattern` (`%` wildcards).
sourceraw docstring

ltclj

Rows where column is less than value (column=lt.value).

Rows where `column` is less than `value` (`column=lt.value`).
sourceraw docstring

lteclj

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`).
sourceraw docstring

matchclj

Rows where column matches the POSIX regex pattern (~).

Rows where `column` matches the POSIX regex `pattern` (`~`).
sourceraw docstring

neqclj

Rows where column does not equal value (column=neq.value).

Rows where `column` does not equal `value` (`column=neq.value`).
sourceraw docstring

notclj

(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
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close