diff --git a/CHANGELOG.md b/CHANGELOG.md index ac196fc..3fdb1b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ Only accretive/fixative changes will be made from now on. -* 1.3.next in progress +* 1.3.865 -- 2023-03-31 + * Fix [#246](https://github.com/seancorfield/next-jdbc/issues/246) by adopting the `strop` function from HoneySQL. * Address [#245](https://github.com/seancorfield/next-jdbc/issues/245) by not `locking` the `Connection` when `*nested-tx*` is bound to `:ignore` -- improving `clojure.java.jdbc` compatibility. * Address [#237](https://github.com/seancorfield/next-jdbc/issues/237) by adding an `:init-fn` option to the `db-spec` argument for `next.jdbc.connection/component`. diff --git a/README.md b/README.md index 2295a3b..e6c71a8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The next generation of `clojure.java.jdbc`: a new low-level Clojure wrapper for The latest versions on Clojars and on cljdoc: -[![Clojars Project](https://clojars.org/com.github.seancorfield/next.jdbc/latest-version.svg)](https://clojars.org/com.github.seancorfield/next.jdbc) [![cljdoc badge](https://cljdoc.org/badge/com.github.seancorfield/next.jdbc?1.3.862)](https://cljdoc.org/d/com.github.seancorfield/next.jdbc/CURRENT) +[![Clojars Project](https://clojars.org/com.github.seancorfield/next.jdbc/latest-version.svg)](https://clojars.org/com.github.seancorfield/next.jdbc) [![cljdoc badge](https://cljdoc.org/badge/com.github.seancorfield/next.jdbc?1.3.865)](https://cljdoc.org/d/com.github.seancorfield/next.jdbc/CURRENT) The documentation on [cljdoc.org](https://cljdoc.org/d/com.github.seancorfield/next.jdbc/CURRENT) is for the current version of `next.jdbc`: @@ -17,7 +17,7 @@ The documentation on [cljdoc.org](https://cljdoc.org/d/com.github.seancorfield/n * [Migrating from `clojure.java.jdbc`](https://cljdoc.org/d/com.github.seancorfield/next.jdbc/CURRENT/doc/migration-from-clojure-java-jdbc) * Feedback via [issues](https://github.com/seancorfield/next-jdbc/issues) or in the [`#sql` channel on the Clojurians Slack](https://clojurians.slack.com/messages/C1Q164V29/) or the [`#sql` stream on the Clojurians Zulip](https://clojurians.zulipchat.com/#narrow/stream/152063-sql). -The documentation on GitHub is for **develop** since the 1.3.862 release -- [see the CHANGELOG](https://github.com/seancorfield/next-jdbc/blob/develop/CHANGELOG.md) and then read the [corresponding updated documentation](https://github.com/seancorfield/next-jdbc/tree/develop/doc) on GitHub if you want. Older versions of `next.jdbc` were published under the `seancorfield` group ID and you can find [older seancorfield/next.jdbc documentation on cljdoc.org](https://cljdoc.org/versions/seancorfield/next.jdbc). +The documentation on GitHub is for **develop** since the 1.3.865 release -- [see the CHANGELOG](https://github.com/seancorfield/next-jdbc/blob/develop/CHANGELOG.md) and then read the [corresponding updated documentation](https://github.com/seancorfield/next-jdbc/tree/develop/doc) on GitHub if you want. Older versions of `next.jdbc` were published under the `seancorfield` group ID and you can find [older seancorfield/next.jdbc documentation on cljdoc.org](https://cljdoc.org/versions/seancorfield/next.jdbc). This project follows the version scheme MAJOR.MINOR.COMMITS where MAJOR and MINOR provide some relative indication of the size of the change, but do not follow semantic versioning. In general, all changes endeavor to be non-breaking (by moving to new names rather than by breaking existing names). COMMITS is an ever-increasing counter of commits since the beginning of this repository. diff --git a/doc/getting-started.md b/doc/getting-started.md index 905563c..b8106ba 100644 --- a/doc/getting-started.md +++ b/doc/getting-started.md @@ -11,12 +11,12 @@ It is designed to work with Clojure 1.10 or later, supports `datafy`/`nav`, and You can add `next.jdbc` to your project with either: ```clojure -com.github.seancorfield/next.jdbc {:mvn/version "1.3.862"} +com.github.seancorfield/next.jdbc {:mvn/version "1.3.865"} ``` for `deps.edn` or: ```clojure -[com.github.seancorfield/next.jdbc "1.3.862"] +[com.github.seancorfield/next.jdbc "1.3.865"] ``` for `project.clj` or `build.boot`. @@ -38,7 +38,7 @@ For the examples in this documentation, we will use a local H2 database on disk, ```clojure ;; deps.edn {:deps {org.clojure/clojure {:mvn/version "1.10.3"} - com.github.seancorfield/next.jdbc {:mvn/version "1.3.862"} + com.github.seancorfield/next.jdbc {:mvn/version "1.3.865"} com.h2database/h2 {:mvn/version "1.4.199"}}} ``` diff --git a/src/next/jdbc/quoted.clj b/src/next/jdbc/quoted.clj index 5f46edb..b92251f 100644 --- a/src/next/jdbc/quoted.clj +++ b/src/next/jdbc/quoted.clj @@ -1,4 +1,4 @@ -;; copyright (c) 2019-2021 Sean Corfield, all rights reserved +;; copyright (c) 2019-2023 Sean Corfield, all rights reserved (ns next.jdbc.quoted "Provides functions for use with the `:table-fn` and `:column-fn` options @@ -8,11 +8,16 @@ (set! *warn-on-reflection* true) -(defn ansi "ANSI \"quoting\"" [s] (str \" s \")) +(defn strop + "Escape any embedded closing strop characters." + [s x e] + (str s (str/replace x (str e) (str e e)) e)) -(defn mysql "MySQL `quoting`" [s] (str \` s \`)) +(defn ansi "ANSI \"quoting\"" [s] (strop \" s \")) -(defn sql-server "SQL Server [quoting]" [s] (str \[ s \])) +(defn mysql "MySQL `quoting`" [s] (strop \` s \`)) + +(defn sql-server "SQL Server [quoting]" [s] (strop \[ s \])) (def oracle "Oracle \"quoting\" (ANSI)" ansi)