Ports datomic.client.api to IGraph protocol with accumulate-only mutability. Defines a record DatomicClient With parameters [<conn> <db>] Where <conn> is a datomic connection to some client <db> is a DB in <conn> associated with some transaction.
Ports datomic.client.api to IGraph protocol with accumulate-only mutability. Defines a record DatomicClient With parameters [<conn> <db>] Where <conn> is a datomic connection to some client <db> is a DB in <conn> associated with some transaction.
(ask-s-p-o db s p o)
Returns true iff s-p-o is a triple in <db>
Returns true iff s-p-o is a triple in <db>
(clear-orphan-irrelevant-attributes-cache!)
Side-effect: removes all values in orphan-irrelevant-attributes-cache
Side-effect: removes all values in orphan-irrelevant-attributes-cache
Args: [db q]. Returns the result of a query q
posed to db
Where
<q> is either a map conforming to datomic's arity-1 query or a vector
conforming to a :query clause, with implicit <db> as 2nd argument to d/q.
Args: [db q]. Returns the result of a query `q` posed to `db` Where <q> is either a map conforming to datomic's arity-1 query or a vector conforming to a :query clause, with implicit <db> as 2nd argument to d/q.
(declare-edn-property! db p)
Side-effect: declares p
as an EDN property in db
Side-effect: declares `p` as an EDN property in `db`
True when a graph element is not part of the standard schema.
True when a graph element is not part of the standard schema.
Caches the set of properties which store EDN strings for a given DB. {<db> #{<property>, ...}, ...}
Caches the set of properties which store EDN strings for a given DB. {<db> #{<property>, ...}, ...}
(edn-property? db p)
Returns true iff (g p
:igraph/edn? true) for g of db
Where
<p> names a property in <db> Note: typically used when deciding whether to encode/decode objects as edn.
Returns true iff (g `p` :igraph/edn? true) for g of `db` Where <p> names a property in <db> Note: typically used when deciding whether to encode/decode objects as edn.
(entity-id db s)
Returns <e> for <s> in <db> Where <e> is the entity ID (a positive integer) in (:db <g>) <s> is a subject s.t. [<e> ::id <s>] in (:db <g>) <g> is an instance of DatascriptGraph
Returns <e> for <s> in <db> Where <e> is the entity ID (a positive integer) in (:db <g>) <s> is a subject s.t. [<e> ::id <s>] in (:db <g>) <g> is an instance of DatascriptGraph
(get-normal-form db)
Returns <desc> for <s> in <db> Where <desc> := {<p> #{<o>, ...}, ...}
Returns <desc> for <s> in <db> Where <desc> := {<p> #{<o>, ...}, ...}
(get-subjects db)
Returns (<s>, ...) for <db>, a lazy seq Where <s> is a unique identifier for some <e> <db> is a datomic db <e> <unique-id> <s>, in <db> <e> is an entity-id <unique-id> is any <p> s.t. <p>'s datatype is a unique ID.
Returns (<s>, ...) for <db>, a lazy seq Where <s> is a unique identifier for some <e> <db> is a datomic db <e> <unique-id> <s>, in <db> <e> is an entity-id <unique-id> is any <p> s.t. <p>'s datatype is a unique ID.
(make-graph conn)
(make-graph conn db)
Returns an instance of DatascriptGraph for conn
and optional db
Where
<conn> is a transactor, presumably initialized for domain-specific schemas
<db> (optional) is a db filter on conn
, default is the db as-of the
current basis-t of <conn>
Returns an instance of DatascriptGraph for `conn` and optional `db` Where <conn> is a transactor, presumably initialized for domain-specific schemas <db> (optional) is a db filter on `conn`, default is the db as-of the current basis-t of <conn>
(map-value-to-value-type value)
Returns a :db.type/* for <value>, or :edn-string Where <value> is some graph element being claimed/retracted on some g :edn-string signals that <value> should be stored as an EDN string.
Returns a :db.type/* for <value>, or :edn-string Where <value> is some graph element being claimed/retracted on some g :edn-string signals that <value> should be stored as an EDN string.
(maybe-encode-edn db p o)
Returns an EDN string for o
if (edn-property? p
) else o
Returns an EDN string for `o` if (edn-property? `p`) else `o`
(maybe-read-edn db p o)
Returns the clojure object read from o
if (edn-property? p
) else o
Returns the clojure object read from `o` if (edn-property? `p`) else `o`
Sets the timeout in ms for normal form query
Sets the timeout in ms for normal form query
An igraph.graph/Graph describing the various elements in datomic-client. Primarily documentatry at this point.
An igraph.graph/Graph describing the various elements in datomic-client. Primarily documentatry at this point.
(orphan-irrelevant-attributes conn)
Returns #{<insignificant-attribute>, ...} for <conn> Where <insignificant attribute> is ignored when determining orphan-dom.
Returns #{<insignificant-attribute>, ...} for <conn> Where <insignificant attribute> is ignored when determining orphan-dom.
Caches attributes irrelevant to determining orphans for some conn
{<conn> #{<attribute>, ....}}
Caches attributes irrelevant to determining orphans for some `conn` {<conn> #{<attribute>, ....}}
(query-arity q)
Returns either :arity-1 or :arity-2 depending on the type of q
Where
<q> is a query posed to a datomic db.
Maps are arity-1 and vectors are arity-2, with implicit db as 2nd arg
Returns either :arity-1 or :arity-2 depending on the type of `q` Where <q> is a query posed to a datomic db. Maps are arity-1 and vectors are arity-2, with implicit db as 2nd arg
(query-for-o db s p)
Returns #{<o>, ...} for s
and p
in db
Where
<o> is a value for <db> s.t. <s> <p> <o>
<s> is a subject in <db>
<p> is a predicate with schema definition in <db> <db> is a datomic DB
Returns #{<o>, ...} for `s` and `p` in `db` Where <o> is a value for <db> s.t. <s> <p> <o> <s> is a subject in <db> <p> is a predicate with schema definition in <db> <db> is a datomic DB
(query-for-p-o db s)
Returns <desc> for <s> in <db> Where <desc> := {<p> #{<o>, ...}, ...}
Returns <desc> for <s> in <db> Where <desc> := {<p> #{<o>, ...}, ...}
(remove-orphans g)
(remove-orphans g candidates)
Returns <g'>, s.t. candidates
are removed if they are orphans
i.e. not connected to other elements.
Side-effect: (:conn g) will be modified accordingly.
Where
<g> is a datomic-client
<candidates> := #{<elt>, ...}, (or any sequence) default (subjects g)
<elt> is an element in <g> which we suspect might be an orphan. It may be
an integer entity ID or a keyword unique identifier.
Returns <g'>, s.t. `candidates` are removed if they are orphans i.e. not connected to other elements. Side-effect: (:conn g) will be modified accordingly. Where <g> is a datomic-client <candidates> := #{<elt>, ...}, (or any sequence) default (subjects g) <elt> is an element in <g> which we suspect might be an orphan. It may be an integer entity ID or a keyword unique identifier.
(retract-clauses-for-underspecified-triple affected-entity-fn g to-remove)
Returns [<retraction-clause>, ...] for to-remove
from db
Where
<retraction-clause> := [<op> <elt> ...]
<g> is a
<op> is in #{:db/retract :db/retractEntity}
<elt> is an element of <g>
<affected-entity-fn> := fn [elt] -> <entity-id>, typically with the side-effect
of registering a possible orphan in the calling function.
<entity-id> is the numeric id of <elt> in <g>
Returns [<retraction-clause>, ...] for `to-remove` from `db` Where <retraction-clause> := [<op> <elt> ...] <g> is a <op> is in #{:db/retract :db/retractEntity} <elt> is an element of <g> <affected-entity-fn> := fn [elt] -> <entity-id>, typically with the side-effect of registering a possible orphan in the calling function. <entity-id> is the numeric id of <elt> in <g>
The set of elements provided at time of schema creation.
The set of elements provided at time of schema creation.
From https://docs.datomic.com/cloud/schema/schema-reference.html#db-valuetype
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close