Add metadatabase URL override for CloudKit sync#426
Open
byMohamedali wants to merge 1 commit intopointfreeco:mainfrom
Open
Add metadatabase URL override for CloudKit sync#426byMohamedali wants to merge 1 commit intopointfreeco:mainfrom
byMohamedali wants to merge 1 commit intopointfreeco:mainfrom
Conversation
Member
|
Hi @byMohamedali, it's intended that the metadatabase is created right alongside wherever the user's database is. You can see that's done right here: sqlite-data/Sources/SQLiteData/CloudKit/SyncEngine.swift Lines 2139 to 2143 in 65502ac So I'm not sure why this would be needed. Are you positive that the metadatabase is always created in application support? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
metadatabaseURLoverride to SQLiteData's CloudKit APIs so callers can choose where the CloudKit metadata database lives.Changes
metadatabaseURL: URL? = nilto:SyncEngine.init(for:tables:privateTables:containerIdentifier:metadatabaseURL:defaultZone:startImmediately:delegate:logger:)Database.attachMetadatabase(containerIdentifier:metadatabaseURL:)Application Support.Motivation
Some platforms, notably tvOS, may not allow the current hardcoded
Application Supportbehavior for this metadata database. The main user database may already be configured to live somewhere else, but CloudKit setup still fails because the metadata store is not configurable.This change keeps the default behavior intact for existing apps while allowing callers to explicitly provide a writable location when needed.
Example