@capacitor-community/sqlite 3.4.2-4 → 3.4.2-5
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/dist/esm/definitions.js +15 -17
- package/dist/esm/definitions.js.map +1 -1
- package/dist/plugin.cjs.js +14 -16
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +14 -16
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/ImportExportJson/ExportToJson.swift +27 -12
- package/ios/Plugin/Utils/UtilsBinding.swift +2 -2
- package/ios/Plugin/Utils/UtilsDrop.swift +8 -4
- package/ios/Plugin/Utils/UtilsJson.swift +22 -8
- package/ios/Plugin/Utils/UtilsSQLCipher.swift +7 -4
- package/ios/Plugin/Utils/UtilsUpgrade.swift +2 -1
- package/package.json +1 -1
|
@@ -266,11 +266,12 @@ class UtilsSQLCipher {
|
|
|
266
266
|
|
|
267
267
|
let sqltr: String = "PRAGMA user_version;"
|
|
268
268
|
do {
|
|
269
|
-
|
|
269
|
+
var resVersion = try UtilsSQLCipher.querySQL(mDB: mDB,
|
|
270
270
|
sql: sqltr,
|
|
271
271
|
values: [])
|
|
272
|
-
if resVersion.count >
|
|
273
|
-
|
|
272
|
+
if resVersion.count > 1 {
|
|
273
|
+
resVersion.removeFirst()
|
|
274
|
+
guard let res: Int64 = resVersion[0]["user_version"]
|
|
274
275
|
as? Int64 else {
|
|
275
276
|
throw UtilsSQLCipherError.getVersion(
|
|
276
277
|
message: "Error get version failed")
|
|
@@ -504,13 +505,14 @@ class UtilsSQLCipher {
|
|
|
504
505
|
// MARK: - FetchColumnInfo
|
|
505
506
|
|
|
506
507
|
// swiftlint:disable function_body_length
|
|
508
|
+
// swiftlint:disable cyclomatic_complexity
|
|
507
509
|
class func fetchColumnInfo(handle: OpaquePointer?)
|
|
508
510
|
throws -> [[String: Any]] {
|
|
509
511
|
var result: [[String: Any]] = []
|
|
510
512
|
var columnCount: Int32 = 0
|
|
511
513
|
var columnNames: [String] = []
|
|
512
514
|
var columnData: [String: Any] = [:]
|
|
513
|
-
|
|
515
|
+
|
|
514
516
|
while sqlite3_step(handle) == SQLITE_ROW {
|
|
515
517
|
columnCount = sqlite3_column_count(handle)
|
|
516
518
|
var rowData: [String: Any] = [:]
|
|
@@ -567,6 +569,7 @@ class UtilsSQLCipher {
|
|
|
567
569
|
}
|
|
568
570
|
return result
|
|
569
571
|
}
|
|
572
|
+
// swiftlint:enable cyclomatic_complexity
|
|
570
573
|
// swiftlint:enable function_body_length
|
|
571
574
|
|
|
572
575
|
// MARK: - dbChanges
|
|
@@ -307,9 +307,10 @@ class UtilsUpgrade {
|
|
|
307
307
|
var retNames: [String] = []
|
|
308
308
|
let query: String = "PRAGMA table_info('\(tableName)');"
|
|
309
309
|
do {
|
|
310
|
-
|
|
310
|
+
var resColumns: [[String: Any]] = try
|
|
311
311
|
mDB.selectSQL(sql: query, values: [])
|
|
312
312
|
if resColumns.count > 0 {
|
|
313
|
+
resColumns.removeFirst()
|
|
313
314
|
for rColumn in resColumns {
|
|
314
315
|
guard let columnName: String = rColumn["name"] as?
|
|
315
316
|
String else {
|