DataLireCoder swift package

This commit is contained in:
2025-04-27 12:53:43 +03:00
parent 2cca986016
commit 5aec6ea578
60 changed files with 7144 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import Foundation
import DataLiteCore
public extension SQLiteRow {
func contains(_ key: CodingKey) -> Bool {
if let index = key.intValue {
0..<count ~= index
} else {
contains(key.stringValue)
}
}
subscript(key: CodingKey) -> Value? {
get {
if let index = key.intValue {
self[index].value
} else {
self[key.stringValue]
}
}
set {
if let index = key.intValue {
self[self[index].column] = newValue
} else {
self[key.stringValue] = newValue
}
}
}
}