Skip to content

Commit

Permalink
remove experimental xtdb dialect - no longer needed
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Corfield <[email protected]>
  • Loading branch information
seancorfield committed Nov 24, 2024
1 parent 42d5f4b commit f2763d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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).
Expand Down
5 changes: 1 addition & 4 deletions src/honey/sql.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
18 changes: 1 addition & 17 deletions test/honey/sql/xtdb_test.cljc
Original file line number Diff line number Diff line change
@@ -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])
Expand Down

0 comments on commit f2763d5

Please sign in to comment.