Merge pull request #569 from seancorfield/issue-561

Fixes #561 by dropping support for clojure 1.9
This commit is contained in:
Sean Corfield 2025-03-12 15:56:06 -07:00 committed by GitHub
commit 1b042687f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 22 additions and 20 deletions

View file

@ -2,6 +2,7 @@
* 2.7.next in progress * 2.7.next in progress
* Address #570 by adding `:.:.` as special syntax for Snowflake's JSON path syntax, and `:at` as special syntax for general `[`..`]` path syntax. * Address #570 by adding `:.:.` as special syntax for Snowflake's JSON path syntax, and `:at` as special syntax for general `[`..`]` path syntax.
* Drop support for Clojure 1.9 [#561](https://github.com/seancorfield/honeysql/issues/561).
* 2.6.1281 -- 2025-03-06 * 2.6.1281 -- 2025-03-06
* Address [#568](https://github.com/seancorfield/honeysql/issues/568) by adding `honey.sql/semicolon` to merge multiple SQL+params vectors into one (with semicolons separating the SQL statements). * Address [#568](https://github.com/seancorfield/honeysql/issues/568) by adding `honey.sql/semicolon` to merge multiple SQL+params vectors into one (with semicolons separating the SQL statements).

View file

@ -14,7 +14,8 @@ This project follows the version scheme MAJOR.MINOR.COMMITS where MAJOR and MINO
> Note: every commit to the **develop** branch runs CI (GitHub Actions) and successful runs push a MAJOR.MINOR.9999-SNAPSHOT build to Clojars so the very latest version of HoneySQL is always available either via that [snapshot on Clojars](https://clojars.org/com.github.seancorfield/honeysql) or via a git dependency on the latest SHA. > Note: every commit to the **develop** branch runs CI (GitHub Actions) and successful runs push a MAJOR.MINOR.9999-SNAPSHOT build to Clojars so the very latest version of HoneySQL is always available either via that [snapshot on Clojars](https://clojars.org/com.github.seancorfield/honeysql) or via a git dependency on the latest SHA.
HoneySQL 2.x requires Clojure 1.9 or later. HoneySQL 2.7.y requires Clojure 1.10.3 or later.
Earlier versions of HoneySQL support Clojure 1.9.0.
It also supports recent versions of ClojureScript and Babashka. It also supports recent versions of ClojureScript and Babashka.
Compared to the [legacy 1.x version](#1.x), HoneySQL 2.x provides a streamlined codebase and a simpler method for extending the DSL. It also supports SQL dialects out-of-the-box and will be extended to support vendor-specific language features over time (unlike 1.x). Compared to the [legacy 1.x version](#1.x), HoneySQL 2.x provides a streamlined codebase and a simpler method for extending the DSL. It also supports SQL dialects out-of-the-box and will be extended to support vendor-specific language features over time (unlike 1.x).

View file

@ -19,7 +19,7 @@
[deps-deploy.deps-deploy :as dd])) [deps-deploy.deps-deploy :as dd]))
(def lib 'com.github.seancorfield/honeysql) (def lib 'com.github.seancorfield/honeysql)
(defn- the-version [patch] (format "2.6.%s" patch)) (defn- the-version [patch] (format "2.7.%s" patch))
(def version (the-version (b/git-count-revs nil))) (def version (the-version (b/git-count-revs nil)))
(def snapshot (the-version "9999-SNAPSHOT")) (def snapshot (the-version "9999-SNAPSHOT"))
(def class-dir "target/classes") (def class-dir "target/classes")
@ -47,8 +47,7 @@
"Generate and run doc tests. "Generate and run doc tests.
Optionally specify :aliases vector: Optionally specify :aliases vector:
[:1.9] -- test against Clojure 1.9 (the default) [:1.10] -- test against Clojure 1.10.3 (the default)
[:1.10] -- test against Clojure 1.10.3
[:1.11] -- test against Clojure 1.11.0 [:1.11] -- test against Clojure 1.11.0
[:1.12] -- test against Clojure 1.12.0 [:1.12] -- test against Clojure 1.12.0
[:cljs] -- test against ClojureScript" [:cljs] -- test against ClojureScript"
@ -99,10 +98,10 @@
(defn ci (defn ci
"Run the CI pipeline of tests (and build the JAR). "Run the CI pipeline of tests (and build the JAR).
Default Clojure version is 1.9.0 (:1.9) so :elide Default Clojure version is 1.10.3 (:1.10) so :elide
tests for #409 on that version." tests for #409 on that version."
[opts] [opts]
(let [aliases [:cljs :elide :1.10 :1.11 :1.12] (let [aliases [:cljs :elide :1.11 :1.12]
opts (jar-opts opts)] opts (jar-opts opts)]
(b/delete {:path "target"}) (b/delete {:path "target"})
(doseq [alias aliases] (doseq [alias aliases]

View file

@ -1,6 +1,6 @@
{:mvn/repos {"sonatype" {:url "https://oss.sonatype.org/content/repositories/snapshots/"}} {:mvn/repos {"sonatype" {:url "https://oss.sonatype.org/content/repositories/snapshots/"}}
:paths ["src"] :paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.9.0"}} :deps {org.clojure/clojure {:mvn/version "1.10.3"}}
:aliases :aliases
{;; for help: clojure -A:deps -T:build help/doc {;; for help: clojure -A:deps -T:build help/doc
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.6"} :build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.6"}
@ -8,7 +8,6 @@
:ns-default build} :ns-default build}
;; versions to test against: ;; versions to test against:
:1.9 {:override-deps {org.clojure/clojure {:mvn/version "1.9.0"}}}
:1.10 {:override-deps {org.clojure/clojure {:mvn/version "1.10.3"}}} :1.10 {:override-deps {org.clojure/clojure {:mvn/version "1.10.3"}}}
:1.11 {:override-deps {org.clojure/clojure {:mvn/version "1.11.4"}}} :1.11 {:override-deps {org.clojure/clojure {:mvn/version "1.11.4"}}}
:1.12 {:override-deps {org.clojure/clojure {:mvn/version "1.12.0"}}} :1.12 {:override-deps {org.clojure/clojure {:mvn/version "1.12.0"}}}

View file

@ -9,7 +9,7 @@ The DSL itself -- the data structures that both versions convert to SQL and para
If you are using Clojure 1.11, you can invoke `format` with a mixture of named arguments and a trailing hash If you are using Clojure 1.11, you can invoke `format` with a mixture of named arguments and a trailing hash
map of additional options, if you wish. map of additional options, if you wish.
HoneySQL 1.x supported Clojure 1.7 and later. HoneySQL 2.x requires Clojure 1.9 or later. HoneySQL 1.x supported Clojure 1.7 and later. HoneySQL 2.7.y requires Clojure 1.10.3 or later. Earlier versions of HoneySQL 2.x support Clojure 1.9.0.
## Group, Artifact, and Namespaces ## Group, Artifact, and Namespaces
@ -90,7 +90,7 @@ The new namespaces are:
* `honey.sql` -- the primary API (just `format` now), * `honey.sql` -- the primary API (just `format` now),
* `honey.sql.helpers` -- helper functions to build the DSL. * `honey.sql.helpers` -- helper functions to build the DSL.
Supported Clojure versions: 1.9 and later. Supported Clojure versions: 1.10.3 and later.
## API Changes ## API Changes

View file

@ -436,8 +436,8 @@
(defn- format-simple-var (defn- format-simple-var
([x] ([x]
(let [c (if (keyword? x) (let [c (if (keyword? x)
#?(:bb (str (symbol x)) #?(:bb (subs (str x) 1)
:clj (str (.sym ^clojure.lang.Keyword x)) ;; Omits leading colon :clj (str (.sym ^clojure.lang.Keyword x))
:default (subs (str x) 1)) :default (subs (str x) 1))
(str x))] (str x))]
(format-simple-var x c {}))) (format-simple-var x c {})))
@ -455,8 +455,8 @@
;; for multiple / in the %fun.call case so that ;; for multiple / in the %fun.call case so that
;; qualified column names can be used: ;; qualified column names can be used:
(let [c (if (keyword? x) (let [c (if (keyword? x)
#?(:bb (str (symbol x)) #?(:bb (subs (str x) 1)
:clj (str (.sym ^clojure.lang.Keyword x)) ;; Omits leading colon :clj (str (.sym ^clojure.lang.Keyword x))
:default (subs (str x) 1)) :default (subs (str x) 1))
(str x))] (str x))]
(cond (str/starts-with? c "%") (cond (str/starts-with? c "%")
@ -1735,12 +1735,13 @@
qualifier, if any." qualifier, if any."
[k] [k]
(if (keyword? k) (if (keyword? k)
(if-let [n (namespace k)] #?(:bb (if-let [n (namespace k)]
(symbol n (name k)) (symbol n (name k))
;; In CLJ runtime, reuse symbol that's already present in the keyword. (symbol (name k)))
#?(:bb (symbol (name k)) :clj (.sym ^clojure.lang.Keyword k)
:clj (.sym ^clojure.lang.Keyword k) :default (if-let [n (namespace k)]
:default (symbol (name k)))) (symbol n (name k))
(symbol (name k))))
k)) k))
(defn format-dsl (defn format-dsl
@ -1965,6 +1966,7 @@
(str "." (join "." (map #(format-simple-expr % "dot navigation") (str "." (join "." (map #(format-simple-expr % "dot navigation")
subcols)))))] subcols)))))]
params))) params)))
(def ^:private special-syntax (def ^:private special-syntax
(atom (atom
{;; these "functions" are mostly used in column {;; these "functions" are mostly used in column