@capacitor-community/sqlite 4.1.0 → 4.1.1

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.
@@ -20,6 +20,7 @@ export default {
20
20
  'fs',
21
21
  'os',
22
22
  'jszip',
23
+ 'node-fetch',
23
24
  ],
24
25
  plugins: [
25
26
  nodeResolve(),
@@ -491,7 +491,7 @@ enum CapacitorSQLiteError: Error {
491
491
  var conns: [String] = []
492
492
  for name in dbNames {
493
493
  conns.append("\(openModes[idx])_\(name)")
494
- idx = idx + 1
494
+ idx += 1
495
495
  }
496
496
  do {
497
497
  if conns.count == 0 {
@@ -44,4 +44,5 @@ CAP_PLUGIN(CapacitorSQLitePlugin, "CapacitorSQLite",
44
44
  CAP_PLUGIN_METHOD(setEncryptionSecret, CAPPluginReturnPromise);
45
45
  CAP_PLUGIN_METHOD(changeEncryptionSecret, CAPPluginReturnPromise);
46
46
  CAP_PLUGIN_METHOD(clearEncryptionSecret, CAPPluginReturnPromise);
47
+ CAP_PLUGIN_METHOD(getFromHTTPRequest, CAPPluginReturnPromise);
47
48
  )
@@ -1158,7 +1158,16 @@ public class CapacitorSQLitePlugin: CAPPlugin {
1158
1158
  if let upgVersionDict: [Int: [String: Any]] = try
1159
1159
  implementation?.addUpgradeStatement(dbName,
1160
1160
  upgrade: upgrade) {
1161
- versionUpgrades = ["\(dbName)": upgVersionDict]
1161
+ if (
1162
+ versionUpgrades[dbName] != nil
1163
+ ){
1164
+ for (versionKey, upgObj) in upgVersionDict {
1165
+ versionUpgrades[dbName]![versionKey] = upgObj
1166
+ }
1167
+ } else {
1168
+ versionUpgrades = ["\(dbName)": upgVersionDict]
1169
+ }
1170
+
1162
1171
  retHandler.rResult(call: call)
1163
1172
  return
1164
1173
  } else {
@@ -1314,6 +1323,13 @@ public class CapacitorSQLitePlugin: CAPPlugin {
1314
1323
  }
1315
1324
 
1316
1325
  }
1326
+
1327
+ // MARK: - GetFromHTTPRequest
1328
+
1329
+ @objc func getFromHTTPRequest(_ call: CAPPluginCall) {
1330
+ call.unimplemented("Not implemented on iOS.")
1331
+ }
1332
+
1317
1333
 
1318
1334
  // MARK: - Add Observers
1319
1335
 
@@ -22,10 +22,12 @@ class UtilsUpgrade {
22
22
  currentVersion: Int,
23
23
  targetVersion: Int,
24
24
  databaseLocation: String) throws {
25
- print("UtilsUpgrade.onUpgrade: \(currentVersion) => \(targetVersion)")
25
+ print("UtilsUpgrade.onUpgrade: from \(currentVersion) to \(targetVersion)")
26
26
 
27
27
  for (versionKey, upgrade) in Array(upgDict).sorted(by: {$0.0 < $1.0}) {
28
28
  if versionKey > currentVersion && versionKey <= targetVersion {
29
+ print("- UtilsUpgrade.onUpgrade toVersion: \(versionKey)")
30
+
29
31
  guard let statements = upgrade["statements"] as? [String] else {
30
32
  let msg: String = "Error: onUpgrade statements not given"
31
33
  throw UtilsUpgradeError.onUpgradeFailed(message: msg)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor-community/sqlite",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "Community plugin for native & electron SQLite databases",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -93,6 +93,6 @@
93
93
  }
94
94
  },
95
95
  "dependencies": {
96
- "jeep-sqlite": "^1.6.2"
96
+ "jeep-sqlite": "^1.6.5"
97
97
  }
98
98
  }