react-native-sqlite-storage
react-native-sqlite-storage copied to clipboard
How can I enable write-ahead logging
I was searching for the documentation showing how WAL can be enabled for simultaneous reading and writing
This feature is not available. If you would like to make it work on iOS and Android PR would be very welcome. Otherwise I have to look more into this when I have time...
You can just do, db.executeSql('PRAGMA journal_mode=WAL;')
when you open/build your database.
While this is not the best solution it does enable WAL.
You can just do,
db.executeSql('PRAGMA journal_mode=WAL;')
when you open/build your database.While this is not the best solution it does enable WAL.
Actually, it won't work. The db did changed to wal mode, but android just restrict your db connection to 1.
The right way is to call https://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper#setWriteAheadLoggingEnabled(boolean)