Skip to content

Commit 11191a0

Browse files
committed
Update syntax + fix typos
Used parameter types support in diagnostics app to test syntax
1 parent f206a29 commit 11191a0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

images/usage/use-case-prioritized.png

17.1 KB
Loading

usage/use-case-examples/prioritized-sync.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
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."
44
---
55

66
## Overview
@@ -12,7 +12,7 @@ The general approach is as follows:
1212
3. Use [client parameters](/usage/sync-rules/advanced-topics/client-parameters) to control which priorities you want the client to sync
1313

1414
## 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:
1616

1717
1. First, sync all the user's lists, enabling us to render the initial screen in the app
1818
2. Then, sync the user's todos
@@ -28,12 +28,12 @@ bucket_definitions:
2828
- select * from lists where id = bucket.list_id
2929
# sync any remaining tables, in this case todo items
3030
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)
3232
data:
3333
- select * from todos where list_id = bucket.list_id
3434
```
3535
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:
3737
3838
<Frame>
3939
<img src="/images/usage/use-case-prioritized.png"/>

0 commit comments

Comments
 (0)