File tree 1 file changed +21
-0
lines changed 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,27 @@ export class SubscriptionBuilder {
121
121
subscribe ( query_sql : string [ ] ) : void {
122
122
this . db [ 'subscribe' ] ( query_sql , this . #onApplied, this . #onError) ;
123
123
}
124
+
125
+ /**
126
+ * Subscribes to all rows from all tables.
127
+ *
128
+ * This method is intended as a convenience
129
+ * for applications where client-side memory use and network bandwidth are not concerns.
130
+ * Applications where these resources are a constraint
131
+ * should register more precise queries via `subscribe`
132
+ * in order to replicate only the subset of data which the client needs to function.
133
+ *
134
+ * This method should not be combined with `subscribe` on the same `DbConnection`.
135
+ * A connection may either `subscribe` to particular queries,
136
+ * or `subscribeToAllTables`, but not both.
137
+ * Attempting to call `subscribe`
138
+ * on a `DbConnection` that has previously used `subscribeToAllTables`,
139
+ * or vice versa, may misbehave in any number of ways,
140
+ * including dropping subscriptions, corrupting the client cache, or throwing errors.
141
+ */
142
+ subscribeToAllTables ( ) : void {
143
+ this . subscribe ( [ 'SELECT * FROM *' ] ) ;
144
+ }
124
145
}
125
146
126
147
/**
You can’t perform that action at this time.
0 commit comments