Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (45 sloc) 1.93 KB


HikariCP is a new connection pool that's faster and smaller than BoneCP. There is a Clojure wrapper that doesn't seem to contain URL parsing code... You probably should take it from here but actually use it with HikariCP.

Current semantic version:

clojars version


A Clojure wrapper for BoneCP, a JDBC connection pooling library. Can parse URLs. Works with Heroku Postgres, even remotely (ie. doesn't lose SSL parameters from the URLs).


NOTE: you need to have an implementation of slf4j in your dependencies in addition to clj-bonecp-url itself.

If you don't care about logging:

[org.slf4j/slf4j-nop "1.7.2"]

Actual usage

Use it with Korma:

  (:use clj-bonecp-url.core

(def datasource
    (or (System/getenv "DATABASE_URL")

(when (nil? @korma.db/_default)
  (korma.db/default-connection {:pool {:datasource datasource}}))

; defentity, etc.

or plain old java.jdbc:

  (:use clj-bonecp-url.core)
  (:require [ :as jdbc]))

(def datasource
    (or (System/getenv "DATABASE_URL")

(jdbc/with-connection {:datasource datasource}
  (jdbc/with-query-results rows ["SELECT * FROM everything;"]
    (prn rows)))


Copyright © 2013-2015 Greg V.
Contains code from clj-bonecp and clj-dbcp.

Distributed under the Eclipse Public License, the same as Clojure.