PRAGMA journal_mode = OFF not working, why?

I am running SQLite3 version of sqlite-3.6.12, and I have successfully ported it to my OS. The problem that I see is that when I execute the command "PRAGMA journal_mode = OFF" it returns "OFF", but I still see * .db log files being created. It is very important that these files are not created for my project. When I look through the sqlite3PagerJournalMode code it returns PAGER_JOURNALMODE_OFF, so I wonder if setting journal_mode = OFF should still create these files or if there is something else that I am missing. Please, help

I also tried PRAGMA main.journal_mode = OFF and PRAGMA journal_mode = MEMORY. But the log file is created as such !!!!

+3
source share
1 answer

Compile the application with the ption macro:

SQLITE_ENABLE_ATOMIC_WRITE

If this macro of the C-preprocessor is defined and if the xDeviceCharacteristics object of the sqlite3_io_methods object for the database file reports (through one of the SQLITE_IOCAP_ATOMIC bits) that the file system supports atomic writing and if the transaction involves changing only one page of the database file, then the transaction only performs one a request to write one page of the database, and the rollback log is not created or written.

-1
source

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


All Articles