Fork me on GitHub
#datomic
<
2019-04-09
>
Ivar Refsdal07:04:24

@currentoor I had the same issue, and while I don't recall the exact details of it, I solved it using clojure.walk/prewalk and checking for java.util.List inside my db fn:

(clojure.walk/prewalk
  (fn [e] (cond (and (instance? java.util.List e) (not (vector? e))) (vec e)
                :else e))
   x)

Ivar Refsdal08:04:05

@currentoor I believe I've also encountered java.util.Arrays$ArrayList, at least that is what my tests are using to reproduce the behaviour encountered in production. I'm using e.g. (java.util.Arrays/asList (into-array [1 2 3])) in my tests to test the convert function

jaihindhreddy11:04:22

I have a service that I use, and I want to store it's response (EDN) under a particular key in Datomic. AFAIK Datomic doesn't currently support this document like storage? How should I do something like this? Store them externally, and put their IDs in Datomic?

benoit11:04:31

Yes, I usually store blobs like these in S3 and the key in Datomic.

jaihindhreddy11:04:21

The API response is highly dynamic, doesn't use namespaced keywords, and most of the time, I don't foresee needing to use Datalog into it.

jaihindhreddy11:04:32

I'm fine with it being an opaque value.

johnj16:04:56

you can store it as a string but datomic has performance issues with big strings >1Kb