Liking cljdoc? Tell your friends :D

eva.api


as-ofclj

(as-of db t)

Returns a historical database value at some point in time t, inclusive. t can be a transaction number or a transaction id

Returns a historical database value at some point in time `t`, inclusive.
`t` can be a transaction number or a transaction id
sourceraw docstring

as-of-tclj

(as-of-t db)

If db isn't the latest snapshot at the time it was constructed, return the tx-num of the log entry / transaction that db was constructed from to reflect; else nil

If `db` isn't the latest snapshot at the time it was constructed, return the
`tx-num` of the log entry / transaction that `db` was constructed from to reflect; else `nil`
sourceraw docstring

attributeclj

(attribute db attr-id)

Retrieves information about an Attribute.

Retrieves information about an `Attribute`.
sourceraw docstring

attribute-strictclj

(attribute-strict db attr-id)

Retrieves information about an Attribute. Exception is thrown if none exists

Retrieves information about an `Attribute`. Exception is thrown if none exists
sourceraw docstring

basis-tclj

(basis-t db)

Return the latest tx-num the Peer knew about at the time db was constructed; else nil

Return the latest `tx-num` the `Peer` knew about at the time `db` was constructed; else `nil`
sourceraw docstring

connectclj

(connect uri)

Returns a Connection, given a valid connection configuration map.

Returns a `Connection`, given a valid connection configuration map.
sourceraw docstring

connect*clj

(connect* connect-fn config)
source

connection-statusclj

(connection-status conn)

Returns status information on a given Connection

Returns status information on a given `Connection`
sourceraw docstring

datomsclj

(datoms db index & components)

Provides raw access to the database indexes. Must pass the index-name. May pass one or more leading components of the index to constrain the results.

The following indexes may be searched:

  • :eavt - contains all datoms sorted by entity-id, attribute-id, value, and transaction
  • :aevt - contains all datoms sorted by attribute-id, entity-id, value, and transaction
  • :avet - contains datoms with indexed and unique attributes (except for bytes values) sorted by attribute-id, value, entity-id, and transaction
  • :vaet - contains datoms with attributes of :db.type/ref; VAET acts as the reverse index for backwards traversal of refs
Provides raw access to the database indexes.
Must pass the index-name. May pass one or more leading components of the index
to constrain the results.

The following indexes may be searched:

- `:eavt` - contains all datoms sorted by entity-id, attribute-id, value, and transaction
- `:aevt` - contains all datoms sorted by attribute-id, entity-id, value, and transaction
- `:avet` - contains datoms with indexed and unique attributes (except for bytes values)
sorted by attribute-id, value, entity-id, and transaction
- `:vaet` - contains datoms with attributes of :db.type/ref; VAET acts as the reverse
index for backwards traversal of refs
sourceraw docstring

dbclj

(db conn)

Yields the most recently known database snapshot, which is maintained in memory.

Yields the most recently known database snapshot, which is maintained in memory.
sourceraw docstring

db-snapshotclj

(db-snapshot conn)

Yields the most recently known database snapshot, which is maintained in memory.

Yields the most recently known database snapshot, which is maintained in memory.
sourceraw docstring

entidclj

(entid db identifier)

Coerces any entity-identifier into an entity-id. Does not confirm existence of an entity id, except incidentally through some coercion processes. To check for existence of an entity, please use isExtantEntity

Coerces any entity-identifier into an entity-id.
Does **not** confirm existence of an entity id, except incidentally through
some coercion processes.
To check for existence of an entity, please use [isExtantEntity](#var-extant-entity.3F)
sourceraw docstring

entid-strictclj

(entid-strict db identifier)

Behaves the same as entid, but instead throws where entid would return nil.

Behaves the same as [`entid`](#var-entid), but instead throws where `entid` would return nil.
sourceraw docstring

entityclj

(entity db eid)

Returns an Entity, which is a dynamic, lazy-loaded projection of the datoms that share the same entity-id

Returns an `Entity`, which is a dynamic, lazy-loaded projection of the datoms
that share the same entity-id
sourceraw docstring

entity-dbclj

(entity-db entity)

Returns the database value that backs this entity

Returns the database value that backs this entity
sourceraw docstring

extant-entity?clj

(extant-entity? db identifier)

Returns true if there exists at least one datom in the database with the provided entity identifier.

Returns true if there exists at least one datom in the database with the
provided entity identifier.
sourceraw docstring

functionclj

(function m)
[Datomic Documentation](https://docs.datomic.com/on-prem/clojure/index.html#datomic.api/function)
sourceraw docstring

historyclj

(history db)

Returns a special view of the database containing all datoms, asserted or retracted across time. Currently supports the datoms and q functions.

Returns a special view of the database containing **all** datoms, asserted
or retracted across time. Currently supports the [`datoms`](#var-datoms) and [`q`](#var-q) functions.
sourceraw docstring

identclj

(ident db id)

Returns the keyword-identifier associated with an id.

Returns the `keyword-identifier` associated with an id.
sourceraw docstring

ident-strictclj

(ident-strict db id)

Returns the keyword-identifier associated with an id. Exception is thrown if none exists

Returns the `keyword-identifier` associated with an id.  Exception is thrown if none exists
sourceraw docstring

invokeclj

(invoke db eid-or-ident & args)

Looks up a database function identified by the eid or ident and invokes the function with the provided args

Looks up a database function identified by the `eid` or `ident` and invokes
the function with the provided `args`
sourceraw docstring

latest-tclj

(latest-t conn)

Returns the t of the most recent transaction reachable via this db value.

Returns the `t` of the most recent transaction reachable via this `db` value.
sourceraw docstring

logclj

(log conn)

Returns the current value of the transaction log.

Communicates with storage, but not with the transactor

Can be used in conjunction with tx-range or a query.

Returns the current value of the transaction log.

Communicates with storage, but not with the transactor

Can be used in conjunction with [`tx-range`](#var-tx-range) or a [`query`](#var-q).
sourceraw docstring

partclj

(part eid)

Return the partition associated with the specified entity id.

Return the partition associated with the specified entity id.
sourceraw docstring

pullclj

(pull db pattern eid)

Executes a pull-query returning a hierarchical selection of attributes for entityId

Executes a pull-query returning a hierarchical selection of attributes for entityId
sourceraw docstring

pull-manyclj

(pull-many db pattern eids)

Returns multiple hierarchical selections for the passed entity-identifiers

Returns multiple hierarchical selections for the passed entity-identifiers
sourceraw docstring

qclj

(q query & inputs)
[Datomic Documentation](https://docs.datomic.com/on-prem/clojure/index.html#datomic.api/q)
sourceraw docstring

releaseclj

(release conn)

Releases the resources associated with this Connection.

Connections are intended to be long-lived, so you should release a Connection only when the entire program is finished with it (for example at program shutdown).

Releases the resources associated with this `Connection`.

Connections are intended to be long-lived, so you should release
a `Connection` only when the entire program is finished with it
(for example at program shutdown).
sourceraw docstring

resolve-tempidclj

(resolve-tempid db tempids)
(resolve-tempid db tempids tempid)

Resolves a temporary-id to a permanent id given a database and a mapping of tempid to permids.

Intended for use with the results of a transact call:

(let [tid (eva/tempid :db.part/user -1)
      result @(eva/transact conn [[:db/add tid :db/ident :foo]])]
    {:temp-id tid
     :perm-id (eva/resolve-tempid (:db-after result) (:tempids result) tid)})

If a tempid is not passed, then a function is returned that will resolve tempids using the given db and tempids-mapping. This form should be used when resolving a collection of tempids.

(let [t1 (eva/tempid :db.part/user -1)
      t2 (eva/tempid :db.part/user -2)
      t3 (eva/tempid :db.part/user -3)
      result @(eva/transact conn [[:db/add t1 :db/ident :foo]
                                  [:db/add t2 :db/ident :bar]
                                  [:db/add t3 :db/ident :baz]])]
    (map (eva/resolve-tempid (:db-after result) (:tempids result)) [t1 t2 t3]))
Resolves a temporary-id to a permanent id given a database and a mapping of tempid to permids.

Intended for use with the results of a [`transact`](#var-transact) call:

```clj
(let [tid (eva/tempid :db.part/user -1)
      result @(eva/transact conn [[:db/add tid :db/ident :foo]])]
    {:temp-id tid
     :perm-id (eva/resolve-tempid (:db-after result) (:tempids result) tid)})
```

If a tempid is not passed, then a function is returned that will resolve tempids
using the given db and tempids-mapping. This form should be used when resolving
a collection of tempids.

```clj
(let [t1 (eva/tempid :db.part/user -1)
      t2 (eva/tempid :db.part/user -2)
      t3 (eva/tempid :db.part/user -3)
      result @(eva/transact conn [[:db/add t1 :db/ident :foo]
                                  [:db/add t2 :db/ident :bar]
                                  [:db/add t3 :db/ident :baz]])]
    (map (eva/resolve-tempid (:db-after result) (:tempids result)) [t1 t2 t3]))
```
sourceraw docstring

snapshot-tclj

(snapshot-t db)

Return the tx-num of the log entry / transaction that db constructed from to reflect; else nil

Return the `tx-num` of the log entry / transaction that `db` constructed from to reflect; else `nil`
sourceraw docstring

squuidclj

(squuid)

Constructs a semi-sequential UUID. Can be useful for having a unique identifier that does not fragment indexes

Constructs a semi-sequential `UUID`.  Can be useful for having a unique
identifier that does not fragment indexes
sourceraw docstring

squuid-time-millisclj

(squuid-time-millis uuid)

Returns the time component of a squuid, in the format of System.currentTimeMillis

Returns the time component of a [`squuid`](#var-squuid), in the format of
`System.currentTimeMillis`
sourceraw docstring

sync-dbclj

(sync-db conn)

Like db-snapshot, but forces reads from the backing store to assert whether or not the in-memory database snapshot is stale before returning. If the snapshot is found to be stale, this call will block until the updated snapshot is produced from storage.

Communicates only with storage.

Intended for use when stale state on a Peer is suspected.

Like [`db-snapshot`](#var-db-snapshot), but forces reads from the backing store to assert whether or
not the in-memory database snapshot is stale before returning. If the
snapshot is found to be stale, this call will block until the updated
snapshot is produced from storage.

Communicates only with storage.

Intended for use when stale state on a `Peer` is suspected.
sourceraw docstring

tempidclj

(tempid part)
(tempid part n)

Construct a temporary id within the specified partition. Tempids will be mapped to permanent ids within a single transaction.

User-created tempids are reserved for values of n within the range of -1 to -1000000 inclusive.

Construct a temporary id within the specified partition.
Tempids will be mapped to permanent ids within a single transaction.

User-created tempids are reserved for values of `n` within the range of -1 to -1000000 inclusive.
sourceraw docstring

to-tx-eidclj

(to-tx-eid tx-num-or-eid)

Takes a tx-num or tx-eid and returns the equivalent tx-eid

Takes a `tx-num` or `tx-eid` and returns the equivalent `tx-eid`
sourceraw docstring

to-tx-numclj

(to-tx-num tx-num-or-eid)

Takes a tx-num or tx-eid and returns the equivalent tx-num

Takes a `tx-num` or `tx-eid` and returns the equivalent `tx-num`
sourceraw docstring

touchclj

(touch entity)

Loads all attributes of the entity, recursively touching any component entities

Loads all attributes of the entity, recursively touching any component entities
sourceraw docstring

transactclj

(transact conn tx-data)

Submits a transaction, blocking until a result is available.

tx-data is a list of operations to be processed, including assertions, retractions, functions, or entity-maps

Returns a CompletableFuture which can monitor the status of the transaction. On successful commit, the future will contain a map of the following keys:

  • :db-before database value before transaction was applied
  • :db-after database value after transaction was applied
  • :tx-data collection of primitive operations performed by the transaction
  • :temp-ids can be used with resolveTempId to resolve temporary ids used in the txData

If the transaction fails or timed out, attempts to .get() the future's value will raise an ExecutionException. When getting the result of the future, catch ExecutionException and call ExecutionException#getCause() to retrieve the underlying error.

Submits a transaction, blocking until a result is available.

`tx-data` is a list of operations to be processed, including assertions,
retractions, functions, or entity-maps

Returns a CompletableFuture which can monitor the status of the transaction.
On successful commit, the future will contain a map of the following keys:

- `:db-before` database value before transaction was applied
- `:db-after` database value after transaction was applied
- `:tx-data` collection of primitive operations performed by the transaction
- `:temp-ids` can be used with [`resolveTempId`](#var-resolve-tempid) to
resolve temporary ids  used in the txData

If the transaction fails or timed out, attempts to .get() the future's value
will raise an `ExecutionException`.
When getting the result of the future, catch `ExecutionException` and call
`ExecutionException#getCause()` to retrieve the underlying error.
sourceraw docstring

transact-asyncclj

(transact-async conn tx-data)

Like transact but returns immediately without waiting for the transaction to complete.

Like [`transact`](#var-transact) but returns immediately without waiting for
the transaction to complete.
sourceraw docstring

tx-rangeclj

(tx-range log start end)

Given a Log object and a start and end transaction number or id, return all applicable datoms that were asserted or retracted in the database.

Given a `Log` object and a start and end `transaction number` or `id`, return all
applicable datoms that were asserted or retracted in the database.
sourceraw docstring

withclj

(with db tx-data)

Simulates a transaction locally without persisting the updated state. Returns a map with the same contents as the future from transact

Simulates a transaction locally without persisting the updated state.
Returns a map with the same contents as the future from [`transact`](#var-transact)
sourceraw docstring

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

× close