Process data from any kind of a source into a format ready to be put in a DataScript DB.
Also provides tools for reading collection data from tagged literals and for deriving collections from attributes.
Process data from any kind of a source into a format ready to be put in a DataScript DB. Also provides tools for reading collection data from tagged literals and for deriving collections from attributes.
(aggregate name)
Returns an aggregate collection
with the given name.
Returns an aggregate [[collection]] with the given name.
(attribute-derive-collection attribute)
Derives a collection from an attribute.
The collection type is based on whether the attribute has a :db/valueType
and the collection name on the attribute's namespace.
Derives a collection from an attribute. The collection type is based on whether the attribute has a `:db/valueType` and the collection name on the attribute's namespace.
(attribute-derive-part-of attribute)
Ensure the attribute has a :db.schema/part-of
.
If it is missing, derives the collection from the attribute.
Ensure the attribute has a `:db.schema/part-of`. If it is missing, derives the collection from the attribute.
(collection type name)
Returns a :db.schema.collection
with the given type (:aggregate
or
:enum
) and name.
Returns a `:db.schema.collection` with the given type (`:aggregate` or `:enum`) and name.
(enum name)
Returns an enum collection
with the given name.
Returns an enum [[collection]] with the given name.
(process elements)
Prepare the provided sequence of schema elements
for import into the
DataScript DB. Each element should be an attribute, constant, entity-spec or
collection.
This function has two main purposes. First it gives attributes and constants
their default :db.schema/part-of
. Second, it converts literal collection
references into full DataScript relationships, so that it's possible to
navigate between collections via attributes.
Prepare the provided sequence of schema `elements` for import into the DataScript DB. Each element should be an attribute, constant, entity-spec or collection. This function has two main purposes. First it gives attributes and constants their default `:db.schema/part-of`. Second, it converts literal collection references into full DataScript relationships, so that it's possible to navigate between collections via attributes.
(read-schema-coll [type name])
DEPRECATED: Prefer collection
.
DEPRECATED: Prefer [[collection]].
(read-string s)
Reads s
as EDN, converting
#schema/enum :foo ;; => #:db.schema.collection{:type :enum, :name :foo}
#schema/agg :foo ;; => #:db.schema.collection{:type :aggregate, :name :foo}
Still supported, but deprecated:
#schema-coll[:enum :foo] ;; => #:db.schema.collection{:type :enum, :name :foo}
#schema/coll[:agg :foo] ;; => #:db.schema.collection{:type :aggregate, :name :foo}
Reads `s` as EDN, converting ```clojure #schema/enum :foo ;; => #:db.schema.collection{:type :enum, :name :foo} #schema/agg :foo ;; => #:db.schema.collection{:type :aggregate, :name :foo} ``` Still supported, but deprecated: ``` #schema-coll[:enum :foo] ;; => #:db.schema.collection{:type :enum, :name :foo} #schema/coll[:agg :foo] ;; => #:db.schema.collection{:type :aggregate, :name :foo} ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close