This commit is contained in:
Sean Corfield 2021-11-26 22:30:36 -08:00
parent 627bc25357
commit be1df97b2b
3 changed files with 6 additions and 3 deletions

View file

@ -1,5 +1,8 @@
# Changes # Changes
* 2.1.next in progress
* Fix #371 by always parenthesizing the operand of `NOT`.
* 2.1.818 -- 2021-10-04 * 2.1.818 -- 2021-10-04
* Fix #367 by supporting parameters in subexpressions around `IS NULL` / `IS NOT NULL` tests. * Fix #367 by supporting parameters in subexpressions around `IS NULL` / `IS NOT NULL` tests.
* Address #366 by introducing `:values-default-columns` option to control whether missing columns are treated as `NULL` or `DEFAULT` in `:values` clauses with sequences of hash maps. * Address #366 by introducing `:values-default-columns` option to control whether missing columns are treated as `NULL` or `DEFAULT` in `:values` clauses with sequences of hash maps.

View file

@ -210,7 +210,7 @@ in front of it:
(sql/format-expr [:not nil]) (sql/format-expr [:not nil])
;;=> ["NOT NULL"] ;;=> ["NOT NULL"]
(sql/format-expr [:not [:= :x 42]]) (sql/format-expr [:not [:= :x 42]])
;;=> ["NOT x = ?" 42] ;;=> ["NOT (x = ?)" 42]
``` ```
## order-by ## order-by

View file

@ -868,7 +868,7 @@
:drop-materialized-view #'format-drop-items :drop-materialized-view #'format-drop-items
:refresh-materialized-view (fn [_ x] (format-create :refresh :materialized-view x nil)) :refresh-materialized-view (fn [_ x] (format-create :refresh :materialized-view x nil))
:raw (fn [_ x] (raw-render x)) :raw (fn [_ x] (raw-render x))
:nest (fn [_ x] (format-expr x)) :nest (fn [_ x] (format-expr x {:nested true}))
:with #'format-with :with #'format-with
:with-recursive #'format-with :with-recursive #'format-with
:intersect #'format-on-set-op :intersect #'format-on-set-op
@ -1183,7 +1183,7 @@
(format-expr x {:nested true})) (format-expr x {:nested true}))
:not :not
(fn [_ [x]] (fn [_ [x]]
(let [[sql & params] (format-expr x)] (let [[sql & params] (format-expr x {:nested true})]
(into [(str "NOT " sql)] params))) (into [(str "NOT " sql)] params)))
:order-by :order-by
(fn [k [e q]] (fn [k [e q]]