(clause clause-name & arg-schemas)
Impl of defclause
macro.
Impl of `defclause` macro.
(defclause clause-name & arg-names-and-schemas)
Define a new MBQL clause.
(defclause field-id, id su/IntGreaterThanZero)
The first arg is the name of the clause, and should be followed by pairs of arg name, arg schema. Arg schemas may
optionally be wrapped in optional
or rest
to signify that the arg is optional, or to accept varargs:
(defclause count, field (optional Field)) (defclause and, filters (rest Filter))
Since there are some cases where clauses should be parsed differently in MBQL (such as expressions in the
expressions
clause vs in aggregations), you can give the actual symbol produced by this macro a different name as
follows:
(defclause [ag:+ +] ...) ; define symbol ag:+
to be used for a [:+ ...]
clause
Define a new MBQL clause. (defclause field-id, id su/IntGreaterThanZero) The first arg is the name of the clause, and should be followed by pairs of arg name, arg schema. Arg schemas may optionally be wrapped in `optional` or `rest` to signify that the arg is optional, or to accept varargs: (defclause count, field (optional Field)) (defclause and, filters (rest Filter)) Since there are some cases where clauses should be parsed differently in MBQL (such as expressions in the `expressions` clause vs in aggregations), you can give the actual symbol produced by this macro a different name as follows: (defclause [ag:+ +] ...) ; define symbol `ag:+` to be used for a `[:+ ...]` clause
(is-clause? k-or-ks x)
If x
an MBQL clause, and an instance of clauses defined by keyword(s) k-or-ks
?
(is-clause? :count [:count 10]) ; -> true (is-clause? #{:+ :- :* :/} [:+ 10 20]) ; -> true
If `x` an MBQL clause, and an instance of clauses defined by keyword(s) `k-or-ks`? (is-clause? :count [:count 10]) ; -> true (is-clause? #{:+ :- :* :/} [:+ 10 20]) ; -> true
(one-of & clauses)
Define a schema that accepts one of several different MBQL clauses.
(one-of field-id field-literal)
Define a schema that accepts one of several different MBQL clauses. (one-of field-id field-literal)
(one-of* & clause-names+schemas)
Interal impl of one-of
macro.
Interal impl of `one-of` macro.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close