@powersync/op-sqlite 0.7.0 → 0.7.2
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.
- package/README.md +4 -0
- package/android/build.gradle +1 -1
- package/lib/commonjs/db/OPSqliteAdapter.js +10 -20
- package/lib/commonjs/db/OPSqliteAdapter.js.map +1 -1
- package/lib/module/db/OPSqliteAdapter.js +11 -21
- package/lib/module/db/OPSqliteAdapter.js.map +1 -1
- package/lib/typescript/commonjs/src/db/OPSqliteAdapter.d.ts +0 -1
- package/lib/typescript/commonjs/src/db/OPSqliteAdapter.d.ts.map +1 -1
- package/lib/typescript/commonjs/tsconfig.build.tsbuildinfo +1 -1
- package/lib/typescript/module/src/db/OPSqliteAdapter.d.ts +0 -1
- package/lib/typescript/module/src/db/OPSqliteAdapter.d.ts.map +1 -1
- package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/powersync-op-sqlite.podspec +1 -1
- package/src/db/OPSqliteAdapter.ts +11 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/op-sqlite",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "PowerSync - sync Postgres or MongoDB with SQLite in your React Native app for offline-first and real-time data",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@op-engineering/op-sqlite": "^13.0.0 || ^14.0.0",
|
|
62
|
-
"@powersync/common": "^1.
|
|
62
|
+
"@powersync/common": "^1.33.1",
|
|
63
63
|
"react": "*",
|
|
64
64
|
"react-native": "*"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"async-lock": "^1.4.0",
|
|
68
|
-
"@powersync/common": "1.
|
|
68
|
+
"@powersync/common": "1.33.1"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@op-engineering/op-sqlite": "^14.0.2",
|
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
|
|
18
18
|
s.dependency "React-callinvoker"
|
|
19
19
|
s.dependency "React"
|
|
20
|
-
s.dependency "powersync-sqlite-core", "~> 0.
|
|
20
|
+
s.dependency "powersync-sqlite-core", "~> 0.4.0"
|
|
21
21
|
if defined?(install_modules_dependencies())
|
|
22
22
|
install_modules_dependencies(s)
|
|
23
23
|
else
|
|
@@ -112,30 +112,21 @@ export class OPSQLiteDBAdapter extends BaseObserver<DBAdapterListener> implement
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
private
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
115
|
+
private openDatabase(dbFilename: string, encryptionKey?: string): DB {
|
|
116
|
+
const openOptions: Parameters<typeof open>[0] = {
|
|
117
|
+
name: dbFilename
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
if (this.options.dbLocation) {
|
|
121
|
+
openOptions.location = this.options.dbLocation;
|
|
120
122
|
}
|
|
121
|
-
}
|
|
122
123
|
|
|
123
|
-
|
|
124
|
-
//This is needed because an undefined/null dbLocation will cause the open function to fail
|
|
125
|
-
const location = this.getDbLocation(this.options.dbLocation);
|
|
126
|
-
//Simarlily if the encryption key is undefined/null when using SQLCipher it will cause the open function to fail
|
|
124
|
+
// If the encryption key is undefined/null when using SQLCipher it will cause the open function to fail
|
|
127
125
|
if (encryptionKey) {
|
|
128
|
-
|
|
129
|
-
name: dbFilename,
|
|
130
|
-
location: location,
|
|
131
|
-
encryptionKey: encryptionKey
|
|
132
|
-
});
|
|
133
|
-
} else {
|
|
134
|
-
return open({
|
|
135
|
-
name: dbFilename,
|
|
136
|
-
location: location
|
|
137
|
-
});
|
|
126
|
+
openOptions.encryptionKey = encryptionKey;
|
|
138
127
|
}
|
|
128
|
+
|
|
129
|
+
return open(openOptions);
|
|
139
130
|
}
|
|
140
131
|
|
|
141
132
|
private loadAdditionalExtensions(DB: DB) {
|