Remove SortDirection

No longer used after Expression<T>.{asc,desc} was implemented.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add enhanced setter functions

Firstly, we now support set(Expression<T>, Expression<T>), for mutations
that involve database state. With this, we also create a bunch of
operator-equals overrides. Now this is possible:

    let amount = 100.0
    db.transaction(
        checking.update(balance -= amount),
        savings.update(balance += amount)
    )
    // BEGIN DEFERRED TRANSACTION
    // UPDATE accounts SET balance = balance - 100.0 WHERE ...
    // UPDATE accounts SET balance = balance + 100.0 WHERE ...
    // COMMIT TRANSACTION

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Let's not use `where` where we can avoid it

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add ++/-- postfix Setter operators

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Maintain expression precedence

We need to surround expressions with parentheses to guarantee that Swift
precedence is preserved.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Support XOR

SQLite may not, but we can.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Share schemes (for CI, eventually)

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Use parentheses consistently to group expressions

It makes the compiled statements slightly muddier, but precedence should
always be retained now.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Surround boolean expressions with parentheses

Better fidelity.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add SELECT DISTINCT helper

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Reorganize ASC/DESC

They're main computer variables, not Expressible extension material.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Use helpers wherever possible

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Support select(distinct: *)

It requires changing select(*) to select(all: *), but this is a small
concession to make when calling `distinct: *` is going to be much more
common (`all: *` is technically the default).

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
From: Apple Developer Relations

> Engineering has determined that your bug report is a duplicate of
> another issue and will be closed.

> The open or closed status of the original bug report your issue was
> duplicated to appears in the yellow "Duplicate of XXXXXXXX" section of
> the bug reporter user interface. This section appears near the top of
> the right column's bug detail view just under the bug number, title,
> state, product and rank.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add collation operator

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Workaround for segfault

Archive currently triggers a segfault with the addition of these two
postfix operators. The bug has been reported to Apple with
<rdar://18825175> and this commit acts as a less-than-DRY workaround in
the meantime.

Reported-by: Ferran Vilà Conesa <@fnva>
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Documentation fixes

Copy-paste an error several times and you have more than several errors.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Move comment to re-enable documentation

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Query shouldn't be Expressible yet

In all likelihood, a Query.expression will be a SELECT statement in the
future.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add table alias helper

Signed-off-by: Stephen Celis <stephen@stephencelis.com>