Using Xcode 11.6; Swift; deploying to iOS.
The app has a ~250M SQLite database as a core resource.
The database is built up by importing a dozen .txt files. This process takes considerable time.
I have used the simulator to build up the database. I then obtained the .sqlite file from the macOS filesystem and include it in the iOS app Resources.
Since this database will undergo changes as the app is used, during first use the .sqlite file id copied to the .applicationSupportDirectory.
The original file in the mainBundle remains useful in the event that the user wishes to 'reset to factory'.
All of this is working fine and as expected.
My concern is the 2x usage of the users storage:
250M in mainBundle + 250M in .applicationSupport....
I have tried using Swift [data].compressed(using: .lz4) and .decompressed() ... The .compressed() works as expected and results in a ~65M file.. BUT the .decompressed() never finishes and never errors - it simply runs until the process is killed... Are there known issues with .sqlite files?
Is there a better strategy?
I really would like to understand the best practice for deploying a large .sqlite file without using 2x the storage...
Any feedback is appreciated.
The app has a ~250M SQLite database as a core resource.
The database is built up by importing a dozen .txt files. This process takes considerable time.
I have used the simulator to build up the database. I then obtained the .sqlite file from the macOS filesystem and include it in the iOS app Resources.
Since this database will undergo changes as the app is used, during first use the .sqlite file id copied to the .applicationSupportDirectory.
The original file in the mainBundle remains useful in the event that the user wishes to 'reset to factory'.
All of this is working fine and as expected.
My concern is the 2x usage of the users storage:
250M in mainBundle + 250M in .applicationSupport....
I have tried using Swift [data].compressed(using: .lz4) and .decompressed() ... The .compressed() works as expected and results in a ~65M file.. BUT the .decompressed() never finishes and never errors - it simply runs until the process is killed... Are there known issues with .sqlite files?
Is there a better strategy?
I really would like to understand the best practice for deploying a large .sqlite file without using 2x the storage...
Any feedback is appreciated.