Dynamic var. When bound to true in the current thread calls to query->ast will no go past the first level of children. This is useful when you just want the AST for one layer of a query.
Dynamic var. When bound to true in the current thread calls to query->ast will no go past the first level of children. This is useful when you just want the AST for one layer of a query.
(ast->expr ast)
(ast->expr {:keys [type component] ast-meta :meta :as ast} unparse?)
Given a query expression AST convert it back into a query expression.
Given a query expression AST convert it back into a query expression.
(eql-ast eql-query-or-ast)
If param is a vector it assumes its an EEQL query and converts to AST. If its an map, it assumes its already and AST and returns as is. The implementation uses protocols for high performance dispatch.
If param is a vector it assumes its an EEQL query and converts to AST. If its an map, it assumes its already and AST and returns as is. The implementation uses protocols for high performance dispatch.
(expr->ast x)
Given a query expression convert it into an AST.
Given a query expression convert it into an AST.
(focus-subquery query sub-query)
Given a query, focus it along the specified query expression.
Examples: (focus-query [:foo :bar :baz] [:foo]) => [:foo]
(fulcro.client.primitives/focus-query [{:foo [:bar :baz]} :woz] [{:foo [:bar]} :woz]) => [{:foo [:bar]} :woz]
Given a query, focus it along the specified query expression. Examples: (focus-query [:foo :bar :baz] [:foo]) => [:foo] (fulcro.client.primitives/focus-query [{:foo [:bar :baz]} :woz] [{:foo [:bar]} :woz]) => [{:foo [:bar]} :woz]
(focus-subquery* query-ast sub-ast)
Internal implementation of focus-subquery, you can use this function directly if you want to send AST in and get AST out (instead of query in / query out).
Internal implementation of focus-subquery, you can use this function directly if you want to send AST in and get AST out (instead of query in / query out).
(mask-query source mask)
Given a source EQL query, use a mask EQL query to filter which elements to pick from the source. Params will be maintaned from the source, params in mask are ignored.
Given a source EQL query, use a mask EQL query to filter which elements to pick from the source. Params will be maintaned from the source, params in mask are ignored.
(normalize-query-variables query)
Converts ident values and param values to ::p/var.
Converts ident values and param values to ::p/var.
(query->ast query)
Convert a query to its AST representation.
Convert a query to its AST representation.
(query->ast1 query-expr)
Call query->ast and return the first children.
Call query->ast and return the first children.
(query->shallow-ast query)
Like query->ast, but does not follow joins. Useful for efficiently getting just the top-level entries in a large query.
Like query->ast, but does not follow joins. Useful for efficiently getting just the top-level entries in a large query.
(query-id query)
Generates a consistent hash from the query. The query first goes to a process to remove any variables from idents and params, then we get the Clojure hash of it. You can use this to save information about a query that can be used to correlate with the query later.
Generates a consistent hash from the query. The query first goes to a process to remove any variables from idents and params, then we get the Clojure hash of it. You can use this to save information about a query that can be used to correlate with the query later.
(transduce-children xform {:keys [children] :as node})
Recursivelly transduce children on the AST, you can use this to apply filter/transformations on a whole AST. Each iteration of the transducer will get a single AST node to process.
(->> [:a {:b [:c :d]} :e]
(p/query->ast)
(p/transduce-children (remove (comp #{:a :c} :key)))
(p/ast->query))
; => [{:b [:d]} :e]
Recursivelly transduce children on the AST, you can use this to apply filter/transformations on a whole AST. Each iteration of the transducer will get a single AST node to process. ``` (->> [:a {:b [:c :d]} :e] (p/query->ast) (p/transduce-children (remove (comp #{:a :c} :key))) (p/ast->query)) ; => [{:b [:d]} :e] ```
(union-children? ast)
Given an AST point, check if the children is a union query type.
Given an AST point, check if the children is a union query type.
(update-property-param x f & args)
Add property param, eg:
(p/update-property-param :keyword assoc :foo "bar") => (:keyword {:foo "bar"})
(p/update-property-param '(:keyword {:param "prev"}) assoc :foo "bar") => (:keyword {:foo "bar" :param "prev"})
Add property param, eg: ``` (p/update-property-param :keyword assoc :foo "bar") => (:keyword {:foo "bar"}) (p/update-property-param '(:keyword {:param "prev"}) assoc :foo "bar") => (:keyword {:foo "bar" :param "prev"}) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close