Hacker News new | ask | show | jobs
by samatman 1402 days ago
As an informed guess: backward compatibility.

This way an SQLite library which has never heard of a WAL2 file will just use WAL mode instead, instead of potentially being confused by the unheard-of existence of multiple .wal files.

1 comments

I don't think that would work; there is also a -wal2 file which might be the active WAL file at the time a DB was closed. If you took an older library and tried to open that same DB, you would lose the data in the -wal2 file since that older library would ignore it.
You won't have a wal2 unless one of these connections generated it. The question is, can sqlite+wal2 write to a database while sqlite+wal is writing to it, without terrible things happening.

The answer kinda has to be 'yes' right? This is SQLite we're speculating about here.