Gwendal Roué
10596e17bf
Cleanup snapshot configurations
2022-11-23 19:42:12 +01:00
Gwendal Roué
0ba3dff901
Rewrite availability check for WAL snapshots
...
Also, enable WAL snapshots with SQLCipher, if SQLITE_ENABLE_SNAPSHOT is set.
2022-11-18 13:33:28 +01:00
Gwendal Roué
9b663e3bcc
Pool can discard elements after use
2022-11-18 08:52:52 +01:00
Gwendal Roué
12d656d3a1
Let SQLite check if DatabaseSnapshotPool can be created
2022-11-17 20:01:17 +01:00
Gwendal Roué
0bc49460d7
DatabaseSnapshotPool uses its own pool of connections
...
In the previous implementation, the snapshot pool would use the same reader connections as the database pool. This would create problem with reentrant reads. Let's make things simple, and not share any database connection.
2022-11-17 18:36:17 +01:00
Gwendal Roué
c23b93d71b
Document that reentrant database accesses use the current database connection when possible
2022-11-14 18:38:33 +01:00
Gwendal Roué
b8bc8273a9
Turn snapshot tokens into a proper reader: DatabaseSnapshotPool
2022-11-14 18:22:13 +01:00
Gwendal Roué
eaf8dc239a
Simplify WALSnapshotToken creation
2022-11-14 10:39:48 +01:00
Gwendal Roué
a71eb3d662
Introduce WALSnapshotToken
2022-11-13 18:28:54 +01:00
Gwendal Roué
997d6cb677
DatabaseSnapshot does not require the WAL mode
...
One can create a snapshot from a read-only pool on a non-WAL database, and that's OK. The snaphost still sees an unchanging database content (but other connections can't write).
2022-11-13 10:54:40 +01:00
Gwendal Roué
85b2e113b2
Relocate DatabaseSnapshot documentation
2022-11-09 17:16:03 +01:00
Gwendal Roué
c5a0598cea
DocC: Concurrency Guides
2022-11-09 13:22:53 +01:00
Gwendal Roué
71880a9b8e
Enhance Documentation
2022-11-09 13:20:08 +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é
dd55175978
SE-0345: if let x { }
...
https://github.com/apple/swift-evolution/blob/main/proposals/0345-if-let-shorthand.md
2022-08-21 21:22:34 +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é
6da7d47394
Swift 5.7 required: Remove compiler checks
2022-08-21 19:21:57 +02:00
Gwendal Roué
c1e752132c
Document why DatabasePool.releaseMemory() needs a barrier
2022-07-09 14:28:09 +02:00
Gwendal Roué
07eaeee123
automaticMemoryManagement tests check for actual connection closing
2022-07-09 13:39:39 +02:00
Gwendal Roué
d72b7109ad
DatabasePool automatic memory management no longer uses any reader barrier
...
This fixes the failing `testDatabasePoolDoesNotPreventConcurrentReadsOnPressureEvent` test
2022-07-09 13:39:11 +02:00
Gwendal Roué
e1a63a4c05
Introduce DatabasePool.releaseMemoryEventually
2022-07-09 13:33:01 +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é
952ee0a137
Rename Pool.async to asyncGet
2022-05-25 17:25:43 +02:00
Gwendal Roué
ee92db9d6f
Pool has a QoS
2022-05-25 17:21:50 +02:00
Gwendal Roué
9ed309b470
Fix failing tests for number of threads created by DatabasePool
2022-05-24 19:31:22 +02:00
Gwendal Roué
209192d3a5
Require Swift 5.6 Compiler for Concurrency Support
2022-04-13 23:07:33 +02: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é
09f7d4d952
Complete #1161
2022-01-30 15:27:11 +01:00
Gwendal Roué
ed4471c5b9
Configuration.writeTargetQueue
2022-01-29 17:45:21 +01:00
Gwendal Roué
09922c34ff
Code formatting
2022-01-23 12:24:34 +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
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é
f74ce91a17
Merge branch 'development' into dev/async
...
# Conflicts:
# CHANGELOG.md
# Documentation/Concurrency.md
# README.md
2021-11-07 11:47:01 +01:00
Gwendal Roué
7af3858ff6
More robust DatabasePool.close() test
2021-11-07 08:17:48 +01:00
Gwendal Roué
7897c6a799
asyncUnsafeRead handle closed connection
2021-11-01 07:25:26 +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é
836efb120f
Xcode 12.3 formatting
2020-12-23 12:13:05 +01:00