Fork me on GitHub
Jack Park21:10:11

On a side note, I am interested in seeing the raw Datom being created by Datahike through Datascript. Can someone point to some code to do just that? It would be nice to be able to roam around a datalog database the way one might in an sql database.


So, you mean converting Datahike datoms to DataScript? As for the implementation, it is inherited from DataScript and can be found here:

Jack Park14:10:51

Actually, I screwed up the request - I want to examine the raw data. If I open a file made by Datahike in textedit, it's mostly binary. I guess next up is to run the postgres example and just look at the table.


You can also just query for [:find ?e ?a ?v :where [?e ?a ?v]], but that may not be as efficient; Datoms should probably be preferred.

Jack Park22:10:03

The return value is a couple of #object objects when using find.


It may print like that, but it should be an interable of tuples.

Jack Park00:10:14

Will run some coding tests on that. Thanks!


Hmm... I just ran a test of this, and not observing what you are. I see a set of tuple vectors, as expected.

      '[:find ?e ?a ?v
        :where [?e ?a ?v]]
      (d/db conn))))
;; => #{[...] ...}


How are you running?

Jack Park16:10:40

I'll make a gist of my code - In a sense, I'm not working from repl but from inside a main called by lein run. I put the calls inside printlns