@capacitor-community/sqlite 5.0.7-1 → 5.0.7
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/README.md +6 -1
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/CapacitorSQLite.java +123 -1
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/CapacitorSQLitePlugin.java +112 -0
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/Database.java +140 -78
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/ImportExportJson/ImportFromJson.java +9 -9
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsDelete.java +484 -0
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsDrop.java +3 -3
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsSQLStatement.java +169 -0
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsUpgrade.java +4 -4
- package/dist/esm/definitions.d.ts +96 -11
- package/dist/esm/definitions.js +99 -50
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +4 -0
- package/dist/esm/web.js +44 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +143 -50
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +143 -50
- package/dist/plugin.js.map +1 -1
- package/electron/dist/plugin.js +1102 -260
- package/electron/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorSQLite.swift +119 -0
- package/ios/Plugin/CapacitorSQLitePlugin.m +4 -0
- package/ios/Plugin/CapacitorSQLitePlugin.swift +128 -0
- package/ios/Plugin/Database.swift +76 -0
- package/ios/Plugin/ImportExportJson/ImportFromJson.swift +13 -2
- package/ios/Plugin/Utils/UtilsDelete.swift +116 -114
- package/ios/Plugin/Utils/UtilsSQLCipher.swift +10 -3
- package/ios/Plugin/Utils/UtilsSQLStatement.swift +84 -84
- package/ios/Plugin/Utils/UtilsUpgrade.swift +3 -0
- package/package.json +2 -2
- package/src/definitions.ts +187 -53
- package/src/web.ts +48 -0
|
@@ -20,6 +20,7 @@ enum UtilsDeleteError: Error {
|
|
|
20
20
|
case upDateWhereForCascade(message: String)
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// swiftlint:disable file_length
|
|
23
24
|
// swiftlint:disable type_body_length
|
|
24
25
|
class UtilsDelete {
|
|
25
26
|
|
|
@@ -54,7 +55,7 @@ class UtilsDelete {
|
|
|
54
55
|
guard let refTable = foreignKeyInfo["tableName"]
|
|
55
56
|
as? String else {
|
|
56
57
|
let msg = "findReferencesAndUpdate: no foreignKeyInfo " +
|
|
57
|
-
|
|
58
|
+
"tableName"
|
|
58
59
|
throw UtilsDeleteError
|
|
59
60
|
.findReferencesAndUpdate(message: msg)
|
|
60
61
|
}
|
|
@@ -63,23 +64,23 @@ class UtilsDelete {
|
|
|
63
64
|
}
|
|
64
65
|
// get the with ref columnName
|
|
65
66
|
guard let withRefsNames = foreignKeyInfo["forKeys"]
|
|
66
|
-
|
|
67
|
+
as? [String] else {
|
|
67
68
|
|
|
68
69
|
let msg = "findReferencesAndUpdate: no foreignKeyInfo " +
|
|
69
|
-
|
|
70
|
+
"forKeys"
|
|
70
71
|
throw UtilsDeleteError
|
|
71
72
|
.findReferencesAndUpdate(message: msg)
|
|
72
73
|
}
|
|
73
74
|
guard let colNames = foreignKeyInfo["refKeys"]
|
|
74
75
|
as? [String] else {
|
|
75
76
|
let msg = "findReferencesAndUpdate: no foreignKeyInfo " +
|
|
76
|
-
|
|
77
|
+
"refKeys"
|
|
77
78
|
throw UtilsDeleteError
|
|
78
79
|
.findReferencesAndUpdate(message: msg)
|
|
79
80
|
}
|
|
80
81
|
if colNames.count != withRefsNames.count {
|
|
81
82
|
let msg = "findReferencesAndUpdate: no foreignKeyInfo " +
|
|
82
|
-
|
|
83
|
+
"colNames"
|
|
83
84
|
throw UtilsDeleteError
|
|
84
85
|
.findReferencesAndUpdate(message: msg)
|
|
85
86
|
|
|
@@ -102,58 +103,58 @@ class UtilsDelete {
|
|
|
102
103
|
if !checkValuesMatch(withRefsNames,
|
|
103
104
|
against: initColNames) {
|
|
104
105
|
// Search for related items in tableName
|
|
105
|
-
let result: (String,[[String: Any]]) = try UtilsDelete
|
|
106
|
+
let result: (String, [[String: Any]]) = try UtilsDelete
|
|
106
107
|
.searchForRelatedItems(mDB: mDB,
|
|
107
108
|
updTableName: updTableName,
|
|
108
109
|
tableName: tableName,
|
|
109
110
|
whStmt: whereStmt,
|
|
110
111
|
withRefsNames: withRefsNames,
|
|
111
112
|
colNames: colNames,
|
|
112
|
-
values: values)
|
|
113
|
+
values: values)
|
|
113
114
|
let key: String = result.0
|
|
114
115
|
let relatedItems: [Any] = result.1
|
|
115
116
|
if relatedItems.count == 0 && key.count <= 0 {
|
|
116
|
-
|
|
117
|
+
continue
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
// case no match
|
|
120
121
|
if updTableName != tableName {
|
|
121
122
|
switch action {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
123
|
+
case "CASCADE":
|
|
124
|
+
// updTableName
|
|
125
|
+
// update all related element
|
|
126
|
+
// set sql_deleted = 1 and last_modified
|
|
127
|
+
// tableName
|
|
128
|
+
//update all by sending return true
|
|
129
|
+
results = try upDateWhereForCascade(
|
|
130
|
+
results: result)
|
|
131
|
+
|
|
132
|
+
case "RESTRICT":
|
|
133
|
+
// find for elements related in updTableName
|
|
134
|
+
// if some elements
|
|
135
|
+
// send a message
|
|
136
|
+
// do not update tableName
|
|
137
|
+
// return false
|
|
138
|
+
// If no related elements in updTableName
|
|
139
|
+
// return true to update tableName
|
|
140
|
+
results = try upDateWhereForRestrict(
|
|
141
|
+
results: result)
|
|
142
|
+
|
|
143
|
+
default:
|
|
144
|
+
// updTableName
|
|
145
|
+
// update the result_id result_slug to Null
|
|
146
|
+
// update the last_modified
|
|
147
|
+
// keep sql_deleted to 0
|
|
148
|
+
// return true to update tableName
|
|
149
|
+
results = try upDateWhereForDefault(
|
|
150
|
+
withRefsNames: withRefsNames,
|
|
151
|
+
results: result)
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
154
|
|
|
154
155
|
} else {
|
|
155
156
|
let msg = "Not implemented. Please transfer your " +
|
|
156
|
-
|
|
157
|
+
"example to the maintener"
|
|
157
158
|
throw UtilsDeleteError
|
|
158
159
|
.findReferencesAndUpdate(message: msg)
|
|
159
160
|
}
|
|
@@ -194,7 +195,7 @@ class UtilsDelete {
|
|
|
194
195
|
// MARK: - upDateWhereForDefault
|
|
195
196
|
|
|
196
197
|
class func upDateWhereForDefault(withRefsNames: [String],
|
|
197
|
-
results: (String,[[String:Any]]))
|
|
198
|
+
results: (String, [[String: Any]]))
|
|
198
199
|
throws -> ((setStmt: String, uWhereStmt: String)) {
|
|
199
200
|
|
|
200
201
|
var setStmt = ""
|
|
@@ -225,31 +226,31 @@ class UtilsDelete {
|
|
|
225
226
|
|
|
226
227
|
uWhereStmt += ");"
|
|
227
228
|
|
|
228
|
-
|
|
229
|
+
return(setStmt, uWhereStmt)
|
|
229
230
|
}
|
|
230
231
|
|
|
231
232
|
// MARK: - upDateWhereForRestrict
|
|
232
233
|
|
|
233
|
-
class func upDateWhereForRestrict(results: (String,[[String: Any]]))
|
|
234
|
-
|
|
234
|
+
class func upDateWhereForRestrict(results: (String, [[String: Any]]))
|
|
235
|
+
throws -> ((setStmt: String, uWhereStmt: String)) {
|
|
235
236
|
|
|
236
|
-
|
|
237
|
+
// Search for related items in tableName
|
|
237
238
|
let setStmt = ""
|
|
238
239
|
let uWhereStmt = ""
|
|
239
240
|
let relatedItems = results.1
|
|
240
241
|
|
|
241
242
|
if !relatedItems.isEmpty {
|
|
242
243
|
let msg = "Restrict mode related items exist" +
|
|
243
|
-
|
|
244
|
+
" please delete them first"
|
|
244
245
|
throw UtilsDeleteError
|
|
245
|
-
|
|
246
|
+
.upDateWhereForRestrict(message: msg)
|
|
246
247
|
}
|
|
247
248
|
return(setStmt, uWhereStmt)
|
|
248
249
|
}
|
|
249
250
|
|
|
250
251
|
// MARK: - upDateWhereForCascade
|
|
251
252
|
|
|
252
|
-
class func upDateWhereForCascade(results: (String,[[String:Any]]))
|
|
253
|
+
class func upDateWhereForCascade(results: (String, [[String: Any]]))
|
|
253
254
|
throws -> ((setStmt: String, uWhereStmt: String)) {
|
|
254
255
|
|
|
255
256
|
// Search for related items in tableName
|
|
@@ -285,48 +286,48 @@ class UtilsDelete {
|
|
|
285
286
|
tableName: String, whStmt: String,
|
|
286
287
|
withRefsNames: [String],
|
|
287
288
|
colNames: [String], values: [Any])
|
|
288
|
-
|
|
289
|
+
throws -> (String, [[String: Any]]) {
|
|
289
290
|
var relatedItems: [[String: Any]] = []
|
|
290
291
|
var key: String = ""
|
|
291
292
|
let t1Names = withRefsNames.map { "t1.\($0)" }
|
|
292
293
|
let t2Names = colNames.map { "t2.\($0)" }
|
|
293
294
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
295
|
+
do {
|
|
296
|
+
var whereClause = try UtilsSQLStatement
|
|
297
|
+
.addPrefixToWhereClause(whStmt, from: colNames,
|
|
298
|
+
to: withRefsNames,
|
|
299
|
+
prefix: "t2.")
|
|
300
|
+
if whereClause.hasSuffix(";") {
|
|
301
|
+
whereClause = String(whereClause.dropLast())
|
|
302
|
+
}
|
|
303
|
+
let resultString = zip(t1Names, t2Names)
|
|
304
|
+
.map {"\($0) = \($1)" }
|
|
305
|
+
.joined(separator: " AND ")
|
|
306
|
+
|
|
307
|
+
let sql = "SELECT t1.rowid FROM \(updTableName) t1 " +
|
|
308
|
+
"JOIN \(tableName) t2 ON \(resultString) " +
|
|
309
|
+
"WHERE \(whereClause) AND t1.sql_deleted = 0;"
|
|
310
|
+
var vals = try UtilsSQLCipher.querySQL(mDB: mDB, sql: sql,
|
|
311
|
+
values: values)
|
|
312
|
+
if vals.count > 1 {
|
|
313
|
+
if let mVals = vals[0]["ios_columns"] as? [String] {
|
|
314
|
+
key = mVals[0]
|
|
315
|
+
let keyToRemove = "ios_columns"
|
|
316
|
+
vals.removeAll { dict in
|
|
317
|
+
return dict.keys.contains(keyToRemove)
|
|
318
|
+
}
|
|
319
|
+
for val in vals {
|
|
320
|
+
relatedItems.append(val)
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return (key, relatedItems)
|
|
325
|
+
} catch UtilsSQLStatementError.addPrefixToWhereClause(let message) {
|
|
326
|
+
throw UtilsDeleteError
|
|
327
|
+
.searchForRelatedItems(message: message)
|
|
327
328
|
} catch UtilsSQLCipherError.querySQL(let message) {
|
|
328
|
-
|
|
329
|
-
|
|
329
|
+
throw UtilsDeleteError
|
|
330
|
+
.searchForRelatedItems(message: message)
|
|
330
331
|
}
|
|
331
332
|
}
|
|
332
333
|
// swiftlint:enable function_parameter_count
|
|
@@ -337,14 +338,14 @@ class UtilsDelete {
|
|
|
337
338
|
class func executeUpdateForDelete(mDB: Database, tableName: String,
|
|
338
339
|
whereStmt: String, setStmt: String,
|
|
339
340
|
colNames: [String], values: [Any])
|
|
340
|
-
|
|
341
|
+
throws {
|
|
341
342
|
var lastId: Int64 = -1
|
|
342
|
-
|
|
343
|
+
//update sql_deleted for this references
|
|
343
344
|
let stmt = "UPDATE \(tableName) SET \(setStmt) \(whereStmt)"
|
|
344
345
|
var selValues: [Any] = []
|
|
345
346
|
if !values.isEmpty {
|
|
346
347
|
var arrVal: [String] = whereStmt
|
|
347
|
-
|
|
348
|
+
.components(separatedBy: "?")
|
|
348
349
|
if arrVal[arrVal.count - 1] == ";" {
|
|
349
350
|
arrVal.removeLast()
|
|
350
351
|
}
|
|
@@ -359,8 +360,8 @@ class UtilsDelete {
|
|
|
359
360
|
}
|
|
360
361
|
|
|
361
362
|
let resp = try UtilsSQLCipher.prepareSQL(mDB: mDB, sql: stmt,
|
|
362
|
-
|
|
363
|
-
|
|
363
|
+
values: selValues,
|
|
364
|
+
fromJson: false, returnMode: "no")
|
|
364
365
|
lastId = resp.0
|
|
365
366
|
if lastId == -1 {
|
|
366
367
|
let msg = "UPDATE sql_deleted failed for " +
|
|
@@ -378,16 +379,16 @@ class UtilsDelete {
|
|
|
378
379
|
return Int(currentTime)
|
|
379
380
|
}
|
|
380
381
|
|
|
381
|
-
|
|
382
|
+
// MARK: - checkValuesMatch
|
|
382
383
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
384
|
+
class func checkValuesMatch(_ array1: [String],
|
|
385
|
+
against array2: [String]) -> Bool {
|
|
386
|
+
for value in array1 {
|
|
387
|
+
if !array2.contains(value) {
|
|
388
|
+
return false
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return true
|
|
391
392
|
}
|
|
392
393
|
|
|
393
394
|
// MARK: - getReferences
|
|
@@ -402,7 +403,7 @@ class UtilsDelete {
|
|
|
402
403
|
sqlStmt += "sql LIKE('%ON DELETE%');"
|
|
403
404
|
do {
|
|
404
405
|
var references: [[String: Any]] = try UtilsSQLCipher
|
|
405
|
-
|
|
406
|
+
.querySQL(mDB: mDB, sql: sqlStmt, values: [])
|
|
406
407
|
var retRefs = [String]()
|
|
407
408
|
var tableWithRefs: String = ""
|
|
408
409
|
if references.count > 1 {
|
|
@@ -426,7 +427,7 @@ class UtilsDelete {
|
|
|
426
427
|
// MARK: - getRefs
|
|
427
428
|
|
|
428
429
|
class func getRefs(sqlStatement: String)
|
|
429
|
-
|
|
430
|
+
throws -> (tableName: String, foreignKeys: [String]) {
|
|
430
431
|
var tableName = ""
|
|
431
432
|
var foreignKeys = [String]()
|
|
432
433
|
let statement = UtilsSQLStatement
|
|
@@ -440,33 +441,33 @@ class UtilsDelete {
|
|
|
440
441
|
if let tableNameMatch = tableNameRegex
|
|
441
442
|
.firstMatch(in: statement, options: [],
|
|
442
443
|
range: NSRange(location: 0,
|
|
443
|
-
|
|
444
|
+
length: statement.utf16.count)) {
|
|
444
445
|
let tableNameRange = Range(tableNameMatch.range(
|
|
445
|
-
|
|
446
|
+
at: 1), in: statement)!
|
|
446
447
|
tableName = String(statement[tableNameRange])
|
|
447
448
|
}
|
|
448
449
|
|
|
449
450
|
// Regular expression pattern to match the FOREIGN KEY
|
|
450
451
|
// constraints
|
|
451
452
|
// swiftlint:disable line_length
|
|
452
|
-
|
|
453
|
+
let foreignKeyPattern = #"FOREIGN\s+KEY\s+\([^)]+\)\s+REFERENCES\s+(\w+)\s*\([^)]+\)\s+ON\s+DELETE\s+(CASCADE|RESTRICT|SET\s+DEFAULT|SET\s+NULL|NO\s+ACTION)"#
|
|
453
454
|
// swiftlint:enable line_length
|
|
454
455
|
|
|
455
456
|
let foreignKeyRegex = try NSRegularExpression(
|
|
456
|
-
|
|
457
|
+
pattern: foreignKeyPattern, options: [])
|
|
457
458
|
let foreignKeyMatches = foreignKeyRegex
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
459
|
+
.matches(in: statement, options: [],
|
|
460
|
+
range: NSRange(location: 0,
|
|
461
|
+
length: statement.utf16.count))
|
|
461
462
|
for foreignKeyMatch in foreignKeyMatches {
|
|
462
|
-
|
|
463
|
+
let foreignKeyRange = Range(
|
|
463
464
|
foreignKeyMatch.range(at: 0), in: statement)!
|
|
464
|
-
|
|
465
|
-
|
|
465
|
+
let foreignKey = String(statement[foreignKeyRange])
|
|
466
|
+
foreignKeys.append(foreignKey)
|
|
466
467
|
}
|
|
467
468
|
} catch {
|
|
468
469
|
let msg = "getRefs: Error creating regular expression: " +
|
|
469
|
-
|
|
470
|
+
"\(error)"
|
|
470
471
|
throw UtilsDeleteError.getRefs(message: msg)
|
|
471
472
|
}
|
|
472
473
|
return (tableName, foreignKeys)
|
|
@@ -477,12 +478,12 @@ class UtilsDelete {
|
|
|
477
478
|
class func getUpdDelReturnedValues(mDB: Database,
|
|
478
479
|
sqlStmt: String,
|
|
479
480
|
names: String )
|
|
480
|
-
|
|
481
|
+
throws -> [[String: Any]] {
|
|
481
482
|
var result: [[String: Any]] = []
|
|
482
483
|
let tableName = UtilsSQLStatement
|
|
483
|
-
|
|
484
|
+
.extractTableName(from: sqlStmt)
|
|
484
485
|
let whereClause = UtilsSQLStatement
|
|
485
|
-
|
|
486
|
+
.extractWhereClause(from: sqlStmt)
|
|
486
487
|
if let tblName = tableName {
|
|
487
488
|
if var wClause = whereClause {
|
|
488
489
|
if wClause.suffix(1) == ";" {
|
|
@@ -490,13 +491,13 @@ class UtilsDelete {
|
|
|
490
491
|
}
|
|
491
492
|
do {
|
|
492
493
|
var query: String = "SELECT \(names) FROM " +
|
|
493
|
-
|
|
494
|
+
"\(tblName) WHERE "
|
|
494
495
|
query += "\(wClause);"
|
|
495
496
|
result = try UtilsSQLCipher
|
|
496
497
|
.querySQL(mDB: mDB, sql: query, values: [])
|
|
497
498
|
} catch UtilsSQLCipherError.querySQL(let message) {
|
|
498
499
|
throw UtilsDeleteError
|
|
499
|
-
|
|
500
|
+
.getUpdDelReturnedValues(message: message)
|
|
500
501
|
}
|
|
501
502
|
}
|
|
502
503
|
}
|
|
@@ -504,3 +505,4 @@ class UtilsDelete {
|
|
|
504
505
|
}
|
|
505
506
|
}
|
|
506
507
|
// swiftlint:enable type_body_length
|
|
508
|
+
// swiftlint:enable file_length
|
|
@@ -633,6 +633,7 @@ class UtilsSQLCipher {
|
|
|
633
633
|
|
|
634
634
|
// MARK: - deleteSQL
|
|
635
635
|
|
|
636
|
+
// swiftlint:disable function_body_length
|
|
636
637
|
class func deleteSQL(mDB: Database, sql: String, values: [Any])
|
|
637
638
|
throws -> String {
|
|
638
639
|
var sqlStmt = sql
|
|
@@ -657,9 +658,9 @@ class UtilsSQLCipher {
|
|
|
657
658
|
"WHERE clause"
|
|
658
659
|
throw UtilsSQLCipherError.deleteSQL(message: msg)
|
|
659
660
|
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
661
|
+
let colNames = UtilsSQLStatement
|
|
662
|
+
.extractColumnNames(from: whereClause)
|
|
663
|
+
if colNames.count == 0 {
|
|
663
664
|
let msg = "Did not find column names in the" +
|
|
664
665
|
"WHERE Statement"
|
|
665
666
|
throw UtilsSQLCipherError.deleteSQL(message: msg)
|
|
@@ -695,6 +696,7 @@ class UtilsSQLCipher {
|
|
|
695
696
|
throw UtilsSQLCipherError.deleteSQL(message: message)
|
|
696
697
|
}
|
|
697
698
|
}
|
|
699
|
+
// swiftlint:enable function_body_length
|
|
698
700
|
|
|
699
701
|
// MARK: - querySQL
|
|
700
702
|
|
|
@@ -835,6 +837,7 @@ class UtilsSQLCipher {
|
|
|
835
837
|
|
|
836
838
|
// MARK: - Execute
|
|
837
839
|
|
|
840
|
+
// swiftlint:disable function_body_length
|
|
838
841
|
class func execute(mDB: Database, sql: String) throws {
|
|
839
842
|
var msg: String = "Error execute: "
|
|
840
843
|
if !mDB.isDBOpen() {
|
|
@@ -886,6 +889,7 @@ class UtilsSQLCipher {
|
|
|
886
889
|
}
|
|
887
890
|
return
|
|
888
891
|
}
|
|
892
|
+
// swiftlint:enable function_body_length
|
|
889
893
|
|
|
890
894
|
// MARK: - DeleteDB
|
|
891
895
|
|
|
@@ -917,6 +921,7 @@ class UtilsSQLCipher {
|
|
|
917
921
|
// MARK: - ExecuteSet
|
|
918
922
|
|
|
919
923
|
// swiftlint:disable function_body_length
|
|
924
|
+
// swiftlint:disable cyclomatic_complexity
|
|
920
925
|
class func executeSet(mDB: Database, set: [[String: Any]],
|
|
921
926
|
returnMode: String)
|
|
922
927
|
throws -> (Int64, [[String: Any]]) {
|
|
@@ -986,6 +991,8 @@ class UtilsSQLCipher {
|
|
|
986
991
|
message: message)
|
|
987
992
|
}
|
|
988
993
|
}
|
|
994
|
+
// swiftlint:enable cyclomatic_complexity
|
|
995
|
+
// swiftlint:enable function_body_length
|
|
989
996
|
|
|
990
997
|
class func addToResponse(response: [[String: Any]],
|
|
991
998
|
respSet: [[String: Any]]) -> [[String: Any]] {
|