Note SettableParameter can be extended via metadata
This commit is contained in:
parent
2f03b73e2c
commit
ea7d42741b
1 changed files with 5 additions and 1 deletions
|
|
@ -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`)
|
* `(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:
|
`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:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue