From ea7d42741b994499612d9211033962dd04d63ac7 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Sat, 20 Apr 2019 23:34:19 -0700 Subject: [PATCH] Note SettableParameter can be extended via metadata --- doc/prepared_stmt.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/prepared_stmt.md b/doc/prepared_stmt.md index 2a6e3cb..d3a662b 100644 --- a/doc/prepared_stmt.md +++ b/doc/prepared_stmt.md @@ -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: