Skip to content

ValueObservation and tracking regions #1756

Answered by groue
Artem-Viveritsa asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @Artem-Viveritsa,

Even when an app defines a very precise region, we're limited by the abilities of SQLite, which can only track columns and rows identified by their numerical rowid. That's it. See DatabaseRegion.

Let's focus on your request:

AnyBlock.select(AnyBlock.SyncableColumns.updatedAt).status(.active).type(type)

I suppose it means "The updatedAt column of all rows of the AnyBlock table that have the status active and the type type".

SQLite can only observe "the updatedAt column of all rows of the AnyBlock table", discarding the status and type filtering.

So GRDB notifies changes even for changes that happen in other statuses and types.

This explains this line of the ValueObs…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@Artem-Viveritsa
Comment options

@groue
Comment options

groue Apr 2, 2025
Maintainer

@Artem-Viveritsa
Comment options

Answer selected by Artem-Viveritsa
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants