diff options
Diffstat (limited to 'src/clojure/contrib/sql/internal.clj')
-rw-r--r-- | src/clojure/contrib/sql/internal.clj | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/clojure/contrib/sql/internal.clj b/src/clojure/contrib/sql/internal.clj index 1c75ee65..9f1aca7e 100644 --- a/src/clojure/contrib/sql/internal.clj +++ b/src/clojure/contrib/sql/internal.clj @@ -32,10 +32,15 @@ (.setProperty p (the-str key) (the-str val))) p)) +(defn find-connection* + "Returns the current database connection (or nil if there is none)" + [] + (:connection *db*)) + (defn connection* "Returns the current database connection (or throws if there is none)" [] - (or (:connection *db*) + (or (find-connection*) (throw (Exception. "no current database connection")))) (defn rollback-only |