aboutsummaryrefslogtreecommitdiff
path: root/Hotline
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2025-11-08 15:32:46 -0800
committerDustin Mierau <dustin@mierau.me>2025-11-08 15:32:46 -0800
commit23dfc75e31a8666eaba14de9f87bf82ac95c05d9 (patch)
tree46e7283f9b77bf583164ddb2c629cebd797b7354 /Hotline
parent286c408370681b022deaabd254d499aefec28add (diff)
Thinking through how to store chat history in SwiftData instead.
Diffstat (limited to 'Hotline')
-rw-r--r--Hotline/MacApp.swift20
1 files changed, 17 insertions, 3 deletions
diff --git a/Hotline/MacApp.swift b/Hotline/MacApp.swift
index b1cc1af..9052c0b 100644
--- a/Hotline/MacApp.swift
+++ b/Hotline/MacApp.swift
@@ -71,10 +71,24 @@ struct Application: App {
private var modelContainer: ModelContainer = {
let schema = Schema([
- Bookmark.self
+ Bookmark.self,
+ // ChatMessage.self
])
- let config = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false, cloudKitDatabase: .private("iCloud.co.goodmake.hotline"))
- let modelContainer = try! ModelContainer(for: schema, configurations: [config])
+
+ // For records we want shared across devices.
+ let cloudKitConfiguration = ModelConfiguration(
+ schema: Schema([Bookmark.self]),
+ isStoredInMemoryOnly: false,
+ cloudKitDatabase: .private("iCloud.co.goodmake.hotline")
+ )
+
+ // For records we only need stored locally.
+// let localConfiguration = ModelConfiguration(
+// schema: Schema([ChatMessage.self]),
+// isStoredInMemoryOnly: false
+// )
+
+ let modelContainer = try! ModelContainer(for: schema, configurations: [cloudKitConfiguration])
// Print local SwiftData sqlite file.
// print(modelContainer.configurations.first?.url.path(percentEncoded: false))