Skip to content

Commit e5c620c

Browse files
committed
Testing op-sqlite inline require
1 parent 3c1b036 commit e5c620c

File tree

3 files changed

+16965
-20843
lines changed

3 files changed

+16965
-20843
lines changed

demos/react-native-supabase-todolist/library/powersync/system.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { AppConfig } from '../supabase/AppConfig';
1111
import { SupabaseConnector } from '../supabase/SupabaseConnector';
1212
import { AppSchema } from './AppSchema';
1313
import { PhotoAttachmentQueue } from './PhotoAttachmentQueue';
14+
import { OPSqliteOpenFactory } from '@powersync/op-sqlite'; // Add this import
1415

1516
Logger.useDefaults();
1617

@@ -25,12 +26,17 @@ export class System {
2526
this.kvStorage = new KVStorage();
2627
this.supabaseConnector = new SupabaseConnector(this);
2728
this.storage = this.supabaseConnector.storage;
28-
this.powersync = new PowerSyncDatabase({
29-
schema: AppSchema,
30-
database: {
31-
dbFilename: 'sqlite.db'
32-
}
29+
// this.powersync = new PowerSyncDatabase({
30+
// schema: AppSchema,
31+
// database: {
32+
// dbFilename: 'sqlite.db'
33+
// }
34+
// });
35+
36+
const factory = new OPSqliteOpenFactory({
37+
dbFilename: 'sqlite.db'
3338
});
39+
this.powersync = new PowerSyncDatabase({ database: factory, schema: AppSchema });
3440
/**
3541
* The snippet below uses OP-SQLite as the default database adapter.
3642
* You will have to uninstall `@journeyapps/react-native-quick-sqlite` and

demos/react-native-supabase-todolist/package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"dependencies": {
1111
"@azure/core-asynciterator-polyfill": "^1.0.2",
1212
"@expo/vector-icons": "^14.0.3",
13-
"@journeyapps/react-native-quick-sqlite": "^2.0.0",
13+
"@op-engineering/op-sqlite": "^9.1.3",
14+
"@powersync/op-sqlite": "workspace:*",
1415
"@powersync/attachments": "workspace:*",
1516
"@powersync/common": "workspace:*",
1617
"@powersync/react": "workspace:*",
@@ -20,7 +21,7 @@
2021
"@react-navigation/native": "^6.0.0",
2122
"@supabase/supabase-js": "^2.33.1",
2223
"base64-arraybuffer": "^1.0.2",
23-
"expo": "51.0.34",
24+
"expo": "51.0.37",
2425
"expo-build-properties": "~0.12.1",
2526
"expo-camera": "~15.0.16",
2627
"expo-constants": "~16.0.2",
@@ -40,7 +41,7 @@
4041
"react-native-encrypted-storage": "^4.0.3",
4142
"react-native-gesture-handler": "~2.16.2",
4243
"react-native-prompt-android": "^1.1.0",
43-
"react-native-reanimated": "~3.15.0",
44+
"react-native-reanimated": "~3.10.1",
4445
"react-native-reanimated-table": "^0.0.2",
4546
"react-native-safe-area-context": "4.10.5",
4647
"react-native-screens": "~3.31.1",

0 commit comments

Comments
 (0)