You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue with `observesAllDatabaseChanges` is that this was a misleading name: transaction observers are not notified of changes that are performed in a save point that is eventually rollbacked.
By exposing the DatabaseEventObservationStrategy type, we allow for a future extra flag that ignores save points, trading observation precision for a reduced memory footprint.
Copy file name to clipboardExpand all lines: GRDB/Documentation.docc/Extension/DatabaseRegionObservation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ let observation = DatabaseRegionObservation(
79
79
`DatabaseRegionObservation` will not notify impactful transactions whenever the database is modified in an undetectable way:
80
80
81
81
- Changes performed by external database connections.
82
-
- Changes performed by SQLite statements that are not compiled and executed by GRDB, including statements ran from a custom SQL function that is itself invoked with GRDB APIs.
82
+
- Changes performed by SQLite statements that are not a `DELETE`, `INSERT` or `UPDATE` statement compiled and executed by GRDB.
83
83
- Changes to the database schema, changes to internal system tables such as `sqlite_master`.
84
84
- Changes to [`WITHOUT ROWID`](https://www.sqlite.org/withoutrowid.html) tables.
Copy file name to clipboardExpand all lines: GRDB/Documentation.docc/Extension/TransactionObserver.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ do {
97
97
98
98
**Transaction observers can choose the database changes they are interested in.**
99
99
100
-
The``observes(eventsOfKind:)`` method filters events that are notified to ``databaseDidChange(with:)``. It is the most efficient and recommended change filtering technique, because it is only called once before a database query is executed, and can completely disable change tracking:
100
+
By default, the``observes(eventsOfKind:)`` method filters events that are notified to ``databaseDidChange(with:)``. It is the most efficient and recommended change filtering technique, because it is only called once before a database query is executed, and can completely disable change tracking:
101
101
102
102
```swift
103
103
// Calls `observes(eventsOfKind:)` once.
@@ -125,8 +125,7 @@ class PlayerObserver: TransactionObserver {
125
125
126
126
When the `observes(eventsOfKind:)` method returns false for all event kinds, the observer is still notified of transactions.
127
127
128
-
In addition to ``observes(eventsOfKind:)``, transaction observers can implement the `observesAllDatabaseChanges` getter. When set to `true`, the observer will
129
-
observe all changes to the database.
128
+
The filtering performed by ``observes(eventsOfKind:)`` makes a transaction observer unaware of changes performed by SQLite statements that are not a `DELETE`, `INSERT` or `UPDATE` statement compiled and executed by GRDB. You can lift this limitation with the ``TransactionObserver/databaseEventObservationStrategy``.
130
129
131
130
## Observation Extent
132
131
@@ -235,7 +234,7 @@ The changes and transactions that are not automatically notified to transaction
235
234
236
235
-Read-only transactions.
237
236
-Changesand transactions performed by external database connections.
238
-
-Changes performed by SQLite statements that are notboth compiled and executed throughGRDBAPIs, including statements ran from a custom SQL function that is itself invoked with GRDBAPIs.
237
+
-Changes performed by SQLite statements that are nota `DELETE`, `INSERT`or`UPDATE` statement compiled and executed byGRDB(this limitation can be lifted, in your custom `TransactionObserver` type, with ``TransactionObserver/databaseEventObservationStrategy``).
239
238
-Changes to the database schema, changes to internal system tables such as `sqlite_master`.
240
239
-Changes to [`WITHOUT ROWID`](https://www.sqlite.org/withoutrowid.html) tables.
241
240
-The deletion of duplicate rows triggered by [`ON CONFLICT REPLACE`](https://www.sqlite.org/lang_conflict.html) clauses (this last exception might change in a future release of SQLite).
Copy file name to clipboardExpand all lines: GRDB/Documentation.docc/Extension/ValueObservation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,7 +228,7 @@ This ``tracking(region:_:fetch:)`` method lets you entirely separate the **obser
228
228
`ValueObservation` will not fetch and notify a fresh value whenever the database is modified in an undetectable way:
229
229
230
230
- Changes performed by external database connections.
231
-
- Changes performed by SQLite statements that are not compiled and executed by GRDB, including statements ran from a custom SQL function that is itself invoked with GRDB APIs.
231
+
- Changes performed by SQLite statements that are not a `DELETE`, `INSERT` or `UPDATE` statement compiled and executed by GRDB.
232
232
- Changes to the database schema, changes to internal system tables such as `sqlite_master`.
233
233
- Changes to [`WITHOUT ROWID`](https://www.sqlite.org/withoutrowid.html) tables.
0 commit comments