Back

Connectable (clj)

(source)

protocol

Protocol for producing a new JDBC connection that should be closed when you are finished with it. Implementations are provided for `DataSource`, `PreparedStatement`, and `Object`, on the assumption that an `Object` can be turned into a `DataSource`.

Examples

seancorfield/next-jdbc
(ns ^:no-doc next.jdbc.default-options
  "Implementation of default options logic."
  (:require [next.jdbc.protocols :as p]))

(extend-protocol p/Connectable
  DefaultOptions
  (get-connection [this opts]
                  (p/get-connection (:connectable this)
                                    (merge (:options this) opts))))