Commit Graph
86 Commits
Author SHA1 Message Date
Gwendal Roué 0dd17a9a16 Turn ValueObservationScheduler into a protocol 2022-12-29 12:38:06 +01:00
Gwendal Roué 10596e17bf Cleanup snapshot configurations 2022-11-23 19:42:12 +01:00
Gwendal Roué b1770e89b7 Introduce DatabaseSnapshotReader 2022-11-17 20:11:58 +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é b8bc8273a9 Turn snapshot tokens into a proper reader: DatabaseSnapshotPool 2022-11-14 18:22:13 +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é 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é 13c804d1cc DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué 1818534513 DocC 2022-11-06 16:02:36 +01: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é 38c0d68db7 WALSnapshot
SQLITE_ENABLE_SNAPSHOT is available from Xcode 14 :-)
2022-06-24 16:48:38 +02:00
Gwendal Roué 6ab3fea8fb Refactor ValueObservation 2022-03-17 18:44:30 +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é 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é 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
Gwendal Roué bf601e6810 Merge SelectStatement and UpdateStatement
Addresses #1015
2021-07-29 20:20:15 +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é 836efb120f Xcode 12.3 formatting 2020-12-23 12:13:05 +01:00
Gwendal Roué f84e25f929 Remove dependency on SQLITE_ENABLE_SNAPSHOT
Address #845 and #846
2020-10-06 08:30:41 +02:00
Gwendal Roué 7a2c1413fe Fix DatabaseSnapshot 2020-09-06 13:40:03 +02: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é 86b9616dd7 DatabasePool readers don't invalidate their database schema cache until schema is actually changed. 2020-07-25 18:20:43 +02:00
Gwendal Roué 07092169bf Documentation 2020-07-12 14:17:58 +02:00
Gwendal Roué 813950f832 Avoid SQLITE_BUSY when opening a DatabaseSnapshot. 2020-07-09 17:45:57 +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
Gwendal Roué 70714768d9 Always use snapshots apis through grdb_xxx shims 2020-06-14 15:38:16 +02:00
Gwendal Roué 9215f88e7f Documentation, cleanup, and checkpoint prevention 2020-06-14 10:47:27 +02:00
Gwendal Roué 27120643b9 SE-0255: Implicit returns from single-expression functions 2020-04-09 17:16:23 +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
Gwendal Roué 5a884ad93d Common ValueObservation code for all read-only database accessors 2020-03-21 14:36:48 +01:00
Gwendal Roué dfa40ea18f Rename ValueObservation.fetchFirst to fetchValue
"First", in Swift, hints that the result is optional. But the result of this function is no longer optional.
2020-03-12 07:34:43 +01:00
Gwendal Roué 936c92eba6 All value reducers must emit an initial value
This disqualifies compactMap as a valid ValueObservation transformation: it has been removed.

This simplifies implementation as well.
2020-03-12 07:18:40 +01:00
Gwendal Roué f80c5ce348 Make the ValueReducer protocol unavailable
# Conflicts:
#	GRDB/ValueObservation/ValueReducer/ValueReducer.swift
2020-03-11 21:38:20 +01:00
Gwendal Roué 6f239a5ad3 All ValueObservationScheduling cases now trigger an initial fetch 2020-03-10 19:42:58 +01:00
Gwendal Roué 9aa67f9db9 SE-0255: Implicit returns from single-expression functions 2020-03-08 23:12:46 +01:00
Gwendal Roué 9578f984ec Remove useless #if compiler/swift checks 2020-03-08 13:42:44 +01:00