Fork me on GitHub
#datomic
<
2022-07-12
>
Ian Fernandez02:07:47

datomic on prem, client, is there any way to implement a AutoCloseable for a datomic connection?

jasonjckn08:07:48

not sure if this answers your question, but have you seen https://docs.datomic.com/on-prem/clojure/index.html#datomic.api/shutdown might be what you want.

Ian Fernandez02:07:09

and for a tx-report-queue ?

favila08:07:53

I think I’ve reported this before? _ will unify across tuple-destructures:

(d/q '[:find ?a2
       :in ?xs1 ?xs2
       :where
       [(identity ?xs1) [[_ ?a1]]]
       [(identity ?xs2) [[_ ?a2]]]]
     [[1 2]
      [1 3]]
     
     [[2 2]
      [2 3]])
=> #{}

😳 2
favila08:07:34

Workaround:

favila08:07:39

(d/q '[:find ?a2
       :in ?xs1 ?xs2
       :where
       [(identity ?xs1) [[?_ignore1 ?a1]]]
       [(identity ?xs2) [[?_ignore2 ?a2]]]]
     [[1 2]
      [1 3]]
     
     [[2 2]
      [2 3]]
     
     )
=> #{[2] [3]}

favila08:07:48

This is with latest on-prem.

favila08:07:08

I just lost maybe an hour to this problem, and this is after having seen it before…