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

acceptorclj

(acceptor query)
source

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

assert-arg!clj

(assert-arg! pred arg)

an error that represent apply-post illegal argument

an error that represent apply-post illegal argument
sourceraw docstring

data-error!clj

(data-error! reason k data)

throw an exception specify data error

throw an exception specify data error
sourceraw docstring

decorate-queryclj

(decorate-query q pp-pairs)
source

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

fn-queryclj

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

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

idclj

(id query)

returns id of a query

returns id of a query
sourceraw docstring

join-queryclj

(join-query parent-q q)
source

map-acceptorclj

common acceptor using an empty map to accept

common acceptor using an empty map to accept
sourceraw 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.
sourceraw 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
sourceraw 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
sourceraw docstring

pqclj

(pq id acceptor val-getter)

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

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

sconjclj

commonn acceptor using conj

commonn acceptor using `conj`
sourceraw 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
sourceraw docstring

term-queryclj

(term-query v)

identity query

identity query
sourceraw docstring

val-acceptorclj

(val-acceptor _ v)

identity acceptor, ignore k, only return v

identity acceptor, ignore k, only return `v`
sourceraw 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.
sourceraw docstring

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

× close