Commit Graph
2194 Commits
Author SHA1 Message Date
Gwendal Roué db6da72bec Xcode 15.4 recommended settings, fix ENABLE_MODULE_VERIFIER errors 2024-07-27 16:37:33 +02:00
Gwendal Roué f4d9c97478 StrictConcurrency/tests: enable strict concurrency checks in other test projects 2024-07-27 16:37:33 +02:00
Gwendal Roué 0e18dae266 StrictConcurrency/tests: enable strict concurrency checks in SQLCipher tests 2024-07-27 16:37:33 +02:00
Gwendal Roué 7e2d096dca StrictConcurrency: enable strict concurrency checks in demo apps 2024-07-27 16:37:33 +02:00
Gwendal Roué c1de146a57 StrictConcurrency/tests: avoid warning about non-Sendable DispatchSpecificKey 🙄 2024-07-27 16:37:33 +02:00
Gwendal Roué a12211bc28 StrictConcurrency/tests: fix ValueObservationRecorder warnings 2024-07-27 16:37:33 +02:00
Gwendal Roué a45ba5a6e0 StrictConcurrency/tests: refactor busy handler tests 2024-07-27 16:37:33 +02:00
Gwendal Roué 3e57ce9e98 StrictConcurrency/tests: capture values instead of non-Sendable self 2024-07-27 16:37:33 +02:00
Gwendal Roué 2e10969634 StrictConcurrency/tests: introduce TestDatabaseBuilder that can connect from Sendable closures 2024-07-27 16:37:33 +02:00
Gwendal Roué bbb1a73672 StrictConcurrency/tests: use a single and Sendable test TextOutputStream 2024-07-27 16:37:33 +02:00
Gwendal Roué 2947b3d78b StrictConcurrency/tests: ValueObservationRecorder is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué c3dab1c2da StrictConcurrency: databaseDecodingUserInfo and databaseEncodingUserInfo must be declared as a computed property 2024-07-27 16:37:33 +02:00
Gwendal Roué 1544bd1158 StrictConcurrency: FetchableRecord.databaseDecodingUserInfo must be declared as a computed property 2024-07-27 16:37:33 +02:00
Gwendal Roué c4dfa3d2ab StrictConcurrency/tests: fix warning about mutable state 2024-07-27 16:37:33 +02:00
Gwendal Roué 09182b2ad7 StrictConcurrency/tests: fix warnings about concurrently-executed functions 2024-07-27 16:37:33 +02:00
Gwendal Roué 24d232aafd StrictConcurrency: TableRecord.databaseSelection must be declared as a computed property
An alternative would have been to make SQLSelectable conform to Sendable. But this makes it harder for users to provide SQLSelectable types.
2024-07-27 16:37:33 +02:00
Gwendal Roué 1291bd7dea StrictConcurrency/tests: fix warnings about mutable state 2024-07-27 16:37:33 +02:00
Gwendal Roué f175e3f384 StrictConcurrency/tests: Use a mutex for tracing allocations and deallocations 2024-07-27 16:37:33 +02:00
Gwendal Roué 45fd17028c StrictConcurrency/tests: DispatchQueue.concurrentPerform wants Sendable closures 2024-07-27 16:37:33 +02:00
Gwendal Roué e28558334f StrictConcurrency/tests: XCTestCase.waitForExpectations is main-actor isolated 2024-07-27 16:37:33 +02:00
Gwendal Roué 75f67949ea StrictConcurrency/tests: cleanup test SQL traces 2024-07-27 16:37:33 +02:00
Gwendal Roué 9e3e4158ff StrictConcurrency/tests: fix warning in CombineExpectations 2024-07-27 16:37:33 +02:00
Gwendal Roué 5f26a7ac01 Replace Mutex.value with load() and store(_:)
... and fix logic bugs on the way.

Inspired by https://forums.swift.org/t/se-0433-synchronous-mutual-exclusion-lock/71174/58

Fixed bugs follow this pattern: https://forums.swift.org/t/se-0433-synchronous-mutual-exclusion-lock/71174/77
2024-07-27 16:37:33 +02:00
Gwendal Roué 5d66407368 StrictConcurrency: fix warning about ISO8601DateFormatter 2024-07-27 16:37:33 +02:00
Gwendal Roué 8b49360af1 StrictConcurrency: ValueObservation change callback is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué 8d137a2d16 StrictConcurrency: ValueObservation requires Sendable fetching closures 2024-07-27 16:37:33 +02:00
Gwendal Roué 45539583a8 Mutex.wasNeeded convenience 2024-07-27 16:37:33 +02:00
Gwendal Roué 5465d056ab StrictConcurrency: refactor ValueReducer and extract its Sendable fetching facet 2024-07-27 16:37:33 +02:00
Gwendal Roué 7f5205ef8c Rename ReadWriteBox to ReadWriteLock
... and make it conditionally Sendable, and it is no longer a property wrapper.

It is conditionally Sendable because we can't use the techniques of the future standard Mutex (SE-0433 Synchronous Mutual Exclusion Lock, https://github.com/apple/swift-evolution/blob/main/proposals/0433-mutex.md).

It is no longer a property wrapper because the Swift compiler can perform strict concurrency checks through a `var` property.
2024-07-27 16:37:33 +02:00
Gwendal Roué 3995bfdbec StrictConcurrency: workaround warning about UIApplication.xxxNotification 2024-07-27 16:37:33 +02:00
Gwendal Roué 9b2466c2aa Fix a concurrency warning 2024-07-27 16:37:33 +02:00
Gwendal Roué 3b593d7649 ValueObservation.handleEvents accept Sendable closures 2024-07-27 16:37:33 +02:00
Gwendal Roué 7d7dc8ea72 SerializedDatabase async access requires a Sendable closure 2024-07-27 16:37:33 +02:00
Gwendal Roué f13b2d2eb4 Pool is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué f362518dd6 LogErrorFunction is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué 22114ad433 DatabaseMigrator is Sendable 2024-07-27 16:37:32 +02:00
Gwendal Roué 6e691fe71d DatabaseFunction is Sendable 2024-07-27 16:37:32 +02:00
Gwendal Roué 05f7d3c8d4 [BREAKING] Remove DatabaseFuture and concurrentRead
That's one less DispatchSemaphore. We don't need this method anymore.
2024-07-27 16:37:32 +02:00
Gwendal Roué 54ffb21fb8 Configuration is Sendable 2024-07-27 16:37:32 +02:00
Gwendal Roué f7dc72a5f3 TransactionClock is Sendable 2024-07-27 16:37:32 +02:00
Gwendal Roué e0d8e20bef BusyCallback and BusyMode are Sendable 2024-07-27 16:37:32 +02:00
Gwendal Roué 04d8c357b5 Tests need a Mutex too 2024-07-27 16:37:32 +02:00
Gwendal Roué 00ccab06bd Rename LockedBox to Mutex
Maybe we'll be able to plug in the standard one eventually: https://forums.swift.org/t/pitch-synchronous-mutual-exclusion-lock/69889
2024-07-27 16:37:32 +02:00
Gwendal Roué 2661ff4690 [BREAKING] Remove Configuration.defaultTransactionKind
GRDB know defaults read-only transactions to DEFERRED, and write transactions to IMMEDIATE. See https://github.com/groue/GRDB.swift/issues/1483 for some context.
2024-07-27 16:37:32 +02:00
Gwendal Roué 2297c8f432 [BREAKING] Bump requirements: watchOS 7
Rationale: https://github.com/groue/GRDB.swift/issues/1472#issuecomment-1960696836
2024-07-27 16:37:32 +02:00
Gwendal Roué 679d6463fd [BREAKING] Stop exporting SQLite 2024-07-27 16:37:32 +02:00
Gwendal Roué 83c0e6432b [BREAKING] Remove AsyncValueObservation does not need any scheduler 2024-07-27 16:37:32 +02:00
Gwendal Roué 32f41472b6 [BREAKING] insertAndFetch, saveAndFetch, and updateAndFetch no longer return optionals.
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.
2024-07-27 16:37:32 +02:00
Gwendal Roué 5ab166b9c3 [BREAKING] Bump requirements: Swift 5.10, Xcode 15.3, iOS 12, tvOS 12 2024-07-27 16:37:32 +02:00
Steven Roebert c977cb8226 Implemented support for single value decoding in _RowDecoder 2024-07-13 11:48:02 +02:00