Last active
April 20, 2017 14:26
-
-
Save tolitius/7449fc5c6248c9c9f5ff to your computer and use it in GitHub Desktop.
mount thoughts on: https://github.com/danielsz/system/blob/master/src/system/components/jdbc.clj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn connect [db-spec] | |
(jdbc/get-connection db-spec)) | |
(defn disconnect [conn] | |
(.close conn)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: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