Whilst understanding that SQLite is not very good in a multi-user environment I was reading up on Pragmas in the SQLite website and came across:
pragma journal_mode = wal;
Unless I am mis-reading it the WAL mode seems to cater for multi-user.
Can somebody please enlighten me on this subject? A newly created database sets up a default value of DELETE and it is persistent. What is it used for?
wal recalls me something.
It may be or not related, but I found in my macOS Library/ folder files:
NoteStore.sqlite-wal --> Group Containers/group.com.apple.note
NotesV6.storedata-wal --> Group Containers/group.com.apple.note
places.sqlite-wal --> Firefox folder
ABAssistantChangelog.aclcddb-wal --> AddressBook
and some others.
The file contents holds a mix of binary data and text data.
Thank you for that but it was not my question.
I am aware of both wal and shm files being produced during program execution and access to the database. My question was related to the multi-user aspect.
WAL improves write speed. Here’s more info: SQLite Write-ahead Logging
It improves concurrency and makes it more likely that multi applications can read / write the same db at the same time without conflicts
Note that it DOES NOT support network file systems so sharing a single db from a file server is not recommended
In Xojo, you turn it on by setting your db.MultiUser to true.