@capacitor-community/sqlite 5.6.1-3 → 5.6.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.
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/ImportExportJson/ImportFromJson.java +306 -19
- package/dist/esm/definitions.js +1 -1
- package/dist/plugin.cjs.js +1 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/electron/dist/plugin.js +17 -1
- package/electron/dist/plugin.js.map +1 -1
- package/ios/Plugin/ImportExportJson/JsonSQLite.swift +7 -3
- package/ios/Plugin/Utils/UtilsJson.swift +4 -4
- package/package.json +1 -1
- package/src/definitions.ts +1 -1
|
@@ -51,7 +51,7 @@ public struct JsonTable: Codable {
|
|
|
51
51
|
var schema: [JsonColumn]?
|
|
52
52
|
var indexes: [JsonIndex]?
|
|
53
53
|
var triggers: [JsonTrigger]?
|
|
54
|
-
var values: [[UncertainValue<String, Int, Double>]]?
|
|
54
|
+
var values: [[UncertainValue<String, Int, Double, [UInt8]>]]?
|
|
55
55
|
|
|
56
56
|
public func show() {
|
|
57
57
|
print("name: \(name) ")
|
|
@@ -141,12 +141,13 @@ public struct JsonTrigger: Codable {
|
|
|
141
141
|
print("logic: \(logic) ")
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
public struct UncertainValue<T: Codable, U: Codable, V: Codable>: Codable {
|
|
144
|
+
public struct UncertainValue<T: Codable, U: Codable, V: Codable, W: Codable>: Codable {
|
|
145
145
|
public var tValue: T?
|
|
146
146
|
public var uValue: U?
|
|
147
147
|
public var vValue: V?
|
|
148
|
+
public var wValue: W?
|
|
148
149
|
public var value: Any? {
|
|
149
|
-
return tValue ?? uValue ?? vValue
|
|
150
|
+
return tValue ?? uValue ?? vValue ?? wValue
|
|
150
151
|
}
|
|
151
152
|
public init(from decoder: Decoder) throws {
|
|
152
153
|
let container = try decoder.singleValueContainer()
|
|
@@ -155,6 +156,9 @@ public struct UncertainValue<T: Codable, U: Codable, V: Codable>: Codable {
|
|
|
155
156
|
if uValue == nil {
|
|
156
157
|
vValue = try? container.decode(V.self)
|
|
157
158
|
}
|
|
159
|
+
if vValue == nil {
|
|
160
|
+
wValue = try? container.decode(W.self)
|
|
161
|
+
}
|
|
158
162
|
}
|
|
159
163
|
}
|
|
160
164
|
public struct JsonView: Codable {
|
|
@@ -191,7 +191,7 @@ class UtilsJson {
|
|
|
191
191
|
|
|
192
192
|
class func checkColumnTypes (
|
|
193
193
|
mDB: Database, types: [String],
|
|
194
|
-
values: [UncertainValue<String, Int, Double>]) -> Bool {
|
|
194
|
+
values: [UncertainValue<String, Int, Double, [UInt8]>]) -> Bool {
|
|
195
195
|
var isRetType: Bool = true
|
|
196
196
|
for ipos in 0..<values.count {
|
|
197
197
|
isRetType = UtilsJson.isType(
|
|
@@ -204,7 +204,7 @@ class UtilsJson {
|
|
|
204
204
|
// MARK: - ImportFromJson - IsType
|
|
205
205
|
|
|
206
206
|
class func isType(stype: String,
|
|
207
|
-
avalue: UncertainValue<String, Int, Double>)
|
|
207
|
+
avalue: UncertainValue<String, Int, Double, [UInt8]>)
|
|
208
208
|
-> Bool {
|
|
209
209
|
var ret: Bool = false
|
|
210
210
|
// swiftlint:disable force_unwrapping
|
|
@@ -266,7 +266,7 @@ class UtilsJson {
|
|
|
266
266
|
// MARK: - ImportFromJson - GetValuesFromRow
|
|
267
267
|
|
|
268
268
|
class func getValuesFromRow(
|
|
269
|
-
rowValues: [ UncertainValue<String, Int, Double>]) -> [Any] {
|
|
269
|
+
rowValues: [ UncertainValue<String, Int, Double, [UInt8]>]) -> [Any] {
|
|
270
270
|
var retArray: [Any] = []
|
|
271
271
|
for ipos in 0..<rowValues.count {
|
|
272
272
|
let value = rowValues[ipos].value
|
|
@@ -354,7 +354,7 @@ class UtilsJson {
|
|
|
354
354
|
|
|
355
355
|
class func checkRowValidity(
|
|
356
356
|
mDB: Database, jsonNamesTypes: JsonNamesTypes,
|
|
357
|
-
row: [UncertainValue<String, Int, Double>], pos: Int,
|
|
357
|
+
row: [UncertainValue<String, Int, Double, [UInt8]>], pos: Int,
|
|
358
358
|
tableName: String) throws {
|
|
359
359
|
if jsonNamesTypes.names.count != row.count {
|
|
360
360
|
let message: String = """
|
package/package.json
CHANGED
package/src/definitions.ts
CHANGED