Skip to content

Instantly share code, notes, and snippets.

@tolitius
Last active April 20, 2017 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tolitius/7449fc5c6248c9c9f5ff to your computer and use it in GitHub Desktop.
Save tolitius/7449fc5c6248c9c9f5ff to your computer and use it in GitHub Desktop.
(defn connect [db-spec]
(jdbc/get-connection db-spec))
(defn disconnect [conn]
(.close conn))
(:require [app.jdbc :as jdbc] ;; << that defined above
[app.env :as env])
(defstate db :start (jdbc/connect (get-in env [:source :db]))
:stop (jdbc/disconnect db))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment