summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@clearboxsystems.com.au>2013-11-12 17:18:00 +1100
committerCarlo Zancanaro <carlo@clearboxsystems.com.au>2013-11-12 17:18:00 +1100
commita2aabf7b89da6313c3b47e603a2668d55ad946b7 (patch)
treeca9564a3f0c0df638c79ee42132deb91c6ad25ff
parentb99379ed94d7c4f2ae9dc208a2d322632f2898f0 (diff)
Fix the database type detection in the jdbc executor
-rw-r--r--src/clojure_sql/jdbc.clj5
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)]