Merge pull request #89 from dball/document-unions

Document the correct use of the :union clause
This commit is contained in:
Dave Della Costa 2015-08-26 11:22:58 +09:00
commit ee2b778d52

View file

@ -174,6 +174,14 @@ Queries can be nested:
=> ["SELECT * FROM foo WHERE (foo.a IN (SELECT a FROM bar))"]
```
Queries may be united within a :union or :union-all keyword:
```clj
(sql/format {:union [(-> (select :*) (from :foo))
(-> (select :*) (from :bar))]})
=> ["(SELECT * FROM foo) UNION (SELECT * FROM bar)"]
```
Keywords that begin with `%` are interpreted as SQL function calls:
```clj