@powersync/react-native 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AbstractPowerSyncDatabase
|
|
1
|
+
import { AbstractPowerSyncDatabase } from '@powersync/common';
|
|
2
2
|
import { ReactNativeRemote } from '../sync/stream/ReactNativeRemote';
|
|
3
3
|
import { ReactNativeStreamingSyncImplementation } from '../sync/stream/ReactNativeStreamingSyncImplementation';
|
|
4
4
|
import { ReactNativeQuickSqliteOpenFactory } from './adapters/react-native-quick-sqlite/ReactNativeQuickSQLiteOpenFactory';
|
|
5
|
+
import { ReactNativeBucketStorageAdapter } from './../sync/bucket/ReactNativeBucketStorageAdapter';
|
|
5
6
|
/**
|
|
6
7
|
* A PowerSync database which provides SQLite functionality
|
|
7
8
|
* which is automatically synced.
|
|
@@ -27,7 +28,7 @@ export class PowerSyncDatabase extends AbstractPowerSyncDatabase {
|
|
|
27
28
|
return defaultFactory.openDB();
|
|
28
29
|
}
|
|
29
30
|
generateBucketStorageAdapter() {
|
|
30
|
-
return new
|
|
31
|
+
return new ReactNativeBucketStorageAdapter(this.database, AbstractPowerSyncDatabase.transactionMutex);
|
|
31
32
|
}
|
|
32
33
|
generateSyncStreamImplementation(connector, options) {
|
|
33
34
|
const remote = new ReactNativeRemote(connector);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SqliteBucketStorage } from '@powersync/common';
|
|
2
|
+
export class ReactNativeBucketStorageAdapter extends SqliteBucketStorage {
|
|
3
|
+
control(op, payload) {
|
|
4
|
+
if (payload != null && typeof payload != 'string') {
|
|
5
|
+
// For some reason, we need to copy array buffers for RNQS to recognize them. We're doing that here because we
|
|
6
|
+
// don't want to pay the cost of a copy on platforms where it's not necessary.
|
|
7
|
+
payload = new Uint8Array(payload).buffer;
|
|
8
|
+
}
|
|
9
|
+
return super.control(op, payload);
|
|
10
|
+
}
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://docs.powersync.com/",
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@journeyapps/react-native-quick-sqlite": "^2.4.
|
|
28
|
-
"@powersync/common": "^1.
|
|
27
|
+
"@journeyapps/react-native-quick-sqlite": "^2.4.5",
|
|
28
|
+
"@powersync/common": "^1.33.0",
|
|
29
29
|
"react": "*",
|
|
30
30
|
"react-native": "*"
|
|
31
31
|
},
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@powersync/common": "1.
|
|
38
|
+
"@powersync/common": "1.33.0",
|
|
39
39
|
"@powersync/react": "1.5.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@craftzdog/react-native-buffer": "^6.0.5",
|
|
43
|
-
"@journeyapps/react-native-quick-sqlite": "^2.4.
|
|
43
|
+
"@journeyapps/react-native-quick-sqlite": "^2.4.5",
|
|
44
44
|
"@rollup/plugin-alias": "^5.1.0",
|
|
45
45
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
46
46
|
"@rollup/plugin-inject": "^5.0.5",
|