Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/honeysql_postgres/format.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
:offset 210
:lock 215
:values 220
:query-values 250}
:query-values 221}
custom-additions))

(defn override-default-clause-priority
Expand Down
11 changes: 9 additions & 2 deletions test/honeysql_postgres/postgres_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
add-column partition-by insert-into-as
create-table rename-table drop-table
window create-view over with-columns]]
[honeysql.helpers :as sqlh :refer [insert-into values where select
from order-by update sset]]
[honeysql.helpers :as sqlh :refer [insert-into values where select columns
from order-by update sset query-values]]
[honeysql.core :as sql]
[clojure.test :as test :refer [deftest is testing]]))

Expand Down Expand Up @@ -45,6 +45,13 @@
(values [{:did 23 :dname "Foo Distributors"}])
(on-conflict :did)
(do-update-set! [:dname "EXCLUDED.dname || ' (formerly ' || d.dname || ')'"])
sql/format)))
(is (= ["INSERT INTO distributors (did, dname) (SELECT ?, ?) ON CONFLICT ON CONSTRAINT distributors_pkey DO NOTHING" 1 "whatever"]
(-> (insert-into :distributors)
(columns :did :dname)
(query-values (select 1 "whatever"))
(upsert (-> (on-conflict-constraint :distributors_pkey)
do-nothing))
sql/format)))))


Expand Down