Fork me on GitHub

Hello. I have a noob problem but I'm not really having luck reading the documentation: I just want to pull all the datoms of a transation. How do I do that?


tx-range is probably going to be better in this case


I found tx-range and tx-data and it was exactly what I needed 🙂 Thanks.


Today I'm doing:

(d/q '[:find ?pl ?v ?added
                 :in $ ?tx
                 [?pl :purchase-line/quantity-received ?v ?tx ?added]]
      (d/history db) transaction-id)
and it's terribly inneficient (like 20s).

Lennart Buit10:09:48

so; there is no index on t (or tx). Running this query, datomic has no choice but to use AEVT or AVET indices. Effectively walking through the index for that attr, for each point in time.

Lennart Buit10:09:18

since you bind ?tx in your in, consider using (d/as-of db transaction-id)

Lennart Buit10:09:38

or otherwise, you can probably also use d/tx-range to get that specific transaction from the log

Lennart Buit10:09:07

Does that make sense?


It makes sense. Thanks for your help 🙂


How to retract mistakenly added :db/ident? E.g. i added such a transaction by mistake:

(d/transact conn {:tx-data [{:db/ident :release.type/album :release.type/name "Album"}]})
How to retract it so :release.type/album is not longer available in the latest db:
(d/q '[:find ?e :where [?e :db/ident :release.type/album]] db) ;; => ()


trying to understand the difference between lookup refs and unique identity (reading, is there a difference between upserting

{:person/email ""
 :person/loves :pizza}
{:db/id [:person/email ""]
 :person/loves :pizza}

Lennart Buit18:09:14

I think the second will raise when is not in your db

Lennart Buit18:09:15

Yeah it does, so the first is a proper upsert, the second can only update