1.2.0 permalink Arrow_down_16x16

with-connection*

clojure.contrib.sql.internal

  • (with-connection* db-spec func)
Evaluates func in the context of a new connection to a database then
closes the connection.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/sql/internal.clj:98 top

(defn with-connection*
  "Evaluates func in the context of a new connection to a database then
  closes the connection."
  [db-spec func]
  (with-open [con (get-connection db-spec)]
    (binding [*db* (assoc *db*
                     :connection con :level 0 :rollback (atom false))]
      (func))))
Vars in clojure.contrib.sql.internal/with-connection*: binding defn with-open
Used in 0 other vars

Comments top

No comments for with-connection*. Log in to add a comment.