Fork me on GitHub
Pragyan Tripathi06:05:48

Hello Guys. Is there a correct way to store raw edn data in datomic? Only way I could figure out is stringify the edn and parse it when reading.


You can't store Clojure values as-is in Datomic. You have to represent them using the Datomic schema. You can always store an EDN string using the :db.type/string type but it is limited to 4096 characters according to the docs (same link). Also, keep in mind that you won't be able to query against the values inside your EDN string.


on datomic on-prem, you can use bytes + nippy

Pragyan Tripathi11:05:22

I figured out a way to use refs in my schema to solve my problem... Thanks 🙂

Yarin Kessler21:05:25

The following query was taken straight from Datomic docs (, but when I run it it goes into an infinite loop of continuous data output, forcing my to terminate my REPL. Any idea why?

(d/q  '[:find ?name ?duration
        :where [?e :artist/name "The Beatles"]
        [?track :track/artists ?e]
        [?track :track/name ?name]
        [?Track :track/duration ?duration]]
(Running this against mbrainz ( on local-dev instance)

Alex Miller (Clojure team)22:05:13

Is that capital ?Track in there? Seems like that should be lowercase to match the others

🙌 2
Yarin Kessler22:05:13

YES! Thanks Alex- I never would have spotted that!

Alex Miller (Clojure team)22:05:14

I dropped a note in our internal support channel to fix the docs, sorry about that

Alex Miller (Clojure team)22:05:17

Might be creating an unintended free variable