Commit Graph
11428 Commits
Author SHA1 Message Date
Gwendal Roué f3b8b7221c Failing test for #1274
https://github.com/groue/GRDB.swift/discussions/1274
2022-09-05 08:42:29 +02:00
Gwendal Roué f04a02731d Add defaultLocalization to GRDB package
This solves the "manifest property 'defaultLocalization' not set; it is required in the presence of localized resources" error
2022-09-04 14:09:35 +02:00
Gwendal Roué 6add38e3e5 BREAKING: Allow ValueObservation to perform different kinds of fetch
We're interested in allowing observations to build values based on snapshots
2022-09-04 12:06:17 +02:00
Gwendal Roué 202b3e5620 Encapsulate ValueObservation database accesses
Also, enhance Database.isolated(readOnly:) by not creating a savepoint if the database is already inside a transaction.
2022-09-04 10:11:22 +02:00
Gwendal Roué 49cce0aa8a CHANGELOG 2022-08-29 14:22:04 +02:00
Gwendal Roué ccf3486827 CHANGELOG 2022-08-29 14:21:01 +02:00
Gwendal Roué cb93979a44 Update CONTRIBUTING.md
It needed to be updated for cross-platform targets
2022-08-28 14:52:31 +02:00
Gwendal Roué 628ac58535 Merge branch 'development' v6.0.0-beta.4 2022-08-28 13:45:17 +02:00
Gwendal Roué 373f95a6cb v6.0.0-beta.4 2022-08-28 13:44:35 +02:00
Gwendal Roué f2859ff8bf Use SQLITE_OPEN_EXRESCODE when available 2022-08-28 12:50:47 +02:00
Gwendal Roué e2b412afc8 Merge branch 'dev/TableInfo' into development 2022-08-28 12:49:59 +02:00
Gwendal Roué 040e5d9d87 WITHOUT ROWID check: prefer PRAGMA table_list when available
This avoids the undesired errors described in #945.
2022-08-28 12:28:39 +02:00
Gwendal Roué 189430c1fe PRAGMA table_list 2022-08-28 12:28:39 +02:00
Gwendal Roué 3d77a8da86 Update the manual installation documentation 2022-08-28 09:59:52 +02:00
Gwendal Roué c40256600a Update playgrounds doc 2022-08-28 09:49:34 +02:00
Gwendal Roué b617f432c0 Merge branch 'dev/cross-platform-targets' into development 2022-08-27 14:43:33 +02:00
Gwendal Roué 72ef13f4fb CHANGELOG 2022-08-27 14:43:06 +02:00
Gwendal Roué 535f44c463 Update the GRDB6 migration guide 2022-08-27 14:42:57 +02:00
Gwendal Roué 4c10899a3c Single Cross-Platform Target 2022-08-27 13:43:44 +02:00
Gwendal Roué 524ee1d098 Merge pull request #1271 from groue/dev/SQLite-3.39.2
Bump custom SQLite builds v3.39.2
2022-08-27 12:27:56 +02:00
Gwendal Roué 973b679baa CHANGELOG 2022-08-27 12:27:14 +02:00
Gwendal Roué 0321c79c2d Update SQLiteCustom to v3.39.2 2022-08-27 12:16:59 +02:00
Gwendal Roué e82a03615f Merge branch 'development' v6.0.0-beta.3 2022-08-25 19:11:29 +02:00
Gwendal Roué 51c9071b3d v6.0.0-beta.3 2022-08-25 19:11:20 +02:00
Gwendal Roué 91e5f838d3 Merge branch 'dev/GRDB6-singleton-record' into development 2022-08-25 19:10:09 +02:00
Gwendal Roué d026232cbf CHANGELOG 2022-08-25 19:09:51 +02:00
Gwendal Roué c2e4aaf51d Throw SQLITE_MISUSE in case of programmer error in the aroundXxx callbacks
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.
2022-08-25 19:05:27 +02:00
Gwendal Roué 05b81df614 Update the migration guide with the actions to perform on customized records 2022-08-25 19:05:27 +02:00
Gwendal Roué 3e4b04d4d1 Test the "Single-Row Tables" guide 2022-08-25 19:05:27 +02:00
Gwendal Roué 56cdaabd9c Update the "Single-Row Tables" guide 2022-08-25 19:05:27 +02:00
Gwendal Roué c65a19c50f Merge pull request #1268 from groue/dev/issue-1267
Fix SQL generation of CHECK constraints.
2022-08-25 08:31:53 +02:00
Gwendal Roué 5247a1537c CHANGELOG 2022-08-25 08:31:20 +02:00
Gwendal Roué 58f970701f BREAKING: Fix failing test for #1267
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.
2022-08-25 08:26:37 +02:00
Gwendal Roué 980f5247f0 Failing test for #1267 2022-08-25 08:12:32 +02:00
Gwendal Roué d70032c483 Merge branch 'development' v6.0.0-beta.2 2022-08-23 22:17:06 +02:00
Gwendal Roué 14321e411c v6.0.0-beta.2 2022-08-23 22:16:37 +02:00
Gwendal Roué d3d2ad1b91 Merge branch 'dev/upsert-documentation' into development 2022-08-23 22:10:33 +02:00
Gwendal Roué 55f3c2f510 CHANGELOG 2022-08-23 22:05:23 +02:00
Gwendal Roué ffa183821c UPSERT documentation 2022-08-23 22:05:23 +02:00
Gwendal Roué 327911d057 Upsert: add support for conflict target and assignments 2022-08-23 20:02:17 +02:00
Gwendal Roué c6657b7063 ColumnAssignment that does nothing
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.
2022-08-23 20:02:17 +02:00
Gwendal Roué 2a5626efea Replace if let x = x with if let x 2022-08-22 20:40:00 +02:00
Gwendal Roué 6bf346ccf5 Merge branch 'development' v6.0.0-beta 2022-08-21 21:57:30 +02:00
Gwendal Roué 1036dd4d6e v6.0.0-beta 2022-08-21 21:56:51 +02:00
Gwendal Roué 48f14c7a8c Merge pull request #1221 from groue/GRDB6/development
GRDB 6
2022-08-21 21:44:19 +02:00
Gwendal Roué 2789444acd Enable UPSERT and RETURNING with SQLCipher 2022-08-21 21:22:34 +02:00
Gwendal Roué 8f8b273424 CHANGELOG organization 2022-08-21 21:22:34 +02:00
Gwendal Roué 37f0a0bb9a BREAKING: throwing EncodableRecord.encode(to:) 2022-08-21 21:22:34 +02:00
Gwendal Roué d2dd18b3e5 Remove note and warning icons
Those are handled by Github now:
https://github.com/community/community/discussions/16925
2022-08-21 21:22:34 +02:00
Gwendal Roué 422e0ae85a BREAKING: Handles both commits and rollbacks
Replace afterNextTransactionCommit(_:) with afterNextTransaction(onCommit:onRollback:)
2022-08-21 21:22:34 +02:00