postgresSingleDataFlow

inline suspend fun <Data : Any> RealtimeChannel.postgresSingleDataFlow(schema: String = "public", table: String, primaryKey: PrimaryKey<Data>, crossinline filter: PostgrestFilterBuilder.() -> Unit): Flow<Data>(source)
inline suspend fun <Data, Value> RealtimeChannel.postgresSingleDataFlow(schema: String = "public", table: String, primaryKey: KProperty1<Data, Value>, crossinline filter: PostgrestFilterBuilder.() -> Unit): Flow<Data>(source)

This function retrieves the initial data for a single value and then listens for changes on that value. It automatically handles updates and closes the flow on the delete event.

If you want more control, use the postgresChangeFlow function.

Return

a Flow of the current data. This flow emits a new value whenever a change occurs.

Parameters

schema

the schema of the table

table

the table name

filter

filter the the value you want to listen to

primaryKey

the primary key of the Data type