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
OffSync is a powerful SQLite Cloud feature that enables true **local-first** data synchronization for your applications. Powered by the <ahref="https://github.com/sqliteai/sqlite-sync"target="_blank">SQLite Sync</a> extension, it allows you to build robust, offline-capable applications where data is stored and processed on edge devices and seamlessly synchronized with a central SQLite Cloud database.
@@ -31,35 +26,51 @@ OffSync extends standard SQLite tables with built-in support for offline work an
31
26
When combined with [Row-Level Security (RLS)](/docs/rls), OffSync allows you to build secure, multi-tenant applications where each user's data is safely isolated, both on the edge and in the cloud.
32
27
33
28
34
-
---
29
+
---
35
30
36
31
## Configuring OffSync
37
32
38
-
You can enable and manage OffSync for your databases directly from the SQLite Cloud dashboard.
39
-
Below are the main steps:
33
+
You can enable and manage OffSync for your databases directly from the SQLite Cloud dashboard.
34
+
The OffSync panel has four tabs: **Sync Tables**, **Configuration**, **Devices**, and **Metrics**.
35
+
36
+
### Enabling and Disabling OffSync
37
+
38
+
When OffSync is not yet active for a database, the panel shows a brief explanation and an **Enable OffSync** button. Clicking it opens a confirmation dialog; after confirming, the database is registered with the sync service and the tabbed view appears.
39
+
40
+
To disable OffSync, click the **Disable OffSync** button in the top-right corner of the panel and confirm the action in the dialog that appears.
40
41
41
42
### Enable Tables for Synchronization
42
-
From the **Sync Tables** tab, select which tables in your database you want to keep synchronized.
43
+
44
+
From the **Sync Tables** tab, select which tables in your database you want to keep synchronized.
43
45
Once enabled, all changes to those tables will automatically sync with connected devices.
44
46
45
-
<VideoPlayersrc={enableSync} />
47
+
### Configuration Tab
46
48
49
+
The **Configuration** tab contains two sub-sections:
47
50
48
-
### Get the Connection String
49
-
In the **Configuration** tab, copy the connection string.
50
-
Use this in your application to initialize OffSync and connect your local SQLite database with SQLite Cloud.
51
+
**Database ID** — A read-only field showing the unique identifier for your OffSync-enabled database, with a copy button for convenience. Use this ID in your application to initialize the sync connection:
51
52
52
-
<VideoPlayersrc={connectionUrlSync} />
53
+
```sql
54
+
SELECT cloudsync_network_init('<database-id>');
55
+
```
53
56
57
+
**Push Notifications** — Configure an Expo access token to enable push notifications when using `sqlite-sync-react-native` in push mode. The tab shows the current notification status: **Working**, **Paused**, or **Not working**.
54
58
55
59
### Manage Connected Devices
56
-
In the **Devices** tab, you can view all devices currently connected to your database.
57
-
Here you can check their sync status and remove devices if needed.
58
60
59
-
<VideoPlayersrc={devicesSync} />
61
+
In the **Devices** tab, you can view all devices currently connected to your database.
62
+
Here you can check their sync status and remove devices if needed.
60
63
61
64
<Callouttype="note"title="Matching Schemas and Tables">
62
65
For OffSync to work correctly, the list of tables configured for synchronization—and their corresponding schemas—must be identical in both your local SQLite database and your SQLite Cloud database.
63
66
</Callout>
64
67
68
+
### Metrics Tab
69
+
70
+
The **Metrics** tab provides visibility into daily and cumulative usage for your OffSync-enabled database:
71
+
72
+
-**Active devices** — number of devices that have synced within the period
73
+
-**Upload bytes** — data sent from devices to SQLite Cloud
74
+
-**Download bytes** — data sent from SQLite Cloud to devices
75
+
65
76
Once enabled, any changes made to the selected tables via the SQLite Sync extension will be automatically synchronized with your SQLite Cloud database.
0 commit comments