function to check if SQLite is using journal_mode=WAL or journal_mode=DELETE
Asked Answered
E

1

11

I was looking for function which would help me to see which journaling mode is enabled.. I looked here too list of function
There was function to check database status sqlite3_db_status(....) but status parameter didn't have option for check journaling mode

Is there a function or any way to find if sqlite db is using WAL-mode or normal journaling mode ..!!

Eiten answered 20/2, 2014 at 8:11 Comment(0)
C
14

To query the journal mode of a connection, execute PRAGMA journal_mode and read the result.

Corrosive answered 20/2, 2014 at 12:4 Comment(2)
If I have to read from a C++ program , how to read output of pragma as they may run on "sqlite3_prepare()" OR on step(). How should be my call like ?? Thank you for all those answers..>!!Eiten
You would read it like a SELECT query, i.e., sqlite3_step returns SQLITE_ROW, and you call sqlite3_column_*.Corrosive

© 2022 - 2024 — McMap. All rights reserved.