Add boolean input param to enable WAL mode#1395
Conversation
dantownsend
left a comment
There was a problem hiding this comment.
This looks good - thanks!
Just one suggestion about making it more flexible.
| path: str = "piccolo.sqlite", | ||
| log_queries: bool = False, | ||
| log_responses: bool = False, | ||
| enable_wal_mode: bool = False, |
There was a problem hiding this comment.
What do you think of changing this to:
journal_mode: Literal['DELETE', 'TRUNCATE', 'PERSIST', 'MEMORY', 'WAL', 'OFF'] | None = NoneIt provides a bit more flexibility if people want alternative journal modes.
There was a problem hiding this comment.
that makes a lot more sense.
have changed it accordingly, updated the PR and pushed the changes.
I did notice some discussion around this here #1394 (reply in thread).
Even so, I think the above change might be a good first pass to get into piccolo and useful for use-cases that I and others might want to try out with piccolo (like litestream https://litestream.io/)
thanks so much for all the hard work Dan and the Piccolo Team.
Let me know if there is anything else.
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