diff options
author | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-11-12 17:18:00 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-11-12 17:18:00 +1100 |
commit | a2aabf7b89da6313c3b47e603a2668d55ad946b7 (patch) | |
tree | ca9564a3f0c0df638c79ee42132deb91c6ad25ff /src/clojure_sql | |
parent | b99379ed94d7c4f2ae9dc208a2d322632f2898f0 (diff) |
Fix the database type detection in the jdbc executor
Diffstat (limited to 'src/clojure_sql')
-rw-r--r-- | src/clojure_sql/jdbc.clj | 5 |
1 files changed, 3 insertions, 2 deletions
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)] |