Skip to content

Commit 7ab84ed

Browse files
committed
Introduce Post table type Add differentFieldsChange_conflictOnSend_clientNewer test Add differentFieldsChange_conflictOnSend_serverNewer test Remove replaced tests Add differentFieldsChange_conflictOnFetch_clientNewer test Add differentFieldsChange_conflictOnFetch_serverNewer test Add convergence assertions for local state Remove replaced test Add sameFieldChange_conflictOnSend_retryBeforeFetch_* tests Add sameFieldChange_conflictOnSend_fetchBeforeRetry_* tests Add sameFieldChange_conflictOnFetch_clientNewer test Add sameFieldChange_conflictOnFetch_serverNewer test Remove replaced tests Add sameFieldChangeAndRemoval_* tests Update test for updating nullable fields Combine local database assertions into a single join query Add sameFieldChange_conflictOnSend_equalTimestamps test Add sameFieldRemoval_conflictOnSend_clientNewer test Add sameFieldRemoval_conflictOnSend_serverNewer test Improve synced row query asserts
1 parent 264a3ce commit 7ab84ed

File tree

7 files changed

+1909
-687
lines changed

7 files changed

+1909
-687
lines changed

Sources/SQLiteData/CloudKit/CloudKit+StructuredQueries.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144

145145
@available(macOS 13, iOS 16, tvOS 16, watchOS 9, *)
146146
extension CKRecordKeyValueSetting {
147-
fileprivate subscript(at key: String) -> Int64 {
147+
package subscript(at key: String) -> Int64 {
148148
get {
149149
self["\(CKRecord.userModificationTimeKey)_\(key)"] as? Int64 ?? -1
150150
}

Tests/SQLiteDataTests/CloudKitTests/CloudKitTests.swift

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,47 @@
365365
type: "TEXT"
366366
)
367367
]
368+
),
369+
[12]: RecordType(
370+
tableName: "posts",
371+
schema: """
372+
CREATE TABLE "posts" (
373+
"id" INT PRIMARY KEY NOT NULL,
374+
"title" TEXT NOT NULL ON CONFLICT REPLACE DEFAULT '',
375+
"body" TEXT,
376+
"isPublished" INTEGER NOT NULL ON CONFLICT REPLACE DEFAULT 0
377+
) STRICT
378+
""",
379+
tableInfo: [
380+
[0]: TableInfo(
381+
defaultValue: nil,
382+
isPrimaryKey: false,
383+
name: "body",
384+
isNotNull: false,
385+
type: "TEXT"
386+
),
387+
[1]: TableInfo(
388+
defaultValue: nil,
389+
isPrimaryKey: true,
390+
name: "id",
391+
isNotNull: true,
392+
type: "INT"
393+
),
394+
[2]: TableInfo(
395+
defaultValue: "0",
396+
isPrimaryKey: false,
397+
name: "isPublished",
398+
isNotNull: true,
399+
type: "INTEGER"
400+
),
401+
[3]: TableInfo(
402+
defaultValue: "\'\'",
403+
isPrimaryKey: false,
404+
name: "title",
405+
isNotNull: true,
406+
type: "TEXT"
407+
)
408+
]
368409
)
369410
]
370411
"""#

0 commit comments

Comments
 (0)