Hi, i'm trying to use fill-db to load a bunch of data. But, it expects [e a v] values is there a way to build datom/eav from tx-data i.e?
[{:chunk/id "foo" :chunk/name "baz"} ...]You will have to do it yourself
Turning tx data into datom is exactly what transactions do. It is expensive.
Tx is expensive because database doesn’t know your data, so it has to check everything. But if you know your data, you can write code to do the transformation into datoms yourself. That’s what Clojure good at. Fill-data is for that purpose.
See the JOB benchmark code for an example of translating a bunch of CSV files into datoms. Pay attention to how we come up with entity ids.
It’s a highly normalized data set, entities are connected. It is still possible to translating into datoms without much effort
With that code, it took about 20 minutes to load all that CSV files, a few times slower than PostgreSQL COPY commands, but it is still doable. It would probably took hours if we do transaction.