Liking cljdoc? Tell your friends :D

edn-query-language.core


*shallow-conversion*

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

ast->expr

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

ast->query

(ast->query query-ast)
source

call->ast

(call->ast [f args :as call])
source

default-gen

(default-gen name)
source

expr->ast

(expr->ast x)

Given a query expression convert it into an AST.

Given a query expression convert it into an AST.
sourceraw docstring

focus-subquery

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

focus-subquery*

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

focus-subquery-union*

(focus-subquery-union* query-ast sub-ast)
source

generators

source

ident->ast

(ident->ast [k id :as ref])
source

ident?

(ident? x)

Check if x is a EQL ident.

Check if x is a EQL ident.
sourceraw docstring

join->ast

(join->ast join)
source

keyword->ast

(keyword->ast k)
source

make-gen

(make-gen env name)
source

merge-asts

(merge-asts qa qb)

Merges two ast's.

Merges two ast's.
sourceraw docstring

merge-queries

(merge-queries qa qb)

Merges two queries

Merges two queries
sourceraw docstring

node-typemultimethod

source

normalize-query-variables

(normalize-query-variables query)

Converts ident values and param values to ::p/var.

Converts ident values and param values to ::p/var.
sourceraw docstring

parameterize

(parameterize expr params)
source

query->ast

(query->ast query)

Convert a query to its AST representation.

Convert a query to its AST representation.
sourceraw docstring

query->ast1

(query->ast1 query-expr)

Call query->ast and return the first children.

Call query->ast and return the first children.
sourceraw docstring

query->shallow-ast

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

query-id

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

symbol->ast

(symbol->ast k)
source

transduce-children

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

union->ast

(union->ast m)
source

union-children?

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

union-entry->ast

(union-entry->ast [k v])
source

update-property-param

(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"})
```
sourceraw docstring

wrap-expr

(wrap-expr root? expr)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close