(find-aliases tsch ks)
finds necessary aliases
(find-aliases (:flat (schema/schema family/family-links)) [:person/brother :person/mother]) => [[:person/brother {:ns :sibling, :template {:sibling {:gender :m}}}] [:person/mother {:ns :parent, :template {:parent {:gender :f}}}]]
finds necessary aliases (find-aliases (:flat (schema/schema family/family-links)) [:person/brother :person/mother]) => [[:person/brother {:ns :sibling, :template {:sibling {:gender :m}}}] [:person/mother {:ns :parent, :template {:parent {:gender :f}}}]]
(resolve-alias tsch tdata alias no-gen-sym)
resolves the data for the alias
(resolve-alias (:tree (schema/schema family/family-links)) {:male {:name "Chris"}} [:male {:ns :person, :template {:person {:gender :m}}}] nil) => {:person {:gender :m, :name "Chris"}}
resolves the data for the alias (resolve-alias (:tree (schema/schema family/family-links)) {:male {:name "Chris"}} [:male {:ns :person, :template {:person {:gender :m}}}] nil) => {:person {:gender :m, :name "Chris"}}
(template-alias tmpl)
templates an alias, replacing symbols with random
(template-alias {:db/id 'hello}) ;;{:db/id hello_141387} => (contains {:db/id symbol?})
templates an alias, replacing symbols with random (template-alias {:db/id 'hello}) ;;{:db/id hello_141387} => (contains {:db/id symbol?})
(wrap-alias f)
wraps normalise to process aliases for a database schema
(pipeline/normalise {:male/name "Chris"} {:schema (schema/schema family/family-links)} {:normalise [wrap-alias]}) => {:person {:gender :m, :name "Chris"}}
(pipeline/normalise {:female {:parent/name "Sam" :brother {:brother/name "Chris"}}} {:schema (schema/schema family/family-links)}) => {:person {:gender :f, :parent {:name "Sam"}, :sibling {:gender :m, :sibling {:gender :m, :name "Chris"}}}}
wraps normalise to process aliases for a database schema (pipeline/normalise {:male/name "Chris"} {:schema (schema/schema family/family-links)} {:normalise [wrap-alias]}) => {:person {:gender :m, :name "Chris"}} (pipeline/normalise {:female {:parent/name "Sam" :brother {:brother/name "Chris"}}} {:schema (schema/schema family/family-links)}) => {:person {:gender :f, :parent {:name "Sam"}, :sibling {:gender :m, :sibling {:gender :m, :name "Chris"}}}}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close