Skip to content

Commit 0bcd29d

Browse files
Stijn WillemsdoozMen
authored andcommitted
workaround for compiler crash - no cloudkit for swift 6.3 at the moment
1 parent b4e9240 commit 0bcd29d

4 files changed

Lines changed: 304 additions & 208 deletions

File tree

Sources/SQLiteData/CloudKit/CloudKit+StructuredQueries.swift

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,29 @@
283283
typealias EquatableCKRecordValueProtocol = CKRecordValueProtocol & Equatable
284284

285285
self.userModificationTime = other.userModificationTime
286-
for column in T.TableColumns.writableColumns {
287-
func open<Value>(_ column: some WritableTableColumnExpression<T, Value>) {
286+
_update(
287+
with: other,
288+
row: row,
289+
columnNames: &columnNames,
290+
parentForeignKey: parentForeignKey,
291+
columns: T.TableColumns.writableColumns
292+
)
293+
}
294+
295+
private func _update<T: PrimaryKeyedTable>(
296+
with other: CKRecord,
297+
row: T,
298+
columnNames: inout [String],
299+
parentForeignKey: ForeignKey?,
300+
columns: [any WritableTableColumnExpression]
301+
) {
302+
typealias EquatableCKRecordValueProtocol = CKRecordValueProtocol & Equatable
303+
304+
for column in columns {
305+
func open<Root, Value>(_ column: some WritableTableColumnExpression<Root, Value>) {
288306
let key = column.name
289-
let keyPath = column.keyPath as! KeyPath<T, Value.QueryOutput>
307+
let column = column as! any WritableTableColumnExpression<T, Value>
308+
let keyPath = column.keyPath
290309
let didSet: Bool
291310
if let value = other[key] as? CKAsset {
292311
didSet = setAsset(value, forKey: key, at: other.encryptedValues[at: key])

0 commit comments

Comments
 (0)