@capacitor-community/sqlite 5.6.1-2 → 5.6.1-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.
@@ -1197,7 +1197,9 @@ class ExportToJson {
1197
1197
  row.append(val)
1198
1198
  } else if values[pos][names[jpos]] is Int64 && (
1199
1199
  INTEGERAFFINITY.contains(types[jpos].uppercased()) ||
1200
- NUMERICAFFINITY.contains(types[jpos].uppercased())) {
1200
+ INTEGERAFFINITY.contains(types[jpos]
1201
+ .components(separatedBy: "(")[0].uppercased()) ||
1202
+ NUMERICAFFINITY.contains(types[jpos].uppercased())) {
1201
1203
  guard let val = values[pos][names[jpos]] as? Int64
1202
1204
  else {
1203
1205
  throw ExportToJsonError.createValues(
@@ -1206,8 +1208,8 @@ class ExportToJson {
1206
1208
  row.append(val)
1207
1209
  } else if values[pos][names[jpos]] is Int64 && (
1208
1210
  REALAFFINITY.contains(types[jpos].uppercased()) ||
1209
- NUMERICAFFINITY.contains(types[jpos]
1210
- .components(separatedBy: "(")[0].uppercased())) {
1211
+ NUMERICAFFINITY.contains(types[jpos]
1212
+ .components(separatedBy: "(")[0].uppercased())) {
1211
1213
  guard let val = values[pos][names[jpos]] as? Int64
1212
1214
  else {
1213
1215
  throw ExportToJsonError.createValues(
@@ -1217,18 +1219,26 @@ class ExportToJson {
1217
1219
  } else if values[pos][names[jpos]] is Double && (
1218
1220
  REALAFFINITY.contains(types[jpos].uppercased()) ||
1219
1221
  NUMERICAFFINITY.contains(types[jpos]
1220
- .components(separatedBy: "(")[0].uppercased())) {
1222
+ .components(separatedBy: "(")[0].uppercased())) {
1221
1223
  guard let val = values[pos][names[jpos]] as? Double
1222
1224
  else {
1223
1225
  throw ExportToJsonError.createValues(
1224
1226
  message: "Error value must be double")
1225
1227
  }
1226
1228
  row.append(val)
1229
+ } else if values[pos][names[jpos]] is [UInt8] &&
1230
+ BLOBAFFINITY.contains(types[jpos].uppercased()) {
1231
+ guard let val = values[pos][names[jpos]] as? [UInt8]
1232
+ else {
1233
+ throw ExportToJsonError.createValues(
1234
+ message: "Error value must be [UInt8]")
1235
+ }
1236
+ row.append(val)
1227
1237
 
1228
1238
  } else {
1229
1239
  throw ExportToJsonError.createValues(
1230
1240
  message: "Error value is not (string, nsnull," +
1231
- "int64,double")
1241
+ "int64,double,[UInt8]) ")
1232
1242
  }
1233
1243
  }
1234
1244
  return row
@@ -70,15 +70,12 @@ class UtilsBinding {
70
70
  sqlite3_bind_blob(handle, Int32(idx), data.bytes,
71
71
  Int32(data.bytes.count), SQLITETRANSIENT)
72
72
  } else if let value = value {
73
- let isDict = checkTypeDict(from: value)
74
- if isDict {
75
-
76
- let sortedValues = extractSortedValues(from: value as! [String : Int])
73
+ if let dict = value as? [String: Int] {
74
+ let sortedValues = extractSortedValues(from: dict)
77
75
  let data: Data = Data(sortedValues)
78
76
  sqlite3_bind_blob(handle, Int32(idx), data.bytes,
79
- Int32(data.bytes.count), SQLITETRANSIENT)
77
+ Int32(data.bytes.count), SQLITETRANSIENT)
80
78
  }
81
-
82
79
  } else {
83
80
  throw UtilsSQLCipherError.bindFailed
84
81
  }
@@ -374,7 +374,6 @@ class UtilsDelete {
374
374
 
375
375
  class func getCurrentTimeAsInteger() -> Int {
376
376
  let currentTime = Date().timeIntervalSince1970
377
- print(">>>> in getCurrentTimeAsInteger currentTime: \(currentTime)")
378
377
  return Int(currentTime)
379
378
  }
380
379
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor-community/sqlite",
3
- "version": "5.6.1-2",
3
+ "version": "5.6.1-3",
4
4
  "description": "Community plugin for native & electron SQLite databases",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",