diff --git a/CHANGELOG.md b/CHANGELOG.md index d2eb24a..3444a1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changes * 2.6.next in progress - * Address [#531](https://github.com/seancorfield/honeysql/issues/531) and [#527](https://github.com/seancorfield/honeysql/issues/527) by adding tests and more documentation for `:composite`. + * Address [#531](https://github.com/seancorfield/honeysql/issues/531) and [#527](https://github.com/seancorfield/honeysql/issues/527) by adding tests and more documentation for `:composite`; fix bug in `set-dialect!` where clause order is not restored. * Address [#529](https://github.com/seancorfield/honeysql/issues/529) by fixing `:join` special syntax to support aliases and to handle expressions the same way `select` / `from` etc handle them (extra `[...]` nesting). * Add example of mixed `DO UPDATE SET` with `EXCLUDED` and regular SQL expressions. * Improve exception message when un-`lift`-ed JSON expressions are used in the DSL. diff --git a/doc/clause-reference.md b/doc/clause-reference.md index 23b6f9b..49ad7c0 100644 --- a/doc/clause-reference.md +++ b/doc/clause-reference.md @@ -752,7 +752,7 @@ You can also `UPDATE .. FROM (VALUES ..) ..` where you might also need `:composi [4 5 6]]} [:v [:composite :a :b :c]]]] :where [:and [:= :x :v.b] [:> :y :v.c]]}) -;;=> ["UPDATE table FROM (VALUES (?, ?, ?), (?, ?, ?)) AS v (a, b, c) SET a = v.a WHERE (x = v.b) AND (y > v.c)" 1 2 3 4 5 6] +["UPDATE table SET a = v.a FROM (VALUES (?, ?, ?), (?, ?, ?)) AS v (a, b, c) WHERE (x = v.b) AND (y > v.c)" 1 2 3 4 5 6] ``` ## delete, delete-from diff --git a/doc/special-syntax.md b/doc/special-syntax.md index 8e5378b..e17fa5f 100644 --- a/doc/special-syntax.md +++ b/doc/special-syntax.md @@ -188,7 +188,7 @@ value, as above, or a composite based on or declaring columns names: [4 5 6]]} [:v [:composite :a :b :c]]]] :where [:and [:= :x :v.b] [:> :y :v.c]]}) -;;=> ["UPDATE table FROM (VALUES (?, ?, ?), (?, ?, ?)) AS v (a, b, c) SET a = v.a WHERE (x = v.b) AND (y > v.c)" 1 2 3 4 5 6] +;;=> ["UPDATE table SET a = v.a FROM (VALUES (?, ?, ?), (?, ?, ?)) AS v (a, b, c) WHERE (x = v.b) AND (y > v.c)" 1 2 3 4 5 6] ``` ## distinct diff --git a/src/honey/sql.cljc b/src/honey/sql.cljc index 95af3ee..e0288c2 100644 --- a/src/honey/sql.cljc +++ b/src/honey/sql.cljc @@ -2130,7 +2130,7 @@ Dialects are always applied to the base order to create the current order." [dialect & {:keys [quoted]}] (reset! default-dialect (get @dialects (check-dialect dialect))) - (when-let [f (:clause-order-fn @default-dialect)] + (let [f (:clause-order-fn @default-dialect identity)] (reset! current-clause-order (f @base-clause-order))) (reset! default-quoted quoted))