@capacitor-community/sqlite 4.2.2 → 4.5.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.
package/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  <a href="https://www.npmjs.com/package/@capacitor-community/sqlite"><img src="https://img.shields.io/npm/dw/@capacitor-community/sqlite?style=flat-square" /></a>
17
17
  <a href="https://www.npmjs.com/package/@capacitor-community/sqlite"><img src="https://img.shields.io/npm/v/@capacitor-community/sqlite?style=flat-square" /></a>
18
18
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
19
- <a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-22-orange?style=flat-square" /></a>
19
+ <a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-24-orange?style=flat-square" /></a>
20
20
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
21
21
  </p>
22
22
 
@@ -95,6 +95,7 @@ npm install --save jszip
95
95
  npm install --save node-fetch
96
96
  npm install --save-dev @types/sqlite3
97
97
  ```
98
+ - **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.
98
99
 
99
100
  ## IOS Quirks
100
101
 
@@ -224,9 +225,9 @@ npm install --save-dev @types/sqlite3
224
225
  ## Dependencies
225
226
 
226
227
  The iOS and Android codes are using `SQLCipher` allowing for database encryption.
227
- The iOS codes is using `ZIPFoundation` for unzipping assets files
228
+ The iOS codes is using `ZIPFoundation` for unzipping assets files.
228
229
  The Electron code is using `sqlite3` and `node-fetch` from 4.2.0.
229
- The Web code is using the Stencil component `jeep-sqlite` based on `sql.js`, `localforage`. and `jszip`
230
+ The Web code is using the Stencil component `jeep-sqlite` based on `sql.js`, `localforage`, and `jszip`.
230
231
 
231
232
  ## Contributors ✨
232
233
 
@@ -257,7 +258,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
257
258
  <a href="https://github.com/antoniovlx" title="antoniovlx"><img src="https://github.com/antoniovlx.png?size=100" width="50" height="50" /></a>
258
259
  <a href="https://github.com/HarelM" title="HarelM"><img src="https://github.com/HarelM.png?size=100" width="50" height="50" /></a>
259
260
  <a href="https://github.com/rdlabo" title="rdlabo"><img src="https://github.com/rdlabo.png?size=100" width="50" height="50" /></a>
260
- <a href="https://github.com/axkristiansen" title="rdlabo"><img src="https://github.com/axkristiansen.png?size=100" width="50" height="50" /></a>
261
+ <a href="https://github.com/axkristiansen" title="axkristiansen"><img src="https://github.com/axkristiansen.png?size=100" width="50" height="50" /></a>
262
+ <a href="https://github.com/aeinn" title="aeinn"><img src="https://github.com/aeinn.png?size=100" width="50" height="50" /></a>
263
+ <a href="https://github.com/https://github.com/jonz94" title="aeinn"><img src="https://github.com/jonz94.png?size=100" width="50" height="50" /></a>
261
264
  </p>
262
265
 
263
266
  <!-- markdownlint-enable -->
@@ -826,7 +826,7 @@ class UtilsSQLite {
826
826
  }
827
827
  async getJournalMode(mDB) {
828
828
  let resQuery = [];
829
- let retMode = "delete";
829
+ let retMode = 'delete';
830
830
  const query = `PRAGMA journal_mode;`;
831
831
  try {
832
832
  resQuery = await this.queryAll(mDB, query, []);
@@ -3258,9 +3258,7 @@ class UtilsUpgrade {
3258
3258
  */
3259
3259
  async onUpgrade(mDB, vUpgDict, curVersion, targetVersion) {
3260
3260
  let changes;
3261
- const sortedKeys = Object.keys(vUpgDict)
3262
- .map(item => parseInt(item))
3263
- .sort();
3261
+ const sortedKeys = new Int32Array(Object.keys(vUpgDict).map(item => parseInt(item))).sort();
3264
3262
  for (const versionKey of sortedKeys) {
3265
3263
  if (versionKey > curVersion && versionKey <= targetVersion) {
3266
3264
  const statements = vUpgDict[versionKey].statements;