Liking cljdoc? Tell your friends :D

doppelganger.api


add-listenerclj

(add-listener fut f executor)

Register a completion listener for the future. The listener will run once and only once, if and when the future's work is complete. If the future has completed already, the listener will run immediately. Ordering of listeners is not guaranteed.

Register a completion listener for the future. The listener
will run once and only once, if and when the future's work is
complete. If the future has completed already, the listener will
run immediately.  Ordering of listeners is not guaranteed.
raw docstring

as-ofclj

(as-of db t)

Returns the value of the database as of some point t, inclusive. t can be a transaction number, transaction ID, or Date.

Returns the value of the database as of some point t, inclusive.
t can be a transaction number, transaction ID, or Date.
raw docstring

as-of-tclj

(as-of-t db)

Returns the as-of point, or nil if none

Returns the as-of point, or nil if none
raw docstring

attributeclj

(attribute db attrid)

Returns information about the attribute with the given id or ident. Supports ILookup interface for key-based access. Supported keys are:

:id, :ident, :cardinality, :value-type, :unique, :indexed, :has-avet, :no-history, :is-component, :fulltext

Returns information about the attribute with the given id or ident.
Supports ILookup interface for key-based access. Supported keys are:

:id, :ident, :cardinality, :value-type, :unique, :indexed, :has-avet,
:no-history, :is-component, :fulltext
raw docstring

basis-tclj

(basis-t db)

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.
raw docstring

connectclj

(connect uri)

Connects to the specified database, returing a Connection. URI syntax ({} indicate place holders to fill in, [] indicate optional):

DynamoDB using roles: datomic:ddb://{aws-region}/{dynamodb-table}/{db-name}

DynamoDB using keys (use roles if possible): datomic:ddb://{aws-region}/{dynamodb-table}/{db-name}?aws_access_key_id={XXX}&aws_secret_key={YYY}

DynamoDB Local datomic:ddb-local://{endpoint:port}/{dynamodb-table}/{db-name}?aws_access_key_id={XXX}&aws_secret_key={YYY}

Riak: datomic:riak://{host}[:{port}]/{bucket}/{dbname}[?interface=http|https|protobuf] (interface defaults to protobuf)

Couchbase: datomic:couchbase://{host}/{bucket}/{dbname}[?password={xxx}]

SQL: datomic:sql://{db-name}?{jdbc-url}

Infinispan: datomic:inf://{cluster-member-host}:{port}/{db-name}

Cassandra: datomic:cass://{cluster-member-host}[:{port}]/{keyspace}.{table}/{db-name}[?user={user}&password={pwd}][&ssl=true]

Dev Appliance: datomic:dev://{transactor-host}:{port}/{db-name}[?password={password}]

Free transactor integrated storage: datomic:free://{transactor-host}:{port}/{db-name}[?password={password}]

In-process Memory: datomic:mem://{db-name}

Note that URIs must be percent encoded and db-name cannot contain the following characters: / " * : = ?

The dev and free protocols use an additional ports to communicate with storage. By default, this ports is one higher than the specified transactor port. You can override the default by specifying h2-port in the query string, e.g.

datomic:free://localhost:4334/mydb?h2-port=6000

The sql protocol also supports a map format instead of the URI string. This is to enable specifying objects that can't be embedded in URI strings, like DataSources. The format for the SQL map is:

{:protocol :sql ;; keyword or string :db-name "myDb" ;; keyword or string

:data-source aDataSourceObject ;; OR :factory aCallableReturningConnection}

Note only one of data-source or factory should be supplied.

The cass protocol also supports a map format instead of the URI string. This is to enable specifying objects that can't be embedded in URI strings. The format for the Cassandra map is:

{:protocol :cass ;; keyword or string :db-name "myDb" ;; keyword or string :table "myKeyspace.myTable" :cluster aClusterObject}

Note that aClusterObject must be an instance of type com.datastax.driver.core.Cluster.

Datomic connections do not adhere to an acquire/use/release pattern. They are thread-safe and long lived. Connections are cached such that calling datomic.api/connect multiple times with the same database value will return the same connection object.

Connects to the specified database, returing a Connection.
URI syntax ({} indicate place holders to fill in, [] indicate optional):

DynamoDB using roles:
datomic:ddb://{aws-region}/{dynamodb-table}/{db-name}

DynamoDB using keys (use roles if possible):
datomic:ddb://{aws-region}/{dynamodb-table}/{db-name}?aws_access_key_id={XXX}&aws_secret_key={YYY}

DynamoDB Local
datomic:ddb-local://{endpoint:port}/{dynamodb-table}/{db-name}?aws_access_key_id={XXX}&aws_secret_key={YYY}

Riak:
datomic:riak://{host}[:{port}]/{bucket}/{dbname}[?interface=http|https|protobuf]
(interface defaults to protobuf)

Couchbase:
datomic:couchbase://{host}/{bucket}/{dbname}[?password={xxx}]

SQL:
datomic:sql://{db-name}?{jdbc-url}

Infinispan:
datomic:inf://{cluster-member-host}:{port}/{db-name}

Cassandra:
datomic:cass://{cluster-member-host}[:{port}]/{keyspace}.{table}/{db-name}[?user={user}&password={pwd}][&ssl=true]

Dev Appliance: 
datomic:dev://{transactor-host}:{port}/{db-name}[?password={password}]

Free transactor integrated storage:
datomic:free://{transactor-host}:{port}/{db-name}[?password={password}]

In-process Memory:
datomic:mem://{db-name}

Note that URIs must be percent encoded and db-name cannot contain the following characters: / " * : = ?

The dev and free protocols use an additional ports to communicate
with storage.  By default, this ports is one higher than
the specified transactor port. You can override the default by
specifying h2-port in the query string, e.g.

  datomic:free://localhost:4334/mydb?h2-port=6000

The sql protocol also supports a map format instead of the URI
string. This is to enable specifying objects that can't be
embedded in URI strings, like DataSources. The format for the
SQL map is:

  {:protocol :sql                  ;; keyword or string
   :db-name "myDb"               ;; keyword or string

   :data-source aDataSourceObject
    ;; OR
   :factory aCallableReturningConnection}

Note only one of data-source or factory should be supplied.

The cass protocol also supports a map format instead of the URI
string. This is to enable specifying objects that can't be embedded
in URI strings. The format for the Cassandra map is:

  {:protocol :cass                 ;; keyword or string
   :db-name "myDb"               ;; keyword or string
   :table "myKeyspace.myTable"
   :cluster aClusterObject}

Note that aClusterObject must be an instance of type
com.datastax.driver.core.Cluster.

Datomic connections do not adhere to an acquire/use/release
pattern. They are thread-safe and long lived. Connections are
cached such that calling datomic.api/connect multiple times with
the same database value will return the same connection object.
raw docstring

create-databaseclj

(create-database uri)

Creates database specified by uri. Returns true if the database was created, false if it already exists. See connect for a description of the URI syntax.

Creates database specified by uri. Returns true if the
database was created, false if it already exists. See connect
for a description of the URI syntax.
raw docstring

datomsclj

(datoms db index & components)

Raw access to the index data, by index. The index must be supplied, and, optionally, one or more leading components of the index can be supplied to narrow the result.

:eavt and :aevt indexes will contain all datoms :avet contains datoms for attributes where :db/index = true. :vaet contains datoms for attributes of :db.type/ref :vaet is the reverse index

Raw access to the index data, by index. The index must be supplied,
 and, optionally, one or more leading components of the index can be
 supplied to narrow the result.

:eavt and :aevt indexes will contain all datoms
:avet contains datoms for attributes where :db/index = true.
:vaet contains datoms for attributes of :db.type/ref
       :vaet is the reverse index
raw docstring

dbclj

(db connection)

Retrieves a value of the database for reading. Does not communicate with the transactor, nor block.

Retrieves a value of the database for reading. Does not
communicate with the transactor, nor block.
raw docstring

delete-databaseclj

(delete-database uri)

Deletes the database specified by uri. Returns true if the delete occurred. See connect for a description of the URI syntax.

Deletes the database specified by uri. Returns true if the
delete occurred. See connect for a description of the URI
syntax.
raw docstring

entidclj

(entid db ident)

Returns the entity id associated with a symbolic keyword, or the id itself if passed.

Returns the entity id associated with a symbolic keyword, or the id
itself if passed.
raw docstring

entid-atclj

(entid-at db part t-or-date)

Returns a fabricated entity id in the supplied partition whose T component is at or after the supplied t. Entity ids sort by partition, then T component, such T components interleaving with transaction numbers. Thus this function can be used to fabricate a time-based entity id component for use in e.g. seek-datoms.

Returns a fabricated entity id in the supplied partition whose
T component is at or after the supplied t. Entity ids sort by partition,
then T component, such T components interleaving with transaction numbers.
Thus this function can be used to fabricate a time-based entity id component for use
in e.g. seek-datoms.
raw docstring

entityclj

(entity db eid)

Returns a dynamic map of the entity's attributes for the given id, ident or lookup ref. Entities implement clojure.lang.Associative clojure.lang.ILookup clojure.lang.IPersistentCollection clojure.lang.Seqable datomic.Entity

Returns a dynamic map of the entity's attributes for the given id, ident or lookup ref.
Entities implement
  clojure.lang.Associative
  clojure.lang.ILookup
  clojure.lang.IPersistentCollection
  clojure.lang.Seqable
  datomic.Entity
raw docstring

entity-dbclj

(entity-db entity)

Returns the database value that is the basis for this entity

Returns the database value that is the basis for this entity
raw docstring

filterclj

(filter db pred)

Returns the value of the database containing only datoms satisfying the predicate. the predicate will be passed two arguments - the unfiltered db and a Datom. Chained calls compose the predicate with 'and'

Returns the value of the database containing only datoms
satisfying the predicate. the predicate will be passed two arguments -
the unfiltered db and a Datom. Chained calls compose the predicate with
'and'
raw docstring

functionclj

(function m)

Generates a function object given a map with required keys

:lang - clojure or java :params - a list of parameter names used in the code :code - a string or data containing the code of the body

and optional keys

:imports - a list to be spliced into (import ...) :requires - a list to be spliced into (require ...)

Clojure code should consist of a single expression in which the params will be in scope.

Returns a function object that implements IFn, and is a record with keys :lang, :params, :code, :imports, and :requires.

Generates a function object given a map with required keys

:lang  - clojure or java
:params - a list of parameter names used in the code
:code - a string or data containing the code of the body

and optional keys

:imports - a list to be spliced into (import ...)
:requires - a list to be spliced into (require ...)

Clojure code should consist of a single expression in which
the params will be in scope.

Returns a function object that implements IFn, and is a record with
keys :lang, :params, :code, :imports, and :requires.
raw docstring

gc-storageclj

(gc-storage connection older-than)

Allow storage to reclaim garbage older than a certain age.

Allow storage to reclaim garbage older than a certain age.
raw docstring

get-database-namesclj

(get-database-names uri)

Returns a list of database names. URI is a database URI as described under the connect documentation, but with a '' where the database name would be. For instance: datomic:dev://{transactor-host}:{port}/. When using the map form, :db-name should be omitted.

Returns a list of database names. URI is a database URI as
described under the connect documentation, but with a '*' where the
database name would be. For instance: datomic:dev://{transactor-host}:{port}/*.
When using the map form, :db-name should be omitted.
raw docstring

historyclj

(history db)

Returns a special database containing all assertions and retractions across time. This special database can be used for datoms and index-range calls and queries, but not for entity or with calls. as-of and since bounds are also supported. Note that queries will get all of the additions and retractions, which can be distinguished by the fifth datom field :added (true for add/assert) [e a v tx added]

Returns a special database containing all assertions and
retractions across time. This special database can be used for
datoms and index-range calls and queries, but not for entity or
with calls. as-of and since bounds are also supported. Note that
queries will get all of the additions and retractions, which can be
distinguished by the fifth datom field :added (true for add/assert)
[e a v tx added]
raw docstring

identclj

(ident db eid)

Returns the keyword associated with an id, or the key itself if passed.

Returns the keyword associated with an id, or the key itself if passed.
raw docstring

index-rangeclj

(index-range db attrid start end)

Returns an Iterable range of datoms in index named by attrid, starting at start, or from beginning if start is nil, and ending before end, or through end of attr index if end is nil.

Returns an Iterable range of datoms in index named by attrid,
starting at start, or from beginning if start is nil, and ending
before end, or through end of attr index if end is nil.
raw docstring

invokeclj

(invoke db eid-or-ident & args)

Lookup the database function named by eid-or-ident, and call it with args.

Lookup the database function named by eid-or-ident, and call it with args.
raw docstring

is-filteredclj

(is-filtered db)

Returns true if db has had a filter set with filter

Returns true if db has had a filter set with filter
raw docstring

is-historyclj

(is-history db)

logclj

(log connection)

Retrieves a value of the log for use in tx-range or query.

Retrieves a value of the log for use in tx-range or query.
raw docstring

make-getterclj

(make-getter value-builder initial-value)

Make a function for getting a value associated with a db.

Find the closest cached value (start-value at start-key), then compute the value for each successive key from there up to the requested key and store it in the cache, returning the last value.

Make a function for getting a value associated with a db.

Find the closest cached value (`start-value` at `start-key`),
then compute the value for each successive key from there up to
the requested key and store it in the cache, returning the last
value.
raw docstring

next-tclj

(next-t db)

Returns the t one beyond the highest reachable via this db value.

Returns the t one beyond the highest reachable via this db value.
raw docstring

partclj

(part eid)

Return the partition associated with an entity id.

Return the partition associated with an entity id.
raw docstring

pullclj

(pull db pattern eid)

Returns a hierarchical selection of attributes for eid.

See https://docs.datomic.com/on-prem/pull.html for more information.

Returns a hierarchical selection of attributes for eid.

See https://docs.datomic.com/on-prem/pull.html for more information.
raw docstring

pull-manyclj

(pull-many db pattern eids)

Returns hierarchical selections of attributes for eids.

See https://docs.datomic.com/on-prem/pull.html for more information.

Returns hierarchical selections of attributes for eids.

See https://docs.datomic.com/on-prem/pull.html for more information.
raw docstring

qclj

(q query & inputs)

Executes a query against inputs.

Inputs are data sources e.g. a database value retrieved from Connection.db, a list of lists, and/or rules. If only one data source is provided, no :in section is required, else the :in section describes the inputs.

query can be a map, list, or string:

The query map form is {:find vars-and-aggregates :with vars-included-but-not-returned :in sources :where clauses} where vars, sources and clauses are lists.

:with is optional, and names vars to be kept in the aggregation set but not returned.

The query list form is [:find ?var1 ?var2 ... :with ?var3 ... :in $src1 $src2 ... :where clause1 clause2 ...] The query list form is converted into the map form internally.

The query string form is a string which, when read, results in a query list form or query map form.

Query parse results are cached.

Returns a data structure based on the find specification passed in. See https://docs.datomic.com/on-prem/query.html#find-specifications.

Executes a query against inputs.

 Inputs are data sources e.g. a database value retrieved from
 Connection.db, a list of lists, and/or rules. If only one data
 source is provided, no :in section is required, else the :in
 section describes the inputs. 

 query can be a map, list, or string:

 The query map form is {:find vars-and-aggregates
                        :with vars-included-but-not-returned
                        :in sources
                        :where clauses}
 where vars, sources and clauses are lists.

:with is optional, and names vars to be kept in the aggregation set but
 not returned.

 The query list form is [:find ?var1 ?var2 ...
                         :with ?var3 ...
                         :in $src1 $src2 ...
                         :where clause1 clause2 ...]
 The query list form is converted into the map form internally.

 The query string form is a string which, when read, results
 in a query list form or query map form.

 Query parse results are cached.

 Returns a data structure based on the find specification passed in.
 See https://docs.datomic.com/on-prem/query.html#find-specifications.
raw docstring

queryclj

(query query-map)

Executes the query described by query-map

query-map form is {:query query :args args :timeout time-in-milliseconds}

The query parameter is the same format as described in q.

The args parameter is the same format as inputs described in q.

The optional timeout is the number of milliseconds after which a query may be stopped.

Note: timeout is approximate, it is meant to protect against long running queries, but is not guaranteed to stop after precisely the duration specified.

Executes the query described by query-map

query-map form is {:query query
                   :args args
                   :timeout time-in-milliseconds}

The query parameter is the same format as described in q.

The args parameter is the same format as inputs described in q.

The optional timeout is the number of milliseconds after which a query may be stopped.

Note: timeout is approximate, it is meant to protect against long running queries, but is not guaranteed to stop
after precisely the duration specified.
raw docstring

releaseclj

(release conn)

Request the release of resources associated with this connection.
Method returns immediately, resources will be released asynchronously. This method should only be called when the entire process is no longer interested in the connection. Note that Datomic connections do not adhere to an acquire/use/release pattern. They are thread-safe, cached, and long lived. Many processes (e.g. application servers) will never call release.

Request the release of resources associated with this connection.  
Method returns immediately, resources will be released 
asynchronously. This method should only be called when the entire 
process is no longer interested in the connection. Note
that Datomic connections do not adhere to an acquire/use/release 
pattern.  They are thread-safe, cached, and long lived.  Many 
processes (e.g. application servers) will never call release.
raw docstring

remove-tx-report-queueclj

(remove-tx-report-queue connection)

Removes the queue associated with this connection.

Removes the queue associated with this connection.
raw docstring

rename-databaseclj

(rename-database uri new-name)

Renames the database specified by uri to new-name. Returns true if rename succeeded. See connect for a description of the URI syntax.

Renames the database specified by uri to new-name. Returns
true if rename succeeded. See connect for a description of the
URI syntax.
raw docstring

request-indexclj

(request-index connection)

Schedules a re-index of the database. The re-indexing happens asynchronously. Returns true if re-index is scheduled.

Schedules a re-index of the database. The re-indexing happens
asynchronously. Returns true if re-index is scheduled.
raw docstring

resolve-tempidclj

(resolve-tempid db tempids tempid)

Resolve a tempid to the actual id assigned in a database. The tempids object must come from the :tempids member returned through transact or transact-async.

Resolve a tempid to the actual id assigned in a database. The
tempids object must come from the :tempids member returned through
transact or transact-async.
raw docstring

seek-datomsclj

(seek-datoms db index & components)

Raw access to the index data, by index. The index must be supplied, and, optionally, one or more leading components of the index can be supplied for the initial search. Note that, unlike the datoms function, there need not be an exact match on the supplied components. The iteration will begin at or after the point in the index where the components would reside. Further, the iteration is not bound by the supplied components, and will only terminate at the end of the index. Thus you will have to supply your own termination logic, as you rarely want the entire index. As such, seek-datoms is for more advanced applications, and datoms should be preferred wherever it is adequate. See also - entid-at.

   :eavt and :aevt indexes will contain all datoms
   :avet contains datoms for attributes where :db/index = true.
   :vaet contains datoms for attributes of :db.type/ref
   :vaet is the reverse index
Raw access to the index data, by index. The index must be supplied,
and, optionally, one or more leading components of the index can be supplied for the initial search.
Note that, unlike the datoms function, there need not be an exact match on the supplied components.
The iteration will begin at or after the point in the index where the components would reside.
Further, the iteration is not bound by the supplied components, and will only terminate
at the end of the index. Thus you will have to supply your own termination logic, as you rarely
want the entire index. As such, seek-datoms is for more advanced applications, and datoms should be preferred
wherever it is adequate. See also - entid-at.

       :eavt and :aevt indexes will contain all datoms
       :avet contains datoms for attributes where :db/index = true.
       :vaet contains datoms for attributes of :db.type/ref
       :vaet is the reverse index
raw docstring

shutdownclj

(shutdown shutdown-clojure)

Shutdown all peer resources. This method should be called as part of clean shutdown of a JVM process. Will release all Connections, and, if shutdown-clojure is true, will release Clojure resources. Programs written in Clojure can set shutdown-clojure to false if they manage Clojure resources (e.g. agents) outside of Datomic; programs written in other JVM languages should typically set shutdown-clojure to true.

Shutdown all peer resources.  This method should be called as
part of clean shutdown of a JVM process.  Will release all Connections,
and, if shutdown-clojure is true, will release Clojure resources.
Programs written in Clojure can set shutdown-clojure to false if they
manage Clojure resources (e.g. agents) outside of Datomic; programs
written in other JVM languages should typically set shutdown-clojure
to true.
raw docstring

sinceclj

(since db t)

Returns the value of the database since some point t, exclusive t can be a transaction number, transaction ID, or Date.

Returns the value of the database since some point t, exclusive
t can be a transaction number, transaction ID, or Date.
raw docstring

since-tclj

(since-t db)

Returns the since point, or nil if none

Returns the since point, or nil if none
raw docstring

squuidclj

(squuid)

Constructs a semi-sequential UUID. Useful for creating UUIDs that don't fragment indexes. Returns a UUID whose most significant 32 bits are currentTimeMillis rounded to seconds.

Constructs a semi-sequential UUID. Useful for creating UUIDs
that don't fragment indexes. Returns a UUID whose most significant
32 bits are currentTimeMillis rounded to seconds.
raw docstring

squuid-time-millisclj

(squuid-time-millis squuid)

get the time part of a squuid (a UUID created by squuid), in the format of System.currentTimeMillis

get the time part of a squuid (a UUID created by squuid), in
the format of System.currentTimeMillis
raw docstring

syncclj

(sync connection)
(sync connection t)

Used to coordinate with other peers.

When called with a t: returns a future that will acquire a database value with basisT >= t. Does not communicate with the transactor.

When called with no t: Returns a future that will acquire a database value guaranteed to include all transactions that were complete at the time sync was called. Communicates with the transactor.

db is the preferred way to get a database value, as it does not need to wait nor block. Only use sync when coordination is required, and prefer the two-argument version when you have a basis t.

The future returned by sync can take arbitrarily long to complete. Waiters should use deref forms that specify a timeout.

Used to coordinate with other peers.

When called with a t: returns a future that will acquire a
database value with basisT >= t. Does not communicate with the
transactor.

When called with no t: Returns a future that will acquire a
database value guaranteed to include all transactions that were
complete at the time sync was called.  Communicates with the
transactor.

db is the preferred way to get a database value, as it does not
need to wait nor block. Only use sync when coordination is
required, and prefer the two-argument version when you have a
basis t.

The future returned by sync can take arbitrarily long to
complete.  Waiters should use deref forms that specify a timeout.
raw docstring

sync-exciseclj

(sync-excise connection t)

Used to coordinate with background excision. Returns a future that will acquire a database value that is aware of excisions through time <= t.

Does not communicate with the transactor, so the future may be available immediately.

The future can take arbitrarily long to complete. Waiters should specify a timeout.

Used to coordinate with background excision. Returns a
future that will acquire a database value that is aware of
excisions through time <= t.

Does not communicate with the transactor, so the future may be
available immediately.

The future can take arbitrarily long to complete.  Waiters
should specify a timeout.
raw docstring

sync-indexclj

(sync-index connection t)

Used to coordinate with background indexing jobs. Returns a future that will acquire a database value that is indexed through time <= t.

Does not communicate with the transactor, so the future may be available immediately.

The future can take arbitrarily long to complete. Waiters should specify a timeout.

Used to coordinate with background indexing jobs. Returns a
future that will acquire a database value that is indexed
through time <= t.

Does not communicate with the transactor, so the future may be
available immediately.

The future can take arbitrarily long to complete.  Waiters
should specify a timeout.
raw docstring

sync-schemaclj

(sync-schema connection t)

Used to coordinate with background schema changes. Returns a future that will acquire a database value that is aware of all schema changes through time <= t.

Does not communicate with the transactor, so the future may be available immediately.

The future can take arbitrarily long to complete. Waiters should specify a timeout.

Used to coordinate with background schema changes. Returns a
future that will acquire a database value that is aware of
all schema changes through time <= t.

Does not communicate with the transactor, so the future may be
available immediately.

The future can take arbitrarily long to complete.  Waiters
should specify a timeout.
raw docstring

t->txclj

(t->tx t)

Return the transaction id associated with a t value.

Return the transaction id associated with a t value.
raw docstring

tempidclj

(tempid partition)
(tempid partition n)

Generate a tempid in the specified partition. Within the scope of a single transaction, tempids map consistently to permanent ids. Values of n from -1 to -1000000, inclusive, are reserved for user-created tempids.

Generate a tempid in the specified partition. Within the scope
of a single transaction, tempids map consistently to permanent
ids. Values of n from -1 to -1000000, inclusive, are reserved for
user-created tempids.
raw docstring

touchclj

(touch entity)

Touches all of the attributes of the entity, including any component entities recursively. Returns the entity.

Touches all of the attributes of the entity, including any component entities recursively.
Returns the entity.
raw docstring

transactclj

(transact connection tx-data)

Submits a transaction to the database for writing. The transaction data is sent to the Transactor and, if transactAsync, processed asynchronously.

tx-data is a list of lists, each of which specifies a write operation, either an assertion, a retraction or the invocation of a data function. Each nested list starts with a keyword identifying the operation followed by the arguments for the operation.

Returns a completed future that can be used to monitor the completion of the transaction. If the transaction commits, the future's value is a map containing the following keys:

:db-before database value before the transaction :db-after database value after the transaction :tx-data collection of Datoms produced by the transaction :tempids argument to resolve-tempids

The transaction id can be passed to as-of to get the database value as of the end of the transaction. If the transaction aborts, attempts to get the future's value throw a java.util.concurrent.ExecutionException, wrapping a java.lang.Error containing error information. If the transaction times out, the call to transact itself will throw a RuntimeException. The transaction timeout can be set via the system property datomic.txTimeoutMsec, and defaults to 10000 (10 seconds).

Submits a transaction to the database for writing. The transaction
data is sent to the Transactor and, if transactAsync, processed
asynchronously.

tx-data is a list of lists, each of which specifies a write
operation, either an assertion, a retraction or the invocation of
a data function. Each nested list starts with a keyword identifying
the operation followed by the arguments for the operation.

Returns a completed future that can be used to monitor the completion
of the transaction. If the transaction commits, the future's value is
a map containing the following keys:

  :db-before         database value before the transaction
  :db-after          database value after the transaction
  :tx-data           collection of Datoms produced by the transaction
  :tempids           argument to resolve-tempids

The transaction id can be passed to as-of to get the database value
as of the end of the transaction.
If the transaction aborts, attempts to get the future's value
throw a java.util.concurrent.ExecutionException, wrapping a
java.lang.Error containing error information.
If the transaction times out, the call to transact itself will
throw a RuntimeException. The transaction timeout can be set
via the system property datomic.txTimeoutMsec, and defaults to
10000 (10 seconds).
raw docstring

transact-asyncclj

(transact-async connection tx-data)

Same as transact, but returns its future immediately.

Same as transact, but returns its future immediately.
raw docstring

tx->tclj

(tx->t tx)

Return the t value associated with a transaction id.

Return the t value associated with a transaction id.
raw docstring

tx-rangeclj

(tx-range log start end)

Returns a range of transactions in log, starting at start, or from beginning if start is nil, and ending before end, or through end of log if end is nil. start and end can be can be a transaction number, transaction ID, Date or nil.

Each transaction is a map with the following keys: :t - the T point of the transaction :data - a Collection of the Datoms asserted/retracted by the transaction

Returns a range of transactions in log, starting at start,
or from beginning if start is nil, and ending before end, or through
end of log if end is nil. start and end can be can be a transaction
number, transaction ID, Date or nil.

Each transaction is a map with the following keys:
 :t - the T point of the transaction
 :data -  a Collection of the Datoms asserted/retracted by the transaction
raw docstring

tx-report-queueclj

(tx-report-queue connection)

Gets the data queue associated with this connection, creating one if necessary. At any point in time either zero or one queue is associated with a connection. The returned queue may be consumed from more than one thread. Note that the returned queue does not block producers, and will consume memory until you consume the elements from it. Reports will be added to the queue at some point after the db has been updated. If this connection originated the transaction, the transaction future will be notified first, before a report is placed on the queue.

Reports are records with the following keys:

:db-before value of database before the transaction :db-after value of database after the transaction :tx-data the transaction data in E/A/V/Tx form.

Gets the data queue associated with this connection, creating one
if necessary. At any point in time either zero or one queue is
associated with a connection. The returned queue may be consumed
from more than one thread. Note that the returned queue does not
block producers, and will consume memory until you consume the
elements from it. Reports will be added to the queue at some point
after the db has been updated. If this connection originated the
transaction, the transaction future will be notified first, before
a report is placed on the queue.

Reports are records with the following keys:

  :db-before    value of database before the transaction
  :db-after     value of database after the transaction
  :tx-data      the transaction data in E/A/V/Tx form.
raw docstring

withclj

(with db tx-data)

Applies tx-data to the database. It is as if the data was applied in a transaction, but the source of the database is unaffected. Takes data in the same format expected by transact, and returns a map similar to the map returned by transact.

Applies tx-data to the database. It is as if the data was
applied in a transaction, but the source of the database is
unaffected. Takes data in the same format expected by transact, and
returns a map similar to the map returned by transact.
raw docstring

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

× close