@@ -16,6 +16,8 @@ The following commands are supported:
16
16
- A ` schema: { tables: Table[], raw_tables: RawTable[] } ` entry specifying the schema of the database to
17
17
use. Regular tables are also inferred from the database itself, but raw tables need to be specified.
18
18
If no raw tables are used, the ` schema ` entry can be omitted.
19
+ - ` active_streams ` : An array of ` {name: string, params: Record<string, any>} ` entries representing streams that
20
+ have an active subscription object in the application at the time the stream was opened.
19
21
2 . ` stop ` : No payload, requests the current sync iteration (if any) to be shut down.
20
22
3 . ` line_text ` : Payload is a serialized JSON object received from the sync service.
21
23
4 . ` line_binary ` : Payload is a BSON-encoded object received from the sync service.
@@ -26,8 +28,14 @@ The following commands are supported:
26
28
6 . ` completed_upload ` : Notify the sync implementation that all local changes have been uploaded.
27
29
7 . ` update_subscriptions ` : Notify the sync implementation that subscriptions which are currently active in the app
28
30
have changed. Depending on the TTL of caches, this may cause it to request a reconnect.
29
- 8 . ` subscriptions ` : Store a new sync steam subscription in the database or remove it.
31
+ 8 . ` connection ` : Notify the sync implementation about the connection being opened (second parameter should be ` established ` )
32
+ or the HTTP stream closing (second parameter should be ` end ` ).
33
+ This is used to set ` connected ` to true in the sync status without waiting for the first sync line.
34
+ 9 . ` subscriptions ` : Store a new sync steam subscription in the database or remove it.
30
35
This command can run outside of a sync iteration and does not affect it.
36
+ 10 . ` update_subscriptions ` : Second parameter is a JSON-encoded array of ` {name: string, params: Record<string, any>} ` .
37
+ If a new subscription is created, or when a subscription without a TTL has been removed, the client will ask to
38
+ restart the connection.
31
39
32
40
` powersync_control ` returns a JSON-encoded array of instructions for the client:
33
41
0 commit comments