on-conflict needs ( ) around exprs
This commit is contained in:
parent
290537c581
commit
e7972ac1b4
2 changed files with 4 additions and 5 deletions
|
|
@ -889,11 +889,10 @@
|
|||
{:clause x})))
|
||||
[sqls expr-params]
|
||||
(when (seq exprs)
|
||||
(format-expr-list exprs))
|
||||
(format-expr-list (map (fn [e] (if (sequential? e) [:nest e] e)) exprs)))
|
||||
[sql & clause-params]
|
||||
(when clause
|
||||
(format-dsl clause))]
|
||||
|
||||
(-> [(str (sql-kw k)
|
||||
(when (pos? n)
|
||||
(str " (" (str/join ", " sqls) ")"))
|
||||
|
|
|
|||
|
|
@ -772,13 +772,13 @@ DO NOTHING
|
|||
INSERT INTO customers
|
||||
(name, email)
|
||||
VALUES ('Microsoft', 'hotline@microsoft.com')
|
||||
ON CONFLICT (name, TRIM(email))
|
||||
ON CONFLICT ((foo + ?), name, (TRIM(email)))
|
||||
DO NOTHING
|
||||
"]
|
||||
" 1]
|
||||
(format {:insert-into :customers
|
||||
:columns [:name :email]
|
||||
:values [[[:inline "Microsoft"], [:inline "hotline@microsoft.com"]]]
|
||||
:on-conflict [:name [:trim :email]]
|
||||
:on-conflict [[:+ :foo 1] :name [:trim :email]]
|
||||
:do-nothing true}
|
||||
{:pretty true})))
|
||||
(is (= ["
|
||||
|
|
|
|||
Loading…
Reference in a new issue