@capacitor-community/sqlite 5.7.3-3 → 5.7.4

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.
@@ -867,18 +867,20 @@ class ExportToJson {
867
867
  with: ",")
868
868
  .replacingOccurrences(of: ", ",
869
869
  with: ",")
870
- case "PRIMARY":
870
+ case "PRIMARY", "UNIQUE":
871
+ let prefix = (String(row[0]).uppercased() == "PRIMARY") ? "CPK_" : "CUN_"
872
+
871
873
  guard let oPar = rstr.firstIndex(of: "(")
872
874
  else {
873
875
  var msg: String = "Create Schema "
874
- msg.append("PRIMARY KEY no '('")
876
+ msg.append("PRIMARY/UNIQUE KEY no '('")
875
877
  throw ExportToJsonError
876
878
  .createSchema(message: msg)
877
879
  }
878
880
  guard let cPar = rstr.firstIndex(of: ")")
879
881
  else {
880
882
  var msg: String = "Create Schema "
881
- msg.append("PRIMARY KEY no ')'")
883
+ msg.append("PRIMARY/UNIQUE KEY no ')'")
882
884
  throw ExportToJsonError
883
885
  .createSchema(message: msg)
884
886
  }
@@ -886,7 +888,7 @@ class ExportToJson {
886
888
  after: oPar)..<cPar]
887
889
  row[1] = rstr[rstr.index(rstr.startIndex,
888
890
  offsetBy: 0)..<rstr.endIndex]
889
- columns["constraint"] = "CPK_" + String(row[0])
891
+ columns["constraint"] = prefix + String(row[0])
890
892
  .replacingOccurrences(of: "§",
891
893
  with: "_")
892
894
  .replacingOccurrences(of: "_ ",
@@ -157,7 +157,7 @@ class UtilsDownloadFromHTTP {
157
157
  }
158
158
  }
159
159
 
160
- class func extractDBFiles(from zipFile: URL, completion: @escaping ([URL], Error?) -> Void) {
160
+ class func extractDBFiles(from zipFile: URL, completion: @escaping ([URL], Error?) -> Void) {
161
161
  DispatchQueue.global().async(execute: {
162
162
  var dbFiles: [URL] = []
163
163
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor-community/sqlite",
3
- "version": "5.7.3-3",
3
+ "version": "5.7.4",
4
4
  "description": "Community plugin for native & electron SQLite databases",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -97,6 +97,6 @@
97
97
  }
98
98
  },
99
99
  "dependencies": {
100
- "jeep-sqlite": "^2.7.0"
100
+ "jeep-sqlite": "^2.7.2"
101
101
  }
102
102
  }