Refer/link to next.jdbc as appropriate

This commit is contained in:
Sean Corfield 2020-03-08 15:40:08 -07:00
parent 58a9a97694
commit ac92047d5e
3 changed files with 8 additions and 4 deletions

View file

@ -2,6 +2,7 @@
* Switch dev/test pipeline to use CLI/`deps.edn` instead of Leiningen. * Switch dev/test pipeline to use CLI/`deps.edn` instead of Leiningen.
* Remove macrovich dependency as this is no longer needed with modern ClojureScript. * Remove macrovich dependency as this is no longer needed with modern ClojureScript.
* Add mention of `next.jdbc` everywhere `clojure.java.jdbc` was mentioned.
## 0.9.10 ## 0.9.10
@ -70,7 +71,7 @@
* Avoid wrapping QUERY with parens while formatting `INSERT INTO ... QUERY`. (@emidln) * Avoid wrapping QUERY with parens while formatting `INSERT INTO ... QUERY`. (@emidln)
* Allow for custom name-transform-fn. Fix #193. (@madvas) * Allow for custom name-transform-fn. Fix #193. (@madvas)
* Add :intersect to default-clause-priorities. (@kenfehling) * Add :intersect to default-clause-priorities. (@kenfehling)
* Add `:parameterizer` `:none` for skipping `clojure.java.jdbc` parameter generation. (@arichiardi) * Add `:parameterizer` `:none` for skipping `next.jdbc` or `clojure.java.jdbc` parameter generation. (@arichiardi)
* Add ClojureScript self-host support. (@arichiardi) * Add ClojureScript self-host support. (@arichiardi)
## 0.9.1 ## 0.9.1

View file

@ -37,7 +37,7 @@ Column names can be provided as keywords or symbols (but not strings -- HoneySQL
### `format` ### `format`
`format` turns maps into `clojure.java.jdbc`-compatible, parameterized SQL: `format` turns maps into `next.jdbc`-compatible (and `clojure.java.jdbc`-compatible), parameterized SQL:
```clojure ```clojure
(sql/format sqlmap) (sql/format sqlmap)
@ -551,7 +551,9 @@ If you do implement a clause or function handler for an ANSI SQL, consider submi
## Why does my parameter get emitted as `()`? ## Why does my parameter get emitted as `()`?
If you want to use your own datatype as a parameter then the idiomatic approach of implementing `clojure.java.jdbc`'s [`ISQLValue`](https://clojure.github.io/java.jdbc/#clojure.java.jdbc/ISQLValue) protocol isn't enough as `honeysql` won't correct pass through your datatype, rather it will interpret it incorrectly. If you want to use your own datatype as a parameter then the idiomatic approach of implementing
`next.jdbc`'s [`SettableParameter`](https://cljdoc.org/d/seancorfield/next.jdbc/CURRENT/api/next.jdbc.prepare#SettableParameter)
or `clojure.java.jdbc`'s [`ISQLValue`](https://clojure.github.io/java.jdbc/#clojure.java.jdbc/ISQLValue) protocol isn't enough as `honeysql` won't correct pass through your datatype, rather it will interpret it incorrectly.
To teach `honeysql` how to handle your datatype you need to implement [`honeysql.format/ToSql`](https://github.com/jkk/honeysql/blob/a9dffec632be62c961be7d9e695d0b2b85732c53/src/honeysql/format.cljc#L94). For example: To teach `honeysql` how to handle your datatype you need to implement [`honeysql.format/ToSql`](https://github.com/jkk/honeysql/blob/a9dffec632be62c961be7d9e695d0b2b85732c53/src/honeysql/format.cljc#L94). For example:
``` clojure ``` clojure

View file

@ -267,7 +267,8 @@
(defn format (defn format
"Takes a SQL map and optional input parameters and returns a vector "Takes a SQL map and optional input parameters and returns a vector
of a SQL string and parameters, as expected by clojure.java.jdbc. of a SQL string and parameters, as expected by `next.jbc` and
`clojure.java.jdbc`.
Input parameters will be filled into designated spots according to Input parameters will be filled into designated spots according to
name (if a map is provided) or by position (if a sequence is provided). name (if a map is provided) or by position (if a sequence is provided).