How to open SQLite connection in WAL mode in iOS. Normally I am using sqlite3_open_v2
to open it.
Here is the C# answer but how to do that in Swift?
How to open SQLite connection in WAL mode in iOS. Normally I am using sqlite3_open_v2
to open it.
Here is the C# answer but how to do that in Swift?
You can run the pragma statement for WAL mode after opening the database.
sqlite3_exec(dbHandle, "PRAGMA journal_mode=WAL;", 0, 0, 0);
The documentation says:
The WAL journaling mode is persistent; after being set it stays in effect across multiple database connections and after closing and reopening the database.
So it is enough that PRAGMA journal_mode=WAL
is executed once after creating the database file. Nothing special is needed when opening it later.