|
106 | 106 | let containerIdentifier = |
107 | 107 | containerIdentifier |
108 | 108 | ?? ModelConfiguration(groupContainer: .automatic).cloudKitContainerIdentifier |
109 | | - ?? (context == .preview ? "preview" : nil) |
| 109 | + ?? (context != .live ? "container" : nil) |
110 | 110 | var allTables: [any SynchronizableTable] = [] |
111 | 111 | var allPrivateTables: [any SynchronizableTable] = [] |
112 | 112 | for table in repeat each tables { |
|
2169 | 2169 | package var `private`: (any SyncEngineProtocol)? { |
2170 | 2170 | guard let `private` = rawValue?.private |
2171 | 2171 | else { |
2172 | | - reportIssue("Private sync engine has not been set.") |
| 2172 | + if isRunning { |
| 2173 | + reportIssue("Private sync engine has not been set.") |
| 2174 | + } |
2173 | 2175 | return nil |
2174 | 2176 | } |
2175 | 2177 | return `private` |
2176 | 2178 | } |
2177 | 2179 | package var `shared`: (any SyncEngineProtocol)? { |
2178 | 2180 | guard let `shared` = rawValue?.shared |
2179 | 2181 | else { |
2180 | | - reportIssue("Shared sync engine has not been set.") |
| 2182 | + if isRunning { |
| 2183 | + reportIssue("Shared sync engine has not been set.") |
| 2184 | + } |
2181 | 2185 | return nil |
2182 | 2186 | } |
2183 | 2187 | return `shared` |
|
2214 | 2218 | let containerIdentifier = |
2215 | 2219 | containerIdentifier |
2216 | 2220 | ?? ModelConfiguration(groupContainer: .automatic).cloudKitContainerIdentifier |
2217 | | - ?? (context == .preview ? "preview" : nil) |
| 2221 | + ?? (context != .live ? "container" : nil) |
2218 | 2222 |
|
2219 | 2223 | guard let containerIdentifier else { |
2220 | 2224 | throw SyncEngine.SchemaError.noCloudKitContainer |
|
2243 | 2247 | url.isInMemory |
2244 | 2248 | ? try DatabaseQueue(path: path) |
2245 | 2249 | : try DatabasePool(path: path) |
2246 | | - _ = try database.write { db in |
| 2250 | + _ = try database.read { db in |
2247 | 2251 | try #sql("SELECT 1").execute(db) |
2248 | 2252 | } |
2249 | 2253 | try #sql( |
|
0 commit comments