(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.
(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.
(entity-schema entity)
Returns the Datomic schema for an entity.
Returns the Datomic schema for an entity.
(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.
(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 ...]`.
(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 [...]}}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close