File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 6
6
(pg/open-db {:hostname " localhost"
7
7
:database " postgres"
8
8
:username " postgres"
9
- :password " postgres" }))
9
+ :password " postgres"
10
+ :validation-query " select 1" }))
10
11
11
12
(defn reload []
12
13
(repl/refresh ))
Original file line number Diff line number Diff line change 7
7
:url " http://github.com/alaisi/postgres.async.git" }
8
8
:dependencies [[org.clojure/clojure " 1.6.0" ]
9
9
[org.clojure/core.async " 0.1.346.0-17112a-alpha" ]
10
- [com.github.alaisi.pgasync/postgres-async-driver " 0.6 " ]
10
+ [com.github.alaisi.pgasync/postgres-async-driver " 0.7-SNAPSHOT " ]
11
11
[cheshire " 5.5.0" :scope " provided" ]]
12
12
:lein-release {:deploy-via :clojars }
13
13
:global-vars {*warn-on-reflection* true }
Original file line number Diff line number Diff line change 18
18
19
19
(defn open-db
20
20
" Creates a db connection pool"
21
- [{:keys [hostname port username password database pool-size ssl] :as config}]
21
+ [{:keys [hostname port username password database pool-size ssl validation-query]
22
+ :as config}]
22
23
(doseq [param [:hostname :username :password :database ]]
23
24
(when (nil? (param config))
24
25
(throw (IllegalArgumentException. (str param " is required" )))))
30
31
(.password password)
31
32
(.ssl (boolean ssl))
32
33
(.poolSize (or pool-size 25 ))
34
+ (.validationQuery validation-query)
33
35
(.dataConverter (create-converter ))
34
36
(.build )))
35
37
You can’t perform that action at this time.
0 commit comments