-
-
Notifications
You must be signed in to change notification settings - Fork 117
Features for enabling and disabling WAL mode #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For the CLI:
For the Python library: import sqlite_utils
db = sqlite_utils.Database("github.db")
db.enable_wal()
db.disable_wal()
mode = db.journal_mode # "wal" or "delete" or others |
https://www.sqlite.org/pragma.html#pragma_journal_mode lists six modes: DELETE | TRUNCATE | PERSIST | MEMORY | WAL | OFF I'm only going to implement utilities for DELETE (wal-off) and WAL (wal-on) - the other modes look like they're for specialist purposes that I don't need to support. If it turns out I do need them I can add those to |
The CLI options should take multiple database files:
It's possible for this to fail if the DB is locked. How about a |
I'm having trouble figuring out how to write a test that locks a SQLite database (so I can test that import time
import sys
import sqlite3
filename = sys.argv[-1]
db = sqlite3.connect(filename)
with db:
db.execute("create table if not exists counter(id integer primary key, counter text)")
time.sleep(100) |
For the moment I'll build it without the |
I finally figured out how to enable WAL - turns out it's a property of the database file itself: https://github.com/simonw/til/blob/master/sqlite/enabling-wal-mode.md
The text was updated successfully, but these errors were encountered: