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: demos/android-supabase-todolist/README.md
+23
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,29 @@ Follow this guide to:
11
11
2. Create a new PowerSync instance, connecting to the database of the Supabase project. See instructions [here](https://docs.powersync.com/integration-guides/supabase-+-powersync#connect-powersync-to-your-supabase).
12
12
3. Deploy sync rules.
13
13
14
+
### Opting in to priorities
15
+
16
+
If you want to use the example with [bucket priorities](https://docs.powersync.com/usage/use-case-examples/prioritized-sync),
17
+
you can adopt the following sync rules instead of the ones suggested by the simpler integration guide:
18
+
19
+
```YAML
20
+
bucket_definitions:
21
+
all_lists:
22
+
priority: 1
23
+
parameters: select request.user_id() as "user"
24
+
data:
25
+
- select * from lists where owner_id = bucket."user"
26
+
27
+
list_items:
28
+
# Separate bucket per list
29
+
parameters: select id as list_id from lists where owner_id = request.user_id()
30
+
data:
31
+
- select * from todos where list_id = bucket.list_id
32
+
```
33
+
34
+
The project will work with both sync rules, but giving lists a higher priority allows updates to be synchronized before
35
+
all items have been received.
36
+
14
37
## Configure project in Android Studio
15
38
16
39
1. Clone this repo: ```git clone https://github.com/powersync-ja/powersync-kotlin.git```
0 commit comments