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
Follow the [database creation guide](https://docs.sqlitecloud.io/docs/create-database).
103
117
104
-
> Ensure your tables have identical schemas in both local and cloud databases.
118
+
> Ensure your tables have identical schemas in both local and cloud databases. See [SQLite Sync Best Practices](https://docs.sqlitecloud.io/docs/sqlite-sync-best-practices) for schema requirements (e.g., all non-primary-key `NOT NULL` columns must have a `DEFAULT` value).
105
119
106
120
3.**Enable OffSync**
107
121
Configure OffSync by following the [OffSync setup guide](https://docs.sqlitecloud.io/docs/offsync#:~:text=in%20the%20cloud.-,Configuring%20OffSync,-You%20can%20enable).
@@ -156,6 +170,7 @@ import {
156
170
useOnTableUpdate,
157
171
useTriggerSqliteSync,
158
172
useSqliteTransaction,
173
+
useSyncStatus,
159
174
} from '@sqliteai/sqlite-sync-react-native';
160
175
161
176
interface Task {
@@ -186,7 +201,10 @@ function TaskList() {
186
201
187
202
// 3. WRITING DATA: Use transactions to trigger reactive queries
// 4. SYNC STATUS: Get sync state for UI indicators
207
+
const { isSyncing } =useSyncStatus();
190
208
191
209
const addTask =useCallback(
192
210
async (title:string) => {
@@ -748,7 +766,8 @@ Manually trigger a sync operation.
748
766
**How it works:** This hook is a convenience wrapper that exposes the `triggerSync` function from the Provider. The actual sync logic lives in `SQLiteSyncProvider` to ensure that `isSyncing`, `lastSyncTime`, and `lastSyncChanges` state are updated correctly, allowing all hooks (`useSqliteSyncQuery`) to react properly.
0 commit comments