I have the following clojure function which transacts to a Datomic database:
(defn demo-tran [term description]
(d/transact conn
[{:db/id (d/tempid :db.part/utility -10034)
:utility.tag/uuid (d/squuid)
:utility.tag/term term
:utility.tag/description description}]))
I then run this in the repl:
(demo-tran "Moo" "A bovine beast")
This succeeds and I am given back a 'transaction map':
{:db-before datomic.db.Db,
@f4c9aa60 :db-after,
datomic.db.Db @908ec69f,
:tx-data [#datom[13194139534424 50 #inst"2016-04-01T09:16:50.945-00:00" 13194139534424 true]
#datom[668503069688921 153 #uuid"56fe3c82-8dbd-4a0d-9f62-27b570cbb14c" 13194139534424 true]
#datom[668503069688921 154 "Moo" 13194139534424 true]
#datom[668503069688921 155 "A bovine beast" 13194139534424 true]],
:tempids {-9222699135738586930 668503069688921}}
I have specified the tempid for this transaction as '-10034' so I would expect to find that negative number in the :tempids map. Instead I find -9222699135738586930. This is confusing. What is going on here?
I was hoping to be able to have the demo-tran function return the new EntityID but (other than guessing the position in the :tempids map) there is no way, given my inputs, to get to this value.