Liking cljdoc? Tell your friends :D

workflo.macros.entity.datomic


attr->fieldclj

(attr->field [attr-name [attr-type & attr-opts]])

Returns an attribute name and definition pair. Returns a pair suitable to be passed to datomic-schema's schema* function as a field.

Returns an attribute name and definition pair. Returns
a pair suitable to be passed to datomic-schema's `schema*`
function as a field.
sourceraw docstring

datomic-schemaclj

(datomic-schema [prefix schema])

Generates a Datomic schema from an entity schema with a specific prefix.

Generates a Datomic schema from an entity schema with
a specific prefix.
sourceraw docstring

entity-schemaclj

(entity-schema entity)

Returns the Datomic schema for an entity.

Returns the Datomic schema for an entity.
sourceraw docstring

merge-schemasclj

(merge-schemas schemas)
(merge-schemas schemas merge-fn)

Merge multiple Datomic schemas so that there are no conflicting attributes. The default behavior is to throw an exception if two schemas for the same attribute are different.

Merge multiple Datomic schemas so that there are no
conflicting attributes. The default behavior is to throw
an exception if two schemas for the same attribute are
different.
sourceraw docstring

normalize-attrclj

(normalize-attr attr)

Normalizes a Datomic schema attribute by converting it to a map if it's of the form [:db/add ...].

Normalizes a Datomic schema attribute by converting
it to a map if it's of the form `[:db/add ...]`.
sourceraw docstring

split-schemaclj

(split-schema schema)

Takes an entity schema and splits it into multiple entity schemas based on attribute prefixes. An entity with a spec like

(s/keys :req [:foo/bar :baz/ruux])

would yield an entity schema like

{:foo/bar [...]
 :baz/ruux [...]}

and would be split into

{:foo {:foo/bar [...]}
 :baz {:bar/ruux [...]}}
Takes an entity schema and splits it into multiple
entity schemas based on attribute prefixes. An entity
with a spec like

    (s/keys :req [:foo/bar :baz/ruux])

would yield an entity schema like

    {:foo/bar [...]
     :baz/ruux [...]}

and would be split into

    {:foo {:foo/bar [...]}
     :baz {:bar/ruux [...]}}
sourceraw docstring

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

× close