Programmatically Repair SQLite Database

五迷三道 提交于 2019-12-02 04:55:37
Jeff

You are overlooking one important word: you can 'recover some data', this is not a repair!

If there is a sitatuation where a corrupted database could be repaired perfectly without user-interaction than it would not be corrupted in the first place and such an repair would have been a standard function of SQLite

You might consider implementing your own strategy for database recovery. You could store backups of the SQLite file and then check that it is OK using:

PRAGMA integrity_check; 

If errors are found then you can revert to a backup.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!