I am using the amalgamation version 3.27.0 compiled with SQLITE_DEFAULT_SYNCHRONOUS=0
, which ought to be the same as executing PRAGMA synchronous=off
(but I am not executing this statement in my code, as I assumed the macro setting would be respected).
What happened was the infamous INSERT
delay after setting a number of rows. Wrapping in BEGIN/COMMIT
solved the problem, as per the FAQ and this answer, but I am left wondering. Is SQLITE_DEFAULT_SYNCHRONOUS
ignored when compiling the amalgamation (i.e. I should not be noticing a delay with synchronous set to off)? . It does not seem that way when I look into the source code. In addition, I am enabling WAL
on the database with PRAGMA journal_mode=WAL
, which should be speeding up the inserts even more, but maybe doing so changes the synchronous
pragma?
EDIT: If I execute PRAGMA synchronous
in my program, sqlite returns 0
.