This commit is contained in:
Sean Corfield 2021-11-26 22:40:51 -08:00
parent be1df97b2b
commit d660c059d4
2 changed files with 7 additions and 3 deletions

View file

@ -1,7 +1,8 @@
# Changes
* 2.1.next in progress
* Fix #371 by always parenthesizing the operand of `NOT`.
* Fix #371 by treating the operand of `NOT` as a nested expression (so it is parenthesized unless it is a simple value).
* Fix #370 by **always** parenthesizing the operand of `:nest`.
* 2.1.818 -- 2021-10-04
* Fix #367 by supporting parameters in subexpressions around `IS NULL` / `IS NOT NULL` tests.

View file

@ -868,7 +868,9 @@
:drop-materialized-view #'format-drop-items
:refresh-materialized-view (fn [_ x] (format-create :refresh :materialized-view x nil))
:raw (fn [_ x] (raw-render x))
:nest (fn [_ x] (format-expr x {:nested true}))
:nest (fn [_ x]
(let [[sql & params] (format-expr x)]
(into [(str "(" sql ")")] params)))
:with #'format-with
:with-recursive #'format-with
:intersect #'format-on-set-op
@ -1180,7 +1182,8 @@
{::wrapper (fn [fx _] (fx))})]))
:nest
(fn [_ [x]]
(format-expr x {:nested true}))
(let [[sql & params] (format-expr x)]
(into [(str "(" sql ")")] params)))
:not
(fn [_ [x]]
(let [[sql & params] (format-expr x {:nested true})]