I tried looking around, and I couldn’t find anything but just in case: Is there a way to “create” a Datomic datom object out of existing data (without writing it to Datomic first)?
Similar to Datascript’s datom fn:
(datascript.core/datom 1 :attr "value")
=> #datascript/Datom [1 :attr "value" 536870912 true]
I realize I could make a new/custom deftype that mimics all of the datomic.db.Datum interfaces but I would prefer to avoid that if possible.
use with?
(d/with (d/db conn) [[:db/add 666 :some/attr "bar"]])
and the return value :tx-data will have themThanks! That might do!
out of curiosity, why do you need a datum instance?
I am writing an IVM query engine for Datomic/Datascript
It might not be strictly necessary, but it’s sometimes more convenient to instantiate Datoms to write a basic unit test to compare to output result set, for example
Modeling it after DBSP?
Yes
interesting