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
+22-22Lines changed: 22 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ This library aims to extend the features of honeysql to support postgres specifi
41
41
</dependency>
42
42
```
43
43
### REPL
44
-
```clj
44
+
```clojure
45
45
(require '[honeysql.core :as sql]
46
46
'[honeysql.helpers :refer:all]
47
47
'[honeysql-postgres.helpers :as psqlh])
@@ -54,7 +54,7 @@ The query creation and usage is exactly the same as honeysql.
54
54
55
55
### upsert
56
56
`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.
57
-
```clj
57
+
```clojure
58
58
(-> (insert-into:distributors)
59
59
(values [{:did5:dname"Gizmo Transglobal"}
60
60
{:did6:dname"Associated Computing, Inc"}])
@@ -74,7 +74,7 @@ The query creation and usage is exactly the same as honeysql.
74
74
75
75
### insert into with alias
76
76
`insert-into-as` can be used to write insert statements with table name aliased.
77
-
```clj
77
+
```clojure
78
78
(-> (psqlh/insert-into-as:distributors:d)
79
79
(values [{:did5:dname"Gizmo Transglobal"}
80
80
{:did6:dname"Associated Computing, Inc"}])
@@ -88,7 +88,7 @@ The query creation and usage is exactly the same as honeysql.
88
88
89
89
### over
90
90
You can make use of `over` to write window functions where it takes in vectors with aggregator functions and window functions along with optional alias like `(over [aggregator-function window-function alias])`, the can be coupled with the `window` clause to write window-function functions with alias that is later defines the window-function, like `(-> (over [aggregator-function :w]) (window :w window-function))`.
@@ -101,7 +101,7 @@ You can make use of `over` to write window functions where it takes in vectors w
101
101
102
102
### create view
103
103
`create-view` can be used to create views
104
-
```clj
104
+
```clojure
105
105
(-> (psqlh/create-view:metro)
106
106
(select:*)
107
107
(from:cities)
@@ -112,7 +112,7 @@ You can make use of `over` to write window functions where it takes in vectors w
112
112
113
113
### create table
114
114
`create-table` and `with-columns` can be used to create tables along with the SQL functions, where `create-table` takes a table name as argument and `with-columns` takes a vector of vectors as argument, where the vectors describe the column properties as `[:column-name :datatype :constraints ... ]`.
0 commit comments