Liking cljdoc? Tell your friends :D

agentspaces.datascript.storage

The storage adapter of a DataScript database on a persistent ref (PDT 2 phase 2, P2-D-01 to P2-D-04; srad/agentspaces-pdt2.md §3.1.1, §3.1.2). Each index's sorted set reads and writes its nodes through a CidAdapter, the persistent-sorted-set IStorage whose address is the node's CID: store of a dirty node writes a dn node through the PDb$Writer of the fold, so a fold writes exactly the dirty paths, and restore of a CID reads the node through the ref's loader into a soft cache per CID, since the tree keeps none.

Encoding. A datom's attribute travels as its keyword's print form (a string attribute has no form and is refused); a value as the datom grammar's int, text, boolean, bytes, float64, or tagged pair (UUID, instant, big integer). A keyword value is its print form; a string that starts with a colon or a backslash gains one backslash in front, the rule of agentspaces.pdt, so both read back as they went in. An instant reads back as a java.util.Date, or as a java.time.Instant under {:instant :instant}.

The storage adapter of a DataScript database on a persistent ref (PDT 2 phase
2, P2-D-01 to P2-D-04; srad/agentspaces-pdt2.md §3.1.1, §3.1.2). Each index's
sorted set reads and writes its nodes through a `CidAdapter`, the
`persistent-sorted-set` IStorage whose address is the node's CID: `store` of a
dirty node writes a `dn` node through the `PDb$Writer` of the fold, so a fold
writes exactly the dirty paths, and `restore` of a CID reads the node through
the ref's loader into a soft cache per CID, since the tree keeps none.

Encoding. A datom's attribute travels as its keyword's print form (a string
attribute has no form and is refused); a value as the datom grammar's int,
text, boolean, bytes, float64, or tagged pair (UUID, instant, big integer).
A keyword value is its print form; a string that starts with a colon or a
backslash gains one backslash in front, the rule of `agentspaces.pdt`, so
both read back as they went in. An instant reads back as a `java.util.Date`,
or as a `java.time.Instant` under `{:instant :instant}`.
raw docstring

*writer*clj

The PDb$Writer of the fold in progress; a dirty node's store writes through it.

The `PDb$Writer` of the fold in progress; a dirty node's `store` writes through it.
raw docstring

attr->textclj

(attr->text a)

An attribute as its keyword's print form.

An attribute as its keyword's print form.
raw docstring

branchingclj

The branching factor of decision 2.

The branching factor of decision 2.
raw docstring

cbor->schemaclj

(cbor->schema cbor)

The schema a db root carries, as DataScript's map.

The schema a `db` root carries, as DataScript's map.
raw docstring

datom->cljclj

(datom->clj d instant)

A Java datom as a DataScript datom.

A Java datom as a DataScript datom.
raw docstring

datom->javaclj

(datom->java d)

A DataScript datom as a Java datom; a retraction keeps its negative transaction.

A DataScript datom as a Java datom; a retraction keeps its negative transaction.
raw docstring

persistclj

(persist folded db tail fold?)

Writes a database as a PDb through a writer over store/loader: when fold? the dirty paths of the three indexes (at most depth + 1 nodes per index for one transaction, P2-D-02) and a root with no tail; otherwise a dn tail of tail named by a root over the indexes of folded, the PDb whose indexes the last fold wrote.

Writes a database as a `PDb` through a writer over `store`/`loader`: when
`fold?` the dirty paths of the three indexes (at most depth + 1 nodes per
index for one transaction, P2-D-02) and a root with no tail; otherwise a
`dn` tail of `tail` named by a root over the indexes of `folded`, the `PDb`
whose indexes the last fold wrote.
raw docstring

restoreclj

(restore pdb)
(restore pdb reads {:keys [instant]})

The DataScript database of a PDb (P2-D-04): reads its root, which the PDb holds, and its tail when the root links one, and nothing else; each index reads its nodes on demand through a CidAdapter. reads counts every node read. opts takes :instant.

The DataScript database of a `PDb` (P2-D-04): reads its root, which the `PDb`
holds, and its tail when the root links one, and nothing else; each index
reads its nodes on demand through a `CidAdapter`. `reads` counts every node
read. `opts` takes :instant.
raw docstring

schema->cborclj

(schema->cbor schema)

A DataScript schema as the CBOR map a db root carries: keyword keys and values as their print forms.

A DataScript schema as the CBOR map a `db` root carries: keyword keys and values as their print forms.
raw docstring

text->attrclj

(text->attr a)

An attribute's print form as the keyword.

An attribute's print form as the keyword.
raw docstring

value->cljclj

(value->clj v instant)

A datom value of the grammar as the DataScript value; instant is :date or :instant.

A datom value of the grammar as the DataScript value; `instant` is :date or :instant.
raw docstring

value->javaclj

(value->java v)

A DataScript value as a datom value of the grammar.

A DataScript value as a datom value of the grammar.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close