-
Hello 👋🏼 With
Is there a way to observe insert/delete/update of rows directly and get back the objects that were inserted/deleted, e.g. as a I'm imagining an API along the lines of ValueObservation(events: [.deletion])
.tracking(Player.self)
.publisher(in: db.reader) If it's already available and I overlooked it in the docs I'm very sorry! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Hello @MartinP7r, You can turn a ValueObservation into a Combine publisher, with the same api as the one you are imagining. For details, see GRDB ❤️ Combine. For more usages of ValueObservation (including Combine, but also asynchronous sequences), see ValueObservation Usage. |
Beta Was this translation helpful? Give feedback.
-
Oops, my initial answer is off topic.
You can build this from the low-level TransactionObserver protocol. You'll get there the most information that SQLite can provide about database changes. |
Beta Was this translation helpful? Give feedback.
Oops, my initial answer is off topic.
You can build this from the low-level TransactionObserver protocol. You'll get there the most information that SQLite can provide about database changes.