EQL helper functions.
Functions that take and return AST will be suffixed with a *
. Functions
without a *
suffix tend to take and return EQL queries.
EQL helper functions. Functions that take and return AST will be suffixed with a `*`. Functions without a `*` suffix tend to take and return EQL queries.
(apply-transform query m opts)
See apply-transform*
.
See [[apply-transform*]].
(apply-transform*
ast
m
{:keys [rf vf node-key-fn]
:or {rf (fn* [p1__2060# p2__2061#]
(assoc p1__2060# (:key p2__2061#) (:value p2__2061#)))
node-key-fn :dispatch-key
vf :value}
:as opts})
(apply-transform*
ast
m
{:keys [rf vf node-key-fn]
:or {rf (fn* [p1__4101# p2__4102#]
(assoc p1__4101# (:key p2__4102#) (:value p2__4102#)))
node-key-fn :dispatch-key
vf :value}
:as opts})
Returns a map created by recursively following paths that exist in the EQL ast
and m
. Takes an option map of the following keys.
rf
- Reducing function called for every kv in m
. The function is passed
the accumulated map and a map with the following keys.
:key
- the key in m
:value
- the value in m
:node
- the node at the path for the kv pair.
node-key-fn
- Function passed the AST node returning a unique identifier
for the node at that position in the tree. Defaults to :dispatch-key.
vf
- Function passed the :key
, :value
, and :node
and should return
the value to be passed to rf
.
Returns a map created by recursively following paths that exist in the EQL `ast` and `m`. Takes an option map of the following keys. `rf` - Reducing function called for every kv in `m`. The function is passed the accumulated map and a map with the following keys. `:key` - the key in `m` `:value` - the value in `m` `:node` - the node at the path for the kv pair. `node-key-fn` - Function passed the AST node returning a unique identifier for the node at that position in the tree. Defaults to :dispatch-key. `vf` - Function passed the `:key`, `:value`, and `:node` and should return the value to be passed to `rf`.
(ast->datomic-pull ast)
(ast->datomic-pull ast
{:keys [select-params]
:or {select-params default-datomic-pull-select-params}})
(datomic-pull->ast pull-pattern)
(datomic-pull->ast pull-pattern _)
(datomic-pull->query pull-pattern)
(datomic-pull->query pull-pattern opts)
See datomic-pull->ast
.
See [[datomic-pull->ast]].
(default-datomic-pull-select-params node)
Default select-params
function used in ast->datomic-pull
to select
the Datomic keys from a node.
Default `select-params` function used in [[ast->datomic-pull]] to select the Datomic keys from a node.
(difference-query source-query not-query)
See difference-query*
.
See [[difference-query*]].
(difference-query* source-ast not-ast)
Filters source-ast
by removing any paths in not-ast
. Similar to a set
difference.
Filters `source-ast` by removing any paths in `not-ast`. Similar to a set difference.
(map-select* ast m)
Filters m
by the ast
. Similar to select-keys
or Datomic pull.
Filters `m` by the `ast`. Similar to `select-keys` or Datomic pull.
(merge-many-queries queries)
(merge-many-queries queries opts)
See merge-many-queries*
.
See [[merge-many-queries*]].
(merge-many-queries* asts)
(merge-many-queries* asts opts)
Merges many asts
via merge-queries*
.
Merges many `asts` via [[merge-queries*]].
(merge-queries* ast1 ast2)
(merge-queries* ast1 ast2 {:keys [merge-params] :or {merge-params merge}})
Merges ast1
and ast2
node maps recursively. Similar to eql/merge-asts, but
allows overriding default merge behaviors (e.g., EQL parameters get merged).
Takes an options map with the following keys:
:merge-params
- a function taking two node params maps and returns a single,
merged param map. Defaults to merge
.
Merges `ast1` and `ast2` node maps recursively. Similar to eql/merge-asts, but allows overriding default merge behaviors (e.g., EQL parameters get merged). Takes an options map with the following keys: `:merge-params` - a function taking two node params maps and returns a single, merged param map. Defaults to `merge`.
(query->datomic-pull query)
(query->datomic-pull query opts)
See ast->datomic-pull
.
See [[ast->datomic-pull]].
(split* input-ast range-ast)
Returns a tuple of ASTs where the first element does not contain any idents
specified in range-ast
, and the second element contains at most all the
elements specified in range-ast
.
Returns a tuple of ASTs where the first element does not contain any idents specified in `range-ast`, and the second element contains at most all the elements specified in `range-ast`.
(top-level-keys query)
See top-level-keys*
.
See [[top-level-keys*]].
(top-level-keys* ast)
Returns the top-level (children at root level) dispatch-key
in ast
.
Returns the top-level (children at root level) `dispatch-key` in `ast`.
(transform-rename-rf {:keys [get-new-key]})
rf function for use with apply-transform*
that renames map keys using
data on the AST node.
rf function for use with [[apply-transform*]] that renames map keys using data on the AST node.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close