Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ..!!

like image 254
Sumit Murari Avatar asked Feb 20 '14 08:02

Sumit Murari


People also ask

What is Wal mode in SQLite?

Android 9 introduces a special mode of SQLiteDatabase called Compatibility WAL (write-ahead logging) that allows a database to use journal_mode=WAL while preserving the behavior of keeping a maximum of one connection per database.

What does PRAGMA do SQLite?

The PRAGMA statement is an SQL extension specific to SQLite and used to modify the operation of the SQLite library or to query the SQLite library for internal (non-table) data.

What is PRAGMA command?

The PRAGMA command is a special command used to modify the operation of the QDB process or to query the library for internal (non-table) data.


1 Answers

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

like image 166
CL. Avatar answered Oct 12 '22 19:10

CL.