Fork me on GitHub

I use Luminus with Postgres. By default Luminus extends some protocols from, as well as adds set-parameter to some Clojure/Java types. How to extend the same protocols/types with pgjdbc-ng?


I understand that is just a wrapped for the stock jdbc, and won't work with pgjdbc-ng.


The easiest thing may be to continue using the default interface and use pgjdbc-ng only where I actually need it (for LISTEN).


It’s not immediately obvious why pgjdbc-ng couldn’t work with, at least for the common jdbc features?


It permits connections to be opened against javax.sql.DataSource impls


I was thinking that maybe hardcodes the dependency on Java's jdbc.


pgjdbc-ng is a jdbc driver


java.jdbc has actually been tested with pgjdbc-ng


I may need to make a new release with that update in… let me just check...


@not-raspberry java.jdbc uses whatever JDBC driver you add as a dependency and whatever driver class you specify. Some have shortcuts (e.g., mysql, mssql, postgres — default PostgreSQL drive). That change added pgsql as a shortcut for the Impossibl pgjdbc-ng driver.


These are the drivers java.jdbc knows about out of the box:

(def ^{:private true :doc "Map of classnames to subprotocols"} classnames
  {"derby"          "org.apache.derby.jdbc.EmbeddedDriver"
   "h2"             "org.h2.Driver"
   "hsqldb"         "org.hsqldb.jdbcDriver"
   "jtds:sqlserver" "net.sourceforge.jtds.jdbc.Driver"
   "mysql"          "com.mysql.jdbc.Driver"
   "oracle:oci"     "oracle.jdbc.OracleDriver"
   "oracle:thin"    "oracle.jdbc.OracleDriver"
   "postgresql"     "org.postgresql.Driver"
   "pgsql"          "com.impossibl.postgres.jdbc.PGDriver"
   "sqlite"         "org.sqlite.JDBC"
   "sqlserver"      ""})
and it has the following shortcut aliases too
(def ^{:private true :doc "Map of schemes to subprotocols"} subprotocols
  {"hsql"     "hsqldb"
   "jtds"     "jtds:sqlserver"
   "mssql"    "sqlserver"
   "oracle"   "oracle:thin"
   "postgres" "postgresql"})
Anything else you need to specify long-hand like this
DriverManager (alternative / legacy style):
    :subprotocol (required) a String, the jdbc subprotocol
    :subname     (required) a String, the jdbc subname
    :classname   (optional) a String, the jdbc driver class name
    (others)     (optional) passed to the driver as properties.


The “built-in” names can be used with this shorthand:

DriverManager (preferred):
    :dbtype      (required) a String, the type of the database (the jdbc subprotocol)
    :dbname      (required) a String, the name of the database
    :host        (optional) a String, the host name/IP of the database
                            (defaults to
    :port        (optional) a Long, the port of the database
                            (defaults to 3306 for mysql, 1433 for mssql/jtds, else nil)
    (others)     (optional) passed to the driver as properties.


LMK if anything about that isn’t clear.


Thanks, everyone, I'll try tomorrow.


Feel free to ping me if you have any issues with java.jdbc!