Document :using

This commit is contained in:
Sean Corfield 2021-02-07 16:36:52 -08:00
parent d2a08c17ef
commit 09745c7237

View file

@ -204,8 +204,21 @@ user=> (sql/format {:select [:u.username :s.name]
["SELECT u.username, s.name FROM user AS u, status AS s WHERE (u.statusid = s.id) AND (u.id = ?)" 9]
```
> Note: the actual formatting of a `:from` clause is currently identical to the formatting of a `:select` clause.
## using
`:using` accepts a single sequence argument that lists
one or more SQL entities. Each entity can either be a
simple table name (keyword or symbol) or a pair of a
table name and an alias.
`:using` is intended to be used as a simple join with a `:delete-from`
clause (see [PostgreSQL DELETE statement](https://www.postgresql.org/docs/12/sql-delete.html)
for more detail).
> Note: the actual formatting of a `:using` clause is currently identical to the formatting of a `:select` clause.
## join, left-join, right-join, inner-join, outer-join, full-join
All these join clauses have the same structure: they accept a sequence