diff --git a/deps.edn b/deps.edn index 65feab4..e9a9c3c 100644 --- a/deps.edn +++ b/deps.edn @@ -1,5 +1,4 @@ -{:deps {org.clojure/clojure {:mvn/version "1.10.3" :scope "provided"} - io.replikativ/superv.async {:mvn/version "0.2.11"} +{:deps {org.clojure/clojure {:mvn/version "1.11.1" :scope "provided"} io.replikativ/konserve-jdbc {:mvn/version "0.1.1"}} :paths ["src"] :aliases {:test {:extra-paths ["test"] diff --git a/src/datahike_jdbc/core.clj b/src/datahike_jdbc/core.clj index 825462f..c716db7 100644 --- a/src/datahike_jdbc/core.clj +++ b/src/datahike_jdbc/core.clj @@ -1,9 +1,15 @@ (ns datahike-jdbc.core - (:require [datahike.store :refer [empty-store delete-store connect-store default-config config-spec release-store]] + (:require [datahike.store :refer [empty-store delete-store connect-store default-config config-spec release-store store-identity]] [datahike.config :refer [map-from-env]] [konserve-jdbc.core :as k] [clojure.spec.alpha :as s])) +(defmethod store-identity :jdbc [store-config] + (let [{:keys [jdbcUrl dbtype host port dbname]} store-config] + (if jdbcUrl + [:jdbc jdbcUrl] + [:jdbc dbtype host port dbname]))) + (defmethod empty-store :jdbc [store-config] (k/connect-store store-config))