Fork me on GitHub

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 '[])
         (catch FileNotFoundException _ :client))

(def datomic-lib-type (memoize _datomic-lib-type))
The oldest release I'm allowed to go back to in 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 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.

👍 4

@lmergen Opened Note -- this is likely to break anyone who was including both Datomic Pro & Datomic Client in the same uberjar. The warns against this, but it's still possible to do


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