Skip to content

Commit 3cb2053

Browse files
committed
Merge branch 'main' into uuid-pk
2 parents ef4d46b + e9416f4 commit 3cb2053

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

examples/to-do-app/.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Copy from the SQLite Cloud Dashboard
22
# eg: sqlitecloud://myhost.cloud:8860/my-remote-database.sqlite?apikey=myapikey
3-
CONNECTION_STRING = "<your-connection-string>"
3+
CONNECTION_STRING = "<your-connection-string>"
4+
API_TOKEN =

examples/to-do-app/hooks/useCategories.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState, useEffect } from 'react'
22
import { Platform } from 'react-native';
33
import { db } from "../db/dbConnection";
4-
import { CONNECTION_STRING } from "@env";
4+
import { CONNECTION_STRING, API_TOKEN } from "@env";
55
import { getDylibPath } from "@op-engineering/op-sqlite";
66
import { randomUUID } from 'expo-crypto';
77
import { useSyncContext } from '../components/SyncContext';
@@ -69,11 +69,8 @@ const useCategories = () => {
6969
await db.execute('INSERT OR IGNORE INTO tags (uuid, name) VALUES (?, ?)', [randomUUID(), 'Work'])
7070
await db.execute('INSERT OR IGNORE INTO tags (uuid, name) VALUES (?, ?)', [randomUUID(), 'Personal'])
7171

72-
if (CONNECTION_STRING && CONNECTION_STRING.startsWith('sqlitecloud://')) {
73-
await db.execute(`SELECT cloudsync_network_init('${CONNECTION_STRING}');`);
74-
} else {
75-
throw new Error('No valid CONNECTION_STRING provided, cloudsync_network_init will not be called');
76-
}
72+
await db.execute(`SELECT cloudsync_network_init('${CONNECTION_STRING}');`);
73+
await db.execute(`SELECT cloudsync_network_set_token('${API_TOKEN}');`)
7774

7875
db.execute('SELECT cloudsync_network_sync(100, 10);')
7976
getCategories()

src/cloudsync.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
extern "C" {
1818
#endif
1919

20-
#define CLOUDSYNC_VERSION "0.9.98"
20+
#define CLOUDSYNC_VERSION "0.9.100"
2121
#define CLOUDSYNC_MAX_TABLENAME_LEN 512
2222

2323
#define CLOUDSYNC_VALUE_NOTSET -1

0 commit comments

Comments
 (0)