Skip to content
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

Support WAL mode under exclusive locking #242

Open
fabiospampinato opened this issue Aug 20, 2023 · 2 comments
Open

Support WAL mode under exclusive locking #242

fabiospampinato opened this issue Aug 20, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@fabiospampinato
Copy link

fabiospampinato commented Aug 20, 2023

According to the docs since v3.7.4 WAL mode is supported without support for memory-mapping by setting a pragma that makes sqlite always ask for exclusive locking of the file.

It may be worth updating the readme to mention this detail.

Though it's not entirely clear if this is a meaningful distinction, like if only one process at any given time can read from the database maybe WAL mode isn't that useful to begin with 🤔

@dyedgreen
Copy link
Owner

This won’t help with performance, but would mean we can open wal mode sqlite files without error so I think enabling this by default would be useful!

@dyedgreen dyedgreen added the enhancement New feature or request label Aug 21, 2023
@fabiospampinato
Copy link
Author

Apparently one can't just open a database and set the magic pragmas to get WAL mode to work, the docs say:

If EXCLUSIVE locking mode is set prior to the first WAL-mode database access

I'm assuming that means the pragma has to be set prior to actually opening the database.

But that's actually impossible in the current version of deno-sqlite, I'm guessing there should be like an "init" option when creating a DB instance that automatically executes the init string before actually opening a database, or something like that 🤔 Could it be added? It'd be pretty cool if WAL databases were usable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants