Liking cljdoc? Tell your friends :D

datalog.parser.pull


IPullSpecComponentclj/sprotocol

-as-specclj/s

(-as-spec this)

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-with-opts     = [attr-name attr-options+]
attr-options       = :as any-value | :limit (positive-number | nil) | :default any-value
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-with-opts     = [attr-name attr-options+]
attr-options       = :as any-value | :limit (positive-number | nil) | :default any-value
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 | '...'
```
raw 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.
raw 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.
  • :as (optional) - Alias, any
  • :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.
* `:as`         (optional) - Alias, any
* `: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.
raw docstring

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

× close