Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Sources/SQLiteData/CloudKit/IdentifierStringConvertible.swift
Original file line number Diff line number Diff line change
@@ -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 }
Expand Down
1 change: 0 additions & 1 deletion Sources/SQLiteData/CloudKit/Internal/Triggers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
Expand Down
13 changes: 4 additions & 9 deletions Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CloudKit synchronization
# Getting started with CloudKit

Learn how to seamlessly add CloudKit synchronization to your SQLiteData application.

Expand Down Expand Up @@ -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.

<!--
### Developing in the simulator

<!-- TODO: talk about simulator push restrictions -->


## Topics

### Go deeper

- <doc:CloudKitSharing>
TODO: talk about simulator push restrictions
-->
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions Sources/SQLiteData/Documentation.docc/Extensions/Database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ``GRDB/Database``

## Topics

### Seeding model data

- ``seed(_:)``

### User-defined functions

- ``add(function:)``
- ``remove(function:)``

### Querying CloudKit metadata

- ``attachMetadatabase(containerIdentifier:)``
Original file line number Diff line number Diff line change
@@ -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``
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ``CloudKit/CKRecord/SystemFieldsRepresentation``
28 changes: 16 additions & 12 deletions Sources/SQLiteData/Documentation.docc/SQLiteData.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,27 +277,31 @@ with SQLite to take full advantage of GRDB and SQLiteData.
- <doc:Observing>
- <doc:PreparingDatabase>
- <doc:DynamicQueries>
- <doc:CloudKit>
- <doc:ComparisonWithSwiftData>

### 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(_:)``
- <doc:CloudKit>
- <doc:CloudKitSharing>
- ``SyncEngine``
- ``Dependencies/DependencyValues/defaultSyncEngine``
- ``IdentifierStringConvertible``
- ``SyncMetadata``
- ``SharedRecord``
Loading