Skip to content

Commit 3d2a85d

Browse files
author
Anton Oellerer
authored
Update README.md
1 parent 313ece1 commit 3d2a85d

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,6 @@ The query creation and usage is exactly the same as honeysql.
8585
sql/format)
8686
=> ["INSERT INTO distributors (did, dname) VALUES (5, ?), (6, ?) ON CONFLICT (did) DO UPDATE SET dname = EXCLUDED.dname RETURNING *" "Gizmo Transglobal" "Associated Computing, Inc"]
8787

88-
(-> (insert-into :distributors)
89-
(values [{:did 23 :dname "Foo Distributors"}])
90-
(psqlh/on-conflict :did)
91-
(psqlh/do-update-set! [:dname "EXCLUDED.dname || ' (formerly ' || distributors.dname || ')'"])
92-
sql/format)
93-
=> ["INSERT INTO distributors (did, dname) VALUES (23, ?) ON CONFLICT (did) DO UPDATE SET dname = ?" "Foo Distributors" "EXCLUDED.dname || ' (formerly ' || d.dname || ')'"]
94-
```
95-
To set multiple fields on conflict, add the `[k, v]` statements like this:
96-
```clj
9788
(-> (insert-into :distributors)
9889
(values [{:did 23 :dname "Foo Distributors"}])
9990
(psqlh/on-conflict :did)

0 commit comments

Comments
 (0)