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
+21-10Lines changed: 21 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,15 @@ PostgreSQL extensions for the widely used [honeysql](https://github.com/jkk/hone
4
4
5
5
This library aims to extend the features of honeysql to support postgres specific SQL clauses and some basic SQL DDL in addition to the ones supported by the parent library. This keeps honeysql clean and single-purpose, any vendor-specific additions can simply be separate libraries that work on top.
6
6
7
+
## Breaking Change
8
+
Implementation of `over` has been changed (from 0.2.2) to accept alias as an option and define the aggregator-function within the over clause and not in the select clause, this allows the inclusion of multiple window-function which was not possible in the previous implementation.
9
+
10
+
The query creation and usage is exactly the same as honeysql.
11
+
7
12
## Index
8
13
9
14
-[Usage](#usage)
10
-
-[Leiningen](#leiningen)
11
-
-[Maven](#maven)
12
15
-[REPL](#REPL)
13
-
-[Breaking Change](#breaking-change)
14
16
-[distinct on](#distinct-on)
15
17
-[upsert](#upsert)
16
18
-[insert into with alias](#insert-into-with-alias)
@@ -21,6 +23,7 @@ This library aims to extend the features of honeysql to support postgres specifi
21
23
-[alter table](#alter-table)
22
24
-[pattern matching](#pattern-matching)
23
25
-[except](#except)
26
+
-[filter](#filter)
24
27
-[SQL functions](#sql-functions)
25
28
-[License](#license)
26
29
@@ -33,14 +36,9 @@ This library aims to extend the features of honeysql to support postgres specifi
33
36
'[honeysql-postgres.helpers :as psqlh])
34
37
```
35
38
36
-
### Breaking Change
37
-
Implementation of `over` has been changed (from 0.2.2) to accept alias as an option and define the aggregator-function within the over clause and not in the select clause, this allows the inclusion of multiple window-function which was not possible in the previous implementation.
38
-
39
-
The query creation and usage is exactly the same as honeysql.
40
-
41
39
### distinct-on
42
40
`select` can be written with a `distinct on` clause
43
-
```clj
41
+
```clojure
44
42
(-> (select:column-1:column-2:column-3)
45
43
(from:table-name)
46
44
(modifiers:distinct-on:column-1:column-2)
@@ -180,6 +178,7 @@ The `ilike` and `not-ilike` operators can be used to query data using a pattern
180
178
sql/format)
181
179
=> ["SELECT name FROM products WHERE name NOT ILIKE ?""%name%"]
182
180
```
181
+
183
182
### except
184
183
```clojure
185
184
(sql/format
@@ -190,6 +189,17 @@ The `ilike` and `not-ilike` operators can be used to query data using a pattern
(is (= ["SELECT count(*) , count(*) FILTER (WHERE s.i < ?) AS foo, count(*) FILTER (WHERE s.i BETWEEN ? AND ?) AS bar FROM generate_series(1,10) AS s(i)"5310]
0 commit comments