Skip to content

Commit 0b11498

Browse files
stephencelismbrandonwrobfeldmannNarsailDavid Moeller
authored
CloudKit Synchronization + Sharing (pointfreeco#112)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * a test for deletion * Fixes pointfreeco#32 failure to compile in release configuration * wip * Fix a reference violation. * wip * add test * wip * wip * format/ * wip * wip * fix tests * fix tests * add a test * wip * wip * wip * wip * wip * simplify * wip * Delete records in groups. * wip * wip * wip * some doc updates * wip * update package * Support zones in mock cloud database. * wip * wip * wip * wip * wip * wip * wip * wip * wip * fix dep * wip * wip * Apply suggestion from @stephencelis Co-authored-by: Stephen Celis <stephen@stephencelis.com> * Better way to process record/database changes in tests. * Fail if we process changes without there being any changes. * merge fix * fix import * Allow sync engine to be initalized with a zone. * wip * Updates swift-structured-queries * 'Float16' is unavailable in Mac Catalyst While Xcode’s error says 'Float16' is unavailable in Mac Catalyst, the docs suggest it is available on Apple silicon, and unavailable on Intel when targeting macOS. Checking for Intel allows archiving for catalyst. * Account management. * Handle account lifecycle events. * wip * Support account status in mock cloud kit. * wip * wip * Derive metadatabase URL from database URL * wip * wip * wip * updates to docs * write test for certain ck scenario * wip * Revert "wip" This reverts commit ba77edd. * wip * get rid of uuid zeros * docs * wip * wip * Public method for fetching metadata. * Revert "Public method for fetching metadata." This reverts commit 6519f17. * Public method for fetching metadata. * Apply suggestions from code review * wip * wip; * Update Tests/SharingGRDBTests/Internal/BaseCloudKitTests.swift Co-authored-by: Stephen Celis <stephen@stephencelis.com> * Update Tests/SharingGRDBTests/CloudKitTests/AccountLifecycleTests.swift Co-authored-by: Stephen Celis <stephen@stephencelis.com> * wip * fix * fix test * wip * wip * wip * todos * Support in-memory metadatabase. * wip * wip * fix merge * Improve `SyncEngine.init` (pointfreeco#113) * Improve `SyncEngine.init` - Infer default cloud container using SwiftData - Statically require string identifier primary keyed tables * wip * wip * fix test * wip * wip * wip * Regenerate macro code for CloudKit tables. (pointfreeco#120) * Regenerate macro code for CloudKit tables. * formatting * fix warnings * fix typo * wip * Add Tagged support to SharingGRDB * Add uniqueness to tag titles. (pointfreeco#119) * Add uniqueness to tag titles. * wip * wip * wip * wip * wip * wip * Improve un-sharing records. * Add Available Permissions (pointfreeco#123) Co-authored-by: David Moeller <david.moller@sensorfact.nl> * Make sync engine play nicely with tests (pointfreeco#124) * wip * control dates internally * wip * wip * add a test * wip * Handling more CloudKit sharing edge cases (pointfreeco#126) * wip * wip * wip * wip * wip * wip * wip * wip * wip * clean up * wip * wip * wip * wip * Making sharing more testable (pointfreeco#128) * Beginnings of making sharing more testable. * wip * wip * wip * wip * fixes * wip * More sharing tests and improvements (pointfreeco#129) * Fixing more sharing edge cases with tests. * wip * wip * wip * wip * dont emit error when unsharing unshared record. * wip * fix --------- Co-authored-by: Stephen Celis <stephen@stephencelis.com> * Test for generated column behavior. (pointfreeco#136) * Test for generated column behavior. * snap * wip * Revert examples * wip * wip * wip * Fix upsert for tables that only have a primary key. * add some tests * Add `SyncEngine.{start,stop,isRunning}` (pointfreeco#142) * Add `SyncEngine.{start,stop}()` * wip * wip * wip * wip * wip * wip * wip * Remove unneeded sleeps * format --------- Co-authored-by: Brandon Williams <mbrandonw@hey.com> * CloudKit: Compile tests on non-macOS platforms (pointfreeco#144) * CloudKit: Compile tests on non-macOS platforms * Bump GRDB requirement * wip * wip * wip * Minimize exports * wip * wip * Remove trigger check * Some permission fixes (pointfreeco#147) * Fix up some permission loopholes. * wip * wip * clean up * Document scene delegate methods for accepting shares. (pointfreeco#148) * Document scene delegate methods for accepting shares. * Update Sources/SharingGRDBCore/Documentation.docc/Articles/CloudKitSharing.md --------- Co-authored-by: Stephen Celis <stephen@stephencelis.com> * Clean up some tests * Add link to apple docs for deploying schema * update docs wrt SyncEngine.isSychnronizing * Delete CK record when updating primary key. (pointfreeco#151) * Delete CK record when updating primary key. * wip * wip * Validate foreign keys point to synchronized tables. (pointfreeco#152) * wip * Lots of updates to docs. (pointfreeco#153) * Lots of updates to docs. * db error * fixes * Beginning of renaming package to SQLiteData. * Rename more things. * wip * flatten * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * fix test * wip * More docs (pointfreeco#154) * More docs * wip * wip * wip * wip * Format SQLiteData entry in README.md table * wip * Update Sources/SQLiteData/CloudKit/CloudKitSharing.swift * Update Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md * Update Sources/SQLiteData/CloudKit/SyncMetadata.swift * Format SQLiteData performance table for clarity --------- Co-authored-by: Stephen Celis <stephen@stephencelis.com> * Fetch pending record zone changes through metadatabase (pointfreeco#155) * wip * docs on uniqueness * Update README.md * wip * Triage some todos (pointfreeco#157) * Triage todos' * wip * wip * wip * wip * wip * CloudKit docs organization (pointfreeco#158) * wip * wip * wip * wip * wip * wip * wip * Add observation to `SyncEngine.isRunning` (pointfreeco#159) * Add observation to `SyncEngine.isRunning` * wip * wip * wip * wip * wip * fix * finish test * Add test for cyclic schemas' * docs on PK migration * wip * docs * Audit reading from metadatabase (pointfreeco#161) * Audit metadatabase * convert more userDatabase to metadatabase * wip * wip * wip * wip * format * wip * docs * CloudKit sqlite data pragmas (pointfreeco#162) * CloudKit: Use virtual table helpers Let's prefer our builder over SQL strings when it's easy to do so. * wip * wip * wip * wip * Move menu into toolbar hstack. * Fix tests for iOS. (pointfreeco#165) * Optimize a few sync metadata queries (pointfreeco#169) Let's select/decode just the data we need. * More efficient joins to SyncMetadata table (pointfreeco#163) * Improve tools for joining SyncMetadata table. * wip * wip * wip * wip * wip * wip --------- Co-authored-by: Stephen Celis <stephen@stephencelis.com> * Make upsertFromServerRecord async. (pointfreeco#170) Co-authored-by: Brandon Williams <mbrandonw@hey.com> * Cloudkit sqlite data send changes background (pointfreeco#167) * Immediately send pending changes when backgrounding app. * wip; * Revert "wip;" This reverts commit fb68ce7. * wip * Revert "Revert "wip;"" This reverts commit 2ddfe3d. * wip * wip * wip * wip * wip * wip * wip * Upload unknown records to CloudKit on sign in. (pointfreeco#168) * Upload unknown records to CloudKit on sign in. * fix tests * wip * wip * wip * merge fix * wip; * Fix sign out. (pointfreeco#164) * Fix sign out. * wip * fix * Apply suggestions from code review * merge fix --------- Co-authored-by: Stephen Celis <stephen@stephencelis.com> * fixes * wip * wip * wip * wip * wip * Add `database` for context-sensitive provisioning (pointfreeco#175) * Add `database` for context-sensitive provisioning This small helper will take live/test/preview into account to simplify how folks bootstrap their databases. * wip * wip * Update DefaultDatabase.swift * wip * another way to get container identifier * Modernize SyncUps and add iCloud sync. (pointfreeco#176) * Modernize SyncUps and add iCloud sync. * fix tests * Send sync engine changes on resign foreground. (pointfreeco#177) * Send changes when resigining active. * fix * wip * Bring back other demo apps. (pointfreeco#178) * Bring back other demo apps. * wip * Rename more references to sqlite-data * wip * wip * wip * go back to getting cloudkit container identifier from swiftdata * wip * A few fixes for Xcode 26. (pointfreeco#180) * A few fixes for Xcode 26. * wip * wip * Throw error when changing zones for existing record (pointfreeco#179) * Throw error when moving records between zones. * wip * wip * wip * wip * Fix floating point bug (pointfreeco#183) * Fix floating point comparison bug. * wip * wip * wip; * wipa * wip * wip * wipa * Fix Examples/README: project reference (pointfreeco#186) * Update README.md - Replace the removed `SharingGRDB.xcworkspace` reference with `Examples.xcodeproj`. - Explain that each example app is worked on individually by selecting its scheme in Xcode. * Update README.md * Perform multiple upserts in a single transaction. (pointfreeco#185) * Perform multiple upserts in a single transaction. * wip * wip * wip * wip * Only reference UIApplication on iOS (pointfreeco#190) * Modernize reminders (pointfreeco#184) * Modernize reminders with triggers. * wip; * wip * wip; * wip * wip * wip * Update Examples/Reminders/Schema.swift * fix tests --------- Co-authored-by: Stephen Celis <stephen@stephencelis.com> * Add zone to sync metadata (pointfreeco#187) * Store zone data in sync metadata. * wip * wip * wip * wip * wip * wip * Support moving records across zones (pointfreeco#188) * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * clean up * fix snapshot * wip * wip * wip * wip * support moving shares between zones and receiving saves before deletes * wip * Update Sources/SQLiteData/CloudKit/Internal/Triggers.swift * wip * wip * wip * format * wip; --------- Co-authored-by: Stephen Celis <stephen@stephencelis.com> --------- Co-authored-by: Stephen Celis <stephen@stephencelis.com> * wip * Fix zone deletion (pointfreeco#192) * wip * wip * wip --------- Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com> Co-authored-by: Brandon Williams <mbrandonw@hey.com> Co-authored-by: Rob Feldmann <me@robfeldmann.com> Co-authored-by: David Moeller <david_moeller@me.com> Co-authored-by: David Moeller <david.moller@sensorfact.nl> Co-authored-by: Yoshinori Imajo <y.imajo@gmail.com> Co-authored-by: Michael Thingnes <thimic@users.noreply.github.com>
1 parent 368fb3c commit 0b11498

185 files changed

Lines changed: 23045 additions & 2476 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/ISSUE_TEMPLATE/bug_report.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ body:
2727
required: false
2828
- label: If possible, I've reproduced the issue using the `main` branch of this package.
2929
required: false
30-
- label: This issue hasn't been addressed in an [existing GitHub issue](https://github.com/pointfreeco/sharing-grdb/issues) or [discussion](https://github.com/pointfreeco/sharing-grdb/discussions).
30+
- label: This issue hasn't been addressed in an [existing GitHub issue](https://github.com/pointfreeco/sqlite-data/issues) or [discussion](https://github.com/pointfreeco/sqlite-data/discussions).
3131
required: true
3232
- type: textarea
3333
attributes:

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ blank_issues_enabled: false
22

33
contact_links:
44
- name: Project Discussion
5-
url: https://github.com/pointfreeco/sharing-grdb/discussions
6-
about: SharingGRDB Q&A, ideas, and more
5+
url: https://github.com/pointfreeco/sqlite-data/discussions
6+
about: SQLiteData Q&A, ideas, and more
77
- name: Documentation
8-
url: https://pointfreeco.github.io/sharing-grdb/main/documentation/sharinggrdb/
9-
about: Read Sharing's documentation
8+
url: https://swiftpackageindex.com/pointfreeco/sqlite-data/~/documentation/sqlitedata
9+
about: Read SQLiteData's documentation
1010
- name: Videos
1111
url: https://www.pointfree.co/
12-
about: Watch videos to get a behind-the-scenes look at how SharingGRDB was motivated and built
12+
about: Watch videos to get a behind-the-scenes look at how SQLiteData was motivated and built
1313
- name: Slack
1414
url: https://www.pointfree.co/slack-invite
1515
about: Community chat

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@ jobs:
3636
config: ['debug']
3737
scheme: ['Reminders', 'CaseStudies', 'SyncUps']
3838
runs-on: macos-15
39+
continue-on-error: true
3940
steps:
4041
- uses: actions/checkout@v4
4142
- name: Select Xcode ${{ matrix.xcode }}
4243
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
44+
- name: List devices available
45+
run: xcrun simctl list --json devices available 'iPhone'
4346
- name: xcodebuild ${{ matrix.scheme }}
4447
run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="${{ matrix.scheme }}" xcodebuild-raw
4548
- name: Output test failures

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
env:
1818
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_PROJECT_CHANNEL_WEBHOOK_URL }}
1919
with:
20-
text: sharing-grdb ${{ github.event.release.tag_name }} has been released.
20+
text: sqlite-data ${{ github.event.release.tag_name }} has been released.
2121
blocks: |
2222
[
2323
{
2424
"type": "header",
2525
"text": {
2626
"type": "plain_text",
27-
"text": "sharing-grdb ${{ github.event.release.tag_name}}"
27+
"text": "sqlite-data ${{ github.event.release.tag_name}}"
2828
}
2929
},
3030
{
@@ -56,14 +56,14 @@ jobs:
5656
env:
5757
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }}
5858
with:
59-
text: sharing-grdb ${{ github.event.release.tag_name }} has been released.
59+
text: sqlite-data ${{ github.event.release.tag_name }} has been released.
6060
blocks: |
6161
[
6262
{
6363
"type": "header",
6464
"text": {
6565
"type": "plain_text",
66-
"text": "sharing-grdb ${{ github.event.release.tag_name}}"
66+
"text": "sqlite-data ${{ github.event.release.tag_name}}"
6767
}
6868
},
6969
{

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ xcuserdata/
55
DerivedData/
66
.swiftpm
77
.netrc
8+
*.orig
89
*.sqlite
910
*.xcresult

‎.spi.yml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ version: 1
22
builder:
33
configs:
44
- documentation_targets:
5-
- SharingGRDBCore
6-
- SharingGRDB
7-
- StructuredQueriesGRDB
8-
- StructuredQueriesGRDBCore
5+
- SQLiteData
96
custom_documentation_parameters: [--enable-experimental-overloaded-symbol-presentation]
7+
platform: ios

‎Examples/CaseStudies/Animations.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import SharingGRDB
1+
import SQLiteData
22
import SwiftUI
33

44
struct AnimationsCaseStudy: SwiftUICaseStudy {
@@ -60,7 +60,7 @@ extension DatabaseWriter where Self == DatabaseQueue {
6060
CREATE TABLE "facts" (
6161
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
6262
"body" TEXT NOT NULL
63-
)
63+
) STRICT
6464
"""
6565
)
6666
.execute(db)

‎Examples/CaseStudies/App.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import SharingGRDB
1+
import SQLiteData
22
import SwiftUI
33

44
@main

‎Examples/CaseStudies/DynamicQuery.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import SharingGRDB
1+
import SQLiteData
22
import SwiftUI
33

44
struct DynamicQueryDemo: SwiftUICaseStudy {
@@ -113,7 +113,7 @@ extension DatabaseWriter where Self == DatabaseQueue {
113113
CREATE TABLE "facts" (
114114
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
115115
"body" TEXT NOT NULL
116-
)
116+
) STRICT
117117
"""
118118
)
119119
.execute(db)

‎Examples/CaseStudies/ObservableModelDemo.swift‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import SharingGRDB
1+
import SQLiteData
22
import SwiftUI
33

44
struct ObservableModelDemo: SwiftUICaseStudy {
55
let readMe = """
6-
This demonstrates how to use the `fetchAll` and `fetchOne` tools in an @Observable model. \
6+
This demonstrates how to use the `@FetchAll` and `@FetchOne` tools in an @Observable model. \
77
In SwiftUI, the `@Query` macro only works when installed directly in a SwiftUI view, and \
88
cannot be used outside of views.
99
@@ -100,7 +100,7 @@ extension DatabaseWriter where Self == DatabaseQueue {
100100
CREATE TABLE "facts" (
101101
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
102102
"body" TEXT NOT NULL
103-
)
103+
) STRICT
104104
"""
105105
)
106106
.execute(db)

0 commit comments

Comments
 (0)