Back

Preparable (clj)

(source)

protocol

Protocol for producing a new `java.sql.PreparedStatement` that should be closed after use. Can be used by `Executable` functions. Implementation is provided for `Connection` only.

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/Preparable
  DefaultOptions
  (prepare [this sql-params opts]
           (p/prepare (:connectable this) sql-params
                      (merge (:options this) opts))))