Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
669 commits
Select commit Hold shift + click to select a range
f3a9c5a
wip
stephencelis Jul 14, 2025
a476f10
wip
stephencelis Jul 14, 2025
aab1ce9
wip
stephencelis Jul 14, 2025
9a0284d
wip
stephencelis Jul 14, 2025
18a05a9
wip
stephencelis Jul 14, 2025
a25f75f
wip
stephencelis Jul 14, 2025
7e6c119
wip
stephencelis Jul 14, 2025
980fbec
wip
stephencelis Jul 14, 2025
692de5f
wip
stephencelis Jul 14, 2025
4894a7a
Merge pull request #28 from pointfreeco/support-transactions-in-mock-…
mbrandonw Jul 15, 2025
edd0e68
Merge pull request #27 from pointfreeco/fix-some-todos
mbrandonw Jul 15, 2025
ba3f06d
wip
stephencelis Jul 15, 2025
e481edf
wip
stephencelis Jul 15, 2025
454809a
Merge pull request #29 from pointfreeco/weaken-primary-keys
stephencelis Jul 15, 2025
9dbb353
wip
mbrandonw Jul 16, 2025
eb6a859
wip
mbrandonw Jul 16, 2025
5c7abc1
a test for deletion
mbrandonw Jul 16, 2025
2a08830
Fixes #32 failure to compile in release configuration
robfeldmann Jul 16, 2025
7e0a3fb
Merge pull request #33 from pointfreeco/32-failure-to-compile-in-rele…
mbrandonw Jul 16, 2025
e97b68f
wip
mbrandonw Jul 16, 2025
e04ad1b
Fix a reference violation.
mbrandonw Jul 16, 2025
438f25f
wip
mbrandonw Jul 16, 2025
1999c2d
add test
mbrandonw Jul 16, 2025
72fdc5a
wip
mbrandonw Jul 16, 2025
800b53b
wip
stephencelis Jul 16, 2025
5d8fbcf
format/
mbrandonw Jul 16, 2025
ff131f4
wip
mbrandonw Jul 16, 2025
1dd92aa
wip
mbrandonw Jul 16, 2025
a0d9aba
fix tests
mbrandonw Jul 16, 2025
47c04ba
fix tests
mbrandonw Jul 16, 2025
94d68c6
Merge remote-tracking branch 'origin/cloudkit' into fk-constraints-pt2
mbrandonw Jul 16, 2025
a5a9a0b
add a test
mbrandonw Jul 16, 2025
d76fd12
Merge pull request #31 from pointfreeco/fk-constraints-pt2
mbrandonw Jul 16, 2025
452a107
Merge remote-tracking branch 'origin/cloudkit' into reference-violati…
mbrandonw Jul 16, 2025
1b50271
wip
mbrandonw Jul 16, 2025
a54e329
wip
mbrandonw Jul 16, 2025
1e82780
wip
mbrandonw Jul 17, 2025
e004f32
wip
mbrandonw Jul 17, 2025
6bef271
wip
mbrandonw Jul 17, 2025
9f4510f
Merge pull request #34 from pointfreeco/reference-violation-fix
mbrandonw Jul 17, 2025
96dae93
simplify
mbrandonw Jul 17, 2025
838690d
wip
mbrandonw Jul 17, 2025
b729883
Delete records in groups.
mbrandonw Jul 17, 2025
f846e5f
wip
mbrandonw Jul 17, 2025
0116805
wip
mbrandonw Jul 17, 2025
986a984
wip
mbrandonw Jul 17, 2025
7d2c5c7
some doc updates
mbrandonw Jul 17, 2025
8b599b3
wip
mbrandonw Jul 17, 2025
6b9dcf3
Merge pull request #35 from pointfreeco/delete-in-groups
mbrandonw Jul 17, 2025
f920862
update package
mbrandonw Jul 17, 2025
6c977ee
Support zones in mock cloud database.
mbrandonw Jul 18, 2025
5b9670b
wip
mbrandonw Jul 18, 2025
5a1611a
wip
mbrandonw Jul 18, 2025
5ad1d6d
wip
mbrandonw Jul 18, 2025
de7788e
wip
mbrandonw Jul 18, 2025
621b95b
wip
mbrandonw Jul 18, 2025
0f37eac
wip
mbrandonw Jul 18, 2025
c9ea77c
wip
mbrandonw Jul 18, 2025
d290aff
wip
mbrandonw Jul 18, 2025
293e78b
wip
mbrandonw Jul 18, 2025
704945e
fix dep
mbrandonw Jul 18, 2025
9362571
Merge remote-tracking branch 'origin/cloudkit' into mock-database-sup…
mbrandonw Jul 18, 2025
4efa33f
wip
mbrandonw Jul 18, 2025
4f3eca2
wip
mbrandonw Jul 18, 2025
93dac4d
Apply suggestion from @stephencelis
mbrandonw Jul 18, 2025
47590b7
Better way to process record/database changes in tests.
mbrandonw Jul 18, 2025
bd99783
Fail if we process changes without there being any changes.
mbrandonw Jul 18, 2025
9b74ca4
Merge pull request #36 from pointfreeco/mock-database-support-zones
mbrandonw Jul 18, 2025
31f0334
merge fix
mbrandonw Jul 18, 2025
bed5e54
Merge remote-tracking branch 'origin/cloudkit' into clean-up-process-…
mbrandonw Jul 18, 2025
6ae9e85
fix import
mbrandonw Jul 18, 2025
54d09a2
Merge pull request #37 from pointfreeco/clean-up-process-batch
mbrandonw Jul 18, 2025
a73523e
Allow sync engine to be initalized with a zone.
mbrandonw Jul 18, 2025
5535032
wip
mbrandonw Jul 18, 2025
f1905bf
Updates swift-structured-queries
robfeldmann Jul 18, 2025
e64a7be
'Float16' is unavailable in Mac Catalyst
robfeldmann Jul 18, 2025
f3d4f5d
Merge pull request #39 from pointfreeco/catalyst
mbrandonw Jul 19, 2025
ed3ad24
Account management.
mbrandonw Jul 19, 2025
f498445
Handle account lifecycle events.
mbrandonw Jul 19, 2025
fa726a5
Merge remote-tracking branch 'origin/cloudkit' into account-management
mbrandonw Jul 19, 2025
d884c56
wip
mbrandonw Jul 22, 2025
05236f0
Merge pull request #38 from pointfreeco/localize-default-zone
mbrandonw Jul 22, 2025
dc96d09
Support account status in mock cloud kit.
mbrandonw Jul 22, 2025
c289c22
wip
mbrandonw Jul 22, 2025
dc0a01b
wip
mbrandonw Jul 22, 2025
48cc993
Derive metadatabase URL from database URL
stephencelis Jul 25, 2025
27f19b8
wip
mbrandonw Jul 27, 2025
bf455f7
Merge pull request #40 from pointfreeco/support-account-state-in-mocks
mbrandonw Jul 27, 2025
b2ee07f
Merge remote-tracking branch 'origin/cloudkit' into account-management
mbrandonw Jul 27, 2025
f375f23
wip
mbrandonw Jul 27, 2025
1e6cb14
wip
mbrandonw Jul 28, 2025
8517596
wip
mbrandonw Jul 28, 2025
6a0defb
updates to docs
mbrandonw Jul 29, 2025
9c7a3f9
write test for certain ck scenario
mbrandonw Jul 29, 2025
ba77edd
wip
mbrandonw Jul 29, 2025
dc25a4a
Revert "wip"
mbrandonw Jul 29, 2025
ce52b36
wip
mbrandonw Jul 29, 2025
f0c9dbe
get rid of uuid zeros
mbrandonw Jul 29, 2025
de11950
docs
mbrandonw Jul 29, 2025
7abda98
wip
mbrandonw Jul 29, 2025
91d9ac9
wip
mbrandonw Jul 30, 2025
6519f17
Public method for fetching metadata.
mbrandonw Jul 30, 2025
52d05c0
Revert "Public method for fetching metadata."
mbrandonw Jul 30, 2025
02563fd
Public method for fetching metadata.
mbrandonw Jul 30, 2025
72797df
Apply suggestions from code review
stephencelis Jul 30, 2025
f1ee1bd
Merge pull request #43 from pointfreeco/improve-delete-efficiency
stephencelis Jul 30, 2025
e37a14e
wip
stephencelis Jul 30, 2025
a077922
wip;
mbrandonw Jul 30, 2025
a204036
Merge pull request #44 from pointfreeco/public-metadata-find
mbrandonw Jul 30, 2025
88d9119
Merge pull request #41 from pointfreeco/metadatabase-location
stephencelis Jul 30, 2025
f269f87
Update Tests/SharingGRDBTests/Internal/BaseCloudKitTests.swift
mbrandonw Jul 30, 2025
d781ff7
Update Tests/SharingGRDBTests/CloudKitTests/AccountLifecycleTests.swift
mbrandonw Jul 30, 2025
630b94a
Merge remote-tracking branch 'origin/cloudkit' into account-management
mbrandonw Jul 30, 2025
358509e
Merge pull request #42 from pointfreeco/account-management
mbrandonw Jul 30, 2025
cd374bd
wip
stephencelis Jul 30, 2025
e120165
fix
mbrandonw Jul 30, 2025
a518efe
fix test
mbrandonw Jul 30, 2025
410bade
Merge remote-tracking branch 'origin/cloudkit' into error-handling
stephencelis Jul 31, 2025
f1dca51
wip
stephencelis Jul 31, 2025
908fe9a
wip
stephencelis Jul 31, 2025
565220b
wip
stephencelis Jul 31, 2025
551efae
todos
mbrandonw Aug 1, 2025
0714578
Merge pull request #45 from pointfreeco/error-handling
stephencelis Aug 1, 2025
a46c74f
Support in-memory metadatabase.
mbrandonw Aug 1, 2025
0db8e2b
wip
mbrandonw Aug 1, 2025
240e4ad
wip
mbrandonw Aug 1, 2025
24df898
Merge remote-tracking branch 'origin/cloudkit' into in-memory-metadat…
mbrandonw Aug 3, 2025
ac127aa
fix merge
mbrandonw Aug 3, 2025
939bf67
Merge pull request #46 from pointfreeco/in-memory-metadatabase
mbrandonw Aug 3, 2025
20e9cd6
Improve `SyncEngine.init` (#113)
stephencelis Aug 5, 2025
97eb047
Merge branch 'main' into cloudkit
stephencelis Aug 5, 2025
fc2e9c5
fix test
stephencelis Aug 5, 2025
53fb7fb
wip
stephencelis Aug 5, 2025
5d9290f
wip
stephencelis Aug 5, 2025
29930e7
wip
stephencelis Aug 8, 2025
0eeb686
Merge remote-tracking branch 'origin/main' into cloudkit
mbrandonw Aug 11, 2025
ccb2444
Regenerate macro code for CloudKit tables. (#120)
mbrandonw Aug 12, 2025
49f4dac
Add Tagged support to SharingGRDB
stephencelis Aug 12, 2025
d256118
Add uniqueness to tag titles. (#119)
mbrandonw Aug 12, 2025
d907238
Improve un-sharing records.
mbrandonw Aug 12, 2025
e751e8d
Add Available Permissions (#123)
Narsail Aug 13, 2025
4ed79c4
Make sync engine play nicely with tests (#124)
mbrandonw Aug 13, 2025
b250b76
Handling more CloudKit sharing edge cases (#126)
mbrandonw Aug 15, 2025
0738cce
Making sharing more testable (#128)
mbrandonw Aug 16, 2025
0f6e7c4
More sharing tests and improvements (#129)
mbrandonw Aug 18, 2025
a5d141a
Merge branch 'main' into cloudkit
stephencelis Aug 20, 2025
0a3762a
Test for generated column behavior. (#136)
mbrandonw Aug 22, 2025
05c7864
Merge remote-tracking branch 'origin/main' into cloudkit
mbrandonw Aug 24, 2025
b94fca6
wip
stephencelis Aug 26, 2025
fe8fa71
Merge remote-tracking branch 'origin/main' into cloudkit
stephencelis Aug 26, 2025
77f8419
Revert examples
stephencelis Aug 26, 2025
44518a4
wip
stephencelis Aug 26, 2025
42e102d
wip
stephencelis Aug 26, 2025
45e2565
wip
stephencelis Aug 26, 2025
fbbd16a
Fix upsert for tables that only have a primary key.
mbrandonw Aug 28, 2025
ef7f381
add some tests
mbrandonw Aug 29, 2025
52f4724
Add `SyncEngine.{start,stop,isRunning}` (#142)
stephencelis Aug 29, 2025
879d79f
CloudKit: Compile tests on non-macOS platforms (#144)
stephencelis Sep 1, 2025
e95e09d
Minimize exports
stephencelis Sep 1, 2025
b27266c
wip
stephencelis Sep 1, 2025
5504a22
Merge remote-tracking branch 'origin/main' into cloudkit
stephencelis Sep 1, 2025
542dd28
wip
stephencelis Sep 1, 2025
d407c68
Remove trigger check
stephencelis Sep 1, 2025
4ca296d
Some permission fixes (#147)
mbrandonw Sep 2, 2025
680e3ee
Document scene delegate methods for accepting shares. (#148)
mbrandonw Sep 2, 2025
6113087
Clean up some tests
mbrandonw Sep 2, 2025
5bfe610
Add link to apple docs for deploying schema
mbrandonw Sep 2, 2025
4ff4338
update docs wrt SyncEngine.isSychnronizing
mbrandonw Sep 2, 2025
df0ef93
Delete CK record when updating primary key. (#151)
mbrandonw Sep 2, 2025
2928dcc
Validate foreign keys point to synchronized tables. (#152)
mbrandonw Sep 2, 2025
304c747
Merge remote-tracking branch 'origin/main' into cloudkit
stephencelis Sep 2, 2025
86cf754
wip
stephencelis Sep 2, 2025
9d8def0
Lots of updates to docs. (#153)
mbrandonw Sep 2, 2025
c1b9383
Beginning of renaming package to SQLiteData.
mbrandonw Sep 2, 2025
a1cb207
Rename more things.
mbrandonw Sep 2, 2025
69ac98d
wip
mbrandonw Sep 2, 2025
ebf5076
flatten
stephencelis Sep 2, 2025
396ad9f
wip
stephencelis Sep 2, 2025
7cf7777
wip
stephencelis Sep 2, 2025
ba55ab3
wip
stephencelis Sep 2, 2025
48d45a2
wip
stephencelis Sep 2, 2025
0507aa5
wip
stephencelis Sep 2, 2025
5801e1e
wip
stephencelis Sep 2, 2025
35cc9b3
wip
stephencelis Sep 2, 2025
86df023
wip
stephencelis Sep 2, 2025
8cd6d0e
wip
stephencelis Sep 2, 2025
d14c3ae
wip
stephencelis Sep 2, 2025
f5e9707
wip
stephencelis Sep 2, 2025
d8e9ed6
wip
stephencelis Sep 3, 2025
47f3521
wip
stephencelis Sep 3, 2025
7f003b4
fix test
mbrandonw Sep 3, 2025
cbe5162
wip
stephencelis Sep 3, 2025
a669450
More docs (#154)
mbrandonw Sep 3, 2025
543684b
Fetch pending record zone changes through metadatabase (#155)
stephencelis Sep 3, 2025
16b423b
Merge branch 'cloudkit' into cloudkit-sqlite-data
stephencelis Sep 3, 2025
7fd7902
wip
stephencelis Sep 3, 2025
2676910
docs on uniqueness
mbrandonw Sep 3, 2025
d614c99
Update README.md
stephencelis Sep 4, 2025
1c4d307
wip
stephencelis Sep 4, 2025
fda2cde
Triage some todos (#157)
mbrandonw Sep 4, 2025
14370ea
CloudKit docs organization (#158)
stephencelis Sep 4, 2025
3433038
wip
stephencelis Sep 4, 2025
8bb1037
wip
stephencelis Sep 4, 2025
900ec10
wip
stephencelis Sep 4, 2025
11e8e91
wip
stephencelis Sep 4, 2025
0d6f504
Add observation to `SyncEngine.isRunning` (#159)
stephencelis Sep 5, 2025
abba0a7
wip
stephencelis Sep 5, 2025
b3eaf7a
fix
mbrandonw Sep 5, 2025
ae6fea4
finish test
mbrandonw Sep 5, 2025
3163c53
Add test for cyclic schemas'
mbrandonw Sep 5, 2025
ee9e934
docs on PK migration
mbrandonw Sep 5, 2025
ee60984
wip
mbrandonw Sep 5, 2025
f718e3d
docs
mbrandonw Sep 5, 2025
855025a
Audit reading from metadatabase (#161)
mbrandonw Sep 5, 2025
61c4fc5
docs
mbrandonw Sep 6, 2025
e93aeb8
CloudKit sqlite data pragmas (#162)
stephencelis Sep 6, 2025
1a173d8
Move menu into toolbar hstack.
mbrandonw Sep 6, 2025
56d34fb
Fix tests for iOS. (#165)
mbrandonw Sep 8, 2025
aa23b59
Optimize a few sync metadata queries (#169)
stephencelis Sep 8, 2025
ef8acf4
More efficient joins to SyncMetadata table (#163)
mbrandonw Sep 8, 2025
a610e56
Make upsertFromServerRecord async. (#170)
stephencelis Sep 8, 2025
adfdaa8
Cloudkit sqlite data send changes background (#167)
mbrandonw Sep 8, 2025
1b60297
Upload unknown records to CloudKit on sign in. (#168)
mbrandonw Sep 8, 2025
0d94e88
Fix sign out. (#164)
mbrandonw Sep 8, 2025
0b7f510
Merge remote-tracking branch 'origin/main' into cloudkit
stephencelis Sep 8, 2025
f6a57a3
Merge remote-tracking branch 'origin/cloudkit' into cloudkit-sqlite-data
stephencelis Sep 8, 2025
094ec7e
fixes
mbrandonw Sep 9, 2025
0addb24
wip
stephencelis Sep 9, 2025
eaffb9c
wip
stephencelis Sep 9, 2025
8c4bf78
wip
stephencelis Sep 9, 2025
8035bf6
wip
stephencelis Sep 9, 2025
496b424
wip
stephencelis Sep 9, 2025
6fa21b6
Add `database` for context-sensitive provisioning (#175)
stephencelis Sep 10, 2025
c406e2f
another way to get container identifier
mbrandonw Sep 10, 2025
e2ff5bd
Modernize SyncUps and add iCloud sync. (#176)
mbrandonw Sep 10, 2025
85574a1
Send sync engine changes on resign foreground. (#177)
mbrandonw Sep 10, 2025
74baee6
Bring back other demo apps. (#178)
mbrandonw Sep 10, 2025
fecaa0e
wip
mbrandonw Sep 11, 2025
aa00105
A few fixes for Xcode 26. (#180)
mbrandonw Sep 15, 2025
480d8f7
Throw error when changing zones for existing record (#179)
mbrandonw Sep 15, 2025
34a25e6
Fix floating point bug (#183)
mbrandonw Sep 15, 2025
3c064b5
Fix Examples/README: project reference (#186)
yimajo Sep 15, 2025
9b3f9a2
Merge remote-tracking branch 'origin/main' into cloudkit
mbrandonw Sep 15, 2025
14d6f20
Perform multiple upserts in a single transaction. (#185)
mbrandonw Sep 15, 2025
eda61f6
Only reference UIApplication on iOS (#190)
thimic Sep 16, 2025
74eaaee
Modernize reminders (#184)
mbrandonw Sep 16, 2025
4aef34c
Add zone to sync metadata (#187)
mbrandonw Sep 16, 2025
834d8ea
Merge remote-tracking branch 'origin/main' into cloudkit
mbrandonw Sep 16, 2025
bebaac0
wip
mbrandonw Sep 16, 2025
ddf3040
Fix zone deletion (#192)
stephencelis Sep 16, 2025
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 .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ body:
required: false
- label: If possible, I've reproduced the issue using the `main` branch of this package.
required: false
- 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).
- 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).
required: true
- type: textarea
attributes:
Expand Down
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ blank_issues_enabled: false

contact_links:
- name: Project Discussion
url: https://github.com/pointfreeco/sharing-grdb/discussions
about: SharingGRDB Q&A, ideas, and more
url: https://github.com/pointfreeco/sqlite-data/discussions
about: SQLiteData Q&A, ideas, and more
- name: Documentation
url: https://pointfreeco.github.io/sharing-grdb/main/documentation/sharinggrdb/
about: Read Sharing's documentation
url: https://swiftpackageindex.com/pointfreeco/sqlite-data/~/documentation/sqlitedata
about: Read SQLiteData's documentation
- name: Videos
url: https://www.pointfree.co/
about: Watch videos to get a behind-the-scenes look at how SharingGRDB was motivated and built
about: Watch videos to get a behind-the-scenes look at how SQLiteData was motivated and built
- name: Slack
url: https://www.pointfree.co/slack-invite
about: Community chat
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ jobs:
config: ['debug']
scheme: ['Reminders', 'CaseStudies', 'SyncUps']
runs-on: macos-15
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: List devices available
run: xcrun simctl list --json devices available 'iPhone'
- name: xcodebuild ${{ matrix.scheme }}
run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="${{ matrix.scheme }}" xcodebuild-raw
- name: Output test failures
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
env:
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_PROJECT_CHANNEL_WEBHOOK_URL }}
with:
text: sharing-grdb ${{ github.event.release.tag_name }} has been released.
text: sqlite-data ${{ github.event.release.tag_name }} has been released.
blocks: |
[
{
"type": "header",
"text": {
"type": "plain_text",
"text": "sharing-grdb ${{ github.event.release.tag_name}}"
"text": "sqlite-data ${{ github.event.release.tag_name}}"
}
},
{
Expand Down Expand Up @@ -56,14 +56,14 @@ jobs:
env:
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }}
with:
text: sharing-grdb ${{ github.event.release.tag_name }} has been released.
text: sqlite-data ${{ github.event.release.tag_name }} has been released.
blocks: |
[
{
"type": "header",
"text": {
"type": "plain_text",
"text": "sharing-grdb ${{ github.event.release.tag_name}}"
"text": "sqlite-data ${{ github.event.release.tag_name}}"
}
},
{
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ xcuserdata/
DerivedData/
.swiftpm
.netrc
*.orig
*.sqlite
*.xcresult
6 changes: 2 additions & 4 deletions .spi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ version: 1
builder:
configs:
- documentation_targets:
- SharingGRDBCore
- SharingGRDB
- StructuredQueriesGRDB
- StructuredQueriesGRDBCore
- SQLiteData
custom_documentation_parameters: [--enable-experimental-overloaded-symbol-presentation]
platform: ios
4 changes: 2 additions & 2 deletions Examples/CaseStudies/Animations.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SharingGRDB
import SQLiteData
import SwiftUI

struct AnimationsCaseStudy: SwiftUICaseStudy {
Expand Down Expand Up @@ -60,7 +60,7 @@ extension DatabaseWriter where Self == DatabaseQueue {
CREATE TABLE "facts" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"body" TEXT NOT NULL
)
) STRICT
"""
)
.execute(db)
Expand Down
2 changes: 1 addition & 1 deletion Examples/CaseStudies/App.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SharingGRDB
import SQLiteData
import SwiftUI

@main
Expand Down
4 changes: 2 additions & 2 deletions Examples/CaseStudies/DynamicQuery.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SharingGRDB
import SQLiteData
import SwiftUI

struct DynamicQueryDemo: SwiftUICaseStudy {
Expand Down Expand Up @@ -113,7 +113,7 @@ extension DatabaseWriter where Self == DatabaseQueue {
CREATE TABLE "facts" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"body" TEXT NOT NULL
)
) STRICT
"""
)
.execute(db)
Expand Down
6 changes: 3 additions & 3 deletions Examples/CaseStudies/ObservableModelDemo.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import SharingGRDB
import SQLiteData
import SwiftUI

struct ObservableModelDemo: SwiftUICaseStudy {
let readMe = """
This demonstrates how to use the `fetchAll` and `fetchOne` tools in an @Observable model. \
This demonstrates how to use the `@FetchAll` and `@FetchOne` tools in an @Observable model. \
In SwiftUI, the `@Query` macro only works when installed directly in a SwiftUI view, and \
cannot be used outside of views.

Expand Down Expand Up @@ -100,7 +100,7 @@ extension DatabaseWriter where Self == DatabaseQueue {
CREATE TABLE "facts" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"body" TEXT NOT NULL
)
) STRICT
"""
)
.execute(db)
Expand Down
2 changes: 1 addition & 1 deletion Examples/CaseStudies/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Case Studies

This project includes a number of digestible examples of how to solve common problems using
SharingGRDB, including:
SQLiteData, including:

* [Animations](Animations.swift): Shows how to animate changes when the database changes and
updates state in features.
Expand Down
4 changes: 2 additions & 2 deletions Examples/CaseStudies/SwiftDataTemplateDemo.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SharingGRDB
import SQLiteData
import SwiftUI

struct SwiftDataTemplateView: SwiftUICaseStudy {
Expand Down Expand Up @@ -71,7 +71,7 @@ extension DatabaseWriter where Self == DatabaseQueue {
CREATE TABLE "items" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"timestamp" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
)
) STRICT
"""
)
.execute(db)
Expand Down
10 changes: 5 additions & 5 deletions Examples/CaseStudies/SwiftUIDemo.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import SharingGRDB
import SQLiteData
import SwiftUI

struct SwiftUIDemo: SwiftUICaseStudy {
let readMe = """
This demonstrates how to use the `fetchAll` and `fetchOne` queries directly in a SwiftUI view. \
The tools listen for changes in the database so that when the table changes it automatically \
updates state and re-renders the view.
This demonstrates how to use the `@FetchAll` and `@FetchOne` queries directly in a SwiftUI \
view. The tools listen for changes in the database so that when the table changes it \
automatically updates state and re-renders the view.

You can also delete rows by swiping on a row and tapping the "Delete" button.
"""
Expand Down Expand Up @@ -69,7 +69,7 @@ extension DatabaseWriter where Self == DatabaseQueue {
CREATE TABLE "facts" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"body" TEXT NOT NULL
)
) STRICT
"""
)
.execute(db)
Expand Down
6 changes: 3 additions & 3 deletions Examples/CaseStudies/TransactionDemo.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import SharingGRDB
import SQLiteData
import SwiftUI

struct TransactionDemo: SwiftUICaseStudy {
let readMe = """
This demonstrates how to use the `fetch` tool to perform multiple SQLite queries in a single \
This demonstrates how to use the `@Fetch` tool to perform multiple SQLite queries in a single \
database transaction. If you need to fetch multiple pieces of data from the database that \
all tend to change together, then performing those queries in a single transaction can be \
more performant.
Expand Down Expand Up @@ -85,7 +85,7 @@ extension DatabaseWriter where Self == DatabaseQueue {
CREATE TABLE "facts" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"body" TEXT NOT NULL
)
) STRICT
"""
)
.execute(db)
Expand Down
4 changes: 2 additions & 2 deletions Examples/CaseStudies/UIKitDemo.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SharingGRDB
import SQLiteData
import SwiftNavigation
import SwiftUI
import UIKit
Expand Down Expand Up @@ -126,7 +126,7 @@ extension DatabaseWriter where Self == DatabaseQueue {
CREATE TABLE "facts" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"body" TEXT NOT NULL
)
) STRICT
"""
)
.execute(db)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions Examples/CloudKitDemo/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
16 changes: 16 additions & 0 deletions Examples/CloudKitDemo/CloudKitDemo.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.co.pointfree.SQLiteData.CloudKitDemo</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudKit</string>
</array>
</dict>
</plist>
63 changes: 63 additions & 0 deletions Examples/CloudKitDemo/CloudKitDemoApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import CloudKit
import SQLiteData
import SwiftUI

@main
struct CloudKitDemoApp: App {
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate

init() {
try! prepareDependencies {
try $0.bootstrapDatabase()
}
}

var body: some Scene {
WindowGroup {
NavigationStack {
CountersListView()
}
}
}
}

class AppDelegate: UIResponder, UIApplicationDelegate, ObservableObject {
func application(
_ application: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
options: UIScene.ConnectionOptions
) -> UISceneConfiguration {
let configuration = UISceneConfiguration(
name: "Default Configuration",
sessionRole: connectingSceneSession.role
)
configuration.delegateClass = SceneDelegate.self
return configuration
}
}

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
@Dependency(\.defaultSyncEngine) var syncEngine
var window: UIWindow?

func windowScene(
_ windowScene: UIWindowScene,
userDidAcceptCloudKitShareWith cloudKitShareMetadata: CKShare.Metadata
) {
Task {
try await syncEngine.acceptShare(metadata: cloudKitShareMetadata)
}
}

func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
guard let cloudKitShareMetadata = connectionOptions.cloudKitShareMetadata
else { return }
Task {
try await syncEngine.acceptShare(metadata: cloudKitShareMetadata)
}
}
}
Loading