Note SettableParameter can be extended via metadata

This commit is contained in:
Sean Corfield 2019-04-20 23:34:19 -07:00
parent 2f03b73e2c
commit ea7d42741b

View file

@ -18,7 +18,11 @@ If parameters are provided in the vector along with the SQL statement, in the ca
* `(set-parameter v ps i)` -- by default this calls `(.setObject ps i v)` (for `nil` and `Object`)
This can be extended to any Clojure data type, to provide a customized way to add specific types of values as parameters to any `PreparedStatement`.
This can be extended to any Clojure data type, to provide a customized way to add specific types of values as parameters to any `PreparedStatement`. Note that you can extend this protocol via metadata so you can do it on a per-object basis if you need:
```clojure
(with-meta obj {'next.jdbc.prepare/set-parameter (fn [v ps i]...)})
```
`next.jdbc/set-parameters` is available for you to call on any existing `PreparedStatement` to set or update the parameters that will be used when the statement is executed: