Commit Graph
51 Commits
Author SHA1 Message Date
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
Gwendal Roué 7c684d06c1 Simplify schema cache management
We don't need EmptyDatabaseSchemaCache. It does not help unsafe reads to work better if concurrent writes modify the schema anyway.
2020-03-01 15:51:37 +01:00
Gwendal Roué 6656f72782 Rename "lock prevention" to "suspension" 2019-12-12 08:47:49 +01:00
Gwendal Roué 16025356bf Adapt lock prevention to the journal mode 2019-12-02 20:27:39 +01:00
Gwendal Roué 0a83848cfc DatabaseReader.interrupt() 2019-11-30 15:35:11 +01:00
Gwendal Roué b06e4ad298 Make DatabaseSnapshot.reentrantRead actually reentrant 2019-10-10 13:49:39 +02:00
Gwendal Roué fc57a69672 Rename beginSnapshotTransaction to beginSnapshotTransaction 2019-10-10 13:43:10 +02:00
Gwendal Roué df6bb8761c Swiftlint + whitespace 2019-07-01 08:57:53 +02:00
Gwendal Roué 02e1793cc9 Move configuration requirement to DatabaseReader 2019-06-15 04:32:14 +02:00
Gwendal Roué bc7c3e5eb1 DatabaseReader.asyncRead 2019-06-13 08:45:49 +02:00
Gwendal Roué 44138c433f Refactor ValueObservation scheduling 2019-06-11 21:45:27 +02:00
Gwendal Roué da042eaae9 Clean up ValueObservation fetching system 2019-06-06 19:56:41 +02:00
Gwendal Roué 4935c6f258 Rename ValueScheduling.onQueue(_:startImmediately:) to .async(onQueue:startImmediately:) 2019-03-01 08:24:00 +01:00
Gwendal Roué db67d3840b Principle of least astonishment: rrename argument label rawSQL to sql 2019-02-17 13:28:41 +01:00
Gwendal Roué c546c578ce fetchCursor/All/One(_:rawSQL:arguments:adapter:) 2019-02-17 13:28:40 +01:00
Gwendal Roué f07eee3ca7 DispatchQueue creation cleanup 2018-12-01 16:22:05 +01:00
Gwendal Roué 87c4775421 ValueObservation creates a reducer when its starts 2018-11-25 14:26:04 +01:00
Gwendal Roué cbc3467e2d Database.beginSnapshotIsolation() 2018-11-18 16:49:51 +01:00
Gwendal Roué 65cc0bb2b3 Cache frequently used statements 2018-11-18 16:49:14 +01:00
Gwendal Roué b4b824c360 dbQueue.start(observation) -> observation.start(in: dbQueue) 2018-10-29 19:31:04 +01:00
Gwendal Roué e5f43e341b ValueScheduling.unsafe guarantees that initial value is notified on the dispatch queue which starts the observation 2018-10-29 18:23:38 +01:00
Gwendal Roué 72c5769e8b ValueScheduling.unsafe 2018-10-29 13:59:02 +01:00
Gwendal Roué 1985b9129a Fix SPM build 2018-10-29 13:09:56 +01:00
Gwendal Roué f582683f20 Move remove(transactionObserver:) to DatabaseReader 2018-10-29 12:26:12 +01:00
Gwendal Roué 489454b0d4 add(observation:observation) -> start(observation) 2018-10-29 07:19:36 +01:00
Gwendal Roué fc3aca792f Replace InitialDispatch with ValueScheduling 2018-10-28 11:28:31 +01:00
Gwendal Roué de227bdce1 Bake uniquing right into ValueObservation: introduce ValueReducer 2018-10-27 16:12:42 +02:00
Gwendal Roué ff4f6f3b12 Cleanup 2018-10-27 04:59:24 +02:00
Gwendal Roué 2341523c41 API cleanup 2018-10-26 08:50:59 +02:00
Gwendal Roué 0df4815086 Move ValueObservation support to DatabaseReader 2018-10-25 20:39:04 +02:00
Gwendal Roué 58a48b73ae concurrentRead documentation 2018-09-09 19:55:07 +02:00
Gwendal Roué 220ce379e1 Test conversion error messages 2018-08-09 14:00:33 +02:00
Gwendal Roué 342dcc5094 Confiiguration.label is used to name dispatch queues 2018-06-14 20:26:34 +02:00
Gwendal Roué 2e80db8aed Database dispatch queues now have labels 2018-06-14 13:36:42 +02:00
Gwendal Roué 1bf7f67008 Update inline documentation with singular table names 2018-05-01 20:32:18 +02:00
Gwendal Roué dbfbe30749 DatabaseSnapshot RAII 2018-02-24 17:15:53 +01:00