How to store EDN (not String) in Datomic?


Is it possible (how) to have /create :db.type/edn in Datomic?

I don’t want: (def uri \"datomic:free://localhost:4334/daqs\")
I want: (def uri "datomic:free://localhost:4334/daqs")

Don’t you feel an impedance mismatch?
You can use edn (aka clj/s) to control JVM RT to use/control datomic, but you can’t store edn in datomic.


The types supported by Datomic are listed here. As far as I’m aware, your options are:

  • :db.type/string containing stringified EDN
  • :db/type/bytes containing some other serialization format such as fressian
  • storing a reference to some other k/v value store (DyanmoDB, S3, MySQL, …), where the value stored is stringified EDN or some other serialization format

As Datomic is not intended to store large blobs in its entities, the third option is probably the most reliable, albeit the most complex.