From b95f8d9a6a88d29266fc6bde97050c8a61dfa365 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Thu, 20 Jun 2013 18:18:15 +1000 Subject: Well, that didn't work. Whatever. --- src/clojure_sql/core.clj | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/clojure_sql/core.clj b/src/clojure_sql/core.clj index e77eeb0..ebdc01f 100644 --- a/src/clojure_sql/core.clj +++ b/src/clojure_sql/core.clj @@ -60,17 +60,18 @@ -(try - (require '[clojure.java.jdbc :as jdbc]) - (defn use-jdbc! [connection-string] - (set-query-executor! (fn [type query] - (jdbc/with-connection connection-string - (case type - :query (jdbc/with-query-results results query - (vec results)) - :insert (jdbc/do-prepared-return-keys (first query) (next query)) - (jdbc/do-prepared (first query) (next query))))))) - - (catch Exception e - )) + + + +;; FIXME: how to do this better? With some discovery, maybe? + +(require '[clojure.java.jdbc :as jdbc]) +(defn use-jdbc! [connection-string] + (set-query-executor! (fn [type query] + (jdbc/with-connection connection-string + (case type + :query (jdbc/with-query-results results query + (vec results)) + :insert (jdbc/do-prepared-return-keys (first query) (next query)) + (jdbc/do-prepared (first query) (next query))))))) -- cgit v1.2.3