fix #480 by adding notes about DSL clause to/from helper mapping
This commit is contained in:
parent
7e67caaf0c
commit
f5744d4f21
4 changed files with 14 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
* 2.4.next in progress
|
* 2.4.next in progress
|
||||||
* Address [#481](https://github.com/seancorfield/honeysql/issues/481) by adding more examples around `:do-update-set`.
|
* Address [#481](https://github.com/seancorfield/honeysql/issues/481) by adding more examples around `:do-update-set`.
|
||||||
|
* Address [#480](https://github.com/seancorfield/honeysql/issues/480) by clarifying the general relationship between clauses and helpers.
|
||||||
|
|
||||||
* 2.4.1006 -- 2023-03-17
|
* 2.4.1006 -- 2023-03-17
|
||||||
* Fix [#478](https://github.com/seancorfield/honeysql/issues/478) by handling `:do-update-set` correctly in the `upsert` helper and by handling parameters correctly in the `:do-update-set` formatter.
|
* Fix [#478](https://github.com/seancorfield/honeysql/issues/478) by handling `:do-update-set` correctly in the `upsert` helper and by handling parameters correctly in the `:do-update-set` formatter.
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,10 @@ function in the `honey.sql.helpers` namespace:
|
||||||
=> {:select [:a :b :c] :from [:foo] :where [:= :foo.a "baz"]}
|
=> {:select [:a :b :c] :from [:foo] :where [:= :foo.a "baz"]}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
In general, `(helper :foo expr)` will produce `{:helper [:foo expr]}`
|
||||||
|
(with a few exceptions -- see the docstring of the helper function
|
||||||
|
for details).
|
||||||
|
|
||||||
Order doesn't matter (for independent clauses):
|
Order doesn't matter (for independent clauses):
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,11 @@ The examples herein assume:
|
||||||
where order-by over partition-by window]])
|
where order-by over partition-by window]])
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Every DDL and SQL clause has a corresponding helper function
|
||||||
|
in `honey.sql.helpers`. In general, `(helper :foo expr)` will
|
||||||
|
produce `{:helper [:foo expr]}` (with a few exceptions -- see
|
||||||
|
the docstring of the helper function for details).
|
||||||
|
|
||||||
# DDL Clauses
|
# DDL Clauses
|
||||||
|
|
||||||
HoneySQL supports the following DDL clauses as a data DSL.
|
HoneySQL supports the following DDL clauses as a data DSL.
|
||||||
|
|
|
||||||
|
|
@ -277,6 +277,10 @@ supports out of the box. In addition, there are helpers for
|
||||||
parts of the SQL DSL (examples of `composite` appear in the [README](/README.md),
|
parts of the SQL DSL (examples of `composite` appear in the [README](/README.md),
|
||||||
examples of `over` appear in the [Clause Reference](clause-reference.md))
|
examples of `over` appear in the [Clause Reference](clause-reference.md))
|
||||||
|
|
||||||
|
In general, `(helper :foo expr)` will produce `{:helper [:foo expr]}`
|
||||||
|
(with a few exceptions -- see the docstring of the helper function
|
||||||
|
for details).
|
||||||
|
|
||||||
In addition to being variadic -- which often lets you omit one
|
In addition to being variadic -- which often lets you omit one
|
||||||
level of `[`..`]` -- the helper functions merge clauses, which
|
level of `[`..`]` -- the helper functions merge clauses, which
|
||||||
can make it easier to build queries programmatically:
|
can make it easier to build queries programmatically:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue