«

Log API

Datomic's database log is a recording of all transaction data in historic order, organized for efficient access by transaction.

tx-range

You can access the log via the tx-range API function.

(d/tx-range conn {:start 1000 :end 1020})

The arguments are startT (inclusive), and endT (exclusive). Legal values for these arguments are:

  • txes (transaction entity ids)
  • ts (as e.g. returned from Database.nextT)
  • transaction instants (java.util.Dates)
  • nil (to represent the beginning/end of the log)

tx-range returns a collection of transactions, each of which contains key/value pairs:

Keyword Value
:t the transaction t
:data a collection of datoms

The datoms implement the datomic.Datom interface. In Clojure, they act as both sequential and associative collections, and can be destructured accordingly.