From a2aabf7b89da6313c3b47e603a2668d55ad946b7 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Tue, 12 Nov 2013 17:18:00 +1100 Subject: Fix the database type detection in the jdbc executor --- src/clojure_sql/jdbc.clj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/clojure_sql/jdbc.clj b/src/clojure_sql/jdbc.clj index 5a3a55d..253f680 100644 --- a/src/clojure_sql/jdbc.clj +++ b/src/clojure_sql/jdbc.clj @@ -18,8 +18,9 @@ (defn ^:private dotted-to-nested-maps [objs] (mapv dotted-to-nested-map-one objs)) -(defn jdbc-executor [connection-string] - (let [[_ db-type] (re-find #"^jdbc:([^:]+)" connection-string)] +(defn jdbc-executor [connection-string & [db-type]] + (let [db-type (or db-type + (keyword (second (re-find #"^([^:]+)" connection-string))))] (reify QueryExecutor (query [_ query] (let [compiled (compiler/compile-select db-type query)] -- cgit v1.2.3