Fork me on GitHub
#datomic
<
2020-06-04
>
joshkh13:06:54

while using a library that implements serialization, i found that query results (which appear to be PersistentVector) throw an .NotSerializableException: datomic.client.impl.shared.Db exception, where as a usual Clojure PersistentVector does not. calling vec on the results of a query solves the problem, but i'm wondering if there's a better way to solve this

favila14:06:48

I think that’s the right way. The result object, especially from the client sync apis, are a bit magical

favila14:06:57

many of them are lazily realized

favila14:06:19

if you use :keys in a query, that is a datatable-like object

favila14:06:43

even in the peer api this is true. queries may return ArrayList instead of vector for efficiency. d/datoms and friends return a reified thing that implements seq and iterable

favila14:06:33

so in general the apis only guarantee the interfaces and behavior of return values, not type