Evaluates func in the context of a new connection to a database then
closes the connection.
(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))))
Comments top
No comments for with-connection*. Log in to add a comment.