fix #493 by clarifying with values

This commit is contained in:
Sean Corfield 2023-06-10 19:18:36 -07:00
parent 23c9597870
commit 19e73a3ebd
2 changed files with 3 additions and 0 deletions

View file

@ -1,6 +1,7 @@
# Changes
* 2.4.next in progress
* Address [#493](https://github.com/seancorfield/honeysql/issues/493) by clarifying use of `:values` in CTEs (using `:with`).
* Address [#489](https://github.com/seancorfield/honeysql/issues/489) by adding more examples around `:update`.
* 2.4.1033 -- 2023-05-22

View file

@ -431,6 +431,8 @@ user=> (sql/format {:with [[[:stuff {:columns [:id :name]}]
["WITH stuff (id, name) AS (VALUES (?, ?), (?, ?)) SELECT id, name FROM stuff" 1 "Sean" 2 "Jay"]
```
> Note: you must use the vector-of-vectors format for `:values` here -- if you try to use the vector-of-maps format, `VALUES` will be preceded by the column names (keys from the maps) and the resultant SQL will be invalid.
`:with-recursive` follows the same rules as `:with` and produces `WITH RECURSIVE` instead of just `WITH`.
## intersect, union, union-all, except, except-all