diff --git a/Examples/Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Examples/Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index a0d54872..587d0c8d 100644 --- a/Examples/Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Examples/Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "c133bf7d10c8ce1e5d6506c3d2f080eac8b4c8c2827044d53a9b925e903564fd", + "originHash" : "41e7781e6c506773b6af84af513bcd6d3b1be59d635e6c4c4bd89638368e4629", "pins" : [ { "identity" : "combine-schedulers", @@ -73,6 +73,24 @@ "version" : "1.9.4" } }, + { + "identity" : "swift-docc-plugin", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-docc-plugin", + "state" : { + "revision" : "3e4f133a77e644a5812911a0513aeb7288b07d06", + "version" : "1.4.5" + } + }, + { + "identity" : "swift-docc-symbolkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swiftlang/swift-docc-symbolkit", + "state" : { + "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", + "version" : "1.0.0" + } + }, { "identity" : "swift-identified-collections", "kind" : "remoteSourceControl", diff --git a/Sources/SQLiteData/CloudKit/CloudKit+StructuredQueries.swift b/Sources/SQLiteData/CloudKit/CloudKit+StructuredQueries.swift index 3c040270..6e9eacd9 100644 --- a/Sources/SQLiteData/CloudKit/CloudKit+StructuredQueries.swift +++ b/Sources/SQLiteData/CloudKit/CloudKit+StructuredQueries.swift @@ -3,12 +3,12 @@ import CryptoKit import StructuredQueriesCore - extension _CKRecord where Self == CKRecord { + extension CKRecord { public typealias _AllFieldsRepresentation = SQLiteData._AllFieldsRepresentation public typealias SystemFieldsRepresentation = _SystemFieldsRepresentation } - extension _CKRecord where Self == CKShare { + extension CKShare { public typealias _AllFieldsRepresentation = SQLiteData._AllFieldsRepresentation public typealias SystemFieldsRepresentation = _SystemFieldsRepresentation } @@ -102,10 +102,6 @@ private struct DecodingError: Error {} } - extension CKRecord: _CKRecord {} - - public protocol _CKRecord {} - extension CKDatabase.Scope { public struct RawValueRepresentation: QueryBindable, QueryRepresentable { public let queryOutput: CKDatabase.Scope diff --git a/Tests/SQLiteDataTests/CompileTimeTests.swift b/Tests/SQLiteDataTests/CompileTimeTests.swift index 252a3795..0a080bb9 100644 --- a/Tests/SQLiteDataTests/CompileTimeTests.swift +++ b/Tests/SQLiteDataTests/CompileTimeTests.swift @@ -1,5 +1,9 @@ import SQLiteData +#if canImport(CloudKit) + import CloudKit +#endif + private final class Model { @FetchAll var titles: [String] @@ -7,3 +11,33 @@ private final class Model { _titles = FetchAll(Reminder.select(\.title)) } } + +#if canImport(CloudKit) + @Table + struct RepresentableFields { + @Column(as: CKShare.SystemFieldsRepresentation.self) + var share: CKShare + @Column(as: CKShare?.SystemFieldsRepresentation.self) + var optionalShare: CKShare? + @Column(as: CKRecord.SystemFieldsRepresentation.self) + var record: CKRecord + @Column(as: CKRecord?.SystemFieldsRepresentation.self) + var optionalRecord: CKRecord? + } + + @DatabaseFunction( + as: (( + CKShare.SystemFieldsRepresentation, + CKRecord.SystemFieldsRepresentation, + CKShare?.SystemFieldsRepresentation, + CKRecord?.SystemFieldsRepresentation + ) -> Void).self + ) + nonisolated func representableArguments( + share: CKShare, + record: CKRecord, + optionalShare: CKShare?, + optionalRecord: CKRecord? + ) { + } +#endif