diff --git a/CHANGELOG.md b/CHANGELOG.md index 77ebb0c..3bca893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). diff --git a/README.md b/README.md index 139c754..2daa225 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/build.clj b/build.clj index c8c6f89..1c35ab5 100644 --- a/build.clj +++ b/build.clj @@ -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] diff --git a/deps.edn b/deps.edn index b8d2cf4..d384356 100644 --- a/deps.edn +++ b/deps.edn @@ -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"}}} diff --git a/doc/differences-from-1-x.md b/doc/differences-from-1-x.md index edb9daa..d12efc3 100644 --- a/doc/differences-from-1-x.md +++ b/doc/differences-from-1-x.md @@ -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 diff --git a/src/honey/sql.cljc b/src/honey/sql.cljc index 6026763..b035ea1 100644 --- a/src/honey/sql.cljc +++ b/src/honey/sql.cljc @@ -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)] - (symbol n (name k)) - ;; In CLJ runtime, reuse symbol that's already present in the keyword. - #?(:bb (symbol (name k)) - :clj (.sym ^clojure.lang.Keyword k) - :default (symbol (name k)))) + #?(:bb (if-let [n (namespace k)] + (symbol n (name k)) + (symbol (name k))) + :clj (.sym ^clojure.lang.Keyword 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