Signed-off-by: Sean Corfield <sean@corfield.org>
This commit is contained in:
Sean Corfield 2025-02-20 16:47:27 -08:00
parent 695351e33c
commit c2990597f1
No known key found for this signature in database
3 changed files with 12 additions and 2 deletions

View file

@ -1,6 +1,7 @@
# Changes
* 2.6.next in progress
* Address [#566](https://github.com/seancorfield/honeysql/issues/566) by adding `IS [NOT] DISTINCT FROM` operators.
* Add examples of `:alias` with `:group-by` (syntax is slightly different to existing examples for `:order-by`).
* 2.6.1270 -- 2025-01-17

View file

@ -1,4 +1,4 @@
;; copyright (c) 2020-2024 sean corfield, all rights reserved
;; copyright (c) 2020-2025 sean corfield, all rights reserved
(ns honey.sql
"Primary API for HoneySQL 2.x.
@ -1788,6 +1788,7 @@
"like" "not-like" "regexp" "~" "&&"
"ilike" "not-ilike" "similar-to" "not-similar-to"
"is" "is-not" "not=" "!=" "regex"
"is-distinct-from" "is-not-distinct-from"
"with-ordinality"}
(into (map str "+-*%|&^=<>"))
(into (keys infix-aliases))

View file

@ -1,4 +1,4 @@
;; copyright (c) 2023-2024 sean corfield, all rights reserved
;; copyright (c) 2023-2025 sean corfield, all rights reserved
(ns honey.ops-test
(:refer-clojure :exclude [format])
@ -9,3 +9,11 @@
(is (= ["SELECT a - b - c AS x"]
(-> {:select [[[:- :a :b :c] :x]]}
(sut/format)))))
(deftest issue-566
(is (= ["SELECT * FROM table WHERE a IS DISTINCT FROM b"]
(-> {:select :* :from :table :where [:is-distinct-from :a :b]}
(sut/format))))
(is (= ["SELECT * FROM table WHERE a IS NOT DISTINCT FROM b"]
(-> {:select :* :from :table :where [:is-not-distinct-from :a :b]}
(sut/format)))))