From 33927e7f4da3f64fb8b04c635d797e8bfb3709a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 23 Oct 2018 13:24:46 +0200 Subject: [PATCH 001/109] FetchResultsObserver --- GRDB.xcodeproj/project.pbxproj | 8 + GRDB/Core/DatabaseRegion.swift | 9 + GRDB/Core/FetchRequest.swift | 7 +- GRDB/Core/FetchResultsObserver.swift | 653 +++++++++++++++++++++++++++ GRDBCipher.xcodeproj/project.pbxproj | 6 + GRDBCustom.xcodeproj/project.pbxproj | 8 +- 6 files changed, 684 insertions(+), 7 deletions(-) create mode 100644 GRDB/Core/FetchResultsObserver.swift diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index 62c452314..679963197 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -116,6 +116,9 @@ 5634B10A1CF9B970005360B9 /* TransactionObserverSavepointsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */; }; 5636E9BC1D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; 5636E9BF1D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; + 563B06AB217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* FetchResultsObserver.swift */; }; + 563B06AC217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* FetchResultsObserver.swift */; }; + 563B06AD217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* FetchResultsObserver.swift */; }; 563EF415215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF416215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF417215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; @@ -889,6 +892,7 @@ 563363F81C960711000BE133 /* PerformanceRealmTests.realm */ = {isa = PBXFileReference; lastKnownFileType = file; path = PerformanceRealmTests.realm; sourceTree = ""; }; 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionObserverSavepointsTests.swift; sourceTree = ""; }; 5636E9BB1D22574100B9B05F /* FetchRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchRequest.swift; sourceTree = ""; }; + 563B06AA217EF0CC00B38F35 /* FetchResultsObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchResultsObserver.swift; sourceTree = ""; }; 563EF414215F87EB007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF42C2161180D007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF43E216131D1007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1705,6 +1709,7 @@ 560D923E1C672C3E00F4F92B /* DatabaseValueConvertible.swift */, 563363C31C942C37000BE133 /* DatabaseWriter.swift */, 5636E9BB1D22574100B9B05F /* FetchRequest.swift */, + 563B06AA217EF0CC00B38F35 /* FetchResultsObserver.swift */, 56A238761B9C75030082EB20 /* Row.swift */, 567404871CEF84C8003ED5CC /* RowAdapter.swift */, 56BB6EA81D3009B100A1CA52 /* SchedulingWatchdog.swift */, @@ -2372,6 +2377,7 @@ 56CEB5671EAA359A00BFAF62 /* SQLSelectable.swift in Sources */, 5653EB272094A14400F46237 /* QueryInterfaceRequest+Association.swift in Sources */, 565490B91D5AE236005622CB /* DatabasePool.swift in Sources */, + 563B06AD217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */, 5674A6EF1F307F0E0095F066 /* DatabaseValueConvertible+Encodable.swift in Sources */, 565490D81D5AE252005622CB /* DatabaseMigrator.swift in Sources */, 56CEB5601EAA359A00BFAF62 /* SQLOrdering.swift in Sources */, @@ -2562,6 +2568,7 @@ 5605F1661C672E4000235C62 /* NSNull.swift in Sources */, 569EF0E3200D2D8400A9FA45 /* DatabaseRegion.swift in Sources */, 56A238841B9C75030082EB20 /* DatabaseQueue.swift in Sources */, + 563B06AC217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */, 5698AC7B1DA37DCB0056AF8C /* VirtualTableModule.swift in Sources */, 56A238821B9C75030082EB20 /* DatabaseError.swift in Sources */, 56D1215D1ED34978001347D2 /* Fixits-0.109.0.swift in Sources */, @@ -2939,6 +2946,7 @@ 563EF44A2161F179007DAACD /* Inflections.swift in Sources */, 566B91091FA4C3970012D5B0 /* Database+Statements.swift in Sources */, 566B91231FA4CF810012D5B0 /* Database+Schema.swift in Sources */, + 563B06AB217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */, 56CEB5111EAA324B00BFAF62 /* FTS3+QueryInterfaceRequest.swift in Sources */, 5659F4901EA8D964004A4992 /* ReadWriteBox.swift in Sources */, 566A841A2041146100E50BFD /* DatabaseSnapshot.swift in Sources */, diff --git a/GRDB/Core/DatabaseRegion.swift b/GRDB/Core/DatabaseRegion.swift index 490450ebb..4c20b6f85 100644 --- a/GRDB/Core/DatabaseRegion.swift +++ b/GRDB/Core/DatabaseRegion.swift @@ -296,3 +296,12 @@ private struct TableRegion: Equatable { return TableRegion(columns: columnsUnion, rowIds: rowIdsUnion) } } + +// MARK: - DatabaseRegionConvertible + +public protocol DatabaseRegionConvertible { + /// Returns a database region. + /// + /// - parameter db: A database connection. + func databaseRegion(_ db: Database) throws -> DatabaseRegion +} diff --git a/GRDB/Core/FetchRequest.swift b/GRDB/Core/FetchRequest.swift index cf8995872..ede50ec8e 100644 --- a/GRDB/Core/FetchRequest.swift +++ b/GRDB/Core/FetchRequest.swift @@ -8,7 +8,7 @@ /// try request.fetchCursor(db) // Cursor of Player /// try request.fetchAll(db) // [Player] /// try request.fetchOne(db) // Player? -public protocol FetchRequest { +public protocol FetchRequest: DatabaseRegionConvertible { /// The type that tells how fetched database rows should be interpreted. associatedtype RowDecoder @@ -30,11 +30,6 @@ public protocol FetchRequest { /// /// - parameter db: A database connection. func fetchCount(_ db: Database) throws -> Int - - /// Returns the database region that the request looks into. - /// - /// - parameter db: A database connection. - func databaseRegion(_ db: Database) throws -> DatabaseRegion } extension FetchRequest { diff --git a/GRDB/Core/FetchResultsObserver.swift b/GRDB/Core/FetchResultsObserver.swift new file mode 100644 index 000000000..46c0157ca --- /dev/null +++ b/GRDB/Core/FetchResultsObserver.swift @@ -0,0 +1,653 @@ +// +// FetchResultsObserver.swift +// GRDB +// +// Created by Gwendal Roué on 23/10/2018. +// Copyright © 2018 Gwendal Roué. All rights reserved. +// + +/// FetchResultsInitialDispatch controls how FetchResultsObserver initial values +/// are dispatched. +public enum FetchResultsInitialDispatch { + /// Initial values are not fetched. + case none + + /// Initial values are immediately notified, on the current dispatch queue. + case immediateOnCurrentQueue + + /// Initial values are fetched and asynchronously notified. + case asynchronous +} + +/// FetchResultsObserver fetch fresh results each time a database region has +/// been modified. +/// +/// You do not create FetchResultsObserver directly. Instead, you use an +/// observation method from DatabaseQueue or DatabasePool: +/// +/// let observer = try dbQueue.observeAll( +/// from: Player.all(), +/// onChange: { players: [Player] in +/// print("players have changed: \(players)") +/// }) +public class FetchResultsObserver { + // Stored as TransactionObserver (the protocol) in order to erase the type + // of fetched values. + private var transactionObserver: TransactionObserver! + + /// Observe *region*: fetch fresh results each time the database has been + /// modified, and notify them through to the *onChange* closure. + /// + /// - parameters: + /// - region: The database region to observe. + /// - databaseWriter: The database to observe. + /// - fetch: A closure that fetches results. + /// - queue: The dispatch queue where change callbacks are called. + /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), + /// initial values are fetched right away, and the *onChange* callback + /// is called synchronously, on the current dispatch queue. + /// + /// When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// When `.none`, initial values are not fetched and not notified. + /// - onError: called when results could not be fetched. + /// - onChange: called with fetched results. + fileprivate init( + observing region: (Database) throws -> DatabaseRegion, + in databaseWriter: DatabaseWriter, + fetch: @escaping (Database) throws -> Result, + queue: DispatchQueue, + initialDispatch: FetchResultsInitialDispatch, + onError: ((Error) -> Void)?, + onChange: @escaping (Result) -> Void) throws + { + // Will be set if initialDispatch is .immediateOnCurrentQueue + var immediateValue: Result? + + // Enter database in order to start observation, and fetch initial + // value if needed. + // + // We use an unsafe reentrant method so that this initializer can be + // called from a database queue. + try databaseWriter.unsafeReentrantWrite { db in + // Start observing the database (take care of future transactions + // that change the observed region). + // + // Observation stops when transactionObserver is deallocated, + // which happens when self is deallocated. + transactionObserver = try _TransactionObserver( + databaseWriter: databaseWriter, + region: region(db), + fetch: fetch, + queue: queue, + onError: onError, + onChange: onChange) + db.add(transactionObserver: transactionObserver) + + switch initialDispatch { + case .none: + break + case .immediateOnCurrentQueue: + immediateValue = try fetch(db) + case .asynchronous: + let initialValue = try fetch(db) + // We're still on the database writer queue. Let's dispatch + // initial value now, before any future transaction has any + // opportunity to trigger a change notification. + queue.async { + onChange(initialValue) + } + } + } + + // Back on the caller queue: + if let immediateValue = immediateValue { + onChange(immediateValue) + } + } +} + +/// The database transaction observer, generic on the type of fetched values. +private class _TransactionObserver: TransactionObserver { + private let databaseWriter: DatabaseWriter + private let region: DatabaseRegion + private let fetch: (Database) throws -> T + private let queue: DispatchQueue + private let onChange: (T) -> Void + private let onError: ((Error) -> Void)? + private let notificationQueue = DispatchQueue(label: "FetchResultsObserver") + private var changed = false + + init( + databaseWriter: DatabaseWriter, + region: DatabaseRegion, + fetch: @escaping (Database) throws -> T, + queue: DispatchQueue, + onError: ((Error) -> Void)?, + onChange: @escaping (T) -> Void) + { + self.databaseWriter = databaseWriter + self.region = region + self.fetch = fetch + self.queue = queue + self.onChange = onChange + self.onError = onError + } + + func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { + return region.isModified(byEventsOfKind: eventKind) + } + + func databaseDidChange(with event: DatabaseEvent) { + if region.isModified(by: event) { + changed = true + stopObservingDatabaseChangesUntilNextTransaction() + } + } + + func databaseDidCommit(_ db: Database) { + guard changed else { + return + } + + changed = false + + // Don't block the database writer queue. Instead, wait until the fetch + // can be executed concurrently. + let future = databaseWriter.concurrentRead { try self.fetch($0) } + + // notificationQueue guarantees that notifications have the same + // ordering as transactions. + notificationQueue.async { [weak self] in + guard let strongSelf = self else { return } + + do { + // block notificationQueue until the concurrent fetch is done + let result = try future.wait() + strongSelf.queue.async { + guard let strongSelf = self else { return } + strongSelf.onChange(result) + } + } catch { + strongSelf.queue.async { + guard let strongSelf = self else { return } + strongSelf.onError?(error) + } + } + } + } + + func databaseDidRollback(_ db: Database) { + changed = false + } +} + +// MARK: - DatabaseRegionConvertible Observation + +extension DatabaseWriter { + /// Observe *regions*: fetch fresh results each time the database has been + /// modified, and notify them through to the *onChange* closure. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let observer = try dbQueue.observe( + /// region: Player.all(), + /// andFetch: { db in return try Player.fetchAll(db) }, + /// onChange: { players: [Player] in + /// print("players have changed: \(players)") + /// }) + /// + /// - parameters: + /// - regions: one or more requests. + /// - fetch: block to execute to fetch the data + /// - queue: The dispatch queue where change callbacks are called. + /// Default is the main queue. + /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), + /// initial values are fetched right away, and the *onChange* callback + /// is called synchronously, on the current dispatch queue. + /// + /// When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// When `.none`, initial values are not fetched and not notified. + /// - onError: called when results could not be fetched. + /// - onChange: called with fetched results. + /// - returns: A new `FetchResultsObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observe( + region regions: DatabaseRegionConvertible..., + andFetch fetch: @escaping (Database) throws -> Result, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Result) -> Void) + throws -> FetchResultsObserver + { + func region(_ db: Database) throws -> DatabaseRegion { + return try regions.reduce(into: DatabaseRegion()) { union, region in + try union.formUnion(region.databaseRegion(db)) + } + } + + return try FetchResultsObserver( + observing: region, + in: self, + fetch: fetch, + queue: queue, + initialDispatch: initialDispatch, + onError: onError, + onChange: onChange) + } +} + +// MARK: - FetchRequest Observation + +extension DatabaseWriter { + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let observer = try dbQueue.observeCount( + /// from: Player.all(), + /// onChange: { count: Int in + /// print("Number of players have changed: \(count)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - queue: The dispatch queue where change callbacks are called. + /// Default is the main queue. + /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), + /// initial values are fetched right away, and the *onChange* callback + /// is called synchronously, on the current dispatch queue. + /// + /// When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// When `.none`, initial values are not fetched and not notified. + /// - onError: called when results could not be fetched. + /// - onChange: called with fetched results. + /// - returns: A new `FetchResultsObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeCount( + from request: Request, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Int) -> Void) + throws -> FetchResultsObserver + where Request: FetchRequest + { + return try FetchResultsObserver( + observing: { try request.databaseRegion($0) }, + in: self, + fetch: { try request.fetchCount($0) }, + queue: queue, + initialDispatch: initialDispatch, + onError: onError, + onChange: onChange) + } +} + +// MARK: - Row Observation + +extension DatabaseWriter { + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let observer = try dbQueue.observeAll( + /// from: SQLRequest("SELECT * FROM player"), + /// onChange: { rows: [Row] in + /// print("players have changed: \(rows)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - queue: The dispatch queue where change callbacks are called. + /// Default is the main queue. + /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), + /// initial values are fetched right away, and the *onChange* callback + /// is called synchronously, on the current dispatch queue. + /// + /// When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// When `.none`, initial values are not fetched and not notified. + /// - onError: called when results could not be fetched. + /// - onChange: called with fetched results. + /// - returns: A new `FetchResultsObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeAll( + from request: Request, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping ([Row]) -> Void) + throws -> FetchResultsObserver + where Request: FetchRequest, Request.RowDecoder == Row + { + return try FetchResultsObserver( + observing: { try request.databaseRegion($0) }, + in: self, + fetch: { try request.fetchAll($0) }, + queue: queue, + initialDispatch: initialDispatch, + onError: onError, + onChange: onChange) + } + + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let observer = try dbQueue.observeOne( + /// from: SQLRequest("SELECT * FROM player WHERE id = 1"), + /// onChange: { row: Row? in + /// print("player has changed: \(row)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - queue: The dispatch queue where change callbacks are called. + /// Default is the main queue. + /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), + /// initial values are fetched right away, and the *onChange* callback + /// is called synchronously, on the current dispatch queue. + /// + /// When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// When `.none`, initial values are not fetched and not notified. + /// - onError: called when results could not be fetched. + /// - onChange: called with fetched results. + /// - returns: A new `FetchResultsObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeOne( + from request: Request, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Row?) -> Void) + throws -> FetchResultsObserver + where Request: FetchRequest, Request.RowDecoder == Row + { + return try FetchResultsObserver( + observing: { try request.databaseRegion($0) }, + in: self, + fetch: { try request.fetchOne($0) }, + queue: queue, + initialDispatch: initialDispatch, + onError: onError, + onChange: onChange) + } +} + +// MARK: - FetchableRecord Observation + +extension DatabaseWriter { + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let observer = try dbQueue.observeAll( + /// from: Player.all(), + /// onChange: { players: [Player] in + /// print("players have changed: \(players)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - queue: The dispatch queue where change callbacks are called. + /// Default is the main queue. + /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), + /// initial values are fetched right away, and the *onChange* callback + /// is called synchronously, on the current dispatch queue. + /// + /// When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// When `.none`, initial values are not fetched and not notified. + /// - onError: called when results could not be fetched. + /// - onChange: called with fetched results. + /// - returns: A new `FetchResultsObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeAll( + from request: Request, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping ([Request.RowDecoder]) -> Void) + throws -> FetchResultsObserver + where Request: FetchRequest, Request.RowDecoder: FetchableRecord + { + return try FetchResultsObserver( + observing: { try request.databaseRegion($0) }, + in: self, + fetch: { try request.fetchAll($0) }, + queue: queue, + initialDispatch: initialDispatch, + onError: onError, + onChange: onChange) + } + + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let observer = try dbQueue.observeOne( + /// from: Player.filter(key: 1), + /// onChange: { player: Player? in + /// print("player has changed: \(player)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - queue: The dispatch queue where change callbacks are called. + /// Default is the main queue. + /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), + /// initial values are fetched right away, and the *onChange* callback + /// is called synchronously, on the current dispatch queue. + /// + /// When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// When `.none`, initial values are not fetched and not notified. + /// - onError: called when results could not be fetched. + /// - onChange: called with fetched results. + /// - returns: A new `FetchResultsObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeOne( + from request: Request, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Request.RowDecoder?) -> Void) + throws -> FetchResultsObserver + where Request: FetchRequest, Request.RowDecoder: FetchableRecord + { + return try FetchResultsObserver( + observing: { try request.databaseRegion($0) }, + in: self, + fetch: { try request.fetchOne($0) }, + queue: queue, + initialDispatch: initialDispatch, + onError: onError, + onChange: onChange) + } +} + +// MARK: - DatabaseValueConvertible Observation + +extension DatabaseWriter { + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let request = Player.select(Column("name"), as: String.self) + /// let observer = try dbQueue.observeAll( + /// from: request, + /// onChange: { names: [String] in + /// print("player names have changed: \(names)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - queue: The dispatch queue where change callbacks are called. + /// Default is the main queue. + /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), + /// initial values are fetched right away, and the *onChange* callback + /// is called synchronously, on the current dispatch queue. + /// + /// When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// When `.none`, initial values are not fetched and not notified. + /// - onError: called when results could not be fetched. + /// - onChange: called with fetched results. + /// - returns: A new `FetchResultsObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeAll( + from request: Request, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping ([Request.RowDecoder]) -> Void) + throws -> FetchResultsObserver + where Request: FetchRequest, Request.RowDecoder: DatabaseValueConvertible + { + return try FetchResultsObserver( + observing: { try request.databaseRegion($0) }, + in: self, + fetch: { try request.fetchAll($0) }, + queue: queue, + initialDispatch: initialDispatch, + onError: onError, + onChange: onChange) + } + + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let request = Player + /// .filter(key: 1) + /// .select(Column("name"), as: String.self) + /// let observer = try dbQueue.observeOne( + /// from: request, + /// onChange: { name: String? in + /// print("player's name has changed: \(name)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - queue: The dispatch queue where change callbacks are called. + /// Default is the main queue. + /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), + /// initial values are fetched right away, and the *onChange* callback + /// is called synchronously, on the current dispatch queue. + /// + /// When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// When `.none`, initial values are not fetched and not notified. + /// - onError: called when results could not be fetched. + /// - onChange: called with fetched results. + /// - returns: A new `FetchResultsObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeOne( + from request: Request, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Request.RowDecoder?) -> Void) + throws -> FetchResultsObserver + where Request: FetchRequest, Request.RowDecoder: DatabaseValueConvertible + { + return try FetchResultsObserver( + observing: { try request.databaseRegion($0) }, + in: self, + fetch: { try request.fetchOne($0) }, + queue: queue, + initialDispatch: initialDispatch, + onError: onError, + onChange: onChange) + } +} + +// MARK: - Optional DatabaseValueConvertible Observation + +extension DatabaseWriter { + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let request = Player.select(Column("email"), as: Optional.self) + /// let observer = try dbQueue.observeAll( + /// from: request, + /// onChange: { emails: [String?] in + /// print("player emails have changed: \(names)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - queue: The dispatch queue where change callbacks are called. + /// Default is the main queue. + /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), + /// initial values are fetched right away, and the *onChange* callback + /// is called synchronously, on the current dispatch queue. + /// + /// When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// When `.none`, initial values are not fetched and not notified. + /// - onError: called when results could not be fetched. + /// - onChange: called with fetched results. + /// - returns: A new `FetchResultsObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeAll( + from request: Request, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping ([Request.RowDecoder._Wrapped?]) -> Void) + throws -> FetchResultsObserver + where Request: FetchRequest, Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible + { + return try FetchResultsObserver( + observing: { try request.databaseRegion($0) }, + in: self, + fetch: { try request.fetchAll($0) }, + queue: queue, + initialDispatch: initialDispatch, + onError: onError, + onChange: onChange) + } +} diff --git a/GRDBCipher.xcodeproj/project.pbxproj b/GRDBCipher.xcodeproj/project.pbxproj index c7f768fe5..29ac9bf88 100755 --- a/GRDBCipher.xcodeproj/project.pbxproj +++ b/GRDBCipher.xcodeproj/project.pbxproj @@ -180,6 +180,8 @@ 5634B10C1CF9B970005360B9 /* TransactionObserverSavepointsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */; }; 5636E9BD1D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; 5636E9C01D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; + 563B06B6217F3C5A00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B4217F3C5900B38F35 /* FetchResultsObserver.swift */; }; + 563B06B7217F3C5A00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B4217F3C5900B38F35 /* FetchResultsObserver.swift */; }; 563EF424215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF425215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF43C2161183E007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF43A2161183E007DAACD /* AssociationAggregate.swift */; }; @@ -988,6 +990,7 @@ 563363D41C94484E000BE133 /* DatabaseQueueReleaseMemoryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseQueueReleaseMemoryTests.swift; sourceTree = ""; }; 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionObserverSavepointsTests.swift; sourceTree = ""; }; 5636E9BB1D22574100B9B05F /* FetchRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchRequest.swift; sourceTree = ""; }; + 563B06B4217F3C5900B38F35 /* FetchResultsObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchResultsObserver.swift; sourceTree = ""; }; 563EF422215F8A88007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF43A2161183E007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF44421613212007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1759,6 +1762,7 @@ 560D923E1C672C3E00F4F92B /* DatabaseValueConvertible.swift */, 563363C31C942C37000BE133 /* DatabaseWriter.swift */, 5636E9BB1D22574100B9B05F /* FetchRequest.swift */, + 563B06B4217F3C5900B38F35 /* FetchResultsObserver.swift */, 56A238761B9C75030082EB20 /* Row.swift */, 567404871CEF84C8003ED5CC /* RowAdapter.swift */, 56BB6EA81D3009B100A1CA52 /* SchedulingWatchdog.swift */, @@ -2244,6 +2248,7 @@ 5644DE7C20F8C903001FFDDE /* DatabaseValueConversion.swift in Sources */, 560FC5321CB003810014AA8E /* DatabasePool.swift in Sources */, 560FC5331CB003810014AA8E /* Migration.swift in Sources */, + 563B06B6217F3C5A00B38F35 /* FetchResultsObserver.swift in Sources */, 560FC5341CB003810014AA8E /* QueryInterfaceQuery.swift in Sources */, 566B912C1FA4D0CC0012D5B0 /* StatementAuthorizer.swift in Sources */, 560FC5351CB003810014AA8E /* Statement.swift in Sources */, @@ -2693,6 +2698,7 @@ 5644DE7D20F8C903001FFDDE /* DatabaseValueConversion.swift in Sources */, 56AFCA071CB1A8BB00F48B96 /* DatabasePool.swift in Sources */, 56AFCA081CB1A8BB00F48B96 /* Statement.swift in Sources */, + 563B06B7217F3C5A00B38F35 /* FetchResultsObserver.swift in Sources */, 56AFCA091CB1A8BB00F48B96 /* QueryInterfaceQuery.swift in Sources */, 566B912F1FA4D0CC0012D5B0 /* StatementAuthorizer.swift in Sources */, 56AFCA0A1CB1A8BB00F48B96 /* Migration.swift in Sources */, diff --git a/GRDBCustom.xcodeproj/project.pbxproj b/GRDBCustom.xcodeproj/project.pbxproj index 40f51815e..4fcd90a72 100755 --- a/GRDBCustom.xcodeproj/project.pbxproj +++ b/GRDBCustom.xcodeproj/project.pbxproj @@ -43,6 +43,8 @@ 562EA8361F17B9EB00FA528C /* CompilationSubClassTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 562EA82E1F17B9EB00FA528C /* CompilationSubClassTests.swift */; }; 5636E9BE1D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; 5636E9C11D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; + 563B06BA217F3C6E00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B8217F3C6E00B38F35 /* FetchResultsObserver.swift */; }; + 563B06BB217F3C6E00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B8217F3C6E00B38F35 /* FetchResultsObserver.swift */; }; 563EF420215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF421215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF4382161182C007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF4362161182C007DAACD /* AssociationAggregate.swift */; }; @@ -649,6 +651,7 @@ 563363D41C94484E000BE133 /* DatabaseQueueReleaseMemoryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseQueueReleaseMemoryTests.swift; sourceTree = ""; }; 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionObserverSavepointsTests.swift; sourceTree = ""; }; 5636E9BB1D22574100B9B05F /* FetchRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchRequest.swift; sourceTree = ""; }; + 563B06B8217F3C6E00B38F35 /* FetchResultsObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchResultsObserver.swift; sourceTree = ""; }; 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF4362161182C007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF441216131F5007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1393,6 +1396,7 @@ 560D923E1C672C3E00F4F92B /* DatabaseValueConvertible.swift */, 563363C31C942C37000BE133 /* DatabaseWriter.swift */, 5636E9BB1D22574100B9B05F /* FetchRequest.swift */, + 563B06B8217F3C6E00B38F35 /* FetchResultsObserver.swift */, 56A238761B9C75030082EB20 /* Row.swift */, 567404871CEF84C8003ED5CC /* RowAdapter.swift */, 56BB6EA81D3009B100A1CA52 /* SchedulingWatchdog.swift */, @@ -1400,8 +1404,8 @@ 56A238781B9C75030082EB20 /* Statement.swift */, 566B912A1FA4D0CC0012D5B0 /* StatementAuthorizer.swift */, 560D923F1C672C3E00F4F92B /* StatementColumnConvertible.swift */, - 566B91321FA4D3810012D5B0 /* TransactionObserver.swift */, 5605F1471C672E4000235C62 /* Support */, + 566B91321FA4D3810012D5B0 /* TransactionObserver.swift */, ); path = Core; sourceTree = ""; @@ -1907,6 +1911,7 @@ 5644DE7920F8C8EA001FFDDE /* DatabaseValueConversion.swift in Sources */, 56DAA2E01DE9C827006E10C8 /* Cursor.swift in Sources */, F3BA800C1CFB286F003DC1BA /* DatabaseError.swift in Sources */, + 563B06BB217F3C6E00B38F35 /* FetchResultsObserver.swift in Sources */, 566B91301FA4D0CC0012D5B0 /* StatementAuthorizer.swift in Sources */, F3BA80221CFB288C003DC1BA /* NSNumber.swift in Sources */, 5653EB4620961F6100F46237 /* AssociationQuery.swift in Sources */, @@ -2189,6 +2194,7 @@ 5644DE7820F8C8EA001FFDDE /* DatabaseValueConversion.swift in Sources */, 56DAA2DD1DE9C827006E10C8 /* Cursor.swift in Sources */, F3BA80681CFB2E55003DC1BA /* DatabaseError.swift in Sources */, + 563B06BA217F3C6E00B38F35 /* FetchResultsObserver.swift in Sources */, 566B912D1FA4D0CC0012D5B0 /* StatementAuthorizer.swift in Sources */, F3BA807E1CFB2E61003DC1BA /* NSNumber.swift in Sources */, 5653EB4520961F6100F46237 /* AssociationQuery.swift in Sources */, From ce95ff7278e70140202078830e05d0d4ae60aef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 24 Oct 2018 19:17:11 +0200 Subject: [PATCH 002/109] Move towards observation from reader --- GRDB.xcodeproj/project.pbxproj | 16 +- GRDB/Core/DatabaseRegion.swift | 7 + ...swift => DatabaseWriter+Observation.swift} | 299 +++++++++--------- 3 files changed, 160 insertions(+), 162 deletions(-) rename GRDB/Core/{FetchResultsObserver.swift => DatabaseWriter+Observation.swift} (82%) diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index 679963197..5f58a5495 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -116,9 +116,9 @@ 5634B10A1CF9B970005360B9 /* TransactionObserverSavepointsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */; }; 5636E9BC1D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; 5636E9BF1D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; - 563B06AB217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* FetchResultsObserver.swift */; }; - 563B06AC217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* FetchResultsObserver.swift */; }; - 563B06AD217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* FetchResultsObserver.swift */; }; + 563B06AB217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* DatabaseWriter+Observation.swift */; }; + 563B06AC217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* DatabaseWriter+Observation.swift */; }; + 563B06AD217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* DatabaseWriter+Observation.swift */; }; 563EF415215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF416215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF417215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; @@ -892,7 +892,7 @@ 563363F81C960711000BE133 /* PerformanceRealmTests.realm */ = {isa = PBXFileReference; lastKnownFileType = file; path = PerformanceRealmTests.realm; sourceTree = ""; }; 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionObserverSavepointsTests.swift; sourceTree = ""; }; 5636E9BB1D22574100B9B05F /* FetchRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchRequest.swift; sourceTree = ""; }; - 563B06AA217EF0CC00B38F35 /* FetchResultsObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchResultsObserver.swift; sourceTree = ""; }; + 563B06AA217EF0CC00B38F35 /* DatabaseWriter+Observation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DatabaseWriter+Observation.swift"; sourceTree = ""; }; 563EF414215F87EB007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF42C2161180D007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF43E216131D1007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1708,8 +1708,8 @@ 5644DE6C20F8C32E001FFDDE /* DatabaseValueConversion.swift */, 560D923E1C672C3E00F4F92B /* DatabaseValueConvertible.swift */, 563363C31C942C37000BE133 /* DatabaseWriter.swift */, + 563B06AA217EF0CC00B38F35 /* DatabaseWriter+Observation.swift */, 5636E9BB1D22574100B9B05F /* FetchRequest.swift */, - 563B06AA217EF0CC00B38F35 /* FetchResultsObserver.swift */, 56A238761B9C75030082EB20 /* Row.swift */, 567404871CEF84C8003ED5CC /* RowAdapter.swift */, 56BB6EA81D3009B100A1CA52 /* SchedulingWatchdog.swift */, @@ -2377,7 +2377,7 @@ 56CEB5671EAA359A00BFAF62 /* SQLSelectable.swift in Sources */, 5653EB272094A14400F46237 /* QueryInterfaceRequest+Association.swift in Sources */, 565490B91D5AE236005622CB /* DatabasePool.swift in Sources */, - 563B06AD217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */, + 563B06AD217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */, 5674A6EF1F307F0E0095F066 /* DatabaseValueConvertible+Encodable.swift in Sources */, 565490D81D5AE252005622CB /* DatabaseMigrator.swift in Sources */, 56CEB5601EAA359A00BFAF62 /* SQLOrdering.swift in Sources */, @@ -2568,7 +2568,7 @@ 5605F1661C672E4000235C62 /* NSNull.swift in Sources */, 569EF0E3200D2D8400A9FA45 /* DatabaseRegion.swift in Sources */, 56A238841B9C75030082EB20 /* DatabaseQueue.swift in Sources */, - 563B06AC217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */, + 563B06AC217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */, 5698AC7B1DA37DCB0056AF8C /* VirtualTableModule.swift in Sources */, 56A238821B9C75030082EB20 /* DatabaseError.swift in Sources */, 56D1215D1ED34978001347D2 /* Fixits-0.109.0.swift in Sources */, @@ -2946,7 +2946,7 @@ 563EF44A2161F179007DAACD /* Inflections.swift in Sources */, 566B91091FA4C3970012D5B0 /* Database+Statements.swift in Sources */, 566B91231FA4CF810012D5B0 /* Database+Schema.swift in Sources */, - 563B06AB217EF0CC00B38F35 /* FetchResultsObserver.swift in Sources */, + 563B06AB217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */, 56CEB5111EAA324B00BFAF62 /* FTS3+QueryInterfaceRequest.swift in Sources */, 5659F4901EA8D964004A4992 /* ReadWriteBox.swift in Sources */, 566A841A2041146100E50BFD /* DatabaseSnapshot.swift in Sources */, diff --git a/GRDB/Core/DatabaseRegion.swift b/GRDB/Core/DatabaseRegion.swift index 4c20b6f85..f15f01ce9 100644 --- a/GRDB/Core/DatabaseRegion.swift +++ b/GRDB/Core/DatabaseRegion.swift @@ -305,3 +305,10 @@ public protocol DatabaseRegionConvertible { /// - parameter db: A database connection. func databaseRegion(_ db: Database) throws -> DatabaseRegion } + +extension DatabaseRegion: DatabaseRegionConvertible { + /// :nodoc: + public func databaseRegion(_ db: Database) throws -> DatabaseRegion { + return self + } +} diff --git a/GRDB/Core/FetchResultsObserver.swift b/GRDB/Core/DatabaseWriter+Observation.swift similarity index 82% rename from GRDB/Core/FetchResultsObserver.swift rename to GRDB/Core/DatabaseWriter+Observation.swift index 46c0157ca..d0c14c00b 100644 --- a/GRDB/Core/FetchResultsObserver.swift +++ b/GRDB/Core/DatabaseWriter+Observation.swift @@ -1,135 +1,43 @@ // -// FetchResultsObserver.swift +// DatabaseWriter+Observation.swift // GRDB // // Created by Gwendal Roué on 23/10/2018. // Copyright © 2018 Gwendal Roué. All rights reserved. // -/// FetchResultsInitialDispatch controls how FetchResultsObserver initial values -/// are dispatched. -public enum FetchResultsInitialDispatch { - /// Initial values are not fetched. +/// InitialDispatch controls how initial values are dispatched when one starts +/// observing database values. +public enum InitialDispatch { + /// Initial values are not fetched, and not notified. case none - /// Initial values are immediately notified, on the current dispatch queue. + /// Initial values are immediately fetched, and notified on the current dispatch queue. case immediateOnCurrentQueue - /// Initial values are fetched and asynchronously notified. + /// Initial values are immediately fetched, and asynchronously notified. case asynchronous } -/// FetchResultsObserver fetch fresh results each time a database region has -/// been modified. -/// -/// You do not create FetchResultsObserver directly. Instead, you use an -/// observation method from DatabaseQueue or DatabasePool: -/// -/// let observer = try dbQueue.observeAll( -/// from: Player.all(), -/// onChange: { players: [Player] in -/// print("players have changed: \(players)") -/// }) -public class FetchResultsObserver { - // Stored as TransactionObserver (the protocol) in order to erase the type - // of fetched values. - private var transactionObserver: TransactionObserver! - - /// Observe *region*: fetch fresh results each time the database has been - /// modified, and notify them through to the *onChange* closure. - /// - /// - parameters: - /// - region: The database region to observe. - /// - databaseWriter: The database to observe. - /// - fetch: A closure that fetches results. - /// - queue: The dispatch queue where change callbacks are called. - /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), - /// initial values are fetched right away, and the *onChange* callback - /// is called synchronously, on the current dispatch queue. - /// - /// When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. - /// - /// When `.none`, initial values are not fetched and not notified. - /// - onError: called when results could not be fetched. - /// - onChange: called with fetched results. - fileprivate init( - observing region: (Database) throws -> DatabaseRegion, - in databaseWriter: DatabaseWriter, - fetch: @escaping (Database) throws -> Result, - queue: DispatchQueue, - initialDispatch: FetchResultsInitialDispatch, - onError: ((Error) -> Void)?, - onChange: @escaping (Result) -> Void) throws - { - // Will be set if initialDispatch is .immediateOnCurrentQueue - var immediateValue: Result? - - // Enter database in order to start observation, and fetch initial - // value if needed. - // - // We use an unsafe reentrant method so that this initializer can be - // called from a database queue. - try databaseWriter.unsafeReentrantWrite { db in - // Start observing the database (take care of future transactions - // that change the observed region). - // - // Observation stops when transactionObserver is deallocated, - // which happens when self is deallocated. - transactionObserver = try _TransactionObserver( - databaseWriter: databaseWriter, - region: region(db), - fetch: fetch, - queue: queue, - onError: onError, - onChange: onChange) - db.add(transactionObserver: transactionObserver) - - switch initialDispatch { - case .none: - break - case .immediateOnCurrentQueue: - immediateValue = try fetch(db) - case .asynchronous: - let initialValue = try fetch(db) - // We're still on the database writer queue. Let's dispatch - // initial value now, before any future transaction has any - // opportunity to trigger a change notification. - queue.async { - onChange(initialValue) - } - } - } - - // Back on the caller queue: - if let immediateValue = immediateValue { - onChange(immediateValue) - } - } -} - /// The database transaction observer, generic on the type of fetched values. -private class _TransactionObserver: TransactionObserver { - private let databaseWriter: DatabaseWriter +private class ValuesObserver: TransactionObserver { private let region: DatabaseRegion - private let fetch: (Database) throws -> T + private let future: () -> Future private let queue: DispatchQueue private let onChange: (T) -> Void private let onError: ((Error) -> Void)? - private let notificationQueue = DispatchQueue(label: "FetchResultsObserver") + private let notificationQueue = DispatchQueue(label: "ValuesObserver") private var changed = false init( - databaseWriter: DatabaseWriter, region: DatabaseRegion, - fetch: @escaping (Database) throws -> T, + future: @escaping () -> Future, queue: DispatchQueue, onError: ((Error) -> Void)?, onChange: @escaping (T) -> Void) { - self.databaseWriter = databaseWriter self.region = region - self.fetch = fetch + self.future = future self.queue = queue self.onChange = onChange self.onError = onError @@ -153,12 +61,11 @@ private class _TransactionObserver: TransactionObserver { changed = false - // Don't block the database writer queue. Instead, wait until the fetch - // can be executed concurrently. - let future = databaseWriter.concurrentRead { try self.fetch($0) } + // Fetch future results now... + let future = self.future() - // notificationQueue guarantees that notifications have the same - // ordering as transactions. + // ...but wait for them in notificationQueue, which guarantees + // that notifications have the same ordering as transactions. notificationQueue.async { [weak self] in guard let strongSelf = self else { return } @@ -183,6 +90,81 @@ private class _TransactionObserver: TransactionObserver { } } +extension DatabaseWriter { + /// Observe *region*: fetch fresh results each time the database has been + /// modified, and notify them through to the *onChange* closure. + /// + /// - parameters: + /// - region: The database region to observe. + /// - fetch: A closure that fetches results. + /// - queue: The dispatch queue where change callbacks are called. + /// Default is the main queue. + /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), + /// initial values are fetched right away, and the *onChange* callback + /// is called synchronously, on the current dispatch queue. + /// + /// When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// When `.none`, initial values are not fetched and not notified. + /// - onError: called when results could not be fetched. + /// - onChange: called with fetched results. + func makeValuesObserver( + observing region: (Database) throws -> DatabaseRegion, + extent: Database.TransactionObservationExtent/* = .observerLifetime*/, + fetch: @escaping (Database) throws -> Result, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Result) -> Void) throws -> TransactionObserver + { + // Will be set and notified on the caller queue if initialDispatch is .immediateOnCurrentQueue + var immediateValue: Result? = nil + defer { + if let immediateValue = immediateValue { + onChange(immediateValue) + } + } + + // Enter database in order to start observation, and fetch initial + // value if needed. + // + // We use an unsafe reentrant method so that this initializer can be + // called from a database queue. + return try unsafeReentrantWrite { db in + // Start observing the database (take care of future transactions + // that change the observed region). + // + // Observation stops when transactionObserver is deallocated, + // which happens when self is deallocated. + let transactionObserver = try ValuesObserver( + region: region(db), + future: { [unowned self] in self.concurrentRead { try fetch($0) } }, + queue: queue, + onError: onError, + onChange: onChange) + db.add(transactionObserver: transactionObserver, extent: extent) + + switch initialDispatch { + case .none: + break + case .immediateOnCurrentQueue: + immediateValue = try fetch(db) + case .asynchronous: + let initialValue = try fetch(db) + // We're still on the database writer queue. Let's dispatch + // initial value now, before any future transaction has any + // opportunity to trigger a change notification. + queue.async { + onChange(initialValue) + } + } + + return transactionObserver + } + } +} + // MARK: - DatabaseRegionConvertible Observation extension DatabaseWriter { @@ -215,16 +197,17 @@ extension DatabaseWriter { /// When `.none`, initial values are not fetched and not notified. /// - onError: called when results could not be fetched. /// - onChange: called with fetched results. - /// - returns: A new `FetchResultsObserver` + /// - returns: A new `TransactionObserver` /// - throws: A DatabaseError whenever an SQLite error occurs. public func observe( region regions: DatabaseRegionConvertible..., + extent: Database.TransactionObservationExtent = .observerLifetime, andFetch fetch: @escaping (Database) throws -> Result, queue: DispatchQueue = DispatchQueue.main, - initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, onError: ((Error) -> Void)? = nil, onChange: @escaping (Result) -> Void) - throws -> FetchResultsObserver + throws -> TransactionObserver { func region(_ db: Database) throws -> DatabaseRegion { return try regions.reduce(into: DatabaseRegion()) { union, region in @@ -232,9 +215,9 @@ extension DatabaseWriter { } } - return try FetchResultsObserver( + return try makeValuesObserver( observing: region, - in: self, + extent: extent, fetch: fetch, queue: queue, initialDispatch: initialDispatch, @@ -273,20 +256,21 @@ extension DatabaseWriter { /// When `.none`, initial values are not fetched and not notified. /// - onError: called when results could not be fetched. /// - onChange: called with fetched results. - /// - returns: A new `FetchResultsObserver` + /// - returns: A new `TransactionObserver` /// - throws: A DatabaseError whenever an SQLite error occurs. public func observeCount( from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, queue: DispatchQueue = DispatchQueue.main, - initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, onError: ((Error) -> Void)? = nil, onChange: @escaping (Int) -> Void) - throws -> FetchResultsObserver + throws -> TransactionObserver where Request: FetchRequest { - return try FetchResultsObserver( + return try makeValuesObserver( observing: { try request.databaseRegion($0) }, - in: self, + extent: extent, fetch: { try request.fetchCount($0) }, queue: queue, initialDispatch: initialDispatch, @@ -325,20 +309,21 @@ extension DatabaseWriter { /// When `.none`, initial values are not fetched and not notified. /// - onError: called when results could not be fetched. /// - onChange: called with fetched results. - /// - returns: A new `FetchResultsObserver` + /// - returns: A new `TransactionObserver` /// - throws: A DatabaseError whenever an SQLite error occurs. public func observeAll( from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, queue: DispatchQueue = DispatchQueue.main, - initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, onError: ((Error) -> Void)? = nil, onChange: @escaping ([Row]) -> Void) - throws -> FetchResultsObserver + throws -> TransactionObserver where Request: FetchRequest, Request.RowDecoder == Row { - return try FetchResultsObserver( + return try makeValuesObserver( observing: { try request.databaseRegion($0) }, - in: self, + extent: extent, fetch: { try request.fetchAll($0) }, queue: queue, initialDispatch: initialDispatch, @@ -373,20 +358,21 @@ extension DatabaseWriter { /// When `.none`, initial values are not fetched and not notified. /// - onError: called when results could not be fetched. /// - onChange: called with fetched results. - /// - returns: A new `FetchResultsObserver` + /// - returns: A new `TransactionObserver` /// - throws: A DatabaseError whenever an SQLite error occurs. public func observeOne( from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, queue: DispatchQueue = DispatchQueue.main, - initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, onError: ((Error) -> Void)? = nil, onChange: @escaping (Row?) -> Void) - throws -> FetchResultsObserver + throws -> TransactionObserver where Request: FetchRequest, Request.RowDecoder == Row { - return try FetchResultsObserver( + return try makeValuesObserver( observing: { try request.databaseRegion($0) }, - in: self, + extent: extent, fetch: { try request.fetchOne($0) }, queue: queue, initialDispatch: initialDispatch, @@ -425,20 +411,21 @@ extension DatabaseWriter { /// When `.none`, initial values are not fetched and not notified. /// - onError: called when results could not be fetched. /// - onChange: called with fetched results. - /// - returns: A new `FetchResultsObserver` + /// - returns: A new `TransactionObserver` /// - throws: A DatabaseError whenever an SQLite error occurs. public func observeAll( from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, queue: DispatchQueue = DispatchQueue.main, - initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, onError: ((Error) -> Void)? = nil, onChange: @escaping ([Request.RowDecoder]) -> Void) - throws -> FetchResultsObserver + throws -> TransactionObserver where Request: FetchRequest, Request.RowDecoder: FetchableRecord { - return try FetchResultsObserver( + return try makeValuesObserver( observing: { try request.databaseRegion($0) }, - in: self, + extent: extent, fetch: { try request.fetchAll($0) }, queue: queue, initialDispatch: initialDispatch, @@ -473,20 +460,21 @@ extension DatabaseWriter { /// When `.none`, initial values are not fetched and not notified. /// - onError: called when results could not be fetched. /// - onChange: called with fetched results. - /// - returns: A new `FetchResultsObserver` + /// - returns: A new `TransactionObserver` /// - throws: A DatabaseError whenever an SQLite error occurs. public func observeOne( from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, queue: DispatchQueue = DispatchQueue.main, - initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, onError: ((Error) -> Void)? = nil, onChange: @escaping (Request.RowDecoder?) -> Void) - throws -> FetchResultsObserver + throws -> TransactionObserver where Request: FetchRequest, Request.RowDecoder: FetchableRecord { - return try FetchResultsObserver( + return try makeValuesObserver( observing: { try request.databaseRegion($0) }, - in: self, + extent: extent, fetch: { try request.fetchOne($0) }, queue: queue, initialDispatch: initialDispatch, @@ -526,20 +514,21 @@ extension DatabaseWriter { /// When `.none`, initial values are not fetched and not notified. /// - onError: called when results could not be fetched. /// - onChange: called with fetched results. - /// - returns: A new `FetchResultsObserver` + /// - returns: A new `TransactionObserver` /// - throws: A DatabaseError whenever an SQLite error occurs. public func observeAll( from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, queue: DispatchQueue = DispatchQueue.main, - initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, onError: ((Error) -> Void)? = nil, onChange: @escaping ([Request.RowDecoder]) -> Void) - throws -> FetchResultsObserver + throws -> TransactionObserver where Request: FetchRequest, Request.RowDecoder: DatabaseValueConvertible { - return try FetchResultsObserver( + return try makeValuesObserver( observing: { try request.databaseRegion($0) }, - in: self, + extent: extent, fetch: { try request.fetchAll($0) }, queue: queue, initialDispatch: initialDispatch, @@ -577,20 +566,21 @@ extension DatabaseWriter { /// When `.none`, initial values are not fetched and not notified. /// - onError: called when results could not be fetched. /// - onChange: called with fetched results. - /// - returns: A new `FetchResultsObserver` + /// - returns: A new `TransactionObserver` /// - throws: A DatabaseError whenever an SQLite error occurs. public func observeOne( from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, queue: DispatchQueue = DispatchQueue.main, - initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, onError: ((Error) -> Void)? = nil, onChange: @escaping (Request.RowDecoder?) -> Void) - throws -> FetchResultsObserver + throws -> TransactionObserver where Request: FetchRequest, Request.RowDecoder: DatabaseValueConvertible { - return try FetchResultsObserver( + return try makeValuesObserver( observing: { try request.databaseRegion($0) }, - in: self, + extent: extent, fetch: { try request.fetchOne($0) }, queue: queue, initialDispatch: initialDispatch, @@ -630,20 +620,21 @@ extension DatabaseWriter { /// When `.none`, initial values are not fetched and not notified. /// - onError: called when results could not be fetched. /// - onChange: called with fetched results. - /// - returns: A new `FetchResultsObserver` + /// - returns: A new `TransactionObserver` /// - throws: A DatabaseError whenever an SQLite error occurs. public func observeAll( from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, queue: DispatchQueue = DispatchQueue.main, - initialDispatch: FetchResultsInitialDispatch = .immediateOnCurrentQueue, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, onError: ((Error) -> Void)? = nil, onChange: @escaping ([Request.RowDecoder._Wrapped?]) -> Void) - throws -> FetchResultsObserver + throws -> TransactionObserver where Request: FetchRequest, Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible { - return try FetchResultsObserver( + return try makeValuesObserver( observing: { try request.databaseRegion($0) }, - in: self, + extent: extent, fetch: { try request.fetchAll($0) }, queue: queue, initialDispatch: initialDispatch, From e5d97c15ad3c603bfca0d48ae7bf7f20fbdb5ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 25 Oct 2018 08:05:55 +0200 Subject: [PATCH 003/109] Looking for a good API --- GRDB.xcodeproj/project.pbxproj | 16 +- GRDB/Core/DatabaseWriter+Observation.swift | 644 ------------------- GRDB/Core/ValueObservation.swift | 689 +++++++++++++++++++++ GRDBCipher.xcodeproj/project.pbxproj | 12 +- GRDBCustom.xcodeproj/project.pbxproj | 12 +- 5 files changed, 709 insertions(+), 664 deletions(-) delete mode 100644 GRDB/Core/DatabaseWriter+Observation.swift create mode 100644 GRDB/Core/ValueObservation.swift diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index 5f58a5495..446658852 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -116,9 +116,9 @@ 5634B10A1CF9B970005360B9 /* TransactionObserverSavepointsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */; }; 5636E9BC1D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; 5636E9BF1D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; - 563B06AB217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* DatabaseWriter+Observation.swift */; }; - 563B06AC217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* DatabaseWriter+Observation.swift */; }; - 563B06AD217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* DatabaseWriter+Observation.swift */; }; + 563B06AB217EF0CC00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* ValueObservation.swift */; }; + 563B06AC217EF0CC00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* ValueObservation.swift */; }; + 563B06AD217EF0CC00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* ValueObservation.swift */; }; 563EF415215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF416215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF417215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; @@ -892,7 +892,7 @@ 563363F81C960711000BE133 /* PerformanceRealmTests.realm */ = {isa = PBXFileReference; lastKnownFileType = file; path = PerformanceRealmTests.realm; sourceTree = ""; }; 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionObserverSavepointsTests.swift; sourceTree = ""; }; 5636E9BB1D22574100B9B05F /* FetchRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchRequest.swift; sourceTree = ""; }; - 563B06AA217EF0CC00B38F35 /* DatabaseWriter+Observation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DatabaseWriter+Observation.swift"; sourceTree = ""; }; + 563B06AA217EF0CC00B38F35 /* ValueObservation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValueObservation.swift; sourceTree = ""; }; 563EF414215F87EB007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF42C2161180D007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF43E216131D1007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1708,7 +1708,6 @@ 5644DE6C20F8C32E001FFDDE /* DatabaseValueConversion.swift */, 560D923E1C672C3E00F4F92B /* DatabaseValueConvertible.swift */, 563363C31C942C37000BE133 /* DatabaseWriter.swift */, - 563B06AA217EF0CC00B38F35 /* DatabaseWriter+Observation.swift */, 5636E9BB1D22574100B9B05F /* FetchRequest.swift */, 56A238761B9C75030082EB20 /* Row.swift */, 567404871CEF84C8003ED5CC /* RowAdapter.swift */, @@ -1719,6 +1718,7 @@ 560D923F1C672C3E00F4F92B /* StatementColumnConvertible.swift */, 5605F1471C672E4000235C62 /* Support */, 566B91321FA4D3810012D5B0 /* TransactionObserver.swift */, + 563B06AA217EF0CC00B38F35 /* ValueObservation.swift */, ); path = Core; sourceTree = ""; @@ -2377,7 +2377,7 @@ 56CEB5671EAA359A00BFAF62 /* SQLSelectable.swift in Sources */, 5653EB272094A14400F46237 /* QueryInterfaceRequest+Association.swift in Sources */, 565490B91D5AE236005622CB /* DatabasePool.swift in Sources */, - 563B06AD217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */, + 563B06AD217EF0CC00B38F35 /* ValueObservation.swift in Sources */, 5674A6EF1F307F0E0095F066 /* DatabaseValueConvertible+Encodable.swift in Sources */, 565490D81D5AE252005622CB /* DatabaseMigrator.swift in Sources */, 56CEB5601EAA359A00BFAF62 /* SQLOrdering.swift in Sources */, @@ -2568,7 +2568,7 @@ 5605F1661C672E4000235C62 /* NSNull.swift in Sources */, 569EF0E3200D2D8400A9FA45 /* DatabaseRegion.swift in Sources */, 56A238841B9C75030082EB20 /* DatabaseQueue.swift in Sources */, - 563B06AC217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */, + 563B06AC217EF0CC00B38F35 /* ValueObservation.swift in Sources */, 5698AC7B1DA37DCB0056AF8C /* VirtualTableModule.swift in Sources */, 56A238821B9C75030082EB20 /* DatabaseError.swift in Sources */, 56D1215D1ED34978001347D2 /* Fixits-0.109.0.swift in Sources */, @@ -2946,7 +2946,7 @@ 563EF44A2161F179007DAACD /* Inflections.swift in Sources */, 566B91091FA4C3970012D5B0 /* Database+Statements.swift in Sources */, 566B91231FA4CF810012D5B0 /* Database+Schema.swift in Sources */, - 563B06AB217EF0CC00B38F35 /* DatabaseWriter+Observation.swift in Sources */, + 563B06AB217EF0CC00B38F35 /* ValueObservation.swift in Sources */, 56CEB5111EAA324B00BFAF62 /* FTS3+QueryInterfaceRequest.swift in Sources */, 5659F4901EA8D964004A4992 /* ReadWriteBox.swift in Sources */, 566A841A2041146100E50BFD /* DatabaseSnapshot.swift in Sources */, diff --git a/GRDB/Core/DatabaseWriter+Observation.swift b/GRDB/Core/DatabaseWriter+Observation.swift deleted file mode 100644 index d0c14c00b..000000000 --- a/GRDB/Core/DatabaseWriter+Observation.swift +++ /dev/null @@ -1,644 +0,0 @@ -// -// DatabaseWriter+Observation.swift -// GRDB -// -// Created by Gwendal Roué on 23/10/2018. -// Copyright © 2018 Gwendal Roué. All rights reserved. -// - -/// InitialDispatch controls how initial values are dispatched when one starts -/// observing database values. -public enum InitialDispatch { - /// Initial values are not fetched, and not notified. - case none - - /// Initial values are immediately fetched, and notified on the current dispatch queue. - case immediateOnCurrentQueue - - /// Initial values are immediately fetched, and asynchronously notified. - case asynchronous -} - -/// The database transaction observer, generic on the type of fetched values. -private class ValuesObserver: TransactionObserver { - private let region: DatabaseRegion - private let future: () -> Future - private let queue: DispatchQueue - private let onChange: (T) -> Void - private let onError: ((Error) -> Void)? - private let notificationQueue = DispatchQueue(label: "ValuesObserver") - private var changed = false - - init( - region: DatabaseRegion, - future: @escaping () -> Future, - queue: DispatchQueue, - onError: ((Error) -> Void)?, - onChange: @escaping (T) -> Void) - { - self.region = region - self.future = future - self.queue = queue - self.onChange = onChange - self.onError = onError - } - - func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { - return region.isModified(byEventsOfKind: eventKind) - } - - func databaseDidChange(with event: DatabaseEvent) { - if region.isModified(by: event) { - changed = true - stopObservingDatabaseChangesUntilNextTransaction() - } - } - - func databaseDidCommit(_ db: Database) { - guard changed else { - return - } - - changed = false - - // Fetch future results now... - let future = self.future() - - // ...but wait for them in notificationQueue, which guarantees - // that notifications have the same ordering as transactions. - notificationQueue.async { [weak self] in - guard let strongSelf = self else { return } - - do { - // block notificationQueue until the concurrent fetch is done - let result = try future.wait() - strongSelf.queue.async { - guard let strongSelf = self else { return } - strongSelf.onChange(result) - } - } catch { - strongSelf.queue.async { - guard let strongSelf = self else { return } - strongSelf.onError?(error) - } - } - } - } - - func databaseDidRollback(_ db: Database) { - changed = false - } -} - -extension DatabaseWriter { - /// Observe *region*: fetch fresh results each time the database has been - /// modified, and notify them through to the *onChange* closure. - /// - /// - parameters: - /// - region: The database region to observe. - /// - fetch: A closure that fetches results. - /// - queue: The dispatch queue where change callbacks are called. - /// Default is the main queue. - /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), - /// initial values are fetched right away, and the *onChange* callback - /// is called synchronously, on the current dispatch queue. - /// - /// When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. - /// - /// When `.none`, initial values are not fetched and not notified. - /// - onError: called when results could not be fetched. - /// - onChange: called with fetched results. - func makeValuesObserver( - observing region: (Database) throws -> DatabaseRegion, - extent: Database.TransactionObservationExtent/* = .observerLifetime*/, - fetch: @escaping (Database) throws -> Result, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping (Result) -> Void) throws -> TransactionObserver - { - // Will be set and notified on the caller queue if initialDispatch is .immediateOnCurrentQueue - var immediateValue: Result? = nil - defer { - if let immediateValue = immediateValue { - onChange(immediateValue) - } - } - - // Enter database in order to start observation, and fetch initial - // value if needed. - // - // We use an unsafe reentrant method so that this initializer can be - // called from a database queue. - return try unsafeReentrantWrite { db in - // Start observing the database (take care of future transactions - // that change the observed region). - // - // Observation stops when transactionObserver is deallocated, - // which happens when self is deallocated. - let transactionObserver = try ValuesObserver( - region: region(db), - future: { [unowned self] in self.concurrentRead { try fetch($0) } }, - queue: queue, - onError: onError, - onChange: onChange) - db.add(transactionObserver: transactionObserver, extent: extent) - - switch initialDispatch { - case .none: - break - case .immediateOnCurrentQueue: - immediateValue = try fetch(db) - case .asynchronous: - let initialValue = try fetch(db) - // We're still on the database writer queue. Let's dispatch - // initial value now, before any future transaction has any - // opportunity to trigger a change notification. - queue.async { - onChange(initialValue) - } - } - - return transactionObserver - } - } -} - -// MARK: - DatabaseRegionConvertible Observation - -extension DatabaseWriter { - /// Observe *regions*: fetch fresh results each time the database has been - /// modified, and notify them through to the *onChange* closure. - /// - /// Database observation lasts until the returned observer is deallocated. - /// - /// For example: - /// - /// let observer = try dbQueue.observe( - /// region: Player.all(), - /// andFetch: { db in return try Player.fetchAll(db) }, - /// onChange: { players: [Player] in - /// print("players have changed: \(players)") - /// }) - /// - /// - parameters: - /// - regions: one or more requests. - /// - fetch: block to execute to fetch the data - /// - queue: The dispatch queue where change callbacks are called. - /// Default is the main queue. - /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), - /// initial values are fetched right away, and the *onChange* callback - /// is called synchronously, on the current dispatch queue. - /// - /// When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. - /// - /// When `.none`, initial values are not fetched and not notified. - /// - onError: called when results could not be fetched. - /// - onChange: called with fetched results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observe( - region regions: DatabaseRegionConvertible..., - extent: Database.TransactionObservationExtent = .observerLifetime, - andFetch fetch: @escaping (Database) throws -> Result, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping (Result) -> Void) - throws -> TransactionObserver - { - func region(_ db: Database) throws -> DatabaseRegion { - return try regions.reduce(into: DatabaseRegion()) { union, region in - try union.formUnion(region.databaseRegion(db)) - } - } - - return try makeValuesObserver( - observing: region, - extent: extent, - fetch: fetch, - queue: queue, - initialDispatch: initialDispatch, - onError: onError, - onChange: onChange) - } -} - -// MARK: - FetchRequest Observation - -extension DatabaseWriter { - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. - /// - /// For example: - /// - /// let observer = try dbQueue.observeCount( - /// from: Player.all(), - /// onChange: { count: Int in - /// print("Number of players have changed: \(count)") - /// }) - /// - /// - parameters: - /// - request: The request to observe. - /// - queue: The dispatch queue where change callbacks are called. - /// Default is the main queue. - /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), - /// initial values are fetched right away, and the *onChange* callback - /// is called synchronously, on the current dispatch queue. - /// - /// When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. - /// - /// When `.none`, initial values are not fetched and not notified. - /// - onError: called when results could not be fetched. - /// - onChange: called with fetched results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeCount( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping (Int) -> Void) - throws -> TransactionObserver - where Request: FetchRequest - { - return try makeValuesObserver( - observing: { try request.databaseRegion($0) }, - extent: extent, - fetch: { try request.fetchCount($0) }, - queue: queue, - initialDispatch: initialDispatch, - onError: onError, - onChange: onChange) - } -} - -// MARK: - Row Observation - -extension DatabaseWriter { - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. - /// - /// For example: - /// - /// let observer = try dbQueue.observeAll( - /// from: SQLRequest("SELECT * FROM player"), - /// onChange: { rows: [Row] in - /// print("players have changed: \(rows)") - /// }) - /// - /// - parameters: - /// - request: The request to observe. - /// - queue: The dispatch queue where change callbacks are called. - /// Default is the main queue. - /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), - /// initial values are fetched right away, and the *onChange* callback - /// is called synchronously, on the current dispatch queue. - /// - /// When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. - /// - /// When `.none`, initial values are not fetched and not notified. - /// - onError: called when results could not be fetched. - /// - onChange: called with fetched results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeAll( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping ([Row]) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder == Row - { - return try makeValuesObserver( - observing: { try request.databaseRegion($0) }, - extent: extent, - fetch: { try request.fetchAll($0) }, - queue: queue, - initialDispatch: initialDispatch, - onError: onError, - onChange: onChange) - } - - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. - /// - /// For example: - /// - /// let observer = try dbQueue.observeOne( - /// from: SQLRequest("SELECT * FROM player WHERE id = 1"), - /// onChange: { row: Row? in - /// print("player has changed: \(row)") - /// }) - /// - /// - parameters: - /// - request: The request to observe. - /// - queue: The dispatch queue where change callbacks are called. - /// Default is the main queue. - /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), - /// initial values are fetched right away, and the *onChange* callback - /// is called synchronously, on the current dispatch queue. - /// - /// When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. - /// - /// When `.none`, initial values are not fetched and not notified. - /// - onError: called when results could not be fetched. - /// - onChange: called with fetched results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeOne( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping (Row?) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder == Row - { - return try makeValuesObserver( - observing: { try request.databaseRegion($0) }, - extent: extent, - fetch: { try request.fetchOne($0) }, - queue: queue, - initialDispatch: initialDispatch, - onError: onError, - onChange: onChange) - } -} - -// MARK: - FetchableRecord Observation - -extension DatabaseWriter { - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. - /// - /// For example: - /// - /// let observer = try dbQueue.observeAll( - /// from: Player.all(), - /// onChange: { players: [Player] in - /// print("players have changed: \(players)") - /// }) - /// - /// - parameters: - /// - request: The request to observe. - /// - queue: The dispatch queue where change callbacks are called. - /// Default is the main queue. - /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), - /// initial values are fetched right away, and the *onChange* callback - /// is called synchronously, on the current dispatch queue. - /// - /// When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. - /// - /// When `.none`, initial values are not fetched and not notified. - /// - onError: called when results could not be fetched. - /// - onChange: called with fetched results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeAll( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping ([Request.RowDecoder]) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder: FetchableRecord - { - return try makeValuesObserver( - observing: { try request.databaseRegion($0) }, - extent: extent, - fetch: { try request.fetchAll($0) }, - queue: queue, - initialDispatch: initialDispatch, - onError: onError, - onChange: onChange) - } - - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. - /// - /// For example: - /// - /// let observer = try dbQueue.observeOne( - /// from: Player.filter(key: 1), - /// onChange: { player: Player? in - /// print("player has changed: \(player)") - /// }) - /// - /// - parameters: - /// - request: The request to observe. - /// - queue: The dispatch queue where change callbacks are called. - /// Default is the main queue. - /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), - /// initial values are fetched right away, and the *onChange* callback - /// is called synchronously, on the current dispatch queue. - /// - /// When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. - /// - /// When `.none`, initial values are not fetched and not notified. - /// - onError: called when results could not be fetched. - /// - onChange: called with fetched results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeOne( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping (Request.RowDecoder?) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder: FetchableRecord - { - return try makeValuesObserver( - observing: { try request.databaseRegion($0) }, - extent: extent, - fetch: { try request.fetchOne($0) }, - queue: queue, - initialDispatch: initialDispatch, - onError: onError, - onChange: onChange) - } -} - -// MARK: - DatabaseValueConvertible Observation - -extension DatabaseWriter { - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. - /// - /// For example: - /// - /// let request = Player.select(Column("name"), as: String.self) - /// let observer = try dbQueue.observeAll( - /// from: request, - /// onChange: { names: [String] in - /// print("player names have changed: \(names)") - /// }) - /// - /// - parameters: - /// - request: The request to observe. - /// - queue: The dispatch queue where change callbacks are called. - /// Default is the main queue. - /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), - /// initial values are fetched right away, and the *onChange* callback - /// is called synchronously, on the current dispatch queue. - /// - /// When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. - /// - /// When `.none`, initial values are not fetched and not notified. - /// - onError: called when results could not be fetched. - /// - onChange: called with fetched results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeAll( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping ([Request.RowDecoder]) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder: DatabaseValueConvertible - { - return try makeValuesObserver( - observing: { try request.databaseRegion($0) }, - extent: extent, - fetch: { try request.fetchAll($0) }, - queue: queue, - initialDispatch: initialDispatch, - onError: onError, - onChange: onChange) - } - - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. - /// - /// For example: - /// - /// let request = Player - /// .filter(key: 1) - /// .select(Column("name"), as: String.self) - /// let observer = try dbQueue.observeOne( - /// from: request, - /// onChange: { name: String? in - /// print("player's name has changed: \(name)") - /// }) - /// - /// - parameters: - /// - request: The request to observe. - /// - queue: The dispatch queue where change callbacks are called. - /// Default is the main queue. - /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), - /// initial values are fetched right away, and the *onChange* callback - /// is called synchronously, on the current dispatch queue. - /// - /// When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. - /// - /// When `.none`, initial values are not fetched and not notified. - /// - onError: called when results could not be fetched. - /// - onChange: called with fetched results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeOne( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping (Request.RowDecoder?) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder: DatabaseValueConvertible - { - return try makeValuesObserver( - observing: { try request.databaseRegion($0) }, - extent: extent, - fetch: { try request.fetchOne($0) }, - queue: queue, - initialDispatch: initialDispatch, - onError: onError, - onChange: onChange) - } -} - -// MARK: - Optional DatabaseValueConvertible Observation - -extension DatabaseWriter { - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. - /// - /// For example: - /// - /// let request = Player.select(Column("email"), as: Optional.self) - /// let observer = try dbQueue.observeAll( - /// from: request, - /// onChange: { emails: [String?] in - /// print("player emails have changed: \(names)") - /// }) - /// - /// - parameters: - /// - request: The request to observe. - /// - queue: The dispatch queue where change callbacks are called. - /// Default is the main queue. - /// - initialDispatch: When `.immediateOnCurrentQueue` (the default), - /// initial values are fetched right away, and the *onChange* callback - /// is called synchronously, on the current dispatch queue. - /// - /// When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. - /// - /// When `.none`, initial values are not fetched and not notified. - /// - onError: called when results could not be fetched. - /// - onChange: called with fetched results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeAll( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping ([Request.RowDecoder._Wrapped?]) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible - { - return try makeValuesObserver( - observing: { try request.databaseRegion($0) }, - extent: extent, - fetch: { try request.fetchAll($0) }, - queue: queue, - initialDispatch: initialDispatch, - onError: onError, - onChange: onChange) - } -} diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift new file mode 100644 index 000000000..0cb695072 --- /dev/null +++ b/GRDB/Core/ValueObservation.swift @@ -0,0 +1,689 @@ +// +// ValueObservation.swift +// GRDB +// +// Created by Gwendal Roué on 23/10/2018. +// Copyright © 2018 Gwendal Roué. All rights reserved. +// + +/// InitialDispatch controls how initial values are dispatched when one starts +/// observing database values. +public enum InitialDispatch { + /// Initial values are not fetched, and not notified. + case none + + /// Initial values are immediately fetched, and notified on the current dispatch queue. + case immediateOnCurrentQueue + + /// Initial values are immediately fetched, and asynchronously notified. + case asynchronous +} + +/// The database transaction observer, generic on the type of fetched values. +private class ValuesObserver: TransactionObserver { + private let region: DatabaseRegion + private let future: () -> Future + private let queue: DispatchQueue + private let onChange: (T) -> Void + private let onError: ((Error) -> Void)? + private let notificationQueue = DispatchQueue(label: "ValuesObserver") + private var changed = false + + init( + region: DatabaseRegion, + future: @escaping () -> Future, + queue: DispatchQueue, + onError: ((Error) -> Void)?, + onChange: @escaping (T) -> Void) + { + self.region = region + self.future = future + self.queue = queue + self.onChange = onChange + self.onError = onError + } + + func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { + return region.isModified(byEventsOfKind: eventKind) + } + + func databaseDidChange(with event: DatabaseEvent) { + if region.isModified(by: event) { + changed = true + stopObservingDatabaseChangesUntilNextTransaction() + } + } + + func databaseDidCommit(_ db: Database) { + guard changed else { + return + } + + changed = false + + // Fetch future results now... + let future = self.future() + + // ...but wait for them in notificationQueue, which guarantees + // that notifications have the same ordering as transactions. + notificationQueue.async { [weak self] in + guard let strongSelf = self else { return } + + do { + // block notificationQueue until the concurrent fetch is done + let result = try future.wait() + strongSelf.queue.async { + guard let strongSelf = self else { return } + strongSelf.onChange(result) + } + } catch { + strongSelf.queue.async { + guard let strongSelf = self else { return } + strongSelf.onError?(error) + } + } + } + } + + func databaseDidRollback(_ db: Database) { + changed = false + } +} + +extension DatabaseWriter { + /// TODO + public func add(observation: ValueObservation) throws -> TransactionObserver { + // Will be set and notified on the caller queue if initialDispatch is .immediateOnCurrentQueue + var immediateValue: Value? = nil + defer { + if let immediateValue = immediateValue { + observation.onChange(immediateValue) + } + } + + // Enter database in order to start observation, and fetch initial + // value if needed. + // + // We use an unsafe reentrant method so that this initializer can be + // called from a database queue. + return try unsafeReentrantWrite { db in + // Start observing the database (take care of future transactions + // that change the observed region). + // + // Observation stops when transactionObserver is deallocated, + // which happens when self is deallocated. + let transactionObserver = try ValuesObserver( + region: observation.observedRegion(db), + future: { [unowned self] in self.concurrentRead { try observation.fetch($0) } }, + queue: observation.queue, + onError: observation.onError, + onChange: observation.onChange) + db.add(transactionObserver: transactionObserver, extent: observation.extent) + + switch observation.initialDispatch { + case .none: + break + case .immediateOnCurrentQueue: + immediateValue = try observation.fetch(db) + case .asynchronous: + let initialValue = try observation.fetch(db) + // We're still on the database writer queue. Let's dispatch + // initial value now, before any future transaction has any + // opportunity to trigger a change notification. + observation.queue.async { + observation.onChange(initialValue) + } + } + + return transactionObserver + } + } +} + +/// TODO +public struct ValueObservation { + /// A closure that is evaluated when the observation startst, and returns + /// the observed database region. + var observedRegion: (Database) throws -> DatabaseRegion + + /// The extent of the database observation. The default is + /// `.observerLifetime`: once started, the observation lasts until the + /// observer is deallocated. + var extent = Database.TransactionObservationExtent.observerLifetime + + /// A closure that fetches fresh results whenever the database changes. + var fetch: (Database) throws -> Value + + /// The dispatch queue where change callbacks are called. Default is the + /// main queue. + /// + /// Note that when *initialDispatch* is `.immediateOnCurrentQueue`, the + /// first values are dispatched on the dispatch queue which starts the + /// observation, regardless of this property. + var queue = DispatchQueue.main + + /// `initialDispatch` controls how initial values are dispatched when + /// observation starts. + /// + /// - When `.immediateOnCurrentQueue` (the default), initial values are + /// fetched right away, and the *onChange* callback is called + /// synchronously, on the dispatch queue which starts the observation. + /// + /// - When `.asynchronous`, initial values are fetched right away, and + /// the *onChange* callback is called asynchronously, on *queue*. + /// + /// - When `.none`, initial values are not fetched and not notified. + var initialDispatch = InitialDispatch.immediateOnCurrentQueue + + /// This callback is called when fresh results could not be fetched. + var onError: ((Error) -> Void)? = nil + + /// This callback is called with fresh results whenever the observed + /// database region is impacted by a database transaction. + var onChange: (Value) -> Void + + /// Creates a ValueObservation which observes *region*, and notifies the + /// *onChange* callback with the values returned by the *fetch* closure + /// whenever the observed region is impacted by a database transaction. + /// + /// For example: + /// + /// let observation = ValueObservation( + /// observing: { db in try Player.all().databaseRegion(db) }, + /// fetch: { db in try Player.fetchAll(db) }, + /// onChange: { player: [Player] in print("players have changed") }) + /// let observer = dbQueue.add(observation: observation) + /// // prints "players have changed" + /// + /// Unless further configured: + /// + /// - The observation notifies fresh values on the main queue. + /// - When started with the `add(observation:)` method, fresh values are + /// immediately notified, on the dispatch queue which starts + /// the observation. + /// - The observation lasts until the returned observer is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter region: a closure that returns the observed region. + /// - parameter fetch: a closure that fetches fresh results. + /// - parameter onChange: called with fresh results. + public init( + observing region: @escaping (Database) throws -> DatabaseRegion, + fetch: @escaping (Database) throws -> Value, + onChange: @escaping (Value) -> Void) + { + self.observedRegion = region + self.fetch = fetch + self.onChange = onChange + } +} + +// MARK: - DatabaseRegionConvertible Observation + +extension ValueObservation { + /// Creates a ValueObservation which observes *regions*, and notifies the + /// *onChange* callback with the values returned by the *fetch* closure + /// whenever one of the observed region is impacted by a + /// database transaction. + /// + /// For example: + /// + /// let observation = ValueObservation( + /// observing: Player.all(), + /// fetch: { db in return try Player.fetchAll(db) }, + /// onChange: { player: [Player] in print("players have changed") }) + /// let observer = dbQueue.add(observation: observation) + /// // prints "players have changed" + /// + /// Unless further configured: + /// + /// - The observation notifies fresh values on the main queue. + /// - When started with the `add(observation:)` method, fresh values are + /// immediately notified, on the dispatch queue which starts + /// the observation. + /// - The observation lasts until the returned observer is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter regions: one or more observed requests. + /// - parameter fetch: a closure that fetches fresh results. + /// - parameter onChange: called with fresh results. + public init( + observing regions: DatabaseRegionConvertible..., + fetch: @escaping (Database) throws -> Value, + onChange: @escaping (Value) -> Void) + { + func region(_ db: Database) throws -> DatabaseRegion { + return try regions.reduce(into: DatabaseRegion()) { union, region in + try union.formUnion(region.databaseRegion(db)) + } + } + + self.init(observing: region, fetch: fetch, onChange: onChange) + } +} + +// MARK: - FetchRequest Observation + +extension ValueObservation where Value == Int { + /// Creates a ValueObservation which observes *request*, and notifies the + /// *onChange* callback with the number of fetched values whenever the + /// request is impacted by a database transaction. + /// + /// For example: + /// + /// let request = Player.all() + /// let observation = ValueObservation(count: request) { count: Int in + /// print("number of players has changed") + /// } + /// let observer = dbQueue.add(observation: observation) + /// // prints "number of players has changed" + /// + /// Unless further configured: + /// + /// - The observation notifies fresh values on the main queue. + /// - When started with the `add(observation:)` method, fresh values are + /// immediately notified, on the dispatch queue which starts + /// the observation. + /// - The observation lasts until the returned observer is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - parameter onChange: called with fresh results. + /// - returns: a new ValueObservation. + init(count request: Request, onChange: @escaping (Int) -> Void) { + self.init( + observing: request, + fetch: { try request.fetchCount($0) }, + onChange: onChange) + } +} + +extension FetchRequest { + /// Creates a ValueObservation which observes *self*, and notifies the + /// *onChange* callback with the number of fetched values whenever the + /// request is impacted by a database transaction. + /// + /// For example: + /// + /// let request = Player.all() + /// let observation = request.observeCount { count: Int in + /// print("number of players has changed") + /// } + /// let observer = dbQueue.add(observation: observation) + /// // prints "number of players has changed" + /// + /// Unless further configured: + /// + /// - The observation notifies fresh values on the main queue. + /// - When started with the `add(observation:)` method, fresh values are + /// immediately notified, on the dispatch queue which starts + /// the observation. + /// - The observation lasts until the returned observer is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - parameter onChange: called with fresh results. + /// - returns: a new ValueObservation. + func observeCount(onChange: @escaping (Int) -> Void) -> ValueObservation { + return ValueObservation( + observing: self, + fetch: { try self.fetchCount($0) }, + onChange: onChange) + } +} + +// MARK: - Row Observation + +extension ValueObservation where Value == [Row] { + /// Creates a ValueObservation which observes *request*, and notifies the + /// *onChange* callback with fetched rows whenever the request is impacted + /// by a database transaction. + /// + /// For example: + /// + /// let request = SQLRequest("SELECT * FROM player") + /// let observation = ValueObservation(all: request) { rows: [Row] in + /// print("players have changed") + /// } + /// let observer = dbQueue.add(observation: observation) + /// // prints "players have changed" + /// + /// Unless further configured: + /// + /// - The observation notifies fresh values on the main queue. + /// - When started with the `add(observation:)` method, fresh values are + /// immediately notified, on the dispatch queue which starts + /// the observation. + /// - The observation lasts until the returned observer is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - parameter onChange: called with fresh results. + /// - returns: a new ValueObservation. + init(all request: Request, onChange: @escaping ([Row]) -> Void) where Request.RowDecoder == Row { + self.init( + observing: request, + fetch: { try request.fetchAll($0) }, + onChange: onChange) + } +} + +extension ValueObservation where Value == Row? { + /// Creates a ValueObservation which observes *request*, and notifies the + /// *onChange* callback with fetched rows whenever the request is impacted + /// by a database transaction. + /// + /// For example: + /// + /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) + /// let observation = ValueObservation(one: request) { row: Row? in + /// print("players have changed") + /// } + /// let observer = dbQueue.add(observation: observation) + /// // prints "players have changed" + /// + /// Unless further configured: + /// + /// - The observation notifies fresh values on the main queue. + /// - When started with the `add(observation:)` method, fresh values are + /// immediately notified, on the dispatch queue which starts + /// the observation. + /// - The observation lasts until the returned observer is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - parameter onChange: called with fresh results. + /// - returns: a new ValueObservation. + init(one request: Request, onChange: @escaping (Row?) -> Void) where Request.RowDecoder == Row { + self.init( + observing: request, + fetch: { try request.fetchOne($0) }, + onChange: onChange) + } +} + +extension FetchRequest where RowDecoder == Row { + /// Creates a ValueObservation which observes *self*, and notifies the + /// *onChange* callback with fetched rows whenever the request is impacted + /// by a database transaction. + /// + /// For example: + /// + /// let request = SQLRequest("SELECT * FROM player") + /// let observation = request.observeAll { rows: [Row] in + /// print("players have changed") + /// } + /// let observer = dbQueue.add(observation: observation) + /// // prints "players have changed" + /// + /// Unless further configured: + /// + /// - The observation notifies fresh values on the main queue. + /// - When started with the `add(observation:)` method, fresh values are + /// immediately notified, on the dispatch queue which starts + /// the observation. + /// - The observation lasts until the returned observer is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - parameter onChange: called with fresh results. + /// - returns: a new ValueObservation. + func observeAll(onChange: @escaping ([Row]) -> Void) -> ValueObservation<[Row]> { + return ValueObservation( + observing: self, + fetch: { try self.fetchAll($0) }, + onChange: onChange) + } + + /// Creates a ValueObservation which observes *self*, and notifies the + /// *onChange* callback with a fetched row whenever the request is impacted + /// by a database transaction. + /// + /// For example: + /// + /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) + /// let observation = request.observeOne { row: Row? in + /// print("player has changed") + /// } + /// let observer = dbQueue.add(observation: observation) + /// // prints "player has changed" + /// + /// Unless further configured: + /// + /// - The observation notifies fresh values on the main queue. + /// - When started with the `add(observation:)` method, fresh values are + /// immediately notified, on the dispatch queue which starts + /// the observation. + /// - The observation lasts until the returned observer is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - parameter onChange: called with fresh results. + /// - returns: a new ValueObservation. + func observeOne(onChange: @escaping (Row?) -> Void) -> ValueObservation { + return ValueObservation( + observing: self, + fetch: { try self.fetchOne($0) }, + onChange: onChange) + } +} + +// MARK: - FetchableRecord Observation + +extension DatabaseWriter { + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let observer = try dbQueue.observeAll( + /// from: Player.all(), + /// onChange: { players: [Player] in + /// print("players have changed: \(players)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - onChange: called with fresh results. + /// - returns: A new `TransactionObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeAll( + from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping ([Request.RowDecoder]) -> Void) + throws -> TransactionObserver + where Request: FetchRequest, Request.RowDecoder: FetchableRecord + { + var observation = ValueObservation( + observing: { try request.databaseRegion($0) }, + fetch: { try request.fetchAll($0) }, + onChange: onChange) + observation.extent = extent + observation.queue = queue + observation.initialDispatch = initialDispatch + observation.onError = onError + return try add(observation: observation) + } + + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let observer = try dbQueue.observeOne( + /// from: Player.filter(key: 1), + /// onChange: { player: Player? in + /// print("player has changed: \(player)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - onChange: called with fresh results. + /// - returns: A new `TransactionObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeOne( + from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Request.RowDecoder?) -> Void) + throws -> TransactionObserver + where Request: FetchRequest, Request.RowDecoder: FetchableRecord + { + var observation = ValueObservation( + observing: { try request.databaseRegion($0) }, + fetch: { try request.fetchOne($0) }, + onChange: onChange) + observation.extent = extent + observation.queue = queue + observation.initialDispatch = initialDispatch + observation.onError = onError + return try add(observation: observation) + } +} + +// MARK: - DatabaseValueConvertible Observation + +extension DatabaseWriter { + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let request = Player.select(Column("name"), as: String.self) + /// let observer = try dbQueue.observeAll( + /// from: request, + /// onChange: { names: [String] in + /// print("player names have changed: \(names)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - onChange: called with fresh results. + /// - returns: A new `TransactionObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeAll( + from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping ([Request.RowDecoder]) -> Void) + throws -> TransactionObserver + where Request: FetchRequest, Request.RowDecoder: DatabaseValueConvertible + { + var observation = ValueObservation( + observing: { try request.databaseRegion($0) }, + fetch: { try request.fetchAll($0) }, + onChange: onChange) + observation.extent = extent + observation.queue = queue + observation.initialDispatch = initialDispatch + observation.onError = onError + return try add(observation: observation) + } + + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let request = Player + /// .filter(key: 1) + /// .select(Column("name"), as: String.self) + /// let observer = try dbQueue.observeOne( + /// from: request, + /// onChange: { name: String? in + /// print("player's name has changed: \(name)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - onChange: called with fresh results. + /// - returns: A new `TransactionObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeOne( + from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Request.RowDecoder?) -> Void) + throws -> TransactionObserver + where Request: FetchRequest, Request.RowDecoder: DatabaseValueConvertible + { + var observation = ValueObservation( + observing: { try request.databaseRegion($0) }, + fetch: { try request.fetchOne($0) }, + onChange: onChange) + observation.extent = extent + observation.queue = queue + observation.initialDispatch = initialDispatch + observation.onError = onError + return try add(observation: observation) + } +} + +// MARK: - Optional DatabaseValueConvertible Observation + +extension DatabaseWriter { + /// Observe *request*: calls a closure with fresh results each time the + /// database has been modified. + /// + /// Database observation lasts until the returned observer is deallocated. + /// + /// For example: + /// + /// let request = Player.select(Column("email"), as: Optional.self) + /// let observer = try dbQueue.observeAll( + /// from: request, + /// onChange: { emails: [String?] in + /// print("player emails have changed: \(names)") + /// }) + /// + /// - parameters: + /// - request: The request to observe. + /// - onChange: called with fresh results. + /// - returns: A new `TransactionObserver` + /// - throws: A DatabaseError whenever an SQLite error occurs. + public func observeAll( + from request: Request, + extent: Database.TransactionObservationExtent = .observerLifetime, + queue: DispatchQueue = DispatchQueue.main, + initialDispatch: InitialDispatch = .immediateOnCurrentQueue, + onError: ((Error) -> Void)? = nil, + onChange: @escaping ([Request.RowDecoder._Wrapped?]) -> Void) + throws -> TransactionObserver + where Request: FetchRequest, Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible + { + var observation = ValueObservation( + observing: { try request.databaseRegion($0) }, + fetch: { try request.fetchAll($0) }, + onChange: onChange) + observation.extent = extent + observation.queue = queue + observation.initialDispatch = initialDispatch + observation.onError = onError + return try add(observation: observation) + } +} diff --git a/GRDBCipher.xcodeproj/project.pbxproj b/GRDBCipher.xcodeproj/project.pbxproj index 29ac9bf88..1c579c2d0 100755 --- a/GRDBCipher.xcodeproj/project.pbxproj +++ b/GRDBCipher.xcodeproj/project.pbxproj @@ -180,8 +180,8 @@ 5634B10C1CF9B970005360B9 /* TransactionObserverSavepointsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */; }; 5636E9BD1D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; 5636E9C01D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; - 563B06B6217F3C5A00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B4217F3C5900B38F35 /* FetchResultsObserver.swift */; }; - 563B06B7217F3C5A00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B4217F3C5900B38F35 /* FetchResultsObserver.swift */; }; + 563B06B6217F3C5A00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B4217F3C5900B38F35 /* ValueObservation.swift */; }; + 563B06B7217F3C5A00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B4217F3C5900B38F35 /* ValueObservation.swift */; }; 563EF424215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF425215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF43C2161183E007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF43A2161183E007DAACD /* AssociationAggregate.swift */; }; @@ -990,7 +990,7 @@ 563363D41C94484E000BE133 /* DatabaseQueueReleaseMemoryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseQueueReleaseMemoryTests.swift; sourceTree = ""; }; 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionObserverSavepointsTests.swift; sourceTree = ""; }; 5636E9BB1D22574100B9B05F /* FetchRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchRequest.swift; sourceTree = ""; }; - 563B06B4217F3C5900B38F35 /* FetchResultsObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchResultsObserver.swift; sourceTree = ""; }; + 563B06B4217F3C5900B38F35 /* ValueObservation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservation.swift; sourceTree = ""; }; 563EF422215F8A88007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF43A2161183E007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF44421613212007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1762,7 +1762,6 @@ 560D923E1C672C3E00F4F92B /* DatabaseValueConvertible.swift */, 563363C31C942C37000BE133 /* DatabaseWriter.swift */, 5636E9BB1D22574100B9B05F /* FetchRequest.swift */, - 563B06B4217F3C5900B38F35 /* FetchResultsObserver.swift */, 56A238761B9C75030082EB20 /* Row.swift */, 567404871CEF84C8003ED5CC /* RowAdapter.swift */, 56BB6EA81D3009B100A1CA52 /* SchedulingWatchdog.swift */, @@ -1772,6 +1771,7 @@ 560D923F1C672C3E00F4F92B /* StatementColumnConvertible.swift */, 5605F1471C672E4000235C62 /* Support */, 566B91321FA4D3810012D5B0 /* TransactionObserver.swift */, + 563B06B4217F3C5900B38F35 /* ValueObservation.swift */, ); path = Core; sourceTree = ""; @@ -2248,7 +2248,7 @@ 5644DE7C20F8C903001FFDDE /* DatabaseValueConversion.swift in Sources */, 560FC5321CB003810014AA8E /* DatabasePool.swift in Sources */, 560FC5331CB003810014AA8E /* Migration.swift in Sources */, - 563B06B6217F3C5A00B38F35 /* FetchResultsObserver.swift in Sources */, + 563B06B6217F3C5A00B38F35 /* ValueObservation.swift in Sources */, 560FC5341CB003810014AA8E /* QueryInterfaceQuery.swift in Sources */, 566B912C1FA4D0CC0012D5B0 /* StatementAuthorizer.swift in Sources */, 560FC5351CB003810014AA8E /* Statement.swift in Sources */, @@ -2698,7 +2698,7 @@ 5644DE7D20F8C903001FFDDE /* DatabaseValueConversion.swift in Sources */, 56AFCA071CB1A8BB00F48B96 /* DatabasePool.swift in Sources */, 56AFCA081CB1A8BB00F48B96 /* Statement.swift in Sources */, - 563B06B7217F3C5A00B38F35 /* FetchResultsObserver.swift in Sources */, + 563B06B7217F3C5A00B38F35 /* ValueObservation.swift in Sources */, 56AFCA091CB1A8BB00F48B96 /* QueryInterfaceQuery.swift in Sources */, 566B912F1FA4D0CC0012D5B0 /* StatementAuthorizer.swift in Sources */, 56AFCA0A1CB1A8BB00F48B96 /* Migration.swift in Sources */, diff --git a/GRDBCustom.xcodeproj/project.pbxproj b/GRDBCustom.xcodeproj/project.pbxproj index 4fcd90a72..19dfe3741 100755 --- a/GRDBCustom.xcodeproj/project.pbxproj +++ b/GRDBCustom.xcodeproj/project.pbxproj @@ -43,8 +43,8 @@ 562EA8361F17B9EB00FA528C /* CompilationSubClassTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 562EA82E1F17B9EB00FA528C /* CompilationSubClassTests.swift */; }; 5636E9BE1D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; 5636E9C11D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; - 563B06BA217F3C6E00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B8217F3C6E00B38F35 /* FetchResultsObserver.swift */; }; - 563B06BB217F3C6E00B38F35 /* FetchResultsObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B8217F3C6E00B38F35 /* FetchResultsObserver.swift */; }; + 563B06BA217F3C6E00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B8217F3C6E00B38F35 /* ValueObservation.swift */; }; + 563B06BB217F3C6E00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B8217F3C6E00B38F35 /* ValueObservation.swift */; }; 563EF420215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF421215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF4382161182C007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF4362161182C007DAACD /* AssociationAggregate.swift */; }; @@ -651,7 +651,7 @@ 563363D41C94484E000BE133 /* DatabaseQueueReleaseMemoryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseQueueReleaseMemoryTests.swift; sourceTree = ""; }; 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionObserverSavepointsTests.swift; sourceTree = ""; }; 5636E9BB1D22574100B9B05F /* FetchRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchRequest.swift; sourceTree = ""; }; - 563B06B8217F3C6E00B38F35 /* FetchResultsObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchResultsObserver.swift; sourceTree = ""; }; + 563B06B8217F3C6E00B38F35 /* ValueObservation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservation.swift; sourceTree = ""; }; 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF4362161182C007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF441216131F5007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1396,7 +1396,6 @@ 560D923E1C672C3E00F4F92B /* DatabaseValueConvertible.swift */, 563363C31C942C37000BE133 /* DatabaseWriter.swift */, 5636E9BB1D22574100B9B05F /* FetchRequest.swift */, - 563B06B8217F3C6E00B38F35 /* FetchResultsObserver.swift */, 56A238761B9C75030082EB20 /* Row.swift */, 567404871CEF84C8003ED5CC /* RowAdapter.swift */, 56BB6EA81D3009B100A1CA52 /* SchedulingWatchdog.swift */, @@ -1406,6 +1405,7 @@ 560D923F1C672C3E00F4F92B /* StatementColumnConvertible.swift */, 5605F1471C672E4000235C62 /* Support */, 566B91321FA4D3810012D5B0 /* TransactionObserver.swift */, + 563B06B8217F3C6E00B38F35 /* ValueObservation.swift */, ); path = Core; sourceTree = ""; @@ -1911,7 +1911,7 @@ 5644DE7920F8C8EA001FFDDE /* DatabaseValueConversion.swift in Sources */, 56DAA2E01DE9C827006E10C8 /* Cursor.swift in Sources */, F3BA800C1CFB286F003DC1BA /* DatabaseError.swift in Sources */, - 563B06BB217F3C6E00B38F35 /* FetchResultsObserver.swift in Sources */, + 563B06BB217F3C6E00B38F35 /* ValueObservation.swift in Sources */, 566B91301FA4D0CC0012D5B0 /* StatementAuthorizer.swift in Sources */, F3BA80221CFB288C003DC1BA /* NSNumber.swift in Sources */, 5653EB4620961F6100F46237 /* AssociationQuery.swift in Sources */, @@ -2194,7 +2194,7 @@ 5644DE7820F8C8EA001FFDDE /* DatabaseValueConversion.swift in Sources */, 56DAA2DD1DE9C827006E10C8 /* Cursor.swift in Sources */, F3BA80681CFB2E55003DC1BA /* DatabaseError.swift in Sources */, - 563B06BA217F3C6E00B38F35 /* FetchResultsObserver.swift in Sources */, + 563B06BA217F3C6E00B38F35 /* ValueObservation.swift in Sources */, 566B912D1FA4D0CC0012D5B0 /* StatementAuthorizer.swift in Sources */, F3BA807E1CFB2E61003DC1BA /* NSNumber.swift in Sources */, 5653EB4520961F6100F46237 /* AssociationQuery.swift in Sources */, From fda04a105d76542f5d15ba40c209c7afe711f344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 25 Oct 2018 08:39:52 +0200 Subject: [PATCH 004/109] ValueObservation: extract callbacks --- GRDB/Core/ValueObservation.swift | 282 ++++++++++++++----------------- 1 file changed, 127 insertions(+), 155 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 0cb695072..9d0489b6f 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -20,13 +20,13 @@ public enum InitialDispatch { } /// The database transaction observer, generic on the type of fetched values. -private class ValuesObserver: TransactionObserver { +private class ValueObserver: TransactionObserver { private let region: DatabaseRegion private let future: () -> Future private let queue: DispatchQueue private let onChange: (T) -> Void private let onError: ((Error) -> Void)? - private let notificationQueue = DispatchQueue(label: "ValuesObserver") + private let notificationQueue = DispatchQueue(label: "ValueObserver") private var changed = false init( @@ -92,12 +92,17 @@ private class ValuesObserver: TransactionObserver { extension DatabaseWriter { /// TODO - public func add(observation: ValueObservation) throws -> TransactionObserver { + public func add( + observation: ValueObservation, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Value) -> Void) + throws -> TransactionObserver + { // Will be set and notified on the caller queue if initialDispatch is .immediateOnCurrentQueue var immediateValue: Value? = nil defer { if let immediateValue = immediateValue { - observation.onChange(immediateValue) + onChange(immediateValue) } } @@ -112,26 +117,26 @@ extension DatabaseWriter { // // Observation stops when transactionObserver is deallocated, // which happens when self is deallocated. - let transactionObserver = try ValuesObserver( + let transactionObserver = try ValueObserver( region: observation.observedRegion(db), - future: { [unowned self] in self.concurrentRead { try observation.fetch($0) } }, + future: { [unowned self] in self.concurrentRead { try observation.read($0) } }, queue: observation.queue, - onError: observation.onError, - onChange: observation.onChange) + onError: onError, + onChange: onChange) db.add(transactionObserver: transactionObserver, extent: observation.extent) switch observation.initialDispatch { case .none: break case .immediateOnCurrentQueue: - immediateValue = try observation.fetch(db) + immediateValue = try observation.read(db) case .asynchronous: - let initialValue = try observation.fetch(db) + let initialValue = try observation.read(db) // We're still on the database writer queue. Let's dispatch // initial value now, before any future transaction has any // opportunity to trigger a change notification. observation.queue.async { - observation.onChange(initialValue) + onChange(initialValue) } } @@ -144,15 +149,15 @@ extension DatabaseWriter { public struct ValueObservation { /// A closure that is evaluated when the observation startst, and returns /// the observed database region. - var observedRegion: (Database) throws -> DatabaseRegion + fileprivate var observedRegion: (Database) throws -> DatabaseRegion + + /// A closure that fetches fresh results whenever the database changes. + fileprivate var read: (Database) throws -> Value /// The extent of the database observation. The default is /// `.observerLifetime`: once started, the observation lasts until the /// observer is deallocated. - var extent = Database.TransactionObservationExtent.observerLifetime - - /// A closure that fetches fresh results whenever the database changes. - var fetch: (Database) throws -> Value + public var extent = Database.TransactionObservationExtent.observerLifetime /// The dispatch queue where change callbacks are called. Default is the /// main queue. @@ -160,62 +165,55 @@ public struct ValueObservation { /// Note that when *initialDispatch* is `.immediateOnCurrentQueue`, the /// first values are dispatched on the dispatch queue which starts the /// observation, regardless of this property. - var queue = DispatchQueue.main + public var queue = DispatchQueue.main /// `initialDispatch` controls how initial values are dispatched when - /// observation starts. + /// observation starts with the `add(observation:)` method: /// /// - When `.immediateOnCurrentQueue` (the default), initial values are - /// fetched right away, and the *onChange* callback is called - /// synchronously, on the dispatch queue which starts the observation. + /// fetched right away, and notified synchronously, on the dispatch queue + /// which starts the observation. /// /// - When `.asynchronous`, initial values are fetched right away, and - /// the *onChange* callback is called asynchronously, on *queue*. + /// notified asynchronously, on *queue*. /// /// - When `.none`, initial values are not fetched and not notified. - var initialDispatch = InitialDispatch.immediateOnCurrentQueue - - /// This callback is called when fresh results could not be fetched. - var onError: ((Error) -> Void)? = nil - - /// This callback is called with fresh results whenever the observed - /// database region is impacted by a database transaction. - var onChange: (Value) -> Void + public var initialDispatch = InitialDispatch.immediateOnCurrentQueue /// Creates a ValueObservation which observes *region*, and notifies the - /// *onChange* callback with the values returned by the *fetch* closure - /// whenever the observed region is impacted by a database transaction. + /// values returned by the *fetch* closure whenever the observed region is + /// impacted by a database transaction. /// /// For example: /// /// let observation = ValueObservation( /// observing: { db in try Player.all().databaseRegion(db) }, - /// fetch: { db in try Player.fetchAll(db) }, - /// onChange: { player: [Player] in print("players have changed") }) - /// let observer = dbQueue.add(observation: observation) + /// read: { db in try Player.fetchAll(db) }) + /// + /// let observer = dbQueue.add(observation: observation) { player: [Player] in + /// print("players have changed") + /// } /// // prints "players have changed" /// - /// Unless further configured: + /// The returned observation has the default configuration: /// - /// - The observation notifies fresh values on the main queue. /// - When started with the `add(observation:)` method, fresh values are - /// immediately notified, on the dispatch queue which starts + /// synchronously notified, on the dispatch queue which starts /// the observation. + /// - When database eventually changes, fresh values are notified on the + /// main queue. /// - The observation lasts until the returned observer is deallocated. /// /// See ValueObservation for more information. /// /// - parameter region: a closure that returns the observed region. - /// - parameter fetch: a closure that fetches fresh results. - /// - parameter onChange: called with fresh results. + /// - parameter read: a closure that fetches fresh results. public init( observing region: @escaping (Database) throws -> DatabaseRegion, - fetch: @escaping (Database) throws -> Value, - onChange: @escaping (Value) -> Void) + read: @escaping (Database) throws -> Value) { self.observedRegion = region - self.fetch = fetch - self.onChange = onChange + self.read = read } } @@ -223,36 +221,36 @@ public struct ValueObservation { extension ValueObservation { /// Creates a ValueObservation which observes *regions*, and notifies the - /// *onChange* callback with the values returned by the *fetch* closure - /// whenever one of the observed region is impacted by a - /// database transaction. + /// values returned by the *read* closure whenever one of the observed + /// regions is impacted by a database transaction. /// /// For example: /// /// let observation = ValueObservation( /// observing: Player.all(), - /// fetch: { db in return try Player.fetchAll(db) }, - /// onChange: { player: [Player] in print("players have changed") }) - /// let observer = dbQueue.add(observation: observation) + /// read: { db in return try Player.fetchAll(db) }) + /// + /// let observer = dbQueue.add(observation: observation) { player: [Player] in + /// print("players have changed") + /// } /// // prints "players have changed" /// - /// Unless further configured: + /// The returned observation has the default configuration: /// - /// - The observation notifies fresh values on the main queue. /// - When started with the `add(observation:)` method, fresh values are - /// immediately notified, on the dispatch queue which starts + /// synchronously notified, on the dispatch queue which starts /// the observation. + /// - When database eventually changes, fresh values are notified on the + /// main queue. /// - The observation lasts until the returned observer is deallocated. /// /// See ValueObservation for more information. /// /// - parameter regions: one or more observed requests. - /// - parameter fetch: a closure that fetches fresh results. - /// - parameter onChange: called with fresh results. + /// - parameter read: a closure that fetches fresh results. public init( observing regions: DatabaseRegionConvertible..., - fetch: @escaping (Database) throws -> Value, - onChange: @escaping (Value) -> Void) + read: @escaping (Database) throws -> Value) { func region(_ db: Database) throws -> DatabaseRegion { return try regions.reduce(into: DatabaseRegion()) { union, region in @@ -260,7 +258,7 @@ extension ValueObservation { } } - self.init(observing: region, fetch: fetch, onChange: onChange) + self.init(observing: region, read: read) } } @@ -268,71 +266,67 @@ extension ValueObservation { extension ValueObservation where Value == Int { /// Creates a ValueObservation which observes *request*, and notifies the - /// *onChange* callback with the number of fetched values whenever the - /// request is impacted by a database transaction. + /// number of fetched values whenever the request is impacted by a + /// database transaction. /// /// For example: /// /// let request = Player.all() - /// let observation = ValueObservation(count: request) { count: Int in + /// let observation = ValueObservation(count: request) + /// + /// let observer = dbQueue.add(observation: observation) { count: Int in /// print("number of players has changed") /// } - /// let observer = dbQueue.add(observation: observation) /// // prints "number of players has changed" /// - /// Unless further configured: + /// The returned observation has the default configuration: /// - /// - The observation notifies fresh values on the main queue. /// - When started with the `add(observation:)` method, fresh values are - /// immediately notified, on the dispatch queue which starts + /// synchronously notified, on the dispatch queue which starts /// the observation. + /// - When database eventually changes, fresh values are notified on the + /// main queue. /// - The observation lasts until the returned observer is deallocated. /// /// See ValueObservation for more information. /// /// - parameter request: the observed request. - /// - parameter onChange: called with fresh results. /// - returns: a new ValueObservation. - init(count request: Request, onChange: @escaping (Int) -> Void) { - self.init( - observing: request, - fetch: { try request.fetchCount($0) }, - onChange: onChange) + init(count request: Request) { + self.init(observing: request, read: { try request.fetchCount($0) }) } } extension FetchRequest { /// Creates a ValueObservation which observes *self*, and notifies the - /// *onChange* callback with the number of fetched values whenever the - /// request is impacted by a database transaction. + /// number of fetched values whenever the request is impacted by a + /// database transaction. /// /// For example: /// /// let request = Player.all() - /// let observation = request.observeCount { count: Int in + /// let observation = request.observeCount() + /// + /// let observer = dbQueue.add(observation: observation) { count: Int in /// print("number of players has changed") /// } - /// let observer = dbQueue.add(observation: observation) /// // prints "number of players has changed" /// - /// Unless further configured: + /// The returned observation has the default configuration: /// - /// - The observation notifies fresh values on the main queue. /// - When started with the `add(observation:)` method, fresh values are - /// immediately notified, on the dispatch queue which starts + /// synchronously notified, on the dispatch queue which starts /// the observation. + /// - When database eventually changes, fresh values are notified on the + /// main queue. /// - The observation lasts until the returned observer is deallocated. /// /// See ValueObservation for more information. /// /// - parameter request: the observed request. - /// - parameter onChange: called with fresh results. /// - returns: a new ValueObservation. - func observeCount(onChange: @escaping (Int) -> Void) -> ValueObservation { - return ValueObservation( - observing: self, - fetch: { try self.fetchCount($0) }, - onChange: onChange) + func observeCount() -> ValueObservation { + return ValueObservation(observing: self, read: { try self.fetchCount($0) }) } } @@ -340,139 +334,127 @@ extension FetchRequest { extension ValueObservation where Value == [Row] { /// Creates a ValueObservation which observes *request*, and notifies the - /// *onChange* callback with fetched rows whenever the request is impacted - /// by a database transaction. + /// fetched rows whenever the request is impacted by a database transaction. /// /// For example: /// /// let request = SQLRequest("SELECT * FROM player") - /// let observation = ValueObservation(all: request) { rows: [Row] in + /// let observation = ValueObservation(all: request) + /// + /// let observer = dbQueue.add(observation: observation) { rows: [Row] in /// print("players have changed") /// } - /// let observer = dbQueue.add(observation: observation) /// // prints "players have changed" /// - /// Unless further configured: + /// The returned observation has the default configuration: /// - /// - The observation notifies fresh values on the main queue. /// - When started with the `add(observation:)` method, fresh values are - /// immediately notified, on the dispatch queue which starts + /// synchronously notified, on the dispatch queue which starts /// the observation. + /// - When database eventually changes, fresh values are notified on the + /// main queue. /// - The observation lasts until the returned observer is deallocated. /// /// See ValueObservation for more information. /// /// - parameter request: the observed request. - /// - parameter onChange: called with fresh results. /// - returns: a new ValueObservation. - init(all request: Request, onChange: @escaping ([Row]) -> Void) where Request.RowDecoder == Row { - self.init( - observing: request, - fetch: { try request.fetchAll($0) }, - onChange: onChange) + init(all request: Request) where Request.RowDecoder == Row { + self.init(observing: request, read: { try request.fetchAll($0) }) } } extension ValueObservation where Value == Row? { /// Creates a ValueObservation which observes *request*, and notifies the - /// *onChange* callback with fetched rows whenever the request is impacted - /// by a database transaction. + /// fetched rows whenever the request is impacted by a database transaction. /// /// For example: /// /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) - /// let observation = ValueObservation(one: request) { row: Row? in + /// let observation = ValueObservation(one: request) + /// + /// let observer = dbQueue.add(observation: observation) { row: Row? in /// print("players have changed") /// } - /// let observer = dbQueue.add(observation: observation) /// // prints "players have changed" /// - /// Unless further configured: + /// The returned observation has the default configuration: /// - /// - The observation notifies fresh values on the main queue. /// - When started with the `add(observation:)` method, fresh values are - /// immediately notified, on the dispatch queue which starts + /// synchronously notified, on the dispatch queue which starts /// the observation. + /// - When database eventually changes, fresh values are notified on the + /// main queue. /// - The observation lasts until the returned observer is deallocated. /// /// See ValueObservation for more information. /// /// - parameter request: the observed request. - /// - parameter onChange: called with fresh results. /// - returns: a new ValueObservation. - init(one request: Request, onChange: @escaping (Row?) -> Void) where Request.RowDecoder == Row { - self.init( - observing: request, - fetch: { try request.fetchOne($0) }, - onChange: onChange) + init(one request: Request) where Request.RowDecoder == Row { + self.init(observing: request, read: { try request.fetchOne($0) }) } } extension FetchRequest where RowDecoder == Row { /// Creates a ValueObservation which observes *self*, and notifies the - /// *onChange* callback with fetched rows whenever the request is impacted - /// by a database transaction. + /// fetched rows whenever the request is impacted by a database transaction. /// /// For example: /// /// let request = SQLRequest("SELECT * FROM player") - /// let observation = request.observeAll { rows: [Row] in + /// let observation = request.observeAll() + /// + /// let observer = dbQueue.add(observation: observation) { rows: [Row] in /// print("players have changed") /// } - /// let observer = dbQueue.add(observation: observation) /// // prints "players have changed" /// - /// Unless further configured: + /// The returned observation has the default configuration: /// - /// - The observation notifies fresh values on the main queue. /// - When started with the `add(observation:)` method, fresh values are - /// immediately notified, on the dispatch queue which starts + /// synchronously notified, on the dispatch queue which starts /// the observation. + /// - When database eventually changes, fresh values are notified on the + /// main queue. /// - The observation lasts until the returned observer is deallocated. /// /// See ValueObservation for more information. /// /// - parameter request: the observed request. - /// - parameter onChange: called with fresh results. /// - returns: a new ValueObservation. - func observeAll(onChange: @escaping ([Row]) -> Void) -> ValueObservation<[Row]> { - return ValueObservation( - observing: self, - fetch: { try self.fetchAll($0) }, - onChange: onChange) + func observeAll() -> ValueObservation<[Row]> { + return ValueObservation(observing: self, read: { try self.fetchAll($0) }) } /// Creates a ValueObservation which observes *self*, and notifies the - /// *onChange* callback with a fetched row whenever the request is impacted - /// by a database transaction. + /// fetched row whenever the request is impacted by a database transaction. /// /// For example: /// /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) - /// let observation = request.observeOne { row: Row? in + /// let observation = request.observeOne() + /// + /// let observer = dbQueue.add(observation: observation) { row: Row? in /// print("player has changed") /// } - /// let observer = dbQueue.add(observation: observation) /// // prints "player has changed" /// - /// Unless further configured: + /// The returned observation has the default configuration: /// - /// - The observation notifies fresh values on the main queue. /// - When started with the `add(observation:)` method, fresh values are - /// immediately notified, on the dispatch queue which starts + /// synchronously notified, on the dispatch queue which starts /// the observation. + /// - When database eventually changes, fresh values are notified on the + /// main queue. /// - The observation lasts until the returned observer is deallocated. /// /// See ValueObservation for more information. /// /// - parameter request: the observed request. - /// - parameter onChange: called with fresh results. /// - returns: a new ValueObservation. - func observeOne(onChange: @escaping (Row?) -> Void) -> ValueObservation { - return ValueObservation( - observing: self, - fetch: { try self.fetchOne($0) }, - onChange: onChange) + func observeOne() -> ValueObservation { + return ValueObservation(observing: self, read: { try self.fetchOne($0) }) } } @@ -509,13 +491,11 @@ extension DatabaseWriter { { var observation = ValueObservation( observing: { try request.databaseRegion($0) }, - fetch: { try request.fetchAll($0) }, - onChange: onChange) + read: { try request.fetchAll($0) }) observation.extent = extent observation.queue = queue observation.initialDispatch = initialDispatch - observation.onError = onError - return try add(observation: observation) + return try add(observation: observation, onError: onError, onChange: onChange) } /// Observe *request*: calls a closure with fresh results each time the @@ -548,13 +528,11 @@ extension DatabaseWriter { { var observation = ValueObservation( observing: { try request.databaseRegion($0) }, - fetch: { try request.fetchOne($0) }, - onChange: onChange) + read: { try request.fetchOne($0) }) observation.extent = extent observation.queue = queue observation.initialDispatch = initialDispatch - observation.onError = onError - return try add(observation: observation) + return try add(observation: observation, onError: onError, onChange: onChange) } } @@ -592,13 +570,11 @@ extension DatabaseWriter { { var observation = ValueObservation( observing: { try request.databaseRegion($0) }, - fetch: { try request.fetchAll($0) }, - onChange: onChange) + read: { try request.fetchAll($0) }) observation.extent = extent observation.queue = queue observation.initialDispatch = initialDispatch - observation.onError = onError - return try add(observation: observation) + return try add(observation: observation, onError: onError, onChange: onChange) } /// Observe *request*: calls a closure with fresh results each time the @@ -634,13 +610,11 @@ extension DatabaseWriter { { var observation = ValueObservation( observing: { try request.databaseRegion($0) }, - fetch: { try request.fetchOne($0) }, - onChange: onChange) + read: { try request.fetchOne($0) }) observation.extent = extent observation.queue = queue observation.initialDispatch = initialDispatch - observation.onError = onError - return try add(observation: observation) + return try add(observation: observation, onError: onError, onChange: onChange) } } @@ -678,12 +652,10 @@ extension DatabaseWriter { { var observation = ValueObservation( observing: { try request.databaseRegion($0) }, - fetch: { try request.fetchAll($0) }, - onChange: onChange) + read: { try request.fetchAll($0) }) observation.extent = extent observation.queue = queue observation.initialDispatch = initialDispatch - observation.onError = onError - return try add(observation: observation) + return try add(observation: observation, onError: onError, onChange: onChange) } } From fe0f238f325187471483fd7ab1efa02400a501b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 25 Oct 2018 08:49:57 +0200 Subject: [PATCH 005/109] Cleanup --- GRDB/Core/ValueObservation.swift | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 9d0489b6f..8e60c5b5a 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -16,7 +16,7 @@ public enum InitialDispatch { case immediateOnCurrentQueue /// Initial values are immediately fetched, and asynchronously notified. - case asynchronous + case deferred } /// The database transaction observer, generic on the type of fetched values. @@ -130,7 +130,7 @@ extension DatabaseWriter { break case .immediateOnCurrentQueue: immediateValue = try observation.read(db) - case .asynchronous: + case .deferred: let initialValue = try observation.read(db) // We're still on the database writer queue. Let's dispatch // initial value now, before any future transaction has any @@ -174,7 +174,7 @@ public struct ValueObservation { /// fetched right away, and notified synchronously, on the dispatch queue /// which starts the observation. /// - /// - When `.asynchronous`, initial values are fetched right away, and + /// - When `.deferred`, initial values are fetched right away, and /// notified asynchronously, on *queue*. /// /// - When `.none`, initial values are not fetched and not notified. @@ -198,8 +198,7 @@ public struct ValueObservation { /// The returned observation has the default configuration: /// /// - When started with the `add(observation:)` method, fresh values are - /// synchronously notified, on the dispatch queue which starts - /// the observation. + /// immediately notified on the dispatch queue which starts the observation. /// - When database eventually changes, fresh values are notified on the /// main queue. /// - The observation lasts until the returned observer is deallocated. @@ -238,8 +237,7 @@ extension ValueObservation { /// The returned observation has the default configuration: /// /// - When started with the `add(observation:)` method, fresh values are - /// synchronously notified, on the dispatch queue which starts - /// the observation. + /// immediately notified on the dispatch queue which starts the observation. /// - When database eventually changes, fresh values are notified on the /// main queue. /// - The observation lasts until the returned observer is deallocated. @@ -282,8 +280,7 @@ extension ValueObservation where Value == Int { /// The returned observation has the default configuration: /// /// - When started with the `add(observation:)` method, fresh values are - /// synchronously notified, on the dispatch queue which starts - /// the observation. + /// immediately notified on the dispatch queue which starts the observation. /// - When database eventually changes, fresh values are notified on the /// main queue. /// - The observation lasts until the returned observer is deallocated. @@ -315,8 +312,7 @@ extension FetchRequest { /// The returned observation has the default configuration: /// /// - When started with the `add(observation:)` method, fresh values are - /// synchronously notified, on the dispatch queue which starts - /// the observation. + /// immediately notified on the dispatch queue which starts the observation. /// - When database eventually changes, fresh values are notified on the /// main queue. /// - The observation lasts until the returned observer is deallocated. @@ -349,8 +345,7 @@ extension ValueObservation where Value == [Row] { /// The returned observation has the default configuration: /// /// - When started with the `add(observation:)` method, fresh values are - /// synchronously notified, on the dispatch queue which starts - /// the observation. + /// immediately notified on the dispatch queue which starts the observation. /// - When database eventually changes, fresh values are notified on the /// main queue. /// - The observation lasts until the returned observer is deallocated. @@ -381,8 +376,7 @@ extension ValueObservation where Value == Row? { /// The returned observation has the default configuration: /// /// - When started with the `add(observation:)` method, fresh values are - /// synchronously notified, on the dispatch queue which starts - /// the observation. + /// immediately notified on the dispatch queue which starts the observation. /// - When database eventually changes, fresh values are notified on the /// main queue. /// - The observation lasts until the returned observer is deallocated. @@ -413,8 +407,7 @@ extension FetchRequest where RowDecoder == Row { /// The returned observation has the default configuration: /// /// - When started with the `add(observation:)` method, fresh values are - /// synchronously notified, on the dispatch queue which starts - /// the observation. + /// immediately notified on the dispatch queue which starts the observation. /// - When database eventually changes, fresh values are notified on the /// main queue. /// - The observation lasts until the returned observer is deallocated. @@ -443,8 +436,7 @@ extension FetchRequest where RowDecoder == Row { /// The returned observation has the default configuration: /// /// - When started with the `add(observation:)` method, fresh values are - /// synchronously notified, on the dispatch queue which starts - /// the observation. + /// immediately notified on the dispatch queue which starts the observation. /// - When database eventually changes, fresh values are notified on the /// main queue. /// - The observation lasts until the returned observer is deallocated. From 0df481508661aafce4e4547f795f44c5174d8660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 25 Oct 2018 20:39:04 +0200 Subject: [PATCH 006/109] Move ValueObservation support to DatabaseReader --- GRDB/Core/DatabaseReader.swift | 19 +++++ GRDB/Core/DatabaseSnapshot.swift | 56 +++++++------ GRDB/Core/DatabaseWriter.swift | 125 +++++++++++++++++++++++++++++ GRDB/Core/ValueObservation.swift | 130 +------------------------------ 4 files changed, 179 insertions(+), 151 deletions(-) diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index 9e17ef96b..42c2c90e8 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -149,6 +149,14 @@ public protocol DatabaseReader : class { /// Remove a collation. func remove(collation: DatabaseCollation) + + // MARK: - Value Observation + + /// TODO + func add( + observation: ValueObservation, + onError: ((Error) -> Void)?, + onChange: @escaping (Value) -> Void) throws -> TransactionObserver } extension DatabaseReader { @@ -228,4 +236,15 @@ public final class AnyDatabaseReader : DatabaseReader { public func remove(collation: DatabaseCollation) { base.remove(collation: collation) } + + // MARK: - Value Observation + + /// TODO + public func add( + observation: ValueObservation, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Value) -> Void) throws -> TransactionObserver + { + return try base.add(observation: observation, onError: onError, onChange: onChange) + } } diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index 423822fcf..e720e89ab 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -81,45 +81,55 @@ extension DatabaseSnapshot { // MARK: - Functions - /// Add or redefine an SQL function. - /// - /// let fn = DatabaseFunction("succ", argumentCount: 1) { dbValues in - /// guard let int = Int.fromDatabaseValue(dbValues[0]) else { - /// return nil - /// } - /// return int + 1 - /// } - /// snapshot.add(function: fn) - /// try snapshot.read { db in - /// try Int.fetchOne(db, "SELECT succ(1)") // 2 - /// } public func add(function: DatabaseFunction) { serializedDatabase.sync { $0.add(function: function) } } - /// Remove an SQL function. public func remove(function: DatabaseFunction) { serializedDatabase.sync { $0.remove(function: function) } } // MARK: - Collations - /// Add or redefine a collation. - /// - /// let collation = DatabaseCollation("localized_standard") { (string1, string2) in - /// return (string1 as NSString).localizedStandardCompare(string2) - /// } - /// snapshot.add(collation: collation) - /// let files = try snapshot.read { db in - /// try File.fetchAll(db, "SELECT * FROM file ORDER BY name COLLATE localized_standard") - /// } public func add(collation: DatabaseCollation) { serializedDatabase.sync { $0.add(collation: collation) } } - /// Remove a collation. public func remove(collation: DatabaseCollation) { serializedDatabase.sync { $0.remove(collation: collation) } } + + // MARK: - Value Observation + + public func add( + observation: ValueObservation, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Value) -> Void) throws -> TransactionObserver + { + // Deal with initial value + switch observation.initialDispatch { + case .none: + break + case .deferred: + let initialValue = try unsafeReentrantRead { try observation.read($0) } + observation.queue.async { + onChange(initialValue) + } + case .immediateOnCurrentQueue: + let initialValue = try unsafeReentrantRead { try observation.read($0) } + onChange(initialValue) + } + + // Return a dummy observer, because snapshots never change + return SnapshotValueObserver() + } } +/// An observer that does nothing, support for +/// `DatabaseSnapshot.add(observation:onError:onChange:)`. +private class SnapshotValueObserver: TransactionObserver { + func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { return false } + func databaseDidChange(with event: DatabaseEvent) { } + func databaseDidCommit(_ db: Database) { } + func databaseDidRollback(_ db: Database) { } +} diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index c1b77e010..07265459c 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -229,6 +229,131 @@ extension DatabaseWriter { } } +/// The database transaction observer, support for ValueObservation. +private class ValueObserver: TransactionObserver { + private let region: DatabaseRegion + private let future: () -> Future + private let queue: DispatchQueue + private let onChange: (Value) -> Void + private let onError: ((Error) -> Void)? + private let notificationQueue = DispatchQueue(label: "ValueObserver") + private var changed = false + + init( + region: DatabaseRegion, + future: @escaping () -> Future, + queue: DispatchQueue, + onError: ((Error) -> Void)?, + onChange: @escaping (Value) -> Void) + { + self.region = region + self.future = future + self.queue = queue + self.onChange = onChange + self.onError = onError + } + + func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { + return region.isModified(byEventsOfKind: eventKind) + } + + func databaseDidChange(with event: DatabaseEvent) { + if region.isModified(by: event) { + changed = true + stopObservingDatabaseChangesUntilNextTransaction() + } + } + + func databaseDidCommit(_ db: Database) { + guard changed else { + return + } + + changed = false + + // Fetch future value now, from the database writer queue + let futureValue = future() + + // Wait for future value in notificationQueue, in order to guarantee + // that notifications have the same ordering as transactions. + notificationQueue.async { [weak self] in + guard let strongSelf = self else { return } + + do { + let value = try futureValue.wait() + strongSelf.queue.async { + guard let strongSelf = self else { return } + strongSelf.onChange(value) + } + } catch { + strongSelf.queue.async { + guard let strongSelf = self else { return } + strongSelf.onError?(error) + } + } + } + } + + func databaseDidRollback(_ db: Database) { + changed = false + } +} + +extension DatabaseWriter { + public func add( + observation: ValueObservation, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Value) -> Void) + throws -> TransactionObserver + { + // Will be set and notified on the caller queue if initialDispatch is .immediateOnCurrentQueue + var immediateValue: Value? = nil + defer { + if let immediateValue = immediateValue { + onChange(immediateValue) + } + } + + // Enter database in order to start observation, and fetch initial + // value if needed. + // + // We use an unsafe reentrant method so that this initializer can be + // called from a database queue. + return try unsafeReentrantWrite { db in + // Start observing the database (take care of future transactions + // that change the observed region). + // + // Observation stops when transactionObserver is deallocated, + // which happens when self is deallocated. + let transactionObserver = try ValueObserver( + region: observation.observedRegion(db), + future: { [unowned self] in self.concurrentRead { try observation.read($0) } }, + queue: observation.queue, + onError: onError, + onChange: onChange) + db.add(transactionObserver: transactionObserver, extent: observation.extent) + + switch observation.initialDispatch { + case .none: + break + case .immediateOnCurrentQueue: + immediateValue = try observation.read(db) + case .deferred: + // We're still on the database writer queue. Let's dispatch + // initial value right now, before any future transaction has + // any opportunity to trigger a change notification, and mess + // with the ordering of value notifications. + let initialValue = try observation.read(db) + observation.queue.async { + onChange(initialValue) + } + } + + return transactionObserver + } + } +} + /// A future value. public class Future { private var consumed = false diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 8e60c5b5a..b6630bf95 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -19,140 +19,14 @@ public enum InitialDispatch { case deferred } -/// The database transaction observer, generic on the type of fetched values. -private class ValueObserver: TransactionObserver { - private let region: DatabaseRegion - private let future: () -> Future - private let queue: DispatchQueue - private let onChange: (T) -> Void - private let onError: ((Error) -> Void)? - private let notificationQueue = DispatchQueue(label: "ValueObserver") - private var changed = false - - init( - region: DatabaseRegion, - future: @escaping () -> Future, - queue: DispatchQueue, - onError: ((Error) -> Void)?, - onChange: @escaping (T) -> Void) - { - self.region = region - self.future = future - self.queue = queue - self.onChange = onChange - self.onError = onError - } - - func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { - return region.isModified(byEventsOfKind: eventKind) - } - - func databaseDidChange(with event: DatabaseEvent) { - if region.isModified(by: event) { - changed = true - stopObservingDatabaseChangesUntilNextTransaction() - } - } - - func databaseDidCommit(_ db: Database) { - guard changed else { - return - } - - changed = false - - // Fetch future results now... - let future = self.future() - - // ...but wait for them in notificationQueue, which guarantees - // that notifications have the same ordering as transactions. - notificationQueue.async { [weak self] in - guard let strongSelf = self else { return } - - do { - // block notificationQueue until the concurrent fetch is done - let result = try future.wait() - strongSelf.queue.async { - guard let strongSelf = self else { return } - strongSelf.onChange(result) - } - } catch { - strongSelf.queue.async { - guard let strongSelf = self else { return } - strongSelf.onError?(error) - } - } - } - } - - func databaseDidRollback(_ db: Database) { - changed = false - } -} - -extension DatabaseWriter { - /// TODO - public func add( - observation: ValueObservation, - onError: ((Error) -> Void)? = nil, - onChange: @escaping (Value) -> Void) - throws -> TransactionObserver - { - // Will be set and notified on the caller queue if initialDispatch is .immediateOnCurrentQueue - var immediateValue: Value? = nil - defer { - if let immediateValue = immediateValue { - onChange(immediateValue) - } - } - - // Enter database in order to start observation, and fetch initial - // value if needed. - // - // We use an unsafe reentrant method so that this initializer can be - // called from a database queue. - return try unsafeReentrantWrite { db in - // Start observing the database (take care of future transactions - // that change the observed region). - // - // Observation stops when transactionObserver is deallocated, - // which happens when self is deallocated. - let transactionObserver = try ValueObserver( - region: observation.observedRegion(db), - future: { [unowned self] in self.concurrentRead { try observation.read($0) } }, - queue: observation.queue, - onError: onError, - onChange: onChange) - db.add(transactionObserver: transactionObserver, extent: observation.extent) - - switch observation.initialDispatch { - case .none: - break - case .immediateOnCurrentQueue: - immediateValue = try observation.read(db) - case .deferred: - let initialValue = try observation.read(db) - // We're still on the database writer queue. Let's dispatch - // initial value now, before any future transaction has any - // opportunity to trigger a change notification. - observation.queue.async { - onChange(initialValue) - } - } - - return transactionObserver - } - } -} - /// TODO public struct ValueObservation { /// A closure that is evaluated when the observation startst, and returns /// the observed database region. - fileprivate var observedRegion: (Database) throws -> DatabaseRegion + var observedRegion: (Database) throws -> DatabaseRegion /// A closure that fetches fresh results whenever the database changes. - fileprivate var read: (Database) throws -> Value + var read: (Database) throws -> Value /// The extent of the database observation. The default is /// `.observerLifetime`: once started, the observation lasts until the From 2341523c41c8feb95302148d48d93ea683539113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 26 Oct 2018 08:50:59 +0200 Subject: [PATCH 007/109] API cleanup --- GRDB/Core/DatabaseSnapshot.swift | 8 +- GRDB/Core/DatabaseWriter.swift | 6 +- GRDB/Core/ValueObservation.swift | 634 +++++++++++++++---------------- 3 files changed, 320 insertions(+), 328 deletions(-) diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index e720e89ab..f09023838 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -111,13 +111,13 @@ extension DatabaseSnapshot { case .none: break case .deferred: - let initialValue = try unsafeReentrantRead { try observation.read($0) } + let value = try unsafeReentrantRead { try observation.fetch($0) } observation.queue.async { - onChange(initialValue) + onChange(value) } case .immediateOnCurrentQueue: - let initialValue = try unsafeReentrantRead { try observation.read($0) } - onChange(initialValue) + let value = try unsafeReentrantRead { try observation.fetch($0) } + onChange(value) } // Return a dummy observer, because snapshots never change diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 07265459c..6523169f3 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -327,7 +327,7 @@ extension DatabaseWriter { // which happens when self is deallocated. let transactionObserver = try ValueObserver( region: observation.observedRegion(db), - future: { [unowned self] in self.concurrentRead { try observation.read($0) } }, + future: { [unowned self] in self.concurrentRead { try observation.fetch($0) } }, queue: observation.queue, onError: onError, onChange: onChange) @@ -337,13 +337,13 @@ extension DatabaseWriter { case .none: break case .immediateOnCurrentQueue: - immediateValue = try observation.read(db) + immediateValue = try observation.fetch(db) case .deferred: // We're still on the database writer queue. Let's dispatch // initial value right now, before any future transaction has // any opportunity to trigger a change notification, and mess // with the ordering of value notifications. - let initialValue = try observation.read(db) + let initialValue = try observation.fetch(db) observation.queue.async { onChange(initialValue) } diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index b6630bf95..7dc0086a2 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -6,27 +6,37 @@ // Copyright © 2018 Gwendal Roué. All rights reserved. // -/// InitialDispatch controls how initial values are dispatched when one starts -/// observing database values. +/// InitialDispatch controls how initial value is dispatched when one starts +/// observing the database. See ValueObservation. public enum InitialDispatch { - /// Initial values are not fetched, and not notified. + /// Initial value is not fetched, and not notified. case none - /// Initial values are immediately fetched, and notified on the current dispatch queue. + /// Initial value is immediately fetched, and notified on the current dispatch queue. case immediateOnCurrentQueue - /// Initial values are immediately fetched, and asynchronously notified. + /// Initial value is immediately fetched, and asynchronously notified. case deferred } -/// TODO +/// TODO: doc +/// TODO: refresh region after each fetch public struct ValueObservation { - /// A closure that is evaluated when the observation startst, and returns + /// A closure that is evaluated when the observation starts, and returns /// the observed database region. var observedRegion: (Database) throws -> DatabaseRegion - /// A closure that fetches fresh results whenever the database changes. - var read: (Database) throws -> Value + /// A closure that fetches a value from the database. It is called upon + /// each database change, and also when the observatioin starts, depending + /// on the *initialDispatch* property. + /// + /// When this closure needs to write in the database, set the *readonly* + /// flag to false. + var fetch: (Database) throws -> Value + + /// Default is true. Set this property to false when the *fetch* closure + /// requires write access, and should be executed inside a savepoint. + var readonly: Bool = true /// The extent of the database observation. The default is /// `.observerLifetime`: once started, the observation lasts until the @@ -36,22 +46,22 @@ public struct ValueObservation { /// The dispatch queue where change callbacks are called. Default is the /// main queue. /// - /// Note that when *initialDispatch* is `.immediateOnCurrentQueue`, the - /// first values are dispatched on the dispatch queue which starts the - /// observation, regardless of this property. + /// When *initialDispatch* is `.immediateOnCurrentQueue`, the first value is + /// dispatched on the dispatch queue which starts the observation, + /// regardless of this property. public var queue = DispatchQueue.main - /// `initialDispatch` controls how initial values are dispatched when + /// `initialDispatch` controls how initial value is dispatched when /// observation starts with the `add(observation:)` method: /// - /// - When `.immediateOnCurrentQueue` (the default), initial values are + /// - When `.immediateOnCurrentQueue` (the default), initial value is /// fetched right away, and notified synchronously, on the dispatch queue /// which starts the observation. /// - /// - When `.deferred`, initial values are fetched right away, and + /// - When `.deferred`, initial value is fetched right away, and /// notified asynchronously, on *queue*. /// - /// - When `.none`, initial values are not fetched and not notified. + /// - When `.none`, initial value is not fetched, and not notified. public var initialDispatch = InitialDispatch.immediateOnCurrentQueue /// Creates a ValueObservation which observes *region*, and notifies the @@ -62,31 +72,31 @@ public struct ValueObservation { /// /// let observation = ValueObservation( /// observing: { db in try Player.all().databaseRegion(db) }, - /// read: { db in try Player.fetchAll(db) }) + /// fetch: { db in try Player.fetchAll(db) }) /// /// let observer = dbQueue.add(observation: observation) { player: [Player] in /// print("players have changed") /// } - /// // prints "players have changed" /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, fresh values are + /// - When started with the `add(observation:)` method, a fresh value is /// immediately notified on the dispatch queue which starts the observation. - /// - When database eventually changes, fresh values are notified on the + /// - Upon subsequent database changes, fresh values are notified on the /// main queue. - /// - The observation lasts until the returned observer is deallocated. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. /// /// See ValueObservation for more information. /// /// - parameter region: a closure that returns the observed region. - /// - parameter read: a closure that fetches fresh results. + /// - parameter fetch: a closure that fetches a value. public init( observing region: @escaping (Database) throws -> DatabaseRegion, - read: @escaping (Database) throws -> Value) + fetch: @escaping (Database) throws -> Value) { self.observedRegion = region - self.read = read + self.fetch = fetch } } @@ -94,35 +104,35 @@ public struct ValueObservation { extension ValueObservation { /// Creates a ValueObservation which observes *regions*, and notifies the - /// values returned by the *read* closure whenever one of the observed + /// values returned by the *fetch* closure whenever one of the observed /// regions is impacted by a database transaction. /// /// For example: /// /// let observation = ValueObservation( /// observing: Player.all(), - /// read: { db in return try Player.fetchAll(db) }) + /// fetch: { db in return try Player.fetchAll(db) }) /// /// let observer = dbQueue.add(observation: observation) { player: [Player] in /// print("players have changed") /// } - /// // prints "players have changed" /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, fresh values are + /// - When started with the `add(observation:)` method, a fresh value is /// immediately notified on the dispatch queue which starts the observation. - /// - When database eventually changes, fresh values are notified on the + /// - Upon subsequent database changes, fresh values are notified on the /// main queue. - /// - The observation lasts until the returned observer is deallocated. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. /// /// See ValueObservation for more information. /// /// - parameter regions: one or more observed requests. - /// - parameter read: a closure that fetches fresh results. + /// - parameter fetch: a closure that fetches a value. public init( observing regions: DatabaseRegionConvertible..., - read: @escaping (Database) throws -> Value) + fetch: @escaping (Database) throws -> Value) { func region(_ db: Database) throws -> DatabaseRegion { return try regions.reduce(into: DatabaseRegion()) { union, region in @@ -130,398 +140,380 @@ extension ValueObservation { } } - self.init(observing: region, read: read) + self.init(observing: region, fetch: fetch) } } // MARK: - FetchRequest Observation -extension ValueObservation where Value == Int { - /// Creates a ValueObservation which observes *request*, and notifies the - /// number of fetched values whenever the request is impacted by a - /// database transaction. +extension ValueObservation where Value == Void { + /// Creates a ValueObservation which observes *request*, and notifies a + /// fresh count whenever the request is impacted by a database transaction. /// /// For example: /// /// let request = Player.all() - /// let observation = ValueObservation(count: request) + /// let observation = ValueObservation.forCount(request) /// /// let observer = dbQueue.add(observation: observation) { count: Int in /// print("number of players has changed") /// } - /// // prints "number of players has changed" /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, fresh values are + /// - When started with the `add(observation:)` method, a fresh value is /// immediately notified on the dispatch queue which starts the observation. - /// - When database eventually changes, fresh values are notified on the + /// - Upon subsequent database changes, fresh values are notified on the /// main queue. - /// - The observation lasts until the returned observer is deallocated. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. /// /// See ValueObservation for more information. /// /// - parameter request: the observed request. - /// - returns: a new ValueObservation. - init(count request: Request) { - self.init(observing: request, read: { try request.fetchCount($0) }) - } -} - -extension FetchRequest { - /// Creates a ValueObservation which observes *self*, and notifies the - /// number of fetched values whenever the request is impacted by a - /// database transaction. - /// - /// For example: - /// - /// let request = Player.all() - /// let observation = request.observeCount() - /// - /// let observer = dbQueue.add(observation: observation) { count: Int in - /// print("number of players has changed") - /// } - /// // prints "number of players has changed" - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `add(observation:)` method, fresh values are - /// immediately notified on the dispatch queue which starts the observation. - /// - When database eventually changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the returned observer is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a new ValueObservation. - func observeCount() -> ValueObservation { - return ValueObservation(observing: self, read: { try self.fetchCount($0) }) + /// - returns: a ValueObservation. + static func forCount(_ request: Request) -> ValueObservation { + return ValueObservation( + observing: request.databaseRegion, + fetch: request.fetchCount) } } // MARK: - Row Observation -extension ValueObservation where Value == [Row] { - /// Creates a ValueObservation which observes *request*, and notifies the - /// fetched rows whenever the request is impacted by a database transaction. +extension ValueObservation where Value == Void { + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh rows whenever the request is impacted by a database transaction. /// /// For example: /// /// let request = SQLRequest("SELECT * FROM player") - /// let observation = ValueObservation(all: request) + /// let observation = ValueObservation.forAll(request) /// /// let observer = dbQueue.add(observation: observation) { rows: [Row] in /// print("players have changed") /// } - /// // prints "players have changed" /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, fresh values are + /// - When started with the `add(observation:)` method, a fresh value is /// immediately notified on the dispatch queue which starts the observation. - /// - When database eventually changes, fresh values are notified on the + /// - Upon subsequent database changes, fresh values are notified on the /// main queue. - /// - The observation lasts until the returned observer is deallocated. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. /// /// See ValueObservation for more information. /// /// - parameter request: the observed request. - /// - returns: a new ValueObservation. - init(all request: Request) where Request.RowDecoder == Row { - self.init(observing: request, read: { try request.fetchAll($0) }) + /// - returns: a ValueObservation. + static func forAll(_ request: Request) -> ValueObservation<[Row]> where Request.RowDecoder == Row { + return ValueObservation<[Row]>( + observing: request.databaseRegion, + fetch: request.fetchAll) } -} -extension ValueObservation where Value == Row? { - /// Creates a ValueObservation which observes *request*, and notifies the - /// fetched rows whenever the request is impacted by a database transaction. + /// Creates a ValueObservation which observes *request*, and notifies a + /// fresh row whenever the request is impacted by a database transaction. /// /// For example: /// /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) - /// let observation = ValueObservation(one: request) + /// let observation = ValueObservation.forOne(request) /// /// let observer = dbQueue.add(observation: observation) { row: Row? in /// print("players have changed") /// } - /// // prints "players have changed" /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, fresh values are + /// - When started with the `add(observation:)` method, a fresh value is /// immediately notified on the dispatch queue which starts the observation. - /// - When database eventually changes, fresh values are notified on the + /// - Upon subsequent database changes, fresh values are notified on the /// main queue. - /// - The observation lasts until the returned observer is deallocated. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. /// /// See ValueObservation for more information. /// /// - parameter request: the observed request. /// - returns: a new ValueObservation. - init(one request: Request) where Request.RowDecoder == Row { - self.init(observing: request, read: { try request.fetchOne($0) }) - } -} - -extension FetchRequest where RowDecoder == Row { - /// Creates a ValueObservation which observes *self*, and notifies the - /// fetched rows whenever the request is impacted by a database transaction. - /// - /// For example: - /// - /// let request = SQLRequest("SELECT * FROM player") - /// let observation = request.observeAll() - /// - /// let observer = dbQueue.add(observation: observation) { rows: [Row] in - /// print("players have changed") - /// } - /// // prints "players have changed" - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `add(observation:)` method, fresh values are - /// immediately notified on the dispatch queue which starts the observation. - /// - When database eventually changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the returned observer is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a new ValueObservation. - func observeAll() -> ValueObservation<[Row]> { - return ValueObservation(observing: self, read: { try self.fetchAll($0) }) - } - - /// Creates a ValueObservation which observes *self*, and notifies the - /// fetched row whenever the request is impacted by a database transaction. - /// - /// For example: - /// - /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) - /// let observation = request.observeOne() - /// - /// let observer = dbQueue.add(observation: observation) { row: Row? in - /// print("player has changed") - /// } - /// // prints "player has changed" - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `add(observation:)` method, fresh values are - /// immediately notified on the dispatch queue which starts the observation. - /// - When database eventually changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the returned observer is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a new ValueObservation. - func observeOne() -> ValueObservation { - return ValueObservation(observing: self, read: { try self.fetchOne($0) }) + static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder == Row { + return ValueObservation( + observing: request.databaseRegion, + fetch: request.fetchOne) } } // MARK: - FetchableRecord Observation -extension DatabaseWriter { - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. +extension ValueObservation where Value == Void { + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh records whenever the request is impacted by a + /// database transaction. /// /// For example: /// - /// let observer = try dbQueue.observeAll( - /// from: Player.all(), - /// onChange: { players: [Player] in - /// print("players have changed: \(players)") - /// }) + /// let request = Player.all() + /// let observation = ValueObservation.forAll(request) /// - /// - parameters: - /// - request: The request to observe. - /// - onChange: called with fresh results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeAll( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping ([Request.RowDecoder]) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder: FetchableRecord - { - var observation = ValueObservation( - observing: { try request.databaseRegion($0) }, - read: { try request.fetchAll($0) }) - observation.extent = extent - observation.queue = queue - observation.initialDispatch = initialDispatch - return try add(observation: observation, onError: onError, onChange: onChange) + /// let observer = dbQueue.add(observation: observation) { players: [Player] in + /// print("players have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: FetchableRecord { + return ValueObservation<[Request.RowDecoder]>( + observing: request.databaseRegion, + fetch: request.fetchAll) } - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. + /// Creates a ValueObservation which observes *request*, and notifies a + /// fresh record whenever the request is impacted by a database transaction. /// /// For example: /// - /// let observer = try dbQueue.observeOne( - /// from: Player.filter(key: 1), - /// onChange: { player: Player? in - /// print("player has changed: \(player)") - /// }) + /// let request = Player.filter(key: 1) + /// let observation = ValueObservation.forOne(request) /// - /// - parameters: - /// - request: The request to observe. - /// - onChange: called with fresh results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeOne( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping (Request.RowDecoder?) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder: FetchableRecord - { - var observation = ValueObservation( - observing: { try request.databaseRegion($0) }, - read: { try request.fetchOne($0) }) - observation.extent = extent - observation.queue = queue - observation.initialDispatch = initialDispatch - return try add(observation: observation, onError: onError, onChange: onChange) + /// let observer = dbQueue.add(observation: observation) { player: Player? in + /// print("player has changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: FetchableRecord { + return ValueObservation( + observing: request.databaseRegion, + fetch: request.fetchOne) } } // MARK: - DatabaseValueConvertible Observation -extension DatabaseWriter { - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. +extension ValueObservation where Value == Void { + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh values whenever the request is impacted by a + /// database transaction. /// /// For example: /// /// let request = Player.select(Column("name"), as: String.self) - /// let observer = try dbQueue.observeAll( - /// from: request, - /// onChange: { names: [String] in - /// print("player names have changed: \(names)") - /// }) + /// let observation = ValueObservation.forAll(request) /// - /// - parameters: - /// - request: The request to observe. - /// - onChange: called with fresh results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeAll( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping ([Request.RowDecoder]) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder: DatabaseValueConvertible - { - var observation = ValueObservation( - observing: { try request.databaseRegion($0) }, - read: { try request.fetchAll($0) }) - observation.extent = extent - observation.queue = queue - observation.initialDispatch = initialDispatch - return try add(observation: observation, onError: onError, onChange: onChange) + /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// print("player name have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: DatabaseValueConvertible { + return ValueObservation<[Request.RowDecoder]>( + observing: request.databaseRegion, + fetch: request.fetchAll) } - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. + /// Creates a ValueObservation which observes *request*, and notifies a + /// fresh value whenever the request is impacted by a database transaction. /// /// For example: /// - /// let request = Player - /// .filter(key: 1) - /// .select(Column("name"), as: String.self) - /// let observer = try dbQueue.observeOne( - /// from: request, - /// onChange: { name: String? in - /// print("player's name has changed: \(name)") - /// }) + /// let request = Player.select(max(Column("score")), as: Int.self) + /// let observation = ValueObservation.forOne(request) /// - /// - parameters: - /// - request: The request to observe. - /// - onChange: called with fresh results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeOne( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping (Request.RowDecoder?) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder: DatabaseValueConvertible - { - var observation = ValueObservation( - observing: { try request.databaseRegion($0) }, - read: { try request.fetchOne($0) }) - observation.extent = extent - observation.queue = queue - observation.initialDispatch = initialDispatch - return try add(observation: observation, onError: onError, onChange: onChange) + /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in + /// print("maximum score has changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: DatabaseValueConvertible { + return ValueObservation( + observing: request.databaseRegion, + fetch: request.fetchOne) + } +} + +// MARK: - DatabaseValueConvertible & StatementColumnConvertible Observation + +extension ValueObservation where Value == Void { + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh values whenever the request is impacted by a + /// database transaction. + /// + /// For example: + /// + /// let request = Player.select(Column("name"), as: String.self) + /// let observation = ValueObservation.forAll(request) + /// + /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// print("player name have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { + return ValueObservation<[Request.RowDecoder]>( + observing: request.databaseRegion, + fetch: request.fetchAll) + } + + /// Creates a ValueObservation which observes *request*, and notifies a + /// fresh value whenever the request is impacted by a database transaction. + /// + /// For example: + /// + /// let request = Player.select(max(Column("score")), as: Int.self) + /// let observation = ValueObservation.forOne(request) + /// + /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in + /// print("maximum score has changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { + return ValueObservation( + observing: request.databaseRegion, + fetch: request.fetchOne) } } // MARK: - Optional DatabaseValueConvertible Observation -extension DatabaseWriter { - /// Observe *request*: calls a closure with fresh results each time the - /// database has been modified. - /// - /// Database observation lasts until the returned observer is deallocated. +extension ValueObservation where Value == Void { + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh values whenever the request is impacted by a + /// database transaction. /// /// For example: /// - /// let request = Player.select(Column("email"), as: Optional.self) - /// let observer = try dbQueue.observeAll( - /// from: request, - /// onChange: { emails: [String?] in - /// print("player emails have changed: \(names)") - /// }) + /// let request = Player.select(Column("name"), as: String.self) + /// let observation = ValueObservation.forAll(request) /// - /// - parameters: - /// - request: The request to observe. - /// - onChange: called with fresh results. - /// - returns: A new `TransactionObserver` - /// - throws: A DatabaseError whenever an SQLite error occurs. - public func observeAll( - from request: Request, - extent: Database.TransactionObservationExtent = .observerLifetime, - queue: DispatchQueue = DispatchQueue.main, - initialDispatch: InitialDispatch = .immediateOnCurrentQueue, - onError: ((Error) -> Void)? = nil, - onChange: @escaping ([Request.RowDecoder._Wrapped?]) -> Void) - throws -> TransactionObserver - where Request: FetchRequest, Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible - { - var observation = ValueObservation( - observing: { try request.databaseRegion($0) }, - read: { try request.fetchAll($0) }) - observation.extent = extent - observation.queue = queue - observation.initialDispatch = initialDispatch - return try add(observation: observation, onError: onError, onChange: onChange) + /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// print("player name have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder._Wrapped?]> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible { + return ValueObservation<[Request.RowDecoder._Wrapped?]>( + observing: request.databaseRegion, + fetch: request.fetchAll) + } +} + +// MARK: - Optional DatabaseValueConvertible & StatementColumnConvertible Observation + +extension ValueObservation where Value == Void { + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh values whenever the request is impacted by a + /// database transaction. + /// + /// For example: + /// + /// let request = Player.select(Column("name"), as: String.self) + /// let observation = ValueObservation.forAll(request) + /// + /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// print("player name have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder._Wrapped?]> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible { + return ValueObservation<[Request.RowDecoder._Wrapped?]>( + observing: request.databaseRegion, + fetch: request.fetchAll) } } From 9c71356e3d8849867a194f9652aca7d3cdb2614c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 26 Oct 2018 09:10:26 +0200 Subject: [PATCH 008/109] Honor ValueObservation.readonly --- GRDB/Core/DatabaseWriter.swift | 43 +++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 6523169f3..a72816c9e 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -232,7 +232,7 @@ extension DatabaseWriter { /// The database transaction observer, support for ValueObservation. private class ValueObserver: TransactionObserver { private let region: DatabaseRegion - private let future: () -> Future + private let future: (Database) -> Future private let queue: DispatchQueue private let onChange: (Value) -> Void private let onError: ((Error) -> Void)? @@ -241,7 +241,7 @@ private class ValueObserver: TransactionObserver { init( region: DatabaseRegion, - future: @escaping () -> Future, + future: @escaping (Database) -> Future, queue: DispatchQueue, onError: ((Error) -> Void)?, onChange: @escaping (Value) -> Void) @@ -272,7 +272,7 @@ private class ValueObserver: TransactionObserver { changed = false // Fetch future value now, from the database writer queue - let futureValue = future() + let futureValue = future(db) // Wait for future value in notificationQueue, in order to guarantee // that notifications have the same ordering as transactions. @@ -320,19 +320,46 @@ extension DatabaseWriter { // We use an unsafe reentrant method so that this initializer can be // called from a database queue. return try unsafeReentrantWrite { db in - // Start observing the database (take care of future transactions - // that change the observed region). + // Setup how future values are fetched, right after a change has + // been detected. // - // Observation stops when transactionObserver is deallocated, - // which happens when self is deallocated. + // The fetching technique depends on the observation.readonly flag: + let future: (Database) -> Future + if observation.readonly { + // Perform a concurrent read. This allows observations not to + // block writes in a DatabasePool longer than necessary. + future = { [unowned self] _ in + self.concurrentRead { try observation.fetch($0) } + } + } else { + // Fetching results require write access: fetch right after the + // impactful transaction has been committed. + future = { db in + assert(!db.configuration.readonly) + let result = Result { + var value: Value! + try db.inSavepoint { + value = try observation.fetch(db) + return .commit + } + return value + } + return Future { + try result.unwrap() + } + } + } + + // Start observing the database let transactionObserver = try ValueObserver( region: observation.observedRegion(db), - future: { [unowned self] in self.concurrentRead { try observation.fetch($0) } }, + future: future, queue: observation.queue, onError: onError, onChange: onChange) db.add(transactionObserver: transactionObserver, extent: observation.extent) + // Deal with initial value switch observation.initialDispatch { case .none: break From 08b103f5f55eb3fb5c5b1fe1137996ecc17645e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 26 Oct 2018 16:42:14 +0200 Subject: [PATCH 009/109] DatabaseReader and DatabaseWriter are no longer available for user types - stop testing compatibility with user types - document that they are no longer available for user types (readme, changelog) --- CHANGELOG.md | 7 +++++ README.md | 20 ++++++++++++- .../GRDBTests/CompilationProtocolTests.swift | 29 ------------------- 3 files changed, 26 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce202e6de..9ea5718c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Release Notes ============= +## Next Version + +### Breaking Changes + +- The DatabaseReader and DatabaseWriter protocols have changed in a way that is compatible with your current code, except with your eventual custom types that implement those protocols. Only five types provided by GRDB adopt those propocols: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. Expanding this set is no longer supported. + + ## 3.4.0 Released October 8, 2018 • [diff](https://github.com/groue/GRDB.swift/compare/v3.3.1...v3.4.0) diff --git a/README.md b/README.md index bce0a6206..b1c6ad953 100644 --- a/README.md +++ b/README.md @@ -7362,7 +7362,25 @@ These protocols provide a unified API that let you write generic code that targe - [FetchedRecordsController](#fetchedrecordscontroller) - [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) -Caution: DatabaseReader and DatabaseWriter only provide the *smallest* common guarantees. They don't erase the differences between queues, pools, and snapshots. See for example [Differences between Database Queues and Pools](#differences-between-database-queues-and-pools). +Only five types adopt those protocols: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. Expanding this set is not supported: any future GRDB release may break your custom writers and readers, without notice. + +DatabaseReader and DatabaseWriter provide the *smallest* common guarantees: they don't erase the differences between queues, pools, and snapshots. See for example [Differences between Database Queues and Pools](#differences-between-database-queues-and-pools). + +However, you can easily prevent some parts of your application from writing in the database by giving them a DatabaseReader: + +```swift +// This class can read in the database, but can't write into it. +class MyReadOnlyComponent { + let reader: DatabaseReader + + init(reader: DatabaseReader) { + self.reader = reader + } +} + +let dbQueue: DatabaseQueue = ... +let component = MyReadOnlyComponent(reader: dbQueue) +``` ### Unsafe Concurrency APIs diff --git a/Tests/GRDBTests/CompilationProtocolTests.swift b/Tests/GRDBTests/CompilationProtocolTests.swift index 109d65759..f92531a46 100644 --- a/Tests/GRDBTests/CompilationProtocolTests.swift +++ b/Tests/GRDBTests/CompilationProtocolTests.swift @@ -42,18 +42,6 @@ private class UserDatabaseAggregate2 : DatabaseAggregate { func finalize() throws -> DatabaseValueConvertible? { preconditionFailure() } } -// MARK: - DatabaseReader - -private class UserDatabaseReader : DatabaseReader { - func read(_ block: (Database) throws -> T) throws -> T { preconditionFailure() } - func unsafeRead(_ block: (Database) throws -> T) throws -> T { preconditionFailure() } - func unsafeReentrantRead(_ block: (Database) throws -> T) throws -> T { preconditionFailure() } - func add(function: DatabaseFunction) { } - func remove(function: DatabaseFunction) { } - func add(collation: DatabaseCollation) { } - func remove(collation: DatabaseCollation) { } -} - // MARK: - DatabaseValueConvertible private struct UserDatabaseValueConvertible1 : DatabaseValueConvertible { @@ -66,23 +54,6 @@ private class UserDatabaseValueConvertible2 : DatabaseValueConvertible { static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Self? { preconditionFailure() } } -// MARK: - DatabaseWriter - -private class UserDatabaseWriter : DatabaseWriter { - func read(_ block: (Database) throws -> T) throws -> T { preconditionFailure() } - func unsafeRead(_ block: (Database) throws -> T) throws -> T { preconditionFailure() } - func unsafeReentrantRead(_ block: (Database) throws -> T) throws -> T { preconditionFailure() } - func add(function: DatabaseFunction) { } - func remove(function: DatabaseFunction) { } - func add(collation: DatabaseCollation) { } - func remove(collation: DatabaseCollation) { } - func write(_ block: (Database) throws -> T) rethrows -> T { preconditionFailure() } - func writeWithoutTransaction(_ block: (Database) throws -> T) rethrows -> T { preconditionFailure() } - func unsafeReentrantWrite(_ block: (Database) throws -> T) rethrows -> T { preconditionFailure() } - func readFromCurrentState(_ block: @escaping (Database) -> Void) throws { preconditionFailure() } - func concurrentRead(_ block: @escaping (Database) throws -> T) -> Future { preconditionFailure() } -} - // MARK: - FTS5Tokenizer #if SQLITE_ENABLE_FTS5 From abe6957c852e6671644469f74a83920ae67cf97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 26 Oct 2018 16:42:27 +0200 Subject: [PATCH 010/109] Typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ea5718c9..4a191bc04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Release Notes ### Breaking Changes -- The DatabaseReader and DatabaseWriter protocols have changed in a way that is compatible with your current code, except with your eventual custom types that implement those protocols. Only five types provided by GRDB adopt those propocols: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. Expanding this set is no longer supported. +- The DatabaseReader and DatabaseWriter protocols have changed in a way that is compatible with your current code, except with your eventual custom types that implement those protocols. Only five types provided by GRDB adopt those protocols: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. Expanding this set is no longer supported. ## 3.4.0 From 69853d79011c1c01bb18d61caeced9712f096cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 26 Oct 2018 16:53:30 +0200 Subject: [PATCH 011/109] Now that user implementations of DatabaseWriter are no longer supported... ...stop pretending we have to implement concurrentRead on top of the deprecated readFromCurrentState. And this fixes #419 :-) --- GRDB/Core/DatabaseWriter.swift | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index a72816c9e..3e0ac78bd 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -187,37 +187,6 @@ extension DatabaseWriter { #endif } - // MARK: - Reading from Database - - /// Default implementation, based on the deprecated readFromCurrentState. - /// - /// :nodoc: - public func concurrentRead(_ block: @escaping (Database) throws -> T) -> Future { - let semaphore = DispatchSemaphore(value: 0) - var result: Result? = nil - - do { - try readFromCurrentState { db in - result = Result { try block(db) } - semaphore.signal() - } - } catch { - result = .failure(error) - semaphore.signal() - } - - return Future { - _ = semaphore.wait(timeout: .distantFuture) - - switch result! { - case .failure(let error): - throw error - case .success(let result): - return result - } - } - } - // MARK: - Claiming Disk Space /// Rebuilds the database file, repacking it into a minimal amount of From f694437f5b7a2ab6b1eb9f65d687e18080b27b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 27 Oct 2018 04:23:45 +0200 Subject: [PATCH 012/109] Add missing public qualifiers --- GRDB/Core/ValueObservation.swift | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 7dc0086a2..2f1ae9103 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -172,7 +172,7 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - static func forCount(_ request: Request) -> ValueObservation { + public static func forCount(_ request: Request) -> ValueObservation { return ValueObservation( observing: request.databaseRegion, fetch: request.fetchCount) @@ -207,7 +207,7 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - static func forAll(_ request: Request) -> ValueObservation<[Row]> where Request.RowDecoder == Row { + public static func forAll(_ request: Request) -> ValueObservation<[Row]> where Request.RowDecoder == Row { return ValueObservation<[Row]>( observing: request.databaseRegion, fetch: request.fetchAll) @@ -238,7 +238,7 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a new ValueObservation. - static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder == Row { + public static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder == Row { return ValueObservation( observing: request.databaseRegion, fetch: request.fetchOne) @@ -274,7 +274,7 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: FetchableRecord { + public static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: FetchableRecord { return ValueObservation<[Request.RowDecoder]>( observing: request.databaseRegion, fetch: request.fetchAll) @@ -305,7 +305,7 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: FetchableRecord { + public static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: FetchableRecord { return ValueObservation( observing: request.databaseRegion, fetch: request.fetchOne) @@ -341,7 +341,7 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: DatabaseValueConvertible { + public static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: DatabaseValueConvertible { return ValueObservation<[Request.RowDecoder]>( observing: request.databaseRegion, fetch: request.fetchAll) @@ -372,7 +372,7 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: DatabaseValueConvertible { + public static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: DatabaseValueConvertible { return ValueObservation( observing: request.databaseRegion, fetch: request.fetchOne) @@ -408,7 +408,7 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { + public static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { return ValueObservation<[Request.RowDecoder]>( observing: request.databaseRegion, fetch: request.fetchAll) @@ -439,7 +439,7 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { + public static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { return ValueObservation( observing: request.databaseRegion, fetch: request.fetchOne) @@ -475,7 +475,7 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder._Wrapped?]> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible { + public static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder._Wrapped?]> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible { return ValueObservation<[Request.RowDecoder._Wrapped?]>( observing: request.databaseRegion, fetch: request.fetchAll) @@ -511,7 +511,7 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder._Wrapped?]> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible { + public static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder._Wrapped?]> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible { return ValueObservation<[Request.RowDecoder._Wrapped?]>( observing: request.databaseRegion, fetch: request.fetchAll) From 31b688d8014467dca1efa315ceb7624aa6487378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 27 Oct 2018 04:24:17 +0200 Subject: [PATCH 013/109] ValueObservationn has a QoS --- GRDB/Core/ValueObservation.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 2f1ae9103..1e669fa6d 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -6,6 +6,8 @@ // Copyright © 2018 Gwendal Roué. All rights reserved. // +import Dispatch + /// InitialDispatch controls how initial value is dispatched when one starts /// observing the database. See ValueObservation. public enum InitialDispatch { @@ -51,6 +53,9 @@ public struct ValueObservation { /// regardless of this property. public var queue = DispatchQueue.main + /// The quality of service. + public var qos: DispatchQoS + /// `initialDispatch` controls how initial value is dispatched when /// observation starts with the `add(observation:)` method: /// @@ -97,6 +102,11 @@ public struct ValueObservation { { self.observedRegion = region self.fetch = fetch + if #available(OSXApplicationExtension 10.10, *) { + self.qos = .default + } else { + self.qos = .unspecified + } } } From ff4f6f3b12d5301bceb6b8003b38c7b7e2793e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 27 Oct 2018 04:59:24 +0200 Subject: [PATCH 014/109] Cleanup --- GRDB/Core/DatabaseQueue.swift | 9 +- GRDB/Core/DatabaseReader.swift | 6 +- GRDB/Core/DatabaseSnapshot.swift | 3 +- GRDB/Core/DatabaseWriter.swift | 196 ++++++++++++++++--------------- 4 files changed, 109 insertions(+), 105 deletions(-) diff --git a/GRDB/Core/DatabaseQueue.swift b/GRDB/Core/DatabaseQueue.swift index 06148a0ba..0814bb11c 100644 --- a/GRDB/Core/DatabaseQueue.swift +++ b/GRDB/Core/DatabaseQueue.swift @@ -225,7 +225,8 @@ extension DatabaseQueue { public func concurrentRead(_ block: @escaping (Database) throws -> T) -> Future { // DatabaseQueue can't perform parallel reads. - let result = Result { + // Perform a blocking read instead. + return Future(Result { // Check that we're on the writer queue... try writer.execute { db in // ... and that no transaction is opened. @@ -234,10 +235,7 @@ extension DatabaseQueue { try block(db) } } - } - return Future { - try result.unwrap() - } + }) } // MARK: - Writing in Database @@ -387,4 +385,3 @@ extension DatabaseQueue { writer.sync { $0.remove(collation: collation) } } } - diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index 42c2c90e8..47bbb4d65 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -156,7 +156,8 @@ public protocol DatabaseReader : class { func add( observation: ValueObservation, onError: ((Error) -> Void)?, - onChange: @escaping (Value) -> Void) throws -> TransactionObserver + onChange: @escaping (Value) -> Void) + throws -> TransactionObserver } extension DatabaseReader { @@ -243,7 +244,8 @@ public final class AnyDatabaseReader : DatabaseReader { public func add( observation: ValueObservation, onError: ((Error) -> Void)? = nil, - onChange: @escaping (Value) -> Void) throws -> TransactionObserver + onChange: @escaping (Value) -> Void) + throws -> TransactionObserver { return try base.add(observation: observation, onError: onError, onChange: onChange) } diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index f09023838..070dcc4d1 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -104,7 +104,8 @@ extension DatabaseSnapshot { public func add( observation: ValueObservation, onError: ((Error) -> Void)? = nil, - onChange: @escaping (Value) -> Void) throws -> TransactionObserver + onChange: @escaping (Value) -> Void) + throws -> TransactionObserver { // Deal with initial value switch observation.initialDispatch { diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 3e0ac78bd..3adcfd757 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -196,79 +196,9 @@ extension DatabaseWriter { public func vacuum() throws { try writeWithoutTransaction { try $0.execute("VACUUM") } } -} - -/// The database transaction observer, support for ValueObservation. -private class ValueObserver: TransactionObserver { - private let region: DatabaseRegion - private let future: (Database) -> Future - private let queue: DispatchQueue - private let onChange: (Value) -> Void - private let onError: ((Error) -> Void)? - private let notificationQueue = DispatchQueue(label: "ValueObserver") - private var changed = false - init( - region: DatabaseRegion, - future: @escaping (Database) -> Future, - queue: DispatchQueue, - onError: ((Error) -> Void)?, - onChange: @escaping (Value) -> Void) - { - self.region = region - self.future = future - self.queue = queue - self.onChange = onChange - self.onError = onError - } + // MARK: - Value Observation - func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { - return region.isModified(byEventsOfKind: eventKind) - } - - func databaseDidChange(with event: DatabaseEvent) { - if region.isModified(by: event) { - changed = true - stopObservingDatabaseChangesUntilNextTransaction() - } - } - - func databaseDidCommit(_ db: Database) { - guard changed else { - return - } - - changed = false - - // Fetch future value now, from the database writer queue - let futureValue = future(db) - - // Wait for future value in notificationQueue, in order to guarantee - // that notifications have the same ordering as transactions. - notificationQueue.async { [weak self] in - guard let strongSelf = self else { return } - - do { - let value = try futureValue.wait() - strongSelf.queue.async { - guard let strongSelf = self else { return } - strongSelf.onChange(value) - } - } catch { - strongSelf.queue.async { - guard let strongSelf = self else { return } - strongSelf.onError?(error) - } - } - } - } - - func databaseDidRollback(_ db: Database) { - changed = false - } -} - -extension DatabaseWriter { public func add( observation: ValueObservation, onError: ((Error) -> Void)? = nil, @@ -289,40 +219,26 @@ extension DatabaseWriter { // We use an unsafe reentrant method so that this initializer can be // called from a database queue. return try unsafeReentrantWrite { db in - // Setup how future values are fetched, right after a change has - // been detected. - // - // The fetching technique depends on the observation.readonly flag: - let future: (Database) -> Future + // The technique to fetch a fresh value after database has changed + // depends on the observation.readonly flag: + let futureValue: (Database) -> Future if observation.readonly { - // Perform a concurrent read. This allows observations not to - // block writes in a DatabasePool longer than necessary. - future = { [unowned self] _ in - self.concurrentRead { try observation.fetch($0) } + // Concurrent read so that we don't block the writer queue + futureValue = { [unowned self] _ in + self.concurrentRead { db in try observation.fetch(db) } } } else { - // Fetching results require write access: fetch right after the - // impactful transaction has been committed. - future = { db in - assert(!db.configuration.readonly) - let result = Result { - var value: Value! - try db.inSavepoint { - value = try observation.fetch(db) - return .commit - } - return value - } - return Future { - try result.unwrap() - } + // Synchronous fetch from the writer queue + futureValue = { db in + Future(Result { try observation.fetch(db) }) } } // Start observing the database let transactionObserver = try ValueObserver( + qos: observation.qos, region: observation.observedRegion(db), - future: future, + futureValue: futureValue, queue: observation.queue, onError: onError, onChange: onChange) @@ -350,6 +266,79 @@ extension DatabaseWriter { } } +/// Support for ValueObservation. +/// See DatabaseWriter.add(observation:onError:onChange:) +private class ValueObserver: TransactionObserver { + private let region: DatabaseRegion + private let futureValue: (Database) -> Future + private let queue: DispatchQueue + private let onChange: (Value) -> Void + private let onError: ((Error) -> Void)? + private let notificationQueue: DispatchQueue + private var changed = false + + init( + qos: DispatchQoS, + region: DatabaseRegion, + futureValue: @escaping (Database) -> Future, + queue: DispatchQueue, + onError: ((Error) -> Void)?, + onChange: @escaping (Value) -> Void) + { + self.region = region + self.futureValue = futureValue + self.queue = queue + self.onChange = onChange + self.onError = onError + self.notificationQueue = DispatchQueue(label: "GRDB.ValueObservation", qos: qos) + } + + func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { + return region.isModified(byEventsOfKind: eventKind) + } + + func databaseDidChange(with event: DatabaseEvent) { + if region.isModified(by: event) { + changed = true + stopObservingDatabaseChangesUntilNextTransaction() + } + } + + func databaseDidCommit(_ db: Database) { + guard changed else { + return + } + + changed = false + + // Fetch future value from the database writer queue + let futureValue = self.futureValue(db) + + // Wait for future value in notificationQueue, in order to guarantee + // that notifications have the same ordering as transactions. + notificationQueue.async { [weak self] in + guard let strongSelf = self else { return } + + do { + let value = try futureValue.wait() + strongSelf.queue.async { + guard let strongSelf = self else { return } + strongSelf.onChange(value) + } + } catch { + strongSelf.queue.async { + guard let strongSelf = self else { return } + strongSelf.onError?(error) + } + } + } + } + + func databaseDidRollback(_ db: Database) { + changed = false + } +} + /// A future value. public class Future { private var consumed = false @@ -359,6 +348,10 @@ public class Future { _wait = wait } + init(_ result: Result) { + _wait = { try result.unwrap() } + } + /// Blocks the current thread until the value is available, and returns it. /// /// It is a programmer error to call this method several times. @@ -453,4 +446,15 @@ public final class AnyDatabaseWriter : DatabaseWriter { public func remove(collation: DatabaseCollation) { base.remove(collation: collation) } + + // MARK: - Value Observation + + public func add( + observation: ValueObservation, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Value) -> Void) + throws -> TransactionObserver + { + return try base.add(observation: observation, onError: onError, onChange: onChange) + } } From 697b2af61d15d6a6c242b912c9bee388b757948b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 27 Oct 2018 05:11:19 +0200 Subject: [PATCH 015/109] Wrap long lines --- GRDB/Core/ValueObservation.swift | 56 +++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 1e669fa6d..123ec86f7 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -182,7 +182,9 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forCount(_ request: Request) -> ValueObservation { + public static func forCount(_ request: Request) + -> ValueObservation + { return ValueObservation( observing: request.databaseRegion, fetch: request.fetchCount) @@ -217,7 +219,10 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) -> ValueObservation<[Row]> where Request.RowDecoder == Row { + public static func forAll(_ request: Request) + -> ValueObservation<[Row]> + where Request.RowDecoder == Row + { return ValueObservation<[Row]>( observing: request.databaseRegion, fetch: request.fetchAll) @@ -248,7 +253,10 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a new ValueObservation. - public static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder == Row { + public static func forOne(_ request: Request) + -> ValueObservation + where Request.RowDecoder == Row + { return ValueObservation( observing: request.databaseRegion, fetch: request.fetchOne) @@ -284,7 +292,10 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: FetchableRecord { + public static func forAll(_ request: Request) + -> ValueObservation<[Request.RowDecoder]> + where Request.RowDecoder: FetchableRecord + { return ValueObservation<[Request.RowDecoder]>( observing: request.databaseRegion, fetch: request.fetchAll) @@ -315,7 +326,10 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: FetchableRecord { + public static func forOne(_ request: Request) -> + ValueObservation + where Request.RowDecoder: FetchableRecord + { return ValueObservation( observing: request.databaseRegion, fetch: request.fetchOne) @@ -351,7 +365,10 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: DatabaseValueConvertible { + public static func forAll(_ request: Request) + -> ValueObservation<[Request.RowDecoder]> + where Request.RowDecoder: DatabaseValueConvertible + { return ValueObservation<[Request.RowDecoder]>( observing: request.databaseRegion, fetch: request.fetchAll) @@ -382,7 +399,10 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: DatabaseValueConvertible { + public static func forOne(_ request: Request) + -> ValueObservation + where Request.RowDecoder: DatabaseValueConvertible + { return ValueObservation( observing: request.databaseRegion, fetch: request.fetchOne) @@ -418,7 +438,10 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder]> where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { + public static func forAll(_ request: Request) + -> ValueObservation<[Request.RowDecoder]> + where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible + { return ValueObservation<[Request.RowDecoder]>( observing: request.databaseRegion, fetch: request.fetchAll) @@ -449,7 +472,10 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forOne(_ request: Request) -> ValueObservation where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { + public static func forOne(_ request: Request) + -> ValueObservation + where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible + { return ValueObservation( observing: request.databaseRegion, fetch: request.fetchOne) @@ -485,7 +511,11 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder._Wrapped?]> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible { + public static func forAll(_ request: Request) + -> ValueObservation<[Request.RowDecoder._Wrapped?]> + where Request.RowDecoder: _OptionalProtocol, + Request.RowDecoder._Wrapped: DatabaseValueConvertible + { return ValueObservation<[Request.RowDecoder._Wrapped?]>( observing: request.databaseRegion, fetch: request.fetchAll) @@ -521,7 +551,11 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) -> ValueObservation<[Request.RowDecoder._Wrapped?]> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible { + public static func forAll(_ request: Request) + -> ValueObservation<[Request.RowDecoder._Wrapped?]> + where Request.RowDecoder: _OptionalProtocol, + Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible + { return ValueObservation<[Request.RowDecoder._Wrapped?]>( observing: request.databaseRegion, fetch: request.fetchAll) From de227bdce1bb844fbdab5b7d322f703a1cfed9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 27 Oct 2018 16:12:42 +0200 Subject: [PATCH 016/109] Bake uniquing right into ValueObservation: introduce ValueReducer --- GRDB/Core/DatabasePool.swift | 8 +- GRDB/Core/DatabaseReader.swift | 12 +- GRDB/Core/DatabaseSnapshot.swift | 22 +- GRDB/Core/DatabaseWriter.swift | 92 ++-- GRDB/Core/ValueObservation.swift | 779 ++++++++++++++++++++++--------- 5 files changed, 622 insertions(+), 291 deletions(-) diff --git a/GRDB/Core/DatabasePool.swift b/GRDB/Core/DatabasePool.swift index eb940bae1..2da9e72cc 100644 --- a/GRDB/Core/DatabasePool.swift +++ b/GRDB/Core/DatabasePool.swift @@ -575,13 +575,7 @@ extension DatabasePool : DatabaseReader { return Future { // Block the future until results are fetched _ = futureSemaphore.wait(timeout: .distantFuture) - - switch futureResult! { - case .failure(let error): - throw error - case .success(let result): - return result - } + return try futureResult!.unwrap() } } diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index 47bbb4d65..f432cda52 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -153,10 +153,10 @@ public protocol DatabaseReader : class { // MARK: - Value Observation /// TODO - func add( - observation: ValueObservation, + func add( + observation: ValueObservation, onError: ((Error) -> Void)?, - onChange: @escaping (Value) -> Void) + onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver } @@ -241,10 +241,10 @@ public final class AnyDatabaseReader : DatabaseReader { // MARK: - Value Observation /// TODO - public func add( - observation: ValueObservation, + public func add( + observation: ValueObservation, onError: ((Error) -> Void)? = nil, - onChange: @escaping (Value) -> Void) + onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver { return try base.add(observation: observation, onError: onError, onChange: onChange) diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index 070dcc4d1..c417dd667 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -101,10 +101,10 @@ extension DatabaseSnapshot { // MARK: - Value Observation - public func add( - observation: ValueObservation, + public func add( + observation: ValueObservation, onError: ((Error) -> Void)? = nil, - onChange: @escaping (Value) -> Void) + onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver { // Deal with initial value @@ -112,13 +112,19 @@ extension DatabaseSnapshot { case .none: break case .deferred: - let value = try unsafeReentrantRead { try observation.fetch($0) } - observation.queue.async { - onChange(value) + var reducer = observation.reducer + let fetchedValue = try unsafeReentrantRead(reducer.fetch) + if let value = reducer.value(fetchedValue) { + observation.queue.async { + onChange(value) + } } case .immediateOnCurrentQueue: - let value = try unsafeReentrantRead { try observation.fetch($0) } - onChange(value) + var reducer = observation.reducer + let fetchedValue = try unsafeReentrantRead(reducer.fetch) + if let value = reducer.value(fetchedValue) { + onChange(value) + } } // Return a dummy observer, because snapshots never change diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 3adcfd757..c8d49c603 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -199,14 +199,14 @@ extension DatabaseWriter { // MARK: - Value Observation - public func add( - observation: ValueObservation, + public func add( + observation: ValueObservation, onError: ((Error) -> Void)? = nil, - onChange: @escaping (Value) -> Void) + onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver { // Will be set and notified on the caller queue if initialDispatch is .immediateOnCurrentQueue - var immediateValue: Value? = nil + var immediateValue: Reducer.Value? = nil defer { if let immediateValue = immediateValue { onChange(immediateValue) @@ -219,18 +219,40 @@ extension DatabaseWriter { // We use an unsafe reentrant method so that this initializer can be // called from a database queue. return try unsafeReentrantWrite { db in + var reducer = observation.reducer + // The technique to fetch a fresh value after database has changed // depends on the observation.readonly flag: - let futureValue: (Database) -> Future + let fetch: (Database) -> Future if observation.readonly { // Concurrent read so that we don't block the writer queue - futureValue = { [unowned self] _ in - self.concurrentRead { db in try observation.fetch(db) } + fetch = { [unowned self] _ in + self.concurrentRead { db in try reducer.fetch(db) } } } else { // Synchronous fetch from the writer queue - futureValue = { db in - Future(Result { try observation.fetch(db) }) + fetch = { db in + Future(Result { try reducer.fetch(db) }) + } + } + + // Deal with initial value + switch observation.initialDispatch { + case .none: + break + case .immediateOnCurrentQueue: + let fetchedValue = try unsafeReentrantRead(reducer.fetch) + immediateValue = reducer.value(fetchedValue) + case .deferred: + // We're still on the database writer queue. Let's dispatch + // initial value right now, before any future transaction has + // any opportunity to trigger a change notification, and mess + // with the ordering of value notifications. + let fetchedValue = try unsafeReentrantRead(reducer.fetch) + if let value = reducer.value(fetchedValue) { + observation.queue.async { + onChange(value) + } } } @@ -238,29 +260,13 @@ extension DatabaseWriter { let transactionObserver = try ValueObserver( qos: observation.qos, region: observation.observedRegion(db), - futureValue: futureValue, + reducer: reducer, + fetch: fetch, queue: observation.queue, onError: onError, onChange: onChange) db.add(transactionObserver: transactionObserver, extent: observation.extent) - // Deal with initial value - switch observation.initialDispatch { - case .none: - break - case .immediateOnCurrentQueue: - immediateValue = try observation.fetch(db) - case .deferred: - // We're still on the database writer queue. Let's dispatch - // initial value right now, before any future transaction has - // any opportunity to trigger a change notification, and mess - // with the ordering of value notifications. - let initialValue = try observation.fetch(db) - observation.queue.async { - onChange(initialValue) - } - } - return transactionObserver } } @@ -268,11 +274,12 @@ extension DatabaseWriter { /// Support for ValueObservation. /// See DatabaseWriter.add(observation:onError:onChange:) -private class ValueObserver: TransactionObserver { +private class ValueObserver: TransactionObserver { private let region: DatabaseRegion - private let futureValue: (Database) -> Future + private var reducer: Reducer + private let fetch: (Database) -> Future private let queue: DispatchQueue - private let onChange: (Value) -> Void + private let onChange: (Reducer.Value) -> Void private let onError: ((Error) -> Void)? private let notificationQueue: DispatchQueue private var changed = false @@ -280,13 +287,15 @@ private class ValueObserver: TransactionObserver { init( qos: DispatchQoS, region: DatabaseRegion, - futureValue: @escaping (Database) -> Future, + reducer: Reducer, + fetch: @escaping (Database) -> Future, queue: DispatchQueue, onError: ((Error) -> Void)?, - onChange: @escaping (Value) -> Void) + onChange: @escaping (Reducer.Value) -> Void) { self.region = region - self.futureValue = futureValue + self.reducer = reducer + self.fetch = fetch self.queue = queue self.onChange = onChange self.onError = onError @@ -312,7 +321,7 @@ private class ValueObserver: TransactionObserver { changed = false // Fetch future value from the database writer queue - let futureValue = self.futureValue(db) + let fetched = self.fetch(db) // Wait for future value in notificationQueue, in order to guarantee // that notifications have the same ordering as transactions. @@ -320,10 +329,11 @@ private class ValueObserver: TransactionObserver { guard let strongSelf = self else { return } do { - let value = try futureValue.wait() - strongSelf.queue.async { - guard let strongSelf = self else { return } - strongSelf.onChange(value) + if let value = try strongSelf.reducer.value(fetched.wait()) { + strongSelf.queue.async { + guard let strongSelf = self else { return } + strongSelf.onChange(value) + } } } catch { strongSelf.queue.async { @@ -449,10 +459,10 @@ public final class AnyDatabaseWriter : DatabaseWriter { // MARK: - Value Observation - public func add( - observation: ValueObservation, + public func add( + observation: ValueObservation, onError: ((Error) -> Void)? = nil, - onChange: @escaping (Value) -> Void) + onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver { return try base.add(observation: observation, onError: onError, onChange: onChange) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 123ec86f7..2da4237cb 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -21,9 +21,17 @@ public enum InitialDispatch { case deferred } +/// TODO: doc +public protocol ValueReducer { + associatedtype Fetched + associatedtype Value + func fetch(_ db: Database) throws -> Fetched + mutating func value(_ fetched: Fetched) -> Value? +} + /// TODO: doc /// TODO: refresh region after each fetch -public struct ValueObservation { +public struct ValueObservation { /// A closure that is evaluated when the observation starts, and returns /// the observed database region. var observedRegion: (Database) throws -> DatabaseRegion @@ -34,7 +42,7 @@ public struct ValueObservation { /// /// When this closure needs to write in the database, set the *readonly* /// flag to false. - var fetch: (Database) throws -> Value + var reducer: Reducer /// Default is true. Set this property to false when the *fetch* closure /// requires write access, and should be executed inside a savepoint. @@ -98,10 +106,10 @@ public struct ValueObservation { /// - parameter fetch: a closure that fetches a value. public init( observing region: @escaping (Database) throws -> DatabaseRegion, - fetch: @escaping (Database) throws -> Value) + reducer: Reducer) { self.observedRegion = region - self.fetch = fetch + self.reducer = reducer if #available(OSXApplicationExtension 10.10, *) { self.qos = .default } else { @@ -110,17 +118,113 @@ public struct ValueObservation { } } +// MARK: - Reducers + +public enum ValueReducers { + /// TODO + public struct Raw: ValueReducer { + let _fetch: (Database) throws -> Value + + /// TODO + public init(_ fetch: @escaping (Database) throws -> Value) { + self._fetch = fetch + } + + /// :nodoc: + public func fetch(_ db: Database) throws -> Value { + return try _fetch(db) + } + + /// :nodoc: + public func value(_ fetched: Value) -> Value? { + return fetched + } + } + + public struct Unique: ValueReducer { + let _fetch: (Database) throws -> Value + var value: Value?? + + /// TODO + public init(_ fetch: @escaping (Database) throws -> Value) { + self._fetch = fetch + } + + /// :nodoc: + public func fetch(_ db: Database) throws -> Value { + return try _fetch(db) + } + + /// :nodoc: + public mutating func value(_ newValue: Value) -> Value? { + if let value = value, value == newValue { + return nil + } + self.value = newValue + return newValue + } + } + + public struct UniqueRecords: ValueReducer { + let _fetch: (Database) throws -> [Row] + var rows: [Row]? + + /// TODO + public init(_ fetch: @escaping (Database) throws -> [Row]) { + self._fetch = fetch + } + + /// :nodoc: + public func fetch(_ db: Database) throws -> [Row] { + return try _fetch(db) + } + + /// :nodoc: + public mutating func value(_ newRows: [Row]) -> [Record]? { + if let rows = rows, rows == newRows { + return nil + } + self.rows = newRows + return newRows.map(Record.init(row:)) + } + } + + public struct UniqueRecord: ValueReducer { + let _fetch: (Database) throws -> Row? + var row: Row?? + + /// TODO + public init(_ fetch: @escaping (Database) throws -> Row?) { + self._fetch = fetch + } + + /// :nodoc: + public func fetch(_ db: Database) throws -> Row? { + return try _fetch(db) + } + + /// :nodoc: + public mutating func value(_ newRow: Row?) -> Record? { + if let row = row, row == newRow { + return nil + } + self.row = newRow + return newRow.map(Record.init(row:)) + } + } +} + // MARK: - DatabaseRegionConvertible Observation -extension ValueObservation { +extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *regions*, and notifies the /// values returned by the *fetch* closure whenever one of the observed /// regions is impacted by a database transaction. /// /// For example: /// - /// let observation = ValueObservation( - /// observing: Player.all(), + /// let observation = ValueObservation.observing( + /// Player.all(), /// fetch: { db in return try Player.fetchAll(db) }) /// /// let observer = dbQueue.add(observation: observation) { player: [Player] in @@ -140,9 +244,10 @@ extension ValueObservation { /// /// - parameter regions: one or more observed requests. /// - parameter fetch: a closure that fetches a value. - public init( - observing regions: DatabaseRegionConvertible..., + public static func observing( + _ regions: DatabaseRegionConvertible..., fetch: @escaping (Database) throws -> Value) + -> ValueObservation> { func region(_ db: Database) throws -> DatabaseRegion { return try regions.reduce(into: DatabaseRegion()) { union, region in @@ -150,13 +255,59 @@ extension ValueObservation { } } - self.init(observing: region, fetch: fetch) + return ValueObservation>( + observing: region, + reducer: ValueReducers.Raw(fetch)) + } + + /// Creates a ValueObservation which observes *regions*, and notifies the + /// values returned by the *fetch* closure whenever one of the observed + /// regions is impacted by a database transaction. + /// + /// For example: + /// + /// let observation = ValueObservation.observing( + /// withUniquing: Player.all(), + /// fetch: { db in return try Player.fetchAll(db) }) + /// + /// let observer = dbQueue.add(observation: observation) { player: [Player] in + /// print("players have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter regions: one or more observed requests. + /// - parameter fetch: a closure that fetches a value. + public static func observing( + withUniquing regions: DatabaseRegionConvertible..., + fetch: @escaping (Database) throws -> Value) + -> ValueObservation> + where Value: Equatable + { + func region(_ db: Database) throws -> DatabaseRegion { + return try regions.reduce(into: DatabaseRegion()) { union, region in + try union.formUnion(region.databaseRegion(db)) + } + } + + return ValueObservation>( + observing: region, + reducer: ValueReducers.Unique(fetch)) } } // MARK: - FetchRequest Observation -extension ValueObservation where Value == Void { +extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *request*, and notifies a /// fresh count whenever the request is impacted by a database transaction. /// @@ -183,17 +334,50 @@ extension ValueObservation where Value == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func forCount(_ request: Request) - -> ValueObservation + -> ValueObservation> { - return ValueObservation( + return ValueObservation>( observing: request.databaseRegion, - fetch: request.fetchCount) + reducer: ValueReducers.Raw(request.fetchCount)) + } + + /// Creates a ValueObservation which observes *request*, and notifies a + /// fresh count whenever the request is impacted by a database transaction. + /// + /// For example: + /// + /// let request = Player.all() + /// let observation = ValueObservation.forCount(withUniquing: request) + /// + /// let observer = dbQueue.add(observation: observation) { count: Int in + /// print("number of players has changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forCount(withUniquing request: Request) + -> ValueObservation> + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.Unique(request.fetchCount)) } } // MARK: - Row Observation -extension ValueObservation where Value == Void { +extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *request*, and notifies /// fresh rows whenever the request is impacted by a database transaction. /// @@ -220,14 +404,48 @@ extension ValueObservation where Value == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func forAll(_ request: Request) - -> ValueObservation<[Row]> + -> ValueObservation> where Request.RowDecoder == Row { - return ValueObservation<[Row]>( + return ValueObservation>( observing: request.databaseRegion, - fetch: request.fetchAll) + reducer: ValueReducers.Raw(request.fetchAll)) } + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh rows whenever the request is impacted by a database transaction. + /// + /// For example: + /// + /// let request = SQLRequest("SELECT * FROM player") + /// let observation = ValueObservation.forAll(withUniquing: request) + /// + /// let observer = dbQueue.add(observation: observation) { rows: [Row] in + /// print("players have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forAll(withUniquing request: Request) + -> ValueObservation> + where Request.RowDecoder == Row + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.Unique(request.fetchAll)) + } + /// Creates a ValueObservation which observes *request*, and notifies a /// fresh row whenever the request is impacted by a database transaction. /// @@ -254,18 +472,52 @@ extension ValueObservation where Value == Void { /// - parameter request: the observed request. /// - returns: a new ValueObservation. public static func forOne(_ request: Request) - -> ValueObservation + -> ValueObservation> where Request.RowDecoder == Row { - return ValueObservation( + return ValueObservation>( observing: request.databaseRegion, - fetch: request.fetchOne) + reducer: ValueReducers.Raw(request.fetchOne)) + } + + /// Creates a ValueObservation which observes *request*, and notifies a + /// fresh row whenever the request is impacted by a database transaction. + /// + /// For example: + /// + /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) + /// let observation = ValueObservation.forOne(withUniquing: request) + /// + /// let observer = dbQueue.add(observation: observation) { row: Row? in + /// print("players have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a new ValueObservation. + public static func forOne(withUniquing request: Request) + -> ValueObservation> + where Request.RowDecoder == Row + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.Unique(request.fetchOne)) } } // MARK: - FetchableRecord Observation -extension ValueObservation where Value == Void { +extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *request*, and notifies /// fresh records whenever the request is impacted by a /// database transaction. @@ -293,12 +545,47 @@ extension ValueObservation where Value == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func forAll(_ request: Request) - -> ValueObservation<[Request.RowDecoder]> + -> ValueObservation> where Request.RowDecoder: FetchableRecord { - return ValueObservation<[Request.RowDecoder]>( + return ValueObservation>( observing: request.databaseRegion, - fetch: request.fetchAll) + reducer: ValueReducers.Raw(request.fetchAll)) + } + + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh records whenever the request is impacted by a + /// database transaction. + /// + /// For example: + /// + /// let request = Player.all() + /// let observation = ValueObservation.forAll(withUniquing: request) + /// + /// let observer = dbQueue.add(observation: observation) { players: [Player] in + /// print("players have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forAll(withUniquing request: Request) + -> ValueObservation> + where Request.RowDecoder: FetchableRecord + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.UniqueRecords { try Row.fetchAll($0, request) }) } /// Creates a ValueObservation which observes *request*, and notifies a @@ -327,63 +614,24 @@ extension ValueObservation where Value == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func forOne(_ request: Request) -> - ValueObservation + ValueObservation> where Request.RowDecoder: FetchableRecord { - return ValueObservation( + return ValueObservation>( observing: request.databaseRegion, - fetch: request.fetchOne) - } -} - -// MARK: - DatabaseValueConvertible Observation - -extension ValueObservation where Value == Void { - /// Creates a ValueObservation which observes *request*, and notifies - /// fresh values whenever the request is impacted by a - /// database transaction. - /// - /// For example: - /// - /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.forAll(request) - /// - /// let observer = dbQueue.add(observation: observation) { names: [String] in - /// print("player name have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func forAll(_ request: Request) - -> ValueObservation<[Request.RowDecoder]> - where Request.RowDecoder: DatabaseValueConvertible - { - return ValueObservation<[Request.RowDecoder]>( - observing: request.databaseRegion, - fetch: request.fetchAll) + reducer: ValueReducers.Raw(request.fetchOne)) } /// Creates a ValueObservation which observes *request*, and notifies a - /// fresh value whenever the request is impacted by a database transaction. + /// fresh record whenever the request is impacted by a database transaction. /// /// For example: /// - /// let request = Player.select(max(Column("score")), as: Int.self) - /// let observation = ValueObservation.forOne(request) + /// let request = Player.filter(key: 1) + /// let observation = ValueObservation.forOne(withUniquing: request) /// - /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in - /// print("maximum score has changed") + /// let observer = dbQueue.add(observation: observation) { player: Player? in + /// print("player has changed") /// } /// /// The returned observation has the default configuration: @@ -399,165 +647,238 @@ extension ValueObservation where Value == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forOne(_ request: Request) - -> ValueObservation - where Request.RowDecoder: DatabaseValueConvertible + public static func forOne(withUniquing request: Request) -> + ValueObservation> + where Request.RowDecoder: FetchableRecord { - return ValueObservation( + return ValueObservation>( observing: request.databaseRegion, - fetch: request.fetchOne) + reducer: ValueReducers.UniqueRecord { try Row.fetchOne($0, request) }) } } -// MARK: - DatabaseValueConvertible & StatementColumnConvertible Observation - -extension ValueObservation where Value == Void { - /// Creates a ValueObservation which observes *request*, and notifies - /// fresh values whenever the request is impacted by a - /// database transaction. - /// - /// For example: - /// - /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.forAll(request) - /// - /// let observer = dbQueue.add(observation: observation) { names: [String] in - /// print("player name have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func forAll(_ request: Request) - -> ValueObservation<[Request.RowDecoder]> - where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible - { - return ValueObservation<[Request.RowDecoder]>( - observing: request.databaseRegion, - fetch: request.fetchAll) - } - - /// Creates a ValueObservation which observes *request*, and notifies a - /// fresh value whenever the request is impacted by a database transaction. - /// - /// For example: - /// - /// let request = Player.select(max(Column("score")), as: Int.self) - /// let observation = ValueObservation.forOne(request) - /// - /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in - /// print("maximum score has changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func forOne(_ request: Request) - -> ValueObservation - where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible - { - return ValueObservation( - observing: request.databaseRegion, - fetch: request.fetchOne) - } -} - -// MARK: - Optional DatabaseValueConvertible Observation - -extension ValueObservation where Value == Void { - /// Creates a ValueObservation which observes *request*, and notifies - /// fresh values whenever the request is impacted by a - /// database transaction. - /// - /// For example: - /// - /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.forAll(request) - /// - /// let observer = dbQueue.add(observation: observation) { names: [String] in - /// print("player name have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func forAll(_ request: Request) - -> ValueObservation<[Request.RowDecoder._Wrapped?]> - where Request.RowDecoder: _OptionalProtocol, - Request.RowDecoder._Wrapped: DatabaseValueConvertible - { - return ValueObservation<[Request.RowDecoder._Wrapped?]>( - observing: request.databaseRegion, - fetch: request.fetchAll) - } -} - -// MARK: - Optional DatabaseValueConvertible & StatementColumnConvertible Observation - -extension ValueObservation where Value == Void { - /// Creates a ValueObservation which observes *request*, and notifies - /// fresh values whenever the request is impacted by a - /// database transaction. - /// - /// For example: - /// - /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.forAll(request) - /// - /// let observer = dbQueue.add(observation: observation) { names: [String] in - /// print("player name have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func forAll(_ request: Request) - -> ValueObservation<[Request.RowDecoder._Wrapped?]> - where Request.RowDecoder: _OptionalProtocol, - Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible - { - return ValueObservation<[Request.RowDecoder._Wrapped?]>( - observing: request.databaseRegion, - fetch: request.fetchAll) - } -} +//// MARK: - DatabaseValueConvertible Observation +// +//extension ValueObservation where Value == Void { +// /// Creates a ValueObservation which observes *request*, and notifies +// /// fresh values whenever the request is impacted by a +// /// database transaction. +// /// +// /// For example: +// /// +// /// let request = Player.select(Column("name"), as: String.self) +// /// let observation = ValueObservation.forAll(request) +// /// +// /// let observer = dbQueue.add(observation: observation) { names: [String] in +// /// print("player name have changed") +// /// } +// /// +// /// The returned observation has the default configuration: +// /// +// /// - When started with the `add(observation:)` method, a fresh value is +// /// immediately notified on the dispatch queue which starts the observation. +// /// - Upon subsequent database changes, fresh values are notified on the +// /// main queue. +// /// - The observation lasts until the observer returned by +// /// `add(observation:)` is deallocated. +// /// +// /// See ValueObservation for more information. +// /// +// /// - parameter request: the observed request. +// /// - returns: a ValueObservation. +// public static func forAll(_ request: Request) +// -> ValueObservation<[Request.RowDecoder]> +// where Request.RowDecoder: DatabaseValueConvertible +// { +// return ValueObservation<[Request.RowDecoder]>( +// observing: request.databaseRegion, +// fetch: request.fetchAll) +// } +// +// /// Creates a ValueObservation which observes *request*, and notifies a +// /// fresh value whenever the request is impacted by a database transaction. +// /// +// /// For example: +// /// +// /// let request = Player.select(max(Column("score")), as: Int.self) +// /// let observation = ValueObservation.forOne(request) +// /// +// /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in +// /// print("maximum score has changed") +// /// } +// /// +// /// The returned observation has the default configuration: +// /// +// /// - When started with the `add(observation:)` method, a fresh value is +// /// immediately notified on the dispatch queue which starts the observation. +// /// - Upon subsequent database changes, fresh values are notified on the +// /// main queue. +// /// - The observation lasts until the observer returned by +// /// `add(observation:)` is deallocated. +// /// +// /// See ValueObservation for more information. +// /// +// /// - parameter request: the observed request. +// /// - returns: a ValueObservation. +// public static func forOne(_ request: Request) +// -> ValueObservation +// where Request.RowDecoder: DatabaseValueConvertible +// { +// return ValueObservation( +// observing: request.databaseRegion, +// fetch: request.fetchOne) +// } +//} +// +//// MARK: - DatabaseValueConvertible & StatementColumnConvertible Observation +// +//extension ValueObservation where Value == Void { +// /// Creates a ValueObservation which observes *request*, and notifies +// /// fresh values whenever the request is impacted by a +// /// database transaction. +// /// +// /// For example: +// /// +// /// let request = Player.select(Column("name"), as: String.self) +// /// let observation = ValueObservation.forAll(request) +// /// +// /// let observer = dbQueue.add(observation: observation) { names: [String] in +// /// print("player name have changed") +// /// } +// /// +// /// The returned observation has the default configuration: +// /// +// /// - When started with the `add(observation:)` method, a fresh value is +// /// immediately notified on the dispatch queue which starts the observation. +// /// - Upon subsequent database changes, fresh values are notified on the +// /// main queue. +// /// - The observation lasts until the observer returned by +// /// `add(observation:)` is deallocated. +// /// +// /// See ValueObservation for more information. +// /// +// /// - parameter request: the observed request. +// /// - returns: a ValueObservation. +// public static func forAll(_ request: Request) +// -> ValueObservation<[Request.RowDecoder]> +// where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible +// { +// return ValueObservation<[Request.RowDecoder]>( +// observing: request.databaseRegion, +// fetch: request.fetchAll) +// } +// +// /// Creates a ValueObservation which observes *request*, and notifies a +// /// fresh value whenever the request is impacted by a database transaction. +// /// +// /// For example: +// /// +// /// let request = Player.select(max(Column("score")), as: Int.self) +// /// let observation = ValueObservation.forOne(request) +// /// +// /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in +// /// print("maximum score has changed") +// /// } +// /// +// /// The returned observation has the default configuration: +// /// +// /// - When started with the `add(observation:)` method, a fresh value is +// /// immediately notified on the dispatch queue which starts the observation. +// /// - Upon subsequent database changes, fresh values are notified on the +// /// main queue. +// /// - The observation lasts until the observer returned by +// /// `add(observation:)` is deallocated. +// /// +// /// See ValueObservation for more information. +// /// +// /// - parameter request: the observed request. +// /// - returns: a ValueObservation. +// public static func forOne(_ request: Request) +// -> ValueObservation +// where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible +// { +// return ValueObservation( +// observing: request.databaseRegion, +// fetch: request.fetchOne) +// } +//} +// +//// MARK: - Optional DatabaseValueConvertible Observation +// +//extension ValueObservation where Value == Void { +// /// Creates a ValueObservation which observes *request*, and notifies +// /// fresh values whenever the request is impacted by a +// /// database transaction. +// /// +// /// For example: +// /// +// /// let request = Player.select(Column("name"), as: String.self) +// /// let observation = ValueObservation.forAll(request) +// /// +// /// let observer = dbQueue.add(observation: observation) { names: [String] in +// /// print("player name have changed") +// /// } +// /// +// /// The returned observation has the default configuration: +// /// +// /// - When started with the `add(observation:)` method, a fresh value is +// /// immediately notified on the dispatch queue which starts the observation. +// /// - Upon subsequent database changes, fresh values are notified on the +// /// main queue. +// /// - The observation lasts until the observer returned by +// /// `add(observation:)` is deallocated. +// /// +// /// See ValueObservation for more information. +// /// +// /// - parameter request: the observed request. +// /// - returns: a ValueObservation. +// public static func forAll(_ request: Request) +// -> ValueObservation<[Request.RowDecoder._Wrapped?]> +// where Request.RowDecoder: _OptionalProtocol, +// Request.RowDecoder._Wrapped: DatabaseValueConvertible +// { +// return ValueObservation<[Request.RowDecoder._Wrapped?]>( +// observing: request.databaseRegion, +// fetch: request.fetchAll) +// } +//} +// +//// MARK: - Optional DatabaseValueConvertible & StatementColumnConvertible Observation +// +//extension ValueObservation where Value == Void { +// /// Creates a ValueObservation which observes *request*, and notifies +// /// fresh values whenever the request is impacted by a +// /// database transaction. +// /// +// /// For example: +// /// +// /// let request = Player.select(Column("name"), as: String.self) +// /// let observation = ValueObservation.forAll(request) +// /// +// /// let observer = dbQueue.add(observation: observation) { names: [String] in +// /// print("player name have changed") +// /// } +// /// +// /// The returned observation has the default configuration: +// /// +// /// - When started with the `add(observation:)` method, a fresh value is +// /// immediately notified on the dispatch queue which starts the observation. +// /// - Upon subsequent database changes, fresh values are notified on the +// /// main queue. +// /// - The observation lasts until the observer returned by +// /// `add(observation:)` is deallocated. +// /// +// /// See ValueObservation for more information. +// /// +// /// - parameter request: the observed request. +// /// - returns: a ValueObservation. +// public static func forAll(_ request: Request) +// -> ValueObservation<[Request.RowDecoder._Wrapped?]> +// where Request.RowDecoder: _OptionalProtocol, +// Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible +// { +// return ValueObservation<[Request.RowDecoder._Wrapped?]>( +// observing: request.databaseRegion, +// fetch: request.fetchAll) +// } +//} From 052d2e30082f623c88afb356704f98528545402e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 27 Oct 2018 16:41:42 +0200 Subject: [PATCH 017/109] Value (string, int, etc.) observation, with uniquing --- GRDB/Core/ValueObservation.swift | 627 ++++++++++++++++++++----------- 1 file changed, 402 insertions(+), 225 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 2da4237cb..97ba86d04 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -212,6 +212,78 @@ public enum ValueReducers { return newRow.map(Record.init(row:)) } } + + public struct UniqueValues: ValueReducer { + let _fetch: (Database) throws -> [DatabaseValue] + var dbValues: [DatabaseValue]? + + /// TODO + public init(_ fetch: @escaping (Database) throws -> [DatabaseValue]) { + self._fetch = fetch + } + + /// :nodoc: + public func fetch(_ db: Database) throws -> [DatabaseValue] { + return try _fetch(db) + } + + /// :nodoc: + public mutating func value(_ newDbValues: [DatabaseValue]) -> [T]? { + if let dbValues = dbValues, dbValues == newDbValues { + return nil + } + self.dbValues = newDbValues + return newDbValues.map { T.decode(from: $0, conversionContext: nil) } + } + } + + public struct UniqueValue: ValueReducer { + let _fetch: (Database) throws -> DatabaseValue? + var dbValue: DatabaseValue?? + + /// TODO + public init(_ fetch: @escaping (Database) throws -> DatabaseValue?) { + self._fetch = fetch + } + + /// :nodoc: + public func fetch(_ db: Database) throws -> DatabaseValue? { + return try _fetch(db) + } + + /// :nodoc: + public mutating func value(_ newDbValue: DatabaseValue?) -> T? { + if let dbValue = dbValue, dbValue == newDbValue { + return nil + } + self.dbValue = newDbValue + return newDbValue.map { T.decode(from: $0, conversionContext: nil) } + } + } + + public struct UniqueOptionalValues: ValueReducer { + let _fetch: (Database) throws -> [DatabaseValue] + var dbValues: [DatabaseValue]? + + /// TODO + public init(_ fetch: @escaping (Database) throws -> [DatabaseValue]) { + self._fetch = fetch + } + + /// :nodoc: + public func fetch(_ db: Database) throws -> [DatabaseValue] { + return try _fetch(db) + } + + /// :nodoc: + public mutating func value(_ newDbValues: [DatabaseValue]) -> [T?]? { + if let dbValues = dbValues, dbValues == newDbValues { + return nil + } + self.dbValues = newDbValues + return newDbValues.map { T.decodeIfPresent(from: $0, conversionContext: nil) } + } + } } // MARK: - DatabaseRegionConvertible Observation @@ -657,228 +729,333 @@ extension ValueObservation where Reducer == Void { } } -//// MARK: - DatabaseValueConvertible Observation -// -//extension ValueObservation where Value == Void { -// /// Creates a ValueObservation which observes *request*, and notifies -// /// fresh values whenever the request is impacted by a -// /// database transaction. -// /// -// /// For example: -// /// -// /// let request = Player.select(Column("name"), as: String.self) -// /// let observation = ValueObservation.forAll(request) -// /// -// /// let observer = dbQueue.add(observation: observation) { names: [String] in -// /// print("player name have changed") -// /// } -// /// -// /// The returned observation has the default configuration: -// /// -// /// - When started with the `add(observation:)` method, a fresh value is -// /// immediately notified on the dispatch queue which starts the observation. -// /// - Upon subsequent database changes, fresh values are notified on the -// /// main queue. -// /// - The observation lasts until the observer returned by -// /// `add(observation:)` is deallocated. -// /// -// /// See ValueObservation for more information. -// /// -// /// - parameter request: the observed request. -// /// - returns: a ValueObservation. -// public static func forAll(_ request: Request) -// -> ValueObservation<[Request.RowDecoder]> -// where Request.RowDecoder: DatabaseValueConvertible -// { -// return ValueObservation<[Request.RowDecoder]>( -// observing: request.databaseRegion, -// fetch: request.fetchAll) -// } -// -// /// Creates a ValueObservation which observes *request*, and notifies a -// /// fresh value whenever the request is impacted by a database transaction. -// /// -// /// For example: -// /// -// /// let request = Player.select(max(Column("score")), as: Int.self) -// /// let observation = ValueObservation.forOne(request) -// /// -// /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in -// /// print("maximum score has changed") -// /// } -// /// -// /// The returned observation has the default configuration: -// /// -// /// - When started with the `add(observation:)` method, a fresh value is -// /// immediately notified on the dispatch queue which starts the observation. -// /// - Upon subsequent database changes, fresh values are notified on the -// /// main queue. -// /// - The observation lasts until the observer returned by -// /// `add(observation:)` is deallocated. -// /// -// /// See ValueObservation for more information. -// /// -// /// - parameter request: the observed request. -// /// - returns: a ValueObservation. -// public static func forOne(_ request: Request) -// -> ValueObservation -// where Request.RowDecoder: DatabaseValueConvertible -// { -// return ValueObservation( -// observing: request.databaseRegion, -// fetch: request.fetchOne) -// } -//} -// -//// MARK: - DatabaseValueConvertible & StatementColumnConvertible Observation -// -//extension ValueObservation where Value == Void { -// /// Creates a ValueObservation which observes *request*, and notifies -// /// fresh values whenever the request is impacted by a -// /// database transaction. -// /// -// /// For example: -// /// -// /// let request = Player.select(Column("name"), as: String.self) -// /// let observation = ValueObservation.forAll(request) -// /// -// /// let observer = dbQueue.add(observation: observation) { names: [String] in -// /// print("player name have changed") -// /// } -// /// -// /// The returned observation has the default configuration: -// /// -// /// - When started with the `add(observation:)` method, a fresh value is -// /// immediately notified on the dispatch queue which starts the observation. -// /// - Upon subsequent database changes, fresh values are notified on the -// /// main queue. -// /// - The observation lasts until the observer returned by -// /// `add(observation:)` is deallocated. -// /// -// /// See ValueObservation for more information. -// /// -// /// - parameter request: the observed request. -// /// - returns: a ValueObservation. -// public static func forAll(_ request: Request) -// -> ValueObservation<[Request.RowDecoder]> -// where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible -// { -// return ValueObservation<[Request.RowDecoder]>( -// observing: request.databaseRegion, -// fetch: request.fetchAll) -// } -// -// /// Creates a ValueObservation which observes *request*, and notifies a -// /// fresh value whenever the request is impacted by a database transaction. -// /// -// /// For example: -// /// -// /// let request = Player.select(max(Column("score")), as: Int.self) -// /// let observation = ValueObservation.forOne(request) -// /// -// /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in -// /// print("maximum score has changed") -// /// } -// /// -// /// The returned observation has the default configuration: -// /// -// /// - When started with the `add(observation:)` method, a fresh value is -// /// immediately notified on the dispatch queue which starts the observation. -// /// - Upon subsequent database changes, fresh values are notified on the -// /// main queue. -// /// - The observation lasts until the observer returned by -// /// `add(observation:)` is deallocated. -// /// -// /// See ValueObservation for more information. -// /// -// /// - parameter request: the observed request. -// /// - returns: a ValueObservation. -// public static func forOne(_ request: Request) -// -> ValueObservation -// where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible -// { -// return ValueObservation( -// observing: request.databaseRegion, -// fetch: request.fetchOne) -// } -//} -// -//// MARK: - Optional DatabaseValueConvertible Observation -// -//extension ValueObservation where Value == Void { -// /// Creates a ValueObservation which observes *request*, and notifies -// /// fresh values whenever the request is impacted by a -// /// database transaction. -// /// -// /// For example: -// /// -// /// let request = Player.select(Column("name"), as: String.self) -// /// let observation = ValueObservation.forAll(request) -// /// -// /// let observer = dbQueue.add(observation: observation) { names: [String] in -// /// print("player name have changed") -// /// } -// /// -// /// The returned observation has the default configuration: -// /// -// /// - When started with the `add(observation:)` method, a fresh value is -// /// immediately notified on the dispatch queue which starts the observation. -// /// - Upon subsequent database changes, fresh values are notified on the -// /// main queue. -// /// - The observation lasts until the observer returned by -// /// `add(observation:)` is deallocated. -// /// -// /// See ValueObservation for more information. -// /// -// /// - parameter request: the observed request. -// /// - returns: a ValueObservation. -// public static func forAll(_ request: Request) -// -> ValueObservation<[Request.RowDecoder._Wrapped?]> -// where Request.RowDecoder: _OptionalProtocol, -// Request.RowDecoder._Wrapped: DatabaseValueConvertible -// { -// return ValueObservation<[Request.RowDecoder._Wrapped?]>( -// observing: request.databaseRegion, -// fetch: request.fetchAll) -// } -//} -// -//// MARK: - Optional DatabaseValueConvertible & StatementColumnConvertible Observation -// -//extension ValueObservation where Value == Void { -// /// Creates a ValueObservation which observes *request*, and notifies -// /// fresh values whenever the request is impacted by a -// /// database transaction. -// /// -// /// For example: -// /// -// /// let request = Player.select(Column("name"), as: String.self) -// /// let observation = ValueObservation.forAll(request) -// /// -// /// let observer = dbQueue.add(observation: observation) { names: [String] in -// /// print("player name have changed") -// /// } -// /// -// /// The returned observation has the default configuration: -// /// -// /// - When started with the `add(observation:)` method, a fresh value is -// /// immediately notified on the dispatch queue which starts the observation. -// /// - Upon subsequent database changes, fresh values are notified on the -// /// main queue. -// /// - The observation lasts until the observer returned by -// /// `add(observation:)` is deallocated. -// /// -// /// See ValueObservation for more information. -// /// -// /// - parameter request: the observed request. -// /// - returns: a ValueObservation. -// public static func forAll(_ request: Request) -// -> ValueObservation<[Request.RowDecoder._Wrapped?]> -// where Request.RowDecoder: _OptionalProtocol, -// Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible -// { -// return ValueObservation<[Request.RowDecoder._Wrapped?]>( -// observing: request.databaseRegion, -// fetch: request.fetchAll) -// } -//} +// MARK: - DatabaseValueConvertible Observation + +extension ValueObservation where Reducer == Void { + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh values whenever the request is impacted by a + /// database transaction. + /// + /// For example: + /// + /// let request = Player.select(Column("name"), as: String.self) + /// let observation = ValueObservation.forAll(request) + /// + /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// print("player name have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forAll(_ request: Request) + -> ValueObservation> + where Request.RowDecoder: DatabaseValueConvertible + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.Raw(request.fetchAll)) + } + + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh values whenever the request is impacted by a + /// database transaction. + /// + /// For example: + /// + /// let request = Player.select(Column("name"), as: String.self) + /// let observation = ValueObservation.forAll(withUniquing: request) + /// + /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// print("player name have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forAll(withUniquing request: Request) + -> ValueObservation> + where Request.RowDecoder: DatabaseValueConvertible + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.UniqueValues { try DatabaseValue.fetchAll($0, request) }) + } + + /// Creates a ValueObservation which observes *request*, and notifies a + /// fresh value whenever the request is impacted by a database transaction. + /// + /// For example: + /// + /// let request = Player.select(max(Column("score")), as: Int.self) + /// let observation = ValueObservation.forOne(request) + /// + /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in + /// print("maximum score has changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forOne(_ request: Request) + -> ValueObservation> + where Request.RowDecoder: DatabaseValueConvertible + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.Raw(request.fetchOne)) + } + + /// Creates a ValueObservation which observes *request*, and notifies a + /// fresh value whenever the request is impacted by a database transaction. + /// + /// For example: + /// + /// let request = Player.select(max(Column("score")), as: Int.self) + /// let observation = ValueObservation.forOne(withUniquing: request) + /// + /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in + /// print("maximum score has changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forOne(withUniquing request: Request) + -> ValueObservation> + where Request.RowDecoder: DatabaseValueConvertible + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.UniqueValue { try DatabaseValue.fetchOne($0, request) }) + } +} + +// MARK: - DatabaseValueConvertible & StatementColumnConvertible Observation + +extension ValueObservation where Reducer == Void { + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh values whenever the request is impacted by a + /// database transaction. + /// + /// For example: + /// + /// let request = Player.select(Column("name"), as: String.self) + /// let observation = ValueObservation.forAll(request) + /// + /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// print("player name have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forAll(_ request: Request) + -> ValueObservation> + where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.Raw(request.fetchAll)) + } + + /// Creates a ValueObservation which observes *request*, and notifies a + /// fresh value whenever the request is impacted by a database transaction. + /// + /// For example: + /// + /// let request = Player.select(max(Column("score")), as: Int.self) + /// let observation = ValueObservation.forOne(request) + /// + /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in + /// print("maximum score has changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forOne(_ request: Request) + -> ValueObservation> + where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.Raw(request.fetchOne)) + } +} + +// MARK: - Optional DatabaseValueConvertible Observation + +extension ValueObservation where Reducer == Void { + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh values whenever the request is impacted by a + /// database transaction. + /// + /// For example: + /// + /// let request = Player.select(Column("name"), as: String.self) + /// let observation = ValueObservation.forAll(request) + /// + /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// print("player name have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forAll(_ request: Request) + -> ValueObservation> + where Request.RowDecoder: _OptionalProtocol, + Request.RowDecoder._Wrapped: DatabaseValueConvertible + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.Raw(request.fetchAll)) + } + + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh values whenever the request is impacted by a + /// database transaction. + /// + /// For example: + /// + /// let request = Player.select(Column("name"), as: String.self) + /// let observation = ValueObservation.forAll(withUniquing: request) + /// + /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// print("player name have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forAll(withUniquing request: Request) + -> ValueObservation> + where Request.RowDecoder: _OptionalProtocol, + Request.RowDecoder._Wrapped: DatabaseValueConvertible + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.UniqueOptionalValues { try DatabaseValue.fetchAll($0, request) }) + } +} + +// MARK: - Optional DatabaseValueConvertible & StatementColumnConvertible Observation + +extension ValueObservation where Reducer == Void { + /// Creates a ValueObservation which observes *request*, and notifies + /// fresh values whenever the request is impacted by a + /// database transaction. + /// + /// For example: + /// + /// let request = Player.select(Column("name"), as: String.self) + /// let observation = ValueObservation.forAll(request) + /// + /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// print("player name have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter request: the observed request. + /// - returns: a ValueObservation. + public static func forAll(_ request: Request) + -> ValueObservation> + where Request.RowDecoder: _OptionalProtocol, + Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible + { + return ValueObservation>( + observing: request.databaseRegion, + reducer: ValueReducers.Raw(request.fetchAll)) + } +} From 82efe7ca23e203e73d3a909f6891592877198301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 27 Oct 2018 17:06:23 +0200 Subject: [PATCH 018/109] AnyValueReducer --- GRDB/Core/ValueObservation.swift | 71 ++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 97ba86d04..930c811f5 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -29,6 +29,35 @@ public protocol ValueReducer { mutating func value(_ fetched: Fetched) -> Value? } +/// TODO: doc +public struct AnyValueReducer: ValueReducer { + var _fetch: (Database) throws -> Fetched + var _value: (Fetched) -> Value? + + /// TODO: doc + public init(fetch: @escaping (Database) throws -> Fetched, value: @escaping (Fetched) -> Value?) { + self._fetch = fetch + self._value = value + } + + /// TODO: doc + public init(_ reducer: Reducer) where Reducer.Fetched == Fetched, Reducer.Value == Value { + var reducer = reducer + self._fetch = { try reducer.fetch($0) } + self._value = { reducer.value($0) } + } + + /// :nodoc: + public func fetch(_ db: Database) throws -> Fetched { + return try _fetch(db) + } + + /// :nodoc: + public func value(_ fetched: Fetched) -> Value? { + return _value(fetched) + } +} + /// TODO: doc /// TODO: refresh region after each fetch public struct ValueObservation { @@ -288,6 +317,48 @@ public enum ValueReducers { // MARK: - DatabaseRegionConvertible Observation +extension ValueObservation { + /// Creates a ValueObservation which observes *region*, and notifies the + /// values returned by the *fetch* closure whenever the observed region is + /// impacted by a database transaction. + /// + /// For example: + /// + /// let observation = ValueObservation( + /// observing: { db in try Player.all().databaseRegion(db) }, + /// fetch: { db in try Player.fetchAll(db) }) + /// + /// let observer = dbQueue.add(observation: observation) { player: [Player] in + /// print("players have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter region: a closure that returns the observed region. + /// - parameter fetch: a closure that fetches a value. + public init( + observing regions: DatabaseRegionConvertible..., + reducer: Reducer) + { + func region(_ db: Database) throws -> DatabaseRegion { + return try regions.reduce(into: DatabaseRegion()) { union, region in + try union.formUnion(region.databaseRegion(db)) + } + } + + self.init(observing: region, reducer: reducer) + } +} + extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *regions*, and notifies the /// values returned by the *fetch* closure whenever one of the observed From 7c4462641e266d8cc02e4bd7ff801803dc98cac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 27 Oct 2018 17:16:03 +0200 Subject: [PATCH 019/109] ValueObservation creation is always done with a factory initializer --- GRDB/Core/ValueObservation.swift | 44 +++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 930c811f5..3af2d8613 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -133,7 +133,7 @@ public struct ValueObservation { /// /// - parameter region: a closure that returns the observed region. /// - parameter fetch: a closure that fetches a value. - public init( + init( observing region: @escaping (Database) throws -> DatabaseRegion, reducer: Reducer) { @@ -145,6 +145,41 @@ public struct ValueObservation { self.qos = .unspecified } } + + /// Creates a ValueObservation which observes *region*, and notifies the + /// values returned by the *fetch* closure whenever the observed region is + /// impacted by a database transaction. + /// + /// For example: + /// + /// let observation = ValueObservation( + /// observing: { db in try Player.all().databaseRegion(db) }, + /// fetch: { db in try Player.fetchAll(db) }) + /// + /// let observer = dbQueue.add(observation: observation) { player: [Player] in + /// print("players have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter region: a closure that returns the observed region. + /// - parameter fetch: a closure that fetches a value. + public static func observing( + _ region: @escaping (Database) throws -> DatabaseRegion, + reducer: Reducer) + -> ValueObservation + { + return ValueObservation(observing: region, reducer: reducer) + } } // MARK: - Reducers @@ -345,9 +380,10 @@ extension ValueObservation { /// /// - parameter region: a closure that returns the observed region. /// - parameter fetch: a closure that fetches a value. - public init( - observing regions: DatabaseRegionConvertible..., + public static func observing( + _ regions: DatabaseRegionConvertible..., reducer: Reducer) + -> ValueObservation { func region(_ db: Database) throws -> DatabaseRegion { return try regions.reduce(into: DatabaseRegion()) { union, region in @@ -355,7 +391,7 @@ extension ValueObservation { } } - self.init(observing: region, reducer: reducer) + return ValueObservation(observing: region, reducer: reducer) } } From ec5451ee70e5e1a248c2c4b81ad7df2088e42ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 27 Oct 2018 17:18:03 +0200 Subject: [PATCH 020/109] Cleanup --- GRDB/Core/DatabaseWriter.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index c8d49c603..ff0953d6c 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -299,6 +299,7 @@ private class ValueObserver: TransactionObserver { self.queue = queue self.onChange = onChange self.onError = onError + // TODO: provide a proper label self.notificationQueue = DispatchQueue(label: "GRDB.ValueObservation", qos: qos) } From a043c4c29ec566d4de9b128018321b7cc506916c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 27 Oct 2018 23:01:24 +0200 Subject: [PATCH 021/109] QoS are hard --- GRDB/Core/ValueObservation.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 3af2d8613..b9beaa975 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -139,7 +139,10 @@ public struct ValueObservation { { self.observedRegion = region self.reducer = reducer - if #available(OSXApplicationExtension 10.10, *) { + + // TODO: read https://developer.apple.com/library/archive/documentation/Performance/Conceptual/EnergyGuide-iOS/PrioritizeWorkWithQoS.html + // and pick a sensible default qos + if #available(OSX 10.10, *) { self.qos = .default } else { self.qos = .unspecified From fc3aca792f5935147b07c9ff1c0ef02f066e1e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 11:28:31 +0100 Subject: [PATCH 022/109] Replace InitialDispatch with ValueScheduling --- GRDB/Core/DatabaseSnapshot.swift | 28 ++-- GRDB/Core/DatabaseWriter.swift | 134 +++++++++---------- GRDB/Core/ValueObservation.swift | 216 ++++++++++++++++++------------- 3 files changed, 205 insertions(+), 173 deletions(-) diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index c417dd667..9f29626ce 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -108,22 +108,26 @@ extension DatabaseSnapshot { throws -> TransactionObserver { // Deal with initial value - switch observation.initialDispatch { - case .none: - break - case .deferred: + switch observation.scheduling { + case .mainQueue: var reducer = observation.reducer - let fetchedValue = try unsafeReentrantRead(reducer.fetch) - if let value = reducer.value(fetchedValue) { - observation.queue.async { + if let value = try reducer.value(unsafeReentrantRead(reducer.fetch)) { + if DispatchQueue.isMain { onChange(value) + } else { + DispatchQueue.main.async { + onChange(value) + } } } - case .immediateOnCurrentQueue: - var reducer = observation.reducer - let fetchedValue = try unsafeReentrantRead(reducer.fetch) - if let value = reducer.value(fetchedValue) { - onChange(value) + case let .onQueue(queue, startImmediately: startImmediately): + if startImmediately { + var reducer = observation.reducer + if let value = try reducer.value(unsafeReentrantRead(reducer.fetch)) { + queue.async { + onChange(value) + } + } } } diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index ff0953d6c..0f900f8d9 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -205,69 +205,64 @@ extension DatabaseWriter { onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver { - // Will be set and notified on the caller queue if initialDispatch is .immediateOnCurrentQueue - var immediateValue: Reducer.Value? = nil + // mainQueueValue will be set and notified if calledOnMainQueue and + // operation.dispatch is .mainQueue + let calledOnMainQueue = DispatchQueue.isMain + var mainQueueValue: Reducer.Value? = nil defer { - if let immediateValue = immediateValue { - onChange(immediateValue) + if let mainQueueValue = mainQueueValue { + onChange(mainQueueValue) } } // Enter database in order to start observation, and fetch initial - // value if needed. - // - // We use an unsafe reentrant method so that this initializer can be - // called from a database queue. + // value if needed. Use unsafeReentrantWrite so that observation can + // start from any dispatch queue. return try unsafeReentrantWrite { db in + // We have a take care of the order of notifications: initial value + // has to be dispatched before any future transaction triggers + // a change. var reducer = observation.reducer - - // The technique to fetch a fresh value after database has changed - // depends on the observation.readonly flag: - let fetch: (Database) -> Future - if observation.readonly { - // Concurrent read so that we don't block the writer queue - fetch = { [unowned self] _ in - self.concurrentRead { db in try reducer.fetch(db) } - } - } else { - // Synchronous fetch from the writer queue - fetch = { db in - Future(Result { try reducer.fetch(db) }) - } - } - - // Deal with initial value - switch observation.initialDispatch { - case .none: - break - case .immediateOnCurrentQueue: - let fetchedValue = try unsafeReentrantRead(reducer.fetch) - immediateValue = reducer.value(fetchedValue) - case .deferred: - // We're still on the database writer queue. Let's dispatch - // initial value right now, before any future transaction has - // any opportunity to trigger a change notification, and mess - // with the ordering of value notifications. - let fetchedValue = try unsafeReentrantRead(reducer.fetch) - if let value = reducer.value(fetchedValue) { - observation.queue.async { - onChange(value) + switch observation.scheduling { + case .mainQueue: + if let value = try reducer.value(reducer.fetch(db)) { + if calledOnMainQueue { + mainQueueValue = value + } else { + DispatchQueue.main.async { onChange(value) } } } + case let .onQueue(queue, startImmediately: startImmediately): + if startImmediately, let value = try reducer.value(reducer.fetch(db)) { + queue.async { onChange(value) } + } } // Start observing the database - let transactionObserver = try ValueObserver( - qos: observation.qos, + // The technique to fetch a fresh value after database has changed + // depends on the observation.readonly flag: + let fetch: (Database, Reducer) -> Future + if observation.readonly { + fetch = { [unowned self] (_, reducer) in + // Concurrent fetch + self.concurrentRead { db in try reducer.fetch(db) } + } + } else { + fetch = { (db, reducer) in + // Synchronous fetch + Future(Result { try reducer.fetch(db) }) + } + } + let valueObserver = try ValueObserver( region: observation.observedRegion(db), reducer: reducer, fetch: fetch, - queue: observation.queue, + notificationQueue: observation.notificatinQueue, onError: onError, onChange: onChange) - db.add(transactionObserver: transactionObserver, extent: observation.extent) + db.add(transactionObserver: valueObserver, extent: observation.extent) - return transactionObserver + return valueObserver } } } @@ -277,30 +272,28 @@ extension DatabaseWriter { private class ValueObserver: TransactionObserver { private let region: DatabaseRegion private var reducer: Reducer - private let fetch: (Database) -> Future - private let queue: DispatchQueue - private let onChange: (Reducer.Value) -> Void - private let onError: ((Error) -> Void)? + private let fetch: (Database, Reducer) -> Future private let notificationQueue: DispatchQueue - private var changed = false + private let onError: ((Error) -> Void)? + private let onChange: (Reducer.Value) -> Void + private let reduceQueue: DispatchQueue + private var isChanged = false init( - qos: DispatchQoS, region: DatabaseRegion, reducer: Reducer, - fetch: @escaping (Database) -> Future, - queue: DispatchQueue, + fetch: @escaping (Database, Reducer) -> Future, + notificationQueue: DispatchQueue, onError: ((Error) -> Void)?, onChange: @escaping (Reducer.Value) -> Void) { self.region = region self.reducer = reducer self.fetch = fetch - self.queue = queue + self.notificationQueue = notificationQueue self.onChange = onChange self.onError = onError - // TODO: provide a proper label - self.notificationQueue = DispatchQueue(label: "GRDB.ValueObservation", qos: qos) + self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation", qos: notificationQueue.qos) } func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { @@ -309,35 +302,34 @@ private class ValueObserver: TransactionObserver { func databaseDidChange(with event: DatabaseEvent) { if region.isModified(by: event) { - changed = true + isChanged = true stopObservingDatabaseChangesUntilNextTransaction() } } func databaseDidCommit(_ db: Database) { - guard changed else { - return - } + guard isChanged else { return } + isChanged = false - changed = false + // Grab future fetched values from the database writer queue + let future = fetch(db, reducer) - // Fetch future value from the database writer queue - let fetched = self.fetch(db) - - // Wait for future value in notificationQueue, in order to guarantee - // that notifications have the same ordering as transactions. - notificationQueue.async { [weak self] in + // Wait for future fetched values in reduceQueue. This guarantees: + // - that notifications have the same ordering as transactions. + // - that expensive reduce operations are computed without blocking + // any database dispatch queue. + reduceQueue.async { [weak self] in guard let strongSelf = self else { return } do { - if let value = try strongSelf.reducer.value(fetched.wait()) { - strongSelf.queue.async { + if let value = try strongSelf.reducer.value(future.wait()) { + strongSelf.notificationQueue.async { guard let strongSelf = self else { return } strongSelf.onChange(value) } } } catch { - strongSelf.queue.async { + strongSelf.notificationQueue.async { guard let strongSelf = self else { return } strongSelf.onError?(error) } @@ -346,7 +338,7 @@ private class ValueObserver: TransactionObserver { } func databaseDidRollback(_ db: Database) { - changed = false + isChanged = false } } diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index b9beaa975..ac5bd52d9 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -8,19 +8,64 @@ import Dispatch -/// InitialDispatch controls how initial value is dispatched when one starts -/// observing the database. See ValueObservation. -public enum InitialDispatch { - /// Initial value is not fetched, and not notified. - case none + +/// ValueScheduling controls how ValueObservation schedules the notifications +/// of fresh values to your application. +/// +/// See ValueObservation. +public enum ValueScheduling { + /// All values are notified on the main queue. + /// + /// If the observation starts on the main queue, initial values are + /// notified right upon subscription, synchronously: + /// + /// // On main queue + /// let observation = ValueObservation.forAll(Player.all()) + /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// print("fresh players: /(players)") + /// } + /// // <- here "fresh players" is already printed. + /// + /// If the observation does not start on the main queue, initial values + /// are asynchronously notified on the main queue: + /// + /// // Not on the main queue: "fresh players" is eventually printed + /// // on the main queue. + /// let observation = ValueObservation.forAll(Player.all()) + /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// print("fresh players: /(players)") + /// } + /// + /// When the database changes, fresh values are asynchronously notified: + /// + /// // Eventually prints "fresh players" on the main queue + /// try dbQueue.write { db in + /// try Player(...).insert(db) + /// } + case mainQueue - /// Initial value is immediately fetched, and notified on the current dispatch queue. - case immediateOnCurrentQueue - - /// Initial value is immediately fetched, and asynchronously notified. - case deferred + /// All values are asychronously notified on the specified queue. + /// Initial values are only fetched and notified if `startImmediately` + /// is true. + /// + /// Correct ordering of notifications is only guaranteed if the queue + /// is serial. + case onQueue(DispatchQueue, startImmediately: Bool) } +extension DispatchQueue { + private static var mainKey: DispatchSpecificKey<()> = { + let key = DispatchSpecificKey<()>() + DispatchQueue.main.setSpecific(key: key, value: ()) + return key + }() + + static var isMain: Bool { + return DispatchQueue.getSpecific(key: mainKey) != nil + } +} + + /// TODO: doc public protocol ValueReducer { associatedtype Fetched @@ -40,7 +85,6 @@ public struct AnyValueReducer: ValueReducer { self._value = value } - /// TODO: doc public init(_ reducer: Reducer) where Reducer.Fetched == Fetched, Reducer.Value == Value { var reducer = reducer self._fetch = { try reducer.fetch($0) } @@ -82,71 +126,63 @@ public struct ValueObservation { /// observer is deallocated. public var extent = Database.TransactionObservationExtent.observerLifetime - /// The dispatch queue where change callbacks are called. Default is the - /// main queue. + /// `scheduling` controls how fresh values are notified. + /// Default is `.mainQueue`: /// - /// When *initialDispatch* is `.immediateOnCurrentQueue`, the first value is - /// dispatched on the dispatch queue which starts the observation, - /// regardless of this property. - public var queue = DispatchQueue.main + /// - `.mainQueue`: all values are notified on the main queue. + /// + /// If the observation starts on the main queue, initial values are + /// notified right upon subscription, synchronously: + /// + /// // On main queue + /// let observation = ValueObservation.forAll(Player.all()) + /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// print("fresh players: /(players)") + /// } + /// // <- here "fresh players" is already printed. + /// + /// If the observation does not start on the main queue, initial values + /// are asynchronously notified on the main queue: + /// + /// // Not on the main queue: "fresh players" is eventually printed + /// // on the main queue. + /// let observation = ValueObservation.forAll(Player.all()) + /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// print("fresh players: /(players)") + /// } + /// + /// When the database changes, fresh values are asynchronously notified: + /// + /// // Eventually prints "fresh players" on the main queue + /// try dbQueue.write { db in + /// try Player(...).insert(db) + /// } + /// + /// - `.onQueue(_:startImmediately:)`: all values are asychronously notified + /// on the specified queue. Initial values are only fetched and notified if + /// `startImmediately` is true. + /// + /// Correct ordering of notifications is only guaranteed if the queue + /// is serial. + public var scheduling: ValueScheduling = .mainQueue - /// The quality of service. - public var qos: DispatchQoS + /// The dispatch queue where change callbacks are called. + public var notificatinQueue: DispatchQueue { + switch scheduling { + case .mainQueue: + return DispatchQueue.main + case .onQueue(let queue, startImmediately: _): + return queue + } + } - /// `initialDispatch` controls how initial value is dispatched when - /// observation starts with the `add(observation:)` method: - /// - /// - When `.immediateOnCurrentQueue` (the default), initial value is - /// fetched right away, and notified synchronously, on the dispatch queue - /// which starts the observation. - /// - /// - When `.deferred`, initial value is fetched right away, and - /// notified asynchronously, on *queue*. - /// - /// - When `.none`, initial value is not fetched, and not notified. - public var initialDispatch = InitialDispatch.immediateOnCurrentQueue - - /// Creates a ValueObservation which observes *region*, and notifies the - /// values returned by the *fetch* closure whenever the observed region is - /// impacted by a database transaction. - /// - /// For example: - /// - /// let observation = ValueObservation( - /// observing: { db in try Player.all().databaseRegion(db) }, - /// fetch: { db in try Player.fetchAll(db) }) - /// - /// let observer = dbQueue.add(observation: observation) { player: [Player] in - /// print("players have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter region: a closure that returns the observed region. - /// - parameter fetch: a closure that fetches a value. + // This initializer is not public. See ValueObservation.observing(_:reducer:) init( observing region: @escaping (Database) throws -> DatabaseRegion, reducer: Reducer) { self.observedRegion = region self.reducer = reducer - - // TODO: read https://developer.apple.com/library/archive/documentation/Performance/Conceptual/EnergyGuide-iOS/PrioritizeWorkWithQoS.html - // and pick a sensible default qos - if #available(OSX 10.10, *) { - self.qos = .default - } else { - self.qos = .unspecified - } } /// Creates a ValueObservation which observes *region*, and notifies the @@ -159,7 +195,7 @@ public struct ValueObservation { /// observing: { db in try Player.all().databaseRegion(db) }, /// fetch: { db in try Player.fetchAll(db) }) /// - /// let observer = dbQueue.add(observation: observation) { player: [Player] in + /// let observer = try dbQueue.add(observation: observation) { player: [Player] in /// print("players have changed") /// } /// @@ -366,7 +402,7 @@ extension ValueObservation { /// observing: { db in try Player.all().databaseRegion(db) }, /// fetch: { db in try Player.fetchAll(db) }) /// - /// let observer = dbQueue.add(observation: observation) { player: [Player] in + /// let observer = try dbQueue.add(observation: observation) { player: [Player] in /// print("players have changed") /// } /// @@ -409,7 +445,7 @@ extension ValueObservation where Reducer == Void { /// Player.all(), /// fetch: { db in return try Player.fetchAll(db) }) /// - /// let observer = dbQueue.add(observation: observation) { player: [Player] in + /// let observer = try dbQueue.add(observation: observation) { player: [Player] in /// print("players have changed") /// } /// @@ -452,7 +488,7 @@ extension ValueObservation where Reducer == Void { /// withUniquing: Player.all(), /// fetch: { db in return try Player.fetchAll(db) }) /// - /// let observer = dbQueue.add(observation: observation) { player: [Player] in + /// let observer = try dbQueue.add(observation: observation) { player: [Player] in /// print("players have changed") /// } /// @@ -498,7 +534,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.forCount(request) /// - /// let observer = dbQueue.add(observation: observation) { count: Int in + /// let observer = try dbQueue.add(observation: observation) { count: Int in /// print("number of players has changed") /// } /// @@ -531,7 +567,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.forCount(withUniquing: request) /// - /// let observer = dbQueue.add(observation: observation) { count: Int in + /// let observer = try dbQueue.add(observation: observation) { count: Int in /// print("number of players has changed") /// } /// @@ -568,7 +604,7 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player") /// let observation = ValueObservation.forAll(request) /// - /// let observer = dbQueue.add(observation: observation) { rows: [Row] in + /// let observer = try dbQueue.add(observation: observation) { rows: [Row] in /// print("players have changed") /// } /// @@ -602,7 +638,7 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player") /// let observation = ValueObservation.forAll(withUniquing: request) /// - /// let observer = dbQueue.add(observation: observation) { rows: [Row] in + /// let observer = try dbQueue.add(observation: observation) { rows: [Row] in /// print("players have changed") /// } /// @@ -636,7 +672,7 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) /// let observation = ValueObservation.forOne(request) /// - /// let observer = dbQueue.add(observation: observation) { row: Row? in + /// let observer = try dbQueue.add(observation: observation) { row: Row? in /// print("players have changed") /// } /// @@ -670,7 +706,7 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) /// let observation = ValueObservation.forOne(withUniquing: request) /// - /// let observer = dbQueue.add(observation: observation) { row: Row? in + /// let observer = try dbQueue.add(observation: observation) { row: Row? in /// print("players have changed") /// } /// @@ -709,7 +745,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.forAll(request) /// - /// let observer = dbQueue.add(observation: observation) { players: [Player] in + /// let observer = try dbQueue.add(observation: observation) { players: [Player] in /// print("players have changed") /// } /// @@ -744,7 +780,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.forAll(withUniquing: request) /// - /// let observer = dbQueue.add(observation: observation) { players: [Player] in + /// let observer = try dbQueue.add(observation: observation) { players: [Player] in /// print("players have changed") /// } /// @@ -778,7 +814,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.filter(key: 1) /// let observation = ValueObservation.forOne(request) /// - /// let observer = dbQueue.add(observation: observation) { player: Player? in + /// let observer = try dbQueue.add(observation: observation) { player: Player? in /// print("player has changed") /// } /// @@ -812,7 +848,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.filter(key: 1) /// let observation = ValueObservation.forOne(withUniquing: request) /// - /// let observer = dbQueue.add(observation: observation) { player: Player? in + /// let observer = try dbQueue.add(observation: observation) { player: Player? in /// print("player has changed") /// } /// @@ -851,7 +887,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(request) /// - /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.add(observation: observation) { names: [String] in /// print("player name have changed") /// } /// @@ -886,7 +922,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(withUniquing: request) /// - /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.add(observation: observation) { names: [String] in /// print("player name have changed") /// } /// @@ -920,7 +956,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(max(Column("score")), as: Int.self) /// let observation = ValueObservation.forOne(request) /// - /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in + /// let observer = try dbQueue.add(observation: observation) { maxScore: Int? in /// print("maximum score has changed") /// } /// @@ -954,7 +990,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(max(Column("score")), as: Int.self) /// let observation = ValueObservation.forOne(withUniquing: request) /// - /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in + /// let observer = try dbQueue.add(observation: observation) { maxScore: Int? in /// print("maximum score has changed") /// } /// @@ -993,7 +1029,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(request) /// - /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.add(observation: observation) { names: [String] in /// print("player name have changed") /// } /// @@ -1027,7 +1063,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(max(Column("score")), as: Int.self) /// let observation = ValueObservation.forOne(request) /// - /// let observer = dbQueue.add(observation: observation) { maxScore: Int? in + /// let observer = try dbQueue.add(observation: observation) { maxScore: Int? in /// print("maximum score has changed") /// } /// @@ -1066,7 +1102,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(request) /// - /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.add(observation: observation) { names: [String] in /// print("player name have changed") /// } /// @@ -1102,7 +1138,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(withUniquing: request) /// - /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.add(observation: observation) { names: [String] in /// print("player name have changed") /// } /// @@ -1142,7 +1178,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(request) /// - /// let observer = dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.add(observation: observation) { names: [String] in /// print("player name have changed") /// } /// From 09581c6ae0d8ee2e5c220ca5fe175ef039641b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 11:45:49 +0100 Subject: [PATCH 023/109] ValueObservation factory requires a DatabaseRegionConvertible. Introduce AnyDatabaseRegionConvertible. --- GRDB/Core/DatabaseRegion.swift | 18 +++++++++ GRDB/Core/ValueObservation.swift | 64 ++++++++------------------------ 2 files changed, 34 insertions(+), 48 deletions(-) diff --git a/GRDB/Core/DatabaseRegion.swift b/GRDB/Core/DatabaseRegion.swift index f15f01ce9..613796e9d 100644 --- a/GRDB/Core/DatabaseRegion.swift +++ b/GRDB/Core/DatabaseRegion.swift @@ -312,3 +312,21 @@ extension DatabaseRegion: DatabaseRegionConvertible { return self } } + +/// A type-erased DatabaseRegionConvertible +public struct AnyDatabaseRegionConvertible: DatabaseRegionConvertible { + let _region: (Database) throws -> DatabaseRegion + + public init(_ region: @escaping (Database) throws -> DatabaseRegion) { + _region = region + } + + public init(_ region: DatabaseRegionConvertible) { + _region = { try region.databaseRegion($0) } + } + + /// :nodoc: + public func databaseRegion(_ db: Database) throws -> DatabaseRegion { + return try _region(db) + } +} diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index ac5bd52d9..bce63c47a 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -185,15 +185,20 @@ public struct ValueObservation { self.reducer = reducer } - /// Creates a ValueObservation which observes *region*, and notifies the - /// values returned by the *fetch* closure whenever the observed region is + /// Returs a ValueObservation which observes *regions*, and notifies the + /// values returned by the *reducer* whenever the observed region is /// impacted by a database transaction. /// + /// This method is the most fundamental way to create a ValueObservation. + /// /// For example: /// + /// let reducer = AnyValueReducer( + /// fetch: { db in try Player.fetchAll(db) }, + /// value: { player in players }) /// let observation = ValueObservation( - /// observing: { db in try Player.all().databaseRegion(db) }, - /// fetch: { db in try Player.fetchAll(db) }) + /// observing: Player.all(), + /// reducer: reducer) /// /// let observer = try dbQueue.add(observation: observation) { player: [Player] in /// print("players have changed") @@ -213,10 +218,16 @@ public struct ValueObservation { /// - parameter region: a closure that returns the observed region. /// - parameter fetch: a closure that fetches a value. public static func observing( - _ region: @escaping (Database) throws -> DatabaseRegion, + _ regions: DatabaseRegionConvertible..., reducer: Reducer) -> ValueObservation { + func region(_ db: Database) throws -> DatabaseRegion { + return try regions.reduce(into: DatabaseRegion()) { union, region in + try union.formUnion(region.databaseRegion(db)) + } + } + return ValueObservation(observing: region, reducer: reducer) } } @@ -391,49 +402,6 @@ public enum ValueReducers { // MARK: - DatabaseRegionConvertible Observation -extension ValueObservation { - /// Creates a ValueObservation which observes *region*, and notifies the - /// values returned by the *fetch* closure whenever the observed region is - /// impacted by a database transaction. - /// - /// For example: - /// - /// let observation = ValueObservation( - /// observing: { db in try Player.all().databaseRegion(db) }, - /// fetch: { db in try Player.fetchAll(db) }) - /// - /// let observer = try dbQueue.add(observation: observation) { player: [Player] in - /// print("players have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter region: a closure that returns the observed region. - /// - parameter fetch: a closure that fetches a value. - public static func observing( - _ regions: DatabaseRegionConvertible..., - reducer: Reducer) - -> ValueObservation - { - func region(_ db: Database) throws -> DatabaseRegion { - return try regions.reduce(into: DatabaseRegion()) { union, region in - try union.formUnion(region.databaseRegion(db)) - } - } - - return ValueObservation(observing: region, reducer: reducer) - } -} - extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *regions*, and notifies the /// values returned by the *fetch* closure whenever one of the observed From 26ba5768b2b3455ceb3fbfcda3fa47935f0f30b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 13:26:40 +0100 Subject: [PATCH 024/109] whitespace --- Tests/GRDBTests/DatabaseRegionTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/GRDBTests/DatabaseRegionTests.swift b/Tests/GRDBTests/DatabaseRegionTests.swift index 4f7d992ee..47744ced9 100644 --- a/Tests/GRDBTests/DatabaseRegionTests.swift +++ b/Tests/GRDBTests/DatabaseRegionTests.swift @@ -443,7 +443,7 @@ class DatabaseRegionTests : GRDBTestCase { try XCTAssertEqual(request.databaseRegion(db).description, "a(id,name),b(aid,id,name)[1],c(aid,id,name)") } } - } + } func testDatabaseRegionOfDerivedRequests() throws { let dbQueue = try makeDatabaseQueue() From e0a9cced4a0c13e82bd4c4d6c7460f1fa58ff297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 13:27:43 +0100 Subject: [PATCH 025/109] First tests for ValueObservation: focus on reducers --- GRDB.xcodeproj/project.pbxproj | 38 ++++++ GRDB/Core/DatabaseWriter.swift | 17 +-- GRDB/Core/ValueObservation.swift | 2 +- GRDBCipher.xcodeproj/project.pbxproj | 58 +++++++++ GRDBCustom.xcodeproj/project.pbxproj | 38 ++++++ .../ValueObservationExtentTests.swift | 16 +++ .../ValueObservationFetchTests.swift | 19 +++ .../ValueObservationReadonlyTests.swift | 16 +++ .../ValueObservationReducerTests.swift | 119 ++++++++++++++++++ .../ValueObservationSchedulingTests.swift | 16 +++ 10 files changed, 326 insertions(+), 13 deletions(-) create mode 100644 Tests/GRDBTests/ValueObservationExtentTests.swift create mode 100644 Tests/GRDBTests/ValueObservationFetchTests.swift create mode 100644 Tests/GRDBTests/ValueObservationReadonlyTests.swift create mode 100644 Tests/GRDBTests/ValueObservationReducerTests.swift create mode 100644 Tests/GRDBTests/ValueObservationSchedulingTests.swift diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index 446658852..ced845cbc 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -119,6 +119,16 @@ 563B06AB217EF0CC00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* ValueObservation.swift */; }; 563B06AC217EF0CC00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* ValueObservation.swift */; }; 563B06AD217EF0CC00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06AA217EF0CC00B38F35 /* ValueObservation.swift */; }; + 563B06BD2185CCD300B38F35 /* ValueObservationReducerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06BC2185CCD300B38F35 /* ValueObservationReducerTests.swift */; }; + 563B06BE2185CCD300B38F35 /* ValueObservationReducerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06BC2185CCD300B38F35 /* ValueObservationReducerTests.swift */; }; + 563B06C32185D29F00B38F35 /* ValueObservationExtentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C02185D29F00B38F35 /* ValueObservationExtentTests.swift */; }; + 563B06C42185D29F00B38F35 /* ValueObservationExtentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C02185D29F00B38F35 /* ValueObservationExtentTests.swift */; }; + 563B06C52185D29F00B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C12185D29F00B38F35 /* ValueObservationSchedulingTests.swift */; }; + 563B06C62185D29F00B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C12185D29F00B38F35 /* ValueObservationSchedulingTests.swift */; }; + 563B06C72185D29F00B38F35 /* ValueObservationReadonlyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C22185D29F00B38F35 /* ValueObservationReadonlyTests.swift */; }; + 563B06C82185D29F00B38F35 /* ValueObservationReadonlyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C22185D29F00B38F35 /* ValueObservationReadonlyTests.swift */; }; + 563B06CA2185D2E500B38F35 /* ValueObservationFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */; }; + 563B06CB2185D2E500B38F35 /* ValueObservationFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */; }; 563EF415215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF416215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF417215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; @@ -893,6 +903,11 @@ 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionObserverSavepointsTests.swift; sourceTree = ""; }; 5636E9BB1D22574100B9B05F /* FetchRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchRequest.swift; sourceTree = ""; }; 563B06AA217EF0CC00B38F35 /* ValueObservation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValueObservation.swift; sourceTree = ""; }; + 563B06BC2185CCD300B38F35 /* ValueObservationReducerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValueObservationReducerTests.swift; sourceTree = ""; }; + 563B06C02185D29F00B38F35 /* ValueObservationExtentTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationExtentTests.swift; sourceTree = ""; }; + 563B06C12185D29F00B38F35 /* ValueObservationSchedulingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationSchedulingTests.swift; sourceTree = ""; }; + 563B06C22185D29F00B38F35 /* ValueObservationReadonlyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationReadonlyTests.swift; sourceTree = ""; }; + 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationFetchTests.swift; sourceTree = ""; }; 563EF414215F87EB007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF42C2161180D007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF43E216131D1007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1454,6 +1469,18 @@ name = DatabaseQueue; sourceTree = ""; }; + 563B06BF2185CD1700B38F35 /* ValueObservation */ = { + isa = PBXGroup; + children = ( + 563B06C02185D29F00B38F35 /* ValueObservationExtentTests.swift */, + 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */, + 563B06C22185D29F00B38F35 /* ValueObservationReadonlyTests.swift */, + 563B06BC2185CCD300B38F35 /* ValueObservationReducerTests.swift */, + 563B06C12185D29F00B38F35 /* ValueObservationSchedulingTests.swift */, + ); + name = ValueObservation; + sourceTree = ""; + }; 5653EABF20944B1300F46237 /* Association */ = { isa = PBXGroup; children = ( @@ -1625,6 +1652,7 @@ 56A238201B9C74A90082EB20 /* Statement */, 56E8CE0F1BB4FE5B00828BEC /* StatementColumnConvertibleFetchTests.swift */, 5607EFD11BB8253300605DE3 /* TransactionObserver */, + 563B06BF2185CD1700B38F35 /* ValueObservation */, ); name = Core; sourceTree = ""; @@ -2603,6 +2631,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 563B06C82185D29F00B38F35 /* ValueObservationReadonlyTests.swift in Sources */, 6340BF841E5E3F7900832805 /* RecordPersistenceConflictPolicy.swift in Sources */, 56300B861C54DC95005A543B /* Record+QueryInterfaceRequestTests.swift in Sources */, 56F26C1C1CEE3F32007969C4 /* RowAdapterTests.swift in Sources */, @@ -2663,6 +2692,7 @@ 567F45AC1F888B2600030B59 /* TruncateOptimizationTests.swift in Sources */, 5657AB621D108BA9006283EF /* FoundationNSURLTests.swift in Sources */, 5657AB6A1D108BA9006283EF /* FoundationURLTests.swift in Sources */, + 563B06C42185D29F00B38F35 /* ValueObservationExtentTests.swift in Sources */, 564FCE5F20F7E11B00202B90 /* DatabaseValueConversionErrorTests.swift in Sources */, 5653EADF20944B4F00F46237 /* AssociationHasOneSQLDerivationTests.swift in Sources */, 56F3E74D1E66F83A00BF0F01 /* ResultCodeTests.swift in Sources */, @@ -2687,6 +2717,7 @@ 565D5D721BBC694D00DC9BD4 /* Row+FoundationTests.swift in Sources */, 5623936D1DEE0CD200A6B01F /* FlattenCursorTests.swift in Sources */, 567A80571D41350C00C7DCEC /* IndexInfoTests.swift in Sources */, + 563B06CB2185D2E500B38F35 /* ValueObservationFetchTests.swift in Sources */, 5623935B1DEE013C00A6B01F /* FilterCursorTests.swift in Sources */, 5674A72D1F30A9090095F066 /* FetchableRecordDecodableTests.swift in Sources */, 566A84412041914000E50BFD /* MutablePersistableRecordChangesTests.swift in Sources */, @@ -2742,6 +2773,7 @@ 5623931C1DECC02000A6B01F /* RowFetchTests.swift in Sources */, 5653EAD720944B4F00F46237 /* AssociationChainRowScopesTests.swift in Sources */, 562393641DEE06D300A6B01F /* CursorTests.swift in Sources */, + 563B06C62185D29F00B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5657AB5A1D108BA9006283EF /* FoundationNSStringTests.swift in Sources */, 56300B6C1C53D3E8005A543B /* TableRecord+QueryInterfaceRequestTests.swift in Sources */, 5674A7231F30A8DF0095F066 /* MutablePersistableRecordEncodableTests.swift in Sources */, @@ -2755,6 +2787,7 @@ 56A2383A1B9C74A90082EB20 /* DatabaseQueueInMemoryTests.swift in Sources */, 56A5E40A1BA2BCF900707640 /* RecordWithColumnNameManglingTests.swift in Sources */, 5653EAF520944B4F00F46237 /* AssociationParallelSQLTests.swift in Sources */, + 563B06BE2185CCD300B38F35 /* ValueObservationReducerTests.swift in Sources */, 56FF455A1D2CDA5200F21EF9 /* RecordUniqueIndexTests.swift in Sources */, 56B7F42A1BE14A1900E39BBF /* CGFloatTests.swift in Sources */, 5605F1881C69111300235C62 /* DatabaseRegionTests.swift in Sources */, @@ -2770,6 +2803,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 563B06C72185D29F00B38F35 /* ValueObservationReadonlyTests.swift in Sources */, 6340BF801E5E3F7900832805 /* RecordPersistenceConflictPolicy.swift in Sources */, 56D496771D81309E008276D7 /* RecordInitializersTests.swift in Sources */, 56D496651D813076008276D7 /* DatabaseMigratorTests.swift in Sources */, @@ -2830,6 +2864,7 @@ 56D4968A1D81316E008276D7 /* DatabaseValueConvertibleSubclassTests.swift in Sources */, 56D496601D81304E008276D7 /* FoundationNSUUIDTests.swift in Sources */, 567F45A81F888B2600030B59 /* TruncateOptimizationTests.swift in Sources */, + 563B06C32185D29F00B38F35 /* ValueObservationExtentTests.swift in Sources */, 56D4968D1D81316E008276D7 /* DatabaseFunctionTests.swift in Sources */, 564FCE5E20F7E11B00202B90 /* DatabaseValueConversionErrorTests.swift in Sources */, 5653EADE20944B4F00F46237 /* AssociationHasOneSQLDerivationTests.swift in Sources */, @@ -2854,6 +2889,7 @@ 5653EAF220944B4F00F46237 /* AssociationBelongsToDecodableRecordTests.swift in Sources */, 56D496851D813147008276D7 /* StatementArgumentsTests.swift in Sources */, 56D496B81D813465008276D7 /* DataMemoryTests.swift in Sources */, + 563B06CA2185D2E500B38F35 /* ValueObservationFetchTests.swift in Sources */, 56D496541D812F5B008276D7 /* SQLExpressionLiteralTests.swift in Sources */, 56D496961D81317B008276D7 /* PersistableRecordTests.swift in Sources */, 5698AC9E1DA4B0430056AF8C /* FTS4TableBuilderTests.swift in Sources */, @@ -2909,6 +2945,7 @@ 56D496B41D8133F8008276D7 /* DatabaseTests.swift in Sources */, 56D496951D81317B008276D7 /* MutablePersistableRecordTests.swift in Sources */, 5653EAD620944B4F00F46237 /* AssociationChainRowScopesTests.swift in Sources */, + 563B06C52185D29F00B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5698AC801DA380A20056AF8C /* VirtualTableModuleTests.swift in Sources */, 56D496821D813131008276D7 /* TransactionObserverTests.swift in Sources */, 56D496941D81317B008276D7 /* SchedulingWatchdogTests.swift in Sources */, @@ -2922,6 +2959,7 @@ 5653EAD820944B4F00F46237 /* AssociationBelongsToRowScopeTests.swift in Sources */, 562205F11E420E47005860AC /* DatabasePoolReleaseMemoryTests.swift in Sources */, 5653EAF420944B4F00F46237 /* AssociationParallelSQLTests.swift in Sources */, + 563B06BD2185CCD300B38F35 /* ValueObservationReducerTests.swift in Sources */, 56D496971D81317B008276D7 /* DatabaseReaderTests.swift in Sources */, 56D496911D81316E008276D7 /* RowFromStatementTests.swift in Sources */, 56071A411DB54ED000CA6E47 /* FetchedRecordsControllerTests.swift in Sources */, diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 0f900f8d9..187e60f87 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -293,7 +293,11 @@ private class ValueObserver: TransactionObserver { self.notificationQueue = notificationQueue self.onChange = onChange self.onError = onError - self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation", qos: notificationQueue.qos) + if #available(OSX 10.10, *) { + self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation", qos: notificationQueue.qos) + } else { + self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation") + } } func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { @@ -449,15 +453,4 @@ public final class AnyDatabaseWriter : DatabaseWriter { public func remove(collation: DatabaseCollation) { base.remove(collation: collation) } - - // MARK: - Value Observation - - public func add( - observation: ValueObservation, - onError: ((Error) -> Void)? = nil, - onChange: @escaping (Reducer.Value) -> Void) - throws -> TransactionObserver - { - return try base.add(observation: observation, onError: onError, onChange: onChange) - } } diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index bce63c47a..e8931ee34 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -119,7 +119,7 @@ public struct ValueObservation { /// Default is true. Set this property to false when the *fetch* closure /// requires write access, and should be executed inside a savepoint. - var readonly: Bool = true + public var readonly: Bool = true /// The extent of the database observation. The default is /// `.observerLifetime`: once started, the observation lasts until the diff --git a/GRDBCipher.xcodeproj/project.pbxproj b/GRDBCipher.xcodeproj/project.pbxproj index 1c579c2d0..727963078 100755 --- a/GRDBCipher.xcodeproj/project.pbxproj +++ b/GRDBCipher.xcodeproj/project.pbxproj @@ -182,6 +182,26 @@ 5636E9C01D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; 563B06B6217F3C5A00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B4217F3C5900B38F35 /* ValueObservation.swift */; }; 563B06B7217F3C5A00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B4217F3C5900B38F35 /* ValueObservation.swift */; }; + 563B06E12185E07200B38F35 /* ValueObservationExtentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DC2185E07100B38F35 /* ValueObservationExtentTests.swift */; }; + 563B06E22185E07200B38F35 /* ValueObservationExtentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DC2185E07100B38F35 /* ValueObservationExtentTests.swift */; }; + 563B06E32185E07300B38F35 /* ValueObservationExtentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DC2185E07100B38F35 /* ValueObservationExtentTests.swift */; }; + 563B06E42185E07300B38F35 /* ValueObservationExtentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DC2185E07100B38F35 /* ValueObservationExtentTests.swift */; }; + 563B06E52185E07300B38F35 /* ValueObservationReadonlyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DD2185E07200B38F35 /* ValueObservationReadonlyTests.swift */; }; + 563B06E62185E07300B38F35 /* ValueObservationReadonlyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DD2185E07200B38F35 /* ValueObservationReadonlyTests.swift */; }; + 563B06E72185E07300B38F35 /* ValueObservationReadonlyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DD2185E07200B38F35 /* ValueObservationReadonlyTests.swift */; }; + 563B06E82185E07300B38F35 /* ValueObservationReadonlyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DD2185E07200B38F35 /* ValueObservationReadonlyTests.swift */; }; + 563B06E92185E07300B38F35 /* ValueObservationFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DE2185E07200B38F35 /* ValueObservationFetchTests.swift */; }; + 563B06EA2185E07300B38F35 /* ValueObservationFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DE2185E07200B38F35 /* ValueObservationFetchTests.swift */; }; + 563B06EB2185E07300B38F35 /* ValueObservationFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DE2185E07200B38F35 /* ValueObservationFetchTests.swift */; }; + 563B06EC2185E07300B38F35 /* ValueObservationFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DE2185E07200B38F35 /* ValueObservationFetchTests.swift */; }; + 563B06ED2185E07300B38F35 /* ValueObservationReducerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */; }; + 563B06EE2185E07300B38F35 /* ValueObservationReducerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */; }; + 563B06EF2185E07300B38F35 /* ValueObservationReducerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */; }; + 563B06F02185E07300B38F35 /* ValueObservationReducerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */; }; + 563B06F12185E07300B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */; }; + 563B06F22185E07300B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */; }; + 563B06F32185E07300B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */; }; + 563B06F42185E07300B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */; }; 563EF424215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF425215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF43C2161183E007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF43A2161183E007DAACD /* AssociationAggregate.swift */; }; @@ -991,6 +1011,11 @@ 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionObserverSavepointsTests.swift; sourceTree = ""; }; 5636E9BB1D22574100B9B05F /* FetchRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchRequest.swift; sourceTree = ""; }; 563B06B4217F3C5900B38F35 /* ValueObservation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservation.swift; sourceTree = ""; }; + 563B06DC2185E07100B38F35 /* ValueObservationExtentTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationExtentTests.swift; sourceTree = ""; }; + 563B06DD2185E07200B38F35 /* ValueObservationReadonlyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationReadonlyTests.swift; sourceTree = ""; }; + 563B06DE2185E07200B38F35 /* ValueObservationFetchTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationFetchTests.swift; sourceTree = ""; }; + 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationReducerTests.swift; sourceTree = ""; }; + 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationSchedulingTests.swift; sourceTree = ""; }; 563EF422215F8A88007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF43A2161183E007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF44421613212007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1522,6 +1547,18 @@ name = DatabaseQueue; sourceTree = ""; }; + 563B06F52185E07C00B38F35 /* ValueObservation */ = { + isa = PBXGroup; + children = ( + 563B06DC2185E07100B38F35 /* ValueObservationExtentTests.swift */, + 563B06DE2185E07200B38F35 /* ValueObservationFetchTests.swift */, + 563B06DD2185E07200B38F35 /* ValueObservationReadonlyTests.swift */, + 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */, + 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */, + ); + name = ValueObservation; + sourceTree = ""; + }; 5653EB8420961FBF00F46237 /* Association */ = { isa = PBXGroup; children = ( @@ -1678,6 +1715,7 @@ 56A238201B9C74A90082EB20 /* Statement */, 56E8CE0F1BB4FE5B00828BEC /* StatementColumnConvertibleFetchTests.swift */, 5607EFD11BB8253300605DE3 /* TransactionObserver */, + 563B06F52185E07C00B38F35 /* ValueObservation */, ); name = Core; sourceTree = ""; @@ -2352,7 +2390,9 @@ 56D5075F1F6BAE8600AE1C5B /* PrimaryKeyInfoTests.swift in Sources */, 56176C631EACCCC7000F3F2B /* FTS5TokenizerTests.swift in Sources */, 5623934F1DEDFEFB00A6B01F /* EnumeratedCursorTests.swift in Sources */, + 563B06ED2185E07300B38F35 /* ValueObservationReducerTests.swift in Sources */, 560FC57C1CB00B880014AA8E /* StatementArgumentsTests.swift in Sources */, + 563B06E52185E07300B38F35 /* ValueObservationReadonlyTests.swift in Sources */, 567F45A91F888B2600030B59 /* TruncateOptimizationTests.swift in Sources */, 5634B1081CF9B970005360B9 /* TransactionObserverSavepointsTests.swift in Sources */, 560FC57D1CB00B880014AA8E /* RecordInitializersTests.swift in Sources */, @@ -2396,8 +2436,10 @@ 560FC58E1CB00B880014AA8E /* RecordPrimaryKeyRowIDTests.swift in Sources */, 560FC58F1CB00B880014AA8E /* DatabaseReaderTests.swift in Sources */, 5653EBD020961FE800F46237 /* AssociationRowScopeSearchTests.swift in Sources */, + 563B06E12185E07200B38F35 /* ValueObservationExtentTests.swift in Sources */, 560FC5901CB00B880014AA8E /* RecordEditedTests.swift in Sources */, 5665FA412129EEEF004D8612 /* DatabaseDateEncodingStrategyTests.swift in Sources */, + 563B06F12185E07300B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5644DE8220F8D1E4001FFDDE /* DatabaseValueConversionErrorTests.swift in Sources */, 560FC5911CB00B880014AA8E /* RecordPrimaryKeySingleWithReplaceConflictResolutionTests.swift in Sources */, 56CC924C201E059100CB597E /* DropFirstCursorTests.swift in Sources */, @@ -2422,6 +2464,7 @@ 560FC59B1CB00B880014AA8E /* DatabaseTimestampTests.swift in Sources */, 5698AC411DA2BED90056AF8C /* FTS3PatternTests.swift in Sources */, 5623936A1DEE0CD200A6B01F /* FlattenCursorTests.swift in Sources */, + 563B06E92185E07300B38F35 /* ValueObservationFetchTests.swift in Sources */, 560FC59C1CB00B880014AA8E /* StatementArguments+FoundationTests.swift in Sources */, 5657AB671D108BA9006283EF /* FoundationURLTests.swift in Sources */, 560FC59D1CB00B880014AA8E /* TableRecord+QueryInterfaceRequestTests.swift in Sources */, @@ -2519,7 +2562,9 @@ 56D507601F6BAE8600AE1C5B /* PrimaryKeyInfoTests.swift in Sources */, 56176C691EACCCC8000F3F2B /* FTS5TokenizerTests.swift in Sources */, 562393501DEDFEFB00A6B01F /* EnumeratedCursorTests.swift in Sources */, + 563B06EE2185E07300B38F35 /* ValueObservationReducerTests.swift in Sources */, 5671563A1CB16729007DC145 /* StatementArgumentsTests.swift in Sources */, + 563B06E62185E07300B38F35 /* ValueObservationReadonlyTests.swift in Sources */, 567F45AA1F888B2600030B59 /* TruncateOptimizationTests.swift in Sources */, 5657AB601D108BA9006283EF /* FoundationNSURLTests.swift in Sources */, 5671563B1CB16729007DC145 /* RecordInitializersTests.swift in Sources */, @@ -2563,8 +2608,10 @@ 5671564F1CB16729007DC145 /* RecordEditedTests.swift in Sources */, 567156501CB16729007DC145 /* RecordPrimaryKeySingleWithReplaceConflictResolutionTests.swift in Sources */, 5653EBD120961FE800F46237 /* AssociationRowScopeSearchTests.swift in Sources */, + 563B06E22185E07200B38F35 /* ValueObservationExtentTests.swift in Sources */, 567156511CB16729007DC145 /* FetchableRecordTests.swift in Sources */, 5665FA422129EEEF004D8612 /* DatabaseDateEncodingStrategyTests.swift in Sources */, + 563B06F22185E07300B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5644DE8320F8D1E4001FFDDE /* DatabaseValueConversionErrorTests.swift in Sources */, 56A8C2441D1918EE0096E9D4 /* FoundationUUIDTests.swift in Sources */, 56CC924D201E059100CB597E /* DropFirstCursorTests.swift in Sources */, @@ -2589,6 +2636,7 @@ 567156571CB16729007DC145 /* RecordMinimalPrimaryKeySingleTests.swift in Sources */, 5698AC421DA2BED90056AF8C /* FTS3PatternTests.swift in Sources */, 5623936B1DEE0CD200A6B01F /* FlattenCursorTests.swift in Sources */, + 563B06EA2185E07300B38F35 /* ValueObservationFetchTests.swift in Sources */, 567156591CB16729007DC145 /* DatabaseTimestampTests.swift in Sources */, 5671565A1CB16729007DC145 /* StatementArguments+FoundationTests.swift in Sources */, 5657AB581D108BA9006283EF /* FoundationNSStringTests.swift in Sources */, @@ -2802,7 +2850,9 @@ 56CC9238201E009900CB597E /* DropWhileCursorTests.swift in Sources */, 56D507631F6BAE8600AE1C5B /* PrimaryKeyInfoTests.swift in Sources */, 56176C751EACCCCA000F3F2B /* FTS5TokenizerTests.swift in Sources */, + 563B06EF2185E07300B38F35 /* ValueObservationReducerTests.swift in Sources */, 56AFCA4D1CB1AA9900F48B96 /* DatabasePoolReadOnlyTests.swift in Sources */, + 563B06E72185E07300B38F35 /* ValueObservationReadonlyTests.swift in Sources */, 5657AB631D108BA9006283EF /* FoundationNSURLTests.swift in Sources */, 567F45AD1F888B2600030B59 /* TruncateOptimizationTests.swift in Sources */, 5657AB6B1D108BA9006283EF /* FoundationURLTests.swift in Sources */, @@ -2846,8 +2896,10 @@ 56AFCA5D1CB1AA9900F48B96 /* DatabaseReaderTests.swift in Sources */, 56A8C2491D1918F10096E9D4 /* FoundationNSUUIDTests.swift in Sources */, 5653EBD220961FE800F46237 /* AssociationRowScopeSearchTests.swift in Sources */, + 563B06E32185E07300B38F35 /* ValueObservationExtentTests.swift in Sources */, 56AFCA5E1CB1AA9900F48B96 /* FetchableRecordTests.swift in Sources */, 5665FA432129EEEF004D8612 /* DatabaseDateEncodingStrategyTests.swift in Sources */, + 563B06F32185E07300B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5644DE8420F8D1E4001FFDDE /* DatabaseValueConversionErrorTests.swift in Sources */, 56AFCA5F1CB1AA9900F48B96 /* DatabaseValueConvertibleFetchTests.swift in Sources */, 56AFCA601CB1AA9900F48B96 /* RecordPrimaryKeyRowIDTests.swift in Sources */, @@ -2872,6 +2924,7 @@ 5657AB3B1D108BA9006283EF /* FoundationDataTests.swift in Sources */, 5698AC081D9B9FCF0056AF8C /* QueryInterfaceExtensibilityTests.swift in Sources */, 56AFCA661CB1AA9900F48B96 /* DatabaseQueueReleaseMemoryTests.swift in Sources */, + 563B06EB2185E07300B38F35 /* ValueObservationFetchTests.swift in Sources */, 561667061D08A49900ADD404 /* FoundationNSDecimalNumberTests.swift in Sources */, 565EFAF31D0436CE00A8FA9D /* NumericOverflowTests.swift in Sources */, 56AFCA671CB1AA9900F48B96 /* DatabasePoolReleaseMemoryTests.swift in Sources */, @@ -2969,7 +3022,9 @@ 56CC9239201E009A00CB597E /* DropWhileCursorTests.swift in Sources */, 56D507641F6BAE8600AE1C5B /* PrimaryKeyInfoTests.swift in Sources */, 56176C7B1EACCCCB000F3F2B /* FTS5TokenizerTests.swift in Sources */, + 563B06F02185E07300B38F35 /* ValueObservationReducerTests.swift in Sources */, 566AD8CC1D531BEE002EC1A8 /* TableDefinitionTests.swift in Sources */, + 563B06E82185E07300B38F35 /* ValueObservationReadonlyTests.swift in Sources */, 56AFCAA41CB1ABC800F48B96 /* MutablePersistableRecordTests.swift in Sources */, 567F45AE1F888B2600030B59 /* TruncateOptimizationTests.swift in Sources */, 56AFCAA51CB1ABC800F48B96 /* FetchableRecord+QueryInterfaceRequestTests.swift in Sources */, @@ -3013,8 +3068,10 @@ 56AFCAB41CB1ABC800F48B96 /* DatabaseValueTests.swift in Sources */, 5657AB3C1D108BA9006283EF /* FoundationDataTests.swift in Sources */, 5653EBD320961FE800F46237 /* AssociationRowScopeSearchTests.swift in Sources */, + 563B06E42185E07300B38F35 /* ValueObservationExtentTests.swift in Sources */, 5634B10C1CF9B970005360B9 /* TransactionObserverSavepointsTests.swift in Sources */, 5665FA442129EEEF004D8612 /* DatabaseDateEncodingStrategyTests.swift in Sources */, + 563B06F42185E07300B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5644DE8520F8D1E4001FFDDE /* DatabaseValueConversionErrorTests.swift in Sources */, 56AFCAB51CB1ABC800F48B96 /* DatabaseQueueReadOnlyTests.swift in Sources */, 56AFCAB61CB1ABC800F48B96 /* DatabaseReaderTests.swift in Sources */, @@ -3039,6 +3096,7 @@ 561667071D08A49900ADD404 /* FoundationNSDecimalNumberTests.swift in Sources */, 5698AC091D9B9FCF0056AF8C /* QueryInterfaceExtensibilityTests.swift in Sources */, 56AFCABD1CB1ABC800F48B96 /* DatabaseValueConvertibleSubclassTests.swift in Sources */, + 563B06EC2185E07300B38F35 /* ValueObservationFetchTests.swift in Sources */, 56AFCABE1CB1ABC800F48B96 /* DatabaseErrorTests.swift in Sources */, 56AFCABF1CB1ABC800F48B96 /* DatabaseQueueReleaseMemoryTests.swift in Sources */, 56AFCAC01CB1ABC800F48B96 /* DatabasePoolReleaseMemoryTests.swift in Sources */, diff --git a/GRDBCustom.xcodeproj/project.pbxproj b/GRDBCustom.xcodeproj/project.pbxproj index 19dfe3741..a2be72a98 100755 --- a/GRDBCustom.xcodeproj/project.pbxproj +++ b/GRDBCustom.xcodeproj/project.pbxproj @@ -45,6 +45,16 @@ 5636E9C11D22574100B9B05F /* FetchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5636E9BB1D22574100B9B05F /* FetchRequest.swift */; }; 563B06BA217F3C6E00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B8217F3C6E00B38F35 /* ValueObservation.swift */; }; 563B06BB217F3C6E00B38F35 /* ValueObservation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06B8217F3C6E00B38F35 /* ValueObservation.swift */; }; + 563B06D12185E04600B38F35 /* ValueObservationExtentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06CC2185E04500B38F35 /* ValueObservationExtentTests.swift */; }; + 563B06D22185E04600B38F35 /* ValueObservationExtentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06CC2185E04500B38F35 /* ValueObservationExtentTests.swift */; }; + 563B06D32185E04600B38F35 /* ValueObservationReadonlyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06CD2185E04600B38F35 /* ValueObservationReadonlyTests.swift */; }; + 563B06D42185E04600B38F35 /* ValueObservationReadonlyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06CD2185E04600B38F35 /* ValueObservationReadonlyTests.swift */; }; + 563B06D52185E04600B38F35 /* ValueObservationFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06CE2185E04600B38F35 /* ValueObservationFetchTests.swift */; }; + 563B06D62185E04600B38F35 /* ValueObservationFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06CE2185E04600B38F35 /* ValueObservationFetchTests.swift */; }; + 563B06D72185E04600B38F35 /* ValueObservationReducerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06CF2185E04600B38F35 /* ValueObservationReducerTests.swift */; }; + 563B06D82185E04600B38F35 /* ValueObservationReducerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06CF2185E04600B38F35 /* ValueObservationReducerTests.swift */; }; + 563B06D92185E04600B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */; }; + 563B06DA2185E04600B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */; }; 563EF420215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF421215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF4382161182C007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF4362161182C007DAACD /* AssociationAggregate.swift */; }; @@ -652,6 +662,11 @@ 5634B1061CF9B970005360B9 /* TransactionObserverSavepointsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionObserverSavepointsTests.swift; sourceTree = ""; }; 5636E9BB1D22574100B9B05F /* FetchRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchRequest.swift; sourceTree = ""; }; 563B06B8217F3C6E00B38F35 /* ValueObservation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservation.swift; sourceTree = ""; }; + 563B06CC2185E04500B38F35 /* ValueObservationExtentTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationExtentTests.swift; sourceTree = ""; }; + 563B06CD2185E04600B38F35 /* ValueObservationReadonlyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationReadonlyTests.swift; sourceTree = ""; }; + 563B06CE2185E04600B38F35 /* ValueObservationFetchTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationFetchTests.swift; sourceTree = ""; }; + 563B06CF2185E04600B38F35 /* ValueObservationReducerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationReducerTests.swift; sourceTree = ""; }; + 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationSchedulingTests.swift; sourceTree = ""; }; 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF4362161182C007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF441216131F5007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1156,6 +1171,18 @@ name = DatabaseQueue; sourceTree = ""; }; + 563B06DB2185E04E00B38F35 /* ValueObservation */ = { + isa = PBXGroup; + children = ( + 563B06CC2185E04500B38F35 /* ValueObservationExtentTests.swift */, + 563B06CE2185E04600B38F35 /* ValueObservationFetchTests.swift */, + 563B06CD2185E04600B38F35 /* ValueObservationReadonlyTests.swift */, + 563B06CF2185E04600B38F35 /* ValueObservationReducerTests.swift */, + 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */, + ); + name = ValueObservation; + sourceTree = ""; + }; 5653EB3620961F6000F46237 /* Association */ = { isa = PBXGroup; children = ( @@ -1312,6 +1339,7 @@ 56A238201B9C74A90082EB20 /* Statement */, 56E8CE0F1BB4FE5B00828BEC /* StatementColumnConvertibleFetchTests.swift */, 5607EFD11BB8253300605DE3 /* TransactionObserver */, + 563B06DB2185E04E00B38F35 /* ValueObservation */, ); name = Core; sourceTree = ""; @@ -2015,7 +2043,9 @@ 56CC9235201E009100CB597E /* DropWhileCursorTests.swift in Sources */, 56D507651F6BAE8600AE1C5B /* PrimaryKeyInfoTests.swift in Sources */, 5657AB651D108BA9006283EF /* FoundationNSURLTests.swift in Sources */, + 563B06D82185E04600B38F35 /* ValueObservationReducerTests.swift in Sources */, 5657AB6D1D108BA9006283EF /* FoundationURLTests.swift in Sources */, + 563B06D42185E04600B38F35 /* ValueObservationReadonlyTests.swift in Sources */, 567F45AF1F888B2600030B59 /* TruncateOptimizationTests.swift in Sources */, F3BA804C1CFB2B24003DC1BA /* GRDBTestCase.swift in Sources */, 5698ACBD1DA6285E0056AF8C /* FTS3TokenizerTests.swift in Sources */, @@ -2059,8 +2089,10 @@ 5698AC471DA2BED90056AF8C /* FTS3PatternTests.swift in Sources */, F3BA80D61CFB2FFD003DC1BA /* DatabaseReaderTests.swift in Sources */, 5653EB7520961FB200F46237 /* AssociationRowScopeSearchTests.swift in Sources */, + 563B06D22185E04600B38F35 /* ValueObservationExtentTests.swift in Sources */, 5698AC9D1DA4B0430056AF8C /* FTS4RecordTests.swift in Sources */, 5665FA3E2129EED8004D8612 /* DatabaseDateEncodingStrategyTests.swift in Sources */, + 563B06DA2185E04600B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5644DE8020F8D1D1001FFDDE /* DatabaseValueConversionErrorTests.swift in Sources */, 56A4CDB71D4234B200B1A9B9 /* SQLExpressionLiteralTests.swift in Sources */, 56CC924A201E058900CB597E /* DropFirstCursorTests.swift in Sources */, @@ -2085,6 +2117,7 @@ 562393551DEDFEFB00A6B01F /* EnumeratedCursorTests.swift in Sources */, F3BA804F1CFB2B59003DC1BA /* DatabasePoolReleaseMemoryTests.swift in Sources */, 561667081D08A49900ADD404 /* FoundationNSDecimalNumberTests.swift in Sources */, + 563B06D62185E04600B38F35 /* ValueObservationFetchTests.swift in Sources */, 565EFAF51D0436CE00A8FA9D /* NumericOverflowTests.swift in Sources */, F3BA81231CFB3063003DC1BA /* RecordPrimaryKeySingleTests.swift in Sources */, F3BA80541CFB2B59003DC1BA /* DatabaseRegionTests.swift in Sources */, @@ -2298,7 +2331,9 @@ 56CC9234201E009000CB597E /* DropWhileCursorTests.swift in Sources */, 56D507611F6BAE8600AE1C5B /* PrimaryKeyInfoTests.swift in Sources */, F3BA80B01CFB2FB2003DC1BA /* DatabaseCollationTests.swift in Sources */, + 563B06D72185E04600B38F35 /* ValueObservationReducerTests.swift in Sources */, 56C7A6AE1D2DFF6100EFB0C2 /* FoundationNSDateTests.swift in Sources */, + 563B06D32185E04600B38F35 /* ValueObservationReadonlyTests.swift in Sources */, 567F45AB1F888B2600030B59 /* TruncateOptimizationTests.swift in Sources */, F3BA80A61CFB2F91003DC1BA /* GRDBTestCase.swift in Sources */, 5657AB411D108BA9006283EF /* FoundationNSDataTests.swift in Sources */, @@ -2342,8 +2377,10 @@ F3BA80D51CFB2FFB003DC1BA /* DatabaseReaderTests.swift in Sources */, F3BA81321CFB3064003DC1BA /* RecordPrimaryKeySingleWithReplaceConflictResolutionTests.swift in Sources */, 5653EB7420961FB200F46237 /* AssociationRowScopeSearchTests.swift in Sources */, + 563B06D12185E04600B38F35 /* ValueObservationExtentTests.swift in Sources */, 5623935A1DEE013C00A6B01F /* FilterCursorTests.swift in Sources */, 5665FA3D2129EED8004D8612 /* DatabaseDateEncodingStrategyTests.swift in Sources */, + 563B06D92185E04600B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5644DE7F20F8D1D1001FFDDE /* DatabaseValueConversionErrorTests.swift in Sources */, F3BA80FC1CFB3021003DC1BA /* UpdateStatementTests.swift in Sources */, 56CC9249201E058900CB597E /* DropFirstCursorTests.swift in Sources */, @@ -2368,6 +2405,7 @@ 562205FF1E420EA2005860AC /* DatabasePoolReadOnlyTests.swift in Sources */, 562205FC1E420E49005860AC /* DatabaseQueueReleaseMemoryTests.swift in Sources */, 562393631DEE06D300A6B01F /* CursorTests.swift in Sources */, + 563B06D52185E04600B38F35 /* ValueObservationFetchTests.swift in Sources */, 562205FE1E420EA2005860AC /* DatabasePoolConcurrencyTests.swift in Sources */, 565EFAF11D0436CE00A8FA9D /* NumericOverflowTests.swift in Sources */, F3BA812E1CFB3064003DC1BA /* RecordPrimaryKeyMultipleTests.swift in Sources */, diff --git a/Tests/GRDBTests/ValueObservationExtentTests.swift b/Tests/GRDBTests/ValueObservationExtentTests.swift new file mode 100644 index 000000000..776231334 --- /dev/null +++ b/Tests/GRDBTests/ValueObservationExtentTests.swift @@ -0,0 +1,16 @@ +import XCTest +#if GRDBCIPHER + import GRDBCipher +#elseif GRDBCUSTOMSQLITE + import GRDBCustomSQLite +#else + #if SWIFT_PACKAGE + import CSQLite + #else + import SQLite3 + #endif + import GRDB +#endif + +class ValueObservationExtentTests: GRDBTestCase { +} diff --git a/Tests/GRDBTests/ValueObservationFetchTests.swift b/Tests/GRDBTests/ValueObservationFetchTests.swift new file mode 100644 index 000000000..81a3ce84c --- /dev/null +++ b/Tests/GRDBTests/ValueObservationFetchTests.swift @@ -0,0 +1,19 @@ +import XCTest +#if GRDBCIPHER + import GRDBCipher +#elseif GRDBCUSTOMSQLITE + import GRDBCustomSQLite +#else + #if SWIFT_PACKAGE + import CSQLite + #else + import SQLite3 + #endif + import GRDB +#endif + +class ValueObservationFetchTests: GRDBTestCase { +} + +// let observation = ValueObservation.observing(<#T##regions: DatabaseRegionConvertible...##DatabaseRegionConvertible#>, fetch: <#T##(Database) throws -> Value#>) +// let observation = ValueObservation.observing(withUniquing: <#T##DatabaseRegionConvertible...##DatabaseRegionConvertible#>, fetch: <#T##(Database) throws -> Equatable#>) diff --git a/Tests/GRDBTests/ValueObservationReadonlyTests.swift b/Tests/GRDBTests/ValueObservationReadonlyTests.swift new file mode 100644 index 000000000..624fef9cd --- /dev/null +++ b/Tests/GRDBTests/ValueObservationReadonlyTests.swift @@ -0,0 +1,16 @@ +import XCTest +#if GRDBCIPHER + import GRDBCipher +#elseif GRDBCUSTOMSQLITE + import GRDBCustomSQLite +#else + #if SWIFT_PACKAGE + import CSQLite + #else + import SQLite3 + #endif + import GRDB +#endif + +class ValueObservationReadonlyTests: GRDBTestCase { +} diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift new file mode 100644 index 000000000..7ea6e8019 --- /dev/null +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -0,0 +1,119 @@ +import XCTest +#if GRDBCIPHER + import GRDBCipher +#elseif GRDBCUSTOMSQLITE + import GRDBCustomSQLite +#else + #if SWIFT_PACKAGE + import CSQLite + #else + import SQLite3 + #endif + import GRDB +#endif + +class ValueObservationReducerTests: GRDBTestCase { + func testReducer() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + // Track reducer proceess + var fetchCount = 0 + var reduceCount = 0 + var errorCount = 0 + var changes: [String] = [] + let changeExpectation = expectation(description: "changes") + changeExpectation.assertForOverFulfill = true + changeExpectation.expectedFulfillmentCount = 3 + + // A reducer which tracks its progress + var dropNext = false // if true, reducer drops next value + let reducer = AnyValueReducer( + fetch: { db -> Int in + fetchCount += 1 + return try Int.fetchOne(db, "SELECT COUNT(*) FROM t")! + }, + value: { count -> String? in + reduceCount += 1 + if dropNext { + dropNext = false + return nil + } + // just make sure the fetched type and the notified type can be different + return count.description + }) + + // Create an observation + let request = SQLRequest("SELECT * FROM t") + let observation = ValueObservation.observing(request, reducer: reducer) + + // Start observation with default configuration + let observer = try dbQueue.add( + observation: observation, + onError: { _ in errorCount += 1 }, + onChange: { change in + changes.append(change) + changeExpectation.fulfill() + }) + + // Default config stops when observer is deallocated: keep it alive for + // the duration of the test: + try withExtendedLifetime(observer) { + + // Test that default config synchronously notifies initial value + XCTAssertEqual(fetchCount, 1) + XCTAssertEqual(reduceCount, 1) + XCTAssertEqual(errorCount, 0) + XCTAssertEqual(changes, ["0"]) + + try dbQueue.inDatabase { db in + // A 1st notified transaction + try db.inTransaction { + try db.execute("INSERT INTO t DEFAULT VALUES") + return .commit + } + + // An untracked transaction + try db.inTransaction { + try db.execute("CREATE TABLE ignored(a)") + return .commit + } + + // A dropped transaction + dropNext = true + try db.inTransaction { + try db.execute("INSERT INTO t DEFAULT VALUES") + try db.execute("INSERT INTO t DEFAULT VALUES") + return .commit + } + + // A rollbacked transaction + try db.inTransaction { + try db.execute("INSERT INTO t DEFAULT VALUES") + return .rollback + } + + // A 2nd notified transaction + try db.inTransaction { + try db.execute("INSERT INTO t DEFAULT VALUES") + try db.execute("INSERT INTO t DEFAULT VALUES") + return .commit + } + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(fetchCount, 4) + XCTAssertEqual(reduceCount, 4) + XCTAssertEqual(errorCount, 0) + XCTAssertEqual(changes, ["0", "1", "5"]) + } + } + + func testErrorThenSuccess() throws { + } + + func testSuccessThenErrorThenSuccess() throws { + } + +} diff --git a/Tests/GRDBTests/ValueObservationSchedulingTests.swift b/Tests/GRDBTests/ValueObservationSchedulingTests.swift new file mode 100644 index 000000000..a90fb3808 --- /dev/null +++ b/Tests/GRDBTests/ValueObservationSchedulingTests.swift @@ -0,0 +1,16 @@ +import XCTest +#if GRDBCIPHER + import GRDBCipher +#elseif GRDBCUSTOMSQLITE + import GRDBCustomSQLite +#else + #if SWIFT_PACKAGE + import CSQLite + #else + import SQLite3 + #endif + import GRDB +#endif + +class ValueObservationSchedulingTests: GRDBTestCase { +} From 2b78479a5efb04e65079ac04c82c333e6f4c904a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 15:32:55 +0100 Subject: [PATCH 026/109] More ValueReducer tests: error --- .../ValueObservationReducerTests.swift | 103 +++++++++++++++--- 1 file changed, 90 insertions(+), 13 deletions(-) diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift index 7ea6e8019..ec2cb7a7e 100644 --- a/Tests/GRDBTests/ValueObservationReducerTests.swift +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -21,11 +21,11 @@ class ValueObservationReducerTests: GRDBTestCase { // Track reducer proceess var fetchCount = 0 var reduceCount = 0 - var errorCount = 0 + var errors: [Error] = [] var changes: [String] = [] - let changeExpectation = expectation(description: "changes") - changeExpectation.assertForOverFulfill = true - changeExpectation.expectedFulfillmentCount = 3 + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 3 // A reducer which tracks its progress var dropNext = false // if true, reducer drops next value @@ -51,11 +51,14 @@ class ValueObservationReducerTests: GRDBTestCase { // Start observation with default configuration let observer = try dbQueue.add( observation: observation, - onError: { _ in errorCount += 1 }, - onChange: { change in - changes.append(change) - changeExpectation.fulfill() - }) + onError: { + errors.append($0) + notificationExpectation.fulfill() + }, + onChange: { + changes.append($0) + notificationExpectation.fulfill() + }) // Default config stops when observer is deallocated: keep it alive for // the duration of the test: @@ -64,7 +67,7 @@ class ValueObservationReducerTests: GRDBTestCase { // Test that default config synchronously notifies initial value XCTAssertEqual(fetchCount, 1) XCTAssertEqual(reduceCount, 1) - XCTAssertEqual(errorCount, 0) + XCTAssertEqual(errors.count, 0) XCTAssertEqual(changes, ["0"]) try dbQueue.inDatabase { db in @@ -105,15 +108,89 @@ class ValueObservationReducerTests: GRDBTestCase { waitForExpectations(timeout: 1, handler: nil) XCTAssertEqual(fetchCount, 4) XCTAssertEqual(reduceCount, 4) - XCTAssertEqual(errorCount, 0) + XCTAssertEqual(errors.count, 0) XCTAssertEqual(changes, ["0", "1", "5"]) } } - func testErrorThenSuccess() throws { + func testInitialError() throws { + struct TestError: Error { } + let reducer = AnyValueReducer( + fetch: { _ in throw TestError() }, + value: { _ in fatalError() }) + + // Create an observation + let observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) + + // Start observation with default configuration + do { + let dbQueue = try makeDatabaseQueue() + _ = try dbQueue.add( + observation: observation, + onError: { _ in fatalError() }, + onChange: { _ in fatalError() }) + XCTFail("Expected error") + } catch is TestError { + } catch { + XCTFail("Unexpected error") + } } func testSuccessThenErrorThenSuccess() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + // Track reducer proceess + var errors: [Error] = [] + var changes: [Void] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 3 + + // A reducer which throws an error is requested to do so + var nextError: Error? = nil // If not null, reducer throws an error + let reducer = AnyValueReducer( + fetch: { _ -> Void in + if let error = nextError { + nextError = nil + throw error + } + }, + value: { $0 }) + + // Create an observation + let request = SQLRequest("SELECT * FROM t") + let observation = ValueObservation.observing(request, reducer: reducer) + + // Start observation with default configuration, and an error + let observer = try dbQueue.add( + observation: observation, + onError: { + errors.append($0) + notificationExpectation.fulfill() + }, + onChange: { + changes.append($0) + notificationExpectation.fulfill() + }) + + // Default config stops when observer is deallocated: keep it alive for + // the duration of the test: + try withExtendedLifetime(observer) { + struct TestError: Error { } + nextError = TestError() + try dbQueue.write { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + } + + try dbQueue.write { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(errors.count, 1) + XCTAssertEqual(changes.count, 2) + } } - } From 627e8ec969b551fc403fcaf9501523b84a71cdf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 15:35:25 +0100 Subject: [PATCH 027/109] Fix wrong documentation --- Tests/GRDBTests/ValueObservationReducerTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift index ec2cb7a7e..2f8d8f7bf 100644 --- a/Tests/GRDBTests/ValueObservationReducerTests.swift +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -163,7 +163,7 @@ class ValueObservationReducerTests: GRDBTestCase { let request = SQLRequest("SELECT * FROM t") let observation = ValueObservation.observing(request, reducer: reducer) - // Start observation with default configuration, and an error + // Start observation with default configuration let observer = try dbQueue.add( observation: observation, onError: { From a519a4ab86303dd4a2c24f572e3ddf2e215770b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 15:38:01 +0100 Subject: [PATCH 028/109] Documentation --- Tests/GRDBTests/ValueObservationReducerTests.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift index 2f8d8f7bf..5553e5904 100644 --- a/Tests/GRDBTests/ValueObservationReducerTests.swift +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -32,15 +32,17 @@ class ValueObservationReducerTests: GRDBTestCase { let reducer = AnyValueReducer( fetch: { db -> Int in fetchCount += 1 + // test for database access return try Int.fetchOne(db, "SELECT COUNT(*) FROM t")! }, value: { count -> String? in reduceCount += 1 if dropNext { + // test that reducer can drop values dropNext = false return nil } - // just make sure the fetched type and the notified type can be different + // test that the fetched type and the notified type can be different return count.description }) @@ -71,19 +73,19 @@ class ValueObservationReducerTests: GRDBTestCase { XCTAssertEqual(changes, ["0"]) try dbQueue.inDatabase { db in - // A 1st notified transaction + // Test a 1st notified transaction try db.inTransaction { try db.execute("INSERT INTO t DEFAULT VALUES") return .commit } - // An untracked transaction + // Test an untracked transaction try db.inTransaction { try db.execute("CREATE TABLE ignored(a)") return .commit } - // A dropped transaction + // Test a dropped transaction dropNext = true try db.inTransaction { try db.execute("INSERT INTO t DEFAULT VALUES") @@ -91,13 +93,13 @@ class ValueObservationReducerTests: GRDBTestCase { return .commit } - // A rollbacked transaction + // Test a rollbacked transaction try db.inTransaction { try db.execute("INSERT INTO t DEFAULT VALUES") return .rollback } - // A 2nd notified transaction + // Test a 2nd notified transaction try db.inTransaction { try db.execute("INSERT INTO t DEFAULT VALUES") try db.execute("INSERT INTO t DEFAULT VALUES") From 087989fc8900e796c6c2d2df4dfb510e8ce0e91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 15:57:27 +0100 Subject: [PATCH 029/109] More ValueObseervation tests: extent --- .../ValueObservationExtentTests.swift | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/Tests/GRDBTests/ValueObservationExtentTests.swift b/Tests/GRDBTests/ValueObservationExtentTests.swift index 776231334..5b9028aef 100644 --- a/Tests/GRDBTests/ValueObservationExtentTests.swift +++ b/Tests/GRDBTests/ValueObservationExtentTests.swift @@ -13,4 +13,134 @@ import XCTest #endif class ValueObservationExtentTests: GRDBTestCase { + func testExtentDatabaseLifetime() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + // Track reducer proceess + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 3 + + // A reducer + let reducer = AnyValueReducer( + fetch: { _ in }, + value: { $0 }) + + // Create an observation + let request = SQLRequest("SELECT * FROM t") + var observation = ValueObservation.observing(request, reducer: reducer) + observation.extent = .databaseLifetime + + // Start observation + _ = try dbQueue.add( + observation: observation, + onError: nil, + onChange: { notificationExpectation.fulfill() }) + + // notified + try dbQueue.write { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + } + + // notified + try dbQueue.write { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + } + + func testExtentObserverLifetime() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + // Track reducer proceess + var changesCount = 0 + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + // A reducer + let reducer = AnyValueReducer( + fetch: { _ in }, + value: { $0 }) + + // Create an observation + let request = SQLRequest("SELECT * FROM t") + var observation = ValueObservation.observing(request, reducer: reducer) + observation.extent = .observerLifetime + + // Start observation and deallocate observer after second change + var observer: TransactionObserver? + observer = try dbQueue.add( + observation: observation, + onError: nil, + onChange: { + changesCount += 1 + if changesCount == 2 { + observer = nil + } + notificationExpectation.fulfill() + }) + + // notified + try dbQueue.write { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + } + + // not notified + try dbQueue.write { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + } + + // Avoid "Variable 'observer' was written to, but never read" warning + _ = observer + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(changesCount, 2) + } + + func testExtentNextTransaction() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + // Track reducer proceess + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + // A reducer + let reducer = AnyValueReducer( + fetch: { _ in }, + value: { $0 }) + + // Create an observation + let request = SQLRequest("SELECT * FROM t") + var observation = ValueObservation.observing(request, reducer: reducer) + observation.extent = .nextTransaction + + // Start observation + let observer = try dbQueue.add( + observation: observation, + onError: nil, + onChange: { notificationExpectation.fulfill() }) + + try withExtendedLifetime(observer) { + // notified + try dbQueue.write { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + } + + // not notified + try dbQueue.write { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + } + } } From cbe505f4a4afe54ec98d9dda750dfa41dd181a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 16:13:34 +0100 Subject: [PATCH 030/109] Cleanup --- .../ValueObservationExtentTests.swift | 40 ++++++++----------- .../ValueObservationReducerTests.swift | 3 +- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/Tests/GRDBTests/ValueObservationExtentTests.swift b/Tests/GRDBTests/ValueObservationExtentTests.swift index 5b9028aef..ec14a8750 100644 --- a/Tests/GRDBTests/ValueObservationExtentTests.swift +++ b/Tests/GRDBTests/ValueObservationExtentTests.swift @@ -29,15 +29,13 @@ class ValueObservationExtentTests: GRDBTestCase { value: { $0 }) // Create an observation - let request = SQLRequest("SELECT * FROM t") - var observation = ValueObservation.observing(request, reducer: reducer) + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .databaseLifetime // Start observation - _ = try dbQueue.add( - observation: observation, - onError: nil, - onChange: { notificationExpectation.fulfill() }) + _ = try dbQueue.add(observation: observation) { + notificationExpectation.fulfill() + } // notified try dbQueue.write { db in @@ -69,22 +67,18 @@ class ValueObservationExtentTests: GRDBTestCase { value: { $0 }) // Create an observation - let request = SQLRequest("SELECT * FROM t") - var observation = ValueObservation.observing(request, reducer: reducer) + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .observerLifetime // Start observation and deallocate observer after second change var observer: TransactionObserver? - observer = try dbQueue.add( - observation: observation, - onError: nil, - onChange: { - changesCount += 1 - if changesCount == 2 { - observer = nil - } - notificationExpectation.fulfill() - }) + observer = try dbQueue.add(observation: observation) { + changesCount += 1 + if changesCount == 2 { + observer = nil + } + notificationExpectation.fulfill() + } // notified try dbQueue.write { db in @@ -119,15 +113,13 @@ class ValueObservationExtentTests: GRDBTestCase { value: { $0 }) // Create an observation - let request = SQLRequest("SELECT * FROM t") - var observation = ValueObservation.observing(request, reducer: reducer) + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .nextTransaction // Start observation - let observer = try dbQueue.add( - observation: observation, - onError: nil, - onChange: { notificationExpectation.fulfill() }) + let observer = try dbQueue.add(observation: observation) { + notificationExpectation.fulfill() + } try withExtendedLifetime(observer) { // notified diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift index 5553e5904..784d53e34 100644 --- a/Tests/GRDBTests/ValueObservationReducerTests.swift +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -162,8 +162,7 @@ class ValueObservationReducerTests: GRDBTestCase { value: { $0 }) // Create an observation - let request = SQLRequest("SELECT * FROM t") - let observation = ValueObservation.observing(request, reducer: reducer) + let observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) // Start observation with default configuration let observer = try dbQueue.add( From 471808fa3bcec34b8012f49ba7f8cafda9d995db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 16:13:58 +0100 Subject: [PATCH 031/109] More ValueObseervation tests: fetch, with and without uniquing --- .../ValueObservationFetchTests.swift | 66 ++++++++++++++++++- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/Tests/GRDBTests/ValueObservationFetchTests.swift b/Tests/GRDBTests/ValueObservationFetchTests.swift index 81a3ce84c..a85129f1c 100644 --- a/Tests/GRDBTests/ValueObservationFetchTests.swift +++ b/Tests/GRDBTests/ValueObservationFetchTests.swift @@ -13,7 +13,67 @@ import XCTest #endif class ValueObservationFetchTests: GRDBTestCase { + func testFetch() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! + }) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { count in + notificationExpectation.fulfill() + counts.append(count) + } + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + try dbQueue.write { + try $0.execute("UPDATE t SET id = id") + } + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [0, 1, 1, 2]) + } + + func testFetchWithUniquing() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 3 + + var observation = ValueObservation.observing(withUniquing: DatabaseRegion.fullDatabase, fetch: { + try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! + }) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { count in + notificationExpectation.fulfill() + counts.append(count) + } + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + try dbQueue.write { + try $0.execute("UPDATE t SET id = id") + } + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [0, 1, 2]) + } } - -// let observation = ValueObservation.observing(<#T##regions: DatabaseRegionConvertible...##DatabaseRegionConvertible#>, fetch: <#T##(Database) throws -> Value#>) -// let observation = ValueObservation.observing(withUniquing: <#T##DatabaseRegionConvertible...##DatabaseRegionConvertible#>, fetch: <#T##(Database) throws -> Equatable#>) From f3036648082d7f6b9a64739c868d112543ce2c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 16:20:57 +0100 Subject: [PATCH 032/109] Cleanup --- GRDB/Core/DatabaseWriter.swift | 2 +- GRDB/Core/ValueObservation.swift | 266 ++++++++++++++++--------------- 2 files changed, 135 insertions(+), 133 deletions(-) diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 187e60f87..2b9875456 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -257,7 +257,7 @@ extension DatabaseWriter { region: observation.observedRegion(db), reducer: reducer, fetch: fetch, - notificationQueue: observation.notificatinQueue, + notificationQueue: observation.notificationQueue, onError: onError, onChange: onChange) db.add(transactionObserver: valueObserver, extent: observation.extent) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index e8931ee34..a5e4fc2aa 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -8,6 +8,7 @@ import Dispatch +// MARK: - ValueScheduling /// ValueScheduling controls how ValueObservation schedules the notifications /// of fresh values to your application. @@ -65,6 +66,7 @@ extension DispatchQueue { } } +// MARK: - ValueReducer /// TODO: doc public protocol ValueReducer { @@ -102,138 +104,6 @@ public struct AnyValueReducer: ValueReducer { } } -/// TODO: doc -/// TODO: refresh region after each fetch -public struct ValueObservation { - /// A closure that is evaluated when the observation starts, and returns - /// the observed database region. - var observedRegion: (Database) throws -> DatabaseRegion - - /// A closure that fetches a value from the database. It is called upon - /// each database change, and also when the observatioin starts, depending - /// on the *initialDispatch* property. - /// - /// When this closure needs to write in the database, set the *readonly* - /// flag to false. - var reducer: Reducer - - /// Default is true. Set this property to false when the *fetch* closure - /// requires write access, and should be executed inside a savepoint. - public var readonly: Bool = true - - /// The extent of the database observation. The default is - /// `.observerLifetime`: once started, the observation lasts until the - /// observer is deallocated. - public var extent = Database.TransactionObservationExtent.observerLifetime - - /// `scheduling` controls how fresh values are notified. - /// Default is `.mainQueue`: - /// - /// - `.mainQueue`: all values are notified on the main queue. - /// - /// If the observation starts on the main queue, initial values are - /// notified right upon subscription, synchronously: - /// - /// // On main queue - /// let observation = ValueObservation.forAll(Player.all()) - /// let observer = try dbQueue.add(observation: observation) { players: [Player] in - /// print("fresh players: /(players)") - /// } - /// // <- here "fresh players" is already printed. - /// - /// If the observation does not start on the main queue, initial values - /// are asynchronously notified on the main queue: - /// - /// // Not on the main queue: "fresh players" is eventually printed - /// // on the main queue. - /// let observation = ValueObservation.forAll(Player.all()) - /// let observer = try dbQueue.add(observation: observation) { players: [Player] in - /// print("fresh players: /(players)") - /// } - /// - /// When the database changes, fresh values are asynchronously notified: - /// - /// // Eventually prints "fresh players" on the main queue - /// try dbQueue.write { db in - /// try Player(...).insert(db) - /// } - /// - /// - `.onQueue(_:startImmediately:)`: all values are asychronously notified - /// on the specified queue. Initial values are only fetched and notified if - /// `startImmediately` is true. - /// - /// Correct ordering of notifications is only guaranteed if the queue - /// is serial. - public var scheduling: ValueScheduling = .mainQueue - - /// The dispatch queue where change callbacks are called. - public var notificatinQueue: DispatchQueue { - switch scheduling { - case .mainQueue: - return DispatchQueue.main - case .onQueue(let queue, startImmediately: _): - return queue - } - } - - // This initializer is not public. See ValueObservation.observing(_:reducer:) - init( - observing region: @escaping (Database) throws -> DatabaseRegion, - reducer: Reducer) - { - self.observedRegion = region - self.reducer = reducer - } - - /// Returs a ValueObservation which observes *regions*, and notifies the - /// values returned by the *reducer* whenever the observed region is - /// impacted by a database transaction. - /// - /// This method is the most fundamental way to create a ValueObservation. - /// - /// For example: - /// - /// let reducer = AnyValueReducer( - /// fetch: { db in try Player.fetchAll(db) }, - /// value: { player in players }) - /// let observation = ValueObservation( - /// observing: Player.all(), - /// reducer: reducer) - /// - /// let observer = try dbQueue.add(observation: observation) { player: [Player] in - /// print("players have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter region: a closure that returns the observed region. - /// - parameter fetch: a closure that fetches a value. - public static func observing( - _ regions: DatabaseRegionConvertible..., - reducer: Reducer) - -> ValueObservation - { - func region(_ db: Database) throws -> DatabaseRegion { - return try regions.reduce(into: DatabaseRegion()) { union, region in - try union.formUnion(region.databaseRegion(db)) - } - } - - return ValueObservation(observing: region, reducer: reducer) - } -} - -// MARK: - Reducers - public enum ValueReducers { /// TODO public struct Raw: ValueReducer { @@ -400,6 +270,138 @@ public enum ValueReducers { } } +// MARK: - ValueObservation + +/// TODO: doc +/// TODO: refresh region after each fetch +public struct ValueObservation { + /// A closure that is evaluated when the observation starts, and returns + /// the observed database region. + var observedRegion: (Database) throws -> DatabaseRegion + + /// A closure that fetches a value from the database. It is called upon + /// each database change, and also when the observatioin starts, depending + /// on the *initialDispatch* property. + /// + /// When this closure needs to write in the database, set the *readonly* + /// flag to false. + var reducer: Reducer + + /// Default is true. Set this property to false when the *fetch* closure + /// requires write access, and should be executed inside a savepoint. + public var readonly: Bool = true + + /// The extent of the database observation. The default is + /// `.observerLifetime`: once started, the observation lasts until the + /// observer is deallocated. + public var extent = Database.TransactionObservationExtent.observerLifetime + + /// `scheduling` controls how fresh values are notified. + /// Default is `.mainQueue`: + /// + /// - `.mainQueue`: all values are notified on the main queue. + /// + /// If the observation starts on the main queue, initial values are + /// notified right upon subscription, synchronously: + /// + /// // On main queue + /// let observation = ValueObservation.forAll(Player.all()) + /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// print("fresh players: /(players)") + /// } + /// // <- here "fresh players" is already printed. + /// + /// If the observation does not start on the main queue, initial values + /// are asynchronously notified on the main queue: + /// + /// // Not on the main queue: "fresh players" is eventually printed + /// // on the main queue. + /// let observation = ValueObservation.forAll(Player.all()) + /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// print("fresh players: /(players)") + /// } + /// + /// When the database changes, fresh values are asynchronously notified: + /// + /// // Eventually prints "fresh players" on the main queue + /// try dbQueue.write { db in + /// try Player(...).insert(db) + /// } + /// + /// - `.onQueue(_:startImmediately:)`: all values are asychronously notified + /// on the specified queue. Initial values are only fetched and notified if + /// `startImmediately` is true. + /// + /// Correct ordering of notifications is only guaranteed if the queue + /// is serial. + public var scheduling: ValueScheduling = .mainQueue + + /// The dispatch queue where change callbacks are called. + public var notificationQueue: DispatchQueue { + switch scheduling { + case .mainQueue: + return DispatchQueue.main + case .onQueue(let queue, startImmediately: _): + return queue + } + } + + // This initializer is not public. See ValueObservation.observing(_:reducer:) + init( + observing region: @escaping (Database) throws -> DatabaseRegion, + reducer: Reducer) + { + self.observedRegion = region + self.reducer = reducer + } + + /// Returs a ValueObservation which observes *regions*, and notifies the + /// values returned by the *reducer* whenever the observed region is + /// impacted by a database transaction. + /// + /// This method is the most fundamental way to create a ValueObservation. + /// + /// For example: + /// + /// let reducer = AnyValueReducer( + /// fetch: { db in try Player.fetchAll(db) }, + /// value: { player in players }) + /// let observation = ValueObservation( + /// observing: Player.all(), + /// reducer: reducer) + /// + /// let observer = try dbQueue.add(observation: observation) { player: [Player] in + /// print("players have changed") + /// } + /// + /// The returned observation has the default configuration: + /// + /// - When started with the `add(observation:)` method, a fresh value is + /// immediately notified on the dispatch queue which starts the observation. + /// - Upon subsequent database changes, fresh values are notified on the + /// main queue. + /// - The observation lasts until the observer returned by + /// `add(observation:)` is deallocated. + /// + /// See ValueObservation for more information. + /// + /// - parameter region: a closure that returns the observed region. + /// - parameter fetch: a closure that fetches a value. + public static func observing( + _ regions: DatabaseRegionConvertible..., + reducer: Reducer) + -> ValueObservation + { + func region(_ db: Database) throws -> DatabaseRegion { + return try regions.reduce(into: DatabaseRegion()) { union, region in + try union.formUnion(region.databaseRegion(db)) + } + } + + return ValueObservation(observing: region, reducer: reducer) + } +} + // MARK: - DatabaseRegionConvertible Observation extension ValueObservation where Reducer == Void { From f2c3c213cc25ffd539dbf5caca3cda185c4e0605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 17:04:36 +0100 Subject: [PATCH 033/109] Read-only observation is enforced. When not read-only, savepoint is enforced. --- GRDB/Core/DatabaseWriter.swift | 41 +++++- GRDB/Core/ValueObservation.swift | 41 ++---- .../ValueObservationReadonlyTests.swift | 105 +++++++++++++ .../ValueObservationReducerTests.swift | 138 +++++++++--------- 4 files changed, 221 insertions(+), 104 deletions(-) diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 2b9875456..68506aa55 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -225,7 +225,18 @@ extension DatabaseWriter { var reducer = observation.reducer switch observation.scheduling { case .mainQueue: - if let value = try reducer.value(reducer.fetch(db)) { + // fetch + var fetchedValue: Reducer.Fetched! + if observation.isReadOnly { + fetchedValue = try db.readOnly { try reducer.fetch(db) } + } else { + try db.inSavepoint { + fetchedValue = try reducer.fetch(db) + return .commit + } + } + // reduce + if let value = reducer.value(fetchedValue) { if calledOnMainQueue { mainQueueValue = value } else { @@ -233,8 +244,21 @@ extension DatabaseWriter { } } case let .onQueue(queue, startImmediately: startImmediately): - if startImmediately, let value = try reducer.value(reducer.fetch(db)) { - queue.async { onChange(value) } + if startImmediately { + // fetch + var fetchedValue: Reducer.Fetched! + if observation.isReadOnly { + fetchedValue = try db.readOnly { try reducer.fetch(db) } + } else { + try db.inSavepoint { + fetchedValue = try reducer.fetch(db) + return .commit + } + } + // reduce + if let value = reducer.value(fetchedValue) { + queue.async { onChange(value) } + } } } @@ -242,7 +266,7 @@ extension DatabaseWriter { // The technique to fetch a fresh value after database has changed // depends on the observation.readonly flag: let fetch: (Database, Reducer) -> Future - if observation.readonly { + if observation.isReadOnly { fetch = { [unowned self] (_, reducer) in // Concurrent fetch self.concurrentRead { db in try reducer.fetch(db) } @@ -250,7 +274,14 @@ extension DatabaseWriter { } else { fetch = { (db, reducer) in // Synchronous fetch - Future(Result { try reducer.fetch(db) }) + Future(Result { + var fetchedValue: Reducer.Fetched! + try db.inTransaction { + fetchedValue = try reducer.fetch(db) + return .commit + } + return fetchedValue + }) } } let valueObserver = try ValueObserver( diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index a5e4fc2aa..8b490fa9a 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -283,13 +283,13 @@ public struct ValueObservation { /// each database change, and also when the observatioin starts, depending /// on the *initialDispatch* property. /// - /// When this closure needs to write in the database, set the *readonly* + /// When this closure needs to write in the database, set the *isReadOnly* /// flag to false. var reducer: Reducer /// Default is true. Set this property to false when the *fetch* closure /// requires write access, and should be executed inside a savepoint. - public var readonly: Bool = true + public var isReadOnly: Bool = true /// The extent of the database observation. The default is /// `.observerLifetime`: once started, the observation lasts until the @@ -392,18 +392,10 @@ public struct ValueObservation { reducer: Reducer) -> ValueObservation { - func region(_ db: Database) throws -> DatabaseRegion { - return try regions.reduce(into: DatabaseRegion()) { union, region in - try union.formUnion(region.databaseRegion(db)) - } - } - - return ValueObservation(observing: region, reducer: reducer) + return ValueObservation(observing: union(regions), reducer: reducer) } } -// MARK: - DatabaseRegionConvertible Observation - extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *regions*, and notifies the /// values returned by the *fetch* closure whenever one of the observed @@ -437,14 +429,8 @@ extension ValueObservation where Reducer == Void { fetch: @escaping (Database) throws -> Value) -> ValueObservation> { - func region(_ db: Database) throws -> DatabaseRegion { - return try regions.reduce(into: DatabaseRegion()) { union, region in - try union.formUnion(region.databaseRegion(db)) - } - } - return ValueObservation>( - observing: region, + observing: union(regions), reducer: ValueReducers.Raw(fetch)) } @@ -481,19 +467,22 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Value: Equatable { - func region(_ db: Database) throws -> DatabaseRegion { - return try regions.reduce(into: DatabaseRegion()) { union, region in - try union.formUnion(region.databaseRegion(db)) - } - } - return ValueObservation>( - observing: region, + observing: union(regions), reducer: ValueReducers.Unique(fetch)) } } -// MARK: - FetchRequest Observation +private func union(_ regions: [DatabaseRegionConvertible]) -> (Database) throws -> DatabaseRegion { + return { db in + try regions.reduce(into: DatabaseRegion()) { union, region in + try union.formUnion(region.databaseRegion(db)) + } + } +} + + +// MARK: - Count Observation extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *request*, and notifies a diff --git a/Tests/GRDBTests/ValueObservationReadonlyTests.swift b/Tests/GRDBTests/ValueObservationReadonlyTests.swift index 624fef9cd..384644843 100644 --- a/Tests/GRDBTests/ValueObservationReadonlyTests.swift +++ b/Tests/GRDBTests/ValueObservationReadonlyTests.swift @@ -13,4 +13,109 @@ import XCTest #endif class ValueObservationReadonlyTests: GRDBTestCase { + + func testReadOnlyObservation() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! + }) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { count in + notificationExpectation.fulfill() + counts.append(count) + } + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [0, 1]) + } + + func testWriteObservationFailsByDefault() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + let observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { db -> Int in + try db.execute("INSERT INTO t DEFAULT VALUES") + return 0 + }) + + do { + _ = try dbQueue.add( + observation: observation, + onError: { _ in fatalError() }, + onChange: { _ in fatalError() }) + XCTFail("Expected error") + } catch let error as DatabaseError { + XCTAssertEqual(error.resultCode, .SQLITE_READONLY) + XCTAssertEqual(error.message, "attempt to write a readonly database") + XCTAssertEqual(error.sql!, "INSERT INTO t DEFAULT VALUES") + XCTAssertEqual(error.description, "SQLite error 8 with statement `INSERT INTO t DEFAULT VALUES`: attempt to write a readonly database") + } + } + + func testWriteObservation() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { db -> Int in + try db.execute("CREATE TEMPORARY TABLE temp AS SELECT * FROM t") + let result = try Int.fetchOne(db, "SELECT COUNT(*) FROM temp")! + try db.execute("DROP TABLE temp") + return result + }) + observation.extent = .databaseLifetime + observation.isReadOnly = false + _ = try dbQueue.add(observation: observation) { count in + notificationExpectation.fulfill() + counts.append(count) + } + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [0, 1]) + } + + func testWriteObservationIsWrappedInSavepoint() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { + try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") + } + + struct TestError: Error { } + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + throw TestError() + }) + observation.isReadOnly = false + + do { + _ = try dbQueue.add( + observation: observation, + onError: { _ in fatalError() }, + onChange: { _ in fatalError() }) + XCTFail("Expected error") + } catch is TestError { + } + + let count = try dbQueue.read { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! } + XCTAssertEqual(count, 0) + } } diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift index 784d53e34..46f7055d0 100644 --- a/Tests/GRDBTests/ValueObservationReducerTests.swift +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -48,10 +48,11 @@ class ValueObservationReducerTests: GRDBTestCase { // Create an observation let request = SQLRequest("SELECT * FROM t") - let observation = ValueObservation.observing(request, reducer: reducer) + var observation = ValueObservation.observing(request, reducer: reducer) + observation.extent = .databaseLifetime - // Start observation with default configuration - let observer = try dbQueue.add( + // Start observation + _ = try dbQueue.add( observation: observation, onError: { errors.append($0) @@ -62,57 +63,53 @@ class ValueObservationReducerTests: GRDBTestCase { notificationExpectation.fulfill() }) - // Default config stops when observer is deallocated: keep it alive for - // the duration of the test: - try withExtendedLifetime(observer) { + + // Test that default config synchronously notifies initial value + XCTAssertEqual(fetchCount, 1) + XCTAssertEqual(reduceCount, 1) + XCTAssertEqual(errors.count, 0) + XCTAssertEqual(changes, ["0"]) + + try dbQueue.inDatabase { db in + // Test a 1st notified transaction + try db.inTransaction { + try db.execute("INSERT INTO t DEFAULT VALUES") + return .commit + } - // Test that default config synchronously notifies initial value - XCTAssertEqual(fetchCount, 1) - XCTAssertEqual(reduceCount, 1) - XCTAssertEqual(errors.count, 0) - XCTAssertEqual(changes, ["0"]) + // Test an untracked transaction + try db.inTransaction { + try db.execute("CREATE TABLE ignored(a)") + return .commit + } - try dbQueue.inDatabase { db in - // Test a 1st notified transaction - try db.inTransaction { - try db.execute("INSERT INTO t DEFAULT VALUES") - return .commit - } - - // Test an untracked transaction - try db.inTransaction { - try db.execute("CREATE TABLE ignored(a)") - return .commit - } - - // Test a dropped transaction - dropNext = true - try db.inTransaction { - try db.execute("INSERT INTO t DEFAULT VALUES") - try db.execute("INSERT INTO t DEFAULT VALUES") - return .commit - } - - // Test a rollbacked transaction - try db.inTransaction { - try db.execute("INSERT INTO t DEFAULT VALUES") - return .rollback - } - - // Test a 2nd notified transaction - try db.inTransaction { - try db.execute("INSERT INTO t DEFAULT VALUES") - try db.execute("INSERT INTO t DEFAULT VALUES") - return .commit - } - } + // Test a dropped transaction + dropNext = true + try db.inTransaction { + try db.execute("INSERT INTO t DEFAULT VALUES") + try db.execute("INSERT INTO t DEFAULT VALUES") + return .commit + } - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(fetchCount, 4) - XCTAssertEqual(reduceCount, 4) - XCTAssertEqual(errors.count, 0) - XCTAssertEqual(changes, ["0", "1", "5"]) + // Test a rollbacked transaction + try db.inTransaction { + try db.execute("INSERT INTO t DEFAULT VALUES") + return .rollback + } + + // Test a 2nd notified transaction + try db.inTransaction { + try db.execute("INSERT INTO t DEFAULT VALUES") + try db.execute("INSERT INTO t DEFAULT VALUES") + return .commit + } } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(fetchCount, 4) + XCTAssertEqual(reduceCount, 4) + XCTAssertEqual(errors.count, 0) + XCTAssertEqual(changes, ["0", "1", "5"]) } func testInitialError() throws { @@ -124,7 +121,7 @@ class ValueObservationReducerTests: GRDBTestCase { // Create an observation let observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) - // Start observation with default configuration + // Start observation do { let dbQueue = try makeDatabaseQueue() _ = try dbQueue.add( @@ -133,8 +130,6 @@ class ValueObservationReducerTests: GRDBTestCase { onChange: { _ in fatalError() }) XCTFail("Expected error") } catch is TestError { - } catch { - XCTFail("Unexpected error") } } @@ -162,10 +157,11 @@ class ValueObservationReducerTests: GRDBTestCase { value: { $0 }) // Create an observation - let observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) - - // Start observation with default configuration - let observer = try dbQueue.add( + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) + observation.extent = .databaseLifetime + + // Start observation + _ = try dbQueue.add( observation: observation, onError: { errors.append($0) @@ -176,22 +172,18 @@ class ValueObservationReducerTests: GRDBTestCase { notificationExpectation.fulfill() }) - // Default config stops when observer is deallocated: keep it alive for - // the duration of the test: - try withExtendedLifetime(observer) { - struct TestError: Error { } - nextError = TestError() - try dbQueue.write { db in - try db.execute("INSERT INTO t DEFAULT VALUES") - } - - try dbQueue.write { db in - try db.execute("INSERT INTO t DEFAULT VALUES") - } - - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(errors.count, 1) - XCTAssertEqual(changes.count, 2) + struct TestError: Error { } + nextError = TestError() + try dbQueue.write { db in + try db.execute("INSERT INTO t DEFAULT VALUES") } + + try dbQueue.write { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(errors.count, 1) + XCTAssertEqual(changes.count, 2) } } From 31e6ddeac30b5a90045c8efbd5e5f8f89f24749d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 17:32:31 +0100 Subject: [PATCH 034/109] ValueObservation: test scheduling --- .../ValueObservationExtentTests.swift | 5 + .../ValueObservationFetchTests.swift | 4 +- .../ValueObservationReadonlyTests.swift | 4 +- .../ValueObservationSchedulingTests.swift | 223 ++++++++++++++++++ 4 files changed, 232 insertions(+), 4 deletions(-) diff --git a/Tests/GRDBTests/ValueObservationExtentTests.swift b/Tests/GRDBTests/ValueObservationExtentTests.swift index ec14a8750..7b8e5fdf8 100644 --- a/Tests/GRDBTests/ValueObservationExtentTests.swift +++ b/Tests/GRDBTests/ValueObservationExtentTests.swift @@ -13,6 +13,11 @@ import XCTest #endif class ValueObservationExtentTests: GRDBTestCase { + func testDefaultExtentIsObserverLifetime() { + let observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { _ in }) + XCTAssertEqual(observation.extent, .observerLifetime) + } + func testExtentDatabaseLifetime() throws { // We need something to change let dbQueue = try makeDatabaseQueue() diff --git a/Tests/GRDBTests/ValueObservationFetchTests.swift b/Tests/GRDBTests/ValueObservationFetchTests.swift index a85129f1c..855981cdb 100644 --- a/Tests/GRDBTests/ValueObservationFetchTests.swift +++ b/Tests/GRDBTests/ValueObservationFetchTests.swift @@ -27,8 +27,8 @@ class ValueObservationFetchTests: GRDBTestCase { }) observation.extent = .databaseLifetime _ = try dbQueue.add(observation: observation) { count in - notificationExpectation.fulfill() counts.append(count) + notificationExpectation.fulfill() } try dbQueue.write { @@ -59,8 +59,8 @@ class ValueObservationFetchTests: GRDBTestCase { }) observation.extent = .databaseLifetime _ = try dbQueue.add(observation: observation) { count in - notificationExpectation.fulfill() counts.append(count) + notificationExpectation.fulfill() } try dbQueue.write { diff --git a/Tests/GRDBTests/ValueObservationReadonlyTests.swift b/Tests/GRDBTests/ValueObservationReadonlyTests.swift index 384644843..f94f24b1a 100644 --- a/Tests/GRDBTests/ValueObservationReadonlyTests.swift +++ b/Tests/GRDBTests/ValueObservationReadonlyTests.swift @@ -28,8 +28,8 @@ class ValueObservationReadonlyTests: GRDBTestCase { }) observation.extent = .databaseLifetime _ = try dbQueue.add(observation: observation) { count in - notificationExpectation.fulfill() counts.append(count) + notificationExpectation.fulfill() } try dbQueue.write { @@ -81,8 +81,8 @@ class ValueObservationReadonlyTests: GRDBTestCase { observation.extent = .databaseLifetime observation.isReadOnly = false _ = try dbQueue.add(observation: observation) { count in - notificationExpectation.fulfill() counts.append(count) + notificationExpectation.fulfill() } try dbQueue.write { diff --git a/Tests/GRDBTests/ValueObservationSchedulingTests.swift b/Tests/GRDBTests/ValueObservationSchedulingTests.swift index a90fb3808..b45434c9a 100644 --- a/Tests/GRDBTests/ValueObservationSchedulingTests.swift +++ b/Tests/GRDBTests/ValueObservationSchedulingTests.swift @@ -13,4 +13,227 @@ import XCTest #endif class ValueObservationSchedulingTests: GRDBTestCase { + func testMainQueueObservationStartedFromMainQueue() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + let key = DispatchSpecificKey<()>() + DispatchQueue.main.setSpecific(key: key, value: ()) + + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! + }) + observation.extent = .databaseLifetime + + _ = try dbQueue.add(observation: observation) { count in + XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) + counts.append(count) + notificationExpectation.fulfill() + } + // .mainQueue scheduling: initial value MUST be synchronously + // dispatched when observation is started from the main queue + XCTAssertEqual(counts, [0]) + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [0, 1]) + } + + @available(OSX 10.10, *) // DispatchQueue qos + func testMainQueueObservationStartedFromAnotherQueue() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + let key = DispatchSpecificKey<()>() + DispatchQueue.main.setSpecific(key: key, value: ()) + + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! + }) + observation.extent = .databaseLifetime + + DispatchQueue.global(qos: .default).async { + _ = try! dbQueue.add(observation: observation) { count in + XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) + counts.append(count) + notificationExpectation.fulfill() + } + + try! dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [0, 1]) + } + + func testMainQueueError() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var errorCount = 0 + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + let key = DispatchSpecificKey<()>() + DispatchQueue.main.setSpecific(key: key, value: ()) + + var nextError: Error? = nil // If not null, reducer throws an error + let reducer = AnyValueReducer( + fetch: { _ -> Void in + if let error = nextError { + nextError = nil + throw error + } + }, + value: { $0 }) + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) + observation.extent = .databaseLifetime + + _ = try dbQueue.add( + observation: observation, + onError: { error in + XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) + errorCount += 1 + notificationExpectation.fulfill() + }, + onChange: { _ in + XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) + notificationExpectation.fulfill() + }) + + struct TestError: Error { } + nextError = TestError() + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(errorCount, 1) + } + + func testCustomQueueStartImmediately() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + let queue = DispatchQueue(label: "") + let key = DispatchSpecificKey<()>() + queue.setSpecific(key: key, value: ()) + + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! + }) + observation.extent = .databaseLifetime + observation.scheduling = .onQueue(queue, startImmediately: true) + + _ = try dbQueue.add(observation: observation) { count in + XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) + counts.append(count) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [0, 1]) + } + + func testCustomQueueDontStartImmediately() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 1 + + let queue = DispatchQueue(label: "") + let key = DispatchSpecificKey<()>() + queue.setSpecific(key: key, value: ()) + + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! + }) + observation.extent = .databaseLifetime + observation.scheduling = .onQueue(queue, startImmediately: false) + + _ = try dbQueue.add(observation: observation) { count in + XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) + counts.append(count) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [1]) + } + + func testCustomQueueError() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var errorCount = 0 + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 1 + + let queue = DispatchQueue(label: "") + let key = DispatchSpecificKey<()>() + queue.setSpecific(key: key, value: ()) + + struct TestError: Error { } + let reducer = AnyValueReducer( + fetch: { _ in throw TestError() }, + value: { $0 }) + var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) + observation.extent = .databaseLifetime + observation.scheduling = .onQueue(queue, startImmediately: false) + + _ = try dbQueue.add( + observation: observation, + onError: { error in + XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) + errorCount += 1 + notificationExpectation.fulfill() + }, + onChange: { _ in fatalError() }) + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(errorCount, 1) + } } From 62f6cfe6b53bdbcdd1ac1a80d1549c96d34ca007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 17:41:18 +0100 Subject: [PATCH 035/109] ValueObservation: count tests --- GRDB.xcodeproj/project.pbxproj | 6 ++ GRDBCipher.xcodeproj/project.pbxproj | 10 +++ GRDBCustom.xcodeproj/project.pbxproj | 6 ++ .../ValueObservationCountTests.swift | 77 +++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 Tests/GRDBTests/ValueObservationCountTests.swift diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index ced845cbc..a1abd4678 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -129,6 +129,8 @@ 563B06C82185D29F00B38F35 /* ValueObservationReadonlyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C22185D29F00B38F35 /* ValueObservationReadonlyTests.swift */; }; 563B06CA2185D2E500B38F35 /* ValueObservationFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */; }; 563B06CB2185D2E500B38F35 /* ValueObservationFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */; }; + 563B06F721861D8400B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F621861D8300B38F35 /* ValueObservationCountTests.swift */; }; + 563B06F821861D8400B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F621861D8300B38F35 /* ValueObservationCountTests.swift */; }; 563EF415215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF416215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF417215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; @@ -908,6 +910,7 @@ 563B06C12185D29F00B38F35 /* ValueObservationSchedulingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationSchedulingTests.swift; sourceTree = ""; }; 563B06C22185D29F00B38F35 /* ValueObservationReadonlyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationReadonlyTests.swift; sourceTree = ""; }; 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationFetchTests.swift; sourceTree = ""; }; + 563B06F621861D8300B38F35 /* ValueObservationCountTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationCountTests.swift; sourceTree = ""; }; 563EF414215F87EB007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF42C2161180D007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF43E216131D1007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1472,6 +1475,7 @@ 563B06BF2185CD1700B38F35 /* ValueObservation */ = { isa = PBXGroup; children = ( + 563B06F621861D8300B38F35 /* ValueObservationCountTests.swift */, 563B06C02185D29F00B38F35 /* ValueObservationExtentTests.swift */, 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */, 563B06C22185D29F00B38F35 /* ValueObservationReadonlyTests.swift */, @@ -2659,6 +2663,7 @@ 56A2385A1B9C74A90082EB20 /* RecordPrimaryKeySingleTests.swift in Sources */, 562756471E963AAC0035B653 /* DatabaseWriterTests.swift in Sources */, 569531381C919DF700CF1A2B /* DatabasePoolFunctionTests.swift in Sources */, + 563B06F821861D8400B38F35 /* ValueObservationCountTests.swift in Sources */, 56A238481B9C74A90082EB20 /* RowCopiedFromStatementTests.swift in Sources */, 56EA63C6209C7CE3009715B8 /* DerivableRequestTests.swift in Sources */, 5674A71A1F3087710095F066 /* DatabaseValueConvertibleDecodableTests.swift in Sources */, @@ -2831,6 +2836,7 @@ 56D4968C1D81316E008276D7 /* RawRepresentable+DatabaseValueConvertibleTests.swift in Sources */, 56D496981D81317B008276D7 /* DatabaseValueTests.swift in Sources */, 56D4966B1D81309E008276D7 /* MutablePersistableRecordDeleteTests.swift in Sources */, + 563B06F721861D8400B38F35 /* ValueObservationCountTests.swift in Sources */, 56D4965B1D81304E008276D7 /* FoundationNSDecimalNumberTests.swift in Sources */, 562756431E963AAC0035B653 /* DatabaseWriterTests.swift in Sources */, 56EA63C5209C7CE3009715B8 /* DerivableRequestTests.swift in Sources */, diff --git a/GRDBCipher.xcodeproj/project.pbxproj b/GRDBCipher.xcodeproj/project.pbxproj index 727963078..633ac4e4f 100755 --- a/GRDBCipher.xcodeproj/project.pbxproj +++ b/GRDBCipher.xcodeproj/project.pbxproj @@ -202,6 +202,10 @@ 563B06F22185E07300B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */; }; 563B06F32185E07300B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */; }; 563B06F42185E07300B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */; }; + 563B06FA21861D8B00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */; }; + 563B06FB21861D8B00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */; }; + 563B06FC21861D8B00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */; }; + 563B06FD21861D8B00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */; }; 563EF424215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF425215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF43C2161183E007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF43A2161183E007DAACD /* AssociationAggregate.swift */; }; @@ -1016,6 +1020,7 @@ 563B06DE2185E07200B38F35 /* ValueObservationFetchTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationFetchTests.swift; sourceTree = ""; }; 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationReducerTests.swift; sourceTree = ""; }; 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationSchedulingTests.swift; sourceTree = ""; }; + 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationCountTests.swift; sourceTree = ""; }; 563EF422215F8A88007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF43A2161183E007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF44421613212007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1550,6 +1555,7 @@ 563B06F52185E07C00B38F35 /* ValueObservation */ = { isa = PBXGroup; children = ( + 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */, 563B06DC2185E07100B38F35 /* ValueObservationExtentTests.swift */, 563B06DE2185E07200B38F35 /* ValueObservationFetchTests.swift */, 563B06DD2185E07200B38F35 /* ValueObservationReadonlyTests.swift */, @@ -2359,6 +2365,7 @@ 560FC56B1CB00B880014AA8E /* DatabaseCollationTests.swift in Sources */, 560FC56C1CB00B880014AA8E /* UpdateStatementTests.swift in Sources */, 5653EBE020961FE800F46237 /* AssociationBelongsToSQLTests.swift in Sources */, + 563B06FA21861D8B00B38F35 /* ValueObservationCountTests.swift in Sources */, 560FC56D1CB00B880014AA8E /* DatabaseMigratorTests.swift in Sources */, 56EA63CC209C7F31009715B8 /* DerivableRequestTests.swift in Sources */, 560FC5701CB00B880014AA8E /* DatabasePoolCollationTests.swift in Sources */, @@ -2531,6 +2538,7 @@ 5671562E1CB16729007DC145 /* DatabasePoolCollationTests.swift in Sources */, 5671562F1CB16729007DC145 /* RecordPrimaryKeySingleTests.swift in Sources */, 5653EBE120961FE800F46237 /* AssociationBelongsToSQLTests.swift in Sources */, + 563B06FB21861D8B00B38F35 /* ValueObservationCountTests.swift in Sources */, 56EA63CD209C7F31009715B8 /* DerivableRequestTests.swift in Sources */, 56C3F7551CF9F12400F6A361 /* DatabaseSavepointTests.swift in Sources */, 5672DE5B1CDB72520022BA81 /* DatabaseQueueBackupTests.swift in Sources */, @@ -2819,6 +2827,7 @@ 5657AB4B1D108BA9006283EF /* FoundationNSNullTests.swift in Sources */, 56AFCA3E1CB1AA9900F48B96 /* DatabasePoolCollationTests.swift in Sources */, 5653EBE220961FE800F46237 /* AssociationBelongsToSQLTests.swift in Sources */, + 563B06FC21861D8B00B38F35 /* ValueObservationCountTests.swift in Sources */, 56FF455B1D2CDA5200F21EF9 /* RecordUniqueIndexTests.swift in Sources */, 56EA63CE209C7F31009715B8 /* DerivableRequestTests.swift in Sources */, 56AFCA3F1CB1AA9900F48B96 /* RecordPrimaryKeySingleTests.swift in Sources */, @@ -2991,6 +3000,7 @@ 56AFCA921CB1ABC800F48B96 /* SelectStatementTests.swift in Sources */, 56AFCA931CB1ABC800F48B96 /* UpdateStatementTests.swift in Sources */, 5653EBE320961FE800F46237 /* AssociationBelongsToSQLTests.swift in Sources */, + 563B06FD21861D8B00B38F35 /* ValueObservationCountTests.swift in Sources */, 56AFCA941CB1ABC800F48B96 /* DatabaseMigratorTests.swift in Sources */, 56EA63CF209C7F31009715B8 /* DerivableRequestTests.swift in Sources */, 5657AB641D108BA9006283EF /* FoundationNSURLTests.swift in Sources */, diff --git a/GRDBCustom.xcodeproj/project.pbxproj b/GRDBCustom.xcodeproj/project.pbxproj index a2be72a98..7e5949454 100755 --- a/GRDBCustom.xcodeproj/project.pbxproj +++ b/GRDBCustom.xcodeproj/project.pbxproj @@ -55,6 +55,8 @@ 563B06D82185E04600B38F35 /* ValueObservationReducerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06CF2185E04600B38F35 /* ValueObservationReducerTests.swift */; }; 563B06D92185E04600B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */; }; 563B06DA2185E04600B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */; }; + 563B06FF21861D9D00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06FE21861D9D00B38F35 /* ValueObservationCountTests.swift */; }; + 563B070021861D9D00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06FE21861D9D00B38F35 /* ValueObservationCountTests.swift */; }; 563EF420215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF421215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF4382161182C007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF4362161182C007DAACD /* AssociationAggregate.swift */; }; @@ -667,6 +669,7 @@ 563B06CE2185E04600B38F35 /* ValueObservationFetchTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationFetchTests.swift; sourceTree = ""; }; 563B06CF2185E04600B38F35 /* ValueObservationReducerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationReducerTests.swift; sourceTree = ""; }; 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationSchedulingTests.swift; sourceTree = ""; }; + 563B06FE21861D9D00B38F35 /* ValueObservationCountTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationCountTests.swift; sourceTree = ""; }; 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF4362161182C007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF441216131F5007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1174,6 +1177,7 @@ 563B06DB2185E04E00B38F35 /* ValueObservation */ = { isa = PBXGroup; children = ( + 563B06FE21861D9D00B38F35 /* ValueObservationCountTests.swift */, 563B06CC2185E04500B38F35 /* ValueObservationExtentTests.swift */, 563B06CE2185E04600B38F35 /* ValueObservationFetchTests.swift */, 563B06CD2185E04600B38F35 /* ValueObservationReadonlyTests.swift */, @@ -2012,6 +2016,7 @@ F3BA81221CFB3063003DC1BA /* RecordPrimaryKeyRowIDTests.swift in Sources */, F3BA80F81CFB3021003DC1BA /* StatementArgumentsTests.swift in Sources */, 5653EB7D20961FB200F46237 /* AssociationBelongsToSQLTests.swift in Sources */, + 563B070021861D9D00B38F35 /* ValueObservationCountTests.swift in Sources */, 5698AC0A1D9B9FCF0056AF8C /* QueryInterfaceExtensibilityTests.swift in Sources */, 56EA63CA209C7F1E009715B8 /* DerivableRequestTests.swift in Sources */, F3BA80E91CFB3016003DC1BA /* RowAdapterTests.swift in Sources */, @@ -2300,6 +2305,7 @@ F3BA80F61CFB301E003DC1BA /* StatementColumnConvertibleFetchTests.swift in Sources */, F3BA80E61CFB3012003DC1BA /* DatabaseFunctionTests.swift in Sources */, 5653EB7C20961FB200F46237 /* AssociationBelongsToSQLTests.swift in Sources */, + 563B06FF21861D9D00B38F35 /* ValueObservationCountTests.swift in Sources */, 5698ACDA1DA925430056AF8C /* RowTestCase.swift in Sources */, 56EA63C9209C7F1E009715B8 /* DerivableRequestTests.swift in Sources */, F3BA811D1CFB305F003DC1BA /* TableRecord+QueryInterfaceRequestTests.swift in Sources */, diff --git a/Tests/GRDBTests/ValueObservationCountTests.swift b/Tests/GRDBTests/ValueObservationCountTests.swift new file mode 100644 index 000000000..9c15aab7e --- /dev/null +++ b/Tests/GRDBTests/ValueObservationCountTests.swift @@ -0,0 +1,77 @@ +import XCTest +#if GRDBCIPHER + import GRDBCipher +#elseif GRDBCUSTOMSQLITE + import GRDBCustomSQLite +#else + #if SWIFT_PACKAGE + import CSQLite + #else + import SQLite3 + #endif + import GRDB +#endif + +class ValueObservationCountTests: GRDBTestCase { + func testCount() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + struct T: TableRecord { } + var observation = ValueObservation.forCount(T.all()) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { count in + counts.append(count) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + try dbQueue.write { + try $0.execute("UPDATE t SET id = id") + } + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [0, 1, 1, 2]) + } + + func testCountWithUniquing() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 3 + + struct T: TableRecord { } + var observation = ValueObservation.forCount(withUniquing: T.all()) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { count in + counts.append(count) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + try dbQueue.write { + try $0.execute("UPDATE t SET id = id") + } + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [0, 1, 2]) + } +} From 0010be4e561215694e271b9df50dada279ed70ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 18:40:21 +0100 Subject: [PATCH 036/109] ValueObservation: row tests --- GRDB.xcodeproj/project.pbxproj | 6 + GRDBCipher.xcodeproj/project.pbxproj | 10 ++ GRDBCustom.xcodeproj/project.pbxproj | 6 + .../GRDBTests/ValueObservationRowTests.swift | 157 ++++++++++++++++++ 4 files changed, 179 insertions(+) create mode 100644 Tests/GRDBTests/ValueObservationRowTests.swift diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index a1abd4678..3fe83e215 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -131,6 +131,8 @@ 563B06CB2185D2E500B38F35 /* ValueObservationFetchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */; }; 563B06F721861D8400B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F621861D8300B38F35 /* ValueObservationCountTests.swift */; }; 563B06F821861D8400B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F621861D8300B38F35 /* ValueObservationCountTests.swift */; }; + 563B0705218627F800B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */; }; + 563B0706218627F800B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */; }; 563EF415215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF416215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF417215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; @@ -911,6 +913,7 @@ 563B06C22185D29F00B38F35 /* ValueObservationReadonlyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationReadonlyTests.swift; sourceTree = ""; }; 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationFetchTests.swift; sourceTree = ""; }; 563B06F621861D8300B38F35 /* ValueObservationCountTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationCountTests.swift; sourceTree = ""; }; + 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; 563EF414215F87EB007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF42C2161180D007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF43E216131D1007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1480,6 +1483,7 @@ 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */, 563B06C22185D29F00B38F35 /* ValueObservationReadonlyTests.swift */, 563B06BC2185CCD300B38F35 /* ValueObservationReducerTests.swift */, + 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */, 563B06C12185D29F00B38F35 /* ValueObservationSchedulingTests.swift */, ); name = ValueObservation; @@ -2670,6 +2674,7 @@ 5698AC071D9B9FCF0056AF8C /* QueryInterfaceExtensibilityTests.swift in Sources */, 56C3F7561CF9F12400F6A361 /* DatabaseSavepointTests.swift in Sources */, 56B021CD1D8C0D3900B239BB /* MutablePersistableRecordPersistenceConflictPolicyTests.swift in Sources */, + 563B0706218627F800B38F35 /* ValueObservationRowTests.swift in Sources */, 569531271C9087B700CF1A2B /* DatabaseQueueSchemaCacheTests.swift in Sources */, 56B14E831D4DAE54000BF4A3 /* RowFromDictionaryLiteralTests.swift in Sources */, 562393341DEDFC5700A6B01F /* AnyCursorTests.swift in Sources */, @@ -2843,6 +2848,7 @@ 56D496BF1D8135D4008276D7 /* TableDefinitionTests.swift in Sources */, 5674A7171F3087710095F066 /* DatabaseValueConvertibleDecodableTests.swift in Sources */, 56D496801D813131008276D7 /* StatementColumnConvertibleFetchTests.swift in Sources */, + 563B0705218627F800B38F35 /* ValueObservationRowTests.swift in Sources */, 56D4966E1D81309E008276D7 /* RecordPrimaryKeyMultipleTests.swift in Sources */, 56D496891D81316E008276D7 /* DatabaseValueConvertibleFetchTests.swift in Sources */, 56D4967C1D8130DB008276D7 /* CGFloatTests.swift in Sources */, diff --git a/GRDBCipher.xcodeproj/project.pbxproj b/GRDBCipher.xcodeproj/project.pbxproj index 633ac4e4f..c25dc26c3 100755 --- a/GRDBCipher.xcodeproj/project.pbxproj +++ b/GRDBCipher.xcodeproj/project.pbxproj @@ -206,6 +206,10 @@ 563B06FB21861D8B00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */; }; 563B06FC21861D8B00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */; }; 563B06FD21861D8B00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */; }; + 563B07082186280600B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B07072186280500B38F35 /* ValueObservationRowTests.swift */; }; + 563B07092186280600B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B07072186280500B38F35 /* ValueObservationRowTests.swift */; }; + 563B070A2186280600B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B07072186280500B38F35 /* ValueObservationRowTests.swift */; }; + 563B070B2186280600B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B07072186280500B38F35 /* ValueObservationRowTests.swift */; }; 563EF424215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF425215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF43C2161183E007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF43A2161183E007DAACD /* AssociationAggregate.swift */; }; @@ -1021,6 +1025,7 @@ 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationReducerTests.swift; sourceTree = ""; }; 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationSchedulingTests.swift; sourceTree = ""; }; 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationCountTests.swift; sourceTree = ""; }; + 563B07072186280500B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; 563EF422215F8A88007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF43A2161183E007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF44421613212007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1560,6 +1565,7 @@ 563B06DE2185E07200B38F35 /* ValueObservationFetchTests.swift */, 563B06DD2185E07200B38F35 /* ValueObservationReadonlyTests.swift */, 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */, + 563B07072186280500B38F35 /* ValueObservationRowTests.swift */, 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */, ); name = ValueObservation; @@ -2372,6 +2378,7 @@ 560FC5711CB00B880014AA8E /* RecordPrimaryKeySingleTests.swift in Sources */, 5674A7191F3087710095F066 /* DatabaseValueConvertibleDecodableTests.swift in Sources */, 56B021CA1D8C0D3900B239BB /* MutablePersistableRecordPersistenceConflictPolicyTests.swift in Sources */, + 563B07082186280600B38F35 /* ValueObservationRowTests.swift in Sources */, 562205F61E420E48005860AC /* DatabaseQueueReleaseMemoryTests.swift in Sources */, 560FC5741CB00B880014AA8E /* DatabasePoolFunctionTests.swift in Sources */, 5653EBDC20961FE800F46237 /* AssociationParallelRowScopesTests.swift in Sources */, @@ -2545,6 +2552,7 @@ 56B021CB1D8C0D3900B239BB /* MutablePersistableRecordPersistenceConflictPolicyTests.swift in Sources */, 5674A71B1F3087710095F066 /* DatabaseValueConvertibleDecodableTests.swift in Sources */, 56B14E811D4DAE54000BF4A3 /* RowFromDictionaryLiteralTests.swift in Sources */, + 563B07092186280600B38F35 /* ValueObservationRowTests.swift in Sources */, 562205F91E420E49005860AC /* DatabaseQueueReleaseMemoryTests.swift in Sources */, 566AD8C81D531BEB002EC1A8 /* TableDefinitionTests.swift in Sources */, 5653EBDD20961FE800F46237 /* AssociationParallelRowScopesTests.swift in Sources */, @@ -2834,6 +2842,7 @@ 56AFCA421CB1AA9900F48B96 /* DatabasePoolFunctionTests.swift in Sources */, 5674A7181F3087710095F066 /* DatabaseValueConvertibleDecodableTests.swift in Sources */, 56AFCA441CB1AA9900F48B96 /* RowCopiedFromStatementTests.swift in Sources */, + 563B070A2186280600B38F35 /* ValueObservationRowTests.swift in Sources */, 56C3F7571CF9F12400F6A361 /* DatabaseSavepointTests.swift in Sources */, 562393351DEDFC5700A6B01F /* AnyCursorTests.swift in Sources */, 5653EBDE20961FE800F46237 /* AssociationParallelRowScopesTests.swift in Sources */, @@ -3007,6 +3016,7 @@ 56FF455C1D2CDA5200F21EF9 /* RecordUniqueIndexTests.swift in Sources */, 56AFCA971CB1ABC800F48B96 /* DatabasePoolCollationTests.swift in Sources */, 5674A7151F3087710095F066 /* DatabaseValueConvertibleDecodableTests.swift in Sources */, + 563B070B2186280600B38F35 /* ValueObservationRowTests.swift in Sources */, 5657AB5C1D108BA9006283EF /* FoundationNSStringTests.swift in Sources */, 56AFCA981CB1ABC800F48B96 /* RecordPrimaryKeySingleTests.swift in Sources */, 562393361DEDFC5700A6B01F /* AnyCursorTests.swift in Sources */, diff --git a/GRDBCustom.xcodeproj/project.pbxproj b/GRDBCustom.xcodeproj/project.pbxproj index 7e5949454..f71c79757 100755 --- a/GRDBCustom.xcodeproj/project.pbxproj +++ b/GRDBCustom.xcodeproj/project.pbxproj @@ -57,6 +57,8 @@ 563B06DA2185E04600B38F35 /* ValueObservationSchedulingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */; }; 563B06FF21861D9D00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06FE21861D9D00B38F35 /* ValueObservationCountTests.swift */; }; 563B070021861D9D00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06FE21861D9D00B38F35 /* ValueObservationCountTests.swift */; }; + 563B0702218627DF00B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */; }; + 563B0703218627DF00B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */; }; 563EF420215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF421215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF4382161182C007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF4362161182C007DAACD /* AssociationAggregate.swift */; }; @@ -670,6 +672,7 @@ 563B06CF2185E04600B38F35 /* ValueObservationReducerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationReducerTests.swift; sourceTree = ""; }; 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationSchedulingTests.swift; sourceTree = ""; }; 563B06FE21861D9D00B38F35 /* ValueObservationCountTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationCountTests.swift; sourceTree = ""; }; + 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF4362161182C007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF441216131F5007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1182,6 +1185,7 @@ 563B06CE2185E04600B38F35 /* ValueObservationFetchTests.swift */, 563B06CD2185E04600B38F35 /* ValueObservationReadonlyTests.swift */, 563B06CF2185E04600B38F35 /* ValueObservationReducerTests.swift */, + 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */, 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */, ); name = ValueObservation; @@ -2023,6 +2027,7 @@ 562393371DEDFC5700A6B01F /* AnyCursorTests.swift in Sources */, 5674A7161F3087710095F066 /* DatabaseValueConvertibleDecodableTests.swift in Sources */, 56B021D01D8C0D3900B239BB /* MutablePersistableRecordPersistenceConflictPolicyTests.swift in Sources */, + 563B0703218627DF00B38F35 /* ValueObservationRowTests.swift in Sources */, 5623935E1DEE013C00A6B01F /* FilterCursorTests.swift in Sources */, 56B14E861D4DAE54000BF4A3 /* RowFromDictionaryLiteralTests.swift in Sources */, 566AD8CD1D531BEE002EC1A8 /* TableDefinitionTests.swift in Sources */, @@ -2312,6 +2317,7 @@ F3BA80AD1CFB2FA6003DC1BA /* DataMemoryTests.swift in Sources */, 5698ACB91DA6285E0056AF8C /* FTS3TokenizerTests.swift in Sources */, 5674A7141F3087710095F066 /* DatabaseValueConvertibleDecodableTests.swift in Sources */, + 563B0702218627DF00B38F35 /* ValueObservationRowTests.swift in Sources */, 567A80561D41350C00C7DCEC /* IndexInfoTests.swift in Sources */, F3BA81301CFB3064003DC1BA /* RecordPrimaryKeyRowIDTests.swift in Sources */, 56DAA2D51DE99DAB006E10C8 /* DatabaseCursorTests.swift in Sources */, diff --git a/Tests/GRDBTests/ValueObservationRowTests.swift b/Tests/GRDBTests/ValueObservationRowTests.swift new file mode 100644 index 000000000..f268a8652 --- /dev/null +++ b/Tests/GRDBTests/ValueObservationRowTests.swift @@ -0,0 +1,157 @@ +import XCTest +#if GRDBCIPHER + import GRDBCipher +#elseif GRDBCUSTOMSQLITE + import GRDBCustomSQLite +#else + #if SWIFT_PACKAGE + import CSQLite + #else + import SQLite3 + #endif + import GRDB +#endif + +class ValueObservationRowTests: GRDBTestCase { + func testAll() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [[Row]] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + var observation = ValueObservation.forAll(SQLRequest("SELECT * FROM t ORDER BY id")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { rows in + results.append(rows) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results, [ + [], + [["id":1, "name":"foo"]], + [["id":1, "name":"foo"]], + [["id":1, "name":"foo"], ["id":2, "name":"bar"]]]) + } + + func testAllWithUniquing() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [[Row]] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 3 + + var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { rows in + results.append(rows) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results, [ + [], + [["id":1, "name":"foo"]], + [["id":1, "name":"foo"], ["id":2, "name":"bar"]]]) + } + + func testOne() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [Row?] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 5 + + var observation = ValueObservation.forOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { row in + results.append(row) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + try dbQueue.write { + try $0.execute("DELETE FROM t") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results, [ + nil, + ["id":1, "name":"foo"], + ["id":1, "name":"foo"], + ["id":2, "name":"bar"], + nil]) + } + + func testOneWithUniquing() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [Row?] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + var observation = ValueObservation.forOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { row in + results.append(row) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + try dbQueue.write { + try $0.execute("DELETE FROM t") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results, [ + nil, + ["id":1, "name":"foo"], + ["id":2, "name":"bar"], + nil]) + } +} From 0d5adfe5a9723959bd405a2d1aa3b844e2c314a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 19:16:55 +0100 Subject: [PATCH 037/109] ValueObservation: FetchableRecord & DatabaseValueConvertible tests --- GRDB.xcodeproj/project.pbxproj | 12 + GRDB/Core/ValueObservation.swift | 8 +- GRDBCipher.xcodeproj/project.pbxproj | 20 ++ GRDBCustom.xcodeproj/project.pbxproj | 12 + ...rvationDatabaseValueConvertibleTests.swift | 239 ++++++++++++++++++ .../ValueObservationRecordTests.swift | 171 +++++++++++++ 6 files changed, 458 insertions(+), 4 deletions(-) create mode 100644 Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift create mode 100644 Tests/GRDBTests/ValueObservationRecordTests.swift diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index 3fe83e215..b42142903 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -133,6 +133,10 @@ 563B06F821861D8400B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06F621861D8300B38F35 /* ValueObservationCountTests.swift */; }; 563B0705218627F800B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */; }; 563B0706218627F800B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */; }; + 563B071521862C4700B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071421862C4600B38F35 /* ValueObservationRecordTests.swift */; }; + 563B071621862C4700B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071421862C4600B38F35 /* ValueObservationRecordTests.swift */; }; + 563B071821862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071721862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; + 563B071921862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071721862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; 563EF415215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF416215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF417215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; @@ -914,6 +918,8 @@ 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationFetchTests.swift; sourceTree = ""; }; 563B06F621861D8300B38F35 /* ValueObservationCountTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationCountTests.swift; sourceTree = ""; }; 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; + 563B071421862C4600B38F35 /* ValueObservationRecordTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRecordTests.swift; sourceTree = ""; }; + 563B071721862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationDatabaseValueConvertibleTests.swift; sourceTree = ""; }; 563EF414215F87EB007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF42C2161180D007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF43E216131D1007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1479,9 +1485,11 @@ isa = PBXGroup; children = ( 563B06F621861D8300B38F35 /* ValueObservationCountTests.swift */, + 563B071721862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */, 563B06C02185D29F00B38F35 /* ValueObservationExtentTests.swift */, 563B06C92185D2E500B38F35 /* ValueObservationFetchTests.swift */, 563B06C22185D29F00B38F35 /* ValueObservationReadonlyTests.swift */, + 563B071421862C4600B38F35 /* ValueObservationRecordTests.swift */, 563B06BC2185CCD300B38F35 /* ValueObservationReducerTests.swift */, 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */, 563B06C12185D29F00B38F35 /* ValueObservationSchedulingTests.swift */, @@ -2708,6 +2716,7 @@ 56F3E74D1E66F83A00BF0F01 /* ResultCodeTests.swift in Sources */, 56EB0AB31BCD787300A3DC55 /* DataMemoryTests.swift in Sources */, 56B6EF57208CB4E3002F0ACB /* ColumnExpressionTests.swift in Sources */, + 563B071621862C4700B38F35 /* ValueObservationRecordTests.swift in Sources */, 56176C7F1EACCD2F000F3F2B /* EncryptionTests.swift in Sources */, 56741EAC1E66A8B3003E422D /* FetchRequestTests.swift in Sources */, 5672DE5C1CDB72520022BA81 /* DatabaseQueueBackupTests.swift in Sources */, @@ -2718,6 +2727,7 @@ 564E73E0203D50B9000C443C /* JoinSupportTests.swift in Sources */, 5674A7121F3087710095F066 /* DatabaseValueConvertibleEncodableTests.swift in Sources */, 5657AB521D108BA9006283EF /* FoundationNSNumberTests.swift in Sources */, + 563B071921862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */, 5665F85E203EE6030084C6C0 /* ColumnInfoTests.swift in Sources */, 56A238441B9C74A90082EB20 /* RawRepresentable+DatabaseValueConvertibleTests.swift in Sources */, 560A37AC1C90085D00949E71 /* DatabasePoolConcurrencyTests.swift in Sources */, @@ -2882,6 +2892,7 @@ 5653EADE20944B4F00F46237 /* AssociationHasOneSQLDerivationTests.swift in Sources */, 56D496661D813086008276D7 /* QueryInterfaceRequestTests.swift in Sources */, 56F3E7491E66F83A00BF0F01 /* ResultCodeTests.swift in Sources */, + 563B071521862C4700B38F35 /* ValueObservationRecordTests.swift in Sources */, 56B6EF56208CB4E3002F0ACB /* ColumnExpressionTests.swift in Sources */, 5698ACD71DA925420056AF8C /* RowTestCase.swift in Sources */, 56176C7D1EACCD2D000F3F2B /* EncryptionTests.swift in Sources */, @@ -2892,6 +2903,7 @@ 56D496581D81304E008276D7 /* FoundationDateTests.swift in Sources */, 562205F31E420E47005860AC /* DatabaseQueueReleaseMemoryTests.swift in Sources */, 564E73DF203D50B9000C443C /* JoinSupportTests.swift in Sources */, + 563B071821862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */, 5674A70F1F3087710095F066 /* DatabaseValueConvertibleEncodableTests.swift in Sources */, 56D496711D81309E008276D7 /* RecordPrimaryKeySingleTests.swift in Sources */, 5665F85D203EE6030084C6C0 /* ColumnInfoTests.swift in Sources */, diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 8b490fa9a..3e99e938e 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -188,12 +188,12 @@ public enum ValueReducers { } /// :nodoc: - public mutating func value(_ newRow: Row?) -> Record? { + public mutating func value(_ newRow: Row?) -> Record?? { if let row = row, row == newRow { return nil } self.row = newRow - return newRow.map(Record.init(row:)) + return .some(newRow.map(Record.init(row:))) } } @@ -236,12 +236,12 @@ public enum ValueReducers { } /// :nodoc: - public mutating func value(_ newDbValue: DatabaseValue?) -> T? { + public mutating func value(_ newDbValue: DatabaseValue?) -> T?? { if let dbValue = dbValue, dbValue == newDbValue { return nil } self.dbValue = newDbValue - return newDbValue.map { T.decode(from: $0, conversionContext: nil) } + return .some(newDbValue.map { T.decode(from: $0, conversionContext: nil) }) } } diff --git a/GRDBCipher.xcodeproj/project.pbxproj b/GRDBCipher.xcodeproj/project.pbxproj index c25dc26c3..f6541248d 100755 --- a/GRDBCipher.xcodeproj/project.pbxproj +++ b/GRDBCipher.xcodeproj/project.pbxproj @@ -210,6 +210,14 @@ 563B07092186280600B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B07072186280500B38F35 /* ValueObservationRowTests.swift */; }; 563B070A2186280600B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B07072186280500B38F35 /* ValueObservationRowTests.swift */; }; 563B070B2186280600B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B07072186280500B38F35 /* ValueObservationRowTests.swift */; }; + 563B070D21862C3600B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B070C21862C3500B38F35 /* ValueObservationRecordTests.swift */; }; + 563B070E21862C3600B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B070C21862C3500B38F35 /* ValueObservationRecordTests.swift */; }; + 563B070F21862C3600B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B070C21862C3500B38F35 /* ValueObservationRecordTests.swift */; }; + 563B071021862C3600B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B070C21862C3500B38F35 /* ValueObservationRecordTests.swift */; }; + 563B071E21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; + 563B071F21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; + 563B072021862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; + 563B072121862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; 563EF424215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF425215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF43C2161183E007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF43A2161183E007DAACD /* AssociationAggregate.swift */; }; @@ -1026,6 +1034,8 @@ 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationSchedulingTests.swift; sourceTree = ""; }; 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationCountTests.swift; sourceTree = ""; }; 563B07072186280500B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; + 563B070C21862C3500B38F35 /* ValueObservationRecordTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRecordTests.swift; sourceTree = ""; }; + 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationDatabaseValueConvertibleTests.swift; sourceTree = ""; }; 563EF422215F8A88007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF43A2161183E007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF44421613212007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1561,9 +1571,11 @@ isa = PBXGroup; children = ( 563B06F921861D8B00B38F35 /* ValueObservationCountTests.swift */, + 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */, 563B06DC2185E07100B38F35 /* ValueObservationExtentTests.swift */, 563B06DE2185E07200B38F35 /* ValueObservationFetchTests.swift */, 563B06DD2185E07200B38F35 /* ValueObservationReadonlyTests.swift */, + 563B070C21862C3500B38F35 /* ValueObservationRecordTests.swift */, 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */, 563B07072186280500B38F35 /* ValueObservationRowTests.swift */, 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */, @@ -2412,6 +2424,7 @@ 560FC57D1CB00B880014AA8E /* RecordInitializersTests.swift in Sources */, 56176C5F1EACCCC7000F3F2B /* FTS5CustomTokenizerTests.swift in Sources */, 565F03C31CE5D3AA00DE108F /* RowAdapterTests.swift in Sources */, + 563B070D21862C3600B38F35 /* ValueObservationRecordTests.swift in Sources */, 56B6EF64208CB762002F0ACB /* ColumnExpressionTests.swift in Sources */, 5657AB3F1D108BA9006283EF /* FoundationNSDataTests.swift in Sources */, 560FC57E1CB00B880014AA8E /* MutablePersistableRecordTests.swift in Sources */, @@ -2422,6 +2435,7 @@ 5653EBE820961FE800F46237 /* AssociationBelongsToDecodableRecordTests.swift in Sources */, 56176C601EACCCC7000F3F2B /* FTS5PatternTests.swift in Sources */, 564E73EF203DA2A2000C443C /* JoinSupportTests.swift in Sources */, + 563B071E21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */, 5674A7111F3087710095F066 /* DatabaseValueConvertibleEncodableTests.swift in Sources */, 5657AB471D108BA9006283EF /* FoundationNSNullTests.swift in Sources */, 5665F86C203EF47D0084C6C0 /* ColumnInfoTests.swift in Sources */, @@ -2586,6 +2600,7 @@ 5671563B1CB16729007DC145 /* RecordInitializersTests.swift in Sources */, 56176C651EACCCC8000F3F2B /* FTS5CustomTokenizerTests.swift in Sources */, 5657AB681D108BA9006283EF /* FoundationURLTests.swift in Sources */, + 563B070E21862C3600B38F35 /* ValueObservationRecordTests.swift in Sources */, 56B6EF65208CB762002F0ACB /* ColumnExpressionTests.swift in Sources */, 5671563C1CB16729007DC145 /* MutablePersistableRecordTests.swift in Sources */, 5671563D1CB16729007DC145 /* FetchableRecord+QueryInterfaceRequestTests.swift in Sources */, @@ -2596,6 +2611,7 @@ 5653EBE920961FE800F46237 /* AssociationBelongsToDecodableRecordTests.swift in Sources */, 56176C661EACCCC8000F3F2B /* FTS5PatternTests.swift in Sources */, 564E73F0203DA2A3000C443C /* JoinSupportTests.swift in Sources */, + 563B071F21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */, 5674A7131F3087710095F066 /* DatabaseValueConvertibleEncodableTests.swift in Sources */, 567156411CB16729007DC145 /* PersistableRecordTests.swift in Sources */, 5665F86D203EF47D0084C6C0 /* ColumnInfoTests.swift in Sources */, @@ -2876,6 +2892,7 @@ 5657AB6B1D108BA9006283EF /* FoundationURLTests.swift in Sources */, 56AFCA4F1CB1AA9900F48B96 /* DataMemoryTests.swift in Sources */, 56176C711EACCCCA000F3F2B /* FTS5CustomTokenizerTests.swift in Sources */, + 563B070F21862C3600B38F35 /* ValueObservationRecordTests.swift in Sources */, 56B6EF66208CB762002F0ACB /* ColumnExpressionTests.swift in Sources */, 5672DE5D1CDB72520022BA81 /* DatabaseQueueBackupTests.swift in Sources */, 56AFCA501CB1AA9900F48B96 /* RecordCopyTests.swift in Sources */, @@ -2886,6 +2903,7 @@ 5653EBEA20961FE800F46237 /* AssociationBelongsToDecodableRecordTests.swift in Sources */, 5698AC9B1DA4B0430056AF8C /* FTS4RecordTests.swift in Sources */, 56176C721EACCCCA000F3F2B /* FTS5PatternTests.swift in Sources */, + 563B072021862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */, 564E73F1203DA2A3000C443C /* JoinSupportTests.swift in Sources */, 5674A7101F3087710095F066 /* DatabaseValueConvertibleEncodableTests.swift in Sources */, 56AFCA551CB1AA9900F48B96 /* RawRepresentable+DatabaseValueConvertibleTests.swift in Sources */, @@ -3050,6 +3068,7 @@ 56AFCAA51CB1ABC800F48B96 /* FetchableRecord+QueryInterfaceRequestTests.swift in Sources */, 56AFCAA61CB1ABC800F48B96 /* DatabasePoolReadOnlyTests.swift in Sources */, 56176C771EACCCCB000F3F2B /* FTS5CustomTokenizerTests.swift in Sources */, + 563B071021862C3600B38F35 /* ValueObservationRecordTests.swift in Sources */, 56B6EF67208CB762002F0ACB /* ColumnExpressionTests.swift in Sources */, 5657AB6C1D108BA9006283EF /* FoundationURLTests.swift in Sources */, 56AFCAA81CB1ABC800F48B96 /* DataMemoryTests.swift in Sources */, @@ -3060,6 +3079,7 @@ 5653EBEB20961FE800F46237 /* AssociationBelongsToDecodableRecordTests.swift in Sources */, 5698AC9C1DA4B0430056AF8C /* FTS4RecordTests.swift in Sources */, 56176C781EACCCCB000F3F2B /* FTS5PatternTests.swift in Sources */, + 563B072121862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */, 564E73F2203DA2A4000C443C /* JoinSupportTests.swift in Sources */, 5674A70D1F3087710095F066 /* DatabaseValueConvertibleEncodableTests.swift in Sources */, 56AFCAAC1CB1ABC800F48B96 /* DatabaseValueConversionTests.swift in Sources */, diff --git a/GRDBCustom.xcodeproj/project.pbxproj b/GRDBCustom.xcodeproj/project.pbxproj index f71c79757..7b4462c5f 100755 --- a/GRDBCustom.xcodeproj/project.pbxproj +++ b/GRDBCustom.xcodeproj/project.pbxproj @@ -59,6 +59,10 @@ 563B070021861D9D00B38F35 /* ValueObservationCountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B06FE21861D9D00B38F35 /* ValueObservationCountTests.swift */; }; 563B0702218627DF00B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */; }; 563B0703218627DF00B38F35 /* ValueObservationRowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */; }; + 563B071221862C3E00B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071121862C3E00B38F35 /* ValueObservationRecordTests.swift */; }; + 563B071321862C3E00B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071121862C3E00B38F35 /* ValueObservationRecordTests.swift */; }; + 563B071B21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071A21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; + 563B071C21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071A21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; 563EF420215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF421215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF4382161182C007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF4362161182C007DAACD /* AssociationAggregate.swift */; }; @@ -673,6 +677,8 @@ 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationSchedulingTests.swift; sourceTree = ""; }; 563B06FE21861D9D00B38F35 /* ValueObservationCountTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationCountTests.swift; sourceTree = ""; }; 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; + 563B071121862C3E00B38F35 /* ValueObservationRecordTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRecordTests.swift; sourceTree = ""; }; + 563B071A21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationDatabaseValueConvertibleTests.swift; sourceTree = ""; }; 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF4362161182C007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF441216131F5007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1181,9 +1187,11 @@ isa = PBXGroup; children = ( 563B06FE21861D9D00B38F35 /* ValueObservationCountTests.swift */, + 563B071A21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */, 563B06CC2185E04500B38F35 /* ValueObservationExtentTests.swift */, 563B06CE2185E04600B38F35 /* ValueObservationFetchTests.swift */, 563B06CD2185E04600B38F35 /* ValueObservationReadonlyTests.swift */, + 563B071121862C3E00B38F35 /* ValueObservationRecordTests.swift */, 563B06CF2185E04600B38F35 /* ValueObservationReducerTests.swift */, 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */, 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */, @@ -2061,6 +2069,7 @@ 5698ACBD1DA6285E0056AF8C /* FTS3TokenizerTests.swift in Sources */, 5623931F1DECC02000A6B01F /* RowFetchTests.swift in Sources */, 562393701DEE0CD200A6B01F /* FlattenCursorTests.swift in Sources */, + 563B071321862C3E00B38F35 /* ValueObservationRecordTests.swift in Sources */, 56B6EF61208CB746002F0ACB /* ColumnExpressionTests.swift in Sources */, F3BA81121CFB3059003DC1BA /* DatabaseMigratorTests.swift in Sources */, 56176C801EACCD31000F3F2B /* EncryptionTests.swift in Sources */, @@ -2071,6 +2080,7 @@ 5653EB8120961FB200F46237 /* AssociationBelongsToDecodableRecordTests.swift in Sources */, 56B964CA1DA521450002DA19 /* FTS5PatternTests.swift in Sources */, 564E73F4203DA2AD000C443C /* JoinSupportTests.swift in Sources */, + 563B071C21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */, 5674A70E1F3087710095F066 /* DatabaseValueConvertibleEncodableTests.swift in Sources */, 5657AB551D108BA9006283EF /* FoundationNSNumberTests.swift in Sources */, 5665F869203EF4650084C6C0 /* ColumnInfoTests.swift in Sources */, @@ -2351,6 +2361,7 @@ 5657AB411D108BA9006283EF /* FoundationNSDataTests.swift in Sources */, 56B964C61DA521450002DA19 /* FTS5PatternTests.swift in Sources */, 562205FA1E420E49005860AC /* DatabasePoolReleaseMemoryTests.swift in Sources */, + 563B071221862C3E00B38F35 /* ValueObservationRecordTests.swift in Sources */, 56B6EF60208CB746002F0ACB /* ColumnExpressionTests.swift in Sources */, 562205FD1E420EA2005860AC /* DatabasePoolBackupTests.swift in Sources */, 562206091E420EB2005860AC /* DatabaseQueueConcurrencyTests.swift in Sources */, @@ -2361,6 +2372,7 @@ 5653EB8020961FB200F46237 /* AssociationBelongsToDecodableRecordTests.swift in Sources */, 5657AB611D108BA9006283EF /* FoundationNSURLTests.swift in Sources */, 564E73F3203DA2AC000C443C /* JoinSupportTests.swift in Sources */, + 563B071B21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */, 5674A70C1F3087710095F066 /* DatabaseValueConvertibleEncodableTests.swift in Sources */, 5698AC8C1DA389380056AF8C /* FTS3TableBuilderTests.swift in Sources */, 5665F868203EF4640084C6C0 /* ColumnInfoTests.swift in Sources */, diff --git a/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift b/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift new file mode 100644 index 000000000..dff500f44 --- /dev/null +++ b/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift @@ -0,0 +1,239 @@ +import XCTest +#if GRDBCIPHER + import GRDBCipher +#elseif GRDBCUSTOMSQLITE + import GRDBCustomSQLite +#else + #if SWIFT_PACKAGE + import CSQLite + #else + import SQLite3 + #endif + import GRDB +#endif + +private struct Name: DatabaseValueConvertible { + var rawValue: String + + var databaseValue: DatabaseValue { + return rawValue.databaseValue + } + + static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Name? { + guard let rawValue = String.fromDatabaseValue(dbValue) else { + return nil + } + return Name(rawValue: rawValue) + } +} + +class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { + func testAll() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [[Name]] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { names in + results.append(names) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ + [], + ["foo"], + ["foo"], + ["foo", "bar"]]) + } + + func testAllWithUniquing() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [[Name]] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 3 + + var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { names in + results.append(names) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ + [], + ["foo"], + ["foo", "bar"]]) + } + + func testOne() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [Name?] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 5 + + var observation = ValueObservation.forOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { name in + results.append(name) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + try dbQueue.write { + try $0.execute("DELETE FROM t") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ + nil, + "foo", + "foo", + "bar", + nil]) + } + + func testOneWithUniquing() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [Name?] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + var observation = ValueObservation.forOne(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id DESC")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { name in + results.append(name) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + try dbQueue.write { + try $0.execute("DELETE FROM t") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ + nil, + "foo", + "bar", + nil]) + } + + func testAllOptional() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [[Name?]] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { names in + results.append(names) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, NULL)") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0?.rawValue }}, [ + [], + ["foo"], + ["foo"], + ["foo", nil]]) + } + + func testAllOptionalWithUniquing() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [[Name?]] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 3 + + var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { names in + results.append(names) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, NULL)") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0?.rawValue }}, [ + [], + ["foo"], + ["foo", nil]]) + } +} diff --git a/Tests/GRDBTests/ValueObservationRecordTests.swift b/Tests/GRDBTests/ValueObservationRecordTests.swift new file mode 100644 index 000000000..4c7b819fd --- /dev/null +++ b/Tests/GRDBTests/ValueObservationRecordTests.swift @@ -0,0 +1,171 @@ +import XCTest +#if GRDBCIPHER + import GRDBCipher +#elseif GRDBCUSTOMSQLITE + import GRDBCustomSQLite +#else + #if SWIFT_PACKAGE + import CSQLite + #else + import SQLite3 + #endif + import GRDB +#endif + +private struct Player: FetchableRecord { + var id: Int64 + var name: String + + init(row: Row) { + self.id = row["id"] + self.name = row["name"] + } + + var row: Row { + return ["id": id, "name": name] + } +} + +class ValueObservationRecordTests: GRDBTestCase { + func testAll() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [[Player]] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + var observation = ValueObservation.forAll(SQLRequest("SELECT * FROM t ORDER BY id")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { players in + results.append(players) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0.row }}, [ + [], + [["id":1, "name":"foo"]], + [["id":1, "name":"foo"]], + [["id":1, "name":"foo"], ["id":2, "name":"bar"]]]) + } + + func testAllWithUniquing() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [[Player]] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 3 + + var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { players in + results.append(players) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0.row }}, [ + [], + [["id":1, "name":"foo"]], + [["id":1, "name":"foo"], ["id":2, "name":"bar"]]]) + } + + func testOne() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [Player?] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 5 + + var observation = ValueObservation.forOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { player in + results.append(player) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + try dbQueue.write { + try $0.execute("DELETE FROM t") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0.row }}, [ + nil, + ["id":1, "name":"foo"], + ["id":1, "name":"foo"], + ["id":2, "name":"bar"], + nil]) + } + + func testOneWithUniquing() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [Player?] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + var observation = ValueObservation.forOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { player in + results.append(player) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + try dbQueue.write { + try $0.execute("DELETE FROM t") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0.row }}, [ + nil, + ["id":1, "name":"foo"], + ["id":2, "name":"bar"], + nil]) + } +} From de2823b613216841d05fefb0b7fdc814a4659b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 19:28:19 +0100 Subject: [PATCH 038/109] ValueObservation: StatementColumnConvertible tests --- GRDB.xcodeproj/project.pbxproj | 6 + GRDBCipher.xcodeproj/project.pbxproj | 10 ++ GRDBCustom.xcodeproj/project.pbxproj | 6 + ...ationStatementColumnConvertibleTests.swift | 148 ++++++++++++++++++ 4 files changed, 170 insertions(+) create mode 100644 Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index b42142903..00806ec7d 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -137,6 +137,8 @@ 563B071621862C4700B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071421862C4600B38F35 /* ValueObservationRecordTests.swift */; }; 563B071821862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071721862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; 563B071921862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071721862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; + 563B0723218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0722218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; + 563B0724218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0722218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; 563EF415215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF416215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF417215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; @@ -920,6 +922,7 @@ 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; 563B071421862C4600B38F35 /* ValueObservationRecordTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRecordTests.swift; sourceTree = ""; }; 563B071721862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationDatabaseValueConvertibleTests.swift; sourceTree = ""; }; + 563B0722218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationStatementColumnConvertibleTests.swift; sourceTree = ""; }; 563EF414215F87EB007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF42C2161180D007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF43E216131D1007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1493,6 +1496,7 @@ 563B06BC2185CCD300B38F35 /* ValueObservationReducerTests.swift */, 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */, 563B06C12185D29F00B38F35 /* ValueObservationSchedulingTests.swift */, + 563B0722218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */, ); name = ValueObservation; sourceTree = ""; @@ -2795,6 +2799,7 @@ 562393641DEE06D300A6B01F /* CursorTests.swift in Sources */, 563B06C62185D29F00B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5657AB5A1D108BA9006283EF /* FoundationNSStringTests.swift in Sources */, + 563B0724218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 56300B6C1C53D3E8005A543B /* TableRecord+QueryInterfaceRequestTests.swift in Sources */, 5674A7231F30A8DF0095F066 /* MutablePersistableRecordEncodableTests.swift in Sources */, 56F0B9921B6001C600A2F135 /* FoundationNSDateTests.swift in Sources */, @@ -2971,6 +2976,7 @@ 5653EAD620944B4F00F46237 /* AssociationChainRowScopesTests.swift in Sources */, 563B06C52185D29F00B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5698AC801DA380A20056AF8C /* VirtualTableModuleTests.swift in Sources */, + 563B0723218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 56D496821D813131008276D7 /* TransactionObserverTests.swift in Sources */, 56D496941D81317B008276D7 /* SchedulingWatchdogTests.swift in Sources */, 5674A7201F30A8DF0095F066 /* MutablePersistableRecordEncodableTests.swift in Sources */, diff --git a/GRDBCipher.xcodeproj/project.pbxproj b/GRDBCipher.xcodeproj/project.pbxproj index f6541248d..9f4650dab 100755 --- a/GRDBCipher.xcodeproj/project.pbxproj +++ b/GRDBCipher.xcodeproj/project.pbxproj @@ -218,6 +218,10 @@ 563B071F21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; 563B072021862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; 563B072121862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; + 563B0729218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; + 563B072A218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; + 563B072B218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; + 563B072C218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; 563EF424215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF425215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF43C2161183E007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF43A2161183E007DAACD /* AssociationAggregate.swift */; }; @@ -1036,6 +1040,7 @@ 563B07072186280500B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; 563B070C21862C3500B38F35 /* ValueObservationRecordTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRecordTests.swift; sourceTree = ""; }; 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationDatabaseValueConvertibleTests.swift; sourceTree = ""; }; + 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationStatementColumnConvertibleTests.swift; sourceTree = ""; }; 563EF422215F8A88007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF43A2161183E007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF44421613212007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1579,6 +1584,7 @@ 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */, 563B07072186280500B38F35 /* ValueObservationRowTests.swift */, 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */, + 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */, ); name = ValueObservation; sourceTree = ""; @@ -2503,6 +2509,7 @@ 560FC59E1CB00B880014AA8E /* FoundationNSDateTests.swift in Sources */, 568068321EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, 560FC59F1CB00B880014AA8E /* DatabaseTests.swift in Sources */, + 563B0729218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 560FC5A01CB00B880014AA8E /* QueryInterfaceRequestTests.swift in Sources */, 5698ACCF1DA8C2620056AF8C /* RecordPrimaryKeyHiddenRowIDTests.swift in Sources */, 560FC5A21CB00B880014AA8E /* DatabaseFunctionTests.swift in Sources */, @@ -2679,6 +2686,7 @@ 5671565B1CB16729007DC145 /* TableRecord+QueryInterfaceRequestTests.swift in Sources */, 568068331EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, 5671565C1CB16729007DC145 /* FoundationNSDateTests.swift in Sources */, + 563B072A218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 5671565D1CB16729007DC145 /* DatabaseTests.swift in Sources */, 5671565E1CB16729007DC145 /* QueryInterfaceRequestTests.swift in Sources */, 5698ACD01DA8C2620056AF8C /* RecordPrimaryKeyHiddenRowIDTests.swift in Sources */, @@ -2971,6 +2979,7 @@ 56AFCA6B1CB1AA9900F48B96 /* DatabaseTimestampTests.swift in Sources */, 568068361EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, 56AFCA6C1CB1AA9900F48B96 /* StatementArguments+FoundationTests.swift in Sources */, + 563B072B218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 562393651DEE06D300A6B01F /* CursorTests.swift in Sources */, 5657AB5B1D108BA9006283EF /* FoundationNSStringTests.swift in Sources */, 56AFCA6D1CB1AA9900F48B96 /* TableRecord+QueryInterfaceRequestTests.swift in Sources */, @@ -3147,6 +3156,7 @@ 56AFCAC41CB1ABC800F48B96 /* DatabaseTimestampTests.swift in Sources */, 568068371EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, 56AFCAC51CB1ABC800F48B96 /* StatementArguments+FoundationTests.swift in Sources */, + 563B072C218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 562393661DEE06D300A6B01F /* CursorTests.swift in Sources */, 56AFCAC61CB1ABC800F48B96 /* TableRecord+QueryInterfaceRequestTests.swift in Sources */, 56AFCAC71CB1ABC800F48B96 /* FoundationNSDateTests.swift in Sources */, diff --git a/GRDBCustom.xcodeproj/project.pbxproj b/GRDBCustom.xcodeproj/project.pbxproj index 7b4462c5f..3d164e482 100755 --- a/GRDBCustom.xcodeproj/project.pbxproj +++ b/GRDBCustom.xcodeproj/project.pbxproj @@ -63,6 +63,8 @@ 563B071321862C3E00B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071121862C3E00B38F35 /* ValueObservationRecordTests.swift */; }; 563B071B21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071A21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; 563B071C21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071A21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; + 563B0726218634D800B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0725218634D700B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; + 563B0727218634D800B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0725218634D700B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; 563EF420215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF421215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF4382161182C007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF4362161182C007DAACD /* AssociationAggregate.swift */; }; @@ -679,6 +681,7 @@ 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; 563B071121862C3E00B38F35 /* ValueObservationRecordTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRecordTests.swift; sourceTree = ""; }; 563B071A21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationDatabaseValueConvertibleTests.swift; sourceTree = ""; }; + 563B0725218634D700B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationStatementColumnConvertibleTests.swift; sourceTree = ""; }; 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF4362161182C007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF441216131F5007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1195,6 +1198,7 @@ 563B06CF2185E04600B38F35 /* ValueObservationReducerTests.swift */, 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */, 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */, + 563B0725218634D700B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */, ); name = ValueObservation; sourceTree = ""; @@ -2148,6 +2152,7 @@ F3BA810B1CFB3056003DC1BA /* Row+FoundationTests.swift in Sources */, 5698AC901DA389380056AF8C /* FTS3TableBuilderTests.swift in Sources */, 568068381EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, + 563B0727218634D800B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, F3BA80DB1CFB300E003DC1BA /* DatabaseValueConversionTests.swift in Sources */, 56741EAF1E66A8B3003E422D /* FetchRequestTests.swift in Sources */, 5657AB5D1D108BA9006283EF /* FoundationNSStringTests.swift in Sources */, @@ -2440,6 +2445,7 @@ F3BA81131CFB305B003DC1BA /* DatabaseMigratorTests.swift in Sources */, F3BA81381CFB3064003DC1BA /* RecordSubClassTests.swift in Sources */, F3BA81351CFB3064003DC1BA /* RecordEditedTests.swift in Sources */, + 563B0726218634D800B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 568068341EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, 5657AB691D108BA9006283EF /* FoundationURLTests.swift in Sources */, 56741EAB1E66A8B3003E422D /* FetchRequestTests.swift in Sources */, diff --git a/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift b/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift new file mode 100644 index 000000000..b85e868a4 --- /dev/null +++ b/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift @@ -0,0 +1,148 @@ +import XCTest +#if GRDBCIPHER + import GRDBCipher +#elseif GRDBCUSTOMSQLITE + import GRDBCustomSQLite +#else + #if SWIFT_PACKAGE + import CSQLite + #else + import SQLite3 + #endif + import GRDB +#endif + +private struct Name: DatabaseValueConvertible { + var rawValue: String + var fast: Bool + + var databaseValue: DatabaseValue { + return rawValue.databaseValue + } + + static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Name? { + guard let rawValue = String.fromDatabaseValue(dbValue) else { + return nil + } + return Name(rawValue: rawValue, fast: false) + } +} + +extension Name: StatementColumnConvertible { + init(sqliteStatement: SQLiteStatement, index: Int32) { + self.init(rawValue: String(sqliteStatement: sqliteStatement, index: index), fast: true) + } +} + +class ValueObservationStatementColumnConvertibleTests: GRDBTestCase { + func testAll() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [[Name]] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { names in + XCTAssert(names.allSatisfy { $0.fast }) + results.append(names) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ + [], + ["foo"], + ["foo"], + ["foo", "bar"]]) + } + + func testOne() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [Name?] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 5 + + var observation = ValueObservation.forOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { name in + if let name = name { + XCTAssert(name.fast) + } + results.append(name) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + } + try dbQueue.write { + try $0.execute("DELETE FROM t") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ + nil, + "foo", + "foo", + "bar", + nil]) + } + + func testAllOptional() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } + + var results: [[Name?]] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) + observation.extent = .databaseLifetime + _ = try dbQueue.add(observation: observation) { names in + XCTAssert(names.allSatisfy { $0.map { $0.fast } ?? true }) + results.append(names) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + } + try dbQueue.write { + try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") + } + try dbQueue.write { + try $0.execute("INSERT INTO t (id, name) VALUES (2, NULL)") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(results.map { $0.map { $0?.rawValue }}, [ + [], + ["foo"], + ["foo"], + ["foo", nil]]) + } +} From 158177364b3409c72977eac274b7fd334fc78c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 22:04:39 +0100 Subject: [PATCH 039/109] Documentation --- GRDB/Core/ValueObservation.swift | 6 - README.md | 276 +++++++++++++++++++++++++++++-- 2 files changed, 265 insertions(+), 17 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 3e99e938e..3134598a0 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -48,9 +48,6 @@ public enum ValueScheduling { /// All values are asychronously notified on the specified queue. /// Initial values are only fetched and notified if `startImmediately` /// is true. - /// - /// Correct ordering of notifications is only guaranteed if the queue - /// is serial. case onQueue(DispatchQueue, startImmediately: Bool) } @@ -331,9 +328,6 @@ public struct ValueObservation { /// - `.onQueue(_:startImmediately:)`: all values are asychronously notified /// on the specified queue. Initial values are only fetched and notified if /// `startImmediately` is true. - /// - /// Correct ordering of notifications is only guaranteed if the queue - /// is serial. public var scheduling: ValueScheduling = .mainQueue /// The dispatch queue where change callbacks are called. diff --git a/README.md b/README.md index b1c6ad953..36a438fd1 100644 --- a/README.md +++ b/README.md @@ -5793,14 +5793,9 @@ GRDB puts this SQLite feature to some good use, and lets you observe the databas - [After Commit Hook](#after-commit-hook): The simplest way to handle successful transactions. - [TransactionObserver Protocol](#transactionobserver-protocol): The low-level protocol for database observation - - [Activate a Transaction Observer](#activate-a-transaction-observer) - - [Database Changes And Transactions](#database-changes-and-transactions) - - [Filtering Database Events](#filtering-database-events) - - [Observation Extent](#observation-extent) - - [DatabaseRegion](#databaseregion) - - [Support for SQLite Pre-Update Hooks](#support-for-sqlite-pre-update-hooks) -- [FetchedRecordsController](#fetchedrecordscontroller): Automated tracking of changes in a query results, plus UITableView animations -- [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB): Automated tracking of changes in a query results, based on [RxSwift](https://github.com/ReactiveX/RxSwift) +- [ValueObservation]: Automated tracking of changes in a request results +- [FetchedRecordsController](#fetchedrecordscontroller): Automated tracking of changes in a request results, with table view animations +- [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB): Automated tracking of changes in a request results, based on [RxSwift](https://github.com/ReactiveX/RxSwift) Database observation requires that a single [database queue](#database-queues) or [pool](#database-pools) is kept open for all the duration of the database usage. @@ -6203,11 +6198,269 @@ protocol TransactionObserverType : class { ``` +## ValueObservation + +**ValueObservation automatically tracks changes in the results of a [request](#requests).** + +It is designed for easy consumption of fresh values by an application. For example, you will find below the typical UIViewController setup: + +```swift +class PlayerViewController: UIViewController { + @IBOutlet weak var nameLabel: UILabel! + private var playerObserver: TransactionObserver? + + override func viewDidLoad() { + super.viewDidLoad() + + // 1. Define a tracked request + let request = Player.filter(key: 42) + + // 2. Create a ValueObservation + let observation = ValueObservation.forOne(request) + + // 3. Start observing the database, and store the returned observer + // in a property + playerObserver = dbQueue.add( + observation: observation, + onChange: { [unowned self] player: Player? in + self.nameLabel.text = player?.name + }) + } +} +``` + +All values are notified on the main queue: views can be updated right from the `onChange` callback. + +An initial fetch is performed, and notified, as soon as the observation starts: the view is ready when `viewDidLoad` method returns. + +The view controller stores the observer returned by the `add(observation:onChange:)` method in a property. When the view controller is deallocated, so is the observer: the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. + + +### `ValueObservation.forCount`, `.forOne`, `.forAll` + +Given a [request](#requests), you can track its number of results, the first one, or all of them: + +```swift +ValueObservation.forCount(request) +ValueObservation.forOne(request) +ValueObservation.forAll(request) + +ValueObservation.forCount(withUniquing: request) +ValueObservation.forOne(withUniquing: request) +ValueObservation.forAll(withUniquing: request) +``` + +The `forCount` observation notifies counts: + +```swift +// Observe number of players +let observation = ValueObservation.forCount(Player.all()) +let observer = try dbQueue.add( + observation: observation, + onChange: { count: Int in + print("Number of players have changed: \(count)") + }) +``` + +The `forOne` observation notifies optional values, built from a single database row (if any): + +```swift +// Observe a single player +let observation = ValueObservation.forOne(Player.filter(key: 1)) +let observer = try dbQueue.add( + observation: observation, + onChange: { player: Player? in + print("Player has changed: \(player)") + }) + +// Observe the maximum score +let request = Player.select(max(Column("score")), as: Int.self) +let observation = ValueObservation.forOne(request) +let observer = try dbQueue.add( + observation: observation, + onChange: { maximumScore: Int? in + print("Maximum score has changed: \(maximumScore)") + }) +``` + + +The `forAll` observation notifies arrays: + +```swift +// Observe all players +let observation = ValueObservation.forAll(Player.all()) +let observer = try dbQueue.add( + observation: observation, + onChange: { players: [Player] in + print("Players have changed: \(players)") + }) + +// Observe all player names +let request = SQLRequest("SELECT name FROM player") +let observation = ValueObservation.forAll(request) +let observer = try dbQueue.add( + observation: observation, + onChange: { names: [String] in + print("Players names have changed: \(names)") + }) +``` + +Beware that by default, a ValueObservation notifies *potential* changes, not *actual* changes in the results of a request. A change is notified if and only if a statement has actually modified the tracked tables and columns by inserting, updating, or deleting a row. + +For example, if you observe `Player.select(max(Column("score")))`, then you'll get be notified of all changes performed on the `score` column of the `player` table (updates, insertions and deletions), even if they do not modify the value of the maximum score. However, you will not get any notification for changes performed on other database tables, or updates to other columns of the player table. + +Similarly, observing `Country.filter(key: "FR")` will notify all changes that happen to the whole `country` table. That is because SQLite only notifies the numerical [rowid](https://www.sqlite.org/rowidtable.html) of changed rows, and we can't check if it is the row "FR" that has been changed, or another. This limitation does not apply to tables whose primary key *is* the rowid: `Player.filter(key: 42)` will only notify of changes performed on the row with id 42. + +You can avoid notification of consecutive identical values with the `withUniquing` variant. It performs deduplication at the database level, by comparing raw database values: + +```swift +// Observe the maximum score +let request = Player.select(max(Column("score")), as: Int.self) +let observation = ValueObservation.forOne(withUniquing: request) +let observer = try dbQueue.add( + observation: observation, + onChange: { maximumScore: Int? in + print("Maximum score has (really) changed: \(maximumScore)") + }) +``` + + +### `ValueObservation.observing(_:fetch)` + +Sometimes you need to observe several requests at the same time, and be notified of **consistent** values. For example, you need to observe changes on both a team and its players: + +```swift +struct TeamInfo { + var team: Team + var player: [Player] +} + +let teamRequest = Team.filter(key: 1) +let playersRequest = Player.filter(Column("teamId") == 1) + +let observation = ValueObservation.observing( + teamRequest, playersRequest, + fetch { db -> TeamInfo? in + guard let team = try teamRequest.fetchOne(db) else { + return nil + } + let players = try playersRequest.fetchAll(db) + return TeamInfo(team: team, players: players) + }) + +let observer = dbQueue.add( + observation: observation, + onChange: { teamInfo: TeamInfo? in + print("team and players have changed.") + }) +``` + +You can avoid notification of consecutive identical values with the `withUniquing` variant. It requires the fetched type to be Equatable: + +```swift +extension TeamInfo: Equatable { ... } + +let observation = ValueObservation.observing( + withUniquing: teamRequest, playersRequest, + fetch { db -> TeamInfo? in + guard let team = try teamRequest.fetchOne(db) else { + return nil + } + let players = try playersRequest.fetchAll(db) + return TeamInfo(team: team, players: players) + }) + +let observer = dbQueue.add( + observation: observation, + onChange: { teamInfo: TeamInfo? in + print("team and players have (really) changed.") + }) +``` + + +### ValueObservation Options + +- **`extent`** + + The `extent` property lets you specify the duration of the observation. See [Observation Extent](#observation-extent) for more details: + + ```swift + // This observation lasts until the database connection is closed + var observation = ValueObservation... + observation.extent = .databaseLifetime + _ = dbQueue.add(observation: observation) { newValue in ... } + ``` + + The default extent is `.observerLifetime`. + +- **`scheduling`** + + The `scheduling` property lets you control how fresh values are notified: + + - `.mainQueue` (the default): all values are notified on the main queue. + + If the observation starts on the main queue, initial values are notified right upon subscription, synchronously: + + ```swift + // On main queue + let observation = ValueObservation.forAll(Player.all()) + let observer = try dbQueue.add(observation: observation) { players: [Player] in + print("fresh players: /(players)") + } + // <- here "fresh players" is already printed. + ``` + + If the observation does not start on the main queue, initial values are asynchronously notified on the main queue: + + ```swift + // Not on the main queue: "fresh players" is eventually printed + // on the main queue. + let observation = ValueObservation.forAll(Player.all()) + let observer = try dbQueue.add(observation: observation) { players: [Player] in + print("fresh players: /(players)") + } + ``` + + When the database changes, fresh values are asynchronously notified: + + ```swift + // Eventually prints "fresh players" on the main queue + try dbQueue.write { db in + try Player(...).insert(db) + } + ``` + + - `.onQueue(_:startImmediately:)`: all values are asychronously notified on the specified queue. Initial values are only fetched and notified if `startImmediately` is true. + + ```swift + let customQueue = DispatchQueue(label: "customQueue") + var observation = ValueObservation.forAll(Player.all()) + observation.scheduling = .onQueue(customQueue, startImmediately: true) + let observer = try dbQueue.add(observation: observation) { players: [Player] in + // in customQueue + print("fresh players: /(players)")s + } + ``` + +- **`isReadOnly`** + + The default is true. When false, a ValueObservation has a write access to the database when it fetches fresh values: + + ```swift + let observation = ValueObservation.observing( + teamRequest, playersRequest, + fetch { db in + // some + }) + observation.isReadOnly = false + ``` + + When you use a [database pool](#database-pools), an observation is less efficient when it is not read-only. + + ## FetchedRecordsController -**You use FetchedRecordsController to track changes in the results of an SQLite request.** - -**FetchedRecordsController can also feed table views, collection views, and animate cells when the results of the request change.** +**FetchedRecordsController track changes in the results of a request. It can also feed table views, collection views, and animate cells when the results of the request change.** It looks and behaves very much like [Core Data's NSFetchedResultsController](https://developer.apple.com/library/ios/documentation/CoreData/Reference/NSFetchedResultsController_Class/). @@ -7911,3 +8164,4 @@ This chapter has been renamed [Beyond FetchableRecord]. [Record Comparison]: #record-comparison [Record Customization Options]: #record-customization-options [TableRecord]: #tablerecord-protocol +[ValueObservation]: #valueobservation From 470e1534dc7318441fa1fcaf3bb2f7ce1836e46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 28 Oct 2018 22:29:15 +0100 Subject: [PATCH 040/109] Documentation --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 36a438fd1..7b7ebcf21 100644 --- a/README.md +++ b/README.md @@ -6332,7 +6332,7 @@ Sometimes you need to observe several requests at the same time, and be notified ```swift struct TeamInfo { var team: Team - var player: [Player] + var players: [Player] } let teamRequest = Team.filter(key: 1) @@ -6449,13 +6449,17 @@ let observer = dbQueue.add( ```swift let observation = ValueObservation.observing( teamRequest, playersRequest, - fetch { db in - // some + fetch { db in + // write access allowed }) observation.isReadOnly = false ``` - When you use a [database pool](#database-pools), an observation is less efficient when it is not read-only. + The `fetch` closure is executed inside a [savepoint](#transactions-and-savepoints). + + Don't use this flag unless you actually need it: when you use a [database pool](#database-pools), observations with write access are less efficient. + + See [RxSwiftCommunity/RxGRDB/issues/42](https://github.com/RxSwiftCommunity/RxGRDB/issues/42) for an example use case. The `isReadOnly` flag exists in order to address this feature request. ## FetchedRecordsController From 840f8358b50558166cf9a85b006bd6e84d457ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 06:51:56 +0100 Subject: [PATCH 041/109] Documentation --- README.md | 94 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 7b7ebcf21..28e36fac8 100644 --- a/README.md +++ b/README.md @@ -6202,7 +6202,7 @@ protocol TransactionObserverType : class { **ValueObservation automatically tracks changes in the results of a [request](#requests).** -It is designed for easy consumption of fresh values by an application. For example, you will find below the typical UIViewController setup: +It is designed for easy consumption of fresh values by an application. For example, you will find below a typical UIViewController setup: ```swift class PlayerViewController: UIViewController { @@ -6218,17 +6218,33 @@ class PlayerViewController: UIViewController { // 2. Create a ValueObservation let observation = ValueObservation.forOne(request) - // 3. Start observing the database, and store the returned observer - // in a property - playerObserver = dbQueue.add( - observation: observation, - onChange: { [unowned self] player: Player? in - self.nameLabel.text = player?.name - }) + do { + // 3. Start observing the database, and store the returned observer + // in a property + playerObserver = try dbQueue.add( + observation: observation, + onError: { error in + print("fresh values could not be fetched") + }, + onChange: { [unowned self] player: Player? in + self.nameLabel.text = player?.name + }) + } catch { + print("Observation could not start") + } } } ``` +When you are not interested in eventual refreshing errors, drop the `onError` callback: + +```swift + playerObserver = try dbQueue.add(observation: observation) { + [unowned self] player: Player? in + self.nameLabel.text = player?.name + } +``` + All values are notified on the main queue: views can be updated right from the `onChange` callback. An initial fetch is performed, and notified, as soon as the observation starts: the view is ready when `viewDidLoad` method returns. @@ -6255,11 +6271,9 @@ The `forCount` observation notifies counts: ```swift // Observe number of players let observation = ValueObservation.forCount(Player.all()) -let observer = try dbQueue.add( - observation: observation, - onChange: { count: Int in - print("Number of players have changed: \(count)") - }) +let observer = try dbQueue.add(observation: observation) { count: Int in + print("Number of players have changed: \(count)") +} ``` The `forOne` observation notifies optional values, built from a single database row (if any): @@ -6267,20 +6281,16 @@ The `forOne` observation notifies optional values, built from a single database ```swift // Observe a single player let observation = ValueObservation.forOne(Player.filter(key: 1)) -let observer = try dbQueue.add( - observation: observation, - onChange: { player: Player? in - print("Player has changed: \(player)") - }) +let observer = try dbQueue.add(observation: observation) { player: Player? in + print("Player has changed: \(player)") +} // Observe the maximum score let request = Player.select(max(Column("score")), as: Int.self) let observation = ValueObservation.forOne(request) -let observer = try dbQueue.add( - observation: observation, - onChange: { maximumScore: Int? in - print("Maximum score has changed: \(maximumScore)") - }) +let observer = try dbQueue.add(observation: observation) { maximumScore: Int? in + print("Maximum score has changed: \(maximumScore)") +} ``` @@ -6289,20 +6299,16 @@ The `forAll` observation notifies arrays: ```swift // Observe all players let observation = ValueObservation.forAll(Player.all()) -let observer = try dbQueue.add( - observation: observation, - onChange: { players: [Player] in - print("Players have changed: \(players)") - }) +let observer = try dbQueue.add(observation: observation) { players: [Player] in + print("Players have changed: \(players)") +} // Observe all player names let request = SQLRequest("SELECT name FROM player") let observation = ValueObservation.forAll(request) -let observer = try dbQueue.add( - observation: observation, - onChange: { names: [String] in - print("Players names have changed: \(names)") - }) +let observer = try dbQueue.add(observation: observation) { names: [String] in + print("Players names have changed: \(names)") +} ``` Beware that by default, a ValueObservation notifies *potential* changes, not *actual* changes in the results of a request. A change is notified if and only if a statement has actually modified the tracked tables and columns by inserting, updating, or deleting a row. @@ -6348,11 +6354,9 @@ let observation = ValueObservation.observing( return TeamInfo(team: team, players: players) }) -let observer = dbQueue.add( - observation: observation, - onChange: { teamInfo: TeamInfo? in - print("team and players have changed.") - }) +let observer = dbQueue.add(observation: observation) { teamInfo: TeamInfo? in + print("team and players have changed.") +} ``` You can avoid notification of consecutive identical values with the `withUniquing` variant. It requires the fetched type to be Equatable: @@ -6370,11 +6374,9 @@ let observation = ValueObservation.observing( return TeamInfo(team: team, players: players) }) -let observer = dbQueue.add( - observation: observation, - onChange: { teamInfo: TeamInfo? in - print("team and players have (really) changed.") - }) +let observer = dbQueue.add(observation: observation) { teamInfo: TeamInfo? in + print("team and players have (really) changed.") +} ``` @@ -6405,7 +6407,7 @@ let observer = dbQueue.add( // On main queue let observation = ValueObservation.forAll(Player.all()) let observer = try dbQueue.add(observation: observation) { players: [Player] in - print("fresh players: /(players)") + print("fresh players: \(players)") } // <- here "fresh players" is already printed. ``` @@ -6417,7 +6419,7 @@ let observer = dbQueue.add( // on the main queue. let observation = ValueObservation.forAll(Player.all()) let observer = try dbQueue.add(observation: observation) { players: [Player] in - print("fresh players: /(players)") + print("fresh players: \(players)") } ``` @@ -6438,7 +6440,7 @@ let observer = dbQueue.add( observation.scheduling = .onQueue(customQueue, startImmediately: true) let observer = try dbQueue.add(observation: observation) { players: [Player] in // in customQueue - print("fresh players: /(players)")s + print("fresh players: \(players)")s } ``` From 489454b0d44dc61ad2c4102f81ec96adfb688436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 07:19:36 +0100 Subject: [PATCH 042/109] add(observation:observation) -> start(observation) --- GRDB/Core/DatabaseReader.swift | 10 +- GRDB/Core/DatabaseSnapshot.swift | 6 +- GRDB/Core/DatabaseWriter.swift | 6 +- GRDB/Core/ValueObservation.swift | 206 ++++++++++-------- README.md | 38 ++-- .../ValueObservationCountTests.swift | 4 +- ...rvationDatabaseValueConvertibleTests.swift | 12 +- .../ValueObservationExtentTests.swift | 6 +- .../ValueObservationFetchTests.swift | 4 +- .../ValueObservationReadonlyTests.swift | 12 +- .../ValueObservationRecordTests.swift | 8 +- .../ValueObservationReducerTests.swift | 12 +- .../GRDBTests/ValueObservationRowTests.swift | 8 +- .../ValueObservationSchedulingTests.swift | 16 +- ...ationStatementColumnConvertibleTests.swift | 6 +- 15 files changed, 187 insertions(+), 167 deletions(-) diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index f432cda52..0144f9308 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -153,8 +153,8 @@ public protocol DatabaseReader : class { // MARK: - Value Observation /// TODO - func add( - observation: ValueObservation, + func start( + _ observation: ValueObservation, onError: ((Error) -> Void)?, onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver @@ -241,12 +241,12 @@ public final class AnyDatabaseReader : DatabaseReader { // MARK: - Value Observation /// TODO - public func add( - observation: ValueObservation, + public func start( + _ observation: ValueObservation, onError: ((Error) -> Void)? = nil, onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver { - return try base.add(observation: observation, onError: onError, onChange: onChange) + return try base.start(observation, onError: onError, onChange: onChange) } } diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index 9f29626ce..b25591a98 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -101,8 +101,8 @@ extension DatabaseSnapshot { // MARK: - Value Observation - public func add( - observation: ValueObservation, + public func start( + _ observation: ValueObservation, onError: ((Error) -> Void)? = nil, onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver @@ -137,7 +137,7 @@ extension DatabaseSnapshot { } /// An observer that does nothing, support for -/// `DatabaseSnapshot.add(observation:onError:onChange:)`. +/// `DatabaseSnapshot.start(_:onError:onChange:)`. private class SnapshotValueObserver: TransactionObserver { func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { return false } func databaseDidChange(with event: DatabaseEvent) { } diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 68506aa55..c4c29deb2 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -199,8 +199,8 @@ extension DatabaseWriter { // MARK: - Value Observation - public func add( - observation: ValueObservation, + public func start( + _ observation: ValueObservation, onError: ((Error) -> Void)? = nil, onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver @@ -299,7 +299,7 @@ extension DatabaseWriter { } /// Support for ValueObservation. -/// See DatabaseWriter.add(observation:onError:onChange:) +/// See DatabaseWriter.start(_:onError:onChange:) private class ValueObserver: TransactionObserver { private let region: DatabaseRegion private var reducer: Reducer diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 3134598a0..a05658b83 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -22,7 +22,7 @@ public enum ValueScheduling { /// /// // On main queue /// let observation = ValueObservation.forAll(Player.all()) - /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("fresh players: /(players)") /// } /// // <- here "fresh players" is already printed. @@ -33,7 +33,7 @@ public enum ValueScheduling { /// // Not on the main queue: "fresh players" is eventually printed /// // on the main queue. /// let observation = ValueObservation.forAll(Player.all()) - /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("fresh players: /(players)") /// } /// @@ -303,7 +303,7 @@ public struct ValueObservation { /// /// // On main queue /// let observation = ValueObservation.forAll(Player.all()) - /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("fresh players: /(players)") /// } /// // <- here "fresh players" is already printed. @@ -314,7 +314,7 @@ public struct ValueObservation { /// // Not on the main queue: "fresh players" is eventually printed /// // on the main queue. /// let observation = ValueObservation.forAll(Player.all()) - /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("fresh players: /(players)") /// } /// @@ -364,18 +364,19 @@ public struct ValueObservation { /// observing: Player.all(), /// reducer: reducer) /// - /// let observer = try dbQueue.add(observation: observation) { player: [Player] in + /// let observer = try dbQueue.start(observation) { player: [Player] in /// print("players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -401,18 +402,19 @@ extension ValueObservation where Reducer == Void { /// Player.all(), /// fetch: { db in return try Player.fetchAll(db) }) /// - /// let observer = try dbQueue.add(observation: observation) { player: [Player] in + /// let observer = try dbQueue.start(observation) { player: [Player] in /// print("players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -438,18 +440,19 @@ extension ValueObservation where Reducer == Void { /// withUniquing: Player.all(), /// fetch: { db in return try Player.fetchAll(db) }) /// - /// let observer = try dbQueue.add(observation: observation) { player: [Player] in + /// let observer = try dbQueue.start(observation) { player: [Player] in /// print("players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -487,18 +490,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.forCount(request) /// - /// let observer = try dbQueue.add(observation: observation) { count: Int in + /// let observer = try dbQueue.start(observation) { count: Int in /// print("number of players has changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -520,18 +524,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.forCount(withUniquing: request) /// - /// let observer = try dbQueue.add(observation: observation) { count: Int in + /// let observer = try dbQueue.start(observation) { count: Int in /// print("number of players has changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -557,18 +562,19 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player") /// let observation = ValueObservation.forAll(request) /// - /// let observer = try dbQueue.add(observation: observation) { rows: [Row] in + /// let observer = try dbQueue.start(observation) { rows: [Row] in /// print("players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -591,18 +597,19 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player") /// let observation = ValueObservation.forAll(withUniquing: request) /// - /// let observer = try dbQueue.add(observation: observation) { rows: [Row] in + /// let observer = try dbQueue.start(observation) { rows: [Row] in /// print("players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -625,18 +632,19 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) /// let observation = ValueObservation.forOne(request) /// - /// let observer = try dbQueue.add(observation: observation) { row: Row? in + /// let observer = try dbQueue.start(observation) { row: Row? in /// print("players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -659,18 +667,19 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) /// let observation = ValueObservation.forOne(withUniquing: request) /// - /// let observer = try dbQueue.add(observation: observation) { row: Row? in + /// let observer = try dbQueue.start(observation) { row: Row? in /// print("players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -698,18 +707,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.forAll(request) /// - /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -733,18 +743,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.forAll(withUniquing: request) /// - /// let observer = try dbQueue.add(observation: observation) { players: [Player] in + /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -767,18 +778,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.filter(key: 1) /// let observation = ValueObservation.forOne(request) /// - /// let observer = try dbQueue.add(observation: observation) { player: Player? in + /// let observer = try dbQueue.start(observation) { player: Player? in /// print("player has changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -801,18 +813,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.filter(key: 1) /// let observation = ValueObservation.forOne(withUniquing: request) /// - /// let observer = try dbQueue.add(observation: observation) { player: Player? in + /// let observer = try dbQueue.start(observation) { player: Player? in /// print("player has changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -840,18 +853,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(request) /// - /// let observer = try dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -875,18 +889,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(withUniquing: request) /// - /// let observer = try dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -909,18 +924,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(max(Column("score")), as: Int.self) /// let observation = ValueObservation.forOne(request) /// - /// let observer = try dbQueue.add(observation: observation) { maxScore: Int? in + /// let observer = try dbQueue.start(observation) { maxScore: Int? in /// print("maximum score has changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -943,18 +959,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(max(Column("score")), as: Int.self) /// let observation = ValueObservation.forOne(withUniquing: request) /// - /// let observer = try dbQueue.add(observation: observation) { maxScore: Int? in + /// let observer = try dbQueue.start(observation) { maxScore: Int? in /// print("maximum score has changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -982,18 +999,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(request) /// - /// let observer = try dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -1016,18 +1034,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(max(Column("score")), as: Int.self) /// let observation = ValueObservation.forOne(request) /// - /// let observer = try dbQueue.add(observation: observation) { maxScore: Int? in + /// let observer = try dbQueue.start(observation) { maxScore: Int? in /// print("maximum score has changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -1055,18 +1074,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(request) /// - /// let observer = try dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -1091,18 +1111,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(withUniquing: request) /// - /// let observer = try dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// @@ -1131,18 +1152,19 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.forAll(request) /// - /// let observer = try dbQueue.add(observation: observation) { names: [String] in + /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `add(observation:)` method, a fresh value is - /// immediately notified on the dispatch queue which starts the observation. + /// - When started with the `start(_:onError:onChage:)` method, a fresh + /// value is immediately notified on the dispatch queue which starts + /// the observation. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by - /// `add(observation:)` is deallocated. + /// `start` is deallocated. /// /// See ValueObservation for more information. /// diff --git a/README.md b/README.md index 28e36fac8..6f8fc715b 100644 --- a/README.md +++ b/README.md @@ -6221,8 +6221,8 @@ class PlayerViewController: UIViewController { do { // 3. Start observing the database, and store the returned observer // in a property - playerObserver = try dbQueue.add( - observation: observation, + playerObserver = try dbQueue.start( + observation, onError: { error in print("fresh values could not be fetched") }, @@ -6239,7 +6239,7 @@ class PlayerViewController: UIViewController { When you are not interested in eventual refreshing errors, drop the `onError` callback: ```swift - playerObserver = try dbQueue.add(observation: observation) { + playerObserver = try dbQueue.start(observation) { [unowned self] player: Player? in self.nameLabel.text = player?.name } @@ -6249,7 +6249,7 @@ All values are notified on the main queue: views can be updated right from the ` An initial fetch is performed, and notified, as soon as the observation starts: the view is ready when `viewDidLoad` method returns. -The view controller stores the observer returned by the `add(observation:onChange:)` method in a property. When the view controller is deallocated, so is the observer: the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. +The view controller stores the observer returned by the `start` method in a property. When the view controller is deallocated, so is the observer: the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. ### `ValueObservation.forCount`, `.forOne`, `.forAll` @@ -6271,7 +6271,7 @@ The `forCount` observation notifies counts: ```swift // Observe number of players let observation = ValueObservation.forCount(Player.all()) -let observer = try dbQueue.add(observation: observation) { count: Int in +let observer = try dbQueue.start(observation) { count: Int in print("Number of players have changed: \(count)") } ``` @@ -6281,14 +6281,14 @@ The `forOne` observation notifies optional values, built from a single database ```swift // Observe a single player let observation = ValueObservation.forOne(Player.filter(key: 1)) -let observer = try dbQueue.add(observation: observation) { player: Player? in +let observer = try dbQueue.start(observation) { player: Player? in print("Player has changed: \(player)") } // Observe the maximum score let request = Player.select(max(Column("score")), as: Int.self) let observation = ValueObservation.forOne(request) -let observer = try dbQueue.add(observation: observation) { maximumScore: Int? in +let observer = try dbQueue.start(observation) { maximumScore: Int? in print("Maximum score has changed: \(maximumScore)") } ``` @@ -6299,14 +6299,14 @@ The `forAll` observation notifies arrays: ```swift // Observe all players let observation = ValueObservation.forAll(Player.all()) -let observer = try dbQueue.add(observation: observation) { players: [Player] in +let observer = try dbQueue.start(observation) { players: [Player] in print("Players have changed: \(players)") } // Observe all player names let request = SQLRequest("SELECT name FROM player") let observation = ValueObservation.forAll(request) -let observer = try dbQueue.add(observation: observation) { names: [String] in +let observer = try dbQueue.start(observation) { names: [String] in print("Players names have changed: \(names)") } ``` @@ -6323,11 +6323,9 @@ You can avoid notification of consecutive identical values with the `withUniquin // Observe the maximum score let request = Player.select(max(Column("score")), as: Int.self) let observation = ValueObservation.forOne(withUniquing: request) -let observer = try dbQueue.add( - observation: observation, - onChange: { maximumScore: Int? in - print("Maximum score has (really) changed: \(maximumScore)") - }) +let observer = try dbQueue.start(observation) { maximumScore: Int? in + print("Maximum score has (really) changed: \(maximumScore)") +} ``` @@ -6354,7 +6352,7 @@ let observation = ValueObservation.observing( return TeamInfo(team: team, players: players) }) -let observer = dbQueue.add(observation: observation) { teamInfo: TeamInfo? in +let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in print("team and players have changed.") } ``` @@ -6374,7 +6372,7 @@ let observation = ValueObservation.observing( return TeamInfo(team: team, players: players) }) -let observer = dbQueue.add(observation: observation) { teamInfo: TeamInfo? in +let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in print("team and players have (really) changed.") } ``` @@ -6390,7 +6388,7 @@ let observer = dbQueue.add(observation: observation) { teamInfo: TeamInfo? in // This observation lasts until the database connection is closed var observation = ValueObservation... observation.extent = .databaseLifetime - _ = dbQueue.add(observation: observation) { newValue in ... } + _ = dbQueue.start(observation) { newValue in ... } ``` The default extent is `.observerLifetime`. @@ -6406,7 +6404,7 @@ let observer = dbQueue.add(observation: observation) { teamInfo: TeamInfo? in ```swift // On main queue let observation = ValueObservation.forAll(Player.all()) - let observer = try dbQueue.add(observation: observation) { players: [Player] in + let observer = try dbQueue.start(observation) { players: [Player] in print("fresh players: \(players)") } // <- here "fresh players" is already printed. @@ -6418,7 +6416,7 @@ let observer = dbQueue.add(observation: observation) { teamInfo: TeamInfo? in // Not on the main queue: "fresh players" is eventually printed // on the main queue. let observation = ValueObservation.forAll(Player.all()) - let observer = try dbQueue.add(observation: observation) { players: [Player] in + let observer = try dbQueue.start(observation) { players: [Player] in print("fresh players: \(players)") } ``` @@ -6438,7 +6436,7 @@ let observer = dbQueue.add(observation: observation) { teamInfo: TeamInfo? in let customQueue = DispatchQueue(label: "customQueue") var observation = ValueObservation.forAll(Player.all()) observation.scheduling = .onQueue(customQueue, startImmediately: true) - let observer = try dbQueue.add(observation: observation) { players: [Player] in + let observer = try dbQueue.start(observation) { players: [Player] in // in customQueue print("fresh players: \(players)")s } diff --git a/Tests/GRDBTests/ValueObservationCountTests.swift b/Tests/GRDBTests/ValueObservationCountTests.swift index 9c15aab7e..89bbeee2d 100644 --- a/Tests/GRDBTests/ValueObservationCountTests.swift +++ b/Tests/GRDBTests/ValueObservationCountTests.swift @@ -25,7 +25,7 @@ class ValueObservationCountTests: GRDBTestCase { struct T: TableRecord { } var observation = ValueObservation.forCount(T.all()) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { count in + _ = try dbQueue.start(observation) { count in counts.append(count) notificationExpectation.fulfill() } @@ -56,7 +56,7 @@ class ValueObservationCountTests: GRDBTestCase { struct T: TableRecord { } var observation = ValueObservation.forCount(withUniquing: T.all()) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { count in + _ = try dbQueue.start(observation) { count in counts.append(count) notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift b/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift index dff500f44..566cbb577 100644 --- a/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift +++ b/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift @@ -39,7 +39,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { names in + _ = try dbQueue.start(observation) { names in results.append(names) notificationExpectation.fulfill() } @@ -73,7 +73,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { names in + _ = try dbQueue.start(observation) { names in results.append(names) notificationExpectation.fulfill() } @@ -106,7 +106,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.forOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { name in + _ = try dbQueue.start(observation) { name in results.append(name) notificationExpectation.fulfill() } @@ -144,7 +144,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.forOne(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { name in + _ = try dbQueue.start(observation) { name in results.append(name) notificationExpectation.fulfill() } @@ -181,7 +181,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { names in + _ = try dbQueue.start(observation) { names in results.append(names) notificationExpectation.fulfill() } @@ -215,7 +215,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { names in + _ = try dbQueue.start(observation) { names in results.append(names) notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationExtentTests.swift b/Tests/GRDBTests/ValueObservationExtentTests.swift index 7b8e5fdf8..71f905b2b 100644 --- a/Tests/GRDBTests/ValueObservationExtentTests.swift +++ b/Tests/GRDBTests/ValueObservationExtentTests.swift @@ -38,7 +38,7 @@ class ValueObservationExtentTests: GRDBTestCase { observation.extent = .databaseLifetime // Start observation - _ = try dbQueue.add(observation: observation) { + _ = try dbQueue.start(observation) { notificationExpectation.fulfill() } @@ -77,7 +77,7 @@ class ValueObservationExtentTests: GRDBTestCase { // Start observation and deallocate observer after second change var observer: TransactionObserver? - observer = try dbQueue.add(observation: observation) { + observer = try dbQueue.start(observation) { changesCount += 1 if changesCount == 2 { observer = nil @@ -122,7 +122,7 @@ class ValueObservationExtentTests: GRDBTestCase { observation.extent = .nextTransaction // Start observation - let observer = try dbQueue.add(observation: observation) { + let observer = try dbQueue.start(observation) { notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationFetchTests.swift b/Tests/GRDBTests/ValueObservationFetchTests.swift index 855981cdb..2fdc92570 100644 --- a/Tests/GRDBTests/ValueObservationFetchTests.swift +++ b/Tests/GRDBTests/ValueObservationFetchTests.swift @@ -26,7 +26,7 @@ class ValueObservationFetchTests: GRDBTestCase { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { count in + _ = try dbQueue.start(observation) { count in counts.append(count) notificationExpectation.fulfill() } @@ -58,7 +58,7 @@ class ValueObservationFetchTests: GRDBTestCase { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { count in + _ = try dbQueue.start(observation) { count in counts.append(count) notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationReadonlyTests.swift b/Tests/GRDBTests/ValueObservationReadonlyTests.swift index f94f24b1a..33b29e8f2 100644 --- a/Tests/GRDBTests/ValueObservationReadonlyTests.swift +++ b/Tests/GRDBTests/ValueObservationReadonlyTests.swift @@ -27,7 +27,7 @@ class ValueObservationReadonlyTests: GRDBTestCase { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { count in + _ = try dbQueue.start(observation) { count in counts.append(count) notificationExpectation.fulfill() } @@ -50,8 +50,8 @@ class ValueObservationReadonlyTests: GRDBTestCase { }) do { - _ = try dbQueue.add( - observation: observation, + _ = try dbQueue.start( + observation, onError: { _ in fatalError() }, onChange: { _ in fatalError() }) XCTFail("Expected error") @@ -80,7 +80,7 @@ class ValueObservationReadonlyTests: GRDBTestCase { }) observation.extent = .databaseLifetime observation.isReadOnly = false - _ = try dbQueue.add(observation: observation) { count in + _ = try dbQueue.start(observation) { count in counts.append(count) notificationExpectation.fulfill() } @@ -107,8 +107,8 @@ class ValueObservationReadonlyTests: GRDBTestCase { observation.isReadOnly = false do { - _ = try dbQueue.add( - observation: observation, + _ = try dbQueue.start( + observation, onError: { _ in fatalError() }, onChange: { _ in fatalError() }) XCTFail("Expected error") diff --git a/Tests/GRDBTests/ValueObservationRecordTests.swift b/Tests/GRDBTests/ValueObservationRecordTests.swift index 4c7b819fd..cdd0e24b9 100644 --- a/Tests/GRDBTests/ValueObservationRecordTests.swift +++ b/Tests/GRDBTests/ValueObservationRecordTests.swift @@ -38,7 +38,7 @@ class ValueObservationRecordTests: GRDBTestCase { var observation = ValueObservation.forAll(SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { players in + _ = try dbQueue.start(observation) { players in results.append(players) notificationExpectation.fulfill() } @@ -72,7 +72,7 @@ class ValueObservationRecordTests: GRDBTestCase { var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { players in + _ = try dbQueue.start(observation) { players in results.append(players) notificationExpectation.fulfill() } @@ -105,7 +105,7 @@ class ValueObservationRecordTests: GRDBTestCase { var observation = ValueObservation.forOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { player in + _ = try dbQueue.start(observation) { player in results.append(player) notificationExpectation.fulfill() } @@ -143,7 +143,7 @@ class ValueObservationRecordTests: GRDBTestCase { var observation = ValueObservation.forOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { player in + _ = try dbQueue.start(observation) { player in results.append(player) notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift index 46f7055d0..5f360c1bb 100644 --- a/Tests/GRDBTests/ValueObservationReducerTests.swift +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -52,8 +52,8 @@ class ValueObservationReducerTests: GRDBTestCase { observation.extent = .databaseLifetime // Start observation - _ = try dbQueue.add( - observation: observation, + _ = try dbQueue.start( + observation, onError: { errors.append($0) notificationExpectation.fulfill() @@ -124,8 +124,8 @@ class ValueObservationReducerTests: GRDBTestCase { // Start observation do { let dbQueue = try makeDatabaseQueue() - _ = try dbQueue.add( - observation: observation, + _ = try dbQueue.start( + observation, onError: { _ in fatalError() }, onChange: { _ in fatalError() }) XCTFail("Expected error") @@ -161,8 +161,8 @@ class ValueObservationReducerTests: GRDBTestCase { observation.extent = .databaseLifetime // Start observation - _ = try dbQueue.add( - observation: observation, + _ = try dbQueue.start( + observation, onError: { errors.append($0) notificationExpectation.fulfill() diff --git a/Tests/GRDBTests/ValueObservationRowTests.swift b/Tests/GRDBTests/ValueObservationRowTests.swift index f268a8652..e63d68cc7 100644 --- a/Tests/GRDBTests/ValueObservationRowTests.swift +++ b/Tests/GRDBTests/ValueObservationRowTests.swift @@ -24,7 +24,7 @@ class ValueObservationRowTests: GRDBTestCase { var observation = ValueObservation.forAll(SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { rows in + _ = try dbQueue.start(observation) { rows in results.append(rows) notificationExpectation.fulfill() } @@ -58,7 +58,7 @@ class ValueObservationRowTests: GRDBTestCase { var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { rows in + _ = try dbQueue.start(observation) { rows in results.append(rows) notificationExpectation.fulfill() } @@ -91,7 +91,7 @@ class ValueObservationRowTests: GRDBTestCase { var observation = ValueObservation.forOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { row in + _ = try dbQueue.start(observation) { row in results.append(row) notificationExpectation.fulfill() } @@ -129,7 +129,7 @@ class ValueObservationRowTests: GRDBTestCase { var observation = ValueObservation.forOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { row in + _ = try dbQueue.start(observation) { row in results.append(row) notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationSchedulingTests.swift b/Tests/GRDBTests/ValueObservationSchedulingTests.swift index b45434c9a..f985a3157 100644 --- a/Tests/GRDBTests/ValueObservationSchedulingTests.swift +++ b/Tests/GRDBTests/ValueObservationSchedulingTests.swift @@ -31,7 +31,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { }) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { count in + _ = try dbQueue.start(observation) { count in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) counts.append(count) notificationExpectation.fulfill() @@ -68,7 +68,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.extent = .databaseLifetime DispatchQueue.global(qos: .default).async { - _ = try! dbQueue.add(observation: observation) { count in + _ = try! dbQueue.start(observation) { count in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) counts.append(count) notificationExpectation.fulfill() @@ -108,8 +108,8 @@ class ValueObservationSchedulingTests: GRDBTestCase { var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .databaseLifetime - _ = try dbQueue.add( - observation: observation, + _ = try dbQueue.start( + observation, onError: { error in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) errorCount += 1 @@ -150,7 +150,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.extent = .databaseLifetime observation.scheduling = .onQueue(queue, startImmediately: true) - _ = try dbQueue.add(observation: observation) { count in + _ = try dbQueue.start(observation) { count in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) counts.append(count) notificationExpectation.fulfill() @@ -184,7 +184,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.extent = .databaseLifetime observation.scheduling = .onQueue(queue, startImmediately: false) - _ = try dbQueue.add(observation: observation) { count in + _ = try dbQueue.start(observation) { count in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) counts.append(count) notificationExpectation.fulfill() @@ -220,8 +220,8 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.extent = .databaseLifetime observation.scheduling = .onQueue(queue, startImmediately: false) - _ = try dbQueue.add( - observation: observation, + _ = try dbQueue.start( + observation, onError: { error in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) errorCount += 1 diff --git a/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift b/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift index b85e868a4..b8c184bba 100644 --- a/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift +++ b/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift @@ -46,7 +46,7 @@ class ValueObservationStatementColumnConvertibleTests: GRDBTestCase { var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { names in + _ = try dbQueue.start(observation) { names in XCTAssert(names.allSatisfy { $0.fast }) results.append(names) notificationExpectation.fulfill() @@ -81,7 +81,7 @@ class ValueObservationStatementColumnConvertibleTests: GRDBTestCase { var observation = ValueObservation.forOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { name in + _ = try dbQueue.start(observation) { name in if let name = name { XCTAssert(name.fast) } @@ -122,7 +122,7 @@ class ValueObservationStatementColumnConvertibleTests: GRDBTestCase { var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.add(observation: observation) { names in + _ = try dbQueue.start(observation) { names in XCTAssert(names.allSatisfy { $0.map { $0.fast } ?? true }) results.append(names) notificationExpectation.fulfill() From 22ed0fb1a19c14a2823985d4de3cbed2c1c8461a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 08:00:39 +0100 Subject: [PATCH 043/109] Documentation --- README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6f8fc715b..af950cbe2 100644 --- a/README.md +++ b/README.md @@ -6209,8 +6209,8 @@ class PlayerViewController: UIViewController { @IBOutlet weak var nameLabel: UILabel! private var playerObserver: TransactionObserver? - override func viewDidLoad() { - super.viewDidLoad() + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) // 1. Define a tracked request let request = Player.filter(key: 42) @@ -6233,6 +6233,13 @@ class PlayerViewController: UIViewController { print("Observation could not start") } } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillAppear(animated) + + // Stop observing the database + playerObserver = nil + } } ``` @@ -6247,12 +6254,12 @@ When you are not interested in eventual refreshing errors, drop the `onError` ca All values are notified on the main queue: views can be updated right from the `onChange` callback. -An initial fetch is performed, and notified, as soon as the observation starts: the view is ready when `viewDidLoad` method returns. +An initial fetch is performed as soon as the observation starts: the view is set up and ready when the `viewWillAppear` method returns. -The view controller stores the observer returned by the `start` method in a property. When the view controller is deallocated, so is the observer: the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. +The view controller stores the observer returned by the `start` method in a property in order to control the duration of the observation. When the observed is deallocated, the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. -### `ValueObservation.forCount`, `.forOne`, `.forAll` +### `ValueObservation.forCount`, `forOne`, `forAll` Given a [request](#requests), you can track its number of results, the first one, or all of them: From 03d2bc43acf9ecad4f6af94abeafa7514b8c174b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 08:07:28 +0100 Subject: [PATCH 044/109] Documentation --- README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index af950cbe2..dbc6ae84c 100644 --- a/README.md +++ b/README.md @@ -6338,17 +6338,21 @@ let observer = try dbQueue.start(observation) { maximumScore: Int? in ### `ValueObservation.observing(_:fetch)` -Sometimes you need to observe several requests at the same time, and be notified of **consistent** values. For example, you need to observe changes on both a team and its players: +Sometimes you need to observe several requests at the same time, and be notified of **consistent** values. For example, you need to observe changes on both a team and its players. + +When this happens, you create a ValueObservation with two parameters: one is the observed database region, and the other is a closure that fetches fresh values whenever the observed region is modified: ```swift +// The two observed requests +let teamRequest = Team.filter(key: 1) +let playersRequest = Player.filter(Column("teamId") == 1) + +// The fetched value struct TeamInfo { var team: Team var players: [Player] } -let teamRequest = Team.filter(key: 1) -let playersRequest = Player.filter(Column("teamId") == 1) - let observation = ValueObservation.observing( teamRequest, playersRequest, fetch { db -> TeamInfo? in @@ -6360,11 +6364,11 @@ let observation = ValueObservation.observing( }) let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in - print("team and players have changed.") + print("Team and players have changed.") } ``` -You can avoid notification of consecutive identical values with the `withUniquing` variant. It requires the fetched type to be Equatable: +You can avoid notification of consecutive identical values with the `withUniquing` variant. It requires the fetched value to adopt the Equatable protocol: ```swift extension TeamInfo: Equatable { ... } @@ -6380,7 +6384,7 @@ let observation = ValueObservation.observing( }) let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in - print("team and players have (really) changed.") + print("Team and players have (really) changed.") } ``` From 29b54dd37dc1ad052bd500b149eaf69805688e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 08:17:35 +0100 Subject: [PATCH 045/109] Documentation --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index dbc6ae84c..dab409204 100644 --- a/README.md +++ b/README.md @@ -6388,6 +6388,45 @@ let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in } ``` +The initial parameter of the `ValueObservation.observing(_:fetch)` method can be fed with requests, and generally speaking, values that adopt the `DatabaseRegionConvertible` protocol. + +This allows you to encapsulate your complex requests in a dedicated type. Our example above can be rewritten as below: + +```swift +struct TeamInfoRequest: DatabaseRegionConvertible { + var teamId: Int64 + + private var teamRequest: QueryInterfaceRequest { + return Team.filter(key: teamId) + } + + private var playersRequest: QueryInterfaceRequest { + return Player.filter(Column("teamId") == teamId) + } + + // DatabaseRegionConvertible adoption + func databaseRegion(_ db: Database) throws -> DatabaseRegion { + let teamRegion = try teamRequest.databaseRegion(db) + let playersRegion = try playersRequest.databaseRegion(db) + return teamRegion.union(playersRequest) + } + + func fetch(_ db: Database) throws -> TeamInfo? { + guard let team = try teamRequest.fetchOne(db) else { + return nil + } + let players = try playersRequest.fetchAll(db) + return TeamInfo(team: team, players: players) + } +} + +let request = TeamInfoRequest(teamId: 1) +let observation = ValueObservation.observing(request, fetch: request.fetch) +let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in + print("Team and players have hanged.") +} +``` + ### ValueObservation Options From 38e402759957dca17e93811aa03a064d525d8159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 08:41:22 +0100 Subject: [PATCH 046/109] Documentation --- README.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dab409204..d1a990b7f 100644 --- a/README.md +++ b/README.md @@ -6336,7 +6336,7 @@ let observer = try dbQueue.start(observation) { maximumScore: Int? in ``` -### `ValueObservation.observing(_:fetch)` +### `ValueObservation.observing(_:fetch:)` Sometimes you need to observe several requests at the same time, and be notified of **consistent** values. For example, you need to observe changes on both a team and its players. @@ -6427,6 +6427,46 @@ let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in } ``` +See [DatabaseRegion](#databaseregion) for more information. + + +### `ValueObservation.observing(_:reducer:)` + +The most general way to define a ValueObservation is to create one from an observed database region (see above), and a **reducer** that adopts the ValueReducer protocol: + +```swift +protocol ValueReducer { + associatedtype Fetched + associatedtype Value + + /// Fetch a database value + func fetch(_ db: Database) throws -> Fetched + + /// Outputs an notified value + mutating func value(_ fetched: Fetched) -> Value? +} +``` + +The `fetch` method is called upon changes in the observed [database region](#databaseregion). It runs inside a dispatch queue which can access the database. + +The `value` method transforms a fetched value into a notified value. It returns nil if the observer should not be notified. This method runs inside a private dispatch queue. + +The sample code below counts the number of times the database is modified: + +```swift +var count = 0 +let reducer = AnyValueReducer( + fetch: { _ in /* don't fetch anything */ }, + value: { _ -> Int? in + count += 1 + return count + }) +let observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) +let observer = try dbQueue.start(observation) { count: Int in + print("The database has been modified \(count) times.") +} +``` + ### ValueObservation Options From 1d47853abeeaa2704ac6acf5bec7642abc9b17bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 08:47:51 +0100 Subject: [PATCH 047/109] Documentation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d1a990b7f..10bda3d0b 100644 --- a/README.md +++ b/README.md @@ -6388,7 +6388,7 @@ let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in } ``` -The initial parameter of the `ValueObservation.observing(_:fetch)` method can be fed with requests, and generally speaking, values that adopt the `DatabaseRegionConvertible` protocol. +The initial parameter of the `ValueObservation.observing(_:fetch:)` method can be fed with requests, and generally speaking, values that adopt the `DatabaseRegionConvertible` protocol. This allows you to encapsulate your complex requests in a dedicated type. Our example above can be rewritten as below: @@ -6481,7 +6481,7 @@ let observer = try dbQueue.start(observation) { count: Int in _ = dbQueue.start(observation) { newValue in ... } ``` - The default extent is `.observerLifetime`. + The default extent is `.observerLifetime`: the observation stops when the observer returned by `start` is deallocated. - **`scheduling`** From 8d6ec6297ab1ba03adfc5463a7073dd372ad2536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 08:52:59 +0100 Subject: [PATCH 048/109] Backport Sequence.allSatisfy in Swift 4.1 --- GRDB/Utils/Utils.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GRDB/Utils/Utils.swift b/GRDB/Utils/Utils.swift index fa808dca4..fb497951d 100644 --- a/GRDB/Utils/Utils.swift +++ b/GRDB/Utils/Utils.swift @@ -69,3 +69,11 @@ extension Array { } } } + +#if !swift(>=4.2) +extension Sequence { + func allSatisfy(_ predicate: (Self.Element) throws -> Bool) rethrows -> Bool { + return try !contains(where: { try !predicate($0) }) + } +} +#endif From 93326307fa8756179282a22ffff3c10077322d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 09:00:15 +0100 Subject: [PATCH 049/109] Documentation --- GRDB/Core/DatabaseWriter.swift | 1 + README.md | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index c4c29deb2..8fadabe12 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -137,6 +137,7 @@ extension DatabaseWriter { writeWithoutTransaction { $0.add(transactionObserver: transactionObserver, extent: extent) } } + // TODO: move to DatabaseReader /// Remove a transaction observer. public func remove(transactionObserver: TransactionObserver) { writeWithoutTransaction { $0.remove(transactionObserver: transactionObserver) } diff --git a/README.md b/README.md index 10bda3d0b..d7f8b610e 100644 --- a/README.md +++ b/README.md @@ -6482,6 +6482,16 @@ let observer = try dbQueue.start(observation) { count: Int in ``` The default extent is `.observerLifetime`: the observation stops when the observer returned by `start` is deallocated. + + Regardless of the extent of an observation, you can always stop observation with the `remove(transactionObserver:)` method: + + ```swift + // Start + let observer = dbQueue.start(observation) { ... } + + // Stop + dbQueue.remove(transactionObserver: observer) + ``` - **`scheduling`** From f59dba711cc607e4ff0c5badd7fe5f534050852b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 09:15:18 +0100 Subject: [PATCH 050/109] Try with "tracking" --- GRDB/Core/ValueObservation.swift | 144 +++++++++--------- README.md | 56 +++---- .../ValueObservationCountTests.swift | 4 +- ...rvationDatabaseValueConvertibleTests.swift | 12 +- .../ValueObservationExtentTests.swift | 8 +- .../ValueObservationFetchTests.swift | 4 +- .../ValueObservationReadonlyTests.swift | 8 +- .../ValueObservationRecordTests.swift | 8 +- .../ValueObservationReducerTests.swift | 6 +- .../GRDBTests/ValueObservationRowTests.swift | 8 +- .../ValueObservationSchedulingTests.swift | 12 +- ...ationStatementColumnConvertibleTests.swift | 6 +- 12 files changed, 138 insertions(+), 138 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index a05658b83..452726af4 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -21,7 +21,7 @@ public enum ValueScheduling { /// notified right upon subscription, synchronously: /// /// // On main queue - /// let observation = ValueObservation.forAll(Player.all()) + /// let observation = ValueObservation.trackingAll(Player.all()) /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("fresh players: /(players)") /// } @@ -32,7 +32,7 @@ public enum ValueScheduling { /// /// // Not on the main queue: "fresh players" is eventually printed /// // on the main queue. - /// let observation = ValueObservation.forAll(Player.all()) + /// let observation = ValueObservation.trackingAll(Player.all()) /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("fresh players: /(players)") /// } @@ -302,7 +302,7 @@ public struct ValueObservation { /// notified right upon subscription, synchronously: /// /// // On main queue - /// let observation = ValueObservation.forAll(Player.all()) + /// let observation = ValueObservation.trackingAll(Player.all()) /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("fresh players: /(players)") /// } @@ -313,7 +313,7 @@ public struct ValueObservation { /// /// // Not on the main queue: "fresh players" is eventually printed /// // on the main queue. - /// let observation = ValueObservation.forAll(Player.all()) + /// let observation = ValueObservation.trackingAll(Player.all()) /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("fresh players: /(players)") /// } @@ -340,9 +340,9 @@ public struct ValueObservation { } } - // This initializer is not public. See ValueObservation.observing(_:reducer:) + // This initializer is not public. See ValueObservation.tracking(_:reducer:) init( - observing region: @escaping (Database) throws -> DatabaseRegion, + tracking region: @escaping (Database) throws -> DatabaseRegion, reducer: Reducer) { self.observedRegion = region @@ -361,7 +361,7 @@ public struct ValueObservation { /// fetch: { db in try Player.fetchAll(db) }, /// value: { player in players }) /// let observation = ValueObservation( - /// observing: Player.all(), + /// tracking: Player.all(), /// reducer: reducer) /// /// let observer = try dbQueue.start(observation) { player: [Player] in @@ -382,12 +382,12 @@ public struct ValueObservation { /// /// - parameter region: a closure that returns the observed region. /// - parameter fetch: a closure that fetches a value. - public static func observing( + public static func tracking( _ regions: DatabaseRegionConvertible..., reducer: Reducer) -> ValueObservation { - return ValueObservation(observing: union(regions), reducer: reducer) + return ValueObservation(tracking: union(regions), reducer: reducer) } } @@ -398,7 +398,7 @@ extension ValueObservation where Reducer == Void { /// /// For example: /// - /// let observation = ValueObservation.observing( + /// let observation = ValueObservation.tracking( /// Player.all(), /// fetch: { db in return try Player.fetchAll(db) }) /// @@ -420,13 +420,13 @@ extension ValueObservation where Reducer == Void { /// /// - parameter regions: one or more observed requests. /// - parameter fetch: a closure that fetches a value. - public static func observing( + public static func tracking( _ regions: DatabaseRegionConvertible..., fetch: @escaping (Database) throws -> Value) -> ValueObservation> { return ValueObservation>( - observing: union(regions), + tracking: union(regions), reducer: ValueReducers.Raw(fetch)) } @@ -436,7 +436,7 @@ extension ValueObservation where Reducer == Void { /// /// For example: /// - /// let observation = ValueObservation.observing( + /// let observation = ValueObservation.tracking( /// withUniquing: Player.all(), /// fetch: { db in return try Player.fetchAll(db) }) /// @@ -458,14 +458,14 @@ extension ValueObservation where Reducer == Void { /// /// - parameter regions: one or more observed requests. /// - parameter fetch: a closure that fetches a value. - public static func observing( + public static func tracking( withUniquing regions: DatabaseRegionConvertible..., fetch: @escaping (Database) throws -> Value) -> ValueObservation> where Value: Equatable { return ValueObservation>( - observing: union(regions), + tracking: union(regions), reducer: ValueReducers.Unique(fetch)) } } @@ -488,7 +488,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.all() - /// let observation = ValueObservation.forCount(request) + /// let observation = ValueObservation.trackingCount(request) /// /// let observer = try dbQueue.start(observation) { count: Int in /// print("number of players has changed") @@ -508,11 +508,11 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forCount(_ request: Request) + public static func trackingCount(_ request: Request) -> ValueObservation> { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Raw(request.fetchCount)) } @@ -522,7 +522,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.all() - /// let observation = ValueObservation.forCount(withUniquing: request) + /// let observation = ValueObservation.trackingCount(withUniquing: request) /// /// let observer = try dbQueue.start(observation) { count: Int in /// print("number of players has changed") @@ -542,11 +542,11 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forCount(withUniquing request: Request) + public static func trackingCount(withUniquing request: Request) -> ValueObservation> { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Unique(request.fetchCount)) } } @@ -560,7 +560,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = SQLRequest("SELECT * FROM player") - /// let observation = ValueObservation.forAll(request) + /// let observation = ValueObservation.trackingAll(request) /// /// let observer = try dbQueue.start(observation) { rows: [Row] in /// print("players have changed") @@ -580,12 +580,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) + public static func trackingAll(_ request: Request) -> ValueObservation> where Request.RowDecoder == Row { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Raw(request.fetchAll)) } @@ -595,7 +595,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = SQLRequest("SELECT * FROM player") - /// let observation = ValueObservation.forAll(withUniquing: request) + /// let observation = ValueObservation.trackingAll(withUniquing: request) /// /// let observer = try dbQueue.start(observation) { rows: [Row] in /// print("players have changed") @@ -615,12 +615,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(withUniquing request: Request) + public static func trackingAll(withUniquing request: Request) -> ValueObservation> where Request.RowDecoder == Row { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Unique(request.fetchAll)) } @@ -630,7 +630,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) - /// let observation = ValueObservation.forOne(request) + /// let observation = ValueObservation.trackingOne(request) /// /// let observer = try dbQueue.start(observation) { row: Row? in /// print("players have changed") @@ -650,12 +650,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a new ValueObservation. - public static func forOne(_ request: Request) + public static func trackingOne(_ request: Request) -> ValueObservation> where Request.RowDecoder == Row { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Raw(request.fetchOne)) } @@ -665,7 +665,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) - /// let observation = ValueObservation.forOne(withUniquing: request) + /// let observation = ValueObservation.trackingOne(withUniquing: request) /// /// let observer = try dbQueue.start(observation) { row: Row? in /// print("players have changed") @@ -685,12 +685,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a new ValueObservation. - public static func forOne(withUniquing request: Request) + public static func trackingOne(withUniquing request: Request) -> ValueObservation> where Request.RowDecoder == Row { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Unique(request.fetchOne)) } } @@ -705,7 +705,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.all() - /// let observation = ValueObservation.forAll(request) + /// let observation = ValueObservation.trackingAll(request) /// /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("players have changed") @@ -725,12 +725,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) + public static func trackingAll(_ request: Request) -> ValueObservation> where Request.RowDecoder: FetchableRecord { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Raw(request.fetchAll)) } @@ -741,7 +741,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.all() - /// let observation = ValueObservation.forAll(withUniquing: request) + /// let observation = ValueObservation.trackingAll(withUniquing: request) /// /// let observer = try dbQueue.start(observation) { players: [Player] in /// print("players have changed") @@ -761,12 +761,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(withUniquing request: Request) + public static func trackingAll(withUniquing request: Request) -> ValueObservation> where Request.RowDecoder: FetchableRecord { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.UniqueRecords { try Row.fetchAll($0, request) }) } @@ -776,7 +776,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.filter(key: 1) - /// let observation = ValueObservation.forOne(request) + /// let observation = ValueObservation.trackingOne(request) /// /// let observer = try dbQueue.start(observation) { player: Player? in /// print("player has changed") @@ -796,12 +796,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forOne(_ request: Request) -> + public static func trackingOne(_ request: Request) -> ValueObservation> where Request.RowDecoder: FetchableRecord { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Raw(request.fetchOne)) } @@ -811,7 +811,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.filter(key: 1) - /// let observation = ValueObservation.forOne(withUniquing: request) + /// let observation = ValueObservation.trackingOne(withUniquing: request) /// /// let observer = try dbQueue.start(observation) { player: Player? in /// print("player has changed") @@ -831,12 +831,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forOne(withUniquing request: Request) -> + public static func trackingOne(withUniquing request: Request) -> ValueObservation> where Request.RowDecoder: FetchableRecord { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.UniqueRecord { try Row.fetchOne($0, request) }) } } @@ -851,7 +851,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.forAll(request) + /// let observation = ValueObservation.trackingAll(request) /// /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") @@ -871,12 +871,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) + public static func trackingAll(_ request: Request) -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Raw(request.fetchAll)) } @@ -887,7 +887,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.forAll(withUniquing: request) + /// let observation = ValueObservation.trackingAll(withUniquing: request) /// /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") @@ -907,12 +907,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(withUniquing request: Request) + public static func trackingAll(withUniquing request: Request) -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.UniqueValues { try DatabaseValue.fetchAll($0, request) }) } @@ -922,7 +922,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.select(max(Column("score")), as: Int.self) - /// let observation = ValueObservation.forOne(request) + /// let observation = ValueObservation.trackingOne(request) /// /// let observer = try dbQueue.start(observation) { maxScore: Int? in /// print("maximum score has changed") @@ -942,12 +942,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forOne(_ request: Request) + public static func trackingOne(_ request: Request) -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Raw(request.fetchOne)) } @@ -957,7 +957,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.select(max(Column("score")), as: Int.self) - /// let observation = ValueObservation.forOne(withUniquing: request) + /// let observation = ValueObservation.trackingOne(withUniquing: request) /// /// let observer = try dbQueue.start(observation) { maxScore: Int? in /// print("maximum score has changed") @@ -977,12 +977,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forOne(withUniquing request: Request) + public static func trackingOne(withUniquing request: Request) -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.UniqueValue { try DatabaseValue.fetchOne($0, request) }) } } @@ -997,7 +997,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.forAll(request) + /// let observation = ValueObservation.trackingAll(request) /// /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") @@ -1017,12 +1017,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) + public static func trackingAll(_ request: Request) -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Raw(request.fetchAll)) } @@ -1032,7 +1032,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.select(max(Column("score")), as: Int.self) - /// let observation = ValueObservation.forOne(request) + /// let observation = ValueObservation.trackingOne(request) /// /// let observer = try dbQueue.start(observation) { maxScore: Int? in /// print("maximum score has changed") @@ -1052,12 +1052,12 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forOne(_ request: Request) + public static func trackingOne(_ request: Request) -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Raw(request.fetchOne)) } } @@ -1072,7 +1072,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.forAll(request) + /// let observation = ValueObservation.trackingAll(request) /// /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") @@ -1092,13 +1092,13 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) + public static func trackingAll(_ request: Request) -> ValueObservation> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Raw(request.fetchAll)) } @@ -1109,7 +1109,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.forAll(withUniquing: request) + /// let observation = ValueObservation.trackingAll(withUniquing: request) /// /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") @@ -1129,13 +1129,13 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(withUniquing request: Request) + public static func trackingAll(withUniquing request: Request) -> ValueObservation> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.UniqueOptionalValues { try DatabaseValue.fetchAll($0, request) }) } } @@ -1150,7 +1150,7 @@ extension ValueObservation where Reducer == Void { /// For example: /// /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.forAll(request) + /// let observation = ValueObservation.trackingAll(request) /// /// let observer = try dbQueue.start(observation) { names: [String] in /// print("player name have changed") @@ -1170,13 +1170,13 @@ extension ValueObservation where Reducer == Void { /// /// - parameter request: the observed request. /// - returns: a ValueObservation. - public static func forAll(_ request: Request) + public static func trackingAll(_ request: Request) -> ValueObservation> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible { return ValueObservation>( - observing: request.databaseRegion, + tracking: request.databaseRegion, reducer: ValueReducers.Raw(request.fetchAll)) } } diff --git a/README.md b/README.md index d7f8b610e..eaf5836a1 100644 --- a/README.md +++ b/README.md @@ -6216,7 +6216,7 @@ class PlayerViewController: UIViewController { let request = Player.filter(key: 42) // 2. Create a ValueObservation - let observation = ValueObservation.forOne(request) + let observation = ValueObservation.trackingOne(request) do { // 3. Start observing the database, and store the returned observer @@ -6259,60 +6259,60 @@ An initial fetch is performed as soon as the observation starts: the view is set The view controller stores the observer returned by the `start` method in a property in order to control the duration of the observation. When the observed is deallocated, the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. -### `ValueObservation.forCount`, `forOne`, `forAll` +### `ValueObservation.trackingCount`, `trackingOne`, `trackingAll` Given a [request](#requests), you can track its number of results, the first one, or all of them: ```swift -ValueObservation.forCount(request) -ValueObservation.forOne(request) -ValueObservation.forAll(request) +ValueObservation.trackingCount(request) +ValueObservation.trackingOne(request) +ValueObservation.trackingAll(request) -ValueObservation.forCount(withUniquing: request) -ValueObservation.forOne(withUniquing: request) -ValueObservation.forAll(withUniquing: request) +ValueObservation.trackingCount(withUniquing: request) +ValueObservation.trackingOne(withUniquing: request) +ValueObservation.trackingAll(withUniquing: request) ``` -The `forCount` observation notifies counts: +The `trackingCount` observation notifies counts: ```swift // Observe number of players -let observation = ValueObservation.forCount(Player.all()) +let observation = ValueObservation.trackingCount(Player.all()) let observer = try dbQueue.start(observation) { count: Int in print("Number of players have changed: \(count)") } ``` -The `forOne` observation notifies optional values, built from a single database row (if any): +The `trackingOne` observation notifies optional values, built from a single database row (if any): ```swift // Observe a single player -let observation = ValueObservation.forOne(Player.filter(key: 1)) +let observation = ValueObservation.trackingOne(Player.filter(key: 1)) let observer = try dbQueue.start(observation) { player: Player? in print("Player has changed: \(player)") } // Observe the maximum score let request = Player.select(max(Column("score")), as: Int.self) -let observation = ValueObservation.forOne(request) +let observation = ValueObservation.trackingOne(request) let observer = try dbQueue.start(observation) { maximumScore: Int? in print("Maximum score has changed: \(maximumScore)") } ``` -The `forAll` observation notifies arrays: +The `trackingAll` observation notifies arrays: ```swift // Observe all players -let observation = ValueObservation.forAll(Player.all()) +let observation = ValueObservation.trackingAll(Player.all()) let observer = try dbQueue.start(observation) { players: [Player] in print("Players have changed: \(players)") } // Observe all player names let request = SQLRequest("SELECT name FROM player") -let observation = ValueObservation.forAll(request) +let observation = ValueObservation.trackingAll(request) let observer = try dbQueue.start(observation) { names: [String] in print("Players names have changed: \(names)") } @@ -6329,14 +6329,14 @@ You can avoid notification of consecutive identical values with the `withUniquin ```swift // Observe the maximum score let request = Player.select(max(Column("score")), as: Int.self) -let observation = ValueObservation.forOne(withUniquing: request) +let observation = ValueObservation.trackingOne(withUniquing: request) let observer = try dbQueue.start(observation) { maximumScore: Int? in print("Maximum score has (really) changed: \(maximumScore)") } ``` -### `ValueObservation.observing(_:fetch:)` +### `ValueObservation.tracking(_:fetch:)` Sometimes you need to observe several requests at the same time, and be notified of **consistent** values. For example, you need to observe changes on both a team and its players. @@ -6353,7 +6353,7 @@ struct TeamInfo { var players: [Player] } -let observation = ValueObservation.observing( +let observation = ValueObservation.tracking( teamRequest, playersRequest, fetch { db -> TeamInfo? in guard let team = try teamRequest.fetchOne(db) else { @@ -6373,7 +6373,7 @@ You can avoid notification of consecutive identical values with the `withUniquin ```swift extension TeamInfo: Equatable { ... } -let observation = ValueObservation.observing( +let observation = ValueObservation.tracking( withUniquing: teamRequest, playersRequest, fetch { db -> TeamInfo? in guard let team = try teamRequest.fetchOne(db) else { @@ -6388,7 +6388,7 @@ let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in } ``` -The initial parameter of the `ValueObservation.observing(_:fetch:)` method can be fed with requests, and generally speaking, values that adopt the `DatabaseRegionConvertible` protocol. +The initial parameter of the `ValueObservation.tracking(_:fetch:)` method can be fed with requests, and generally speaking, values that adopt the `DatabaseRegionConvertible` protocol. This allows you to encapsulate your complex requests in a dedicated type. Our example above can be rewritten as below: @@ -6421,7 +6421,7 @@ struct TeamInfoRequest: DatabaseRegionConvertible { } let request = TeamInfoRequest(teamId: 1) -let observation = ValueObservation.observing(request, fetch: request.fetch) +let observation = ValueObservation.tracking(request, fetch: request.fetch) let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in print("Team and players have hanged.") } @@ -6430,7 +6430,7 @@ let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in See [DatabaseRegion](#databaseregion) for more information. -### `ValueObservation.observing(_:reducer:)` +### `ValueObservation.tracking(_:reducer:)` The most general way to define a ValueObservation is to create one from an observed database region (see above), and a **reducer** that adopts the ValueReducer protocol: @@ -6461,7 +6461,7 @@ let reducer = AnyValueReducer( count += 1 return count }) -let observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) +let observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) let observer = try dbQueue.start(observation) { count: Int in print("The database has been modified \(count) times.") } @@ -6503,7 +6503,7 @@ let observer = try dbQueue.start(observation) { count: Int in ```swift // On main queue - let observation = ValueObservation.forAll(Player.all()) + let observation = ValueObservation.trackingAll(Player.all()) let observer = try dbQueue.start(observation) { players: [Player] in print("fresh players: \(players)") } @@ -6515,7 +6515,7 @@ let observer = try dbQueue.start(observation) { count: Int in ```swift // Not on the main queue: "fresh players" is eventually printed // on the main queue. - let observation = ValueObservation.forAll(Player.all()) + let observation = ValueObservation.trackingAll(Player.all()) let observer = try dbQueue.start(observation) { players: [Player] in print("fresh players: \(players)") } @@ -6534,7 +6534,7 @@ let observer = try dbQueue.start(observation) { count: Int in ```swift let customQueue = DispatchQueue(label: "customQueue") - var observation = ValueObservation.forAll(Player.all()) + var observation = ValueObservation.trackingAll(Player.all()) observation.scheduling = .onQueue(customQueue, startImmediately: true) let observer = try dbQueue.start(observation) { players: [Player] in // in customQueue @@ -6547,7 +6547,7 @@ let observer = try dbQueue.start(observation) { count: Int in The default is true. When false, a ValueObservation has a write access to the database when it fetches fresh values: ```swift - let observation = ValueObservation.observing( + let observation = ValueObservation.tracking( teamRequest, playersRequest, fetch { db in // write access allowed diff --git a/Tests/GRDBTests/ValueObservationCountTests.swift b/Tests/GRDBTests/ValueObservationCountTests.swift index 89bbeee2d..b66e93a0c 100644 --- a/Tests/GRDBTests/ValueObservationCountTests.swift +++ b/Tests/GRDBTests/ValueObservationCountTests.swift @@ -23,7 +23,7 @@ class ValueObservationCountTests: GRDBTestCase { notificationExpectation.expectedFulfillmentCount = 4 struct T: TableRecord { } - var observation = ValueObservation.forCount(T.all()) + var observation = ValueObservation.trackingCount(T.all()) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { count in counts.append(count) @@ -54,7 +54,7 @@ class ValueObservationCountTests: GRDBTestCase { notificationExpectation.expectedFulfillmentCount = 3 struct T: TableRecord { } - var observation = ValueObservation.forCount(withUniquing: T.all()) + var observation = ValueObservation.trackingCount(withUniquing: T.all()) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { count in counts.append(count) diff --git a/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift b/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift index 566cbb577..bb01848a9 100644 --- a/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift +++ b/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift @@ -37,7 +37,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 4 - var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) + var observation = ValueObservation.trackingAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { names in results.append(names) @@ -71,7 +71,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 3 - var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) + var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { names in results.append(names) @@ -104,7 +104,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 5 - var observation = ValueObservation.forOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) + var observation = ValueObservation.trackingOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { name in results.append(name) @@ -142,7 +142,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 4 - var observation = ValueObservation.forOne(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id DESC")) + var observation = ValueObservation.trackingOne(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { name in results.append(name) @@ -179,7 +179,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 4 - var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) + var observation = ValueObservation.trackingAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { names in results.append(names) @@ -213,7 +213,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 3 - var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) + var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { names in results.append(names) diff --git a/Tests/GRDBTests/ValueObservationExtentTests.swift b/Tests/GRDBTests/ValueObservationExtentTests.swift index 71f905b2b..fc86046d1 100644 --- a/Tests/GRDBTests/ValueObservationExtentTests.swift +++ b/Tests/GRDBTests/ValueObservationExtentTests.swift @@ -14,7 +14,7 @@ import XCTest class ValueObservationExtentTests: GRDBTestCase { func testDefaultExtentIsObserverLifetime() { - let observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { _ in }) + let observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { _ in }) XCTAssertEqual(observation.extent, .observerLifetime) } @@ -34,7 +34,7 @@ class ValueObservationExtentTests: GRDBTestCase { value: { $0 }) // Create an observation - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .databaseLifetime // Start observation @@ -72,7 +72,7 @@ class ValueObservationExtentTests: GRDBTestCase { value: { $0 }) // Create an observation - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .observerLifetime // Start observation and deallocate observer after second change @@ -118,7 +118,7 @@ class ValueObservationExtentTests: GRDBTestCase { value: { $0 }) // Create an observation - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .nextTransaction // Start observation diff --git a/Tests/GRDBTests/ValueObservationFetchTests.swift b/Tests/GRDBTests/ValueObservationFetchTests.swift index 2fdc92570..df5e4d4a7 100644 --- a/Tests/GRDBTests/ValueObservationFetchTests.swift +++ b/Tests/GRDBTests/ValueObservationFetchTests.swift @@ -22,7 +22,7 @@ class ValueObservationFetchTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 4 - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime @@ -54,7 +54,7 @@ class ValueObservationFetchTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 3 - var observation = ValueObservation.observing(withUniquing: DatabaseRegion.fullDatabase, fetch: { + var observation = ValueObservation.tracking(withUniquing: DatabaseRegion.fullDatabase, fetch: { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime diff --git a/Tests/GRDBTests/ValueObservationReadonlyTests.swift b/Tests/GRDBTests/ValueObservationReadonlyTests.swift index 33b29e8f2..c51263c9c 100644 --- a/Tests/GRDBTests/ValueObservationReadonlyTests.swift +++ b/Tests/GRDBTests/ValueObservationReadonlyTests.swift @@ -23,7 +23,7 @@ class ValueObservationReadonlyTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 2 - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime @@ -44,7 +44,7 @@ class ValueObservationReadonlyTests: GRDBTestCase { let dbQueue = try makeDatabaseQueue() try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } - let observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { db -> Int in + let observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { db -> Int in try db.execute("INSERT INTO t DEFAULT VALUES") return 0 }) @@ -72,7 +72,7 @@ class ValueObservationReadonlyTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 2 - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { db -> Int in + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { db -> Int in try db.execute("CREATE TEMPORARY TABLE temp AS SELECT * FROM t") let result = try Int.fetchOne(db, "SELECT COUNT(*) FROM temp")! try db.execute("DROP TABLE temp") @@ -100,7 +100,7 @@ class ValueObservationReadonlyTests: GRDBTestCase { } struct TestError: Error { } - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { db in + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { db in try db.execute("INSERT INTO t DEFAULT VALUES") throw TestError() }) diff --git a/Tests/GRDBTests/ValueObservationRecordTests.swift b/Tests/GRDBTests/ValueObservationRecordTests.swift index cdd0e24b9..fff2a3087 100644 --- a/Tests/GRDBTests/ValueObservationRecordTests.swift +++ b/Tests/GRDBTests/ValueObservationRecordTests.swift @@ -36,7 +36,7 @@ class ValueObservationRecordTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 4 - var observation = ValueObservation.forAll(SQLRequest("SELECT * FROM t ORDER BY id")) + var observation = ValueObservation.trackingAll(SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { players in results.append(players) @@ -70,7 +70,7 @@ class ValueObservationRecordTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 3 - var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) + var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { players in results.append(players) @@ -103,7 +103,7 @@ class ValueObservationRecordTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 5 - var observation = ValueObservation.forOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) + var observation = ValueObservation.trackingOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { player in results.append(player) @@ -141,7 +141,7 @@ class ValueObservationRecordTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 4 - var observation = ValueObservation.forOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) + var observation = ValueObservation.trackingOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { player in results.append(player) diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift index 5f360c1bb..170f0b705 100644 --- a/Tests/GRDBTests/ValueObservationReducerTests.swift +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -48,7 +48,7 @@ class ValueObservationReducerTests: GRDBTestCase { // Create an observation let request = SQLRequest("SELECT * FROM t") - var observation = ValueObservation.observing(request, reducer: reducer) + var observation = ValueObservation.tracking(request, reducer: reducer) observation.extent = .databaseLifetime // Start observation @@ -119,7 +119,7 @@ class ValueObservationReducerTests: GRDBTestCase { value: { _ in fatalError() }) // Create an observation - let observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) + let observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) // Start observation do { @@ -157,7 +157,7 @@ class ValueObservationReducerTests: GRDBTestCase { value: { $0 }) // Create an observation - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .databaseLifetime // Start observation diff --git a/Tests/GRDBTests/ValueObservationRowTests.swift b/Tests/GRDBTests/ValueObservationRowTests.swift index e63d68cc7..0442d0217 100644 --- a/Tests/GRDBTests/ValueObservationRowTests.swift +++ b/Tests/GRDBTests/ValueObservationRowTests.swift @@ -22,7 +22,7 @@ class ValueObservationRowTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 4 - var observation = ValueObservation.forAll(SQLRequest("SELECT * FROM t ORDER BY id")) + var observation = ValueObservation.trackingAll(SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { rows in results.append(rows) @@ -56,7 +56,7 @@ class ValueObservationRowTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 3 - var observation = ValueObservation.forAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) + var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { rows in results.append(rows) @@ -89,7 +89,7 @@ class ValueObservationRowTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 5 - var observation = ValueObservation.forOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) + var observation = ValueObservation.trackingOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { row in results.append(row) @@ -127,7 +127,7 @@ class ValueObservationRowTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 4 - var observation = ValueObservation.forOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) + var observation = ValueObservation.trackingOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { row in results.append(row) diff --git a/Tests/GRDBTests/ValueObservationSchedulingTests.swift b/Tests/GRDBTests/ValueObservationSchedulingTests.swift index f985a3157..63918b3d6 100644 --- a/Tests/GRDBTests/ValueObservationSchedulingTests.swift +++ b/Tests/GRDBTests/ValueObservationSchedulingTests.swift @@ -26,7 +26,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { let key = DispatchSpecificKey<()>() DispatchQueue.main.setSpecific(key: key, value: ()) - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime @@ -62,7 +62,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { let key = DispatchSpecificKey<()>() DispatchQueue.main.setSpecific(key: key, value: ()) - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime @@ -105,7 +105,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { } }, value: { $0 }) - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .databaseLifetime _ = try dbQueue.start( @@ -144,7 +144,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { let key = DispatchSpecificKey<()>() queue.setSpecific(key: key, value: ()) - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime @@ -178,7 +178,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { let key = DispatchSpecificKey<()>() queue.setSpecific(key: key, value: ()) - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, fetch: { + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime @@ -216,7 +216,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { let reducer = AnyValueReducer( fetch: { _ in throw TestError() }, value: { $0 }) - var observation = ValueObservation.observing(DatabaseRegion.fullDatabase, reducer: reducer) + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .databaseLifetime observation.scheduling = .onQueue(queue, startImmediately: false) diff --git a/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift b/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift index b8c184bba..96bc3af10 100644 --- a/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift +++ b/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift @@ -44,7 +44,7 @@ class ValueObservationStatementColumnConvertibleTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 4 - var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) + var observation = ValueObservation.trackingAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { names in XCTAssert(names.allSatisfy { $0.fast }) @@ -79,7 +79,7 @@ class ValueObservationStatementColumnConvertibleTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 5 - var observation = ValueObservation.forOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) + var observation = ValueObservation.trackingOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { name in if let name = name { @@ -120,7 +120,7 @@ class ValueObservationStatementColumnConvertibleTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 4 - var observation = ValueObservation.forAll(SQLRequest("SELECT name FROM t ORDER BY id")) + var observation = ValueObservation.trackingAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime _ = try dbQueue.start(observation) { names in XCTAssert(names.allSatisfy { $0.map { $0.fast } ?? true }) From 5a540e8850158c9f0056fcf1060ce154e1edfe32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 09:16:42 +0100 Subject: [PATCH 051/109] Documentation --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index eaf5836a1..090107ef2 100644 --- a/README.md +++ b/README.md @@ -6322,8 +6322,6 @@ Beware that by default, a ValueObservation notifies *potential* changes, not *ac For example, if you observe `Player.select(max(Column("score")))`, then you'll get be notified of all changes performed on the `score` column of the `player` table (updates, insertions and deletions), even if they do not modify the value of the maximum score. However, you will not get any notification for changes performed on other database tables, or updates to other columns of the player table. -Similarly, observing `Country.filter(key: "FR")` will notify all changes that happen to the whole `country` table. That is because SQLite only notifies the numerical [rowid](https://www.sqlite.org/rowidtable.html) of changed rows, and we can't check if it is the row "FR" that has been changed, or another. This limitation does not apply to tables whose primary key *is* the rowid: `Player.filter(key: 42)` will only notify of changes performed on the row with id 42. - You can avoid notification of consecutive identical values with the `withUniquing` variant. It performs deduplication at the database level, by comparing raw database values: ```swift From 191607fc13a902b87f0a8470ae769d3bbef864ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 09:18:29 +0100 Subject: [PATCH 052/109] Documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 090107ef2..c2762cd39 100644 --- a/README.md +++ b/README.md @@ -6406,7 +6406,7 @@ struct TeamInfoRequest: DatabaseRegionConvertible { func databaseRegion(_ db: Database) throws -> DatabaseRegion { let teamRegion = try teamRequest.databaseRegion(db) let playersRegion = try playersRequest.databaseRegion(db) - return teamRegion.union(playersRequest) + return teamRegion.union(playersRegion) } func fetch(_ db: Database) throws -> TeamInfo? { From a4b35729df8d5b2130be716834c7449e3b940aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 12:22:16 +0100 Subject: [PATCH 053/109] Documentation --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c2762cd39..603d87d25 100644 --- a/README.md +++ b/README.md @@ -6235,7 +6235,7 @@ class PlayerViewController: UIViewController { } override func viewWillDisappear(_ animated: Bool) { - super.viewWillAppear(animated) + super.viewWillDisappear(animated) // Stop observing the database playerObserver = nil @@ -6243,7 +6243,7 @@ class PlayerViewController: UIViewController { } ``` -When you are not interested in eventual refreshing errors, drop the `onError` callback: +When you are not interested in eventual errors, drop the `onError` callback: ```swift playerObserver = try dbQueue.start(observation) { @@ -6256,7 +6256,7 @@ All values are notified on the main queue: views can be updated right from the ` An initial fetch is performed as soon as the observation starts: the view is set up and ready when the `viewWillAppear` method returns. -The view controller stores the observer returned by the `start` method in a property in order to control the duration of the observation. When the observed is deallocated, the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. +The view controller stores the observer returned by the `start` method in a property. This allows the view controller to control the duration of the observation. When the observed is deallocated, the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. ### `ValueObservation.trackingCount`, `trackingOne`, `trackingAll` @@ -6325,7 +6325,7 @@ For example, if you observe `Player.select(max(Column("score")))`, then you'll g You can avoid notification of consecutive identical values with the `withUniquing` variant. It performs deduplication at the database level, by comparing raw database values: ```swift -// Observe the maximum score +// Observe the maximum score (with uniquing) let request = Player.select(max(Column("score")), as: Int.self) let observation = ValueObservation.trackingOne(withUniquing: request) let observer = try dbQueue.start(observation) { maximumScore: Int? in @@ -6336,12 +6336,12 @@ let observer = try dbQueue.start(observation) { maximumScore: Int? in ### `ValueObservation.tracking(_:fetch:)` -Sometimes you need to observe several requests at the same time, and be notified of **consistent** values. For example, you need to observe changes on both a team and its players. +Sometimes you need to observe several requests at the same time. For example, you need to observe changes in both a team and its players. -When this happens, you create a ValueObservation with two parameters: one is the observed database region, and the other is a closure that fetches fresh values whenever the observed region is modified: +When this happens, you create a ValueObservation with two parameters. The first parameter is the list of observed requests. The other parameter is a closure that fetches fresh values whenever the observed requests are modified. This fetch closure is guaranteed an immutable view of the last committed state of the database: this means that fetched values are **consistent**. For example: ```swift -// The two observed requests +// The two observed requests (the team and its players) let teamRequest = Team.filter(key: 1) let playersRequest = Player.filter(Column("teamId") == 1) @@ -6386,9 +6386,9 @@ let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in } ``` -The initial parameter of the `ValueObservation.tracking(_:fetch:)` method can be fed with requests, and generally speaking, values that adopt the `DatabaseRegionConvertible` protocol. +The initial parameter of the `ValueObservation.tracking(_:fetch:)` method can be fed with requests, and generally speaking, values that adopt the **DatabaseRegionConvertible** protocol. -This allows you to encapsulate your complex requests in a dedicated type. Our example above can be rewritten as below: +Use this protocol when you want to encapsulate your complex requests in a dedicated type. Our example above can be rewritten as below: ```swift struct TeamInfoRequest: DatabaseRegionConvertible { From f582683f20fa502166e96c1565c57799ef956621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 12:26:12 +0100 Subject: [PATCH 054/109] Move remove(transactionObserver:) to DatabaseReader --- GRDB/Core/DatabaseReader.swift | 10 +++++++++- GRDB/Core/DatabaseSnapshot.swift | 4 ++++ GRDB/Core/DatabaseWriter.swift | 2 -- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index 0144f9308..59282d78a 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -158,6 +158,9 @@ public protocol DatabaseReader : class { onError: ((Error) -> Void)?, onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver + + /// Remove a transaction observer. + func remove(transactionObserver: TransactionObserver) } extension DatabaseReader { @@ -240,7 +243,7 @@ public final class AnyDatabaseReader : DatabaseReader { // MARK: - Value Observation - /// TODO + /// :nodoc: public func start( _ observation: ValueObservation, onError: ((Error) -> Void)? = nil, @@ -249,4 +252,9 @@ public final class AnyDatabaseReader : DatabaseReader { { return try base.start(observation, onError: onError, onChange: onChange) } + + /// :nodoc: + public func remove(transactionObserver: TransactionObserver) { + base.remove(transactionObserver: transactionObserver) + } } diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index b25591a98..2f7f14917 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -134,6 +134,10 @@ extension DatabaseSnapshot { // Return a dummy observer, because snapshots never change return SnapshotValueObserver() } + + public func remove(transactionObserver: TransactionObserver) { + // Can't remove an observer which could not be added :-) + } } /// An observer that does nothing, support for diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 8fadabe12..662d8a818 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -137,8 +137,6 @@ extension DatabaseWriter { writeWithoutTransaction { $0.add(transactionObserver: transactionObserver, extent: extent) } } - // TODO: move to DatabaseReader - /// Remove a transaction observer. public func remove(transactionObserver: TransactionObserver) { writeWithoutTransaction { $0.remove(transactionObserver: transactionObserver) } } From f7712473aa024cabb96855e68f3d1fa0f5a419c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 12:27:39 +0100 Subject: [PATCH 055/109] Move Sequence.allSatisfy where it is used: tests --- GRDB/Utils/Utils.swift | 8 -------- Tests/GRDBTests/GRDBTestCase.swift | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/GRDB/Utils/Utils.swift b/GRDB/Utils/Utils.swift index fb497951d..fa808dca4 100644 --- a/GRDB/Utils/Utils.swift +++ b/GRDB/Utils/Utils.swift @@ -69,11 +69,3 @@ extension Array { } } } - -#if !swift(>=4.2) -extension Sequence { - func allSatisfy(_ predicate: (Self.Element) throws -> Bool) rethrows -> Bool { - return try !contains(where: { try !predicate($0) }) - } -} -#endif diff --git a/Tests/GRDBTests/GRDBTestCase.swift b/Tests/GRDBTests/GRDBTestCase.swift index 9989a9882..60fa4f0ff 100644 --- a/Tests/GRDBTests/GRDBTestCase.swift +++ b/Tests/GRDBTests/GRDBTestCase.swift @@ -166,3 +166,11 @@ class GRDBTestCase: XCTestCase { } } } + +#if !swift(>=4.2) +extension Sequence { + func allSatisfy(_ predicate: (Self.Element) throws -> Bool) rethrows -> Bool { + return try !contains(where: { try !predicate($0) }) + } +} +#endif From 1985b9129a76d2480dd0e4e75d263185527f61a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 13:09:56 +0100 Subject: [PATCH 056/109] Fix SPM build --- GRDB/Core/DatabaseSnapshot.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index 2f7f14917..ea3724817 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -1,3 +1,5 @@ +import Dispatch + /// A DatabaseSnapshot sees an unchanging database content, as it existed at the /// moment it was created. /// From a4899597809c99f64bb2f7945ff0f50a8ad9bfd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 13:10:04 +0100 Subject: [PATCH 057/109] Typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 603d87d25..d3924b3c7 100644 --- a/README.md +++ b/README.md @@ -6437,10 +6437,10 @@ protocol ValueReducer { associatedtype Fetched associatedtype Value - /// Fetch a database value + /// Fetches a database value func fetch(_ db: Database) throws -> Fetched - /// Outputs an notified value + /// Returns a notified value mutating func value(_ fetched: Fetched) -> Value? } ``` From 669b9c4e911ac2affee5202e1dae0eb5026d6e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 13:31:42 +0100 Subject: [PATCH 058/109] Test for the ValueReducer documented in README --- .../ValueObservationReducerTests.swift | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift index 170f0b705..c9bbe01e7 100644 --- a/Tests/GRDBTests/ValueObservationReducerTests.swift +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -186,4 +186,44 @@ class ValueObservationReducerTests: GRDBTestCase { XCTAssertEqual(errors.count, 1) XCTAssertEqual(changes.count, 2) } + + func testReadMeReducer() throws { + // Test for the reducer documented in the main README + + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + // Track reducer proceess + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + // The reducer + var count = 0 + let reducer = AnyValueReducer( + fetch: { _ in /* don't fetch anything */ }, + value: { _ -> Int? in + count += 1 + return count + }) + + // Create an observation + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) + observation.extent = .databaseLifetime + + // Start observation + _ = try dbQueue.start(observation) { count in + counts.append(count) + notificationExpectation.fulfill() + } + + try dbQueue.write { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [1, 2]) + } } From 72c5769e8b3b79adc2b2361fa87470d889986f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 13:59:02 +0100 Subject: [PATCH 059/109] ValueScheduling.unsafe --- GRDB/Core/DatabaseSnapshot.swift | 17 +++- GRDB/Core/DatabaseWriter.swift | 48 ++++++++-- GRDB/Core/ValueObservation.swift | 67 ++++++++++---- README.md | 23 ++++- .../ValueObservationSchedulingTests.swift | 92 +++++++++++++++++++ 5 files changed, 216 insertions(+), 31 deletions(-) diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index ea3724817..62c990efa 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -124,9 +124,20 @@ extension DatabaseSnapshot { } case let .onQueue(queue, startImmediately: startImmediately): if startImmediately { - var reducer = observation.reducer - if let value = try reducer.value(unsafeReentrantRead(reducer.fetch)) { - queue.async { + try unsafeReentrantRead { db in + var reducer = observation.reducer + if let value = try reducer.value(reducer.fetch(db)) { + queue.async { + onChange(value) + } + } + } + } + case let .unsafe(startImmediately: startImmediately): + if startImmediately { + try unsafeReentrantRead { db in + var reducer = observation.reducer + if let value = try reducer.value(reducer.fetch(db)) { onChange(value) } } diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 662d8a818..8cac59981 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -234,7 +234,7 @@ extension DatabaseWriter { return .commit } } - // reduce + // reduce & notify if let value = reducer.value(fetchedValue) { if calledOnMainQueue { mainQueueValue = value @@ -254,11 +254,28 @@ extension DatabaseWriter { return .commit } } - // reduce + // reduce & notify if let value = reducer.value(fetchedValue) { queue.async { onChange(value) } } } + case let .unsafe(startImmediately: startImmediately): + if startImmediately { + // fetch + var fetchedValue: Reducer.Fetched! + if observation.isReadOnly { + fetchedValue = try db.readOnly { try reducer.fetch(db) } + } else { + try db.inSavepoint { + fetchedValue = try reducer.fetch(db) + return .commit + } + } + // reduce & notify + if let value = reducer.value(fetchedValue) { + onChange(value) + } + } } // Start observing the database @@ -303,7 +320,7 @@ private class ValueObserver: TransactionObserver { private let region: DatabaseRegion private var reducer: Reducer private let fetch: (Database, Reducer) -> Future - private let notificationQueue: DispatchQueue + private let notificationQueue: DispatchQueue? private let onError: ((Error) -> Void)? private let onChange: (Reducer.Value) -> Void private let reduceQueue: DispatchQueue @@ -313,7 +330,7 @@ private class ValueObserver: TransactionObserver { region: DatabaseRegion, reducer: Reducer, fetch: @escaping (Database, Reducer) -> Future, - notificationQueue: DispatchQueue, + notificationQueue: DispatchQueue?, onError: ((Error) -> Void)?, onChange: @escaping (Reducer.Value) -> Void) { @@ -324,7 +341,12 @@ private class ValueObserver: TransactionObserver { self.onChange = onChange self.onError = onError if #available(OSX 10.10, *) { - self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation", qos: notificationQueue.qos) + if let queue = notificationQueue { + self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation", qos: queue.qos) + } else { + // TODO: provide a qos + self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation") + } } else { self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation") } @@ -357,14 +379,22 @@ private class ValueObserver: TransactionObserver { do { if let value = try strongSelf.reducer.value(future.wait()) { - strongSelf.notificationQueue.async { - guard let strongSelf = self else { return } + if let queue = strongSelf.notificationQueue { + queue.async { + guard let strongSelf = self else { return } + strongSelf.onChange(value) + } + } else { strongSelf.onChange(value) } } } catch { - strongSelf.notificationQueue.async { - guard let strongSelf = self else { return } + if let queue = strongSelf.notificationQueue { + queue.async { + guard let strongSelf = self else { return } + strongSelf.onError?(error) + } + } else { strongSelf.onError?(error) } } diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 452726af4..58c926079 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -17,27 +17,28 @@ import Dispatch public enum ValueScheduling { /// All values are notified on the main queue. /// - /// If the observation starts on the main queue, initial values are + /// If the observation starts on the main queue, an initial value is /// notified right upon subscription, synchronously: /// /// // On main queue /// let observation = ValueObservation.trackingAll(Player.all()) /// let observer = try dbQueue.start(observation) { players: [Player] in - /// print("fresh players: /(players)") + /// print("fresh players: \(players)") /// } /// // <- here "fresh players" is already printed. /// - /// If the observation does not start on the main queue, initial values - /// are asynchronously notified on the main queue: + /// If the observation does not start on the main queue, an initial value + /// is also notified on the main queue, but asynchronously: /// /// // Not on the main queue: "fresh players" is eventually printed /// // on the main queue. /// let observation = ValueObservation.trackingAll(Player.all()) /// let observer = try dbQueue.start(observation) { players: [Player] in - /// print("fresh players: /(players)") + /// print("fresh players: \(players)") /// } /// - /// When the database changes, fresh values are asynchronously notified: + /// When the database changes, fresh values are asynchronously notified on + /// the main queue: /// /// // Eventually prints "fresh players" on the main queue /// try dbQueue.write { db in @@ -46,9 +47,25 @@ public enum ValueScheduling { case mainQueue /// All values are asychronously notified on the specified queue. - /// Initial values are only fetched and notified if `startImmediately` + /// + /// An initial value is fetched and notified if `startImmediately` /// is true. case onQueue(DispatchQueue, startImmediately: Bool) + + /// Each value is notified on an unspecified dispatch queue, which may be + /// different for each notified value. + /// + /// If `startImmediately` is true, an initial value is notified right upon + /// subscription, synchronously. + /// + /// // On any queue + /// var observation = ValueObservation.trackingAll(Player.all()) + /// observation.scheduling = .unsafe(startImmediately: true) + /// let observer = try dbQueue.start(observation) { players: [Player] in + /// print("fresh players: \(players)") + /// } + /// // <- here "fresh players" is already printed. + case unsafe(startImmediately: Bool) } extension DispatchQueue { @@ -298,24 +315,24 @@ public struct ValueObservation { /// /// - `.mainQueue`: all values are notified on the main queue. /// - /// If the observation starts on the main queue, initial values are - /// notified right upon subscription, synchronously: + /// If the observation starts on the main queue, an initial value is + /// notified right upon subscription, synchronously:: /// /// // On main queue /// let observation = ValueObservation.trackingAll(Player.all()) /// let observer = try dbQueue.start(observation) { players: [Player] in - /// print("fresh players: /(players)") + /// print("fresh players: \(players)") /// } /// // <- here "fresh players" is already printed. /// - /// If the observation does not start on the main queue, initial values - /// are asynchronously notified on the main queue: + /// If the observation does not start on the main queue, an initial + /// value is also notified on the main queue, but asynchronously: /// /// // Not on the main queue: "fresh players" is eventually printed /// // on the main queue. /// let observation = ValueObservation.trackingAll(Player.all()) /// let observer = try dbQueue.start(observation) { players: [Player] in - /// print("fresh players: /(players)") + /// print("fresh players: \(players)") /// } /// /// When the database changes, fresh values are asynchronously notified: @@ -326,17 +343,35 @@ public struct ValueObservation { /// } /// /// - `.onQueue(_:startImmediately:)`: all values are asychronously notified - /// on the specified queue. Initial values are only fetched and notified if - /// `startImmediately` is true. + /// on the specified queue. + /// + /// An initial value is fetched and notified if `startImmediately` + /// is true. + /// + /// - `unsafe(startImmediately:)`: each value is notified on an unspecified + /// dispatch queue, which may be different for each notified value. + /// + /// If `startImmediately` is true, an initial value is notified right + /// upon subscription, synchronously. + /// + /// // On any queue + /// var observation = ValueObservation.trackingAll(Player.all()) + /// observation.scheduling = .unsafe(startImmediately: true) + /// let observer = try dbQueue.start(observation) { players: [Player] in + /// print("fresh players: \(players)") + /// } + /// // <- here "fresh players" is already printed. public var scheduling: ValueScheduling = .mainQueue /// The dispatch queue where change callbacks are called. - public var notificationQueue: DispatchQueue { + var notificationQueue: DispatchQueue? { switch scheduling { case .mainQueue: return DispatchQueue.main case .onQueue(let queue, startImmediately: _): return queue + case .unsafe: + return nil } } diff --git a/README.md b/README.md index d3924b3c7..d8d04ba59 100644 --- a/README.md +++ b/README.md @@ -6497,7 +6497,7 @@ let observer = try dbQueue.start(observation) { count: Int in - `.mainQueue` (the default): all values are notified on the main queue. - If the observation starts on the main queue, initial values are notified right upon subscription, synchronously: + If the observation starts on the main queue, an initial value is notified right upon subscription, synchronously: ```swift // On main queue @@ -6508,7 +6508,7 @@ let observer = try dbQueue.start(observation) { count: Int in // <- here "fresh players" is already printed. ``` - If the observation does not start on the main queue, initial values are asynchronously notified on the main queue: + If the observation does not start on the main queue, an initial value is also notified on the main queue, but asynchronously: ```swift // Not on the main queue: "fresh players" is eventually printed @@ -6528,7 +6528,9 @@ let observer = try dbQueue.start(observation) { count: Int in } ``` - - `.onQueue(_:startImmediately:)`: all values are asychronously notified on the specified queue. Initial values are only fetched and notified if `startImmediately` is true. + - `.onQueue(_:startImmediately:)`: all values are asychronously notified on the specified queue. + + An initial value is fetched and notified if `startImmediately` is true. ```swift let customQueue = DispatchQueue(label: "customQueue") @@ -6540,6 +6542,21 @@ let observer = try dbQueue.start(observation) { count: Int in } ``` + - `unsafe(startImmediately:)`: each value is notified on an unspecified dispatch queue, which may be different for each notified value. + + If `startImmediately` is true, an initial value is notified right upon subscription, synchronously. + + ```swift + // On any queue + var observation = ValueObservation.trackingAll(Player.all()) + observation.scheduling = .unsafe(startImmediately: true) + let observer = try dbQueue.start(observation) { players: [Player] in + // in an unspecified queue + print("fresh players: \(players)") + } + // <- here "fresh players" is already printed. + ``` + - **`isReadOnly`** The default is true. When false, a ValueObservation has a write access to the database when it fetches fresh values: diff --git a/Tests/GRDBTests/ValueObservationSchedulingTests.swift b/Tests/GRDBTests/ValueObservationSchedulingTests.swift index 63918b3d6..eaa5e7bb9 100644 --- a/Tests/GRDBTests/ValueObservationSchedulingTests.swift +++ b/Tests/GRDBTests/ValueObservationSchedulingTests.swift @@ -236,4 +236,96 @@ class ValueObservationSchedulingTests: GRDBTestCase { waitForExpectations(timeout: 1, handler: nil) XCTAssertEqual(errorCount, 1) } + + func testUnsafeStartImmediately() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { + try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! + }) + observation.extent = .databaseLifetime + observation.scheduling = .unsafe(startImmediately: true) + + _ = try dbQueue.start(observation) { count in + counts.append(count) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [0, 1]) + } + + func testUnsafeDontStartImmediately() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 1 + + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { + try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! + }) + observation.extent = .databaseLifetime + observation.scheduling = .unsafe(startImmediately: false) + + _ = try dbQueue.start(observation) { count in + counts.append(count) + notificationExpectation.fulfill() + } + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [1]) + } + + func testUnsafeError() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var errorCount = 0 + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 1 + + struct TestError: Error { } + let reducer = AnyValueReducer( + fetch: { _ in throw TestError() }, + value: { $0 }) + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) + observation.extent = .databaseLifetime + observation.scheduling = .unsafe(startImmediately: false) + + _ = try dbQueue.start( + observation, + onError: { error in + errorCount += 1 + notificationExpectation.fulfill() + }, + onChange: { _ in fatalError() }) + + try dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(errorCount, 1) + } } From e5f43e341b6bedefd91d9890e81c308da65c4615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 18:23:38 +0100 Subject: [PATCH 060/109] ValueScheduling.unsafe guarantees that initial value is notified on the dispatch queue which starts the observation --- GRDB/Core/DatabaseSnapshot.swift | 18 +- GRDB/Core/DatabaseWriter.swift | 70 ++--- GRDB/Core/ValueObservation.swift | 19 +- README.md | 297 ++++++++++-------- .../ValueObservationSchedulingTests.swift | 52 ++- 5 files changed, 257 insertions(+), 199 deletions(-) diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index 62c990efa..5bf1424aa 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -124,22 +124,18 @@ extension DatabaseSnapshot { } case let .onQueue(queue, startImmediately: startImmediately): if startImmediately { - try unsafeReentrantRead { db in - var reducer = observation.reducer - if let value = try reducer.value(reducer.fetch(db)) { - queue.async { - onChange(value) - } + var reducer = observation.reducer + if let value = try reducer.value(unsafeReentrantRead(reducer.fetch)) { + queue.async { + onChange(value) } } } case let .unsafe(startImmediately: startImmediately): if startImmediately { - try unsafeReentrantRead { db in - var reducer = observation.reducer - if let value = try reducer.value(reducer.fetch(db)) { - onChange(value) - } + var reducer = observation.reducer + if let value = try reducer.value(unsafeReentrantRead(reducer.fetch)) { + onChange(value) } } } diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 8cac59981..f14aa01f6 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -204,13 +204,11 @@ extension DatabaseWriter { onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver { - // mainQueueValue will be set and notified if calledOnMainQueue and - // operation.dispatch is .mainQueue let calledOnMainQueue = DispatchQueue.isMain - var mainQueueValue: Reducer.Value? = nil + var startValue: Reducer.Value? = nil defer { - if let mainQueueValue = mainQueueValue { - onChange(mainQueueValue) + if let startValue = startValue { + onChange(startValue) } } @@ -224,60 +222,25 @@ extension DatabaseWriter { var reducer = observation.reducer switch observation.scheduling { case .mainQueue: - // fetch - var fetchedValue: Reducer.Fetched! - if observation.isReadOnly { - fetchedValue = try db.readOnly { try reducer.fetch(db) } - } else { - try db.inSavepoint { - fetchedValue = try reducer.fetch(db) - return .commit - } - } - // reduce & notify - if let value = reducer.value(fetchedValue) { + if let value = try reducer.value(observation.fetch(db)) { if calledOnMainQueue { - mainQueueValue = value + startValue = value } else { DispatchQueue.main.async { onChange(value) } } } case let .onQueue(queue, startImmediately: startImmediately): if startImmediately { - // fetch - var fetchedValue: Reducer.Fetched! - if observation.isReadOnly { - fetchedValue = try db.readOnly { try reducer.fetch(db) } - } else { - try db.inSavepoint { - fetchedValue = try reducer.fetch(db) - return .commit - } - } - // reduce & notify - if let value = reducer.value(fetchedValue) { + if let value = try reducer.value(observation.fetch(db)) { queue.async { onChange(value) } } } case let .unsafe(startImmediately: startImmediately): if startImmediately { - // fetch - var fetchedValue: Reducer.Fetched! - if observation.isReadOnly { - fetchedValue = try db.readOnly { try reducer.fetch(db) } - } else { - try db.inSavepoint { - fetchedValue = try reducer.fetch(db) - return .commit - } - } - // reduce & notify - if let value = reducer.value(fetchedValue) { - onChange(value) - } + startValue = try reducer.value(observation.fetch(db)) } } - + // Start observing the database // The technique to fetch a fresh value after database has changed // depends on the observation.readonly flag: @@ -314,6 +277,23 @@ extension DatabaseWriter { } } +extension ValueObservation where Reducer: ValueReducer { + /// Helper method for DatabaseWriter.start(_:onError:onChange:) + fileprivate func fetch(_ db: Database) throws -> Reducer.Fetched { + if isReadOnly { + return try db.readOnly { try reducer.fetch(db) } + } else { + var fetchedValue: Reducer.Fetched! + try db.inSavepoint { + fetchedValue = try reducer.fetch(db) + return .commit + } + return fetchedValue + } + } +} + + /// Support for ValueObservation. /// See DatabaseWriter.start(_:onError:onChange:) private class ValueObserver: TransactionObserver { diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 58c926079..7a369e048 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -52,11 +52,11 @@ public enum ValueScheduling { /// is true. case onQueue(DispatchQueue, startImmediately: Bool) - /// Each value is notified on an unspecified dispatch queue, which may be - /// different for each notified value. + /// Values are not all notified on the same dispatch queue. /// /// If `startImmediately` is true, an initial value is notified right upon - /// subscription, synchronously. + /// subscription, synchronously, on the dispatch queue which starts + /// the observation. /// /// // On any queue /// var observation = ValueObservation.trackingAll(Player.all()) @@ -65,6 +65,9 @@ public enum ValueScheduling { /// print("fresh players: \(players)") /// } /// // <- here "fresh players" is already printed. + /// + /// When the database changes, other values are notified on + /// unspecified queues. case unsafe(startImmediately: Bool) } @@ -348,11 +351,12 @@ public struct ValueObservation { /// An initial value is fetched and notified if `startImmediately` /// is true. /// - /// - `unsafe(startImmediately:)`: each value is notified on an unspecified - /// dispatch queue, which may be different for each notified value. + /// - `unsafe(startImmediately:)`: values are not all notified on the same + /// dispatch queue. /// /// If `startImmediately` is true, an initial value is notified right - /// upon subscription, synchronously. + /// upon subscription, synchronously, on the dispatch queue which starts + /// the observation. /// /// // On any queue /// var observation = ValueObservation.trackingAll(Player.all()) @@ -361,6 +365,9 @@ public struct ValueObservation { /// print("fresh players: \(players)") /// } /// // <- here "fresh players" is already printed. + /// + /// When the database changes, other values are notified on + /// unspecified queues. public var scheduling: ValueScheduling = .mainQueue /// The dispatch queue where change callbacks are called. diff --git a/README.md b/README.md index d8d04ba59..c0fe3bd12 100644 --- a/README.md +++ b/README.md @@ -6258,8 +6258,13 @@ An initial fetch is performed as soon as the observation starts: the view is set The view controller stores the observer returned by the `start` method in a property. This allows the view controller to control the duration of the observation. When the observed is deallocated, the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. +- [ValueObservation.trackingCount, trackingOne, trackingAll](#valueobservationtrackingcount-trackingone-trackingall) +- [ValueObservation.tracking(_:fetch:)](#valueobservationtracking_fetch) +- [ValueObservation.tracking(_:reducer:)](#valueobservationtracking_reducer) +- [ValueObservation Options](#valueobservation-options) -### `ValueObservation.trackingCount`, `trackingOne`, `trackingAll` + +### ValueObservation.trackingCount, trackingOne, trackingAll Given a [request](#requests), you can track its number of results, the first one, or all of them: @@ -6273,50 +6278,51 @@ ValueObservation.trackingOne(withUniquing: request) ValueObservation.trackingAll(withUniquing: request) ``` -The `trackingCount` observation notifies counts: +Those observations match the `fetchCount`, `fetchOne`, and `fetchAll` request methods: -```swift -// Observe number of players -let observation = ValueObservation.trackingCount(Player.all()) -let observer = try dbQueue.start(observation) { count: Int in - print("Number of players have changed: \(count)") -} -``` +- `trackingCount` notifies counts: -The `trackingOne` observation notifies optional values, built from a single database row (if any): + ```swift + // Observe number of players + let observation = ValueObservation.trackingCount(Player.all()) + let observer = try dbQueue.start(observation) { count: Int in + print("Number of players have changed: \(count)") + } + ``` -```swift -// Observe a single player -let observation = ValueObservation.trackingOne(Player.filter(key: 1)) -let observer = try dbQueue.start(observation) { player: Player? in - print("Player has changed: \(player)") -} +- `trackingOne` notifies optional values, built from a single database row (if any): -// Observe the maximum score -let request = Player.select(max(Column("score")), as: Int.self) -let observation = ValueObservation.trackingOne(request) -let observer = try dbQueue.start(observation) { maximumScore: Int? in - print("Maximum score has changed: \(maximumScore)") -} -``` + ```swift + // Observe a single player + let observation = ValueObservation.trackingOne(Player.filter(key: 1)) + let observer = try dbQueue.start(observation) { player: Player? in + print("Player has changed: \(player)") + } + // Observe the maximum score + let request = Player.select(max(Column("score")), as: Int.self) + let observation = ValueObservation.trackingOne(request) + let observer = try dbQueue.start(observation) { maximumScore: Int? in + print("Maximum score has changed: \(maximumScore)") + } + ``` -The `trackingAll` observation notifies arrays: +- `trackingAll` notifies arrays: -```swift -// Observe all players -let observation = ValueObservation.trackingAll(Player.all()) -let observer = try dbQueue.start(observation) { players: [Player] in - print("Players have changed: \(players)") -} + ```swift + // Observe all players + let observation = ValueObservation.trackingAll(Player.all()) + let observer = try dbQueue.start(observation) { players: [Player] in + print("Players have changed: \(players)") + } -// Observe all player names -let request = SQLRequest("SELECT name FROM player") -let observation = ValueObservation.trackingAll(request) -let observer = try dbQueue.start(observation) { names: [String] in - print("Players names have changed: \(names)") -} -``` + // Observe all player names + let request = SQLRequest("SELECT name FROM player") + let observation = ValueObservation.trackingAll(request) + let observer = try dbQueue.start(observation) { names: [String] in + print("Players names have changed: \(names)") + } + ``` Beware that by default, a ValueObservation notifies *potential* changes, not *actual* changes in the results of a request. A change is notified if and only if a statement has actually modified the tracked tables and columns by inserting, updating, or deleting a row. @@ -6334,7 +6340,7 @@ let observer = try dbQueue.start(observation) { maximumScore: Int? in ``` -### `ValueObservation.tracking(_:fetch:)` +### ValueObservation.tracking(_:fetch:) Sometimes you need to observe several requests at the same time. For example, you need to observe changes in both a team and its players. @@ -6428,9 +6434,9 @@ let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in See [DatabaseRegion](#databaseregion) for more information. -### `ValueObservation.tracking(_:reducer:)` +### ValueObservation.tracking(_:reducer:) -The most general way to define a ValueObservation is to create one from an observed database region (see above), and a **reducer** that adopts the ValueReducer protocol: +The most general way to define a ValueObservation is to create one from an observed database region (see above), and a **reducer** that adopts the **ValueReducer** protocol: ```swift protocol ValueReducer { @@ -6468,113 +6474,136 @@ let observer = try dbQueue.start(observation) { count: Int in ### ValueObservation Options -- **`extent`** +Some behaviors of value observations can be configured: + +- [ValueObservation.extent](#valueobservationextent): fine-grained control of the observation duration +- [ValueObservation.scheduling](#valueobservationscheduling): control the dispatching of notified values +- [ValueObservation.isReadOnly](#valueobservationisreadonly): allow observations to write in the database + + +#### ValueObservation.extent + +The `extent` property lets you specify the duration of the observation. See [Observation Extent](#observation-extent) for more details: + +```swift +// This observation lasts until the database connection is closed +var observation = ValueObservation... +observation.extent = .databaseLifetime +_ = dbQueue.start(observation) { newValue in ... } +``` + +The default extent is `.observerLifetime`: the observation stops when the observer returned by `start` is deallocated. + +Regardless of the extent of an observation, you can always stop observation with the `remove(transactionObserver:)` method: + +```swift +// Start +let observer = dbQueue.start(observation) { ... } + +// Stop +dbQueue.remove(transactionObserver: observer) +``` + + +#### ValueObservation.scheduling - The `extent` property lets you specify the duration of the observation. See [Observation Extent](#observation-extent) for more details: +The `scheduling` property lets you control how fresh values are notified: + +- `.mainQueue` (the default): all values are notified on the main queue. + + If the observation starts on the main queue, an initial value is notified right upon subscription, synchronously: ```swift - // This observation lasts until the database connection is closed - var observation = ValueObservation... - observation.extent = .databaseLifetime - _ = dbQueue.start(observation) { newValue in ... } + // On main queue + let observation = ValueObservation.trackingAll(Player.all()) + let observer = try dbQueue.start(observation) { players: [Player] in + print("fresh players: \(players)") + } + // <- here "fresh players" is already printed. ``` - The default extent is `.observerLifetime`: the observation stops when the observer returned by `start` is deallocated. - - Regardless of the extent of an observation, you can always stop observation with the `remove(transactionObserver:)` method: + If the observation does not start on the main queue, an initial value is also notified on the main queue, but asynchronously: ```swift - // Start - let observer = dbQueue.start(observation) { ... } - - // Stop - dbQueue.remove(transactionObserver: observer) + // Not on the main queue: "fresh players" is eventually printed + // on the main queue. + let observation = ValueObservation.trackingAll(Player.all()) + let observer = try dbQueue.start(observation) { players: [Player] in + print("fresh players: \(players)") + } ``` - -- **`scheduling`** - The `scheduling` property lets you control how fresh values are notified: - - - `.mainQueue` (the default): all values are notified on the main queue. - - If the observation starts on the main queue, an initial value is notified right upon subscription, synchronously: - - ```swift - // On main queue - let observation = ValueObservation.trackingAll(Player.all()) - let observer = try dbQueue.start(observation) { players: [Player] in - print("fresh players: \(players)") - } - // <- here "fresh players" is already printed. - ``` - - If the observation does not start on the main queue, an initial value is also notified on the main queue, but asynchronously: - - ```swift - // Not on the main queue: "fresh players" is eventually printed - // on the main queue. - let observation = ValueObservation.trackingAll(Player.all()) - let observer = try dbQueue.start(observation) { players: [Player] in - print("fresh players: \(players)") - } - ``` - - When the database changes, fresh values are asynchronously notified: - - ```swift - // Eventually prints "fresh players" on the main queue - try dbQueue.write { db in - try Player(...).insert(db) - } - ``` - - - `.onQueue(_:startImmediately:)`: all values are asychronously notified on the specified queue. - - An initial value is fetched and notified if `startImmediately` is true. - - ```swift - let customQueue = DispatchQueue(label: "customQueue") - var observation = ValueObservation.trackingAll(Player.all()) - observation.scheduling = .onQueue(customQueue, startImmediately: true) - let observer = try dbQueue.start(observation) { players: [Player] in - // in customQueue - print("fresh players: \(players)")s - } - ``` - - - `unsafe(startImmediately:)`: each value is notified on an unspecified dispatch queue, which may be different for each notified value. - - If `startImmediately` is true, an initial value is notified right upon subscription, synchronously. - - ```swift - // On any queue - var observation = ValueObservation.trackingAll(Player.all()) - observation.scheduling = .unsafe(startImmediately: true) - let observer = try dbQueue.start(observation) { players: [Player] in - // in an unspecified queue - print("fresh players: \(players)") - } - // <- here "fresh players" is already printed. - ``` - -- **`isReadOnly`** - - The default is true. When false, a ValueObservation has a write access to the database when it fetches fresh values: + When the database changes, fresh values are asynchronously notified: ```swift - let observation = ValueObservation.tracking( - teamRequest, playersRequest, - fetch { db in - // write access allowed - }) - observation.isReadOnly = false + // Eventually prints "fresh players" on the main queue + try dbQueue.write { db in + try Player(...).insert(db) + } + ``` + +- `.onQueue(_:startImmediately:)`: all values are asychronously notified on the specified queue. + + An initial value is fetched and notified if `startImmediately` is true. + + ```swift + let customQueue = DispatchQueue(label: "customQueue") + var observation = ValueObservation.trackingAll(Player.all()) + observation.scheduling = .onQueue(customQueue, startImmediately: true) + let observer = try dbQueue.start(observation) { players: [Player] in + // in customQueue + print("fresh players: \(players)")s + } + ``` + +- `unsafe(startImmediately:)`: each value is notified on an unspecified dispatch queue, which may be different for each notified value. + + If `startImmediately` is true, an initial value is notified right upon subscription, synchronously. + + ```swift + // On any queue + var observation = ValueObservation.trackingAll(Player.all()) + observation.scheduling = .unsafe(startImmediately: true) + let observer = try dbQueue.start(observation) { players: [Player] in + // in an unspecified queue + print("fresh players: \(players)") + } + // <- here "fresh players" is already printed. + ``` + +- `unsafe(startImmediately:)`: values are not all notified on the same dispatch queue. + + If `startImmediately` is true, an initial value is notified right upon subscription, synchronously, on the dispatch queue which starts the observation. + + ```swift + // On any queue + var observation = ValueObservation.trackingAll(Player.all()) + observation.scheduling = .unsafe(startImmediately: true) + let observer = try dbQueue.start(observation) { players: [Player] in + print("fresh players: \(players)") + } + // <- here "fresh players" is already printed. ``` - The `fetch` closure is executed inside a [savepoint](#transactions-and-savepoints). - - Don't use this flag unless you actually need it: when you use a [database pool](#database-pools), observations with write access are less efficient. - - See [RxSwiftCommunity/RxGRDB/issues/42](https://github.com/RxSwiftCommunity/RxGRDB/issues/42) for an example use case. The `isReadOnly` flag exists in order to address this feature request. + When the database changes, other values are notified on unspecified queues. + + +#### ValueObservation.isReadOnly + +The `isReadOnly` property is true by default. When false, a ValueObservation has a write access to the database when it fetches fresh values: + +```swift +var observation = ValueObservation.tracking(..., fetch: { db in + // write access allowed +}) +observation.isReadOnly = false +``` + +The `fetch` closure is executed inside a [savepoint](#transactions-and-savepoints). + +Don't use this flag unless you actually need it: when you use a [database pool](#database-pools), observations with write access are less efficient. + +See [RxSwiftCommunity/RxGRDB/issues/42](https://github.com/RxSwiftCommunity/RxGRDB/issues/42) for an example use case. The `isReadOnly` flag exists in order to address this feature request. ## FetchedRecordsController diff --git a/Tests/GRDBTests/ValueObservationSchedulingTests.swift b/Tests/GRDBTests/ValueObservationSchedulingTests.swift index eaa5e7bb9..bcb9a1855 100644 --- a/Tests/GRDBTests/ValueObservationSchedulingTests.swift +++ b/Tests/GRDBTests/ValueObservationSchedulingTests.swift @@ -39,7 +39,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { // .mainQueue scheduling: initial value MUST be synchronously // dispatched when observation is started from the main queue XCTAssertEqual(counts, [0]) - + try dbQueue.write { try $0.execute("INSERT INTO t DEFAULT VALUES") } @@ -219,7 +219,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .databaseLifetime observation.scheduling = .onQueue(queue, startImmediately: false) - + _ = try dbQueue.start( observation, onError: { error in @@ -237,7 +237,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { XCTAssertEqual(errorCount, 1) } - func testUnsafeStartImmediately() throws { + func testUnsafeStartImmediatelyFromMainQueue() throws { // We need something to change let dbQueue = try makeDatabaseQueue() try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } @@ -247,6 +247,9 @@ class ValueObservationSchedulingTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 2 + let key = DispatchSpecificKey<()>() + DispatchQueue.main.setSpecific(key: key, value: ()) + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) @@ -254,6 +257,10 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.scheduling = .unsafe(startImmediately: true) _ = try dbQueue.start(observation) { count in + if counts.isEmpty { + // require main queue on first element + XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) + } counts.append(count) notificationExpectation.fulfill() } @@ -266,6 +273,45 @@ class ValueObservationSchedulingTests: GRDBTestCase { XCTAssertEqual(counts, [0, 1]) } + func testUnsafeStartImmediatelyFromCustomQueue() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [Int] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + let queue = DispatchQueue(label: "") + let key = DispatchSpecificKey<()>() + queue.setSpecific(key: key, value: ()) + + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { + try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! + }) + observation.extent = .databaseLifetime + observation.scheduling = .unsafe(startImmediately: true) + + queue.async { + _ = try! dbQueue.start(observation) { count in + if counts.isEmpty { + // require custom queue on first notification + XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) + } + counts.append(count) + notificationExpectation.fulfill() + } + + try! dbQueue.write { + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, [0, 1]) + } + func testUnsafeDontStartImmediately() throws { // We need something to change let dbQueue = try makeDatabaseQueue() From 4e40d755f492c4e8824045a7949015aa7b97aa37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 18:26:27 +0100 Subject: [PATCH 061/109] Documentation --- README.md | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/README.md b/README.md index c0fe3bd12..62bbeca21 100644 --- a/README.md +++ b/README.md @@ -6556,21 +6556,6 @@ The `scheduling` property lets you control how fresh values are notified: } ``` -- `unsafe(startImmediately:)`: each value is notified on an unspecified dispatch queue, which may be different for each notified value. - - If `startImmediately` is true, an initial value is notified right upon subscription, synchronously. - - ```swift - // On any queue - var observation = ValueObservation.trackingAll(Player.all()) - observation.scheduling = .unsafe(startImmediately: true) - let observer = try dbQueue.start(observation) { players: [Player] in - // in an unspecified queue - print("fresh players: \(players)") - } - // <- here "fresh players" is already printed. - ``` - - `unsafe(startImmediately:)`: values are not all notified on the same dispatch queue. If `startImmediately` is true, an initial value is notified right upon subscription, synchronously, on the dispatch queue which starts the observation. From 735394669dc186bcbcebcf570d6cbf365da8c642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 18:28:10 +0100 Subject: [PATCH 062/109] Documentation --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 62bbeca21..514ffa7e3 100644 --- a/README.md +++ b/README.md @@ -6517,6 +6517,7 @@ The `scheduling` property lets you control how fresh values are notified: // On main queue let observation = ValueObservation.trackingAll(Player.all()) let observer = try dbQueue.start(observation) { players: [Player] in + // On main queue print("fresh players: \(players)") } // <- here "fresh players" is already printed. @@ -6525,10 +6526,10 @@ The `scheduling` property lets you control how fresh values are notified: If the observation does not start on the main queue, an initial value is also notified on the main queue, but asynchronously: ```swift - // Not on the main queue: "fresh players" is eventually printed - // on the main queue. + // Not on the main queue let observation = ValueObservation.trackingAll(Player.all()) let observer = try dbQueue.start(observation) { players: [Player] in + // On main queue print("fresh players: \(players)") } ``` @@ -6551,7 +6552,7 @@ The `scheduling` property lets you control how fresh values are notified: var observation = ValueObservation.trackingAll(Player.all()) observation.scheduling = .onQueue(customQueue, startImmediately: true) let observer = try dbQueue.start(observation) { players: [Player] in - // in customQueue + // On customQueue print("fresh players: \(players)")s } ``` From 10650704b53307b197cd38b7c23aaf27e67a6da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 18:32:54 +0100 Subject: [PATCH 063/109] Documentation (todo: document error handling) --- README.md | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 514ffa7e3..aaada137e 100644 --- a/README.md +++ b/README.md @@ -6212,25 +6212,15 @@ class PlayerViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - // 1. Define a tracked request + // Define a ValueObservation that tracks a request let request = Player.filter(key: 42) - - // 2. Create a ValueObservation let observation = ValueObservation.trackingOne(request) - do { - // 3. Start observing the database, and store the returned observer - // in a property - playerObserver = try dbQueue.start( - observation, - onError: { error in - print("fresh values could not be fetched") - }, - onChange: { [unowned self] player: Player? in - self.nameLabel.text = player?.name - }) - } catch { - print("Observation could not start") + // Start observing the database, and store the + // returned observer in a property + playerObserver = try! dbQueue.start(observation) { + [unowned self] player: Player? in + self.nameLabel.text = player?.name } } @@ -6243,16 +6233,7 @@ class PlayerViewController: UIViewController { } ``` -When you are not interested in eventual errors, drop the `onError` callback: - -```swift - playerObserver = try dbQueue.start(observation) { - [unowned self] player: Player? in - self.nameLabel.text = player?.name - } -``` - -All values are notified on the main queue: views can be updated right from the `onChange` callback. +All values are notified on the main queue: views can be updated right from the change callback. An initial fetch is performed as soon as the observation starts: the view is set up and ready when the `viewWillAppear` method returns. From 739c3250791d9da735a40511ef84385e4aa59d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 18:34:11 +0100 Subject: [PATCH 064/109] Documentation --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index aaada137e..a5df77eed 100644 --- a/README.md +++ b/README.md @@ -6207,7 +6207,7 @@ It is designed for easy consumption of fresh values by an application. For examp ```swift class PlayerViewController: UIViewController { @IBOutlet weak var nameLabel: UILabel! - private var playerObserver: TransactionObserver? + private var observer: TransactionObserver? override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) @@ -6216,10 +6216,8 @@ class PlayerViewController: UIViewController { let request = Player.filter(key: 42) let observation = ValueObservation.trackingOne(request) - // Start observing the database, and store the - // returned observer in a property - playerObserver = try! dbQueue.start(observation) { - [unowned self] player: Player? in + // Start observing the database + observer = try! dbQueue.start(observation) { [unowned self] player: Player? in self.nameLabel.text = player?.name } } @@ -6228,7 +6226,7 @@ class PlayerViewController: UIViewController { super.viewWillDisappear(animated) // Stop observing the database - playerObserver = nil + observer = nil } } ``` From 77de519fcc1ab3baf103d4278d990169c173f306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 18:40:12 +0100 Subject: [PATCH 065/109] More tests for read/write observations --- Tests/GRDBTests/ValueObservationReadonlyTests.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/GRDBTests/ValueObservationReadonlyTests.swift b/Tests/GRDBTests/ValueObservationReadonlyTests.swift index c51263c9c..efcdf903c 100644 --- a/Tests/GRDBTests/ValueObservationReadonlyTests.swift +++ b/Tests/GRDBTests/ValueObservationReadonlyTests.swift @@ -73,6 +73,7 @@ class ValueObservationReadonlyTests: GRDBTestCase { notificationExpectation.expectedFulfillmentCount = 2 var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetch: { db -> Int in + XCTAssert(db.isInsideTransaction, "expected a wrapping transaction") try db.execute("CREATE TEMPORARY TABLE temp AS SELECT * FROM t") let result = try Int.fetchOne(db, "SELECT COUNT(*) FROM temp")! try db.execute("DROP TABLE temp") From 53f98a7bf6f0fcd8c2be73e89e3059ca7c60d7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 18:42:04 +0100 Subject: [PATCH 066/109] Documentation --- README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a5df77eed..af076d64d 100644 --- a/README.md +++ b/README.md @@ -6338,7 +6338,7 @@ struct TeamInfo { let observation = ValueObservation.tracking( teamRequest, playersRequest, - fetch { db -> TeamInfo? in + fetch: { db -> TeamInfo? in guard let team = try teamRequest.fetchOne(db) else { return nil } @@ -6358,12 +6358,8 @@ extension TeamInfo: Equatable { ... } let observation = ValueObservation.tracking( withUniquing: teamRequest, playersRequest, - fetch { db -> TeamInfo? in - guard let team = try teamRequest.fetchOne(db) else { - return nil - } - let players = try playersRequest.fetchAll(db) - return TeamInfo(team: team, players: players) + fetch: { db -> TeamInfo? in + // same code as above }) let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in From f68b1cd2c356f77f0f3dd9d4abdf0f8d311afc40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 18:44:48 +0100 Subject: [PATCH 067/109] Documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af076d64d..c8afb13ea 100644 --- a/README.md +++ b/README.md @@ -6357,7 +6357,7 @@ You can avoid notification of consecutive identical values with the `withUniquin extension TeamInfo: Equatable { ... } let observation = ValueObservation.tracking( - withUniquing: teamRequest, playersRequest, + withUniquing: teamRequest, playersRequest, // <- uniquing is here fetch: { db -> TeamInfo? in // same code as above }) From 6f86cbf0c43026c1bec25bb8f95707d19fe1d560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 18:48:16 +0100 Subject: [PATCH 068/109] Documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c8afb13ea..966c00511 100644 --- a/README.md +++ b/README.md @@ -6299,7 +6299,7 @@ Those observations match the `fetchCount`, `fetchOne`, and `fetchAll` request me let request = SQLRequest("SELECT name FROM player") let observation = ValueObservation.trackingAll(request) let observer = try dbQueue.start(observation) { names: [String] in - print("Players names have changed: \(names)") + print("Player names have changed: \(names)") } ``` From b4b824c3606e1798683ad7d62ea58b49b6808683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 19:31:04 +0100 Subject: [PATCH 069/109] dbQueue.start(observation) -> observation.start(in: dbQueue) --- GRDB/Core/DatabaseReader.swift | 23 ++++-- GRDB/Core/DatabaseSnapshot.swift | 8 +- GRDB/Core/DatabaseWriter.swift | 10 +-- GRDB/Core/ValueObservation.swift | 74 ++++++++++++------- README.md | 34 ++++----- .../ValueObservationCountTests.swift | 4 +- ...rvationDatabaseValueConvertibleTests.swift | 12 +-- .../ValueObservationExtentTests.swift | 6 +- .../ValueObservationFetchTests.swift | 4 +- .../ValueObservationReadonlyTests.swift | 12 +-- .../ValueObservationRecordTests.swift | 8 +- .../ValueObservationReducerTests.swift | 14 ++-- .../GRDBTests/ValueObservationRowTests.swift | 8 +- .../ValueObservationSchedulingTests.swift | 26 +++---- ...ationStatementColumnConvertibleTests.swift | 6 +- 15 files changed, 138 insertions(+), 111 deletions(-) diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index 59282d78a..ee4ddd702 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -152,9 +152,18 @@ public protocol DatabaseReader : class { // MARK: - Value Observation - /// TODO - func start( - _ observation: ValueObservation, + /// Starts a value observation. + /// + /// You should use the `ValueObservation.start(in:onError:onChange:)` + /// method instead. + /// + /// - parameter observation: the stared observation + /// - parameter onError: a closure that is provided by eventual errors that happen + /// during observation + /// - parameter onChange: a closure that is provided fresh values + /// - returns: a TransactionObserver + func add( + observation: ValueObservation, onError: ((Error) -> Void)?, onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver @@ -244,13 +253,13 @@ public final class AnyDatabaseReader : DatabaseReader { // MARK: - Value Observation /// :nodoc: - public func start( - _ observation: ValueObservation, - onError: ((Error) -> Void)? = nil, + public func add( + observation: ValueObservation, + onError: ((Error) -> Void)?, onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver { - return try base.start(observation, onError: onError, onChange: onChange) + return try base.add(observation: observation, onError: onError, onChange: onChange) } /// :nodoc: diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index 5bf1424aa..30f60bef2 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -103,9 +103,9 @@ extension DatabaseSnapshot { // MARK: - Value Observation - public func start( - _ observation: ValueObservation, - onError: ((Error) -> Void)? = nil, + public func add( + observation: ValueObservation, + onError: ((Error) -> Void)?, onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver { @@ -150,7 +150,7 @@ extension DatabaseSnapshot { } /// An observer that does nothing, support for -/// `DatabaseSnapshot.start(_:onError:onChange:)`. +/// `DatabaseSnapshot.add(observation:onError:onChange:)`. private class SnapshotValueObserver: TransactionObserver { func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool { return false } func databaseDidChange(with event: DatabaseEvent) { } diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index f14aa01f6..315d30a0f 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -198,9 +198,9 @@ extension DatabaseWriter { // MARK: - Value Observation - public func start( - _ observation: ValueObservation, - onError: ((Error) -> Void)? = nil, + public func add( + observation: ValueObservation, + onError: ((Error) -> Void)?, onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver { @@ -278,7 +278,7 @@ extension DatabaseWriter { } extension ValueObservation where Reducer: ValueReducer { - /// Helper method for DatabaseWriter.start(_:onError:onChange:) + /// Helper method for DatabaseWriter.add(observation:onError:onChange:) fileprivate func fetch(_ db: Database) throws -> Reducer.Fetched { if isReadOnly { return try db.readOnly { try reducer.fetch(db) } @@ -295,7 +295,7 @@ extension ValueObservation where Reducer: ValueReducer { /// Support for ValueObservation. -/// See DatabaseWriter.start(_:onError:onChange:) +/// See DatabaseWriter.add(observation:onError:onChange:) private class ValueObserver: TransactionObserver { private let region: DatabaseRegion private var reducer: Reducer diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 7a369e048..6b7d8e678 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -22,7 +22,7 @@ public enum ValueScheduling { /// /// // On main queue /// let observation = ValueObservation.trackingAll(Player.all()) - /// let observer = try dbQueue.start(observation) { players: [Player] in + /// let observer = try observation.start(in: dbQueue) { players: [Player] in /// print("fresh players: \(players)") /// } /// // <- here "fresh players" is already printed. @@ -33,7 +33,7 @@ public enum ValueScheduling { /// // Not on the main queue: "fresh players" is eventually printed /// // on the main queue. /// let observation = ValueObservation.trackingAll(Player.all()) - /// let observer = try dbQueue.start(observation) { players: [Player] in + /// let observer = try observation.start(in: dbQueue) { players: [Player] in /// print("fresh players: \(players)") /// } /// @@ -61,7 +61,7 @@ public enum ValueScheduling { /// // On any queue /// var observation = ValueObservation.trackingAll(Player.all()) /// observation.scheduling = .unsafe(startImmediately: true) - /// let observer = try dbQueue.start(observation) { players: [Player] in + /// let observer = try observation.start(in: dbQueue) { players: [Player] in /// print("fresh players: \(players)") /// } /// // <- here "fresh players" is already printed. @@ -323,7 +323,7 @@ public struct ValueObservation { /// /// // On main queue /// let observation = ValueObservation.trackingAll(Player.all()) - /// let observer = try dbQueue.start(observation) { players: [Player] in + /// let observer = try observation.start(in: dbQueue) { players: [Player] in /// print("fresh players: \(players)") /// } /// // <- here "fresh players" is already printed. @@ -334,7 +334,7 @@ public struct ValueObservation { /// // Not on the main queue: "fresh players" is eventually printed /// // on the main queue. /// let observation = ValueObservation.trackingAll(Player.all()) - /// let observer = try dbQueue.start(observation) { players: [Player] in + /// let observer = try observation.start(in: dbQueue) { players: [Player] in /// print("fresh players: \(players)") /// } /// @@ -361,7 +361,7 @@ public struct ValueObservation { /// // On any queue /// var observation = ValueObservation.trackingAll(Player.all()) /// observation.scheduling = .unsafe(startImmediately: true) - /// let observer = try dbQueue.start(observation) { players: [Player] in + /// let observer = try observation.start(in: dbQueue) { players: [Player] in /// print("fresh players: \(players)") /// } /// // <- here "fresh players" is already printed. @@ -406,7 +406,7 @@ public struct ValueObservation { /// tracking: Player.all(), /// reducer: reducer) /// - /// let observer = try dbQueue.start(observation) { player: [Player] in + /// let observer = try observation.start(in: dbQueue) { player: [Player] in /// print("players have changed") /// } /// @@ -433,6 +433,24 @@ public struct ValueObservation { } } +extension ValueObservation where Reducer: ValueReducer { + /// Starts the value observation in the provided database reader (such as + /// a database queue or database pool). + /// + /// - parameter observation: the stared observation + /// - parameter onError: a closure that is provided by eventual errors that happen + /// during observation + /// - parameter onChange: a closure that is provided fresh values + /// - returns: a TransactionObserver + public func start( + in reader: DatabaseReader, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver + { + return try reader.add(observation: self, onError: onError, onChange: onChange) + } +} + extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *regions*, and notifies the /// values returned by the *fetch* closure whenever one of the observed @@ -444,7 +462,7 @@ extension ValueObservation where Reducer == Void { /// Player.all(), /// fetch: { db in return try Player.fetchAll(db) }) /// - /// let observer = try dbQueue.start(observation) { player: [Player] in + /// let observer = try observation.start(in: dbQueue) { player: [Player] in /// print("players have changed") /// } /// @@ -482,7 +500,7 @@ extension ValueObservation where Reducer == Void { /// withUniquing: Player.all(), /// fetch: { db in return try Player.fetchAll(db) }) /// - /// let observer = try dbQueue.start(observation) { player: [Player] in + /// let observer = try observation.start(in: dbQueue) { player: [Player] in /// print("players have changed") /// } /// @@ -532,7 +550,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.trackingCount(request) /// - /// let observer = try dbQueue.start(observation) { count: Int in + /// let observer = try observation.start(in: dbQueue) { count: Int in /// print("number of players has changed") /// } /// @@ -566,7 +584,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.trackingCount(withUniquing: request) /// - /// let observer = try dbQueue.start(observation) { count: Int in + /// let observer = try observation.start(in: dbQueue) { count: Int in /// print("number of players has changed") /// } /// @@ -604,7 +622,7 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player") /// let observation = ValueObservation.trackingAll(request) /// - /// let observer = try dbQueue.start(observation) { rows: [Row] in + /// let observer = try observation.start(in: dbQueue) { rows: [Row] in /// print("players have changed") /// } /// @@ -639,7 +657,7 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player") /// let observation = ValueObservation.trackingAll(withUniquing: request) /// - /// let observer = try dbQueue.start(observation) { rows: [Row] in + /// let observer = try observation.start(in: dbQueue) { rows: [Row] in /// print("players have changed") /// } /// @@ -674,7 +692,7 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) /// let observation = ValueObservation.trackingOne(request) /// - /// let observer = try dbQueue.start(observation) { row: Row? in + /// let observer = try observation.start(in: dbQueue) { row: Row? in /// print("players have changed") /// } /// @@ -709,7 +727,7 @@ extension ValueObservation where Reducer == Void { /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) /// let observation = ValueObservation.trackingOne(withUniquing: request) /// - /// let observer = try dbQueue.start(observation) { row: Row? in + /// let observer = try observation.start(in: dbQueue) { row: Row? in /// print("players have changed") /// } /// @@ -749,7 +767,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.trackingAll(request) /// - /// let observer = try dbQueue.start(observation) { players: [Player] in + /// let observer = try observation.start(in: dbQueue) { players: [Player] in /// print("players have changed") /// } /// @@ -785,7 +803,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.all() /// let observation = ValueObservation.trackingAll(withUniquing: request) /// - /// let observer = try dbQueue.start(observation) { players: [Player] in + /// let observer = try observation.start(in: dbQueue) { players: [Player] in /// print("players have changed") /// } /// @@ -820,7 +838,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.filter(key: 1) /// let observation = ValueObservation.trackingOne(request) /// - /// let observer = try dbQueue.start(observation) { player: Player? in + /// let observer = try observation.start(in: dbQueue) { player: Player? in /// print("player has changed") /// } /// @@ -855,7 +873,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.filter(key: 1) /// let observation = ValueObservation.trackingOne(withUniquing: request) /// - /// let observer = try dbQueue.start(observation) { player: Player? in + /// let observer = try observation.start(in: dbQueue) { player: Player? in /// print("player has changed") /// } /// @@ -895,7 +913,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.trackingAll(request) /// - /// let observer = try dbQueue.start(observation) { names: [String] in + /// let observer = try observation.start(in: dbQueue) { names: [String] in /// print("player name have changed") /// } /// @@ -931,7 +949,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.trackingAll(withUniquing: request) /// - /// let observer = try dbQueue.start(observation) { names: [String] in + /// let observer = try observation.start(in: dbQueue) { names: [String] in /// print("player name have changed") /// } /// @@ -966,7 +984,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(max(Column("score")), as: Int.self) /// let observation = ValueObservation.trackingOne(request) /// - /// let observer = try dbQueue.start(observation) { maxScore: Int? in + /// let observer = try observation.start(in: dbQueue) { maxScore: Int? in /// print("maximum score has changed") /// } /// @@ -1001,7 +1019,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(max(Column("score")), as: Int.self) /// let observation = ValueObservation.trackingOne(withUniquing: request) /// - /// let observer = try dbQueue.start(observation) { maxScore: Int? in + /// let observer = try observation.start(in: dbQueue) { maxScore: Int? in /// print("maximum score has changed") /// } /// @@ -1041,7 +1059,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.trackingAll(request) /// - /// let observer = try dbQueue.start(observation) { names: [String] in + /// let observer = try observation.start(in: dbQueue) { names: [String] in /// print("player name have changed") /// } /// @@ -1076,7 +1094,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(max(Column("score")), as: Int.self) /// let observation = ValueObservation.trackingOne(request) /// - /// let observer = try dbQueue.start(observation) { maxScore: Int? in + /// let observer = try observation.start(in: dbQueue) { maxScore: Int? in /// print("maximum score has changed") /// } /// @@ -1116,7 +1134,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.trackingAll(request) /// - /// let observer = try dbQueue.start(observation) { names: [String] in + /// let observer = try observation.start(in: dbQueue) { names: [String] in /// print("player name have changed") /// } /// @@ -1153,7 +1171,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.trackingAll(withUniquing: request) /// - /// let observer = try dbQueue.start(observation) { names: [String] in + /// let observer = try observation.start(in: dbQueue) { names: [String] in /// print("player name have changed") /// } /// @@ -1194,7 +1212,7 @@ extension ValueObservation where Reducer == Void { /// let request = Player.select(Column("name"), as: String.self) /// let observation = ValueObservation.trackingAll(request) /// - /// let observer = try dbQueue.start(observation) { names: [String] in + /// let observer = try observation.start(in: dbQueue) { names: [String] in /// print("player name have changed") /// } /// diff --git a/README.md b/README.md index 966c00511..4f6f40ca6 100644 --- a/README.md +++ b/README.md @@ -6217,7 +6217,7 @@ class PlayerViewController: UIViewController { let observation = ValueObservation.trackingOne(request) // Start observing the database - observer = try! dbQueue.start(observation) { [unowned self] player: Player? in + observer = try! observation.start(in: dbQueue) { [unowned self] player: Player? in self.nameLabel.text = player?.name } } @@ -6264,7 +6264,7 @@ Those observations match the `fetchCount`, `fetchOne`, and `fetchAll` request me ```swift // Observe number of players let observation = ValueObservation.trackingCount(Player.all()) - let observer = try dbQueue.start(observation) { count: Int in + let observer = try observation.start(in: dbQueue) { count: Int in print("Number of players have changed: \(count)") } ``` @@ -6274,14 +6274,14 @@ Those observations match the `fetchCount`, `fetchOne`, and `fetchAll` request me ```swift // Observe a single player let observation = ValueObservation.trackingOne(Player.filter(key: 1)) - let observer = try dbQueue.start(observation) { player: Player? in + let observer = try observation.start(in: dbQueue) { player: Player? in print("Player has changed: \(player)") } // Observe the maximum score let request = Player.select(max(Column("score")), as: Int.self) let observation = ValueObservation.trackingOne(request) - let observer = try dbQueue.start(observation) { maximumScore: Int? in + let observer = try observation.start(in: dbQueue) { maximumScore: Int? in print("Maximum score has changed: \(maximumScore)") } ``` @@ -6291,14 +6291,14 @@ Those observations match the `fetchCount`, `fetchOne`, and `fetchAll` request me ```swift // Observe all players let observation = ValueObservation.trackingAll(Player.all()) - let observer = try dbQueue.start(observation) { players: [Player] in + let observer = try observation.start(in: dbQueue) { players: [Player] in print("Players have changed: \(players)") } // Observe all player names let request = SQLRequest("SELECT name FROM player") let observation = ValueObservation.trackingAll(request) - let observer = try dbQueue.start(observation) { names: [String] in + let observer = try observation.start(in: dbQueue) { names: [String] in print("Player names have changed: \(names)") } ``` @@ -6313,7 +6313,7 @@ You can avoid notification of consecutive identical values with the `withUniquin // Observe the maximum score (with uniquing) let request = Player.select(max(Column("score")), as: Int.self) let observation = ValueObservation.trackingOne(withUniquing: request) -let observer = try dbQueue.start(observation) { maximumScore: Int? in +let observer = try observation.start(in: dbQueue) { maximumScore: Int? in print("Maximum score has (really) changed: \(maximumScore)") } ``` @@ -6346,7 +6346,7 @@ let observation = ValueObservation.tracking( return TeamInfo(team: team, players: players) }) -let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in +let observer = observation.start(in: dbQueue) { teamInfo: TeamInfo? in print("Team and players have changed.") } ``` @@ -6362,7 +6362,7 @@ let observation = ValueObservation.tracking( // same code as above }) -let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in +let observer = observation.start(in: dbQueue) { teamInfo: TeamInfo? in print("Team and players have (really) changed.") } ``` @@ -6401,7 +6401,7 @@ struct TeamInfoRequest: DatabaseRegionConvertible { let request = TeamInfoRequest(teamId: 1) let observation = ValueObservation.tracking(request, fetch: request.fetch) -let observer = dbQueue.start(observation) { teamInfo: TeamInfo? in +let observer = observation.start(in: dbQueue) { teamInfo: TeamInfo? in print("Team and players have hanged.") } ``` @@ -6441,7 +6441,7 @@ let reducer = AnyValueReducer( return count }) let observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) -let observer = try dbQueue.start(observation) { count: Int in +let observer = try observation.start(in: dbQueue) { count: Int in print("The database has been modified \(count) times.") } ``` @@ -6464,7 +6464,7 @@ The `extent` property lets you specify the duration of the observation. See [Obs // This observation lasts until the database connection is closed var observation = ValueObservation... observation.extent = .databaseLifetime -_ = dbQueue.start(observation) { newValue in ... } +_ = observation.start(in: dbQueue) { newValue in ... } ``` The default extent is `.observerLifetime`: the observation stops when the observer returned by `start` is deallocated. @@ -6473,7 +6473,7 @@ Regardless of the extent of an observation, you can always stop observation with ```swift // Start -let observer = dbQueue.start(observation) { ... } +let observer = observation.start(in: dbQueue) { ... } // Stop dbQueue.remove(transactionObserver: observer) @@ -6491,7 +6491,7 @@ The `scheduling` property lets you control how fresh values are notified: ```swift // On main queue let observation = ValueObservation.trackingAll(Player.all()) - let observer = try dbQueue.start(observation) { players: [Player] in + let observer = try observation.start(in: dbQueue) { players: [Player] in // On main queue print("fresh players: \(players)") } @@ -6503,7 +6503,7 @@ The `scheduling` property lets you control how fresh values are notified: ```swift // Not on the main queue let observation = ValueObservation.trackingAll(Player.all()) - let observer = try dbQueue.start(observation) { players: [Player] in + let observer = try observation.start(in: dbQueue) { players: [Player] in // On main queue print("fresh players: \(players)") } @@ -6526,7 +6526,7 @@ The `scheduling` property lets you control how fresh values are notified: let customQueue = DispatchQueue(label: "customQueue") var observation = ValueObservation.trackingAll(Player.all()) observation.scheduling = .onQueue(customQueue, startImmediately: true) - let observer = try dbQueue.start(observation) { players: [Player] in + let observer = try observation.start(in: dbQueue) { players: [Player] in // On customQueue print("fresh players: \(players)")s } @@ -6540,7 +6540,7 @@ The `scheduling` property lets you control how fresh values are notified: // On any queue var observation = ValueObservation.trackingAll(Player.all()) observation.scheduling = .unsafe(startImmediately: true) - let observer = try dbQueue.start(observation) { players: [Player] in + let observer = try observation.start(in: dbQueue) { players: [Player] in print("fresh players: \(players)") } // <- here "fresh players" is already printed. diff --git a/Tests/GRDBTests/ValueObservationCountTests.swift b/Tests/GRDBTests/ValueObservationCountTests.swift index b66e93a0c..3519d11e1 100644 --- a/Tests/GRDBTests/ValueObservationCountTests.swift +++ b/Tests/GRDBTests/ValueObservationCountTests.swift @@ -25,7 +25,7 @@ class ValueObservationCountTests: GRDBTestCase { struct T: TableRecord { } var observation = ValueObservation.trackingCount(T.all()) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in counts.append(count) notificationExpectation.fulfill() } @@ -56,7 +56,7 @@ class ValueObservationCountTests: GRDBTestCase { struct T: TableRecord { } var observation = ValueObservation.trackingCount(withUniquing: T.all()) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in counts.append(count) notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift b/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift index bb01848a9..70392ddbb 100644 --- a/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift +++ b/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift @@ -39,7 +39,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.trackingAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { names in + _ = try observation.start(in: dbQueue) { names in results.append(names) notificationExpectation.fulfill() } @@ -73,7 +73,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { names in + _ = try observation.start(in: dbQueue) { names in results.append(names) notificationExpectation.fulfill() } @@ -106,7 +106,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.trackingOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { name in + _ = try observation.start(in: dbQueue) { name in results.append(name) notificationExpectation.fulfill() } @@ -144,7 +144,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.trackingOne(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { name in + _ = try observation.start(in: dbQueue) { name in results.append(name) notificationExpectation.fulfill() } @@ -181,7 +181,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.trackingAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { names in + _ = try observation.start(in: dbQueue) { names in results.append(names) notificationExpectation.fulfill() } @@ -215,7 +215,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { names in + _ = try observation.start(in: dbQueue) { names in results.append(names) notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationExtentTests.swift b/Tests/GRDBTests/ValueObservationExtentTests.swift index fc86046d1..253507f6f 100644 --- a/Tests/GRDBTests/ValueObservationExtentTests.swift +++ b/Tests/GRDBTests/ValueObservationExtentTests.swift @@ -38,7 +38,7 @@ class ValueObservationExtentTests: GRDBTestCase { observation.extent = .databaseLifetime // Start observation - _ = try dbQueue.start(observation) { + _ = try observation.start(in: dbQueue) { notificationExpectation.fulfill() } @@ -77,7 +77,7 @@ class ValueObservationExtentTests: GRDBTestCase { // Start observation and deallocate observer after second change var observer: TransactionObserver? - observer = try dbQueue.start(observation) { + observer = try observation.start(in: dbQueue) { changesCount += 1 if changesCount == 2 { observer = nil @@ -122,7 +122,7 @@ class ValueObservationExtentTests: GRDBTestCase { observation.extent = .nextTransaction // Start observation - let observer = try dbQueue.start(observation) { + let observer = try observation.start(in: dbQueue) { notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationFetchTests.swift b/Tests/GRDBTests/ValueObservationFetchTests.swift index df5e4d4a7..21b6c40f9 100644 --- a/Tests/GRDBTests/ValueObservationFetchTests.swift +++ b/Tests/GRDBTests/ValueObservationFetchTests.swift @@ -26,7 +26,7 @@ class ValueObservationFetchTests: GRDBTestCase { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in counts.append(count) notificationExpectation.fulfill() } @@ -58,7 +58,7 @@ class ValueObservationFetchTests: GRDBTestCase { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in counts.append(count) notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationReadonlyTests.swift b/Tests/GRDBTests/ValueObservationReadonlyTests.swift index efcdf903c..65236df8e 100644 --- a/Tests/GRDBTests/ValueObservationReadonlyTests.swift +++ b/Tests/GRDBTests/ValueObservationReadonlyTests.swift @@ -27,7 +27,7 @@ class ValueObservationReadonlyTests: GRDBTestCase { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in counts.append(count) notificationExpectation.fulfill() } @@ -50,8 +50,8 @@ class ValueObservationReadonlyTests: GRDBTestCase { }) do { - _ = try dbQueue.start( - observation, + _ = try observation.start( + in: dbQueue, onError: { _ in fatalError() }, onChange: { _ in fatalError() }) XCTFail("Expected error") @@ -81,7 +81,7 @@ class ValueObservationReadonlyTests: GRDBTestCase { }) observation.extent = .databaseLifetime observation.isReadOnly = false - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in counts.append(count) notificationExpectation.fulfill() } @@ -108,8 +108,8 @@ class ValueObservationReadonlyTests: GRDBTestCase { observation.isReadOnly = false do { - _ = try dbQueue.start( - observation, + _ = try observation.start( + in: dbQueue, onError: { _ in fatalError() }, onChange: { _ in fatalError() }) XCTFail("Expected error") diff --git a/Tests/GRDBTests/ValueObservationRecordTests.swift b/Tests/GRDBTests/ValueObservationRecordTests.swift index fff2a3087..36fc96fb5 100644 --- a/Tests/GRDBTests/ValueObservationRecordTests.swift +++ b/Tests/GRDBTests/ValueObservationRecordTests.swift @@ -38,7 +38,7 @@ class ValueObservationRecordTests: GRDBTestCase { var observation = ValueObservation.trackingAll(SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { players in + _ = try observation.start(in: dbQueue) { players in results.append(players) notificationExpectation.fulfill() } @@ -72,7 +72,7 @@ class ValueObservationRecordTests: GRDBTestCase { var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { players in + _ = try observation.start(in: dbQueue) { players in results.append(players) notificationExpectation.fulfill() } @@ -105,7 +105,7 @@ class ValueObservationRecordTests: GRDBTestCase { var observation = ValueObservation.trackingOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { player in + _ = try observation.start(in: dbQueue) { player in results.append(player) notificationExpectation.fulfill() } @@ -143,7 +143,7 @@ class ValueObservationRecordTests: GRDBTestCase { var observation = ValueObservation.trackingOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { player in + _ = try observation.start(in: dbQueue) { player in results.append(player) notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift index c9bbe01e7..f66be5b2e 100644 --- a/Tests/GRDBTests/ValueObservationReducerTests.swift +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -52,8 +52,8 @@ class ValueObservationReducerTests: GRDBTestCase { observation.extent = .databaseLifetime // Start observation - _ = try dbQueue.start( - observation, + _ = try observation.start( + in: dbQueue, onError: { errors.append($0) notificationExpectation.fulfill() @@ -124,8 +124,8 @@ class ValueObservationReducerTests: GRDBTestCase { // Start observation do { let dbQueue = try makeDatabaseQueue() - _ = try dbQueue.start( - observation, + _ = try observation.start( + in: dbQueue, onError: { _ in fatalError() }, onChange: { _ in fatalError() }) XCTFail("Expected error") @@ -161,8 +161,8 @@ class ValueObservationReducerTests: GRDBTestCase { observation.extent = .databaseLifetime // Start observation - _ = try dbQueue.start( - observation, + _ = try observation.start( + in: dbQueue, onError: { errors.append($0) notificationExpectation.fulfill() @@ -214,7 +214,7 @@ class ValueObservationReducerTests: GRDBTestCase { observation.extent = .databaseLifetime // Start observation - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in counts.append(count) notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationRowTests.swift b/Tests/GRDBTests/ValueObservationRowTests.swift index 0442d0217..c5a55c9ae 100644 --- a/Tests/GRDBTests/ValueObservationRowTests.swift +++ b/Tests/GRDBTests/ValueObservationRowTests.swift @@ -24,7 +24,7 @@ class ValueObservationRowTests: GRDBTestCase { var observation = ValueObservation.trackingAll(SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { rows in + _ = try observation.start(in: dbQueue) { rows in results.append(rows) notificationExpectation.fulfill() } @@ -58,7 +58,7 @@ class ValueObservationRowTests: GRDBTestCase { var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { rows in + _ = try observation.start(in: dbQueue) { rows in results.append(rows) notificationExpectation.fulfill() } @@ -91,7 +91,7 @@ class ValueObservationRowTests: GRDBTestCase { var observation = ValueObservation.trackingOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { row in + _ = try observation.start(in: dbQueue) { row in results.append(row) notificationExpectation.fulfill() } @@ -129,7 +129,7 @@ class ValueObservationRowTests: GRDBTestCase { var observation = ValueObservation.trackingOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { row in + _ = try observation.start(in: dbQueue) { row in results.append(row) notificationExpectation.fulfill() } diff --git a/Tests/GRDBTests/ValueObservationSchedulingTests.swift b/Tests/GRDBTests/ValueObservationSchedulingTests.swift index bcb9a1855..18593a024 100644 --- a/Tests/GRDBTests/ValueObservationSchedulingTests.swift +++ b/Tests/GRDBTests/ValueObservationSchedulingTests.swift @@ -31,7 +31,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { }) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) counts.append(count) notificationExpectation.fulfill() @@ -68,7 +68,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.extent = .databaseLifetime DispatchQueue.global(qos: .default).async { - _ = try! dbQueue.start(observation) { count in + _ = try! observation.start(in: dbQueue) { count in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) counts.append(count) notificationExpectation.fulfill() @@ -108,8 +108,8 @@ class ValueObservationSchedulingTests: GRDBTestCase { var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) observation.extent = .databaseLifetime - _ = try dbQueue.start( - observation, + _ = try observation.start( + in: dbQueue, onError: { error in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) errorCount += 1 @@ -150,7 +150,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.extent = .databaseLifetime observation.scheduling = .onQueue(queue, startImmediately: true) - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) counts.append(count) notificationExpectation.fulfill() @@ -184,7 +184,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.extent = .databaseLifetime observation.scheduling = .onQueue(queue, startImmediately: false) - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) counts.append(count) notificationExpectation.fulfill() @@ -220,8 +220,8 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.extent = .databaseLifetime observation.scheduling = .onQueue(queue, startImmediately: false) - _ = try dbQueue.start( - observation, + _ = try observation.start( + in: dbQueue, onError: { error in XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) errorCount += 1 @@ -256,7 +256,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.extent = .databaseLifetime observation.scheduling = .unsafe(startImmediately: true) - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in if counts.isEmpty { // require main queue on first element XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) @@ -294,7 +294,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.scheduling = .unsafe(startImmediately: true) queue.async { - _ = try! dbQueue.start(observation) { count in + _ = try! observation.start(in: dbQueue) { count in if counts.isEmpty { // require custom queue on first notification XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) @@ -328,7 +328,7 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.extent = .databaseLifetime observation.scheduling = .unsafe(startImmediately: false) - _ = try dbQueue.start(observation) { count in + _ = try observation.start(in: dbQueue) { count in counts.append(count) notificationExpectation.fulfill() } @@ -359,8 +359,8 @@ class ValueObservationSchedulingTests: GRDBTestCase { observation.extent = .databaseLifetime observation.scheduling = .unsafe(startImmediately: false) - _ = try dbQueue.start( - observation, + _ = try observation.start( + in: dbQueue, onError: { error in errorCount += 1 notificationExpectation.fulfill() diff --git a/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift b/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift index 96bc3af10..fc5bdc299 100644 --- a/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift +++ b/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift @@ -46,7 +46,7 @@ class ValueObservationStatementColumnConvertibleTests: GRDBTestCase { var observation = ValueObservation.trackingAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { names in + _ = try observation.start(in: dbQueue) { names in XCTAssert(names.allSatisfy { $0.fast }) results.append(names) notificationExpectation.fulfill() @@ -81,7 +81,7 @@ class ValueObservationStatementColumnConvertibleTests: GRDBTestCase { var observation = ValueObservation.trackingOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { name in + _ = try observation.start(in: dbQueue) { name in if let name = name { XCTAssert(name.fast) } @@ -122,7 +122,7 @@ class ValueObservationStatementColumnConvertibleTests: GRDBTestCase { var observation = ValueObservation.trackingAll(SQLRequest("SELECT name FROM t ORDER BY id")) observation.extent = .databaseLifetime - _ = try dbQueue.start(observation) { names in + _ = try observation.start(in: dbQueue) { names in XCTAssert(names.allSatisfy { $0.map { $0.fast } ?? true }) results.append(names) notificationExpectation.fulfill() From 4e3b7c14a9ce608b7209a65550a7284bfb1cece7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 19:39:44 +0100 Subject: [PATCH 070/109] Documentation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4f6f40ca6..cc572e9f7 100644 --- a/README.md +++ b/README.md @@ -6217,9 +6217,9 @@ class PlayerViewController: UIViewController { let observation = ValueObservation.trackingOne(request) // Start observing the database - observer = try! observation.start(in: dbQueue) { [unowned self] player: Player? in + observer = try! observation.start(in: dbQueue, onChange: { [unowned self] player: Player? in self.nameLabel.text = player?.name - } + }) } override func viewWillDisappear(_ animated: Bool) { From cdd7579104ac3cee6deeeefe75280394a3c33fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 19:40:37 +0100 Subject: [PATCH 071/109] Documentation --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cc572e9f7..2cefd76d5 100644 --- a/README.md +++ b/README.md @@ -6217,9 +6217,11 @@ class PlayerViewController: UIViewController { let observation = ValueObservation.trackingOne(request) // Start observing the database - observer = try! observation.start(in: dbQueue, onChange: { [unowned self] player: Player? in - self.nameLabel.text = player?.name - }) + observer = try! observation.start( + in: dbQueue, + onChange: { [unowned self] player: Player? in + self.nameLabel.text = player?.name + }) } override func viewWillDisappear(_ animated: Bool) { From d3838d1d73be0364120505b6c4cb529e8d782eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 21:13:14 +0100 Subject: [PATCH 072/109] ValueObservation error handling --- GRDB/Core/DatabaseWriter.swift | 5 +++++ README.md | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 315d30a0f..9b4ec7307 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -369,6 +369,11 @@ private class ValueObserver: TransactionObserver { } } } catch { + guard strongSelf.onError != nil else { + // Should we let an error unnoticed? + try! { throw error }() + return + } if let queue = strongSelf.notificationQueue { queue.async { guard let strongSelf = self else { return } diff --git a/README.md b/README.md index 2cefd76d5..02eb7725d 100644 --- a/README.md +++ b/README.md @@ -6456,6 +6456,7 @@ Some behaviors of value observations can be configured: - [ValueObservation.extent](#valueobservationextent): fine-grained control of the observation duration - [ValueObservation.scheduling](#valueobservationscheduling): control the dispatching of notified values - [ValueObservation.isReadOnly](#valueobservationisreadonly): allow observations to write in the database +- [ValueObservation Error Handling](#valueobservation-error-handling) #### ValueObservation.extent @@ -6569,6 +6570,22 @@ Don't use this flag unless you actually need it: when you use a [database pool]( See [RxSwiftCommunity/RxGRDB/issues/42](https://github.com/RxSwiftCommunity/RxGRDB/issues/42) for an example use case. The `isReadOnly` flag exists in order to address this feature request. +#### ValueObservation Error Handling + +When you start an observation, you can provide an `onError` callback. This callback is called whenever an error happens when a fresh value is fetched after a database change: + +```swift +let observer = try! observation.start( + in: dbQueue, + onError: { error in + print("fresh value could not be fetched") + }, + onChange: { value in + print("fresh value: \(value)") + }) +``` + + ## FetchedRecordsController **FetchedRecordsController track changes in the results of a request. It can also feed table views, collection views, and animate cells when the results of the request change.** From 22b5990669dcad8da70672aceaf461286e491725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 29 Oct 2018 23:04:00 +0100 Subject: [PATCH 073/109] Documentation --- README.md | 98 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 02eb7725d..0e2e7d3d3 100644 --- a/README.md +++ b/README.md @@ -6265,44 +6265,49 @@ Those observations match the `fetchCount`, `fetchOne`, and `fetchAll` request me ```swift // Observe number of players - let observation = ValueObservation.trackingCount(Player.all()) - let observer = try observation.start(in: dbQueue) { count: Int in - print("Number of players have changed: \(count)") - } + let observer = ValueObservation + .trackingCount(Player.all()) + .start(in: dbQueue) { count: Int in + print("Number of players have changed: \(count)") + } ``` - `trackingOne` notifies optional values, built from a single database row (if any): ```swift // Observe a single player - let observation = ValueObservation.trackingOne(Player.filter(key: 1)) - let observer = try observation.start(in: dbQueue) { player: Player? in - print("Player has changed: \(player)") - } - + let observer = ValueObservation + .trackingOne(Player.filter(key: 1)) + .start(in: dbQueue) { player: Player? in + print("Player has changed: \(player)") + } + // Observe the maximum score let request = Player.select(max(Column("score")), as: Int.self) - let observation = ValueObservation.trackingOne(request) - let observer = try observation.start(in: dbQueue) { maximumScore: Int? in - print("Maximum score has changed: \(maximumScore)") - } + let observer = ValueObservation + .trackingOne(request) + .start(in: dbQueue) { maximumScore: Int? in + print("Maximum score has changed: \(maximumScore)") + } ``` - `trackingAll` notifies arrays: ```swift // Observe all players - let observation = ValueObservation.trackingAll(Player.all()) - let observer = try observation.start(in: dbQueue) { players: [Player] in - print("Players have changed: \(players)") - } - + let observer = ValueObservation + .trackingAll(Player.all()) + .start(in: dbQueue) { players: [Player] in + print("Players have changed: \(players)") + } + // Observe all player names let request = SQLRequest("SELECT name FROM player") - let observation = ValueObservation.trackingAll(request) - let observer = try observation.start(in: dbQueue) { names: [String] in - print("Player names have changed: \(names)") - } + let observer = ValueObservation + .trackingAll(request) + .start(in: dbQueue) { names: [String] in + print("Player names have changed: \(names)") + } ``` Beware that by default, a ValueObservation notifies *potential* changes, not *actual* changes in the results of a request. A change is notified if and only if a statement has actually modified the tracked tables and columns by inserting, updating, or deleting a row. @@ -6314,10 +6319,11 @@ You can avoid notification of consecutive identical values with the `withUniquin ```swift // Observe the maximum score (with uniquing) let request = Player.select(max(Column("score")), as: Int.self) -let observation = ValueObservation.trackingOne(withUniquing: request) -let observer = try observation.start(in: dbQueue) { maximumScore: Int? in - print("Maximum score has (really) changed: \(maximumScore)") -} +let observer = ValueObservation + .trackingOne(withUniquing: request) + .start(in: dbQueue) { maximumScore: Int? in + print("Maximum score has (really) changed: \(maximumScore)") + } ``` @@ -6402,10 +6408,11 @@ struct TeamInfoRequest: DatabaseRegionConvertible { } let request = TeamInfoRequest(teamId: 1) -let observation = ValueObservation.tracking(request, fetch: request.fetch) -let observer = observation.start(in: dbQueue) { teamInfo: TeamInfo? in - print("Team and players have hanged.") -} +let observer = ValueObservation + .tracking(request, fetch: request.fetch) + .start(in: dbQueue) { teamInfo: TeamInfo? in + print("Team and players have hanged.") + } ``` See [DatabaseRegion](#databaseregion) for more information. @@ -6442,10 +6449,11 @@ let reducer = AnyValueReducer( count += 1 return count }) -let observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: reducer) -let observer = try observation.start(in: dbQueue) { count: Int in - print("The database has been modified \(count) times.") -} +let observer = ValueObservation + .tracking(DatabaseRegion.fullDatabase, reducer: reducer) + .start(in: dbQueue) { count: Int in + print("The database has been modified \(count) times.") + } ``` @@ -6493,11 +6501,12 @@ The `scheduling` property lets you control how fresh values are notified: ```swift // On main queue - let observation = ValueObservation.trackingAll(Player.all()) - let observer = try observation.start(in: dbQueue) { players: [Player] in - // On main queue - print("fresh players: \(players)") - } + let observer = ValueObservation + .trackingAll(Player.all()) + .start(in: dbQueue) { players: [Player] in + // On main queue + print("fresh players: \(players)") + } // <- here "fresh players" is already printed. ``` @@ -6505,11 +6514,12 @@ The `scheduling` property lets you control how fresh values are notified: ```swift // Not on the main queue - let observation = ValueObservation.trackingAll(Player.all()) - let observer = try observation.start(in: dbQueue) { players: [Player] in - // On main queue - print("fresh players: \(players)") - } + let observer = ValueObservation + .trackingAll(Player.all()) + .start(in: dbQueue) { players: [Player] in + // On main queue + print("fresh players: \(players)") + } ``` When the database changes, fresh values are asynchronously notified: From c4d328783f0d8b27e9683ed78f939715faa04809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 30 Oct 2018 07:24:27 +0100 Subject: [PATCH 074/109] Documentation --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0e2e7d3d3..6c55724d4 100644 --- a/README.md +++ b/README.md @@ -6172,7 +6172,7 @@ try dbQueue.write { db in } ``` -Beware that a region notifies *potential* changes, not *actual* changes in the results of a request. A change is notified if and only if a statement has actually modified the tracked tables and columns by inserting, updating, or deleting a row. +A region notifies *potential* changes, not *actual* changes in the results of a request. A change is notified if and only if a statement has actually modified the tracked tables and columns by inserting, updating, or deleting a row. For example, if you observe the region of `Player.select(max(Column("score")))`, then you'll get be notified of all changes performed on the `score` column of the `player` table (updates, insertions and deletions), even if they do not modify the value of the maximum score. However, you will not get any notification for changes performed on other database tables, or updates to other columns of the player table. @@ -6237,7 +6237,7 @@ All values are notified on the main queue: views can be updated right from the c An initial fetch is performed as soon as the observation starts: the view is set up and ready when the `viewWillAppear` method returns. -The view controller stores the observer returned by the `start` method in a property. This allows the view controller to control the duration of the observation. When the observed is deallocated, the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. +The view controller stores the observer returned by the `start` method in a property. This allows the view controller to control the duration of the observation. When the observer is deallocated, the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. - [ValueObservation.trackingCount, trackingOne, trackingAll](#valueobservationtrackingcount-trackingone-trackingall) - [ValueObservation.tracking(_:fetch:)](#valueobservationtracking_fetch) @@ -6310,7 +6310,7 @@ Those observations match the `fetchCount`, `fetchOne`, and `fetchAll` request me } ``` -Beware that by default, a ValueObservation notifies *potential* changes, not *actual* changes in the results of a request. A change is notified if and only if a statement has actually modified the tracked tables and columns by inserting, updating, or deleting a row. +By default, a ValueObservation notifies *potential* changes, not *actual* changes in the results of a request. A change is notified if and only if a statement has actually modified the tracked tables and columns by inserting, updating, or deleting a row. For example, if you observe `Player.select(max(Column("score")))`, then you'll get be notified of all changes performed on the `score` column of the `player` table (updates, insertions and deletions), even if they do not modify the value of the maximum score. However, you will not get any notification for changes performed on other database tables, or updates to other columns of the player table. @@ -6331,7 +6331,14 @@ let observer = ValueObservation Sometimes you need to observe several requests at the same time. For example, you need to observe changes in both a team and its players. -When this happens, you create a ValueObservation with two parameters. The first parameter is the list of observed requests. The other parameter is a closure that fetches fresh values whenever the observed requests are modified. This fetch closure is guaranteed an immutable view of the last committed state of the database: this means that fetched values are **consistent**. For example: +When this happens, you create a ValueObservation with the `ValueObservation.tracking(_:fetch:)` method, which accepts two parameters: + +1. The list of observed requests. +2. A closure that fetches a fresh value whenever one of the observed requests are modified. + +The fetch closure is guaranteed an immutable view of the last committed state of the database: this means that fetched values are **consistent**. + +For example: ```swift // The two observed requests (the team and its players) From 8e13cb4e6c20dc3c3be4c40d4ae9d68a0c4fa6d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 30 Oct 2018 07:46:41 +0100 Subject: [PATCH 075/109] Cleanup --- GRDB/Core/ValueObservation.swift | 76 ++++++++++---------------------- 1 file changed, 24 insertions(+), 52 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 6b7d8e678..52a6e1d43 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -571,9 +571,7 @@ extension ValueObservation where Reducer == Void { public static func trackingCount(_ request: Request) -> ValueObservation> { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Raw(request.fetchCount)) + return ValueObservation.tracking(request, fetch: request.fetchCount) } /// Creates a ValueObservation which observes *request*, and notifies a @@ -605,9 +603,7 @@ extension ValueObservation where Reducer == Void { public static func trackingCount(withUniquing request: Request) -> ValueObservation> { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Unique(request.fetchCount)) + return ValueObservation.tracking(withUniquing: request, fetch: request.fetchCount) } } @@ -644,9 +640,7 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder == Row { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Raw(request.fetchAll)) + return ValueObservation.tracking(request, fetch: request.fetchAll) } /// Creates a ValueObservation which observes *request*, and notifies @@ -679,9 +673,7 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder == Row { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Unique(request.fetchAll)) + return ValueObservation.tracking(withUniquing: request, fetch: request.fetchAll) } /// Creates a ValueObservation which observes *request*, and notifies a @@ -714,9 +706,7 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder == Row { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Raw(request.fetchOne)) + return ValueObservation.tracking(request, fetch: request.fetchOne) } /// Creates a ValueObservation which observes *request*, and notifies a @@ -749,9 +739,7 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder == Row { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Unique(request.fetchOne)) + return ValueObservation.tracking(withUniquing: request, fetch: request.fetchOne) } } @@ -789,9 +777,7 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder: FetchableRecord { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Raw(request.fetchAll)) + return ValueObservation.tracking(request, fetch: request.fetchAll) } /// Creates a ValueObservation which observes *request*, and notifies @@ -825,8 +811,8 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder: FetchableRecord { - return ValueObservation>( - tracking: request.databaseRegion, + return ValueObservation>.tracking( + request, reducer: ValueReducers.UniqueRecords { try Row.fetchAll($0, request) }) } @@ -860,9 +846,7 @@ extension ValueObservation where Reducer == Void { ValueObservation> where Request.RowDecoder: FetchableRecord { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Raw(request.fetchOne)) + return ValueObservation.tracking(request, fetch: request.fetchOne) } /// Creates a ValueObservation which observes *request*, and notifies a @@ -895,8 +879,8 @@ extension ValueObservation where Reducer == Void { ValueObservation> where Request.RowDecoder: FetchableRecord { - return ValueObservation>( - tracking: request.databaseRegion, + return ValueObservation>.tracking( + request, reducer: ValueReducers.UniqueRecord { try Row.fetchOne($0, request) }) } } @@ -935,9 +919,7 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Raw(request.fetchAll)) + return ValueObservation.tracking(request, fetch: request.fetchAll) } /// Creates a ValueObservation which observes *request*, and notifies @@ -971,8 +953,8 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible { - return ValueObservation>( - tracking: request.databaseRegion, + return ValueObservation>.tracking( + request, reducer: ValueReducers.UniqueValues { try DatabaseValue.fetchAll($0, request) }) } @@ -1006,9 +988,7 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Raw(request.fetchOne)) + return ValueObservation.tracking(request, fetch: request.fetchOne) } /// Creates a ValueObservation which observes *request*, and notifies a @@ -1041,8 +1021,8 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible { - return ValueObservation>( - tracking: request.databaseRegion, + return ValueObservation>.tracking( + request, reducer: ValueReducers.UniqueValue { try DatabaseValue.fetchOne($0, request) }) } } @@ -1081,9 +1061,7 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Raw(request.fetchAll)) + return ValueObservation.tracking(request, fetch: request.fetchAll) } /// Creates a ValueObservation which observes *request*, and notifies a @@ -1116,9 +1094,7 @@ extension ValueObservation where Reducer == Void { -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Raw(request.fetchOne)) + return ValueObservation.tracking(request, fetch: request.fetchOne) } } @@ -1157,9 +1133,7 @@ extension ValueObservation where Reducer == Void { where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Raw(request.fetchAll)) + return ValueObservation.tracking(request, fetch: request.fetchAll) } /// Creates a ValueObservation which observes *request*, and notifies @@ -1194,8 +1168,8 @@ extension ValueObservation where Reducer == Void { where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible { - return ValueObservation>( - tracking: request.databaseRegion, + return ValueObservation>.tracking( + request, reducer: ValueReducers.UniqueOptionalValues { try DatabaseValue.fetchAll($0, request) }) } } @@ -1235,8 +1209,6 @@ extension ValueObservation where Reducer == Void { where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible { - return ValueObservation>( - tracking: request.databaseRegion, - reducer: ValueReducers.Raw(request.fetchAll)) + return ValueObservation.tracking(request, fetch: request.fetchAll) } } From cca716e1ab3c9f694ad0044fb9c0ce6c780cf1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 30 Oct 2018 08:49:36 +0100 Subject: [PATCH 076/109] Cleanup --- GRDB/Core/ValueObservation.swift | 37 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 52a6e1d43..457f69c00 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -433,24 +433,6 @@ public struct ValueObservation { } } -extension ValueObservation where Reducer: ValueReducer { - /// Starts the value observation in the provided database reader (such as - /// a database queue or database pool). - /// - /// - parameter observation: the stared observation - /// - parameter onError: a closure that is provided by eventual errors that happen - /// during observation - /// - parameter onChange: a closure that is provided fresh values - /// - returns: a TransactionObserver - public func start( - in reader: DatabaseReader, - onError: ((Error) -> Void)? = nil, - onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver - { - return try reader.add(observation: self, onError: onError, onChange: onChange) - } -} - extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *regions*, and notifies the /// values returned by the *fetch* closure whenever one of the observed @@ -538,6 +520,25 @@ private func union(_ regions: [DatabaseRegionConvertible]) -> (Database) throws } } +// MARK: - Starting Observation + +extension ValueObservation where Reducer: ValueReducer { + /// Starts the value observation in the provided database reader (such as + /// a database queue or database pool). + /// + /// - parameter observation: the stared observation + /// - parameter onError: a closure that is provided by eventual errors that happen + /// during observation + /// - parameter onChange: a closure that is provided fresh values + /// - returns: a TransactionObserver + public func start( + in reader: DatabaseReader, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver + { + return try reader.add(observation: self, onError: onError, onChange: onChange) + } +} // MARK: - Count Observation From 3d21773496f3f8a6c3e46abd241a853ab6a4e2ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 30 Oct 2018 13:33:24 +0100 Subject: [PATCH 077/109] CHANGELOG --- CHANGELOG.md | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a191bc04..6924ad1a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,119 @@ Release Notes ## Next Version -### Breaking Changes +This release comes with **ValueObservation**, a new type which can track the results of database requests, and notifies fresh values each time the database changes. -- The DatabaseReader and DatabaseWriter protocols have changed in a way that is compatible with your current code, except with your eventual custom types that implement those protocols. Only five types provided by GRDB adopt those protocols: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. Expanding this set is no longer supported. +ValueObservation provides convenient APIs for applications: +```swift +let observer = ValueObversation + .trackingOne(Player.filter(key: 42)) + .start(in: dbQueue) { player: Player? in + print("Player has changed") + } +``` + +It is also highly configurable, and aims at providing support for any third-party code that needs to react to database changes. For example, [RxSwiftCommunity/RxGRDB#46](https://github.com/RxSwiftCommunity/RxGRDB/pull/46) is the pull request which implements RxGRDB, the companion library based on [RxSwift](https://github.com/ReactiveX/RxSwift), on top of ValueObservation. + + +### New + +- [#435](https://github.com/groue/GRDB.swift/pull/435): Improved support for values observation + + +### Fixed + +- It used to be possible to define custom types that adopt the DatabaseReader and DatabaseWriter protocols, with a major drawback: it was impossible to add concurrency-related APIs to GRDB without breaking user code. Now all types that adopt those protocols are defined by GRDB: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. **Expanding this set is no longer supported.** + + +### API diff + +```diff + protocol DatabaseReader: class { ++ func add( ++ observation: ValueObservation, ++ onError: ((Error) -> Void)?, ++ onChange: @escaping (Reducer.Value) -> Void) ++ throws -> TransactionObserver ++ func remove(transactionObserver: TransactionObserver) + } + + protocol DatabaseWriter: DatabaseReader { +- func remove(transactionObserver: TransactionObserver) + } + ++protocol DatabaseRegionConvertible { ++ func databaseRegion(_ db: Database) throws -> DatabaseRegion ++} + ++extension DatabaseRegion: DatabaseRegionConvertible { } + ++struct AnyDatabaseRegionConvertible: DatabaseRegionConvertible { ++ init(_ region: @escaping (Database) throws -> DatabaseRegion) ++ init(_ region: DatabaseRegionConvertible) ++} + +-protocol FetchRequest { ... } ++protocol FetchRequest: DatabaseRegionConvertible { ... } + ++enum ValueScheduling { ++ case mainQueue ++ case onQueue(DispatchQueue, startImmediately: Bool) ++ case unsafe(startImmediately: Bool) ++} + ++protocol ValueReducer { ++ associatedtype Fetched ++ associatedtype Value ++ func fetch(_ db: Database) throws -> Fetched ++ mutating func value(_ fetched: Fetched) -> Value? ++} + ++struct AnyValueReducer: ValueReducer { ++ init(fetch: @escaping (Database) throws -> Fetched, value: @escaping (Fetched) -> Value?) ++ init(_ reducer: Reducer) where Reducer.Fetched == Fetched, Reducer.Value == Value ++} + ++struct ValueObservation { ++ var isReadOnly: Bool ++ var extent: Database.TransactionObservationExtent ++ var scheduling: ValueScheduling ++ static func tracking(_ regions: DatabaseRegionConvertible..., reducer: Reducer) -> ValueObservation ++} + ++extension ValueObservation where Reducer: ValueReducer { ++ public func start( ++ in reader: DatabaseReader, ++ onError: ((Error) -> Void)? = nil, ++ onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver ++} + ++extension ValueObservation where Reducer == Void { ++ static func tracking( ++ _ regions: DatabaseRegionConvertible..., ++ fetch: @escaping (Database) throws -> Value) ++ -> ValueObservation> ++ static func tracking( ++ withUniquing regions: DatabaseRegionConvertible..., ++ fetch: @escaping (Database) throws -> Value) ++ -> ValueObservation> ++ where Value: Equatable ++ ++ static func trackingCount(_ request: Request) ++ -> ValueObservation> ++ static func trackingCount(withUniquing request: Request) ++ -> ValueObservation> ++ ++ static func trackingAll(_ request: Request) ++ -> ValueObservation> ++ static func trackingAll(withUniquing request: Request) ++ -> ValueObservation> ++ static func trackingOne(_ request: Request) ++ -> ValueObservation> ++ static func trackingOne(withUniquing request: Request) ++ -> ValueObservation> ++} +``` ## 3.4.0 From 741f0b2a43f18d8710ede5833d638864b62397e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 30 Oct 2018 13:37:05 +0100 Subject: [PATCH 078/109] CHANGELOG --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6924ad1a1..d927b6c8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,11 @@ It is also highly configurable, and aims at providing support for any third-part - It used to be possible to define custom types that adopt the DatabaseReader and DatabaseWriter protocols, with a major drawback: it was impossible to add concurrency-related APIs to GRDB without breaking user code. Now all types that adopt those protocols are defined by GRDB: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. **Expanding this set is no longer supported.** +### Documentation Diff + +- [ValueObservation](Documentation/AssociationsBasics.md#valueobservation): this new chapter describes the new way to observe database values. + + ### API diff ```diff From a276a49a26e102bd84a6e3429ee056f6fb96e70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 30 Oct 2018 13:37:58 +0100 Subject: [PATCH 079/109] CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d927b6c8d..38e4ae7e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,7 @@ It is also highly configurable, and aims at providing support for any third-part ### Documentation Diff -- [ValueObservation](Documentation/AssociationsBasics.md#valueobservation): this new chapter describes the new way to observe database values. +- [ValueObservation](README.md#valueobservation): this new chapter describes the new way to observe database values. ### API diff From 0e51a0ff6532f71486af223446d3164078f29302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 30 Oct 2018 13:40:32 +0100 Subject: [PATCH 080/109] Documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c55724d4..5a2ea4f32 100644 --- a/README.md +++ b/README.md @@ -6336,7 +6336,7 @@ When this happens, you create a ValueObservation with the `ValueObservation.trac 1. The list of observed requests. 2. A closure that fetches a fresh value whenever one of the observed requests are modified. -The fetch closure is guaranteed an immutable view of the last committed state of the database: this means that fetched values are **consistent**. +The fetch closure is granted an immutable view of the last committed state of the database: this means that fetched values are guaranteed to be **consistent**. For example: From 6fa72ebea1697ef7a7cba2829f9e5db9b880b7b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 30 Oct 2018 13:44:05 +0100 Subject: [PATCH 081/109] Documentation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5a2ea4f32..3c620f1f5 100644 --- a/README.md +++ b/README.md @@ -6567,6 +6567,8 @@ The `scheduling` property lets you control how fresh values are notified: ``` When the database changes, other values are notified on unspecified queues. + + > :point_up: **Note**: this unsafe mode is intended for third-party libraries that provide their own scheduling engine. #### ValueObservation.isReadOnly From 04de6193c047e97f84e74c26f096846a7d46138e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 31 Oct 2018 07:37:05 +0100 Subject: [PATCH 082/109] Documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c620f1f5..a1ba6f90a 100644 --- a/README.md +++ b/README.md @@ -6594,7 +6594,7 @@ See [RxSwiftCommunity/RxGRDB/issues/42](https://github.com/RxSwiftCommunity/RxGR When you start an observation, you can provide an `onError` callback. This callback is called whenever an error happens when a fresh value is fetched after a database change: ```swift -let observer = try! observation.start( +let observer = try observation.start( in: dbQueue, onError: { error in print("fresh value could not be fetched") From 9babbcbcb35af137baa2dda86eab471ce73ba5f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 31 Oct 2018 08:59:50 +0100 Subject: [PATCH 083/109] README: foster ValueObservation --- README.md | 92 ++++++++++++++++++++++++------------------------------- 1 file changed, 40 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index a1ba6f90a..58e53817d 100644 --- a/README.md +++ b/README.md @@ -221,24 +221,14 @@ See the [Query Interface](#the-query-interface) ```swift let request = Place.order(Column("title")) - -// Track request changes with FetchedRecordsController -let controller = FetchedRecordsController(dbQueue, request: request) -controller.trackChanges { controller in - print("Places have changed.") - let places = controller.fetchedRecords // [Place] -} -try controller.performFetch() - -// Track request changes with RxSwift and RxGRDB -request.rx - .fetchAll(in: dbQueue) - .subscribe(onNext: { places: [Place] in +try ValueObservation + .trackingAll(request) + .start(in: dbQueue) { places: [Place] in print("Places have changed.") - }) + } ``` -See [Database Changes Observation](#database-changes-observation), and [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) +See [Database Changes Observation](#database-changes-observation) @@ -2743,7 +2733,7 @@ protocol MutablePersistableRecord { } ``` -> :bulb: **Tip**: Make sure you set the JSONEncoder `sortedKeys` option, available from iOS 11.0+, macOS 10.13+, and watchOS 4.0+. This option makes sure that the JSON output is stable. This stability is required for [Record Comparison] to work as expected, and database observation tools such as [FetchedRecordsController](#fetchedrecordscontroller) or [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) to accurately recognize changed records. +> :bulb: **Tip**: Make sure you set the JSONEncoder `sortedKeys` option, available from iOS 11.0+, macOS 10.13+, and watchOS 4.0+. This option makes sure that the JSON output is stable. This stability is required for [Record Comparison] to work as expected, and database observation tools such as [ValueObservation] to accurately recognize changed records. ### Date and UUID Coding Strategies @@ -2868,15 +2858,15 @@ try dbQueue.read { db in } ``` -... and feed database observation tools such as [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB): +... and feed database observation tools such as [ValueObservation]: ```swift // Observe changes -Player.maximumScore.rx - .fetchOne(in: dbQueue) - .subscribe(onNext: { maxScore: Int? in +try ValueObservation + .trackingOne(Player.maximumScore) + .start(in: dbQueue) { maxScore: Int? in print("The maximum score has changed") - }) + } ``` @@ -3659,7 +3649,7 @@ Use an individual column as **primary**, **unique**, or **foreign key**. When de > } > ``` > -> The reason for this recommendation is that auto-incremented primary keys prevent the reuse of ids. This prevents your app or [database observation tools](#database-changes-observation) to think that a row was updated, when it was actually deleted, then replaced. Depending on your application needs, this may be OK. Or not. +> The reason for this recommendation is that auto-incremented primary keys prevent the reuse of ids. This prevents your app or [database observation tools](#database-changes-observation) to think that a row was updated, when it was actually deleted, then replaced. Depending on your application needs, this may be acceptable. But usually it is not. **Create an index** on the column: @@ -4243,7 +4233,7 @@ let minScore = row[0] as Int? let maxScore = row[1] as Int? ``` -When you also want to use database observation tools such as [FetchedRecordsController](#fetchedrecordscontroller) or [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB), you have to go one step further, and change the type of the request: +When you also want to use database observation tools such as [ValueObservation], you have to go one step further, and change the type of the request: - When you change the selection, prefer the `select(..., as:)` method: @@ -4256,12 +4246,12 @@ When you also want to use database observation tools such as [FetchedRecordsCont try request.fetchOne(db) // Int? } - // Observe with RxGRDB - request.rx - .fetchOne(in: dbQueue) - .subscribe(onNext: { maxScore: Int? in + // Observe with ValueObservation + try ValueObservation + .trackingOne(request) + .start(in: dbQueue) { maxScore: Int? in print("The maximum score has changed") - }) + } ``` - Otherwise, use `asRequest(of:)`. Here is an example that uses [Associations]: @@ -4282,13 +4272,12 @@ When you also want to use database observation tools such as [FetchedRecordsCont try request.fetchAll(db) // [BookInfo] } - // Observe with FetchedRecordsController - let controller = FetchedRecordsController( - dbQueue, - request: request, - isSameRecord: { (bookInfo1, bookInfo2) in - bookInfo1.book.id == bookInfo2.book.id - }) + // Observe with ValueObservation + try ValueObservation + .trackingAll(request) + .start(in: dbQueue) { bookInfos: [BookInfo] in + print("Books have changed") + } ``` @@ -4355,14 +4344,14 @@ let request = Player.filter(key: ["email": "arthur@example.com"]) let player = try request.fetchOne(db) // Player? ``` -Those requests help observing the database with [FetchedRecordsController](#fetchedrecordscontroller) or [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB): +Those requests can feed [ValueObservation]: ```swift -Player.filter(key: 1).rx - .fetchOne(in: dbQueue) - .subscribe(onNext: { player: Player? in +try ValueObservation. + .trackingOne(Player.filter(key: 1)) + .start(in: dbQueue) { player: Player? in print("Player 1 has changed") - }) + } ``` @@ -4475,14 +4464,14 @@ But you may prefer to bring some elegance back in, and build custom requests: try Player.customRequest().fetchAll(db) // [Player] ``` -Custom requests also grant [FetchedRecordsController](#fetchedrecordscontroller) and [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) the ability to observe the database: +Custom requests can also feed [ValueObservation]: ```swift -Player.customRequest(...).rx - .fetchAll(in: dbQueue) - .subscribe(onNext: { players: [Player] in +try ValueObservation. + .trackingAll(Player.customRequest(...)) + .start(in: dbQueue) { players: [Player] in print("Players have changed") - }) + } ``` - [FetchRequest Protocol](#fetchrequest-protocol) @@ -4516,7 +4505,7 @@ The `prepare` method returns a prepared statement and an optional row adapter. T The `fetchCount` method has a default implementation that builds a correct but naive SQL query from the statement returned by `prepare`: `SELECT COUNT(*) FROM (...)`. Adopting types can refine the counting SQL by customizing their `fetchCount` implementation. -The `databaseRegion` method is involved in [database observation](#database-changes-observation). It is given a default implementation, based on the statement returned by `prepare`. For more information, see [DatabaseRegion](#databaseregion), and [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB). +The `databaseRegion` method is involved in [database observation](#database-changes-observation). It is given a default implementation, based on the statement returned by `prepare`. For more information, see [DatabaseRegion](#databaseregion), and [ValueObservation]. The FetchRequest protocol is adopted, for example, by [query interface requests](#requests): @@ -5639,7 +5628,7 @@ let playerInfos = try dbQueue.read { db in ### Splitting Rows, the Request Way -The `PlayerInfo.fetchAll` method [above](#splitting-rows-the-record-way) directly fetches records. It's all good, but in order to profit from [database observation](#database-changes-observation) with [FetchedRecordsController](#fetchedrecordscontroller) or [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB), you'll need a [custom request](#custom-requests) that defines a database query. +The `PlayerInfo.fetchAll` method [above](#splitting-rows-the-record-way) directly fetches records. It's all good, but in order to profit from [database observation](#database-changes-observation), you'll need a [custom request](#custom-requests) that defines a database query. It is recommended that you read the previous paragraphs before you dive in this sample code. We start with the same PlayerInfo record as above: @@ -5983,7 +5972,7 @@ do { > :point_up: **Note**: the databaseDidChange(with:) and databaseWillCommit() callbacks must not touch the SQLite database. This limitation does not apply to databaseDidCommit and databaseDidRollback which can use their database argument. -[FetchedRecordsController](#fetchedrecordscontroller) and [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) are based on the TransactionObserver protocol. +[ValueObservation], [FetchedRecordsController](#fetchedrecordscontroller), and [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) are based on the TransactionObserver protocol. See also [TableChangeObserver.swift](https://gist.github.com/groue/2e21172719e634657dfd), which shows a transaction observer that notifies of modified database tables with NSNotificationCenter. @@ -6586,8 +6575,6 @@ The `fetch` closure is executed inside a [savepoint](#transactions-and-savepoint Don't use this flag unless you actually need it: when you use a [database pool](#database-pools), observations with write access are less efficient. -See [RxSwiftCommunity/RxGRDB/issues/42](https://github.com/RxSwiftCommunity/RxGRDB/issues/42) for an example use case. The `isReadOnly` flag exists in order to address this feature request. - #### ValueObservation Error Handling @@ -6607,7 +6594,7 @@ let observer = try observation.start( ## FetchedRecordsController -**FetchedRecordsController track changes in the results of a request. It can also feed table views, collection views, and animate cells when the results of the request change.** +**FetchedRecordsController track changes in the results of a request, feedd table views, collection views, and animate cells when the results of the request change.** It looks and behaves very much like [Core Data's NSFetchedResultsController](https://developer.apple.com/library/ios/documentation/CoreData/Reference/NSFetchedResultsController_Class/). @@ -6615,7 +6602,7 @@ Given a fetch request, and a type that adopts the [FetchableRecord] protocol, su See the [Demo Application](DemoApps/GRDBDemoiOS) for an sample app that uses FetchedRecordsController. -See also [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB), an [RxSwift](https://github.com/ReactiveX/RxSwift) extension, for a reactive way to track request changes. +When you don't need to animate a table or a collection view, use [ValueObservation] or [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) instead. - [Creating the Fetched Records Controller](#creating-the-fetched-records-controller) - [Responding to Changes](#responding-to-changes) @@ -7759,6 +7746,7 @@ Both DatabaseQueue and DatabasePool adopt the [DatabaseReader](http://groue.gith These protocols provide a unified API that let you write generic code that targets all concurrency modes. They fuel, for example: - [Migrations](#migrations) +- [ValueObservation] - [FetchedRecordsController](#fetchedrecordscontroller) - [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) From bb02d9d857f8eb1bd9c00a5991613dfbd8aad318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 31 Oct 2018 12:07:08 +0100 Subject: [PATCH 084/109] ValueObservation.map --- GRDB/Core/ValueObservation.swift | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 457f69c00..6dc510210 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -93,6 +93,37 @@ public protocol ValueReducer { mutating func value(_ fetched: Fetched) -> Value? } +extension ValueReducer { + public func map(_ transform: @escaping (Value) -> T?) -> MapValueReducer { + return MapValueReducer(self, transform) + } +} + +/// A ValueReducer whose values consist of those in a Base ValueReducer passed +/// through a transform function returning T. +/// +/// See ValueReducer.map(_:) +/// +/// :nodoc: +public struct MapValueReducer: ValueReducer { + private var base: Base + private let transform: (Base.Value) -> T? + + init(_ base: Base, _ transform: @escaping (Base.Value) -> T?) { + self.base = base + self.transform = transform + } + + public func fetch(_ db: Database) throws -> Base.Fetched { + return try base.fetch(db) + } + + public mutating func value(_ fetched: Base.Fetched) -> T? { + guard let value = base.value(fetched) else { return nil } + return transform(value) + } +} + /// TODO: doc public struct AnyValueReducer: ValueReducer { var _fetch: (Database) throws -> Fetched @@ -433,6 +464,13 @@ public struct ValueObservation { } } +extension ValueObservation where Reducer: ValueReducer { + /// TODO + public func map(_ transform: @escaping (Reducer.Value) -> T) -> ValueObservation> { + return ValueObservation>(tracking: observedRegion, reducer: reducer.map(transform)) + } +} + extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *regions*, and notifies the /// values returned by the *fetch* closure whenever one of the observed From 30363b4a5b9be6b03933a76b2cbb343c53ee7994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 31 Oct 2018 19:02:47 +0100 Subject: [PATCH 085/109] Tests for ValueObservation.map --- GRDB/Core/ValueObservation.swift | 19 +++-- .../ValueObservationReducerTests.swift | 74 +++++++++++++++++++ 2 files changed, 86 insertions(+), 7 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 6dc510210..e30e0077a 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -94,13 +94,14 @@ public protocol ValueReducer { } extension ValueReducer { + /// Returns a reducer which transforms the values returned by this reducer. public func map(_ transform: @escaping (Value) -> T?) -> MapValueReducer { return MapValueReducer(self, transform) } } /// A ValueReducer whose values consist of those in a Base ValueReducer passed -/// through a transform function returning T. +/// through a transform function. /// /// See ValueReducer.map(_:) /// @@ -124,18 +125,17 @@ public struct MapValueReducer: ValueReducer { } } -/// TODO: doc +/// A type-erased ValueReducer. public struct AnyValueReducer: ValueReducer { var _fetch: (Database) throws -> Fetched var _value: (Fetched) -> Value? - /// TODO: doc public init(fetch: @escaping (Database) throws -> Fetched, value: @escaping (Fetched) -> Value?) { self._fetch = fetch self._value = value } - public init(_ reducer: Reducer) where Reducer.Fetched == Fetched, Reducer.Value == Value { + public init(_ reducer: Base) where Base.Fetched == Fetched, Base.Value == Value { var reducer = reducer self._fetch = { try reducer.fetch($0) } self._value = { reducer.value($0) } @@ -465,9 +465,14 @@ public struct ValueObservation { } extension ValueObservation where Reducer: ValueReducer { - /// TODO - public func map(_ transform: @escaping (Reducer.Value) -> T) -> ValueObservation> { - return ValueObservation>(tracking: observedRegion, reducer: reducer.map(transform)) + /// Returns a ValueObservation which transforms the values returned by + /// this ValueObservation. + public func map(_ transform: @escaping (Reducer.Value) -> T) + -> ValueObservation> + { + return ValueObservation>( + tracking: observedRegion, + reducer: reducer.map(transform)) } } diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift index f66be5b2e..59ecac53e 100644 --- a/Tests/GRDBTests/ValueObservationReducerTests.swift +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -226,4 +226,78 @@ class ValueObservationReducerTests: GRDBTestCase { waitForExpectations(timeout: 1, handler: nil) XCTAssertEqual(counts, [1, 2]) } + + func testMapValueReducer() throws { + // We need something to change + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + // Track reducer proceess + var counts: [String] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 2 + + // The base reducer + var count = 0 + let reducer = AnyValueReducer( + fetch: { _ in /* don't fetch anything */ }, + value: { _ -> Int? in + count += 1 + return count + }) + + // The mapped reducer + let mapReducer = reducer.map { count -> String? in + if count % 2 == 0 { return nil } + return "\(count)" + } + + // Create an observation + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, reducer: mapReducer) + observation.extent = .databaseLifetime + + // Start observation + _ = try observation.start(in: dbQueue) { count in + counts.append(count) + notificationExpectation.fulfill() + } + + try dbQueue.inDatabase { db in + try db.execute("INSERT INTO t DEFAULT VALUES") + try db.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, ["1", "3"]) + } + + func testValueObservationMap() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } + + var counts: [String] = [] + let notificationExpectation = expectation(description: "notification") + notificationExpectation.assertForOverFulfill = true + notificationExpectation.expectedFulfillmentCount = 4 + + struct T: TableRecord { } + var observation = ValueObservation + .trackingCount(T.all()) + .map { "\($0)" } + observation.extent = .databaseLifetime + _ = try observation.start(in: dbQueue) { count in + counts.append(count) + notificationExpectation.fulfill() + } + + try dbQueue.inDatabase { + try $0.execute("INSERT INTO t DEFAULT VALUES") + try $0.execute("UPDATE t SET id = id") + try $0.execute("INSERT INTO t DEFAULT VALUES") + } + + waitForExpectations(timeout: 1, handler: nil) + XCTAssertEqual(counts, ["0", "1", "1", "2"]) + } } From 44af4e62a675a4f1b1033e86afea68ed54b68479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 31 Oct 2018 19:35:49 +0100 Subject: [PATCH 086/109] Documentation --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 58e53817d..a9427e9fb 100644 --- a/README.md +++ b/README.md @@ -262,8 +262,7 @@ Documentation - [Migrations](#migrations): Transform your database as your application evolves. - [Full-Text Search](#full-text-search): Perform efficient and customizable full-text searches. - [Joined Queries Support](#joined-queries-support): Consume complex joined queries. -- [Database Changes Observation](#database-changes-observation): Perform post-commit and post-rollback actions. -- [FetchedRecordsController](#fetchedrecordscontroller): Automated tracking of changes in a query results, plus UITableView animations. +- [Database Changes Observation](#database-changes-observation): Observe database changes and transactions - [Encryption](#encryption): Encrypt your database with SQLCipher. - [Backup](#backup): Dump the content of a database to another. @@ -2062,7 +2061,7 @@ Before jumping in the low-level wagon, here is the list of all SQLite APIs used - `sqlite3_busy_handler`, `sqlite3_busy_timeout`: see [Configuration.busyMode](http://groue.github.io/GRDB.swift/docs/3.4/Structs/Configuration.html) - `sqlite3_changes`, `sqlite3_total_changes`: see [Database.changesCount and Database.totalChangesCount](http://groue.github.io/GRDB.swift/docs/3.4/Classes/Database.html) - `sqlite3_close`, `sqlite3_close_v2`, `sqlite3_next_stmt`, `sqlite3_open_v2`: see [Database Connections](#database-connections) -- `sqlite3_commit_hook`, `sqlite3_rollback_hook`, `sqlite3_update_hook`: see [TransactionObserver Protocol](#transactionobserver-protocol), [FetchedRecordsController](#fetchedrecordscontroller) +- `sqlite3_commit_hook`, `sqlite3_rollback_hook`, `sqlite3_update_hook`: see [TransactionObserver Protocol](#transactionobserver-protocol), [ValueObservation], [FetchedRecordsController](#fetchedrecordscontroller) - `sqlite3_config`: see [Error Log](#error-log) - `sqlite3_create_collation_v2`: see [String Comparison](#string-comparison) - `sqlite3_db_release_memory`: see [Memory Management](#memory-management) From eb95562b738c3f69efbf5a8c76d01ac0f325cca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 31 Oct 2018 19:37:35 +0100 Subject: [PATCH 087/109] Documentation --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a9427e9fb..c6b607087 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,11 @@ See [Why Adopt GRDB?](Documentation/WhyAdoptGRDB.md) if you are looking for your GRDB ships with: - [Access to raw SQL and SQLite](#sqlite-api) -- [Records](#records): fetching and persistence methods for your custom structs and class hierarchies -- [Query Interface](#the-query-interface): a swift way to avoid the SQL language -- [WAL Mode Support](#database-pools): extra performance for multi-threaded applications -- [Migrations](#migrations): transform your database as your application evolves -- [Database Observation](#database-changes-observation): track database transactions, get notified of database changes +- [Records](#records): Fetching and persistence methods for your custom structs and class hierarchies. +- [Query Interface](#the-query-interface): A swift way to avoid the SQL language. +- [WAL Mode Support](#database-pools): Extra performance for multi-threaded applications. +- [Migrations](#migrations): Transform your database as your application evolves. +- [Database Observation](#database-changes-observation): Observe database changes and transactions. - [Full-Text Search](#full-text-search) - [Encryption](#encryption) - [Support for Custom SQLite Builds](Documentation/CustomSQLiteBuilds.md) @@ -262,7 +262,7 @@ Documentation - [Migrations](#migrations): Transform your database as your application evolves. - [Full-Text Search](#full-text-search): Perform efficient and customizable full-text searches. - [Joined Queries Support](#joined-queries-support): Consume complex joined queries. -- [Database Changes Observation](#database-changes-observation): Observe database changes and transactions +- [Database Changes Observation](#database-changes-observation): Observe database changes and transactions. - [Encryption](#encryption): Encrypt your database with SQLCipher. - [Backup](#backup): Dump the content of a database to another. From 7e8ebed7a8222e6854bd138f593ce3d939e89596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 31 Oct 2018 19:39:44 +0100 Subject: [PATCH 088/109] Documentation --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c6b607087..9657eebb8 100644 --- a/README.md +++ b/README.md @@ -5780,10 +5780,10 @@ Database Changes Observation GRDB puts this SQLite feature to some good use, and lets you observe the database in various ways: - [After Commit Hook](#after-commit-hook): The simplest way to handle successful transactions. -- [TransactionObserver Protocol](#transactionobserver-protocol): The low-level protocol for database observation -- [ValueObservation]: Automated tracking of changes in a request results -- [FetchedRecordsController](#fetchedrecordscontroller): Automated tracking of changes in a request results, with table view animations -- [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB): Automated tracking of changes in a request results, based on [RxSwift](https://github.com/ReactiveX/RxSwift) +- [TransactionObserver Protocol](#transactionobserver-protocol): Low-level database observation. +- [ValueObservation]: Automated tracking of database changes. +- [FetchedRecordsController](#fetchedrecordscontroller): Automated tracking of database changes, with table view animations. +- [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB): Automated tracking of database changes, with [RxSwift](https://github.com/ReactiveX/RxSwift). Database observation requires that a single [database queue](#database-queues) or [pool](#database-pools) is kept open for all the duration of the database usage. From 38e1cc9a274caab143de6da04f7a467e18140bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 1 Nov 2018 12:58:17 +0100 Subject: [PATCH 089/109] Use ValueObservation is demo application --- .../GRDBDemoiOS/PlayersViewController.swift | 153 ++++++++++-------- DemoApps/GRDBDemoiOS/README.md | 2 +- Documentation/Images/GRDBDemoScreenshot.png | Bin 325015 -> 291543 bytes README.md | 20 +-- 4 files changed, 95 insertions(+), 80 deletions(-) diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PlayersViewController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PlayersViewController.swift index 517ff1842..a47810a6d 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PlayersViewController.swift +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PlayersViewController.swift @@ -1,22 +1,23 @@ import UIKit import GRDB +/// PlayersViewController displays the list of players. class PlayersViewController: UITableViewController { - enum PlayerOrdering { + private enum PlayerOrdering { case byName case byScore } - var playersController: FetchedRecordsController! - - var playerOrdering: PlayerOrdering = .byScore { + @IBOutlet private weak var newPlayerButtonItem: UIBarButtonItem! + private var playersController: FetchedRecordsController! + private var playerCountObserver: TransactionObserver? + private var playerOrdering: PlayerOrdering = .byScore { didSet { try! playersController.setRequest(playersRequest) - configureNavigationItem() + configureOrderingBarButtonItem() } } - - var playersRequest: QueryInterfaceRequest { + private var playersRequest: QueryInterfaceRequest { switch playerOrdering { case .byName: return Player.orderedByName() @@ -25,57 +26,59 @@ class PlayersViewController: UITableViewController { } } - @IBOutlet weak var newPlayerButtonItem: UIBarButtonItem! - override func viewDidLoad() { super.viewDidLoad() - configureTableView() configureToolbar() - configureNavigationItem() + configureOrderingBarButtonItem() + configureTitle() + configureTableView() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) navigationController?.isToolbarHidden = false } -} - - -// MARK: - Navigation - -extension PlayersViewController { - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if segue.identifier == "Edit" { - let player = playersController.record(at: tableView.indexPathForSelectedRow!) - let controller = segue.destination as! PlayerEditionViewController - controller.title = player.name - controller.player = player - controller.presentation = .push - } - else if segue.identifier == "New" { - setEditing(false, animated: true) - let navigationController = segue.destination as! UINavigationController - let controller = navigationController.viewControllers.first as! PlayerEditionViewController - controller.title = "New Player" - controller.player = Player(id: nil, name: "", score: 0) - controller.presentation = .modal + private func configureToolbar() { + toolbarItems = [ + UIBarButtonItem(barButtonSystemItem: .trash, target: self, action: #selector(deletePlayers)), + UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil), + UIBarButtonItem(barButtonSystemItem: .refresh, target: self, action: #selector(refresh)), + UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil), + UIBarButtonItem(title: "💣", style: .plain, target: self, action: #selector(stressTest)), + ] + } + + private func configureOrderingBarButtonItem() { + navigationItem.leftBarButtonItems = [editButtonItem, newPlayerButtonItem] + + switch playerOrdering { + case .byScore: + navigationItem.rightBarButtonItem = UIBarButtonItem( + title: "Score ⬇︎", + style: .plain, + target: self, action: #selector(sortByName)) + case .byName: + navigationItem.rightBarButtonItem = UIBarButtonItem( + title: "Name ⬆︎", + style: .plain, + target: self, action: #selector(sortByScore)) } } - @IBAction func cancelPlayerEdition(_ segue: UIStoryboardSegue) { - // Player creation cancelled + private func configureTitle() { + // Track changes in the number of players + playerCountObserver = try! ValueObservation + .trackingCount(withUniquing: playersRequest) + .start(in: dbQueue) { [unowned self] count in + switch count { + case 0: self.navigationItem.title = "No Player" + case 1: self.navigationItem.title = "1 Player" + default: self.navigationItem.title = "\(count) Players" + } + } } - @IBAction func commitPlayerEdition(_ segue: UIStoryboardSegue) { - // Player creation committed - } -} - - -// MARK: - UITableViewDataSource - -extension PlayersViewController { private func configureTableView() { // Track changes in the database players playersController = try! FetchedRecordsController(dbQueue, request: playersRequest) @@ -118,7 +121,44 @@ extension PlayersViewController { // Initial fetch try! playersController.performFetch() } +} + + +// MARK: - Navigation + +extension PlayersViewController { + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + if segue.identifier == "Edit" { + let player = playersController.record(at: tableView.indexPathForSelectedRow!) + let controller = segue.destination as! PlayerEditionViewController + controller.title = player.name + controller.player = player + controller.presentation = .push + } + else if segue.identifier == "New" { + setEditing(false, animated: true) + let navigationController = segue.destination as! UINavigationController + let controller = navigationController.viewControllers.first as! PlayerEditionViewController + controller.title = "New Player" + controller.player = Player(id: nil, name: "", score: 0) + controller.presentation = .modal + } + } + + @IBAction func cancelPlayerEdition(_ segue: UIStoryboardSegue) { + // Player creation cancelled + } + + @IBAction func commitPlayerEdition(_ segue: UIStoryboardSegue) { + // Player creation committed + } +} + + +// MARK: - UITableViewDataSource + +extension PlayersViewController { override func numberOfSections(in tableView: UITableView) -> Int { return playersController.sections.count } @@ -156,33 +196,6 @@ extension PlayersViewController { // MARK: - Actions extension PlayersViewController { - private func configureNavigationItem() { - navigationItem.leftBarButtonItems = [editButtonItem, newPlayerButtonItem] - - switch playerOrdering { - case .byScore: - navigationItem.rightBarButtonItem = UIBarButtonItem( - title: "Score ⬇︎", - style: .plain, - target: self, action: #selector(sortByName)) - case .byName: - navigationItem.rightBarButtonItem = UIBarButtonItem( - title: "Name ⬆︎", - style: .plain, - target: self, action: #selector(sortByScore)) - } - } - - private func configureToolbar() { - toolbarItems = [ - UIBarButtonItem(barButtonSystemItem: .trash, target: self, action: #selector(deletePlayers)), - UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil), - UIBarButtonItem(barButtonSystemItem: .refresh, target: self, action: #selector(refresh)), - UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil), - UIBarButtonItem(title: "💣", style: .plain, target: self, action: #selector(stressTest)), - ] - } - @IBAction func sortByName() { setEditing(false, animated: true) playerOrdering = .byName diff --git a/DemoApps/GRDBDemoiOS/README.md b/DemoApps/GRDBDemoiOS/README.md index f8e18ffb4..9c0eb9562 100644 --- a/DemoApps/GRDBDemoiOS/README.md +++ b/DemoApps/GRDBDemoiOS/README.md @@ -25,7 +25,7 @@ Demo Application - [PlayersViewController.swift](GRDBDemoiOS/PlayersViewController.swift) - `PlayersViewController` displays a list of players, and animates its table view according to database changes with [FetchedRecordsController](../../README.md#fetchedrecordscontroller). + `PlayersViewController` displays a list of players. It keeps its title up-to-date with [ValueObservation](../../README.md#valueobservation), and animates its table view according to database changes with [FetchedRecordsController](../../README.md#fetchedrecordscontroller). - [PlayerEditionViewController.swift](GRDBDemoiOS/PlayerEditionViewController.swift) diff --git a/Documentation/Images/GRDBDemoScreenshot.png b/Documentation/Images/GRDBDemoScreenshot.png index 8ca1c391f526f924a091a4d1470a30523e0fa85c..f8f3a7bac2e06d5692d2180148b234ffb75e9270 100644 GIT binary patch literal 291543 zcmd42WmH_jvoAU`%%B6oT?R;y3=Y8wZh>II0t9z=Ck!qjK!U>{K@$iPg1ftu;O-FI zA;_Ej&$;)Wx87Rs)BEuDT6<>i?ym0YYS~r4u8LAqk;lcR#0CHWxQYrg8UO$|9st1P z!bC%*ysCT|g!%(pNxqf@0Di>b+?ha7??5*Vc_~2I2=y)ifCf-g)|8cZRz{`&|NL@r zaQH6{wY9bXUs%=B(n96x>gs;}{Mp&rSx!#Q#>NKtp9=!{*L~DwWo3o>ZES3`x3|~O z&|qih={w|B_-wK<6~d%5Q>f1*aSEnjw(<2pBv!&SXo(#dh6>OM5T|9k3WC@{Ndr@ z>gp;vIlaBTGcGQ1e0<{i`sVKLetLSgr>A#kXLoLH;o{<=yu5OMf4`)p^y}A>yu7^6 zpOcrDSCW#F&(6+{k58OkTz>ufos*N7o}RU^uvAl1S5WX33WcJhqi1I3FfcG29v%jV zgp7=g5fKqFF)`85(6+X=H#WAct*vitY$+)zFD%SUNlP0U8Clyoyw%ei8XElhv&O>0 z5+xr`FRy`t!8dO-1qB2?#Kee*h@gbIxA&*7Z}`)vPjz(-+uJ)Yl?`wLAIT#g#b1hv zr9ITwH?hV&Y#iQlb914Dtgf#5uJ}GYGHPo3Rw?KH-{}0fpIJZY?;p9ix;Z+(?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!cV-3p2b~Xps}C@ZNd{UmsM6QswH2-}2 zGkg~`&FN^!c`PDdLc@DR`O{v zD?=l;?IImtiarU!Yn|y<)Ghg61w>jd>CiImwR7_1+mEFz!PQ^4l%i^qXB9=vjFR}jHeuj19TN7n zFOwc)L0=}%hNoR3E4pR-x54X`d{Tq0lzK@PmY>EWxY|Y_M&9EtwA>wBx%ODqqShy) za+UvaL*VK-efYVb3=AY%nm3vAdT$+eAw2`wHbcGaK^D}iXO2{*$kEa1Th{2^P~ONvad8FOJvC zp!~d+rRlB7@$1SLwa;+)JftK)cqs6gdi>#JKnKQ@Y<*X!@J$Z+uM3OjkkH71VEU;7dr;$L^C7(W}(=dO+*my!7zTVl?^Me6y z2HvOqd^6*f-`^pm8F?g-TN%DGR_x|4}|BD9#gz(YHtyl8o(gndd67YBLFSR=bx6S|ge?w6Vq5uE@ diff --git a/README.md b/README.md index 9657eebb8..a792bd056 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ GRDB ships with: Companion libraries that enhance and extend GRDB: -- [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB): track database changes in a reactive way, with [RxSwift](https://github.com/ReactiveX/RxSwift). +- [RxGRDB]: track database changes in a reactive way, with [RxSwift](https://github.com/ReactiveX/RxSwift). - [GRDBObjc](https://github.com/groue/GRDBObjc): FMDB-compatible bindings to GRDB. @@ -357,7 +357,7 @@ The repository comes with a [demo application](DemoApps/GRDBDemoiOS) that shows - how to setup a database in an iOS app - how to define a simple [Codable Record](#codable-records) -- how to track database changes and animate a table view with [FetchedRecordsController](#fetchedrecordscontroller). +- how to track database changes with [ValueObservation] and [FetchedRecordsController].

@@ -2061,7 +2061,7 @@ Before jumping in the low-level wagon, here is the list of all SQLite APIs used - `sqlite3_busy_handler`, `sqlite3_busy_timeout`: see [Configuration.busyMode](http://groue.github.io/GRDB.swift/docs/3.4/Structs/Configuration.html) - `sqlite3_changes`, `sqlite3_total_changes`: see [Database.changesCount and Database.totalChangesCount](http://groue.github.io/GRDB.swift/docs/3.4/Classes/Database.html) - `sqlite3_close`, `sqlite3_close_v2`, `sqlite3_next_stmt`, `sqlite3_open_v2`: see [Database Connections](#database-connections) -- `sqlite3_commit_hook`, `sqlite3_rollback_hook`, `sqlite3_update_hook`: see [TransactionObserver Protocol](#transactionobserver-protocol), [ValueObservation], [FetchedRecordsController](#fetchedrecordscontroller) +- `sqlite3_commit_hook`, `sqlite3_rollback_hook`, `sqlite3_update_hook`: see [TransactionObserver Protocol](#transactionobserver-protocol), [ValueObservation], [FetchedRecordsController] - `sqlite3_config`: see [Error Log](#error-log) - `sqlite3_create_collation_v2`: see [String Comparison](#string-comparison) - `sqlite3_db_release_memory`: see [Memory Management](#memory-management) @@ -5782,8 +5782,8 @@ GRDB puts this SQLite feature to some good use, and lets you observe the databas - [After Commit Hook](#after-commit-hook): The simplest way to handle successful transactions. - [TransactionObserver Protocol](#transactionobserver-protocol): Low-level database observation. - [ValueObservation]: Automated tracking of database changes. -- [FetchedRecordsController](#fetchedrecordscontroller): Automated tracking of database changes, with table view animations. -- [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB): Automated tracking of database changes, with [RxSwift](https://github.com/ReactiveX/RxSwift). +- [FetchedRecordsController]: Automated tracking of database changes, with table view animations. +- [RxGRDB]: Automated tracking of database changes, with [RxSwift](https://github.com/ReactiveX/RxSwift). Database observation requires that a single [database queue](#database-queues) or [pool](#database-pools) is kept open for all the duration of the database usage. @@ -5971,7 +5971,7 @@ do { > :point_up: **Note**: the databaseDidChange(with:) and databaseWillCommit() callbacks must not touch the SQLite database. This limitation does not apply to databaseDidCommit and databaseDidRollback which can use their database argument. -[ValueObservation], [FetchedRecordsController](#fetchedrecordscontroller), and [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) are based on the TransactionObserver protocol. +[ValueObservation], [FetchedRecordsController], and [RxGRDB] are based on the TransactionObserver protocol. See also [TableChangeObserver.swift](https://gist.github.com/groue/2e21172719e634657dfd), which shows a transaction observer that notifies of modified database tables with NSNotificationCenter. @@ -6601,7 +6601,7 @@ Given a fetch request, and a type that adopts the [FetchableRecord] protocol, su See the [Demo Application](DemoApps/GRDBDemoiOS) for an sample app that uses FetchedRecordsController. -When you don't need to animate a table or a collection view, use [ValueObservation] or [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) instead. +When you don't need to animate a table or a collection view, use [ValueObservation] or [RxGRDB] instead. - [Creating the Fetched Records Controller](#creating-the-fetched-records-controller) - [Responding to Changes](#responding-to-changes) @@ -7746,8 +7746,8 @@ These protocols provide a unified API that let you write generic code that targe - [Migrations](#migrations) - [ValueObservation] -- [FetchedRecordsController](#fetchedrecordscontroller) -- [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB) +- [FetchedRecordsController] +- [RxGRDB] Only five types adopt those protocols: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. Expanding this set is not supported: any future GRDB release may break your custom writers and readers, without notice. @@ -8299,3 +8299,5 @@ This chapter has been renamed [Beyond FetchableRecord]. [Record Customization Options]: #record-customization-options [TableRecord]: #tablerecord-protocol [ValueObservation]: #valueobservation +[FetchedRecordsController]: #fetchedrecordscontroller +[RxGRDB]: http://github.com/RxSwiftCommunity/RxGRDB \ No newline at end of file From 51942046b97ffa0fabe1b75e9aa821aa194d8781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 1 Nov 2018 13:10:52 +0100 Subject: [PATCH 090/109] Avoid the "No output has been received in the last 10m0s" error on Travis --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 62b7ac67d..892b1c034 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,12 @@ XCODEVERSION := $(XCODEVERSION_MAJOR).$(XCODEVERSION_MINOR) # Used to determine if xcpretty is available XCPRETTY_PATH := $(shell command -v xcpretty 2> /dev/null) +# Avoid the "No output has been received in the last 10m0s" error on Travis: +COCOAPODS_EXTRA_TIME = +ifeq ($(TRAVIS),true) + COCOAPODS_EXTRA_TIME = --verbose +endif + # Tests # ===== @@ -334,7 +340,7 @@ endif test_CocoaPodsLint_GRDB: ifdef POD - $(POD) lib lint GRDB.swift.podspec --allow-warnings + $(POD) lib lint GRDB.swift.podspec --allow-warnings $(COCOAPODS_EXTRA_TIME) else @echo CocoaPods must be installed for test_CocoaPodsLint_GRDB @exit 1 @@ -342,7 +348,7 @@ endif test_CocoaPodsLint_GRDBPlus: ifdef POD - $(POD) lib lint GRDBPlus.podspec --allow-warnings + $(POD) lib lint GRDBPlus.podspec --allow-warnings $(COCOAPODS_EXTRA_TIME) else @echo CocoaPods must be installed for test_CocoaPodsLint_GRDBPlus @exit 1 @@ -350,7 +356,7 @@ endif test_CocoaPodsLint_GRDBCipher: ifdef POD - $(POD) lib lint GRDBCipher.podspec --allow-warnings + $(POD) lib lint GRDBCipher.podspec --allow-warnings $(COCOAPODS_EXTRA_TIME) else @echo CocoaPods must be installed for test_CocoaPodsLint_GRDBCipher @exit 1 From 74ca85e52c890ee40f5cbb200d0c2215548849cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 1 Nov 2018 13:16:04 +0100 Subject: [PATCH 091/109] More links to the demo app --- README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a792bd056..dc955eb36 100644 --- a/README.md +++ b/README.md @@ -347,13 +347,13 @@ If you decide to use Carthage despite this warning, and get any Carthage-related 4. Add the `GRDB.framework` from the targetted platform to the **Embedded Binaries** section of the **General** tab of your application target (extension target for WatchOS). -See the [Demo Application](DemoApps/GRDBDemoiOS) for an example of such integration. +> :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for an example of such integration. Demo Application ================ -The repository comes with a [demo application](DemoApps/GRDBDemoiOS) that shows you: +The repository comes with a [demo application](DemoApps/GRDBDemoiOS/README.md) that shows you: - how to setup a database in an iOS app - how to define a simple [Codable Record](#codable-records) @@ -440,7 +440,7 @@ let newPlaceCount = try dbQueue.write { db -> Int in **A database queue needs your application to follow rules in order to deliver its safety guarantees.** Please refer to the [Concurrency](#concurrency) chapter. -See the [Demo Application](DemoApps/GRDBDemoiOS) for a sample code that sets up a database queue on iOS. +> :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for a sample code that sets up a database queue on iOS. ### DatabaseQueue Configuration @@ -520,7 +520,7 @@ let newPlaceCount = try dbPool.write { db -> Int in **A database pool needs your application to follow rules in order to deliver its safety guarantees.** See the [Concurrency](#concurrency) chapter for more details about database pools, how they differ from database queues, and advanced use cases. -See the [Demo Application](DemoApps/GRDBDemoiOS) for a sample code that sets up a database queue on iOS, and just replace DatabaseQueue with DatabasePool. +> :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for a sample code that sets up a database queue on iOS, and just replace DatabaseQueue with DatabasePool. ### DatabasePool Configuration @@ -2096,6 +2096,8 @@ Your custom structs and classes can adopt each protocol individually, and opt in > :point_up: **Note**: if you are familiar with Core Data's NSManagedObject or Realm's Object, you may experience a cultural shock: GRDB records are not uniqued, do not auto-update, and do not lazy-load. This is both a purpose, and a consequence of protocol-oriented programming. You should read [How to build an iOS application with SQLite and GRDB.swift](https://medium.com/@gwendal.roue/how-to-build-an-ios-application-with-sqlite-and-grdb-swift-d023a06c29b3) for a general introduction. > > :bulb: **Tip**: after you have read this chapter, check the [Good Practices for Designing Record Types](Documentation/GoodPracticesForDesigningRecordTypes.md) Guide. +> +> :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for an sample app that uses records. **Overview** @@ -2685,6 +2687,8 @@ For more information about Codable records, see: - [The userInfo Dictionary] - [Tip: Use Coding Keys as Columns](#tip-use-coding-keys-as-columns) +> :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for an sample app that uses Codable records. + ### JSON Columns @@ -6227,6 +6231,8 @@ An initial fetch is performed as soon as the observation starts: the view is set The view controller stores the observer returned by the `start` method in a property. This allows the view controller to control the duration of the observation. When the observer is deallocated, the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. +> :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for an sample app that uses ValueObservation. + - [ValueObservation.trackingCount, trackingOne, trackingAll](#valueobservationtrackingcount-trackingone-trackingall) - [ValueObservation.tracking(_:fetch:)](#valueobservationtracking_fetch) - [ValueObservation.tracking(_:reducer:)](#valueobservationtracking_reducer) @@ -6599,7 +6605,7 @@ It looks and behaves very much like [Core Data's NSFetchedResultsController](htt Given a fetch request, and a type that adopts the [FetchableRecord] protocol, such as a subclass of the [Record](#record-class) class, a FetchedRecordsController is able to track changes in the results of the fetch request, notify of those changes, and return the results of the request in a form that is suitable for a table view or a collection view, with one cell per fetched record. -See the [Demo Application](DemoApps/GRDBDemoiOS) for an sample app that uses FetchedRecordsController. +> :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for an sample app that uses FetchedRecordsController. When you don't need to animate a table or a collection view, use [ValueObservation] or [RxGRDB] instead. @@ -6896,7 +6902,7 @@ controller.trackChanges( > :warning: **Warning**: notification of individual record changes (the `onChange` callback) has FetchedRecordsController use a diffing algorithm that has a high complexity, a high memory consumption, and is thus **not suited for large result sets**. One hundred rows is probably OK, but one thousand is probably not. If your application experiences problems with large lists, see [Issue 263](https://github.com/groue/GRDB.swift/issues/263) for more information. -See the [Demo Application](DemoApps/GRDBDemoiOS) for an sample app that uses FetchedRecordsController to animate a table view. +> :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for an sample app that uses FetchedRecordsController to animate a table view. > :point_up: **Note**: our sample code above uses `unowned` references to the table view controller. This is a safe pattern as long as the table view controller owns the fetched records controller, and is deallocated from the main thread (this is usually the case). In other situations, prefer weak references. @@ -7495,7 +7501,7 @@ Those guarantees hold as long as you follow three rules: This means that opening a new connection each time you access the database is a bad idea. Do share a single connection instead. - See the [Demo Application](DemoApps/GRDBDemoiOS) for an sample app that sets up a single database queue that is available throughout the application. + See the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for an sample app that sets up a single database queue that is available throughout the application. If there are several instances of database queues or pools that write in the same database, a multi-threaded application will eventually face "database is locked" errors. See [Dealing with External Connections](#dealing-with-external-connections). @@ -8244,7 +8250,7 @@ Sample Code =========== - The [Documentation](#documentation) is full of GRDB snippets. -- [Demo Application](DemoApps/GRDBDemoiOS): A sample iOS application. +- [Demo Application](DemoApps/GRDBDemoiOS/README.md): A sample iOS application. - [WWDC Companion](https://github.com/groue/WWDCCompanion): A sample iOS application. - Check `GRDB.xcworkspace`: it contains GRDB-enabled playgrounds to play with. - How to synchronize a database table with a JSON payload: [JSONSynchronization.playground](Playgrounds/JSONSynchronization.playground/Contents.swift) From d53412d404d852b95f0a8e08710f0c10ae93c5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 1 Nov 2018 13:22:02 +0100 Subject: [PATCH 092/109] Documentation --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dc955eb36..d660f30b7 100644 --- a/README.md +++ b/README.md @@ -6605,10 +6605,10 @@ It looks and behaves very much like [Core Data's NSFetchedResultsController](htt Given a fetch request, and a type that adopts the [FetchableRecord] protocol, such as a subclass of the [Record](#record-class) class, a FetchedRecordsController is able to track changes in the results of the fetch request, notify of those changes, and return the results of the request in a form that is suitable for a table view or a collection view, with one cell per fetched record. +> :point_up: **Note**: when you don't need to animate a table or a collection view, use [ValueObservation] or [RxGRDB] instead. +> > :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for an sample app that uses FetchedRecordsController. -When you don't need to animate a table or a collection view, use [ValueObservation] or [RxGRDB] instead. - - [Creating the Fetched Records Controller](#creating-the-fetched-records-controller) - [Responding to Changes](#responding-to-changes) - [The Changes Notifications](#the-changes-notifications) @@ -6901,10 +6901,10 @@ controller.trackChanges( ``` > :warning: **Warning**: notification of individual record changes (the `onChange` callback) has FetchedRecordsController use a diffing algorithm that has a high complexity, a high memory consumption, and is thus **not suited for large result sets**. One hundred rows is probably OK, but one thousand is probably not. If your application experiences problems with large lists, see [Issue 263](https://github.com/groue/GRDB.swift/issues/263) for more information. - -> :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for an sample app that uses FetchedRecordsController to animate a table view. - +> > :point_up: **Note**: our sample code above uses `unowned` references to the table view controller. This is a safe pattern as long as the table view controller owns the fetched records controller, and is deallocated from the main thread (this is usually the case). In other situations, prefer weak references. +> +> :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for an sample app that uses FetchedRecordsController to animate a table view. ### FetchedRecordsController Concurrency From 1867ee91dea413a7a08d5a096de075b84b84d072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 1 Nov 2018 13:38:54 +0100 Subject: [PATCH 093/109] Documentation --- CHANGELOG.md | 4 +--- README.md | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38e4ae7e9..319a712d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,7 @@ Release Notes ## Next Version -This release comes with **ValueObservation**, a new type which can track the results of database requests, and notifies fresh values each time the database changes. - -ValueObservation provides convenient APIs for applications: +This release comes with **[ValueObservation](README.md#valueobservation)**, a new type which tracks the results of database requests, and notifies fresh values whenever the database changes: ```swift let observer = ValueObversation diff --git a/README.md b/README.md index d660f30b7..6f462e80f 100644 --- a/README.md +++ b/README.md @@ -6192,9 +6192,9 @@ protocol TransactionObserverType : class { ## ValueObservation -**ValueObservation automatically tracks changes in the results of a [request](#requests).** +**ValueObservation tracks changes in the results of database [requests](#requests), and notifies fresh values whenever the database changes.** -It is designed for easy consumption of fresh values by an application. For example, you will find below a typical UIViewController setup: +For example, here is a typical UIViewController which observes the database in order to keep its view up-to-date: ```swift class PlayerViewController: UIViewController { @@ -6204,7 +6204,7 @@ class PlayerViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - // Define a ValueObservation that tracks a request + // Define a ValueObservation which tracks a player let request = Player.filter(key: 42) let observation = ValueObservation.trackingOne(request) @@ -6212,6 +6212,7 @@ class PlayerViewController: UIViewController { observer = try! observation.start( in: dbQueue, onChange: { [unowned self] player: Player? in + // Player has changed: update view self.nameLabel.text = player?.name }) } From f7b79e05f6fb4fdbd0ba7d75e2cae4c158518fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 1 Nov 2018 16:59:39 +0100 Subject: [PATCH 094/109] Attempt at addressing https://github.com/groue/GRDB.swift/issues/430 --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6f462e80f..6bee8a286 100644 --- a/README.md +++ b/README.md @@ -2089,9 +2089,11 @@ try dbQueue.write { db in } ``` -Of course, you need to open a [database connection](#database-connections), and [create a database table](#database-schema) first. +Of course, you need to open a [database connection](#database-connections), and [create database tables](#database-schema) first. -Your custom structs and classes can adopt each protocol individually, and opt in to focused sets of features. Or you can subclass the `Record` class, and get the full toolkit in one go: fetching methods, persistence methods, and record comparison. See the [list of record methods](#list-of-record-methods) for an overview. +To define your custom records, you subclass the ready-made `Record` class, or you extend your structs and classes with protocols that come with focused sets of features: fetching methods, persistence methods, record comparison... + +Extending structs with record protocols is more "swifty". Subclassing the Record class is more "classic". You can choose either way. See some [examples of record definitions](#examples-of-record-definitions), and the [list of record methods](#list-of-record-methods) for an overview. > :point_up: **Note**: if you are familiar with Core Data's NSManagedObject or Realm's Object, you may experience a cultural shock: GRDB records are not uniqued, do not auto-update, and do not lazy-load. This is both a purpose, and a consequence of protocol-oriented programming. You should read [How to build an iOS application with SQLite and GRDB.swift](https://medium.com/@gwendal.roue/how-to-build-an-ios-application-with-sqlite-and-grdb-swift-d023a06c29b3) for a general introduction. > From 842eaf0816c48e3dd4af768755c2a59fd3da80ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 1 Nov 2018 21:46:59 +0100 Subject: [PATCH 095/109] ValueObservation: perform uniquing by default --- .../GRDBDemoiOS/PlayersViewController.swift | 2 +- GRDB.xcodeproj/project.pbxproj | 6 - GRDB/Core/ValueObservation.swift | 444 ++---------------- GRDBCipher.xcodeproj/project.pbxproj | 10 - GRDBCustom.xcodeproj/project.pbxproj | 6 - .../ValueObservationCountTests.swift | 54 +-- ...rvationDatabaseValueConvertibleTests.swift | 179 ++----- .../ValueObservationRecordTests.swift | 116 +---- .../ValueObservationReducerTests.swift | 5 +- .../GRDBTests/ValueObservationRowTests.swift | 116 +---- ...ationStatementColumnConvertibleTests.swift | 148 ------ 11 files changed, 151 insertions(+), 935 deletions(-) delete mode 100644 Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PlayersViewController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PlayersViewController.swift index a47810a6d..bd0258d82 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PlayersViewController.swift +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PlayersViewController.swift @@ -69,7 +69,7 @@ class PlayersViewController: UITableViewController { private func configureTitle() { // Track changes in the number of players playerCountObserver = try! ValueObservation - .trackingCount(withUniquing: playersRequest) + .trackingCount(playersRequest) .start(in: dbQueue) { [unowned self] count in switch count { case 0: self.navigationItem.title = "No Player" diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index 00806ec7d..b42142903 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -137,8 +137,6 @@ 563B071621862C4700B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071421862C4600B38F35 /* ValueObservationRecordTests.swift */; }; 563B071821862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071721862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; 563B071921862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071721862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; - 563B0723218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0722218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; - 563B0724218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0722218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; 563EF415215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF416215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; 563EF417215F87EB007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF414215F87EB007DAACD /* OrderedDictionary.swift */; }; @@ -922,7 +920,6 @@ 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; 563B071421862C4600B38F35 /* ValueObservationRecordTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRecordTests.swift; sourceTree = ""; }; 563B071721862F4C00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationDatabaseValueConvertibleTests.swift; sourceTree = ""; }; - 563B0722218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationStatementColumnConvertibleTests.swift; sourceTree = ""; }; 563EF414215F87EB007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF42C2161180D007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF43E216131D1007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1496,7 +1493,6 @@ 563B06BC2185CCD300B38F35 /* ValueObservationReducerTests.swift */, 563B0704218627F700B38F35 /* ValueObservationRowTests.swift */, 563B06C12185D29F00B38F35 /* ValueObservationSchedulingTests.swift */, - 563B0722218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */, ); name = ValueObservation; sourceTree = ""; @@ -2799,7 +2795,6 @@ 562393641DEE06D300A6B01F /* CursorTests.swift in Sources */, 563B06C62185D29F00B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5657AB5A1D108BA9006283EF /* FoundationNSStringTests.swift in Sources */, - 563B0724218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 56300B6C1C53D3E8005A543B /* TableRecord+QueryInterfaceRequestTests.swift in Sources */, 5674A7231F30A8DF0095F066 /* MutablePersistableRecordEncodableTests.swift in Sources */, 56F0B9921B6001C600A2F135 /* FoundationNSDateTests.swift in Sources */, @@ -2976,7 +2971,6 @@ 5653EAD620944B4F00F46237 /* AssociationChainRowScopesTests.swift in Sources */, 563B06C52185D29F00B38F35 /* ValueObservationSchedulingTests.swift in Sources */, 5698AC801DA380A20056AF8C /* VirtualTableModuleTests.swift in Sources */, - 563B0723218634CC00B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 56D496821D813131008276D7 /* TransactionObserverTests.swift in Sources */, 56D496941D81317B008276D7 /* SchedulingWatchdogTests.swift in Sources */, 5674A7201F30A8DF0095F066 /* MutablePersistableRecordEncodableTests.swift in Sources */, diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index e30e0077a..9c3c8f462 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -197,7 +197,7 @@ public enum ValueReducers { } } - public struct UniqueRecords: ValueReducer { + public struct Records: ValueReducer { let _fetch: (Database) throws -> [Row] var rows: [Row]? @@ -214,6 +214,7 @@ public enum ValueReducers { /// :nodoc: public mutating func value(_ newRows: [Row]) -> [Record]? { if let rows = rows, rows == newRows { + // Don't notify consecutive identical rows return nil } self.rows = newRows @@ -221,7 +222,7 @@ public enum ValueReducers { } } - public struct UniqueRecord: ValueReducer { + public struct Record: ValueReducer { let _fetch: (Database) throws -> Row? var row: Row?? @@ -238,6 +239,7 @@ public enum ValueReducers { /// :nodoc: public mutating func value(_ newRow: Row?) -> Record?? { if let row = row, row == newRow { + // Don't notify consecutive identical row return nil } self.row = newRow @@ -245,7 +247,7 @@ public enum ValueReducers { } } - public struct UniqueValues: ValueReducer { + public struct Values: ValueReducer { let _fetch: (Database) throws -> [DatabaseValue] var dbValues: [DatabaseValue]? @@ -262,6 +264,7 @@ public enum ValueReducers { /// :nodoc: public mutating func value(_ newDbValues: [DatabaseValue]) -> [T]? { if let dbValues = dbValues, dbValues == newDbValues { + // Don't notify consecutive identical dbValues return nil } self.dbValues = newDbValues @@ -269,9 +272,10 @@ public enum ValueReducers { } } - public struct UniqueValue: ValueReducer { + public struct Value: ValueReducer { let _fetch: (Database) throws -> DatabaseValue? var dbValue: DatabaseValue?? + var previousValueWasNil = false /// TODO public init(_ fetch: @escaping (Database) throws -> DatabaseValue?) { @@ -286,14 +290,34 @@ public enum ValueReducers { /// :nodoc: public mutating func value(_ newDbValue: DatabaseValue?) -> T?? { if let dbValue = dbValue, dbValue == newDbValue { + // Don't notify consecutive identical dbValue return nil } self.dbValue = newDbValue - return .some(newDbValue.map { T.decode(from: $0, conversionContext: nil) }) + guard let dbValue = newDbValue else { + if previousValueWasNil { + return nil + } else { + previousValueWasNil = true + return .some(nil) + } + } + let value = T.decodeIfPresent(from: dbValue, conversionContext: nil) + if let value = value { + previousValueWasNil = false + return .some(value) + } else { + if previousValueWasNil { + return nil + } else { + previousValueWasNil = true + return .some(nil) + } + } } } - public struct UniqueOptionalValues: ValueReducer { + public struct OptionalValues: ValueReducer { let _fetch: (Database) throws -> [DatabaseValue] var dbValues: [DatabaseValue]? @@ -310,6 +334,7 @@ public enum ValueReducers { /// :nodoc: public mutating func value(_ newDbValues: [DatabaseValue]) -> [T?]? { if let dbValues = dbValues, dbValues == newDbValues { + // Don't notify consecutive identical dbValues return nil } self.dbValues = newDbValues @@ -613,38 +638,6 @@ extension ValueObservation where Reducer == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingCount(_ request: Request) - -> ValueObservation> - { - return ValueObservation.tracking(request, fetch: request.fetchCount) - } - - /// Creates a ValueObservation which observes *request*, and notifies a - /// fresh count whenever the request is impacted by a database transaction. - /// - /// For example: - /// - /// let request = Player.all() - /// let observation = ValueObservation.trackingCount(withUniquing: request) - /// - /// let observer = try observation.start(in: dbQueue) { count: Int in - /// print("number of players has changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `start` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func trackingCount(withUniquing request: Request) -> ValueObservation> { return ValueObservation.tracking(withUniquing: request, fetch: request.fetchCount) @@ -681,39 +674,6 @@ extension ValueObservation where Reducer == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingAll(_ request: Request) - -> ValueObservation> - where Request.RowDecoder == Row - { - return ValueObservation.tracking(request, fetch: request.fetchAll) - } - - /// Creates a ValueObservation which observes *request*, and notifies - /// fresh rows whenever the request is impacted by a database transaction. - /// - /// For example: - /// - /// let request = SQLRequest("SELECT * FROM player") - /// let observation = ValueObservation.trackingAll(withUniquing: request) - /// - /// let observer = try observation.start(in: dbQueue) { rows: [Row] in - /// print("players have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `start` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func trackingAll(withUniquing request: Request) -> ValueObservation> where Request.RowDecoder == Row { @@ -747,39 +707,6 @@ extension ValueObservation where Reducer == Void { /// - parameter request: the observed request. /// - returns: a new ValueObservation. public static func trackingOne(_ request: Request) - -> ValueObservation> - where Request.RowDecoder == Row - { - return ValueObservation.tracking(request, fetch: request.fetchOne) - } - - /// Creates a ValueObservation which observes *request*, and notifies a - /// fresh row whenever the request is impacted by a database transaction. - /// - /// For example: - /// - /// let request = SQLRequest("SELECT * FROM player WHERE id = ?", arguments: [1]) - /// let observation = ValueObservation.trackingOne(withUniquing: request) - /// - /// let observer = try observation.start(in: dbQueue) { row: Row? in - /// print("players have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `start` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a new ValueObservation. - public static func trackingOne(withUniquing request: Request) -> ValueObservation> where Request.RowDecoder == Row { @@ -818,46 +745,12 @@ extension ValueObservation where Reducer == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingAll(_ request: Request) - -> ValueObservation> + -> ValueObservation> where Request.RowDecoder: FetchableRecord { - return ValueObservation.tracking(request, fetch: request.fetchAll) - } - - /// Creates a ValueObservation which observes *request*, and notifies - /// fresh records whenever the request is impacted by a - /// database transaction. - /// - /// For example: - /// - /// let request = Player.all() - /// let observation = ValueObservation.trackingAll(withUniquing: request) - /// - /// let observer = try observation.start(in: dbQueue) { players: [Player] in - /// print("players have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `start` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func trackingAll(withUniquing request: Request) - -> ValueObservation> - where Request.RowDecoder: FetchableRecord - { - return ValueObservation>.tracking( + return ValueObservation>.tracking( request, - reducer: ValueReducers.UniqueRecords { try Row.fetchAll($0, request) }) + reducer: ValueReducers.Records { try Row.fetchAll($0, request) }) } /// Creates a ValueObservation which observes *request*, and notifies a @@ -887,45 +780,12 @@ extension ValueObservation where Reducer == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingOne(_ request: Request) -> - ValueObservation> + ValueObservation> where Request.RowDecoder: FetchableRecord { - return ValueObservation.tracking(request, fetch: request.fetchOne) - } - - /// Creates a ValueObservation which observes *request*, and notifies a - /// fresh record whenever the request is impacted by a database transaction. - /// - /// For example: - /// - /// let request = Player.filter(key: 1) - /// let observation = ValueObservation.trackingOne(withUniquing: request) - /// - /// let observer = try observation.start(in: dbQueue) { player: Player? in - /// print("player has changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `start` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func trackingOne(withUniquing request: Request) -> - ValueObservation> - where Request.RowDecoder: FetchableRecord - { - return ValueObservation>.tracking( + return ValueObservation>.tracking( request, - reducer: ValueReducers.UniqueRecord { try Row.fetchOne($0, request) }) + reducer: ValueReducers.Record { try Row.fetchOne($0, request) }) } } @@ -960,46 +820,12 @@ extension ValueObservation where Reducer == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingAll(_ request: Request) - -> ValueObservation> + -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible { - return ValueObservation.tracking(request, fetch: request.fetchAll) - } - - /// Creates a ValueObservation which observes *request*, and notifies - /// fresh values whenever the request is impacted by a - /// database transaction. - /// - /// For example: - /// - /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.trackingAll(withUniquing: request) - /// - /// let observer = try observation.start(in: dbQueue) { names: [String] in - /// print("player name have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `start` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func trackingAll(withUniquing request: Request) - -> ValueObservation> - where Request.RowDecoder: DatabaseValueConvertible - { - return ValueObservation>.tracking( + return ValueObservation>.tracking( request, - reducer: ValueReducers.UniqueValues { try DatabaseValue.fetchAll($0, request) }) + reducer: ValueReducers.Values { try DatabaseValue.fetchAll($0, request) }) } /// Creates a ValueObservation which observes *request*, and notifies a @@ -1029,116 +855,12 @@ extension ValueObservation where Reducer == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingOne(_ request: Request) - -> ValueObservation> + -> ValueObservation> where Request.RowDecoder: DatabaseValueConvertible { - return ValueObservation.tracking(request, fetch: request.fetchOne) - } - - /// Creates a ValueObservation which observes *request*, and notifies a - /// fresh value whenever the request is impacted by a database transaction. - /// - /// For example: - /// - /// let request = Player.select(max(Column("score")), as: Int.self) - /// let observation = ValueObservation.trackingOne(withUniquing: request) - /// - /// let observer = try observation.start(in: dbQueue) { maxScore: Int? in - /// print("maximum score has changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `start` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func trackingOne(withUniquing request: Request) - -> ValueObservation> - where Request.RowDecoder: DatabaseValueConvertible - { - return ValueObservation>.tracking( + return ValueObservation>.tracking( request, - reducer: ValueReducers.UniqueValue { try DatabaseValue.fetchOne($0, request) }) - } -} - -// MARK: - DatabaseValueConvertible & StatementColumnConvertible Observation - -extension ValueObservation where Reducer == Void { - /// Creates a ValueObservation which observes *request*, and notifies - /// fresh values whenever the request is impacted by a - /// database transaction. - /// - /// For example: - /// - /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.trackingAll(request) - /// - /// let observer = try observation.start(in: dbQueue) { names: [String] in - /// print("player name have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `start` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func trackingAll(_ request: Request) - -> ValueObservation> - where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible - { - return ValueObservation.tracking(request, fetch: request.fetchAll) - } - - /// Creates a ValueObservation which observes *request*, and notifies a - /// fresh value whenever the request is impacted by a database transaction. - /// - /// For example: - /// - /// let request = Player.select(max(Column("score")), as: Int.self) - /// let observation = ValueObservation.trackingOne(request) - /// - /// let observer = try observation.start(in: dbQueue) { maxScore: Int? in - /// print("maximum score has changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `start` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func trackingOne(_ request: Request) - -> ValueObservation> - where Request.RowDecoder: DatabaseValueConvertible & StatementColumnConvertible - { - return ValueObservation.tracking(request, fetch: request.fetchOne) + reducer: ValueReducers.Value { try DatabaseValue.fetchOne($0, request) }) } } @@ -1173,86 +895,12 @@ extension ValueObservation where Reducer == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingAll(_ request: Request) - -> ValueObservation> + -> ValueObservation> where Request.RowDecoder: _OptionalProtocol, Request.RowDecoder._Wrapped: DatabaseValueConvertible { - return ValueObservation.tracking(request, fetch: request.fetchAll) - } - - /// Creates a ValueObservation which observes *request*, and notifies - /// fresh values whenever the request is impacted by a - /// database transaction. - /// - /// For example: - /// - /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.trackingAll(withUniquing: request) - /// - /// let observer = try observation.start(in: dbQueue) { names: [String] in - /// print("player name have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `start` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func trackingAll(withUniquing request: Request) - -> ValueObservation> - where Request.RowDecoder: _OptionalProtocol, - Request.RowDecoder._Wrapped: DatabaseValueConvertible - { - return ValueObservation>.tracking( + return ValueObservation>.tracking( request, - reducer: ValueReducers.UniqueOptionalValues { try DatabaseValue.fetchAll($0, request) }) - } -} - -// MARK: - Optional DatabaseValueConvertible & StatementColumnConvertible Observation - -extension ValueObservation where Reducer == Void { - /// Creates a ValueObservation which observes *request*, and notifies - /// fresh values whenever the request is impacted by a - /// database transaction. - /// - /// For example: - /// - /// let request = Player.select(Column("name"), as: String.self) - /// let observation = ValueObservation.trackingAll(request) - /// - /// let observer = try observation.start(in: dbQueue) { names: [String] in - /// print("player name have changed") - /// } - /// - /// The returned observation has the default configuration: - /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. - /// - Upon subsequent database changes, fresh values are notified on the - /// main queue. - /// - The observation lasts until the observer returned by - /// `start` is deallocated. - /// - /// See ValueObservation for more information. - /// - /// - parameter request: the observed request. - /// - returns: a ValueObservation. - public static func trackingAll(_ request: Request) - -> ValueObservation> - where Request.RowDecoder: _OptionalProtocol, - Request.RowDecoder._Wrapped: DatabaseValueConvertible & StatementColumnConvertible - { - return ValueObservation.tracking(request, fetch: request.fetchAll) + reducer: ValueReducers.OptionalValues { try DatabaseValue.fetchAll($0, request) }) } } diff --git a/GRDBCipher.xcodeproj/project.pbxproj b/GRDBCipher.xcodeproj/project.pbxproj index 9f4650dab..f6541248d 100755 --- a/GRDBCipher.xcodeproj/project.pbxproj +++ b/GRDBCipher.xcodeproj/project.pbxproj @@ -218,10 +218,6 @@ 563B071F21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; 563B072021862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; 563B072121862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; - 563B0729218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; - 563B072A218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; - 563B072B218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; - 563B072C218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; 563EF424215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF425215F8A88007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF422215F8A88007DAACD /* OrderedDictionary.swift */; }; 563EF43C2161183E007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF43A2161183E007DAACD /* AssociationAggregate.swift */; }; @@ -1040,7 +1036,6 @@ 563B07072186280500B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; 563B070C21862C3500B38F35 /* ValueObservationRecordTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRecordTests.swift; sourceTree = ""; }; 563B071D21862F5D00B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationDatabaseValueConvertibleTests.swift; sourceTree = ""; }; - 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationStatementColumnConvertibleTests.swift; sourceTree = ""; }; 563EF422215F8A88007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF43A2161183E007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF44421613212007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1584,7 +1579,6 @@ 563B06DF2185E07200B38F35 /* ValueObservationReducerTests.swift */, 563B07072186280500B38F35 /* ValueObservationRowTests.swift */, 563B06E02185E07200B38F35 /* ValueObservationSchedulingTests.swift */, - 563B0728218634E100B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */, ); name = ValueObservation; sourceTree = ""; @@ -2509,7 +2503,6 @@ 560FC59E1CB00B880014AA8E /* FoundationNSDateTests.swift in Sources */, 568068321EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, 560FC59F1CB00B880014AA8E /* DatabaseTests.swift in Sources */, - 563B0729218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 560FC5A01CB00B880014AA8E /* QueryInterfaceRequestTests.swift in Sources */, 5698ACCF1DA8C2620056AF8C /* RecordPrimaryKeyHiddenRowIDTests.swift in Sources */, 560FC5A21CB00B880014AA8E /* DatabaseFunctionTests.swift in Sources */, @@ -2686,7 +2679,6 @@ 5671565B1CB16729007DC145 /* TableRecord+QueryInterfaceRequestTests.swift in Sources */, 568068331EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, 5671565C1CB16729007DC145 /* FoundationNSDateTests.swift in Sources */, - 563B072A218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 5671565D1CB16729007DC145 /* DatabaseTests.swift in Sources */, 5671565E1CB16729007DC145 /* QueryInterfaceRequestTests.swift in Sources */, 5698ACD01DA8C2620056AF8C /* RecordPrimaryKeyHiddenRowIDTests.swift in Sources */, @@ -2979,7 +2971,6 @@ 56AFCA6B1CB1AA9900F48B96 /* DatabaseTimestampTests.swift in Sources */, 568068361EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, 56AFCA6C1CB1AA9900F48B96 /* StatementArguments+FoundationTests.swift in Sources */, - 563B072B218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 562393651DEE06D300A6B01F /* CursorTests.swift in Sources */, 5657AB5B1D108BA9006283EF /* FoundationNSStringTests.swift in Sources */, 56AFCA6D1CB1AA9900F48B96 /* TableRecord+QueryInterfaceRequestTests.swift in Sources */, @@ -3156,7 +3147,6 @@ 56AFCAC41CB1ABC800F48B96 /* DatabaseTimestampTests.swift in Sources */, 568068371EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, 56AFCAC51CB1ABC800F48B96 /* StatementArguments+FoundationTests.swift in Sources */, - 563B072C218634E200B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 562393661DEE06D300A6B01F /* CursorTests.swift in Sources */, 56AFCAC61CB1ABC800F48B96 /* TableRecord+QueryInterfaceRequestTests.swift in Sources */, 56AFCAC71CB1ABC800F48B96 /* FoundationNSDateTests.swift in Sources */, diff --git a/GRDBCustom.xcodeproj/project.pbxproj b/GRDBCustom.xcodeproj/project.pbxproj index 3d164e482..7b4462c5f 100755 --- a/GRDBCustom.xcodeproj/project.pbxproj +++ b/GRDBCustom.xcodeproj/project.pbxproj @@ -63,8 +63,6 @@ 563B071321862C3E00B38F35 /* ValueObservationRecordTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071121862C3E00B38F35 /* ValueObservationRecordTests.swift */; }; 563B071B21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071A21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; 563B071C21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B071A21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */; }; - 563B0726218634D800B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0725218634D700B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; - 563B0727218634D800B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B0725218634D700B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */; }; 563EF420215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF421215F8A76007DAACD /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */; }; 563EF4382161182C007DAACD /* AssociationAggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563EF4362161182C007DAACD /* AssociationAggregate.swift */; }; @@ -681,7 +679,6 @@ 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRowTests.swift; sourceTree = ""; }; 563B071121862C3E00B38F35 /* ValueObservationRecordTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRecordTests.swift; sourceTree = ""; }; 563B071A21862F5600B38F35 /* ValueObservationDatabaseValueConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationDatabaseValueConvertibleTests.swift; sourceTree = ""; }; - 563B0725218634D700B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationStatementColumnConvertibleTests.swift; sourceTree = ""; }; 563EF41E215F8A76007DAACD /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 563EF4362161182C007DAACD /* AssociationAggregate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregate.swift; sourceTree = ""; }; 563EF441216131F5007DAACD /* AssociationAggregateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssociationAggregateTests.swift; sourceTree = ""; }; @@ -1198,7 +1195,6 @@ 563B06CF2185E04600B38F35 /* ValueObservationReducerTests.swift */, 563B0701218627DE00B38F35 /* ValueObservationRowTests.swift */, 563B06D02185E04600B38F35 /* ValueObservationSchedulingTests.swift */, - 563B0725218634D700B38F35 /* ValueObservationStatementColumnConvertibleTests.swift */, ); name = ValueObservation; sourceTree = ""; @@ -2152,7 +2148,6 @@ F3BA810B1CFB3056003DC1BA /* Row+FoundationTests.swift in Sources */, 5698AC901DA389380056AF8C /* FTS3TableBuilderTests.swift in Sources */, 568068381EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, - 563B0727218634D800B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, F3BA80DB1CFB300E003DC1BA /* DatabaseValueConversionTests.swift in Sources */, 56741EAF1E66A8B3003E422D /* FetchRequestTests.swift in Sources */, 5657AB5D1D108BA9006283EF /* FoundationNSStringTests.swift in Sources */, @@ -2445,7 +2440,6 @@ F3BA81131CFB305B003DC1BA /* DatabaseMigratorTests.swift in Sources */, F3BA81381CFB3064003DC1BA /* RecordSubClassTests.swift in Sources */, F3BA81351CFB3064003DC1BA /* RecordEditedTests.swift in Sources */, - 563B0726218634D800B38F35 /* ValueObservationStatementColumnConvertibleTests.swift in Sources */, 568068341EBBA26100EFB8AA /* SQLRequestTests.swift in Sources */, 5657AB691D108BA9006283EF /* FoundationURLTests.swift in Sources */, 56741EAB1E66A8B3003E422D /* FetchRequestTests.swift in Sources */, diff --git a/Tests/GRDBTests/ValueObservationCountTests.swift b/Tests/GRDBTests/ValueObservationCountTests.swift index 3519d11e1..70a9f7eca 100644 --- a/Tests/GRDBTests/ValueObservationCountTests.swift +++ b/Tests/GRDBTests/ValueObservationCountTests.swift @@ -20,7 +20,7 @@ class ValueObservationCountTests: GRDBTestCase { var counts: [Int] = [] let notificationExpectation = expectation(description: "notification") notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 4 + notificationExpectation.expectedFulfillmentCount = 5 struct T: TableRecord { } var observation = ValueObservation.trackingCount(T.all()) @@ -30,48 +30,20 @@ class ValueObservationCountTests: GRDBTestCase { notificationExpectation.fulfill() } - try dbQueue.write { - try $0.execute("INSERT INTO t DEFAULT VALUES") - } - try dbQueue.write { - try $0.execute("UPDATE t SET id = id") - } - try dbQueue.write { - try $0.execute("INSERT INTO t DEFAULT VALUES") + try dbQueue.inDatabase { db in + try db.execute("INSERT INTO t DEFAULT VALUES") // +1 + try db.execute("UPDATE t SET id = id") // = + try db.execute("INSERT INTO t DEFAULT VALUES") // +1 + try db.inTransaction { // +1 + try db.execute("INSERT INTO t DEFAULT VALUES") + try db.execute("INSERT INTO t DEFAULT VALUES") + try db.execute("DELETE FROM t WHERE id = 1") + return .commit + } + try db.execute("DELETE FROM t WHERE id = 2") // -1 } waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(counts, [0, 1, 1, 2]) - } - - func testCountWithUniquing() throws { - let dbQueue = try makeDatabaseQueue() - try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } - - var counts: [Int] = [] - let notificationExpectation = expectation(description: "notification") - notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 3 - - struct T: TableRecord { } - var observation = ValueObservation.trackingCount(withUniquing: T.all()) - observation.extent = .databaseLifetime - _ = try observation.start(in: dbQueue) { count in - counts.append(count) - notificationExpectation.fulfill() - } - - try dbQueue.write { - try $0.execute("INSERT INTO t DEFAULT VALUES") - } - try dbQueue.write { - try $0.execute("UPDATE t SET id = id") - } - try dbQueue.write { - try $0.execute("INSERT INTO t DEFAULT VALUES") - } - - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(counts, [0, 1, 2]) + XCTAssertEqual(counts, [0, 1, 2, 3, 2]) } } diff --git a/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift b/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift index 70392ddbb..1f5e11562 100644 --- a/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift +++ b/Tests/GRDBTests/ValueObservationDatabaseValueConvertibleTests.swift @@ -44,55 +44,24 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { notificationExpectation.fulfill() } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + try dbQueue.inDatabase { db in + try db.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") // +1 + try db.execute("UPDATE t SET name = 'foo' WHERE id = 1") // = + try db.inTransaction { // +1 + try db.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + try db.execute("INSERT INTO t (id, name) VALUES (3, 'baz')") + try db.execute("DELETE FROM t WHERE id = 3") + return .commit + } + try db.execute("DELETE FROM t WHERE id = 1") // -1 } waitForExpectations(timeout: 1, handler: nil) XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ [], ["foo"], - ["foo"], - ["foo", "bar"]]) - } - - func testAllWithUniquing() throws { - let dbQueue = try makeDatabaseQueue() - try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } - - var results: [[Name]] = [] - let notificationExpectation = expectation(description: "notification") - notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 3 - - var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) - observation.extent = .databaseLifetime - _ = try observation.start(in: dbQueue) { names in - results.append(names) - notificationExpectation.fulfill() - } - - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") - } - - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ - [], - ["foo"], - ["foo", "bar"]]) + ["foo", "bar"], + ["bar"]]) } func testOne() throws { @@ -102,7 +71,7 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { var results: [Name?] = [] let notificationExpectation = expectation(description: "notification") notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 5 + notificationExpectation.expectedFulfillmentCount = 7 var observation = ValueObservation.trackingOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime @@ -111,63 +80,32 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { notificationExpectation.fulfill() } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") - } - try dbQueue.write { - try $0.execute("DELETE FROM t") + try dbQueue.inDatabase { db in + try db.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") + try db.execute("UPDATE t SET name = 'foo' WHERE id = 1") + try db.inTransaction { + try db.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + try db.execute("INSERT INTO t (id, name) VALUES (3, 'baz')") + try db.execute("DELETE FROM t WHERE id = 3") + return .commit + } + try db.execute("DELETE FROM t") + try db.execute("INSERT INTO t (id, name) VALUES (1, 'baz')") + try db.execute("UPDATE t SET name = NULL") + try db.execute("DELETE FROM t") + try db.execute("INSERT INTO t (id, name) VALUES (1, NULL)") + try db.execute("UPDATE t SET name = 'qux'") } waitForExpectations(timeout: 1, handler: nil) XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ nil, "foo", - "foo", "bar", - nil]) - } - - func testOneWithUniquing() throws { - let dbQueue = try makeDatabaseQueue() - try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } - - var results: [Name?] = [] - let notificationExpectation = expectation(description: "notification") - notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 4 - - var observation = ValueObservation.trackingOne(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id DESC")) - observation.extent = .databaseLifetime - _ = try observation.start(in: dbQueue) { name in - results.append(name) - notificationExpectation.fulfill() - } - - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") - } - try dbQueue.write { - try $0.execute("DELETE FROM t") - } - - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ nil, - "foo", - "bar", - nil]) + "baz", + nil, + "qux"]) } func testAllOptional() throws { @@ -186,54 +124,23 @@ class ValueObservationDatabaseValueConvertibleTests: GRDBTestCase { notificationExpectation.fulfill() } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, NULL)") + try dbQueue.inDatabase { db in + try db.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") // +1 + try db.execute("UPDATE t SET name = 'foo' WHERE id = 1") // = + try db.inTransaction { // +1 + try db.execute("INSERT INTO t (id, name) VALUES (2, NULL)") + try db.execute("INSERT INTO t (id, name) VALUES (3, 'baz')") + try db.execute("DELETE FROM t WHERE id = 3") + return .commit + } + try db.execute("DELETE FROM t WHERE id = 1") // -1 } waitForExpectations(timeout: 1, handler: nil) XCTAssertEqual(results.map { $0.map { $0?.rawValue }}, [ [], ["foo"], - ["foo"], - ["foo", nil]]) - } - - func testAllOptionalWithUniquing() throws { - let dbQueue = try makeDatabaseQueue() - try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } - - var results: [[Name?]] = [] - let notificationExpectation = expectation(description: "notification") - notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 3 - - var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT name FROM t ORDER BY id")) - observation.extent = .databaseLifetime - _ = try observation.start(in: dbQueue) { names in - results.append(names) - notificationExpectation.fulfill() - } - - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, NULL)") - } - - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(results.map { $0.map { $0?.rawValue }}, [ - [], - ["foo"], - ["foo", nil]]) + ["foo", nil], + [nil]]) } } diff --git a/Tests/GRDBTests/ValueObservationRecordTests.swift b/Tests/GRDBTests/ValueObservationRecordTests.swift index 36fc96fb5..d145b85ee 100644 --- a/Tests/GRDBTests/ValueObservationRecordTests.swift +++ b/Tests/GRDBTests/ValueObservationRecordTests.swift @@ -43,55 +43,24 @@ class ValueObservationRecordTests: GRDBTestCase { notificationExpectation.fulfill() } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + try dbQueue.inDatabase { db in + try db.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") // +1 + try db.execute("UPDATE t SET name = 'foo' WHERE id = 1") // = + try db.inTransaction { // +1 + try db.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + try db.execute("INSERT INTO t (id, name) VALUES (3, 'baz')") + try db.execute("DELETE FROM t WHERE id = 3") + return .commit + } + try db.execute("DELETE FROM t WHERE id = 1") // -1 } waitForExpectations(timeout: 1, handler: nil) XCTAssertEqual(results.map { $0.map { $0.row }}, [ [], [["id":1, "name":"foo"]], - [["id":1, "name":"foo"]], - [["id":1, "name":"foo"], ["id":2, "name":"bar"]]]) - } - - func testAllWithUniquing() throws { - let dbQueue = try makeDatabaseQueue() - try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } - - var results: [[Player]] = [] - let notificationExpectation = expectation(description: "notification") - notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 3 - - var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) - observation.extent = .databaseLifetime - _ = try observation.start(in: dbQueue) { players in - results.append(players) - notificationExpectation.fulfill() - } - - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") - } - - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(results.map { $0.map { $0.row }}, [ - [], - [["id":1, "name":"foo"]], - [["id":1, "name":"foo"], ["id":2, "name":"bar"]]]) + [["id":1, "name":"foo"], ["id":2, "name":"bar"]], + [["id":2, "name":"bar"]]]) } func testOne() throws { @@ -101,7 +70,7 @@ class ValueObservationRecordTests: GRDBTestCase { var results: [Player?] = [] let notificationExpectation = expectation(description: "notification") notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 5 + notificationExpectation.expectedFulfillmentCount = 4 var observation = ValueObservation.trackingOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime @@ -110,57 +79,18 @@ class ValueObservationRecordTests: GRDBTestCase { notificationExpectation.fulfill() } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") - } - try dbQueue.write { - try $0.execute("DELETE FROM t") + try dbQueue.inDatabase { db in + try db.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") // +1 + try db.execute("UPDATE t SET name = 'foo' WHERE id = 1") // = + try db.inTransaction { // +1 + try db.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + try db.execute("INSERT INTO t (id, name) VALUES (3, 'baz')") + try db.execute("DELETE FROM t WHERE id = 3") + return .commit + } + try db.execute("DELETE FROM t") // -1 } - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(results.map { $0.map { $0.row }}, [ - nil, - ["id":1, "name":"foo"], - ["id":1, "name":"foo"], - ["id":2, "name":"bar"], - nil]) - } - - func testOneWithUniquing() throws { - let dbQueue = try makeDatabaseQueue() - try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } - - var results: [Player?] = [] - let notificationExpectation = expectation(description: "notification") - notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 4 - - var observation = ValueObservation.trackingOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) - observation.extent = .databaseLifetime - _ = try observation.start(in: dbQueue) { player in - results.append(player) - notificationExpectation.fulfill() - } - - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") - } - try dbQueue.write { - try $0.execute("DELETE FROM t") - } - waitForExpectations(timeout: 1, handler: nil) XCTAssertEqual(results.map { $0.map { $0.row }}, [ nil, diff --git a/Tests/GRDBTests/ValueObservationReducerTests.swift b/Tests/GRDBTests/ValueObservationReducerTests.swift index 59ecac53e..393da3e7c 100644 --- a/Tests/GRDBTests/ValueObservationReducerTests.swift +++ b/Tests/GRDBTests/ValueObservationReducerTests.swift @@ -279,7 +279,7 @@ class ValueObservationReducerTests: GRDBTestCase { var counts: [String] = [] let notificationExpectation = expectation(description: "notification") notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 4 + notificationExpectation.expectedFulfillmentCount = 3 struct T: TableRecord { } var observation = ValueObservation @@ -293,11 +293,10 @@ class ValueObservationReducerTests: GRDBTestCase { try dbQueue.inDatabase { try $0.execute("INSERT INTO t DEFAULT VALUES") - try $0.execute("UPDATE t SET id = id") try $0.execute("INSERT INTO t DEFAULT VALUES") } waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(counts, ["0", "1", "1", "2"]) + XCTAssertEqual(counts, ["0", "1", "2"]) } } diff --git a/Tests/GRDBTests/ValueObservationRowTests.swift b/Tests/GRDBTests/ValueObservationRowTests.swift index c5a55c9ae..1b6656ebf 100644 --- a/Tests/GRDBTests/ValueObservationRowTests.swift +++ b/Tests/GRDBTests/ValueObservationRowTests.swift @@ -29,55 +29,24 @@ class ValueObservationRowTests: GRDBTestCase { notificationExpectation.fulfill() } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + try dbQueue.inDatabase { db in + try db.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") // +1 + try db.execute("UPDATE t SET name = 'foo' WHERE id = 1") // = + try db.inTransaction { // +1 + try db.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + try db.execute("INSERT INTO t (id, name) VALUES (3, 'baz')") + try db.execute("DELETE FROM t WHERE id = 3") + return .commit + } + try db.execute("DELETE FROM t WHERE id = 1") // -1 } waitForExpectations(timeout: 1, handler: nil) XCTAssertEqual(results, [ [], [["id":1, "name":"foo"]], - [["id":1, "name":"foo"]], - [["id":1, "name":"foo"], ["id":2, "name":"bar"]]]) - } - - func testAllWithUniquing() throws { - let dbQueue = try makeDatabaseQueue() - try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } - - var results: [[Row]] = [] - let notificationExpectation = expectation(description: "notification") - notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 3 - - var observation = ValueObservation.trackingAll(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id")) - observation.extent = .databaseLifetime - _ = try observation.start(in: dbQueue) { rows in - results.append(rows) - notificationExpectation.fulfill() - } - - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") - } - - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(results, [ - [], - [["id":1, "name":"foo"]], - [["id":1, "name":"foo"], ["id":2, "name":"bar"]]]) + [["id":1, "name":"foo"], ["id":2, "name":"bar"]], + [["id":2, "name":"bar"]]]) } func testOne() throws { @@ -87,7 +56,7 @@ class ValueObservationRowTests: GRDBTestCase { var results: [Row?] = [] let notificationExpectation = expectation(description: "notification") notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 5 + notificationExpectation.expectedFulfillmentCount = 4 var observation = ValueObservation.trackingOne(SQLRequest("SELECT * FROM t ORDER BY id DESC")) observation.extent = .databaseLifetime @@ -96,57 +65,18 @@ class ValueObservationRowTests: GRDBTestCase { notificationExpectation.fulfill() } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") - } - try dbQueue.write { - try $0.execute("DELETE FROM t") + try dbQueue.inDatabase { db in + try db.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") // +1 + try db.execute("UPDATE t SET name = 'foo' WHERE id = 1") // = + try db.inTransaction { // +1 + try db.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") + try db.execute("INSERT INTO t (id, name) VALUES (3, 'baz')") + try db.execute("DELETE FROM t WHERE id = 3") + return .commit + } + try db.execute("DELETE FROM t") // -1 } - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(results, [ - nil, - ["id":1, "name":"foo"], - ["id":1, "name":"foo"], - ["id":2, "name":"bar"], - nil]) - } - - func testOneWithUniquing() throws { - let dbQueue = try makeDatabaseQueue() - try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } - - var results: [Row?] = [] - let notificationExpectation = expectation(description: "notification") - notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 4 - - var observation = ValueObservation.trackingOne(withUniquing: SQLRequest("SELECT * FROM t ORDER BY id DESC")) - observation.extent = .databaseLifetime - _ = try observation.start(in: dbQueue) { row in - results.append(row) - notificationExpectation.fulfill() - } - - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") - } - try dbQueue.write { - try $0.execute("DELETE FROM t") - } - waitForExpectations(timeout: 1, handler: nil) XCTAssertEqual(results, [ nil, diff --git a/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift b/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift deleted file mode 100644 index fc5bdc299..000000000 --- a/Tests/GRDBTests/ValueObservationStatementColumnConvertibleTests.swift +++ /dev/null @@ -1,148 +0,0 @@ -import XCTest -#if GRDBCIPHER - import GRDBCipher -#elseif GRDBCUSTOMSQLITE - import GRDBCustomSQLite -#else - #if SWIFT_PACKAGE - import CSQLite - #else - import SQLite3 - #endif - import GRDB -#endif - -private struct Name: DatabaseValueConvertible { - var rawValue: String - var fast: Bool - - var databaseValue: DatabaseValue { - return rawValue.databaseValue - } - - static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Name? { - guard let rawValue = String.fromDatabaseValue(dbValue) else { - return nil - } - return Name(rawValue: rawValue, fast: false) - } -} - -extension Name: StatementColumnConvertible { - init(sqliteStatement: SQLiteStatement, index: Int32) { - self.init(rawValue: String(sqliteStatement: sqliteStatement, index: index), fast: true) - } -} - -class ValueObservationStatementColumnConvertibleTests: GRDBTestCase { - func testAll() throws { - let dbQueue = try makeDatabaseQueue() - try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } - - var results: [[Name]] = [] - let notificationExpectation = expectation(description: "notification") - notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 4 - - var observation = ValueObservation.trackingAll(SQLRequest("SELECT name FROM t ORDER BY id")) - observation.extent = .databaseLifetime - _ = try observation.start(in: dbQueue) { names in - XCTAssert(names.allSatisfy { $0.fast }) - results.append(names) - notificationExpectation.fulfill() - } - - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") - } - - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ - [], - ["foo"], - ["foo"], - ["foo", "bar"]]) - } - - func testOne() throws { - let dbQueue = try makeDatabaseQueue() - try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } - - var results: [Name?] = [] - let notificationExpectation = expectation(description: "notification") - notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 5 - - var observation = ValueObservation.trackingOne(SQLRequest("SELECT name FROM t ORDER BY id DESC")) - observation.extent = .databaseLifetime - _ = try observation.start(in: dbQueue) { name in - if let name = name { - XCTAssert(name.fast) - } - results.append(name) - notificationExpectation.fulfill() - } - - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, 'bar')") - } - try dbQueue.write { - try $0.execute("DELETE FROM t") - } - - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(results.map { $0.map { $0.rawValue }}, [ - nil, - "foo", - "foo", - "bar", - nil]) - } - - func testAllOptional() throws { - let dbQueue = try makeDatabaseQueue() - try dbQueue.write { try $0.execute("CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)") } - - var results: [[Name?]] = [] - let notificationExpectation = expectation(description: "notification") - notificationExpectation.assertForOverFulfill = true - notificationExpectation.expectedFulfillmentCount = 4 - - var observation = ValueObservation.trackingAll(SQLRequest("SELECT name FROM t ORDER BY id")) - observation.extent = .databaseLifetime - _ = try observation.start(in: dbQueue) { names in - XCTAssert(names.allSatisfy { $0.map { $0.fast } ?? true }) - results.append(names) - notificationExpectation.fulfill() - } - - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (1, 'foo')") - } - try dbQueue.write { - try $0.execute("UPDATE t SET name = 'foo' WHERE id = 1") - } - try dbQueue.write { - try $0.execute("INSERT INTO t (id, name) VALUES (2, NULL)") - } - - waitForExpectations(timeout: 1, handler: nil) - XCTAssertEqual(results.map { $0.map { $0?.rawValue }}, [ - [], - ["foo"], - ["foo"], - ["foo", nil]]) - } -} From 087a899f132f95ad8a37facc99073b937e56347f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 1 Nov 2018 22:18:58 +0100 Subject: [PATCH 096/109] Rename ValueObservation.tracking(withUniquing:fetch) to ValueObservation.tracking(_:fetchDistinct) --- GRDB/Core/ValueObservation.swift | 24 +++++------ README.md | 43 +++++++------------ .../ValueObservationFetchTests.swift | 2 +- 3 files changed, 29 insertions(+), 40 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 9c3c8f462..64140e866 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -173,7 +173,7 @@ public enum ValueReducers { } } - public struct Unique: ValueReducer { + public struct Distinct: ValueReducer { let _fetch: (Database) throws -> Value var value: Value?? @@ -569,14 +569,14 @@ extension ValueObservation where Reducer == Void { /// - parameter regions: one or more observed requests. /// - parameter fetch: a closure that fetches a value. public static func tracking( - withUniquing regions: DatabaseRegionConvertible..., - fetch: @escaping (Database) throws -> Value) - -> ValueObservation> + _ regions: DatabaseRegionConvertible..., + fetchDistinct fetch: @escaping (Database) throws -> Value) + -> ValueObservation> where Value: Equatable { - return ValueObservation>( + return ValueObservation>( tracking: union(regions), - reducer: ValueReducers.Unique(fetch)) + reducer: ValueReducers.Distinct(fetch)) } } @@ -638,9 +638,9 @@ extension ValueObservation where Reducer == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingCount(_ request: Request) - -> ValueObservation> + -> ValueObservation> { - return ValueObservation.tracking(withUniquing: request, fetch: request.fetchCount) + return ValueObservation.tracking(request, fetchDistinct: request.fetchCount) } } @@ -674,10 +674,10 @@ extension ValueObservation where Reducer == Void { /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingAll(_ request: Request) - -> ValueObservation> + -> ValueObservation> where Request.RowDecoder == Row { - return ValueObservation.tracking(withUniquing: request, fetch: request.fetchAll) + return ValueObservation.tracking(request, fetchDistinct: request.fetchAll) } /// Creates a ValueObservation which observes *request*, and notifies a @@ -707,10 +707,10 @@ extension ValueObservation where Reducer == Void { /// - parameter request: the observed request. /// - returns: a new ValueObservation. public static func trackingOne(_ request: Request) - -> ValueObservation> + -> ValueObservation> where Request.RowDecoder == Row { - return ValueObservation.tracking(withUniquing: request, fetch: request.fetchOne) + return ValueObservation.tracking(request, fetchDistinct: request.fetchOne) } } diff --git a/README.md b/README.md index 6bee8a286..f3af492d5 100644 --- a/README.md +++ b/README.md @@ -6250,10 +6250,6 @@ Given a [request](#requests), you can track its number of results, the first one ValueObservation.trackingCount(request) ValueObservation.trackingOne(request) ValueObservation.trackingAll(request) - -ValueObservation.trackingCount(withUniquing: request) -ValueObservation.trackingOne(withUniquing: request) -ValueObservation.trackingAll(withUniquing: request) ``` Those observations match the `fetchCount`, `fetchOne`, and `fetchAll` request methods: @@ -6307,22 +6303,6 @@ Those observations match the `fetchCount`, `fetchOne`, and `fetchAll` request me } ``` -By default, a ValueObservation notifies *potential* changes, not *actual* changes in the results of a request. A change is notified if and only if a statement has actually modified the tracked tables and columns by inserting, updating, or deleting a row. - -For example, if you observe `Player.select(max(Column("score")))`, then you'll get be notified of all changes performed on the `score` column of the `player` table (updates, insertions and deletions), even if they do not modify the value of the maximum score. However, you will not get any notification for changes performed on other database tables, or updates to other columns of the player table. - -You can avoid notification of consecutive identical values with the `withUniquing` variant. It performs deduplication at the database level, by comparing raw database values: - -```swift -// Observe the maximum score (with uniquing) -let request = Player.select(max(Column("score")), as: Int.self) -let observer = ValueObservation - .trackingOne(withUniquing: request) - .start(in: dbQueue) { maximumScore: Int? in - print("Maximum score has (really) changed: \(maximumScore)") - } -``` - ### ValueObservation.tracking(_:fetch:) @@ -6363,19 +6343,28 @@ let observer = observation.start(in: dbQueue) { teamInfo: TeamInfo? in } ``` -You can avoid notification of consecutive identical values with the `withUniquing` variant. It requires the fetched value to adopt the Equatable protocol: + +The fetch closure may return consecutive identical values. You can filter out those duplicates with the `ValueObservation.tracking(_:fetchDistinct:)` method. It requires the fetched value to adopt the Equatable protocol: ```swift -extension TeamInfo: Equatable { ... } +struct HallOfFame: Equatable { + var count: Int + var players: [Player] +} let observation = ValueObservation.tracking( - withUniquing: teamRequest, playersRequest, // <- uniquing is here - fetch: { db -> TeamInfo? in - // same code as above + Player.all(), + fetchDistinct: { db -> TeamInfo? in + let count = try Player.fetchCount(db) + let players = try Player + .order(Column("score").desc) + .limit(10) + .fetchAll(db) + return HallOfFame(count: count, players: players) }) -let observer = observation.start(in: dbQueue) { teamInfo: TeamInfo? in - print("Team and players have (really) changed.") +let observer = observation.start(in: dbQueue) { hallOfFame: HallOfFame in + print("Best players out of \(hallOfFame.count): \(hallOfFame.players)") } ``` diff --git a/Tests/GRDBTests/ValueObservationFetchTests.swift b/Tests/GRDBTests/ValueObservationFetchTests.swift index 21b6c40f9..de6aa1dbe 100644 --- a/Tests/GRDBTests/ValueObservationFetchTests.swift +++ b/Tests/GRDBTests/ValueObservationFetchTests.swift @@ -54,7 +54,7 @@ class ValueObservationFetchTests: GRDBTestCase { notificationExpectation.assertForOverFulfill = true notificationExpectation.expectedFulfillmentCount = 3 - var observation = ValueObservation.tracking(withUniquing: DatabaseRegion.fullDatabase, fetch: { + var observation = ValueObservation.tracking(DatabaseRegion.fullDatabase, fetchDistinct: { try Int.fetchOne($0, "SELECT COUNT(*) FROM t")! }) observation.extent = .databaseLifetime From ab7970d470f4ddede0a4bbc4496dfc57b8fcf568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 1 Nov 2018 22:58:20 +0100 Subject: [PATCH 097/109] Documentation --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f3af492d5..829450354 100644 --- a/README.md +++ b/README.md @@ -6343,10 +6343,11 @@ let observer = observation.start(in: dbQueue) { teamInfo: TeamInfo? in } ``` - -The fetch closure may return consecutive identical values. You can filter out those duplicates with the `ValueObservation.tracking(_:fetchDistinct:)` method. It requires the fetched value to adopt the Equatable protocol: +It may happen that a database change does not modify the fetched values. In this case, you'll be notified with consecutive identical values. You can filter out those duplicates with the `ValueObservation.tracking(_:fetchDistinct:)` method. It requires the fetched value to adopt the Equatable protocol: ```swift +// When the `player` table is changed, fetch the total number of players, and +// the ten best ones: struct HallOfFame: Equatable { var count: Int var players: [Player] @@ -6354,7 +6355,7 @@ struct HallOfFame: Equatable { let observation = ValueObservation.tracking( Player.all(), - fetchDistinct: { db -> TeamInfo? in + fetchDistinct: { db -> HallOfFame in let count = try Player.fetchCount(db) let players = try Player .order(Column("score").desc) @@ -6368,7 +6369,7 @@ let observer = observation.start(in: dbQueue) { hallOfFame: HallOfFame in } ``` -The initial parameter of the `ValueObservation.tracking(_:fetch:)` method can be fed with requests, and generally speaking, values that adopt the **DatabaseRegionConvertible** protocol. +The initial parameter of the `ValueObservation.tracking(_:fetch:)` and `ValueObservation.tracking(_:fetchDistinct:)` methods can be fed with requests, and generally speaking, values that adopt the **DatabaseRegionConvertible** protocol. Use this protocol when you want to encapsulate your complex requests in a dedicated type. Our example above can be rewritten as below: From bc274a603c71782bc3243a528690d3fefedfb3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 08:35:04 +0100 Subject: [PATCH 098/109] Documentation --- GRDB/Core/ValueObservation.swift | 271 +++++++++++++++++-------------- README.md | 38 ++--- 2 files changed, 163 insertions(+), 146 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 64140e866..4431b27ba 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -12,8 +12,6 @@ import Dispatch /// ValueScheduling controls how ValueObservation schedules the notifications /// of fresh values to your application. -/// -/// See ValueObservation. public enum ValueScheduling { /// All values are notified on the main queue. /// @@ -85,11 +83,21 @@ extension DispatchQueue { // MARK: - ValueReducer -/// TODO: doc +/// The ValueReducer protocol supports ValueObservation. public protocol ValueReducer { + /// The type of fetched database values associatedtype Fetched + + /// The type of observed values associatedtype Value + + /// Feches database values upon changes in an observed database region. func fetch(_ db: Database) throws -> Fetched + + /// Transforms a fetched value into an eventual observed value. Returns nil + /// when observer should not be notified. + /// + /// This method runs inside a private dispatch queue. mutating func value(_ fetched: Fetched) -> Value? } @@ -126,15 +134,37 @@ public struct MapValueReducer: ValueReducer { } /// A type-erased ValueReducer. +/// +/// An AnyValueReducer forwards its operations to an underlying reducer, +/// hiding its specifics. public struct AnyValueReducer: ValueReducer { - var _fetch: (Database) throws -> Fetched - var _value: (Fetched) -> Value? + private var _fetch: (Database) throws -> Fetched + private var _value: (Fetched) -> Value? + /// Creates a reducer whose `fetch(_:)` and `value(_:)` methods wrap and + /// forward operations the argument closures. + /// + /// For example, this reducer counts the number of a times the player table + /// is modified: + /// + /// var count = 0 + /// let reducer = AnyValueReducer( + /// fetch: { _ in }, + /// value: { _ -> Int? in + /// count += 1 + /// return count + /// }) + /// let observer = ValueObservation + /// .tracking(Player.all(), reducer: reducer) + /// .start(in: dbQueue) { count: Int in + /// print("Players have been modified \(count) times.") + /// } public init(fetch: @escaping (Database) throws -> Fetched, value: @escaping (Fetched) -> Value?) { self._fetch = fetch self._value = value } + /// Creates a reducer that wraps and forwards operations to `reducer`. public init(_ reducer: Base) where Base.Fetched == Fetched, Base.Value == Value { var reducer = reducer self._fetch = { try reducer.fetch($0) } @@ -153,11 +183,10 @@ public struct AnyValueReducer: ValueReducer { } public enum ValueReducers { - /// TODO + /// A reducer which outputs raw database values, without any processing. public struct Raw: ValueReducer { let _fetch: (Database) throws -> Value - /// TODO public init(_ fetch: @escaping (Database) throws -> Value) { self._fetch = fetch } @@ -173,11 +202,12 @@ public enum ValueReducers { } } + /// A reducer which outputs raw database values, filtering out consecutive + /// values that are equal. public struct Distinct: ValueReducer { let _fetch: (Database) throws -> Value var value: Value?? - /// TODO public init(_ fetch: @escaping (Database) throws -> Value) { self._fetch = fetch } @@ -197,6 +227,8 @@ public enum ValueReducers { } } + /// A reducer which outputs arrays of records, filtering out consecutive + /// identical database rows. public struct Records: ValueReducer { let _fetch: (Database) throws -> [Row] var rows: [Row]? @@ -222,6 +254,8 @@ public enum ValueReducers { } } + /// A reducer which outputs optional records, filtering out consecutive + /// identical database rows. public struct Record: ValueReducer { let _fetch: (Database) throws -> Row? var row: Row?? @@ -247,6 +281,8 @@ public enum ValueReducers { } } + /// A reducer which outputs arrays of values, filtering out consecutive + /// identical database values. public struct Values: ValueReducer { let _fetch: (Database) throws -> [DatabaseValue] var dbValues: [DatabaseValue]? @@ -272,6 +308,8 @@ public enum ValueReducers { } } + /// A reducer which outputs optional values, filtering out consecutive + /// identical database values. public struct Value: ValueReducer { let _fetch: (Database) throws -> DatabaseValue? var dbValue: DatabaseValue?? @@ -317,6 +355,8 @@ public enum ValueReducers { } } + /// A reducer which outputs arrays of optional values, filtering out consecutive + /// identical database values. public struct OptionalValues: ValueReducer { let _fetch: (Database) throws -> [DatabaseValue] var dbValues: [DatabaseValue]? @@ -345,32 +385,39 @@ public enum ValueReducers { // MARK: - ValueObservation -/// TODO: doc -/// TODO: refresh region after each fetch +/// ValueObservation tracks changes in the results of database requests, and +/// notifies fresh values whenever the database changes. +/// +/// For example: +/// +/// let observation = ValueObservation.trackingAll(Player.all) +/// let observer = try observation.start(in: dbQueue) { players: [Player] in +/// print("Players have changed.") +/// } public struct ValueObservation { /// A closure that is evaluated when the observation starts, and returns /// the observed database region. var observedRegion: (Database) throws -> DatabaseRegion - /// A closure that fetches a value from the database. It is called upon - /// each database change, and also when the observatioin starts, depending - /// on the *initialDispatch* property. - /// - /// When this closure needs to write in the database, set the *isReadOnly* - /// flag to false. + /// The reducer is triggered upon each database change in *observedRegion*. var reducer: Reducer - /// Default is true. Set this property to false when the *fetch* closure - /// requires write access, and should be executed inside a savepoint. + /// Default is true. Set this property to false when the observation + /// requires write access in order to fetch fresh values. Fetches are then + /// wrapped inside a savepoint. + /// + /// Don't set this flag to true unless you really need it. A read/write + /// observation is less efficient than a read-only observation. public var isReadOnly: Bool = true /// The extent of the database observation. The default is - /// `.observerLifetime`: once started, the observation lasts until the - /// observer is deallocated. + /// `.observerLifetime`: the observation lasts until the + /// observer returned by the `start(in:onError:onChange:)` method + /// is deallocated. public var extent = Database.TransactionObservationExtent.observerLifetime - /// `scheduling` controls how fresh values are notified. - /// Default is `.mainQueue`: + /// `scheduling` controls how fresh values are notified. Default + /// is `.mainQueue`. /// /// - `.mainQueue`: all values are notified on the main queue. /// @@ -438,7 +485,7 @@ public struct ValueObservation { } } - // This initializer is not public. See ValueObservation.tracking(_:reducer:) + // Not public. See ValueObservation.tracking(_:reducer:) init( tracking region: @escaping (Database) throws -> DatabaseRegion, reducer: Reducer) @@ -448,38 +495,39 @@ public struct ValueObservation { } /// Returs a ValueObservation which observes *regions*, and notifies the - /// values returned by the *reducer* whenever the observed region is - /// impacted by a database transaction. + /// values returned by the *reducer* whenever one of the observed + /// regions is modified by a database transaction. /// /// This method is the most fundamental way to create a ValueObservation. /// - /// For example: + /// For example, this observation counts the number of a times the player + /// table is modified: /// + /// var count = 0 /// let reducer = AnyValueReducer( - /// fetch: { db in try Player.fetchAll(db) }, - /// value: { player in players }) - /// let observation = ValueObservation( - /// tracking: Player.all(), - /// reducer: reducer) - /// - /// let observer = try observation.start(in: dbQueue) { player: [Player] in - /// print("players have changed") + /// fetch: { _ in }, + /// value: { _ -> Int? in + /// count += 1 + /// return count + /// }) + /// let observation = ValueObservation.tracking(Player.all(), reducer: reducer) + /// let observer = observation.start(in: dbQueue) { count: Int in + /// print("Players have been modified \(count) times.") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. + /// - When started with the `start(in:onError:onChange:)` method, a fresh + /// value is immediately notified on the main queue. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by /// `start` is deallocated. /// - /// See ValueObservation for more information. - /// - /// - parameter region: a closure that returns the observed region. - /// - parameter fetch: a closure that fetches a value. + /// - parameter regions: A list of observed regions. + /// - parameter reducer: A reducer that turns database changes in the + /// modified regions into fresh values. Currently only reducers that adopt + /// the ValueReducer protocol are supported. public static func tracking( _ regions: DatabaseRegionConvertible..., reducer: Reducer) @@ -504,7 +552,7 @@ extension ValueObservation where Reducer: ValueReducer { extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *regions*, and notifies the /// values returned by the *fetch* closure whenever one of the observed - /// regions is impacted by a database transaction. + /// regions is modified by a database transaction. /// /// For example: /// @@ -513,23 +561,20 @@ extension ValueObservation where Reducer == Void { /// fetch: { db in return try Player.fetchAll(db) }) /// /// let observer = try observation.start(in: dbQueue) { player: [Player] in - /// print("players have changed") + /// print("Players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. + /// - When started with the `start(in:onError:onChange:)` method, a fresh + /// value is immediately notified on the main queue. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by /// `start` is deallocated. /// - /// See ValueObservation for more information. - /// - /// - parameter regions: one or more observed requests. - /// - parameter fetch: a closure that fetches a value. + /// - parameter regions: A list of observed regions. + /// - parameter fetch: A closure that fetches a value. public static func tracking( _ regions: DatabaseRegionConvertible..., fetch: @escaping (Database) throws -> Value) @@ -542,32 +587,30 @@ extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *regions*, and notifies the /// values returned by the *fetch* closure whenever one of the observed - /// regions is impacted by a database transaction. + /// regions is modified by a database transaction. Consecutive equal values + /// are filtered out. /// /// For example: /// /// let observation = ValueObservation.tracking( - /// withUniquing: Player.all(), - /// fetch: { db in return try Player.fetchAll(db) }) + /// Player.all(), + /// fetchDistinct: { db in return try Player.fetchAll(db) }) /// /// let observer = try observation.start(in: dbQueue) { player: [Player] in - /// print("players have changed") + /// print("Players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. + /// - When started with the `start(in:onError:onChange:)` method, a fresh + /// value is immediately notified on the main queue. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by /// `start` is deallocated. /// - /// See ValueObservation for more information. - /// - /// - parameter regions: one or more observed requests. - /// - parameter fetch: a closure that fetches a value. + /// - parameter regions: A list of observed regions. + /// - parameter fetch: A closure that fetches a value. public static func tracking( _ regions: DatabaseRegionConvertible..., fetchDistinct fetch: @escaping (Database) throws -> Value) @@ -592,12 +635,12 @@ private func union(_ regions: [DatabaseRegionConvertible]) -> (Database) throws extension ValueObservation where Reducer: ValueReducer { /// Starts the value observation in the provided database reader (such as - /// a database queue or database pool). + /// a database queue or database pool), and returns a transaction observer. /// - /// - parameter observation: the stared observation - /// - parameter onError: a closure that is provided by eventual errors that happen - /// during observation - /// - parameter onChange: a closure that is provided fresh values + /// - parameter reader: A DatabaseReader. + /// - parameter onError: A closure that is provided eventual errors that + /// happen during observation + /// - parameter onChange: A closure that is provided fresh values /// - returns: a TransactionObserver public func start( in reader: DatabaseReader, @@ -611,8 +654,8 @@ extension ValueObservation where Reducer: ValueReducer { // MARK: - Count Observation extension ValueObservation where Reducer == Void { - /// Creates a ValueObservation which observes *request*, and notifies a - /// fresh count whenever the request is impacted by a database transaction. + /// Creates a ValueObservation which observes *request*, and notifies its + /// count whenever it is modified by a database transaction. /// /// For example: /// @@ -620,21 +663,18 @@ extension ValueObservation where Reducer == Void { /// let observation = ValueObservation.trackingCount(request) /// /// let observer = try observation.start(in: dbQueue) { count: Int in - /// print("number of players has changed") + /// print("Number of players has changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. + /// - When started with the `start(in:onError:onChange:)` method, a fresh + /// value is immediately notified on the main queue. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by /// `start` is deallocated. /// - /// See ValueObservation for more information. - /// /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingCount(_ request: Request) @@ -648,7 +688,7 @@ extension ValueObservation where Reducer == Void { extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *request*, and notifies - /// fresh rows whenever the request is impacted by a database transaction. + /// fresh rows whenever the request is modified by a database transaction. /// /// For example: /// @@ -656,21 +696,18 @@ extension ValueObservation where Reducer == Void { /// let observation = ValueObservation.trackingAll(request) /// /// let observer = try observation.start(in: dbQueue) { rows: [Row] in - /// print("players have changed") + /// print("Players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. + /// - When started with the `start(in:onError:onChange:)` method, a fresh + /// value is immediately notified on the main queue. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by /// `start` is deallocated. /// - /// See ValueObservation for more information. - /// /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingAll(_ request: Request) @@ -681,7 +718,7 @@ extension ValueObservation where Reducer == Void { } /// Creates a ValueObservation which observes *request*, and notifies a - /// fresh row whenever the request is impacted by a database transaction. + /// fresh row whenever the request is modified by a database transaction. /// /// For example: /// @@ -689,23 +726,20 @@ extension ValueObservation where Reducer == Void { /// let observation = ValueObservation.trackingOne(request) /// /// let observer = try observation.start(in: dbQueue) { row: Row? in - /// print("players have changed") + /// print("Players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. + /// - When started with the `start(in:onError:onChange:)` method, a fresh + /// value is immediately notified on the main queue. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by /// `start` is deallocated. /// - /// See ValueObservation for more information. - /// /// - parameter request: the observed request. - /// - returns: a new ValueObservation. + /// - returns: a ValueObservation. public static func trackingOne(_ request: Request) -> ValueObservation> where Request.RowDecoder == Row @@ -718,7 +752,7 @@ extension ValueObservation where Reducer == Void { extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *request*, and notifies - /// fresh records whenever the request is impacted by a + /// fresh records whenever the request is modified by a /// database transaction. /// /// For example: @@ -727,21 +761,18 @@ extension ValueObservation where Reducer == Void { /// let observation = ValueObservation.trackingAll(request) /// /// let observer = try observation.start(in: dbQueue) { players: [Player] in - /// print("players have changed") + /// print("Players have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. + /// - When started with the `start(in:onError:onChange:)` method, a fresh + /// value is immediately notified on the main queue. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by /// `start` is deallocated. /// - /// See ValueObservation for more information. - /// /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingAll(_ request: Request) @@ -754,7 +785,7 @@ extension ValueObservation where Reducer == Void { } /// Creates a ValueObservation which observes *request*, and notifies a - /// fresh record whenever the request is impacted by a database transaction. + /// fresh record whenever the request is modified by a database transaction. /// /// For example: /// @@ -762,21 +793,18 @@ extension ValueObservation where Reducer == Void { /// let observation = ValueObservation.trackingOne(request) /// /// let observer = try observation.start(in: dbQueue) { player: Player? in - /// print("player has changed") + /// print("Player has changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. + /// - When started with the `start(in:onError:onChange:)` method, a fresh + /// value is immediately notified on the main queue. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by /// `start` is deallocated. /// - /// See ValueObservation for more information. - /// /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingOne(_ request: Request) -> @@ -793,7 +821,7 @@ extension ValueObservation where Reducer == Void { extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *request*, and notifies - /// fresh values whenever the request is impacted by a + /// fresh values whenever the request is modified by a /// database transaction. /// /// For example: @@ -802,21 +830,18 @@ extension ValueObservation where Reducer == Void { /// let observation = ValueObservation.trackingAll(request) /// /// let observer = try observation.start(in: dbQueue) { names: [String] in - /// print("player name have changed") + /// print("Player names have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. + /// - When started with the `start(in:onError:onChange:)` method, a fresh + /// value is immediately notified on the main queue. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by /// `start` is deallocated. /// - /// See ValueObservation for more information. - /// /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingAll(_ request: Request) @@ -829,7 +854,7 @@ extension ValueObservation where Reducer == Void { } /// Creates a ValueObservation which observes *request*, and notifies a - /// fresh value whenever the request is impacted by a database transaction. + /// fresh value whenever the request is modified by a database transaction. /// /// For example: /// @@ -837,21 +862,18 @@ extension ValueObservation where Reducer == Void { /// let observation = ValueObservation.trackingOne(request) /// /// let observer = try observation.start(in: dbQueue) { maxScore: Int? in - /// print("maximum score has changed") + /// print("Maximum score has changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. + /// - When started with the `start(in:onError:onChange:)` method, a fresh + /// value is immediately notified on the main queue. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by /// `start` is deallocated. /// - /// See ValueObservation for more information. - /// /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingOne(_ request: Request) @@ -868,30 +890,27 @@ extension ValueObservation where Reducer == Void { extension ValueObservation where Reducer == Void { /// Creates a ValueObservation which observes *request*, and notifies - /// fresh values whenever the request is impacted by a + /// fresh values whenever the request is modified by a /// database transaction. /// /// For example: /// - /// let request = Player.select(Column("name"), as: String.self) + /// let request = Player.select(Column("name"), as: Optional.self) /// let observation = ValueObservation.trackingAll(request) /// - /// let observer = try observation.start(in: dbQueue) { names: [String] in - /// print("player name have changed") + /// let observer = try observation.start(in: dbQueue) { names: [String?] in + /// print("Player names have changed") /// } /// /// The returned observation has the default configuration: /// - /// - When started with the `start(_:onError:onChage:)` method, a fresh - /// value is immediately notified on the dispatch queue which starts - /// the observation. + /// - When started with the `start(in:onError:onChange:)` method, a fresh + /// value is immediately notified on the main queue. /// - Upon subsequent database changes, fresh values are notified on the /// main queue. /// - The observation lasts until the observer returned by /// `start` is deallocated. /// - /// See ValueObservation for more information. - /// /// - parameter request: the observed request. /// - returns: a ValueObservation. public static func trackingAll(_ request: Request) diff --git a/README.md b/README.md index 829450354..5cec05e83 100644 --- a/README.md +++ b/README.md @@ -4489,7 +4489,7 @@ try ValueObservation. **FetchRequest** is the protocol for all requests that run from a single select statement, and know how fetched rows should be interpreted: ```swift -protocol FetchRequest { +protocol FetchRequest: DatabaseRegionConvertible { /// The type that tells how fetched rows should be decoded associatedtype RowDecoder @@ -4498,9 +4498,6 @@ protocol FetchRequest { /// The number of rows fetched by the request. func fetchCount(_ db: Database) throws -> Int - - /// The database region that the request looks into. - func databaseRegion(_ db: Database) throws -> DatabaseRegion } ``` @@ -4510,7 +4507,7 @@ The `prepare` method returns a prepared statement and an optional row adapter. T The `fetchCount` method has a default implementation that builds a correct but naive SQL query from the statement returned by `prepare`: `SELECT COUNT(*) FROM (...)`. Adopting types can refine the counting SQL by customizing their `fetchCount` implementation. -The `databaseRegion` method is involved in [database observation](#database-changes-observation). It is given a default implementation, based on the statement returned by `prepare`. For more information, see [DatabaseRegion](#databaseregion), and [ValueObservation]. +The base `DatabaseRegionConvertible` protocol is involved in [database observation](#database-changes-observation). For more information, see [DatabaseRegion](#databaseregion), and [ValueObservation]. The FetchRequest protocol is adopted, for example, by [query interface requests](#requests): @@ -6122,13 +6119,15 @@ You can group regions: } ``` -Those regions provide support for the `observes(eventsOfKind:)` and `databaseDidChange(with:)` methods of transaction observers. For example: +There are two special regions: `DatabaseRegion()` (the empty region), and `DatabaseRegion.fullDatabase` (the region that spans the whole database). + +Regions feed the `observes(eventsOfKind:)` and `databaseDidChange(with:)` methods of transaction observers. For example: ```swift -// A region observer +// A transaction observer which notifies all changes to a database region. class DatabaseRegionObserver: TransactionObserver { let region: DatabaseRegion - var regionModified = false + var regionIsModified = false init(region: DatabaseRegion) { self.region = region @@ -6140,22 +6139,21 @@ class DatabaseRegionObserver: TransactionObserver { func databaseDidChange(with event: DatabaseEvent) { if region.isModified(by: event) { - regionModified = true + regionIsModified = true stopObservingDatabaseChangesUntilNextTransaction() } } func databaseDidRollback(_ db: Database) { - regionModified = false + regionIsModified = false } func databaseDidCommit(_ db: Database) { - if regionModified { - regionModified = false - - // You'll customize your handling of changes here: - print("Region changes have been committed.") - } + if regionIsModified == false { return } + regionIsModified = false + + // You'll customize your handling of changes here: + print("Region has been modified.") } } @@ -6433,20 +6431,20 @@ The `fetch` method is called upon changes in the observed [database region](#dat The `value` method transforms a fetched value into a notified value. It returns nil if the observer should not be notified. This method runs inside a private dispatch queue. -The sample code below counts the number of times the database is modified: +The sample code below counts the number of times the player table is modified: ```swift var count = 0 let reducer = AnyValueReducer( - fetch: { _ in /* don't fetch anything */ }, + fetch: { _ in }, value: { _ -> Int? in count += 1 return count }) let observer = ValueObservation - .tracking(DatabaseRegion.fullDatabase, reducer: reducer) + .tracking(Player.all(), reducer: reducer) .start(in: dbQueue) { count: Int in - print("The database has been modified \(count) times.") + print("Players have been modified \(count) times.") } ``` From 257fc8b66af2946c49a406e0e687b055fe0d4e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 08:35:16 +0100 Subject: [PATCH 099/109] Cleanup --- GRDB/Core/DatabaseWriter.swift | 64 +++++++++++++++++----------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 9b4ec7307..ff0e50f31 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -212,13 +212,11 @@ extension DatabaseWriter { } } - // Enter database in order to start observation, and fetch initial - // value if needed. Use unsafeReentrantWrite so that observation can - // start from any dispatch queue. + // Use unsafeReentrantWrite so that observation can start from any + // dispatch queue. return try unsafeReentrantWrite { db in - // We have a take care of the order of notifications: initial value - // has to be dispatched before any future transaction triggers - // a change. + // Take care of initial value. Make sure it is dispatched before + // any future transaction can trigger a change. var reducer = observation.reducer switch observation.scheduling { case .mainQueue: @@ -242,31 +240,10 @@ extension DatabaseWriter { } // Start observing the database - // The technique to fetch a fresh value after database has changed - // depends on the observation.readonly flag: - let fetch: (Database, Reducer) -> Future - if observation.isReadOnly { - fetch = { [unowned self] (_, reducer) in - // Concurrent fetch - self.concurrentRead { db in try reducer.fetch(db) } - } - } else { - fetch = { (db, reducer) in - // Synchronous fetch - Future(Result { - var fetchedValue: Reducer.Fetched! - try db.inTransaction { - fetchedValue = try reducer.fetch(db) - return .commit - } - return fetchedValue - }) - } - } let valueObserver = try ValueObserver( region: observation.observedRegion(db), reducer: reducer, - fetch: fetch, + fetch: observation.fetchAfterChange(in: self), notificationQueue: observation.notificationQueue, onError: onError, onChange: onChange) @@ -291,6 +268,30 @@ extension ValueObservation where Reducer: ValueReducer { return fetchedValue } } + + /// Helper method for DatabaseWriter.add(observation:onError:onChange:) + fileprivate func fetchAfterChange(in writer: DatabaseWriter) -> (Database, Reducer) -> Future { + // The technique to return a future value after database has changed + // depends on the isReadOnly flag: + if isReadOnly { + // Concurrent fetch + return { [unowned writer] (_, reducer) in + writer.concurrentRead(reducer.fetch) + } + } else { + // Synchronous fetch + return { (db, reducer) in + Future(Result { + var fetchedValue: Reducer.Fetched! + try db.inTransaction { + fetchedValue = try reducer.fetch(db) + return .commit + } + return fetchedValue + }) + } + } + } } @@ -324,8 +325,8 @@ private class ValueObserver: TransactionObserver { if let queue = notificationQueue { self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation", qos: queue.qos) } else { - // TODO: provide a qos - self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation") + // Assume UI purpose + self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation", qos: .userInitiated) } } else { self.reduceQueue = DispatchQueue(label: "GRDB.ValueObservation") @@ -370,8 +371,7 @@ private class ValueObserver: TransactionObserver { } } catch { guard strongSelf.onError != nil else { - // Should we let an error unnoticed? - try! { throw error }() + // TODO: how can we let the user know about the error? return } if let queue = strongSelf.notificationQueue { From 2bc8f33249904e1dc36bdac46dffa23af7b2f293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 11:49:03 +0100 Subject: [PATCH 100/109] Cleanup --- GRDB/Core/ValueObservation.swift | 111 +++++++++++++++---------------- 1 file changed, 54 insertions(+), 57 deletions(-) diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index 4431b27ba..fc352c9f1 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -185,7 +185,7 @@ public struct AnyValueReducer: ValueReducer { public enum ValueReducers { /// A reducer which outputs raw database values, without any processing. public struct Raw: ValueReducer { - let _fetch: (Database) throws -> Value + private let _fetch: (Database) throws -> Value public init(_ fetch: @escaping (Database) throws -> Value) { self._fetch = fetch @@ -205,8 +205,8 @@ public enum ValueReducers { /// A reducer which outputs raw database values, filtering out consecutive /// values that are equal. public struct Distinct: ValueReducer { - let _fetch: (Database) throws -> Value - var value: Value?? + private let _fetch: (Database) throws -> Value + private var previousValue: Value?? public init(_ fetch: @escaping (Database) throws -> Value) { self._fetch = fetch @@ -218,20 +218,21 @@ public enum ValueReducers { } /// :nodoc: - public mutating func value(_ newValue: Value) -> Value? { - if let value = value, value == newValue { + public mutating func value(_ value: Value) -> Value? { + if let previousValue = previousValue, previousValue == value { + // Don't notify consecutive identical values return nil } - self.value = newValue - return newValue + self.previousValue = value + return value } } /// A reducer which outputs arrays of records, filtering out consecutive /// identical database rows. public struct Records: ValueReducer { - let _fetch: (Database) throws -> [Row] - var rows: [Row]? + private let _fetch: (Database) throws -> [Row] + private var previousRows: [Row]? /// TODO public init(_ fetch: @escaping (Database) throws -> [Row]) { @@ -244,21 +245,21 @@ public enum ValueReducers { } /// :nodoc: - public mutating func value(_ newRows: [Row]) -> [Record]? { - if let rows = rows, rows == newRows { - // Don't notify consecutive identical rows + public mutating func value(_ rows: [Row]) -> [Record]? { + if let previousRows = previousRows, previousRows == rows { + // Don't notify consecutive identical row arrays return nil } - self.rows = newRows - return newRows.map(Record.init(row:)) + self.previousRows = rows + return rows.map(Record.init(row:)) } } /// A reducer which outputs optional records, filtering out consecutive /// identical database rows. public struct Record: ValueReducer { - let _fetch: (Database) throws -> Row? - var row: Row?? + private let _fetch: (Database) throws -> Row? + private var previousRow: Row?? /// TODO public init(_ fetch: @escaping (Database) throws -> Row?) { @@ -271,21 +272,21 @@ public enum ValueReducers { } /// :nodoc: - public mutating func value(_ newRow: Row?) -> Record?? { - if let row = row, row == newRow { - // Don't notify consecutive identical row + public mutating func value(_ row: Row?) -> Record?? { + if let previousRow = previousRow, previousRow == row { + // Don't notify consecutive identical rows return nil } - self.row = newRow - return .some(newRow.map(Record.init(row:))) + self.previousRow = row + return .some(row.map(Record.init(row:))) } } /// A reducer which outputs arrays of values, filtering out consecutive /// identical database values. public struct Values: ValueReducer { - let _fetch: (Database) throws -> [DatabaseValue] - var dbValues: [DatabaseValue]? + private let _fetch: (Database) throws -> [DatabaseValue] + private var previousDbValues: [DatabaseValue]? /// TODO public init(_ fetch: @escaping (Database) throws -> [DatabaseValue]) { @@ -298,22 +299,24 @@ public enum ValueReducers { } /// :nodoc: - public mutating func value(_ newDbValues: [DatabaseValue]) -> [T]? { - if let dbValues = dbValues, dbValues == newDbValues { - // Don't notify consecutive identical dbValues + public mutating func value(_ dbValues: [DatabaseValue]) -> [T]? { + if let previousDbValues = previousDbValues, previousDbValues == dbValues { + // Don't notify consecutive identical dbValue arrays return nil } - self.dbValues = newDbValues - return newDbValues.map { T.decode(from: $0, conversionContext: nil) } + self.previousDbValues = dbValues + return dbValues.map { + T.decode(from: $0, conversionContext: nil) + } } } /// A reducer which outputs optional values, filtering out consecutive /// identical database values. public struct Value: ValueReducer { - let _fetch: (Database) throws -> DatabaseValue? - var dbValue: DatabaseValue?? - var previousValueWasNil = false + private let _fetch: (Database) throws -> DatabaseValue? + private var previousDbValue: DatabaseValue?? + private var previousValueWasNil = false /// TODO public init(_ fetch: @escaping (Database) throws -> DatabaseValue?) { @@ -326,31 +329,23 @@ public enum ValueReducers { } /// :nodoc: - public mutating func value(_ newDbValue: DatabaseValue?) -> T?? { - if let dbValue = dbValue, dbValue == newDbValue { + public mutating func value(_ dbValue: DatabaseValue?) -> T?? { + if let previousDbValue = previousDbValue, previousDbValue == dbValue { // Don't notify consecutive identical dbValue return nil } - self.dbValue = newDbValue - guard let dbValue = newDbValue else { - if previousValueWasNil { - return nil - } else { - previousValueWasNil = true - return .some(nil) - } - } - let value = T.decodeIfPresent(from: dbValue, conversionContext: nil) - if let value = value { + self.previousDbValue = dbValue + if let dbValue = dbValue, + let value = T.decodeIfPresent(from: dbValue, conversionContext: nil) + { previousValueWasNil = false return .some(value) + } else if previousValueWasNil { + // Don't notify consecutive nil values + return nil } else { - if previousValueWasNil { - return nil - } else { - previousValueWasNil = true - return .some(nil) - } + previousValueWasNil = true + return .some(nil) } } } @@ -358,8 +353,8 @@ public enum ValueReducers { /// A reducer which outputs arrays of optional values, filtering out consecutive /// identical database values. public struct OptionalValues: ValueReducer { - let _fetch: (Database) throws -> [DatabaseValue] - var dbValues: [DatabaseValue]? + private let _fetch: (Database) throws -> [DatabaseValue] + private var previousDbValues: [DatabaseValue]? /// TODO public init(_ fetch: @escaping (Database) throws -> [DatabaseValue]) { @@ -372,13 +367,15 @@ public enum ValueReducers { } /// :nodoc: - public mutating func value(_ newDbValues: [DatabaseValue]) -> [T?]? { - if let dbValues = dbValues, dbValues == newDbValues { - // Don't notify consecutive identical dbValues + public mutating func value(_ dbValues: [DatabaseValue]) -> [T?]? { + if let previousDbValues = previousDbValues, previousDbValues == dbValues { + // Don't notify consecutive identical dbValue arrays return nil } - self.dbValues = newDbValues - return newDbValues.map { T.decodeIfPresent(from: $0, conversionContext: nil) } + self.previousDbValues = dbValues + return dbValues.map { + T.decodeIfPresent(from: $0, conversionContext: nil) + } } } } From c48d2e484a4a1ec9a84fcc30b28c19b70e806aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 12:10:49 +0100 Subject: [PATCH 101/109] Documentation --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cec05e83..d9ad75158 100644 --- a/README.md +++ b/README.md @@ -6194,7 +6194,9 @@ protocol TransactionObserverType : class { **ValueObservation tracks changes in the results of database [requests](#requests), and notifies fresh values whenever the database changes.** -For example, here is a typical UIViewController which observes the database in order to keep its view up-to-date: +Changes are only notified after they have been committed in the database. No insertion, update, or deletion in tracked tables is missed. This includes indirect changes triggered by [foreign keys](https://www.sqlite.org/foreignkeys.html#fk_actions) or [SQL triggers](https://www.sqlite.org/lang_createtrigger.html). + +Here is a typical UIViewController which observes the database in order to keep its view up-to-date: ```swift class PlayerViewController: UIViewController { From c300cf2a3842484fb854f5cbedbbe24c8946467e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 12:15:04 +0100 Subject: [PATCH 102/109] Documentation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d9ad75158..77564d725 100644 --- a/README.md +++ b/README.md @@ -6228,11 +6228,11 @@ class PlayerViewController: UIViewController { } ``` -All values are notified on the main queue: views can be updated right from the change callback. +By default, all values are notified on the main queue. Views can be updated right from the `onChange` callback. An initial fetch is performed as soon as the observation starts: the view is set up and ready when the `viewWillAppear` method returns. -The view controller stores the observer returned by the `start` method in a property. This allows the view controller to control the duration of the observation. When the observer is deallocated, the observation stops. Meanwhile, all transactions that impact the observed player are notified, and the `nameLabel` is kept up-to-date. +The observer returned by the `start` method is stored in a property of the view controller. This allows the view controller to control the duration of the observation. When the observer is deallocated, the observation stops. Meanwhile, all transactions that modify the observed player are notified, and the `nameLabel` is kept up-to-date. > :bulb: **Tip**: see the [Demo Application](DemoApps/GRDBDemoiOS/README.md) for an sample app that uses ValueObservation. From 7d9e87088d87d4e0488b1b2683a4b0c94373d2e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 12:31:26 +0100 Subject: [PATCH 103/109] Rename ValueObservation.isReadOnly to requiresWriteAccess --- GRDB/Core/DatabaseWriter.swift | 20 +++++++++---------- GRDB/Core/ValueObservation.swift | 4 ++-- README.md | 8 ++++---- .../ValueObservationReadonlyTests.swift | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index ff0e50f31..b8a4318ba 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -257,28 +257,23 @@ extension DatabaseWriter { extension ValueObservation where Reducer: ValueReducer { /// Helper method for DatabaseWriter.add(observation:onError:onChange:) fileprivate func fetch(_ db: Database) throws -> Reducer.Fetched { - if isReadOnly { - return try db.readOnly { try reducer.fetch(db) } - } else { + if requiresWriteAccess { var fetchedValue: Reducer.Fetched! try db.inSavepoint { fetchedValue = try reducer.fetch(db) return .commit } return fetchedValue + } else { + return try db.readOnly { try reducer.fetch(db) } } } /// Helper method for DatabaseWriter.add(observation:onError:onChange:) fileprivate func fetchAfterChange(in writer: DatabaseWriter) -> (Database, Reducer) -> Future { // The technique to return a future value after database has changed - // depends on the isReadOnly flag: - if isReadOnly { - // Concurrent fetch - return { [unowned writer] (_, reducer) in - writer.concurrentRead(reducer.fetch) - } - } else { + // depends on the requiresWriteAccess flag: + if requiresWriteAccess { // Synchronous fetch return { (db, reducer) in Future(Result { @@ -290,6 +285,11 @@ extension ValueObservation where Reducer: ValueReducer { return fetchedValue }) } + } else { + // Concurrent fetch + return { [unowned writer] (_, reducer) in + writer.concurrentRead(reducer.fetch) + } } } } diff --git a/GRDB/Core/ValueObservation.swift b/GRDB/Core/ValueObservation.swift index fc352c9f1..914b55351 100644 --- a/GRDB/Core/ValueObservation.swift +++ b/GRDB/Core/ValueObservation.swift @@ -399,13 +399,13 @@ public struct ValueObservation { /// The reducer is triggered upon each database change in *observedRegion*. var reducer: Reducer - /// Default is true. Set this property to false when the observation + /// Default is false. Set this property to true when the observation /// requires write access in order to fetch fresh values. Fetches are then /// wrapped inside a savepoint. /// /// Don't set this flag to true unless you really need it. A read/write /// observation is less efficient than a read-only observation. - public var isReadOnly: Bool = true + public var requiresWriteAccess: Bool = false /// The extent of the database observation. The default is /// `.observerLifetime`: the observation lasts until the diff --git a/README.md b/README.md index 77564d725..15cefecde 100644 --- a/README.md +++ b/README.md @@ -6457,7 +6457,7 @@ Some behaviors of value observations can be configured: - [ValueObservation.extent](#valueobservationextent): fine-grained control of the observation duration - [ValueObservation.scheduling](#valueobservationscheduling): control the dispatching of notified values -- [ValueObservation.isReadOnly](#valueobservationisreadonly): allow observations to write in the database +- [ValueObservation.requiresWriteAccess](#valueobservationrequireswriteaccess): allow observations to write in the database - [ValueObservation Error Handling](#valueobservation-error-handling) @@ -6558,15 +6558,15 @@ The `scheduling` property lets you control how fresh values are notified: > :point_up: **Note**: this unsafe mode is intended for third-party libraries that provide their own scheduling engine. -#### ValueObservation.isReadOnly +#### ValueObservation.requiresWriteAccess -The `isReadOnly` property is true by default. When false, a ValueObservation has a write access to the database when it fetches fresh values: +The `requiresWriteAccess` property is false by default. When true, a ValueObservation has a write access to the database when it fetches fresh values: ```swift var observation = ValueObservation.tracking(..., fetch: { db in // write access allowed }) -observation.isReadOnly = false +observation.requiresWriteAccess = true ``` The `fetch` closure is executed inside a [savepoint](#transactions-and-savepoints). diff --git a/Tests/GRDBTests/ValueObservationReadonlyTests.swift b/Tests/GRDBTests/ValueObservationReadonlyTests.swift index 65236df8e..c5bc764c5 100644 --- a/Tests/GRDBTests/ValueObservationReadonlyTests.swift +++ b/Tests/GRDBTests/ValueObservationReadonlyTests.swift @@ -80,7 +80,7 @@ class ValueObservationReadonlyTests: GRDBTestCase { return result }) observation.extent = .databaseLifetime - observation.isReadOnly = false + observation.requiresWriteAccess = true _ = try observation.start(in: dbQueue) { count in counts.append(count) notificationExpectation.fulfill() @@ -105,7 +105,7 @@ class ValueObservationReadonlyTests: GRDBTestCase { try db.execute("INSERT INTO t DEFAULT VALUES") throw TestError() }) - observation.isReadOnly = false + observation.requiresWriteAccess = true do { _ = try observation.start( From a1a5165bd214c523f17d536cc0e64cc6eb9cac73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 12:48:48 +0100 Subject: [PATCH 104/109] Documentation --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 15cefecde..8f494d6c4 100644 --- a/README.md +++ b/README.md @@ -6560,7 +6560,7 @@ The `scheduling` property lets you control how fresh values are notified: #### ValueObservation.requiresWriteAccess -The `requiresWriteAccess` property is false by default. When true, a ValueObservation has a write access to the database when it fetches fresh values: +The `requiresWriteAccess` property is false by default. When true, a ValueObservation has a write access to the database, and its fetches are automatically wrapped in a [savepoint](#transactions-and-savepoints): ```swift var observation = ValueObservation.tracking(..., fetch: { db in @@ -6569,9 +6569,7 @@ var observation = ValueObservation.tracking(..., fetch: { db in observation.requiresWriteAccess = true ``` -The `fetch` closure is executed inside a [savepoint](#transactions-and-savepoints). - -Don't use this flag unless you actually need it: when you use a [database pool](#database-pools), observations with write access are less efficient. +When you use a [database pool](#database-pools), don't use this flag unless you really need it. Observations with write access are less efficient because they block all writes for the whole duration of a fetch. #### ValueObservation Error Handling From 50213c925f5dc9e720e1e0d89058608cb39ffe5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 13:00:42 +0100 Subject: [PATCH 105/109] Documentation --- README.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f494d6c4..850185d6e 100644 --- a/README.md +++ b/README.md @@ -6455,9 +6455,10 @@ let observer = ValueObservation Some behaviors of value observations can be configured: -- [ValueObservation.extent](#valueobservationextent): fine-grained control of the observation duration -- [ValueObservation.scheduling](#valueobservationscheduling): control the dispatching of notified values -- [ValueObservation.requiresWriteAccess](#valueobservationrequireswriteaccess): allow observations to write in the database +- [ValueObservation.extent](#valueobservationextent): Precise control of the observation duration. +- [ValueObservation.scheduling](#valueobservationscheduling): Control the dispatching of notified values. +- [ValueObservation.requiresWriteAccess](#valueobservationrequireswriteaccess): Allow observations to write in the database. +- [ValueObservation.map](#valueobservationmap): Transform notified values. - [ValueObservation Error Handling](#valueobservation-error-handling) @@ -6572,6 +6573,22 @@ observation.requiresWriteAccess = true When you use a [database pool](#database-pools), don't use this flag unless you really need it. Observations with write access are less efficient because they block all writes for the whole duration of a fetch. +#### ValueObservation.map + +The `map` method lets you transform the values notified by a ValueObservation. + +The transformation runs in a dispatch queue which does not block the main queue or the database, and is suitable for heavy computations: + +```swift +let observation = ValueObservation + .trackingOne(Player.filter(key: 42)) + .map { player in player?.computeValue() } + .start(in: dbQueue) { value in + print(value) + } +``` + + #### ValueObservation Error Handling When you start an observation, you can provide an `onError` callback. This callback is called whenever an error happens when a fresh value is fetched after a database change: From 8c5e3df54636bdf55883ce9c08b185e532f75f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 13:04:22 +0100 Subject: [PATCH 106/109] Documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 850185d6e..f68be1f46 100644 --- a/README.md +++ b/README.md @@ -6591,7 +6591,7 @@ let observation = ValueObservation #### ValueObservation Error Handling -When you start an observation, you can provide an `onError` callback. This callback is called whenever an error happens when a fresh value is fetched after a database change: +When you start an observation, you can provide an `onError` callback. This callback is called whenever an error happens when a fresh value is fetched after a database change. It is scheduled just like values (see [ValueObservation.scheduling](#valueobservationscheduling)): ```swift let observer = try observation.start( From 296a1d5b12238e9bf47389c990eb27464d6ac2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 13:18:27 +0100 Subject: [PATCH 107/109] CHANGELOG --- CHANGELOG.md | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 319a712d1..afec8ff14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,17 +13,18 @@ let observer = ValueObversation } ``` -It is also highly configurable, and aims at providing support for any third-party code that needs to react to database changes. For example, [RxSwiftCommunity/RxGRDB#46](https://github.com/RxSwiftCommunity/RxGRDB/pull/46) is the pull request which implements RxGRDB, the companion library based on [RxSwift](https://github.com/ReactiveX/RxSwift), on top of ValueObservation. +ValueObservation also aims at providing support for third-party code that needs to react to database changes. For example, [RxSwiftCommunity/RxGRDB#46](https://github.com/RxSwiftCommunity/RxGRDB/pull/46) is the pull request which implements RxGRDB, the companion library based on [RxSwift](https://github.com/ReactiveX/RxSwift), on top of ValueObservation. ### New - [#435](https://github.com/groue/GRDB.swift/pull/435): Improved support for values observation +- It is now possible to observe database change from a [DatabaseReader](https://groue.github.io/GRDB.swift/docs/3.5/Protocols/DatabaseReader.html). -### Fixed +### Breaking Change -- It used to be possible to define custom types that adopt the DatabaseReader and DatabaseWriter protocols, with a major drawback: it was impossible to add concurrency-related APIs to GRDB without breaking user code. Now all types that adopt those protocols are defined by GRDB: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. **Expanding this set is no longer supported.** +It used to be possible to define custom types that adopt the [DatabaseReader and DatabaseWriter protocols](README.md#databasewriter-and-databasereader-protocols), with a major drawback: it was impossible to add concurrency-related APIs to GRDB without breaking user code. Now all types that adopt those protocols are defined by GRDB: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. **Expanding this set is no longer supported.** ### Documentation Diff @@ -50,9 +51,9 @@ It is also highly configurable, and aims at providing support for any third-part +protocol DatabaseRegionConvertible { + func databaseRegion(_ db: Database) throws -> DatabaseRegion +} - ++ +extension DatabaseRegion: DatabaseRegionConvertible { } - ++ +struct AnyDatabaseRegionConvertible: DatabaseRegionConvertible { + init(_ region: @escaping (Database) throws -> DatabaseRegion) + init(_ region: DatabaseRegionConvertible) @@ -73,53 +74,54 @@ It is also highly configurable, and aims at providing support for any third-part + func fetch(_ db: Database) throws -> Fetched + mutating func value(_ fetched: Fetched) -> Value? +} - ++ ++extension ValueReducer { ++ func map(_ transform: @escaping (Value) -> T?) -> MapValueReducer ++} ++ +struct AnyValueReducer: ValueReducer { + init(fetch: @escaping (Database) throws -> Fetched, value: @escaping (Fetched) -> Value?) + init(_ reducer: Reducer) where Reducer.Fetched == Fetched, Reducer.Value == Value +} +struct ValueObservation { -+ var isReadOnly: Bool + var extent: Database.TransactionObservationExtent ++ var requiresWriteAccess: Bool + var scheduling: ValueScheduling + static func tracking(_ regions: DatabaseRegionConvertible..., reducer: Reducer) -> ValueObservation +} - ++ +extension ValueObservation where Reducer: ValueReducer { -+ public func start( ++ func map(_ transform: @escaping (Reducer.Value) -> T) ++ -> ValueObservation> ++ func start( + in reader: DatabaseReader, + onError: ((Error) -> Void)? = nil, + onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver +} - ++ +extension ValueObservation where Reducer == Void { + static func tracking( + _ regions: DatabaseRegionConvertible..., + fetch: @escaping (Database) throws -> Value) + -> ValueObservation> ++ + static func tracking( -+ withUniquing regions: DatabaseRegionConvertible..., -+ fetch: @escaping (Database) throws -> Value) -+ -> ValueObservation> ++ _ regions: DatabaseRegionConvertible..., ++ fetchDistinct: @escaping (Database) throws -> Value) ++ -> ValueObservation> + where Value: Equatable + + static func trackingCount(_ request: Request) + -> ValueObservation> -+ static func trackingCount(withUniquing request: Request) -+ -> ValueObservation> -+ + static func trackingAll(_ request: Request) -+ -> ValueObservation> -+ static func trackingAll(withUniquing request: Request) -+ -> ValueObservation> ++ -> ValueObservation> + static func trackingOne(_ request: Request) -+ -> ValueObservation> -+ static func trackingOne(withUniquing request: Request) -+ -> ValueObservation> ++ -> ValueObservation> +} ``` + ## 3.4.0 Released October 8, 2018 • [diff](https://github.com/groue/GRDB.swift/compare/v3.3.1...v3.4.0) @@ -193,7 +195,7 @@ This release comes with **Association Aggregates**. They let you compute values +} +extension SQLSpecificExpressible { -+ public func aliased(_ key: CodingKey) -> SQLSelectable ++ func aliased(_ key: CodingKey) -> SQLSelectable +} ``` From b3c7fec676830f2412b02fc9f9b69f8cb4e16821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 13:56:52 +0100 Subject: [PATCH 108/109] Documentation --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f68be1f46..c689dec52 100644 --- a/README.md +++ b/README.md @@ -7767,7 +7767,7 @@ Only five types adopt those protocols: DatabaseQueue, DatabasePool, DatabaseSnap DatabaseReader and DatabaseWriter provide the *smallest* common guarantees: they don't erase the differences between queues, pools, and snapshots. See for example [Differences between Database Queues and Pools](#differences-between-database-queues-and-pools). -However, you can easily prevent some parts of your application from writing in the database by giving them a DatabaseReader: +However, you can prevent some parts of your application from writing in the database by giving them a DatabaseReader: ```swift // This class can read in the database, but can't write into it. @@ -7783,6 +7783,14 @@ let dbQueue: DatabaseQueue = ... let component = MyReadOnlyComponent(reader: dbQueue) ``` +> :point_up: **Note**: DatabaseReader is not a **secure** way to prevent an application component from writing in the database, because write access is just a cast away: +> +> ```swift +> if let dbQueue = reader as? DatabaseQueue { +> try dbQueue.write { ... } +> } +> ``` + ### Unsafe Concurrency APIs From 07bf5882feb8a7929fa4ffb65fcc4fc8bac34285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 2 Nov 2018 16:28:06 +0100 Subject: [PATCH 109/109] Adding more reactive engines is no longer hard --- CONTRIBUTING.md | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0b878a9ad..b7f3ab8b6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,7 +75,6 @@ The ideas, in alphabetical order: - [CloudKit] - [Concurrency] - [Custom FTS5 Auxiliary Functions] -- [Database Observation] - [Date and Time Functions] - [Decode NSDecimalNumber from Text Columns] - [Documentation] @@ -86,6 +85,7 @@ The ideas, in alphabetical order: - [JSON] - [Linux] - [More SQL Generation] +- [Reactive Database Observation] - [Records: Splitting Database Encoding from Ability to Write in the Database] - [SQL Console in the Debugger] - [SQLCipher in a Shared App Container] @@ -160,24 +160,6 @@ Applications can define their own [custom FTS5 auxiliary functions](https://www. See issue [#421](https://github.com/groue/GRDB.swift/issues/421) for more information. -### Database Observation - -:muscle: Hard - -[Database Observation](README#database-changes-observation) is currently available in three flavors: - -- The [TransactionObserver](README.md#transactionobserver-protocol) protocol: versatile, but low-level and challenging in terms of concurrency, especially when used in conjunction with database pools. - -- [FetchedRecordsController]: high-level and easier to use. - -- [RxGRDB]: high-level and easier to use, depends on [RxSwift](https://github.com/ReactiveX/RxSwift). - -Suggested contributions are: - -- Enhancements to FetchedRecordsController (see below). -- More choices of reactive engines. - - ### Date and Time Functions :baby: Starter Task @@ -257,7 +239,7 @@ let stringRequest = Player.select(Column("name"), as: String.self) let rowRequest = SQLRequest("SELECT ...") ``` -This limitation does not apply to [RxGRDB], the reactive sibling of FetchedRecordsController. It would be nice if FetchedRecordsController would become just as versatile. +This limitation does not apply to [ValueObservation] and [RxGRDB]. It would be nice if FetchedRecordsController would become just as versatile. ### FetchedRecordsController Support for Sections @@ -312,6 +294,15 @@ There are several SQLite features that GRDB could natively support: - [More ideas](https://www.sqlite.org/lang.html) +### Reactive Database Observation + +:baby: Starter Task + +We already have the [RxGRDB] companion library, which offers [RxSwift](https://github.com/ReactiveX/RxSwift) bindings. + +We need more choices of reactive engines. + + ### Records: Splitting Database Encoding from Ability to Write in the Database :baby: Starter Task :pencil: Documentation @@ -416,3 +407,4 @@ Features that blur this focus are non-goals: [PersistableRecord]: README.md#persistablerecord-protocol [Record Comparison]: README.md#record-comparison [Requesting Associated Records]: Documentation/AssociationsBasics.md#requesting-associated-records +[ValueObservation]: README.md#valueobservation