Skip to content

Add boolean input param to enable WAL mode#1395

Open
TimothyAllman wants to merge 2 commits into
piccolo-orm:masterfrom
TimothyAllman:feature/AddWalParamsToSqliteEngine
Open

Add boolean input param to enable WAL mode#1395
TimothyAllman wants to merge 2 commits into
piccolo-orm:masterfrom
TimothyAllman:feature/AddWalParamsToSqliteEngine

Conversation

@TimothyAllman

Copy link
Copy Markdown

Hi there

adding boolean input to enable WAL mode
as mentioned in this discussion #1394 (comment)

let me know if I mis-interpretted anything or if anything needs more work

I was thinking as a first pass (this PR) just add the boolean input param.
then as a second pass, maybe generalize for any PRAGMA statment (wondered if you had any ideas or first thoughts as to how you would want to go about this)

love the work on piccolo
Many thanks

@dantownsend dantownsend left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good - thanks!

Just one suggestion about making it more flexible.

Comment thread piccolo/engine/sqlite.py
path: str = "piccolo.sqlite",
log_queries: bool = False,
log_responses: bool = False,
enable_wal_mode: bool = False,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of changing this to:

journal_mode: Literal['DELETE', 'TRUNCATE', 'PERSIST', 'MEMORY', 'WAL', 'OFF'] | None = None

It provides a bit more flexibility if people want alternative journal modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants