Skip to content

Commit f58d5d4

Browse files
authored
fix (#456)
1 parent 9a7c01c commit f58d5d4

9 files changed

Lines changed: 23 additions & 23 deletions

File tree

Sources/SQLiteData/CloudKit/SyncEngine.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/// An object that manages the synchronization of local and remote SQLite data.
2121
///
22-
/// See <doc:CloudKit> for more information.
22+
/// See <doc:CloudKitSync> for more information.
2323
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
2424
public final class SyncEngine: Observable, Sendable {
2525
package let userDatabase: UserDatabase
@@ -900,7 +900,7 @@
900900

901901
/// Whether or not the ``SyncEngine`` is currently writing changes to the database.
902902
///
903-
/// See <doc:CloudKit#Updating-triggers-to-be-compatible-with-synchronization> for more info.
903+
/// See <doc:CloudKitSync#Updating-triggers-to-be-compatible-with-synchronization> for more info.
904904
@DatabaseFunction("sqlitedata_icloud_syncEngineIsSynchronizingChanges")
905905
public static var isSynchronizing: Bool {
906906
if _isCreatingTemporaryTrigger {
@@ -2201,7 +2201,7 @@
22012201
/// Attaches the metadatabase to an existing database connection.
22022202
///
22032203
/// Invoke this method when preparing your database connection in order to allow querying the
2204-
/// ``SyncMetadata`` table (see <doc:CloudKit#Accessing-CloudKit-metadata> for more info):
2204+
/// ``SyncMetadata`` table (see <doc:CloudKitSync#Accessing-CloudKit-metadata> for more info):
22052205
///
22062206
/// ```swift
22072207
/// func appDatabase() -> any DatabaseWriter {

Sources/SQLiteData/CloudKit/SyncMetadata.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// application is the number of rows this one single table holds. However, this table is held
1111
/// in a database separate from your app's database.
1212
///
13-
/// See <doc:CloudKit#Accessing-CloudKit-metadata> for more info.
13+
/// See <doc:CloudKitSync#Accessing-CloudKit-metadata> for more info.
1414
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
1515
@Table("sqlitedata_icloud_metadata")
1616
public struct SyncMetadata: Hashable, Identifiable, Sendable {

Sources/SQLiteData/Documentation.docc/Articles/AddingToGRDB.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Learn how to add SQLiteData to an existing app that uses GRDB.
88
to interact with SQLite under the hood, such as performing queries and observing changes to the
99
database. If you have an existing application using GRDB, and would like to use the tools of this
1010
library, such as [`@FetchAll`](<doc:FetchAll>), the SQL query builder, and
11-
[CloudKit synchronization](<doc:CloudKit>), then there are a few steps you must take.
11+
[CloudKit synchronization](<doc:CloudKitSync>), then there are a few steps you must take.
1212

1313
## Replace PersistableRecord and FetchableRecord with @Table
1414

@@ -169,7 +169,7 @@ try Reminder.insert {
169169

170170
## CloudKit synchronization
171171

172-
The library's [CloudKit](<doc:CloudKit>) synchronization tools require that the tables being
172+
The library's [CloudKit](<doc:CloudKitSync>) synchronization tools require that the tables being
173173
synchronized have a primary key, and this is enforced through the `PrimaryKeyedTable` protocol.
174174
The `@Table` macro automatically applies this protocol for you when your type has an `id` field,
175175
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:
186186
The library further requires your tables use globally unique identifiers (such as UUID) for their
187187
primary keys, and in particular auto-incrementing integer IDs do _not_ work. You will need to
188188
migrate your tables to use UUIDs, see
189-
<doc:CloudKit#Preparing-an-existing-schema-for-synchronization> for more information.
189+
<doc:CloudKitSync#Preparing-an-existing-schema-for-synchronization> for more information.
190190

191191
[GRDB]: http://github.com/groue/GRDB.swift

Sources/SQLiteData/Documentation.docc/Articles/CloudKitSharing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ you can share root records, like reminders lists. If you do invoke
179179
``SyncEngine/share(record:configure:)`` with a non-root record, an error will be thrown.
180180

181181
> Note: A reminder can still be shared as an association to a shared reminders list, as discussed
182-
> [in the next section](<doc:CloudKit#Sharing-foreign-key-relationships>). However, a single
182+
> [in the next section](<doc:CloudKitSync#Sharing-foreign-key-relationships>). However, a single
183183
> reminder cannot be shared on its own.
184184
185185
For a more complex example, consider the following diagrammatic schema for a reminders app:
@@ -336,7 +336,7 @@ excels at.
336336

337337
One-to-"at most one" relationships in SQLite allow you to associate zero or one records with
338338
another record. For an example of this, suppose we wanted to hold onto a cover image for reminders
339-
lists (see <doc:CloudKit#Assets> for more information on synchronizing assets such as images). It
339+
lists (see <doc:CloudKitSync#Assets> for more information on synchronizing assets such as images). It
340340
is perfectly fine to hold onto large binary data in SQLite, such as image data, but typically one
341341
should put this data in a separate table.
342342

@@ -384,7 +384,7 @@ do {
384384
}
385385
```
386386

387-
See <doc:CloudKit#Accessing-CloudKit-metadata> for more information on accessing the metadata
387+
See <doc:CloudKitSync#Accessing-CloudKit-metadata> for more information on accessing the metadata
388388
associated with your user's data.
389389

390390
Ideally your app would not allow the user to write to records that they do not have permissions for.

Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md renamed to Sources/SQLiteData/Documentation.docc/Articles/CloudKitSync.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ This will allow you to query the ``SyncMetadata`` table, which gives you access
117117
stored for each of your records, as well as the `CKShare` for any shared records.
118118

119119
See the ``GRDB/Database/attachMetadatabase(containerIdentifier:)`` for more information, as well
120-
as <doc:CloudKit#Accessing-CloudKit-metadata> below.
120+
as <doc:CloudKitSync#Accessing-CloudKit-metadata> below.
121121

122122
## Designing your schema with synchronization in mind
123123

@@ -538,7 +538,7 @@ exposed for you to query it in whichever way you want.
538538
> Important: In order to query the `SyncMetadata` table from your database connection you will need
539539
to attach the metadatabase to your database connection. This can be done with the
540540
``GRDB/Database/attachMetadatabase(containerIdentifier:)`` method defined on `Database`. See
541-
<doc:CloudKit#Setting-up-a-SyncEngine> for more information on how to do this.
541+
<doc:CloudKitSync#Setting-up-a-SyncEngine> for more information on how to do this.
542542

543543
With that done you can use the ``StructuredQueriesCore/PrimaryKeyedTable/syncMetadataID`` property
544544
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:
705705
706706
If you have an existing app deployed to the app store using SQLite, then you may have to perform
707707
a migration on your schema to prepare it for synchronization. The most important requirement
708-
detailed above in <doc:CloudKit#Designing-your-schema-with-synchronization-in-mind> is that
708+
detailed above in <doc:CloudKitSync#Designing-your-schema-with-synchronization-in-mind> is that
709709
all tables _must_ have a primary key, and all primary keys must be globally unique identifiers
710710
such as UUID, and cannot be simple auto-incrementing integers.
711711

Sources/SQLiteData/Documentation.docc/Articles/ComparisonWithSwiftData.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -931,17 +931,17 @@ SQLiteData has only one of these limitations:
931931
* Unique constraints on columns (except for the primary key) cannot be upheld on a distributed
932932
schema. For example, if you have a `Tag` table with a unique `title` column, then what
933933
are you to do if two different devices create a tag with the title "family" at the same time?
934-
See <doc:CloudKit#Uniqueness-constraints> for more information.
934+
See <doc:CloudKitSync#Uniqueness-constraints> for more information.
935935
* Columns on freshly created tables do not need to have default values or be nullable. Only
936936
newly added columns to existing tables need to either be nullable or have a default. See
937-
<doc:CloudKit#Adding-columns> for more info.
937+
<doc:CloudKitSync#Adding-columns> for more info.
938938
* Relationships on freshly created do not need to be nullable. Only newly added columns to
939-
existing tables need to be nullable. See <doc:CloudKit#Adding-columns> for more info.
939+
existing tables need to be nullable. See <doc:CloudKitSync#Adding-columns> for more info.
940940

941941
For more information about requirements of your schema in order to use CloudKit synchronization,
942-
see <doc:CloudKit#Designing-your-schema-with-synchronization-in-mind> and
943-
<doc:CloudKit#Backwards-compatible-migrations>, and for more general
944-
information about CloudKit synchronization, see <doc:CloudKit>.
942+
see <doc:CloudKitSync#Designing-your-schema-with-synchronization-in-mind> and
943+
<doc:CloudKitSync#Backwards-compatible-migrations>, and for more general
944+
information about CloudKit synchronization, see <doc:CloudKitSync>.
945945

946946
### Supported Apple platforms
947947

Sources/SQLiteData/Documentation.docc/Articles/ManuallyMigratingPrimaryKeys.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ struct ReminderTag {
128128
```
129129

130130
And a migration must be run to add that column to the table. However, you must perform a multi-step
131-
migration similar to what is described above in <doc:CloudKit#Convert-Int-primary-keys-to-UUID>.
131+
migration similar to what is described above in <doc:CloudKitSync#Convert-Int-primary-keys-to-UUID>.
132132
You must 1) create a new table with the new primary key column, 2) copy data from the old table
133133
to the new table, 3) delete the old table, and finally 4) rename the new table.
134134

Sources/SQLiteData/Documentation.docc/Articles/PreparingDatabase.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,4 @@ func feature() {
303303

304304
If you plan on synchronizing your local database to CloudKit so that your user's data is available
305305
on all of their devices, there is an additional step you must take. See
306-
<doc:CloudKit> for more information.
306+
<doc:CloudKitSync> for more information.

Sources/SQLiteData/Documentation.docc/SQLiteData.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ struct MyApp: App {
204204
```
205205

206206
> For more information on synchronizing the database to CloudKit and sharing records with iCloud
207-
> users, see <doc:CloudKit>.
207+
> users, see <doc:CloudKitSync>.
208208
209209
This is all you need to know to get started with SQLiteData, but there's much more to learn. Read
210210
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.
311311

312312
### CloudKit synchronization and sharing
313313

314-
- <doc:CloudKit>
314+
- <doc:CloudKitSync>
315315
- <doc:CloudKitSharing>
316316
- ``SyncEngine``
317317
- ``SyncEngineDelegate``

0 commit comments

Comments
 (0)