Liking cljdoc? Tell your friends :D

datascript.pull-parser


IPullSpecComponentclj/s≠protocol

-as-specclj/s

(-as-spec this)
source

parse-patternclj/s

(parse-pattern pattern)

Parse an EDN pull pattern into a tree of records using the following grammar:

pattern            = [attr-spec+]
attr-spec          = attr-name | wildcard | map-spec | attr-expr
attr-name          = an edn keyword that names an attr
wildcard           = "*" or '*'
map-spec           = { ((attr-name | limit-expr) (pattern | recursion-limit))+ }
attr-expr          = limit-expr | default-expr
limit-expr         = ["limit" attr-name (positive-number | nil)]
default-expr       = ["default" attr-name any-value]
recursion-limit    = positive-number | '...'
Parse an EDN pull pattern into a tree of records using the following
grammar:

```
pattern            = [attr-spec+]
attr-spec          = attr-name | wildcard | map-spec | attr-expr
attr-name          = an edn keyword that names an attr
wildcard           = "*" or '*'
map-spec           = { ((attr-name | limit-expr) (pattern | recursion-limit))+ }
attr-expr          = limit-expr | default-expr
limit-expr         = ["limit" attr-name (positive-number | nil)]
default-expr       = ["default" attr-name any-value]
recursion-limit    = positive-number | '...'
```
sourceraw docstring

parse-pullclj/s

(parse-pull pattern)

Parse EDN pull pattern specification (see parse-pattern), and convert the resulting tree into a PullSpec instance (see pattern->spec). Throws an error if the supplied pattern cannot be parsed.

Parse EDN pull `pattern` specification (see `parse-pattern`), and
convert the resulting tree into a `PullSpec` instance (see `pattern->spec`).
Throws an error if the supplied `pattern` cannot be parsed.
sourceraw docstring

pattern->specclj/s

(pattern->spec pattern)

Convert a parsed tree of pull pattern records into a PullSpec instance, a record type containing two keys:

  • :wildcard? - a boolean indicating if the pattern contains a wildcard.
  • :attrs - a map of attribute specifications.

The attribute specification map consists of keys which will become the keys in the result map, and values which are themselves maps describing the attribute:

  • :attr (required) - The attr name to pull; for reverse attributes this will be the normalized attribute name.
  • :limit (optional) - If present, specifies a custom limit for this attribute; Either nil, indicating no limit, or a positive integer.
  • :default (optional) - If present, specifies a default value for this attribute
  • :recursion (optional) - If present, specifies a recursion limit for this attribute; Either nil, indicating no limit, or a positive integer.
  • :subpattern (optional) - If present, specifies a sub PullSpec instance to be applied to entities matched by this attribute.
Convert a parsed tree of pull pattern records into a `PullSpec` instance,
a record type containing two keys:

* `:wildcard?` - a boolean indicating if the pattern contains a wildcard.
* `:attrs` - a map of attribute specifications.

The attribute specification map consists of keys which will become the keys
in the result map, and values which are themselves maps describing the
attribute:

* `:attr`       (required) - The attr name to pull; for reverse attributes
                             this will be the normalized attribute name.
* `:limit`      (optional) - If present, specifies a custom limit for this
                             attribute; Either `nil`, indicating no limit,
                             or a positive integer.
* `:default`    (optional) - If present, specifies a default value for this
                             attribute
* `:recursion`  (optional) - If present, specifies a recursion limit for this
                             attribute; Either `nil`, indicating no limit, or
                             a positive integer.
* `:subpattern` (optional) - If present, specifies a sub `PullSpec` instance
                             to be applied to entities matched by this
                             attribute.
sourceraw docstring

PullAttrNamecljs

source

PullDefaultExprcljs

source

PullLimitExprcljs

source

PullMapSpecEntrycljs

source

PullPatterncljs

source

PullRecursionLimitcljs

source

PullReverseAttrNamecljs

source

PullSpeccljs

source

PullWildcardcljs

source

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

× close