diff --git a/Makefile b/Makefile index d23c3fc0..f80e8f17 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ XCODEBUILD_FLAGS = \ XCODEBUILD_COMMAND = xcodebuild $(XCODEBUILD_ARGUMENT) $(XCODEBUILD_FLAGS) -# TODO: Prefer 'xcbeautify --quiet' when this is fixed: +# NB: Prefer 'xcbeautify --quiet' when this is fixed: # https://github.com/cpisciotta/xcbeautify/issues/339 ifneq ($(strip $(shell which xcbeautify)),) XCODEBUILD = set -o pipefail && $(XCODEBUILD_COMMAND) | xcbeautify diff --git a/Sources/SQLiteData/CloudKit/IdentifierStringConvertible.swift b/Sources/SQLiteData/CloudKit/IdentifierStringConvertible.swift index 54243d39..259aa14c 100644 --- a/Sources/SQLiteData/CloudKit/IdentifierStringConvertible.swift +++ b/Sources/SQLiteData/CloudKit/IdentifierStringConvertible.swift @@ -1,6 +1,9 @@ import Foundation /// A type that can be represented by a string identifier. +/// +/// A requirement of tables synchronized to CloudKit using a ``SyncEngine``. You should generally +/// identify tables using Foundation's `UUID` type. public protocol IdentifierStringConvertible { init?(rawIdentifier: String) var rawIdentifier: String { get } diff --git a/Sources/SQLiteData/CloudKit/Internal/Triggers.swift b/Sources/SQLiteData/CloudKit/Internal/Triggers.swift index 5deeae2e..c2fbe727 100644 --- a/Sources/SQLiteData/CloudKit/Internal/Triggers.swift +++ b/Sources/SQLiteData/CloudKit/Internal/Triggers.swift @@ -51,7 +51,6 @@ ifNotExists: true, after: .update { _, new in checkWritePermissions(alias: new, parentForeignKey: parentForeignKey) - // TODO: change to update? SyncMetadata.upsert(new: new, parentForeignKey: parentForeignKey) } ) diff --git a/Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md b/Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md index 8b7356d9..0d3ca7b5 100644 --- a/Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md +++ b/Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md @@ -1,4 +1,4 @@ -# CloudKit synchronization +# Getting started with CloudKit Learn how to seamlessly add CloudKit synchronization to your SQLiteData application. @@ -714,13 +714,8 @@ Model.createTemporaryTrigger( This will skip the trigger's action when the row is being updated due to data being synchronized from CloudKit. + - - -## Topics - -### Go deeper - -- +TODO: talk about simulator push restrictions +--> \ No newline at end of file diff --git a/Sources/SQLiteData/Documentation.docc/Articles/CloudKitSharing.md b/Sources/SQLiteData/Documentation.docc/Articles/CloudKitSharing.md index f599c68d..01e5e32e 100644 --- a/Sources/SQLiteData/Documentation.docc/Articles/CloudKitSharing.md +++ b/Sources/SQLiteData/Documentation.docc/Articles/CloudKitSharing.md @@ -471,5 +471,3 @@ struct MyApp: App { This table will still be synchronized across all of a single user's devices, but if that user shares a list with a friend, it will _not_ share the private table, allowing each user to have their own personal ordering of lists. - -## Querying share metadata diff --git a/Sources/SQLiteData/Documentation.docc/Extensions/Database.md b/Sources/SQLiteData/Documentation.docc/Extensions/Database.md new file mode 100644 index 00000000..8c8f2316 --- /dev/null +++ b/Sources/SQLiteData/Documentation.docc/Extensions/Database.md @@ -0,0 +1,16 @@ +# ``GRDB/Database`` + +## Topics + +### Seeding model data + +- ``seed(_:)`` + +### User-defined functions + +- ``add(function:)`` +- ``remove(function:)`` + +### Querying CloudKit metadata + +- ``attachMetadatabase(containerIdentifier:)`` diff --git a/Sources/SQLiteData/Documentation.docc/Extensions/IdentifierStringConvertible.md b/Sources/SQLiteData/Documentation.docc/Extensions/IdentifierStringConvertible.md new file mode 100644 index 00000000..15411423 --- /dev/null +++ b/Sources/SQLiteData/Documentation.docc/Extensions/IdentifierStringConvertible.md @@ -0,0 +1,29 @@ +# ``IdentifierStringConvertible`` + +## Topics + +### Conformances + +- ``Swift/Bool`` +- ``Swift/Character`` +- ``Swift/Double`` +- ``Swift/Float`` +- ``Swift/Float16`` +- ``Swift/Int`` +- ``Swift/Int128`` +- ``Swift/Int16`` +- ``Swift/Int32`` +- ``Swift/Int64`` +- ``Swift/Int8`` +- ``Swift/String`` +- ``Swift/Substring`` +- ``Swift/UInt`` +- ``Swift/UInt128`` +- ``Swift/UInt16`` +- ``Swift/UInt32`` +- ``Swift/UInt64`` +- ``Swift/UInt8`` +- ``Swift/Optional`` +- ``Swift/Unicode/Scalar`` +- ``Foundation/UUID`` +- ``Tagged/Tagged`` diff --git a/Sources/SQLiteData/Documentation.docc/Extensions/SystemFieldsRepresentation.md b/Sources/SQLiteData/Documentation.docc/Extensions/SystemFieldsRepresentation.md new file mode 100644 index 00000000..ccf259bf --- /dev/null +++ b/Sources/SQLiteData/Documentation.docc/Extensions/SystemFieldsRepresentation.md @@ -0,0 +1 @@ +# ``CloudKit/CKRecord/SystemFieldsRepresentation`` diff --git a/Sources/SQLiteData/Documentation.docc/SQLiteData.md b/Sources/SQLiteData/Documentation.docc/SQLiteData.md index 6c6c4b7c..958a71c6 100644 --- a/Sources/SQLiteData/Documentation.docc/SQLiteData.md +++ b/Sources/SQLiteData/Documentation.docc/SQLiteData.md @@ -277,27 +277,31 @@ with SQLite to take full advantage of GRDB and SQLiteData. - - - -- - ### Database configuration and access +- ``GRDB/Database`` - ``Dependencies/DependencyValues/defaultDatabase`` -### Fetching and observing queries +### Querying model data + +- ``StructuredQueriesCore/Statement`` +- ``StructuredQueriesCore/SelectStatement`` +- ``QueryCursor`` + +### Observing model data - ``FetchAll`` - ``FetchOne`` - ``Fetch`` -### Executing statements +### CloudKit synchronization and sharing -- ``StructuredQueriesCore/Statement/execute(_:)`` -- ``StructuredQueriesCore/Statement/fetchAll(_:)`` -- ``StructuredQueriesCore/Statement/fetchOne(_:)`` -- ``StructuredQueriesCore/Statement/fetchCursor(_:)`` -- ``StructuredQueriesCore/SelectStatement/fetchCount(_:)`` - -### Seeding data - -- ``GRDB/Database/seed(_:)`` +- +- +- ``SyncEngine`` +- ``Dependencies/DependencyValues/defaultSyncEngine`` +- ``IdentifierStringConvertible`` +- ``SyncMetadata`` +- ``SharedRecord``