186 Commits
Author SHA1 Message Date
Gwendal Roué 38bb8d3505 Backport temporary copies from GRDBSnapshotTesting 2023-10-28 18:38:15 +02:00
Gwendal Roué 7cbcbe12f0 Expose path on DatabaseReader 2023-08-31 09:42:13 +02:00
Gwendal Roué e79b4e25db Apply Configuration.journalMode 2023-08-25 09:10:33 +01:00
László Kustra 788887a2b8 Remove selector-based NotificationCenter calls on Linux 2023-06-29 16:23:36 +02:00
Gwendal Roué 7e6f71912c Enhance DatabaseQueue read-only transactions 2023-03-29 13:02:31 +02:00
baegteun 557ad3d3d3 OS X -> macOS in Remake or CHANGELOG.md 2023-01-14 11:43:27 +09:00
Gwendal Roué 0dd17a9a16 Turn ValueObservationScheduler into a protocol 2022-12-29 12:38:06 +01:00
Gwendal Roué 2c5a86479a DocC: Transactions and Savepoints 2022-12-17 10:11:36 +01:00
Gwendal Roué 392e9e447d Shared in-memory databases 2022-11-23 18:32:57 +01:00
Gwendal Roué 51230834c8 Configuration.maximumReaderCount can be queried
This is useful for tools that adapt their own inner scheduling to the actual capacity for concurrent reads.
2022-11-13 10:54:40 +01:00
Gwendal Roué 85b2e113b2 Relocate DatabaseSnapshot documentation 2022-11-09 17:16:03 +01:00
Gwendal Roué 71880a9b8e Enhance Documentation 2022-11-09 13:20:08 +01:00
Gwendal Roué 13c804d1cc DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué 1818534513 DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué 33a039717c Refer to UIApplication notifications by their names
It looks like FB9801372 was fixed
2022-08-21 21:22:34 +02:00
Gwendal Roué a9fcf1b9c1 SE-0335, SE-0341, SE-0346, SE-0352, SE-0358: some, any, primary associated types 2022-08-21 21:22:34 +02:00
Gwendal Roué 458e1e2675 BREAKING: throwing DatabaseQueue() initializer
As a consequence, FTS3.tokenize(_:) is a throwing method as well.
2022-08-21 21:22:33 +02:00
Gwendal Roué 6f0d45eedb BREAKING: throwing DatabaseWriter.barrierWriteWithoutTransaction
It used to be rethrowing, but it was then unable to deal with closed databases.

The async version is modified accordingly: it accepts a Result<Database, Error>, instead of a raw Database.

DatabaseMigrator.asyncMigrate is impacted as well: it accepts a Result<Database, Error>, instead of a (Database, Error?) tuple.
2022-08-21 19:21:57 +02:00
Gwendal Roué 0bfb4de02d Enhance DatabaseQueue automatic memory management
We have async methods, now: no need to use a global dispatch queue.
2022-07-09 13:39:11 +02:00
George Nachman bbe94a9607 Make memory management optional.
Memory management may not be desirable for all
users of GRDB. `DatabasePool.releaseMemory`
creates a barrier which may cause normally fast
readers to block for a long time. If this is not a
desirable tradeoff, the new
`automaticMemoryManagement` flag in
`Configuration` allows you to disable this feature
of GRDB.
2022-07-05 15:27:55 -07:00
Gwendal Roué 6ab3fea8fb Refactor ValueObservation 2022-03-17 18:44:30 +01:00
Gwendal Roué 287ceb8b07 Documentation & cleanup 2022-03-17 18:44:30 +01:00
Gwendal Roué 01f4c04c4d DatabaseReader is Sendable 2021-12-08 18:12:28 +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é 6ec3ebc398 Merge branch 'development' into dev/async 2021-12-06 18:04:35 +01:00
Gwendal Roué bb2ce74125 Add helper method Database.isolated(readOnly:) 2021-12-02 09:45:28 +01:00
Gwendal Roué 1a87faacfa Merge branch 'development' into dev/async 2021-10-31 18:32:03 +01:00
Gwendal Roué 20cb50f52d Public close() method 2021-10-31 18:12:13 +01:00
Gwendal Roué 1f73c20ae2 DatabaseWriter async methods
write, writeWithoutTransaction, barrierWriteWithoutTransaction, erase, vacuum, vacuum(into:)
2021-10-17 13:24:10 +02:00
Gwendal Roué a827188881 async DatabaseReader.unsafeRead 2021-10-17 13:23:34 +02:00
Gwendal Roué ba88a150c0 Improve inline doc of database access methods 2021-10-11 15:50:06 +02:00
Zev Eisenberg 8b060e6b09 Add angle brackets to URLs to make them clickable in Xcode's rendered documentation. 2021-07-20 20:53:58 -04:00
Gwendal Roué b13922b76e Database schema cache distinguishes the main from the temp schema
Addresses https://github.com/groue/GRDB.swift/pull/946#issuecomment-805756799
2021-03-27 14:50:25 +01:00
Gwendal Roué c9c652dddc DatabaseMigrator async migrations 2021-03-20 13:25:43 +01:00
Gwendal Roué aceaaf24d2 Paranoid: Wrap DatabaseQueue.read in a transaction
This guarantees snapshot isolation even in case of external connections
2021-02-20 12:59:27 +01:00
Gwendal Roué a681ccf2b9 Fix: DatabaseQueue.read is throws, not rethrows 2021-02-20 11:55:19 +01:00
Gwendal Roué 836efb120f Xcode 12.3 formatting 2020-12-23 12:13:05 +01:00
Gwendal Roué 3c38aa1996 Functions, Collations, and tokenizers are no longer available on DatabaseQueue, Pool, and Snapshot 2020-09-06 13:18:58 +02:00
Gwendal Roué 07092169bf Documentation 2020-07-12 14:17:58 +02:00
Gwendal Roué 5c4b282e27 Refactor ValueObservation events handling 2020-06-21 09:17:12 +02:00
Gwendal Roué dd76cdffec ValueObservation.handleEvents 2020-06-20 19:57:51 +02:00
Alexandre Colucci f97e0cc540 Fix inline documentation for the setupMemoryManagement() function. In GRDB 5.0.0 and later, the parameter 'application' has been removed. 2020-06-20 12:09:59 +02:00
Gwendal Roué 9ee3fd38b5 Remove mentions of unsupported iOS versions 2020-05-31 13:54:02 +02:00
Gwendal Roué d72000c6a3 Use scheduling paramater name for consistency with GRDBCombine and RxGRDB 2020-03-31 20:25:36 +02:00
Gwendal Roué 1bffc4f628 ValueObservation is cancellable 2020-03-29 16:06:24 +02:00
Gwendal Roué 5d196c449d Value Observation does no longer retain DatabaseWriter 2020-03-28 17:11:57 +01:00
Gwendal Roué 23d428290b Assume that error ends the observation, and have database pool always perform a concurrent initial fetch 2020-03-28 10:30:36 +01:00
Gwendal Roué 4309eaba64 Scheduling of fresh values is no longer an attribute of ValueObservation 2020-03-27 19:49:11 +01:00
Gwendal Roué 1c59278115 Prefer dbResult argument name for async read closures 2020-03-21 14:36:48 +01:00
Gwendal Roué 2824636650 Prepare for initiial concurrent fetch of ValueObservation in a DatabasePool 2020-03-21 14:36:48 +01:00