You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ This library aims to extend the features of honeysql to support postgres specifi
12
12
-[Maven](#maven)
13
13
-[REPL](#REPL)
14
14
-[Breaking Change](#breaking-change)
15
+
-[distinct on](#distinct-on)
15
16
-[upsert](#upsert)
16
17
-[insert into with alias](#insert-into-with-alias)
17
18
-[over](#over)
@@ -50,6 +51,16 @@ Implementation of `over` has been changed (from 0.2.2) to accept alias as an opt
50
51
51
52
The query creation and usage is exactly the same as honeysql.
52
53
54
+
### distinct-on
55
+
`select` can be written with a `distinct on` clause
56
+
```clj
57
+
(-> (select:column-1:column-2:column-3)
58
+
(from:table-name)
59
+
(modifiers:distinct-on:column-1:column-2)
60
+
(sql/format))
61
+
=> ["SELECT DISTINCT ON(column_1, column_2) column_1, column_2, column_3 FROM table_name"]
62
+
```
63
+
53
64
### upsert
54
65
`upsert` can be written either way. You can make use of `do-update-set!` over `do-update-set`, if you want to modify the some column values in case of conflicts.
0 commit comments