docs: mention WAL mode for concurrently written databases#2718
Open
c-tonneslan wants to merge 1 commit into
Open
docs: mention WAL mode for concurrently written databases#2718c-tonneslan wants to merge 1 commit into
c-tonneslan wants to merge 1 commit into
Conversation
Per simonw#2024. Immutable mode is the right answer when the file won't change; WAL mode is the right answer when something else is writing to the file while Datasette is reading it. Add a small section in performance.rst that points at the sqlite WAL docs and the TIL Simon already wrote, with the one-liner sqlite3 incantation to flip a file into WAL mode. Closes simonw#2024. Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Per #2024 ("It's not currently obvious from the docs how you can ensure that Datasette runs well in situations where other processes may update the underlying SQLite files").
Added a small WAL section in
performance.rstright after the immutable-mode section, since they're the two opposite ends of the same question ("who else touches this file?"). Pointed at the sqlite WAL docs and your existing TIL, and included the one-linersqlite3 data.db 'PRAGMA journal_mode=WAL;'.Happy to expand if you'd rather have a longer treatment.
Closes #2024.