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
* 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
* 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.
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.
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]))
(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 snapshot (the-version "9999-SNAPSHOT"))
(def class-dir "target/classes")
@ -47,8 +47,7 @@
"Generate and run doc tests.
Optionally specify :aliases vector:
[:1.9] -- test against Clojure 1.9 (the default)
[:1.10] -- test against Clojure 1.10.3
[:1.10] -- test against Clojure 1.10.3 (the default)
[:1.11] -- test against Clojure 1.11.0
[:1.12] -- test against Clojure 1.12.0
[:cljs] -- test against ClojureScript"
@ -99,10 +98,10 @@
(defn ci
"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."
[opts]
(let [aliases [:cljs :elide :1.10 :1.11 :1.12]
(let [aliases [:cljs :elide :1.11 :1.12]
opts (jar-opts opts)]
(b/delete {:path "target"})
(doseq [alias aliases]

View file

@ -1,6 +1,6 @@
{:mvn/repos {"sonatype" {:url "https://oss.sonatype.org/content/repositories/snapshots/"}}
:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.9.0"}}
:deps {org.clojure/clojure {:mvn/version "1.10.3"}}
:aliases
{;; for help: clojure -A:deps -T:build help/doc
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.6"}
@ -8,7 +8,6 @@
:ns-default build}
;; 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.11 {:override-deps {org.clojure/clojure {:mvn/version "1.11.4"}}}
: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
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
@ -90,7 +90,7 @@ The new namespaces are:
* `honey.sql` -- the primary API (just `format` now),
* `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

View file

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