Commit Graph
11068 Commits
Author SHA1 Message Date
Max Humber c39db96521 Minor changes to a tip in the README 2021-12-11 15:28:02 -05:00
Gwendal Roué d7514f84f1 Disable concurrency check flags by default 2021-12-10 12:40:08 +01:00
Gwendal Roué 1b62e06c4a Expose Sendable conformance to Swift 5.5
But async apis are still only exposed to Swift 5.5.2.

Sendable conformances are helpful for users of Xcode < 13.2.
2021-12-10 08:08:47 +01:00
Michael Allman bedf2dbcd4 Revise and correct some names and backup code documentation 2021-12-08 10:23:11 -08:00
Michael Allman 13e195db40 Revise incremental backup API to report progress via a throwing callback
function
2021-12-08 09:37:10 -08:00
Michael Allman 087ad10086 Add an API to track progress of and cancel backups in progress, for both
the DatabaseReader/DatabaseWriter API and Database API
2021-12-08 09:37:10 -08:00
Michael Allman f012c011b1 Import the Foundation framework in DatabaseReader.swift, which is required to get the Progress class 2021-12-08 09:37:10 -08:00
Michael Allman f829d46b7f Change default backup page step size from 5 to 100, which is the value used in the sqlite3 cli .backup command 2021-12-08 09:37:10 -08:00
Michael Allman ab6f18e46d Initial commit of code to implement progress-reporting database backups 2021-12-08 09:37:10 -08:00
Gwendal Roué 9579671c02 Remove a concurrency-related warning 2021-12-08 18:16:36 +01:00
Gwendal Roué 01f4c04c4d DatabaseReader is Sendable 2021-12-08 18:12:28 +01:00
Gwendal Roué 7ac78a8ec1 Share concurrency check flags with tests 2021-12-08 18:11:44 +01:00
Gwendal Roué 97e00ab44f Fix async test for SQLCipher VACUUM INTO 2021-12-08 13:18:12 +01:00
Gwendal Roué 33d9ca0e97 UIApplication notification names are isolated to @MainActor
I believe this is incorrect: FB9801372 (UIApplication.didReceiveMemoryWarningNotification should not be declared @MainActor)

Meanwhile, just use the string version.

A workaround based on a MainActor-isolated task can't work due to conflict between compiler version and minimum iOS target:

    #if compiler(>=5.5) && canImport(_Concurrency)
    if #available(...) { // Check for availability of concurrency runtime
        Task { @MainActor [weak self] in
            NotificationCenter.default.addObserver(..., name: UIApplication.didReceiveMemoryWarningNotification, object: nil)
        }
    } else {
        // IMPOSSIBLE CASE: No access to Task, no access to notification names
    }
    #else
    NotificationCenter.default.addObserver(..., name: UIApplication.didReceiveMemoryWarningNotification, object: nil)
    #endif
2021-12-08 12:48:19 +01:00
Gwendal Roué b2985b77c4 Concurrency check flags depend on Xcode version
Xcode 12 won't accept those flags. And we only need them starting Xcode 13.2
2021-12-08 12:00:32 +01:00
Gwendal Roué ec882e8126 Enable concurrency check flags by default 2021-12-08 11:18:54 +01:00
Gwendal Roué 61b0df8017 Enable async APIs on Xcode 13.2+ only
Xcode 13.1 won't have access to async apis. This simplifies our availability checks.

The techniques were inspired from:

- https://github.com/swift-server/guides/blob/main/docs/concurrency-adoption-guidelines.md#api-design
- https://github.com/swift-server/guides/blob/main/docs/concurrency-adoption-guidelines.md#backwards-compatibility-of-declarations-and-checked-swift-concurrency
2021-12-08 11:17:40 +01:00
Gwendal Roué 103266d70c Merge branch 'development' into dev/async 2021-12-08 08:00:49 +01:00
Gwendal Roué 3f02724e60 RowDecodingError is Sendable
Xcode 13.2 RC won't compile unless we make a Sendable copy of the row that could not be decoded.
2021-12-08 07:59:43 +01:00
Gwendal Roué ca05a93c98 Merge pull request #1107 from tcwalther/tw-fix-db-create-index-docstring
Fix docstring for Database.create(index: ...)
2021-12-07 13:32:26 +01:00
Thomas Walther 48f6cee7a6 Fix docstring for Database.create(index: ...) 2021-12-07 13:20:14 +01:00
Gwendal Roué 8ed16f4440 Fix some compiler warnings with -Xfrontend -warn-concurrency
https://twitter.com/olebegemann/status/1467893554915782668
2021-12-07 09:23:37 +01:00
Gwendal Roué 6ec3ebc398 Merge branch 'development' into dev/async 2021-12-06 18:04:35 +01:00
Gwendal Roué 86d0fedfbb Fix wording 2021-12-05 17:08:15 +01:00
Gwendal Roué 0330365d49 Merge branch 'development' v5.16.0 2021-12-05 16:59:59 +01:00
Gwendal Roué ca2f36781e v5.16.0 2021-12-05 16:59:37 +01:00
Gwendal Roué 6c7f71f620 Fix typo 2021-12-05 16:47:32 +01:00
Gwendal Roué 60bf5d30b0 Merge pull request #1106 from groue/dev/annotated-with-association
Sugar for fetching only a few columns of associated records
2021-12-05 16:41:49 +01:00
Gwendal Roué 94caf4ba97 todo: find a way to prefix the selection with the association key 2021-12-05 15:53:59 +01:00
Gwendal Roué a7002e1e09 Enhance "Columns Selected by an Association" 2021-12-05 15:22:07 +01:00
Gwendal Roué 54a991b3b9 Emphasize sections 2021-12-05 15:15:38 +01:00
Gwendal Roué 54ca12437a CHANGELOG 2021-12-05 15:10:25 +01:00
Gwendal Roué 3298cca75f Rewrite the Joining And Prefetching Associated Records chapter 2021-12-05 15:10:25 +01:00
Gwendal Roué 4fe0b687d2 Documentation for annotated(withOptional:), annotated(withRequired:) 2021-12-05 15:04:51 +01:00
Gwendal Roué 9df0f4cdbd Inline documentation for annotated(withOptional:), annotated(withRequired:) 2021-12-05 15:04:44 +01:00
Gwendal Roué e1dc24ac93 Update examples with Team/Player 2021-12-04 10:01:31 +01:00
Gwendal Roué 88e60ed0c6 Update FAQ: How do I select only one column of an associated record? 2021-12-04 09:50:16 +01:00
Gwendal Roué b4ca103002 Tests for annotated(withOptional:), annotated(withRequired:) 2021-12-04 09:49:23 +01:00
Gwendal Roué 564c4cef5c annotated(withOptional:), annotated(withRequired:) 2021-12-03 19:24:56 +01:00
Gwendal Roué 7a77a1fd06 Merge branch 'development' v5.15.0 2021-12-02 19:43:04 +01:00
Gwendal Roué c7291db360 v5.15.0 2021-12-02 18:48:36 +01:00
Gwendal Roué a52d1b1d21 Merge pull request #1102 from groue/dev/ValueObservation-explicit-region-tracking
Explicit tracked region for ValueObservation
2021-12-02 18:40:40 +01:00
Gwendal Roué 89b1783220 TrackingMode is a property of ValueObservation
No reducer changes the tracking mode, so let's simplify the code.
2021-12-02 17:22:18 +01:00
Gwendal Roué 76d2168988 Extend the general description of ValueObservation behavior
Link to the ability to track something which is not the fetched region.
2021-12-02 17:22:18 +01:00
Gwendal Roué e419bb55ca Enhance documentation of DatabaseRegion 2021-12-02 17:22:18 +01:00
Gwendal Roué 06eb45db65 Documentation for ValueObservation(region:fetch:) 2021-12-02 17:22:18 +01:00
Gwendal Roué 6180e4b815 Fix for Swift 5.3 2021-12-02 17:22:18 +01:00
Gwendal Roué 85747935c8 ValueObservation can track an explicit database region 2021-12-02 17:22:18 +01:00
Gwendal Roué 36fba9a79a TODO: deprecate DatabaseRegion(table:)
We have `Table` now, wich is DatabaseRegionConvertible.

This deprecation will revert https://github.com/groue/GRDB.swift/pull/510
2021-12-02 17:21:58 +01:00
Gwendal Roué 6240585a03 Make sure ValueObservation fetches in an isolated transaction
Previously, ValueObservation could fetch in a non-isolated way. When an external connection would commit changes, we could fetch inconsistent values. Here we make sure ValueObservation always fetch in an isolated way.
2021-12-02 09:46:02 +01:00