onyx

FYI: alternative Onyx :onyx: chat is at <https://gitter.im/onyx-platform/onyx> ; log can be found at <https://clojurians-log.clojureverse.org/onyx/index.html>
Quest 2019-08-06T05:45:25.058400Z

In the latest version of [com.datomic/datomic-pro "0.9.5951"], the namespace com.datomic:client-api:jar:0.8.35:compile is included. I'd like to use the Peer API, but this namespace inclusion is tripping up the automatic :peer vs :cloud vs :client discovery mechanism in onyx.datomic.api --

(defn- _datomic-lib-type []
  (if (find-ns 'datomic.client.api)
    (try (require '[datomic.client.impl.cloud])
         :cloud
         (catch FileNotFoundException _ :client))
    :peer))

(def datomic-lib-type (memoize _datomic-lib-type))
The oldest release I'm allowed to go back to in http://my.datomic.com is "0.9.5783", which still has com.datomic:client-api:jar:0.8.7. I found two ways around this:
;; A) project.clj
[com.datomic/datomic-pro "0.9.5951"
                  :exclusions [[com.datomic/client-api]]]

;; B) shim in your (-main) namespace
;;      UPDATE: further testing reveals that this shim doesn't work. use :exclusions
(alter-var-root #'onyx.datomic.api/datomic-lib-type (constantly :peer))
As far as a permanent solution: I don't believe the client-api includes namespace datomic.api, so might fix it to check for that namespace first. The last version of the client API I could find to test with is [com.datomic/client-pro "0.8.28"], which definitely doesn't have that namespace. If preferred, I can open a PR with the fix, but I wanted to check with this channel first to confirm that this is actually what's going on here.

Quest 2019-08-06T05:46:09.058500Z

Quest 2019-08-06T05:48:35.058900Z

2019-08-06T06:11:00.061300Z

@quest I would be happy to accept any PR that fixes this. I think the datomic plugin hasn’t been updated in some time, so your analysis makes sense.

👍 1
Quest 2019-08-06T17:17:29.063700Z

@lmergen Opened https://github.com/onyx-platform/onyx-datomic/pull/37 Note -- this is likely to break anyone who was including both Datomic Pro & Datomic Client in the same uberjar. The README.md warns against this, but it's still possible to do

2019-08-06T17:39:41.063900Z

great! I’ll take a look at it next weekend