Another option is to use the following SQL statement
"PRAGMA journal_mode = TRUNCATE"
It still stores the log, so if a failure occurs during the transaction during the transaction, you can still roll back and you will avoid damaging the database. The difference between DELETE and TRUNCATE is that deletion creates and deletes a log file for each statement permanently. Truncate only needs to be created once and just overwritten. In my case, it was much faster, and I escaped the strange permissions that come with the standard journal_mode = DELETE .
Refer to the explanation of SQlite3 Pragma_journal_mode
source share