Hi!
If I understand correctly... consider something like the following:
(let [log (d/log (db/conn))
my-tx 123456789123456]
(->> (d/tx-range log my-tx (inc my-tx))
seq
pprint))
You get a bunch of datoms and transaction ID.
You can access a datom's fields with: :e :a :v :tx :added.
At first, the datoms look depressing because attributes look like 74 instead
of :mouse/name. So use(d/ident db 74) to get :mouse/name. (You might like
to make a little util which turns these datoms into a nice map or record.
Records are nice because they seem to print fields in the :e :a :v :tx
:added order you declare.)
FWIW, you may see two datoms where the entities are the same, but :added is
different. That's because you changed something; the entity's old value was
retracted and the new value was added.
Hope this helps,
Tj
On Saturday, December 27, 2014 7:57:51 PM UTC+1, rogergl wrote:
>
> I would like to replay all changes since a specific timestamp. It seems
> as if I can get all transactions with
>
> (q '[:find ?t :where
> [_ :db/txInstant ?t]
> ] (db conn))
>
> Using as-of would allow me to replay the state at a given point in time.
> But that would replay the complete state and not just the changes.
>
> Is it possbile to get just the changes for a specific transaction ?
>
> I tried
>
> (q '[:find ?c ?n :where
> [?tx :db/txInstant g]
> [?c :db/txInstant ?n ?tx]] (db conn))
>
> to test if I can get back a result for a specific transaction. That did
> not work although
> <http://dict.leo.org/ende/index_de.html#/search=although&searchLoc=0&resultOrder=basic&multiwordShowSingle=on>
> g
> was a value from the first query.
>
> Regards
> Roger
>
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.