Liking cljdoc? Tell your friends :D

robertluo.pullable.core

Implementation of queries.

A query is a function which can extract k v from data.

Implementation of queries.

A query is a function which can extract k v from data.
raw docstring

acceptclj

(accept f-conj x k v)

General acceptor function design: when k is nil, means there is no match, current progress should fail; when v is nil, means there is no value.

  • funcition f-conj, takes two argements, coll and a k-v pair
  • x is the collection willing to accept
General acceptor function design: when k is nil, means there is no
match, current progress should fail; when v is nil, means there is
no value.

 - funcition `f-conj`, takes two argements, coll and a k-v pair
 - `x` is the collection willing to accept
raw docstring

apply-postcljmultimethod

create a post processor by ::pp-type, returns a function takes k-v pair, returns the same shape of data

create a post processor by ::pp-type, returns a function takes
k-v pair, returns the same shape of data
raw docstring

assert-arg!clj

(assert-arg! pred arg)

an error that represent apply-post illegal argument

an error that represent apply-post illegal argument
raw docstring

data-error!clj

(data-error! reason k data)

throw an exception specify data error

throw an exception specify data error
raw docstring

decorate-queryclj

(decorate-query q pp-pairs)

filter-queryclj

(filter-query q pred)

returns a filter query which will not appears in result data, but will void other query if in a vector query, pred is the filter condition

returns a filter query which will not appears in result data, but will
void other query if in a vector query, `pred` is the filter condition
raw docstring

fn-queryclj

(fn-query k)
(fn-query k f)
(fn-query k f child)

returns a simple query has key as k, f to return a value from a map, and child query to execute if matches.

returns a simple query has key as `k`, `f` to return a value from a map,
and `child` query to execute if matches.
raw docstring

map-acceptorclj

common acceptor using an empty map to accept

common acceptor using an empty map to accept
raw docstring

mk-named-var-queryclj

(mk-named-var-query t-sym-table sym)
(mk-named-var-query t-sym-table status sym)

returns a factory function which take a query q as its argument.

returns a factory function which take a query `q` as its argument.
raw docstring

named-var-factoryclj

(named-var-factory)

returns a function takes a symbol as the argument, returns a named-var-query

returns a function takes a symbol as the argument, returns a named-var-query
raw docstring

post-process-queryclj

(post-process-query child f-post-process)

A query decorator post process its result

A query decorator post process its result
raw docstring

pqclj

construct a general query:

  • id key of this query
  • acceptor default acceptor of this query, used when no acceptor specified when invoke
  • val-getter is the function to extract data
construct a general query:
- `id` key of this query
- `acceptor` default acceptor of this query, used when no acceptor specified when invoke
- `val-getter` is the function to extract data
raw docstring

PullQueryclj


run-bindclj

(run-bind f-query data)

f-query takes a function (returned by named-var-factory) as argument, returns a query, then run it on data, finally returns a vector:

  • query result
  • named variable binding map
`f-query` takes a function (returned by `named-var-factory`) as argument,
returns a query, then run it on `data`, finally returns a vector:
  - query result
  - named variable binding map
raw docstring

run-queryclj

(run-query q data)

run a query q on data, returns the query result function.

A query result function has one argument of acceptor, which is another function takes k, v as arguments. The acceptor can be nil, means that the query are free to construct the result.

run a query `q` on `data`, returns the query result function.

A query result function has one argument of acceptor, which is
another function takes k, v as arguments. The acceptor can be nil,
means that the query are free to construct the result.
raw docstring

sconjclj

commonn acceptor using conj

commonn acceptor using `conj`
raw docstring

seq-queryclj

(seq-query qr)

returns a seq-query which applies query q to data (must be a collection) and return

returns a seq-query which applies query `q` to data (must be a collection) and return
raw docstring

term-queryclj

(term-query v)

identity query

identity query
raw docstring

val-acceptorclj

(val-acceptor _ v)

identity acceptor, ignore k, only return v

identity acceptor, ignore k, only return `v`
raw docstring

vector-queryclj

(vector-query queries)

returns a vector query, takes other queries as its children, then apply them to data, return the merged map.

returns a vector query, takes other `queries` as its children,
then apply them to data, return the merged map.
raw docstring

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

× close