Add more options for opening SQLite databases - busy_timeout and journal_mode - and set busy time-out by default #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #82
This PR adds two new settings when attaching SQLite databases -
busy_timeout
andjournal_mode
.busy_timeout
specifies a busy timeout in milliseconds, see here. This refers to the amount of time the process will wait if there is another process operating on the SQLite file. The default is now set to 5 seconds (i.e.BUSY_TIMEOUT = 5000
), which is the same default used by rusqlite.journal_mode
specifies a journaling mode, e.g.journal_mode
can beWAL
. See here for more info.Usage:
This fixes the linked issue by specifying a busy time-out by default which prevents
database is locked
errors from appearing until after the timeout has passed. To restore previous behavior where the system would immediately returndatabase is locked
abusy_timeout
of 0 can be specified.