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
Copy file name to clipboardExpand all lines: usage/use-case-examples/prioritized-sync.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: "Prioritizied Sync"
3
-
description: "In some scenarios, you may want to sync tables using different priorities. For example, you may want to sync a subset of all tables first to log a user in as fast as possible, then sync the reamining tables in the background."
2
+
title: "Prioritized Sync"
3
+
description: "In some scenarios, you may want to sync tables using different priorities. For example, you may want to sync a subset of all tables first to log a user in as fast as possible, then sync the remaining tables in the background."
4
4
---
5
5
6
6
## Overview
@@ -12,7 +12,7 @@ The general approach is as follows:
12
12
3. Use [client parameters](/usage/sync-rules/advanced-topics/client-parameters) to control which priorities you want the client to sync
13
13
14
14
## Example
15
-
Suppose we have two tables: `lists` and `todos` (as per the standard todolist demo app [schema](/integration-guides/supabase-+-powersync#create-the-demo-database-schema)). We want the sync to behave as follows:
15
+
Suppose we have two tables: `lists` and `todos` (as per the standard todolist demo app [schema](/integration-guides/supabase-+-powersync#create-the-demo-database-schema)). Further, suppose we want the sync priority to behave as follows:
16
16
17
17
1. First, sync all the user's lists, enabling us to render the initial screen in the app
18
18
2. Then, sync the user's todos
@@ -28,12 +28,12 @@ bucket_definitions:
28
28
- select * from lists where id = bucket.list_id
29
29
# sync any remaining tables, in this case todo items
30
30
remaining:
31
-
parameters: select id as list_id from lists where owner_id = token_parameters.user_id and (request.parameters() ->> 'remaining_tables' = 'true')
31
+
parameters: select id as list_id from lists where owner_id = token_parameters.user_id and (request.parameters() ->> 'remaining_tables' = true)
32
32
data:
33
33
- select * from todos where list_id = bucket.list_id
34
34
```
35
35
36
-
It is recommended to set Client Parammeters in the [Diagnostics App](https://github.com/powersync-ja/powersync-js/tree/main/tools/diagnostics-app) to verify functionality at this point:
36
+
It is recommended to set Client Parameters in the [Diagnostics App](https://github.com/powersync-ja/powersync-js/tree/main/tools/diagnostics-app) to verify functionality at this point:
0 commit comments