GRDBCIPHER is now just a marker for importing SQLCipher with CocoaPods.
Also, enable all APIs that used to be disabled with SQLCipher, and skip tests that require a specific SQLite version.
Database.changesCount calls sqlite3_changes(), whose documentation says:
> https://sqlite.org/c3ref/changes.html
> Changes to a view that are intercepted by INSTEAD OF triggers are not counted.
Since we want to support INSTEAD OF triggers well, so that record types can be based on views, we switch to sqlite3_total_changes().
We were frequently turning those sequences into an Array in order to check their emptiness, and generally were not sure we'd iterate a sequence only once.
Also use `some Sequence` and `some Collection` whenever possible.
Those optionals were just an annoyance. Now, nil results are replaced with `RecordError.recordNotFound`. Such an error is only expected with the IGNORE conflict policy.
While writing SingletonRecordTest.swift, I tried the solution below, in order to turn a failed update into an insert:
func aroundUpdate(_ db: Database, columns: Set<String>, update: () throws -> PersistenceSuccess) throws {
do {
_ = try update()
} catch {
insert(db)
}
}
But this can't work. This `insert(db)` is unable to provide the information we need in `update()`: the result of the eventual RETURNING clause, and the PersistenceSuccess that contains the persisted PersistenceContainer.
So we now detect two misuses: 1) not calling the action method, and 2) not rethrowing the error of the action method.