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