Liking cljdoc? Tell your friends :D

spirit.io.datomic.process.pipeline.set


is-queryclj

(is-query datasource)

checks if datasource is a query command

(is-query {:command :query}) => true

checks if datasource is a query command

(is-query {:command :query})
=> true
raw docstring

is-setclj

(is-set attr datasource)

checks if the data needs to be contained within a set

(is-set {:cardinality :many} {}) => true

(is-set {} {:command :query}) => true

checks if the data needs to be contained within a set

(is-set {:cardinality :many} {})
=> true

(is-set {} {:command :query})
=> true
raw docstring

wrap-attr-setclj

(wrap-attr-set f)

wraps normalise to type check inputs as well as to coerce incorrect inputs

(pipeline/normalise {:account {:tags "10"}} {:schema (schema/schema examples/account-orders-items-image)} {:normalise-attr [wrap-attr-set]}) => {:account {:tags #{"10"}}}

(pipeline/normalise {:account {:user #{"andy" "bob"}}} {:schema (schema/schema examples/account-orders-items-image)} {:normalise-attr [wrap-attr-set]}) => (throws-info {:normalise true, :wrong-input true, :data #{"bob" "andy"}, :nsv [:account :user], :key-path nil})

(pipeline/normalise {:account {:user #{"andy" "bob"}}} {:schema (schema/schema examples/account-orders-items-image) :command :query} {:normalise-attr [wrap-attr-set]}) => {:account {:user #{"bob" "andy"}}}

wraps normalise to type check inputs as well as to coerce incorrect inputs

(pipeline/normalise {:account {:tags "10"}}
                     {:schema (schema/schema examples/account-orders-items-image)}
                     {:normalise-attr [wrap-attr-set]})
=> {:account {:tags #{"10"}}}

(pipeline/normalise {:account {:user #{"andy" "bob"}}}
                     {:schema (schema/schema examples/account-orders-items-image)}
                     {:normalise-attr [wrap-attr-set]})
=> (throws-info {:normalise true,
                 :wrong-input true,
                 :data #{"bob" "andy"},
                 :nsv [:account :user],
                 :key-path nil})

(pipeline/normalise {:account {:user #{"andy" "bob"}}}
                     {:schema (schema/schema examples/account-orders-items-image)
                      :command :query}
                     {:normalise-attr [wrap-attr-set]})
=> {:account {:user #{"bob" "andy"}}}
raw docstring

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

× close