Back

Sourceable (clj)

(source)

protocol

Protocol for producing a `javax.sql.DataSource`. Implementations are provided for strings, hash maps (`db-spec` structures), and also a `DataSource` (which just returns itself). Extension via metadata is supported.

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/Sourceable
  DefaultOptions
  (get-datasource [this]
                  (p/get-datasource (:connectable this))))