From f2763d5af55088b789589ba9538f72bd49347b66 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Sat, 23 Nov 2024 18:26:53 -0800 Subject: [PATCH] remove experimental xtdb dialect - no longer needed Signed-off-by: Sean Corfield --- CHANGELOG.md | 5 ++++- src/honey/sql.cljc | 5 +---- test/honey/sql/xtdb_test.cljc | 18 +----------------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a437c0d..1283af8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changes +* 2.6.next in progress + * Experimental `:xtdb` dialect removed (since XTDB no longer supports qualified column names). + * 2.6.1230 -- 2024-11-23 * Fix [#553](https://github.com/seancorfield/honeysql/issues/553) by adding `:not-between` as special syntax via PR [#554](https://github.com/seancorfield/honeysql/pull/554) [@plooney81](https://github.com/plooney81) * Fix [#552](https://github.com/seancorfield/honeysql/issues/552) by changing the assert-on-load behavior into an explicit test in the test suite. @@ -43,7 +46,7 @@ * Address [#524](https://github.com/seancorfield/honeysql/issues/524) by adding example of `{:nest ..}` in `:union` clause reference docs. * Address [#523](https://github.com/seancorfield/honeysql/issues/523) by expanding examples in README **Functions** to show aliases. * Address [#522](https://github.com/seancorfield/honeysql/issues/522) by supporting metadata on table specifications in `:from` and `:join` clauses to provide index hints (SQL Server). - * Address [#521](https://github.com/seancorfield/honeysql/issues/521) by adding initial experimental support for an XTDB dialect. + * ~Address [#521](https://github.com/seancorfield/honeysql/issues/521) by adding initial experimental support for an XTDB dialect.~ _[This was removed in 2.6.next since XTDB no longer supports qualified column names]_ * Address [#520](https://github.com/seancorfield/honeysql/issues/520) by expanding how `:inline` works, to support a sequence of arguments. * Fix [#518](https://github.com/seancorfield/honeysql/issues/518) by moving temporal clause before alias. * Address [#495](https://github.com/seancorfield/honeysql/issues/495) by adding `formatv` macro (`.clj` only!) -- and removing the experimental `formatf` function (added for discussion in 2.4.1045). diff --git a/src/honey/sql.cljc b/src/honey/sql.cljc index 0102a35..27b1bdf 100644 --- a/src/honey/sql.cljc +++ b/src/honey/sql.cljc @@ -119,10 +119,7 @@ :nrql {:quote #(strop "`" % "`") :col-fn #(if (keyword? %) (subs (str %) 1) (str %)) :parts-fn vector} - :oracle {:quote #(strop "\"" % "\"") :as false} - :xtdb {:quote #(strop "\"" % "\"") - :col-fn #(if (keyword? %) (subs (str %) 1) (str %)) - :parts-fn #(str/split % #"\.")}}))) + :oracle {:quote #(strop "\"" % "\"") :as false}}))) ; should become defonce (def ^:private default-dialect (atom (:ansi @dialects))) diff --git a/test/honey/sql/xtdb_test.cljc b/test/honey/sql/xtdb_test.cljc index 541431f..f4e8ee2 100644 --- a/test/honey/sql/xtdb_test.cljc +++ b/test/honey/sql/xtdb_test.cljc @@ -1,28 +1,12 @@ ;; copyright (c) 2020-2024 sean corfield, all rights reserved (ns honey.sql.xtdb-test - (:require [clojure.test :refer [deftest is testing use-fixtures]] + (:require [clojure.test :refer [deftest is testing]] [honey.sql :as sql] [honey.sql.helpers :as h :refer [select exclude rename from where]])) -(use-fixtures :once (fn [t] - (try - (sql/set-dialect! :xtdb) - (t) - (finally - (sql/set-dialect! :ansi))))) - (deftest select-tests - (testing "qualified columns" - (is (= ["SELECT \"foo\".\"bar\", \"baz/quux\""] - (sql/format {:select [:foo.bar :baz/quux]} {:quoted true}))) - (is (= ["SELECT \"foo\".\"bar\", \"baz/quux\""] - (sql/format {:select [:foo.bar :baz/quux]} {:dialect :xtdb}))) - (is (= ["SELECT foo.bar, \"baz/quux\""] - (sql/format {:select [:foo.bar :baz/quux]}))) - (is (= ["SELECT foo.bar, baz/quux"] - (sql/format {:select [:foo.bar :baz/quux]} {:quoted false})))) (testing "select, exclude, rename" (is (= ["SELECT * EXCLUDE _id RENAME value AS foo_value FROM foo"] (sql/format (-> (select :*) (exclude :_id) (rename [:value :foo_value])