3 ms·
>What happens if your application crashes in the middle writing out a JSON file? The usual way to deal with this is to write to a temporary file and then atomi
by fauigerzigerk 2y ago
>What happens if your application crashes in the middle writing out a JSON file?
The usual way to deal with this is to write to a temporary file and then atomically replace the original file with that temporary file. You could do the same thing with an SQLite database. This is the workaround I was referring to earlier.
journal_mode=delete may not be the worst compromise, but I hate the idea of exposing users to potential database corruption, even in a relatively unlikely event.