Fork me on GitHub
#datahike
<
2021-10-19
>
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.

kkuehne07:10:35

So, you mean converting Datahike datoms to DataScript? As for the implementation, it is inherited from DataScript and can be found here: https://github.com/replikativ/datahike/blob/development/src/datahike/datom.cljc#L91

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.

metasoarous18:10:54

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.

metasoarous22:10:20

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!

metasoarous01:10:13

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

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

metasoarous01:10:20

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