预填充核心数据具有新的预写日志(WAL)日志记录的SQL存储 [英] Prepopulated Core Data SQL store with new Write-Ahead Log (WAL) journaling
问题描述
我想使用SQL资料储存库传送我的应用程式,但现在,由于Apple推出了一个WAL日志记录,使3个文件,而不是一个,所以我想知道我应该运送所有3个,或者我可以尝试强制SQL做一个检查点,将它全部合并到一个.sql文件中。
I would like to ship my app with an SQL datastore, but now, since Apple has introduced a WAL journaling, that makes 3 files instead of one, so I wonder if I should ship all 3 of them, or I can try to force SQL to make a checkpoint, merging it all into one .sql file.
我真的想使用这个新的iOS 7功能,所以回到回滚
I would really like to go with this new iOS 7 feature, so going back to rollback journaling is not a way for me.
推荐答案
要强制SQLite创建检查点,请执行 PRAGMA wal_checkpoint 。
To force SQLite to make a checkpoint, execute PRAGMA wal_checkpoint.
或者,使用 journal_mode = DELETE
,并在文件安装后更改模式。
Alternatively, ship the database with journal_mode = DELETE
, and change the mode after the file has been installed.
无论如何,运送所有文件。
( -shm
文件不包含永久数据,可以忽略。)
In any case, there is no problem with just shipping all files.
(The -shm
file does not contain permanent data and could be ignored.)
这篇关于预填充核心数据具有新的预写日志(WAL)日志记录的SQL存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!