Filter builders for PostgREST queries.
Every fn takes a request map (from supabase.postgrest/from) and
returns it with a query-string filter appended.
all-of / any-of accept a nested vector DSL:
[[:gt "age" 18]
[:eq "status" "active"]
[:and [[:lt "salary" 5000]
[:eq "role" "junior"]]]
[:not [:eq "deleted" true]]]
Filter builders for PostgREST queries.
Every fn takes a request map (from `supabase.postgrest/from`) and
returns it with a query-string filter appended.
## Composite filters
`all-of` / `any-of` accept a nested vector DSL:
[[:gt "age" 18]
[:eq "status" "active"]
[:and [[:lt "salary" 5000]
[:eq "role" "junior"]]]
[:not [:eq "deleted" true]]](all-of req patterns)(all-of req patterns opts)AND-combines patterns. Accepts a raw string or a vector of DSL
conditions. Optional :foreign-table scopes to a related table.
AND-combines `patterns`. Accepts a raw string or a vector of DSL conditions. Optional `:foreign-table` scopes to a related table.
(any-of req patterns)(any-of req patterns opts)OR-combines patterns. Accepts a raw string or a vector of DSL
conditions. Optional :foreign-table scopes to a related table.
OR-combines `patterns`. Accepts a raw string or a vector of DSL conditions. Optional `:foreign-table` scopes to a related table.
(contained-by req column value)Match rows where every element of column is contained by value.
Match rows where every element of `column` is contained by `value`.
(contains req column value)Match rows where column contains every element in value.
Match rows where `column` contains every element in `value`.
(filter req column op value)Escape hatch — apply a raw PostgREST operator. column, op, and
value are NOT escaped; sanitize them yourself.
Escape hatch — apply a raw PostgREST operator. `column`, `op`, and `value` are NOT escaped; sanitize them yourself.
(is req column value)Match rows where column IS value (typically nil or a boolean).
Match rows where `column` IS `value` (typically nil or a boolean).
(match req query-map)Shorthand for multiple eq filters from a map of column => value.
Shorthand for multiple `eq` filters from a map of `column => value`.
(negate req column op value)NOT(op).value on column.
NOT(op).value on `column`.
(overlaps req column value)Match rows where column and value share at least one element.
Match rows where `column` and `value` share at least one element.
(process-condition cond-form)Recursively encodes a DSL condition to its PostgREST string form.
Recursively encodes a DSL condition to its PostgREST string form.
(text-search req column query)(text-search req column query opts)Full-text search on column for query.
Opts: :type — :plain | :phrase | :websearch :config — text-search config name (e.g. "english")
Full-text search on `column` for `query`. Opts: :type — :plain | :phrase | :websearch :config — text-search config name (e.g. "english")
(within req column values)PostgREST IN filter. Renamed from in to avoid shadowing tools and
to keep symmetry with clojure.core naming.
PostgREST `IN` filter. Renamed from `in` to avoid shadowing tools and to keep symmetry with `clojure.core` naming.
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 |