Previous fix would not correctly address #1357 when invalid double-quoted identifiers are interpreted as string literals (Configuration.acceptsDoubleQuotedStringLiterals = true, or SQLCipher 3)
If the user would forget the PrimaryKeyDefinition, the primary was not defined:
try db.create(table: "membership") { t in
// WRONG: pk is unused
t.primaryKey { pk in
t.column("playerId", .integer)
t.column("teamId", .text)
}
}
The fix is to remove the PrimaryKeyDefinition:
try db.create(table: "membership") { t in
t.primaryKey {
t.column("playerId", .integer)
t.column("teamId", .text)
}
}
This creates an opportunity for future `request.filter { ... }` apis that look like standard ones. Why not `Player.filter { $0.score > 1000 }` eventually, perhaps with code generation?
The regression was probably due to a bad interaction between Implicitly Opened Existentials (SE-0352) and Opaque Parameter Declarations (SE-0341) which GRDB 6 now uses in a lot of places.
Considering the sample code below:
try db.create(table: ...) { t in
t.column(...).check { $0 != Column(...) }
}
- The `check` method accepts a closure that returns `any SQLExpressible` (the same as GRDB 5)
- The `!=` SQL comparison operator is `(some SQLSpecificExpressible, some SQLSpecificExpressible) -> SQLExpression`, when it was `(SQLSpecificExpressible, SQLSpecificExpressible) -> SQLExpression` in GRDB 5
The compiler has started preferring interpreting the != operator as Column's Equatable implementation, instead of the `!=` SQL comparison operator
We force the compiler to use the SQL comparison operator by removing the Equatable conformance from Column. It was introduced in a70b42c, as a support for a feature that has been removed since then.
This is a breaking change, but this also is an improvement. Now `column1 != column2` has a single meaning, and the library is less prone to similar regressions in the future.
A cool upsert feature is to overwrite an existing value in case of conflict, but another cool upsert feature is to NOT overwrite an existing value. This commit makes it possible to create a ColumnAssignement that does nothing.