|
16 | 16 | @Selection |
17 | 17 | public struct ID: Hashable, Sendable { |
18 | 18 | /// The unique identifier of the record synchronized. |
19 | | - public var recordPrimaryKey: String |
| 19 | + public let recordPrimaryKey: String |
20 | 20 |
|
21 | 21 | /// The type of the record synchronized, _i.e._ its table name. |
22 | | - public var recordType: String |
| 22 | + public let recordType: String |
23 | 23 | } |
24 | 24 |
|
25 | 25 | /// The unique identifier and type of the record synchronized. |
|
32 | 32 | public var recordType: String { id.recordType } |
33 | 33 |
|
34 | 34 | /// The record zone name. |
35 | | - public var zoneName: String |
| 35 | + public let zoneName: String |
36 | 36 |
|
37 | 37 | /// The record owner name. |
38 | | - public var ownerName: String |
| 38 | + public let ownerName: String |
39 | 39 |
|
40 | 40 | /// The name of the record synchronized. |
41 | 41 | /// |
|
53 | 53 | @Selection |
54 | 54 | public struct ParentID: Hashable, Sendable { |
55 | 55 | /// The unique identifier of the parent record synchronized. |
56 | | - public var parentRecordPrimaryKey: String |
| 56 | + public let parentRecordPrimaryKey: String |
57 | 57 |
|
58 | 58 | /// The type of the parent record synchronized, _i.e._ its table name. |
59 | | - public var parentRecordType: String |
| 59 | + public let parentRecordType: String |
60 | 60 | } |
61 | 61 |
|
62 | 62 | /// The identifier and type of this record's parent, if any. |
63 | | - public var parentRecordID: ParentID? |
| 63 | + public let parentRecordID: ParentID? |
64 | 64 |
|
65 | 65 | /// The unique identifier of this record's parent, if any. |
66 | 66 | public var parentRecordPrimaryKey: String? { parentRecordID?.parentRecordPrimaryKey } |
|
83 | 83 | /// |
84 | 84 | /// This record holds only the fields that are archived when using `encodeSystemFields(with:)`. |
85 | 85 | @Column(as: CKRecord?.SystemFieldsRepresentation.self) |
86 | | - public var lastKnownServerRecord: CKRecord? |
| 86 | + public let lastKnownServerRecord: CKRecord? |
87 | 87 |
|
88 | 88 | /// The last known `CKRecord` received from the server with all fields archived. |
89 | 89 | @Column(as: CKRecord?._AllFieldsRepresentation.self) |
90 | | - public var _lastKnownServerRecordAllFields: CKRecord? |
| 90 | + public let _lastKnownServerRecordAllFields: CKRecord? |
91 | 91 |
|
92 | 92 | /// The `CKShare` associated with this record, if it is shared. |
93 | 93 | @Column(as: CKShare?.SystemFieldsRepresentation.self) |
94 | | - public var share: CKShare? |
| 94 | + public let share: CKShare? |
95 | 95 |
|
96 | 96 | /// Determines if the metadata has been "soft" deleted. It will be fully deleted once the |
97 | 97 | /// next batch of pending changes is processed. |
98 | | - public var _isDeleted = false |
| 98 | + public let _isDeleted: Bool |
99 | 99 |
|
100 | 100 | @Column(generated: .virtual) |
101 | 101 | public let hasLastKnownServerRecord: Bool |
|
109 | 109 | public let isShared: Bool |
110 | 110 |
|
111 | 111 | /// The time the user last modified the record. |
112 | | - public var userModificationTime: Int64 |
| 112 | + public let userModificationTime: Int64 |
113 | 113 | } |
114 | 114 |
|
115 | 115 | @available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) |
|
165 | 165 | self.hasLastKnownServerRecord = lastKnownServerRecord != nil |
166 | 166 | self.isShared = share != nil |
167 | 167 | self.userModificationTime = userModificationTime |
| 168 | + self._isDeleted = false |
168 | 169 | } |
169 | 170 |
|
170 | 171 | package static func find(_ recordID: CKRecord.ID) -> Where<Self> { |
|
0 commit comments