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
/// For [RealtimeListenTypes.postgresChanges] it's of the format `column=filter.value` with `filter` being one of `eq, neq, lt, lte, gt, gte, in`
81
+
/// For [RealtimeListenTypes.postgresChanges] it's of the format `column=filter.value` with `filter` being one of `eq, neq, lt, lte, gt, gte, in, like, ilike, is, match, imatch, isdistinct`.
82
82
///
83
-
/// Only one filter can be applied
83
+
/// Multiple conditions can be combined with commas; they are applied as an `AND`.
84
+
/// Any operator can be negated with the `not.` prefix.
84
85
finalString? filter;
85
86
87
+
/// For [RealtimeListenTypes.postgresChanges], restricts the change payload to
88
+
/// a subset of columns instead of the full row.
89
+
finalList<String>? select;
90
+
86
91
constChannelFilter({
87
92
this.event,
88
93
this.schema,
89
94
this.table,
90
95
this.filter,
96
+
this.select,
91
97
});
92
98
93
-
Map<String, String> toMap() {
99
+
Map<String, dynamic> toMap() {
94
100
return {
95
101
if (event !=null) 'event': event!,
96
102
if (schema !=null) 'schema': schema!,
97
103
if (table !=null) 'table': table!,
98
104
if (filter !=null) 'filter': filter!,
105
+
if (select !=null) 'select': select!,
99
106
};
100
107
}
101
108
}
@@ -178,13 +185,24 @@ class RealtimeChannelConfig {
178
185
/// Defines if the channel is private or not and if RLS policies will be used to check data
179
186
finalbool private;
180
187
188
+
/// [replicationReady] instructs the server to emit a `system` event once the
189
+
/// Postgres replication connection backing this channel is established and
190
+
/// ready to stream changes.
191
+
///
192
+
/// Listen for it with [RealtimeChannel.onSystemEvents]; the payload's
193
+
/// [RealtimeSystemPayload.status] is `'ok'`
194
+
/// (message: `'Replication connection established'`) on success or `'error'`
195
+
/// if the connection is not ready in time.
196
+
finalbool replicationReady;
197
+
181
198
constRealtimeChannelConfig({
182
199
this.ack =false,
183
200
this.self =false,
184
201
this.replay,
185
202
this.key ='',
186
203
this.enabled =false,
187
204
this.private =false,
205
+
this.replicationReady =false,
188
206
});
189
207
190
208
Map<String, dynamic> toMap() {
@@ -195,6 +213,9 @@ class RealtimeChannelConfig {
195
213
if (replay !=null) {
196
214
broadcastConfig['replay'] = replay!.toMap();
197
215
}
216
+
if (replicationReady) {
217
+
broadcastConfig['replication_ready'] =true;
218
+
}
198
219
199
220
return {
200
221
'config': {
@@ -209,6 +230,48 @@ class RealtimeChannelConfig {
209
230
}
210
231
}
211
232
233
+
/// Payload of a `system` event emitted by the server.
234
+
///
235
+
/// Most notably, when a channel is created with
236
+
/// [RealtimeChannelConfig.replicationReady] set to `true`, the server sends one
237
+
/// of these once the Postgres replication connection is ready
238
+
/// ([status] is `'ok'`) or fails to become ready in time ([status] is
239
+
/// `'error'`).
240
+
classRealtimeSystemPayload {
241
+
/// The extension that produced the message, e.g. `'system'` or
242
+
/// `'postgres_changes'`.
243
+
finalStringextension;
244
+
245
+
/// `'ok'` on success, `'error'` on failure.
246
+
finalString status;
247
+
248
+
/// Human-readable description, e.g. `'Replication connection established'`.
0 commit comments