mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
Cleanup
This commit is contained in:
1 parent
61e74f9ad4
commit
ff2629a31c
1 file changed
+5
-15
@@ -114,9 +114,7 @@ extension ValueObserver: TransactionObserver {
|
||||
})
|
||||
} else {
|
||||
// Concurrent fetch
|
||||
fetchedValue = writer.concurrentRead {
|
||||
return try self.reducer.fetch($0)
|
||||
}
|
||||
fetchedValue = writer.concurrentRead(reducer.fetch)
|
||||
}
|
||||
|
||||
// Wait for future fetched value in reduceQueue. This guarantees:
|
||||
@@ -154,21 +152,13 @@ extension ValueObserver {
|
||||
var region = DatabaseRegion()
|
||||
let result = try db.recordingSelection(®ion, fetch)
|
||||
|
||||
// Don't record views, because they are never exposed to the
|
||||
// TransactionObserver protocol.
|
||||
//
|
||||
// Don't record schema introspection queries, which may be
|
||||
// run, or not, depending on the state of the schema cache.
|
||||
//
|
||||
// This gives us a quick way to make sure that the observation
|
||||
// below, which runs schema introspection queries as a side effect,
|
||||
// only tracks the "player" table:
|
||||
//
|
||||
// let observation = ValueObservation.tracking { db in
|
||||
// try Player.fetchOne(db, key: 1)
|
||||
// }
|
||||
//
|
||||
// Strictly speaking, this prevents the recording of all schema
|
||||
// queries. But we assume, until proven wrong, that such recording
|
||||
// isn't needed by anyone.
|
||||
observedRegion = try region.ignoringViews(db).ignoringInternalSQLiteTables()
|
||||
|
||||
return result
|
||||
} else {
|
||||
return try fetch()
|
||||
|
||||
Reference in new issue
Block a user