@capacitor-community/sqlite 5.0.3-2.test2 → 5.0.3
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 +5 -2
- package/electron/dist/plugin.js +1 -7
- package/electron/dist/plugin.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,7 @@ const config: CapacitorConfig = {
|
|
|
73
73
|
biometricTitle : "Biometric login for capacitor sqlite",
|
|
74
74
|
biometricSubTitle : "Log in using your biometric"
|
|
75
75
|
},
|
|
76
|
+
electronIsEncryption: false,
|
|
76
77
|
electronWindowsLocation: "C:\\ProgramData\\CapacitorDatabases",
|
|
77
78
|
electronMacLocation: "/Volumes/Development_Lacie/Development/Databases",
|
|
78
79
|
electronLinuxLocation: "Databases"
|
|
@@ -165,8 +166,10 @@ You'll need the usual capacitor/android/react npm script to build and copy the a
|
|
|
165
166
|
```bash
|
|
166
167
|
cd electron
|
|
167
168
|
npm install --save @journeyapps/sqlcipher
|
|
169
|
+
npm install --save sqlite3
|
|
168
170
|
npm install --save jszip
|
|
169
171
|
npm install --save node-fetch@2.6.7
|
|
172
|
+
npm install --save @types/sqlite3
|
|
170
173
|
```
|
|
171
174
|
- **Important**: `node-fetch` version must be `<=2.6.7`; otherwise [you'll get an error](https://github.com/capacitor-community/sqlite/issues/349 "you'll get an error ERR_REQUIRE_ESM") running the app.
|
|
172
175
|
|
|
@@ -228,8 +231,8 @@ npm install --save node-fetch@2.6.7
|
|
|
228
231
|
| isNCDatabase | ✅ | ✅ | ❌ | ❌ |
|
|
229
232
|
| transaction | ✅ | ✅ | ✅ | ✅ |
|
|
230
233
|
| getFromHTTPRequest | ✅ | ✅ | ✅ | ✅ | since 4.2.0
|
|
231
|
-
| isDatabaseEncrypted | ✅ | ✅ |
|
|
232
|
-
| isInConfigEncryption | ✅ | ✅ |
|
|
234
|
+
| isDatabaseEncrypted | ✅ | ✅ | ✅ | ❌ | since 4.6.2-2
|
|
235
|
+
| isInConfigEncryption | ✅ | ✅ | ✅ | ❌ | since 4.6.2-2
|
|
233
236
|
| isInConfigBiometricAuth | ✅ | ✅ | ❌ | ❌ | since 4.6.2-2
|
|
234
237
|
| getFromLocalDiskToStore | ❌ | ❌ | ❌ | ✅ | since 4.6.3
|
|
235
238
|
| saveToLocalDisk | ❌ | ❌ | ❌ | ✅ | since 4.6.3
|
package/electron/dist/plugin.js
CHANGED
|
@@ -3485,8 +3485,6 @@ class Database {
|
|
|
3485
3485
|
this._isDbOpen = true;
|
|
3486
3486
|
if (!this.readonly) {
|
|
3487
3487
|
const curVersion = await this.sqliteUtil.getVersion(this.database);
|
|
3488
|
-
console.log(`@@@@ this.readonly: ${this.readonly}`);
|
|
3489
|
-
console.log(`@@@@ this.version: ${this.version} curVersion: ${curVersion}`);
|
|
3490
3488
|
if (this.version > curVersion &&
|
|
3491
3489
|
Object.keys(this.upgradeVersionDict).length > 0) {
|
|
3492
3490
|
try {
|
|
@@ -4712,24 +4710,20 @@ class CapacitorSQLite {
|
|
|
4712
4710
|
}
|
|
4713
4711
|
}
|
|
4714
4712
|
async isInConfigEncryption() {
|
|
4715
|
-
console.log(`in electron plugin this.isEncryption: ${this.isEncryption}`);
|
|
4716
4713
|
return Promise.resolve({ result: this.isEncryption });
|
|
4717
4714
|
}
|
|
4718
4715
|
async isDatabaseEncrypted(options) {
|
|
4719
4716
|
const dbName = this.getOptionValue(options, 'database');
|
|
4720
4717
|
const isExists = this.fileUtil.isFileExists(dbName + 'SQLite.db');
|
|
4721
|
-
console.log(`@@@ isDatabaseEncrypted dbName: ${dbName} isExists: ${isExists}`);
|
|
4722
4718
|
if (isExists) {
|
|
4723
4719
|
const filePath = this.fileUtil.getFilePath(dbName + 'SQLite.db');
|
|
4724
4720
|
try {
|
|
4725
4721
|
const mDB = await this.sqliteUtil.openOrCreateDatabase(filePath, "", true);
|
|
4726
|
-
|
|
4727
|
-
console.log(`@@@@ UNENCRYPTED dbName: ${dbName} , mDB ${mDB}, curVersion ${curVersion}`);
|
|
4722
|
+
await this.sqliteUtil.getVersion(mDB);
|
|
4728
4723
|
mDB.close();
|
|
4729
4724
|
return Promise.resolve({ result: false });
|
|
4730
4725
|
}
|
|
4731
4726
|
catch (error) {
|
|
4732
|
-
console.log(`@@@@ ENCRYPTED dbName: ${dbName}`);
|
|
4733
4727
|
return Promise.resolve({ result: true });
|
|
4734
4728
|
}
|
|
4735
4729
|
}
|