querySnapshot

fun querySnapshot(result: PostgrestResult?, isFromCache: Boolean, fetchedAt: Instant?, hasPendingMutations: Boolean = false, refresh: RefreshState = RefreshState.Idle): QuerySnapshot(source)

One emission of a reactive read, as selectAsFlow hands one out.

Parameters

result

the rows, or null while nothing is known for the query; build one as for appliedOutcome.

isFromCache

whether the rows are the device's copy.

fetchedAt

when they were fetched, or null while nothing is cached.

hasPendingMutations

whether a queued write changed a row shown.

refresh

how the refresh behind the read stands.


fun querySnapshot(result: PostgrestResult?, isFromCache: Boolean, fetchedAt: Instant?, pendingRowKeys: Set<JsonObject>, refresh: RefreshState = RefreshState.Idle): QuerySnapshot(source)

One emission of a reactive read that names the rows a queued write changed, as selectAsFlow hands one out: QuerySnapshot.pendingRowKeys reads pendingRowKeys, and QuerySnapshot.hasPendingMutations reads true exactly when it is not empty, as the library's own snapshot does when each row changed carries its key. For a write that changed a row without a key to name, build the snapshot with the other querySnapshot and hasPendingMutations = true.

Parameters

result

the rows, or null while nothing is known for the query; build one as for appliedOutcome.

isFromCache

whether the rows are the device's copy.

fetchedAt

when they were fetched, or null while nothing is cached.

pendingRowKeys

the primary keys of the rows a queued write added, changed or removed, each an object of the table's key columns, such as {"id": "a1"}.

refresh

how the refresh behind the read stands.