Liking cljdoc? Tell your friends :D

pe-datomic-utils.core

A set of helper functions for when working with Datomic.

A set of helper functions for when working with Datomic.
raw docstring

are-attributes-retracted-sinceclj

(are-attributes-retracted-since conn entid attrs since-inst)

Returns true if the entity with ID entid has attributes attrs all retracted as of since-inst. Otherwise returns false.

Returns true if the entity with ID entid has attributes attrs all retracted
as of since-inst.  Otherwise returns false.
sourceraw docstring

change-log-sinceclj

(change-log-since conn
                  since-inst
                  reqd-attr
                  reqd-attr-val
                  updated-entry-maker-fn
                  deleted-entry-maker-fn)

Returns a map with 2 keys: :updates and :deletions. The value at each key is a vector of entities that have either been updated (add/update) or deleted as of since-inst. Each vector contains a collection of entries as maps. filter-fn will be invoked for each candidate entity and will return a boolean indicating if it should be included in the final set. The parameters updated-entry-maker-fn and deleted-entry-maker-fn are used to construct the maps. updated-entry-maker-fn will be used to contruct the maps to go into the :updates vector; deleted-entry-maker-fn will be used to construct the maps to go into the :deletions vector. Each of these functions will receive the populated Datomic entity, and is to return a map. Updates and deletions of entities containing reqd-attr will be included in the computation.

Returns a map with 2 keys: :updates and :deletions.  The value at each key is
a vector of entities that have either been updated (add/update) or deleted as
of since-inst.  Each vector contains a collection of entries as maps.
filter-fn will be invoked for each candidate entity and will return a boolean
indicating if it should be included in the final set. The parameters
updated-entry-maker-fn and deleted-entry-maker-fn are used to construct the
maps.  updated-entry-maker-fn will be used to contruct the maps to go into the
:updates vector; deleted-entry-maker-fn will be used to construct the maps to
go into the :deletions vector.  Each of these functions will receive the
populated Datomic entity, and is to return a map.  Updates and deletions of
entities containing reqd-attr will be included in the computation.
sourceraw docstring

entities-of-attrs-sinceclj

(entities-of-attrs-since conn attrs since-inst)

Returns the set of entity IDs (including retracted ones) that contains at least one attribute from attrs, and exists as of since-inst.

Returns the set of entity IDs (including retracted ones) that contains at
least one attribute from attrs, and exists as of since-inst.
sourceraw docstring

entities-updated-sinceclj

(entities-updated-since conn since-inst reqd-attr reqd-attr-val)
(entities-updated-since conn since-inst reqd-attr reqd-attr-val transform-fn)

Returns the set of entity IDs that contain the attribute reqd-attr, and exist since since-inst. If transform-fn is supplied, it will be applied against each found entity.

Returns the set of entity IDs that contain the attribute reqd-attr, and exist
since since-inst.  If transform-fn is supplied, it will be applied against
each found entity.
sourceraw docstring

entities-updated-since-2clj

(entities-updated-since-2 conn since-inst reqd-attr reqd-attr-val)
(entities-updated-since-2 conn since-inst reqd-attr reqd-attr-val transform-fn)
source

entity-for-parent-by-idclj

(entity-for-parent-by-id conn parent-entid entity-entid parent-attr)

Returns a vector where the 1st element is an entity id, and the 2nd element the corresponding entity map. The entity information returned is a direct child entity of the entity with entity id entity-entid.

Returns a vector where the 1st element is an entity id, and the 2nd element
the corresponding entity map.  The entity information returned is a direct
child entity of the entity with entity id entity-entid.
sourceraw docstring

entity-id-for-schema-attributeclj

(entity-id-for-schema-attribute conn attr)

Returns the entity ID of attr.

Returns the entity ID of attr.
sourceraw docstring

get-user-schema-versionclj

(get-user-schema-version conn user-schema-attr-name)

Returns the schema version of the database associated with conn (assumes the schema attribute was installed using transact-user-schema-attribute).

Returns the schema version of the database associated with conn (assumes the
schema attribute was installed using transact-user-schema-attribute).
sourceraw docstring

is-attribute-retracted-sinceclj

(is-attribute-retracted-since conn entid attr since-inst)
source

is-entity-deleted-as-ofclj

(is-entity-deleted-as-of conn as-of-inst entid)
source

is-entity-updated-sinceclj

(is-entity-updated-since conn since-inst entid)
source

refresh-dbclj

(refresh-db db-uri schema-files)

First deletes the database at db-uri, then creates it, and then transacts the set of schema files.

First deletes the database at db-uri, then creates it, and then transacts the
set of schema files.
sourceraw docstring

save-new-entityclj

(save-new-entity conn txnmap)

Transacts txnmap using conn and returns the generated entity id.

Transacts txnmap using conn and returns the generated entity id.
sourceraw docstring

transact-partitionclj

(transact-partition conn partition)

Transacts the given partition using conn.

Transacts the given partition using conn.
sourceraw docstring

transact-schema-filesclj

(transact-schema-files conn schema-files)

Transacts the set of schema files using conn. Each schema file is assumed to be on the classpath, and contains a single transaction.

Transacts the set of schema files using conn.  Each schema file is assumed to
be on the classpath, and contains a single transaction.
sourceraw docstring

transact-user-schema-attributeclj

(transact-user-schema-attribute conn attr-ident)

Transacts a schema attribute with a :db/ident of attr-ident. This attribute is of type long and cardinality one. It's purpose is to capture the notion of a schema version; similar to SQLite's 'user_version' pragma.

Transacts a schema attribute with a :db/ident of attr-ident.  This attribute
is of type long and cardinality one.  It's purpose is to capture the notion of
a schema version; similar to SQLite's 'user_version' pragma.
sourceraw docstring

transact-user-schema-versionclj

(transact-user-schema-version conn partition user-schema-attr-name val)

Transacts a new schema version value val to the database associated with conn, in partition, where the schema attribute :db/ident is user-schema-attr-name.

Transacts a new schema version value val to the database associated with
conn, in partition, where the schema attribute :db/ident is
user-schema-attr-name.
sourceraw docstring

txn-timeclj

(txn-time conn e)
(txn-time conn e since-inst)

Returns the transaction time (instance) of the given entity e.

Returns the transaction time (instance) of the given entity e.
sourceraw docstring

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

× close