diff --git a/Sources/SQLiteData/CloudKit/SyncEngine.swift b/Sources/SQLiteData/CloudKit/SyncEngine.swift index 871c7999..40209738 100644 --- a/Sources/SQLiteData/CloudKit/SyncEngine.swift +++ b/Sources/SQLiteData/CloudKit/SyncEngine.swift @@ -15,7 +15,7 @@ /// An object that manages the synchronization of local and remote SQLite data. /// - /// See for more information. + /// See for more information. @available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) public final class SyncEngine: Observable, Sendable { package let userDatabase: UserDatabase @@ -896,7 +896,7 @@ /// Whether or not the ``SyncEngine`` is currently writing changes to the database. /// - /// See for more info. + /// See for more info. @DatabaseFunction("sqlitedata_icloud_syncEngineIsSynchronizingChanges") public static var isSynchronizing: Bool { if _isCreatingTemporaryTrigger { @@ -2193,7 +2193,7 @@ /// Attaches the metadatabase to an existing database connection. /// /// Invoke this method when preparing your database connection in order to allow querying the - /// ``SyncMetadata`` table (see for more info): + /// ``SyncMetadata`` table (see for more info): /// /// ```swift /// func appDatabase() -> any DatabaseWriter { diff --git a/Sources/SQLiteData/CloudKit/SyncMetadata.swift b/Sources/SQLiteData/CloudKit/SyncMetadata.swift index 22990098..7c1d1cde 100644 --- a/Sources/SQLiteData/CloudKit/SyncMetadata.swift +++ b/Sources/SQLiteData/CloudKit/SyncMetadata.swift @@ -8,7 +8,7 @@ /// application is the number of rows this one single table holds. However, this table is held /// in a database separate from your app's database. /// - /// See for more info. + /// See for more info. @available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) @Table("sqlitedata_icloud_metadata") public struct SyncMetadata: Hashable, Identifiable, Sendable { diff --git a/Sources/SQLiteData/Documentation.docc/Articles/AddingToGRDB.md b/Sources/SQLiteData/Documentation.docc/Articles/AddingToGRDB.md index 6003ea00..4c2d14a6 100644 --- a/Sources/SQLiteData/Documentation.docc/Articles/AddingToGRDB.md +++ b/Sources/SQLiteData/Documentation.docc/Articles/AddingToGRDB.md @@ -8,7 +8,7 @@ Learn how to add SQLiteData to an existing app that uses GRDB. to interact with SQLite under the hood, such as performing queries and observing changes to the database. If you have an existing application using GRDB, and would like to use the tools of this library, such as [`@FetchAll`](), the SQL query builder, and -[CloudKit synchronization](), then there are a few steps you must take. +[CloudKit synchronization](), then there are a few steps you must take. ## Replace PersistableRecord and FetchableRecord with @Table @@ -169,7 +169,7 @@ try Reminder.insert { ## CloudKit synchronization -The library's [CloudKit]() synchronization tools require that the tables being +The library's [CloudKit]() synchronization tools require that the tables being synchronized have a primary key, and this is enforced through the `PrimaryKeyedTable` protocol. The `@Table` macro automatically applies this protocol for you when your type has an `id` field, but if you use a different name for your primary key you will need to use the `@Column` macro @@ -186,6 +186,6 @@ to specify that: The library further requires your tables use globally unique identifiers (such as UUID) for their primary keys, and in particular auto-incrementing integer IDs do _not_ work. You will need to migrate your tables to use UUIDs, see - for more information. + for more information. [GRDB]: http://github.com/groue/GRDB.swift diff --git a/Sources/SQLiteData/Documentation.docc/Articles/CloudKitSharing.md b/Sources/SQLiteData/Documentation.docc/Articles/CloudKitSharing.md index 974215dd..89a008d7 100644 --- a/Sources/SQLiteData/Documentation.docc/Articles/CloudKitSharing.md +++ b/Sources/SQLiteData/Documentation.docc/Articles/CloudKitSharing.md @@ -179,7 +179,7 @@ you can share root records, like reminders lists. If you do invoke ``SyncEngine/share(record:configure:)`` with a non-root record, an error will be thrown. > Note: A reminder can still be shared as an association to a shared reminders list, as discussed -> [in the next section](). However, a single +> [in the next section](). However, a single > reminder cannot be shared on its own. For a more complex example, consider the following diagrammatic schema for a reminders app: @@ -336,7 +336,7 @@ excels at. One-to-"at most one" relationships in SQLite allow you to associate zero or one records with another record. For an example of this, suppose we wanted to hold onto a cover image for reminders -lists (see for more information on synchronizing assets such as images). It +lists (see for more information on synchronizing assets such as images). It is perfectly fine to hold onto large binary data in SQLite, such as image data, but typically one should put this data in a separate table. @@ -384,7 +384,7 @@ do { } ``` -See for more information on accessing the metadata +See for more information on accessing the metadata associated with your user's data. Ideally your app would not allow the user to write to records that they do not have permissions for. diff --git a/Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md b/Sources/SQLiteData/Documentation.docc/Articles/CloudKitSync.md similarity index 99% rename from Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md rename to Sources/SQLiteData/Documentation.docc/Articles/CloudKitSync.md index 49a7871f..7c189a6c 100644 --- a/Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md +++ b/Sources/SQLiteData/Documentation.docc/Articles/CloudKitSync.md @@ -117,7 +117,7 @@ This will allow you to query the ``SyncMetadata`` table, which gives you access stored for each of your records, as well as the `CKShare` for any shared records. See the ``GRDB/Database/attachMetadatabase(containerIdentifier:)`` for more information, as well -as below. +as below. ## Designing your schema with synchronization in mind @@ -538,7 +538,7 @@ exposed for you to query it in whichever way you want. > Important: In order to query the `SyncMetadata` table from your database connection you will need to attach the metadatabase to your database connection. This can be done with the ``GRDB/Database/attachMetadatabase(containerIdentifier:)`` method defined on `Database`. See - for more information on how to do this. + for more information on how to do this. With that done you can use the ``StructuredQueriesCore/PrimaryKeyedTable/syncMetadataID`` property to construct a SQL query for fetching the metadata associated with one of your records. @@ -705,7 +705,7 @@ And in previews you can use it like so: If you have an existing app deployed to the app store using SQLite, then you may have to perform a migration on your schema to prepare it for synchronization. The most important requirement -detailed above in is that +detailed above in is that all tables _must_ have a primary key, and all primary keys must be globally unique identifiers such as UUID, and cannot be simple auto-incrementing integers. diff --git a/Sources/SQLiteData/Documentation.docc/Articles/ComparisonWithSwiftData.md b/Sources/SQLiteData/Documentation.docc/Articles/ComparisonWithSwiftData.md index 0090c0a7..7c82f058 100644 --- a/Sources/SQLiteData/Documentation.docc/Articles/ComparisonWithSwiftData.md +++ b/Sources/SQLiteData/Documentation.docc/Articles/ComparisonWithSwiftData.md @@ -931,17 +931,17 @@ SQLiteData has only one of these limitations: * Unique constraints on columns (except for the primary key) cannot be upheld on a distributed schema. For example, if you have a `Tag` table with a unique `title` column, then what are you to do if two different devices create a tag with the title "family" at the same time? -See for more information. +See for more information. * Columns on freshly created tables do not need to have default values or be nullable. Only newly added columns to existing tables need to either be nullable or have a default. See - for more info. + for more info. * Relationships on freshly created do not need to be nullable. Only newly added columns to -existing tables need to be nullable. See for more info. +existing tables need to be nullable. See for more info. For more information about requirements of your schema in order to use CloudKit synchronization, -see and -, and for more general -information about CloudKit synchronization, see . +see and +, and for more general +information about CloudKit synchronization, see . ### Supported Apple platforms diff --git a/Sources/SQLiteData/Documentation.docc/Articles/ManuallyMigratingPrimaryKeys.md b/Sources/SQLiteData/Documentation.docc/Articles/ManuallyMigratingPrimaryKeys.md index 7120c9dd..e2479ee8 100644 --- a/Sources/SQLiteData/Documentation.docc/Articles/ManuallyMigratingPrimaryKeys.md +++ b/Sources/SQLiteData/Documentation.docc/Articles/ManuallyMigratingPrimaryKeys.md @@ -128,7 +128,7 @@ struct ReminderTag { ``` And a migration must be run to add that column to the table. However, you must perform a multi-step -migration similar to what is described above in . +migration similar to what is described above in . You must 1) create a new table with the new primary key column, 2) copy data from the old table to the new table, 3) delete the old table, and finally 4) rename the new table. diff --git a/Sources/SQLiteData/Documentation.docc/Articles/PreparingDatabase.md b/Sources/SQLiteData/Documentation.docc/Articles/PreparingDatabase.md index 96e9bf86..667158a7 100644 --- a/Sources/SQLiteData/Documentation.docc/Articles/PreparingDatabase.md +++ b/Sources/SQLiteData/Documentation.docc/Articles/PreparingDatabase.md @@ -303,4 +303,4 @@ func feature() { If you plan on synchronizing your local database to CloudKit so that your user's data is available on all of their devices, there is an additional step you must take. See - for more information. + for more information. diff --git a/Sources/SQLiteData/Documentation.docc/SQLiteData.md b/Sources/SQLiteData/Documentation.docc/SQLiteData.md index ca1fda0c..3dad6730 100644 --- a/Sources/SQLiteData/Documentation.docc/SQLiteData.md +++ b/Sources/SQLiteData/Documentation.docc/SQLiteData.md @@ -204,7 +204,7 @@ struct MyApp: App { ``` > For more information on synchronizing the database to CloudKit and sharing records with iCloud -> users, see . +> users, see . This is all you need to know to get started with SQLiteData, but there's much more to learn. Read the [articles](#Essentials) below to learn how to best utilize this library. @@ -311,7 +311,7 @@ with SQLite to take full advantage of GRDB and SQLiteData. ### CloudKit synchronization and sharing -- +- - - ``SyncEngine`` - ``SyncEngineDelegate``