@capacitor-community/sqlite 5.0.3-2.test1 → 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 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 | ✅ | ✅ | | ❌ | since 4.6.2-2
232
- | isInConfigEncryption | ✅ | ✅ | | ❌ | since 4.6.2-2
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
@@ -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,25 +4710,18 @@ 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
- console.log(`@@@@ dbName: ${dbName} , mDB ${mDB}`);
4727
- if (mDB !== null) {
4728
- mDB.close();
4729
- return Promise.resolve({ result: false });
4730
- }
4731
- else {
4732
- return Promise.resolve({ result: true });
4733
- }
4722
+ await this.sqliteUtil.getVersion(mDB);
4723
+ mDB.close();
4724
+ return Promise.resolve({ result: false });
4734
4725
  }
4735
4726
  catch (error) {
4736
4727
  return Promise.resolve({ result: true });