Sqlite Database Browser crahses - how to restore a database with a log file

I worked on my sqlite database using the "SQlite Database Browser" program. The program crashed and I lost my changes. But the db-journal file still exists. How to restore a database with a log file? When I open the database using SQLite Database Browser, the old database opens.

What can I do?

Thanks: -)

+6
source share
1 answer

If you did not enable Write-Ahead, I’m afraid your changes are likely to be lost. SQLite's standard logging system works in the opposite direction than you would expect.

From the documentation:

The traditional rollback log works by writing a copy of the original unchanged database contents to a separate rollback log file, and then writing the changes directly to the database file. In the event of a failure or ROLLBACK, the original content contained in the rollback log is played back in the database file to return the database file to its original state.

Cm:

WAL: https://sqlite.org/wal.html

File formats, including logs: https://sqlite.org/fileformat.html

+1
source

Source: https://habr.com/ru/post/899860/


All Articles