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

Exposing file control operations #1101

Open
devinivy opened this issue Nov 9, 2023 · 1 comment
Open

Exposing file control operations #1101

devinivy opened this issue Nov 9, 2023 · 1 comment

Comments

@devinivy
Copy link

devinivy commented Nov 9, 2023

We have a use case where it would be useful to be able to run file control operations (i.e. sqlite3_file_control()). Our primary use will actually be to set PERSIST_WAL, also mentioned by another user in #1029. More specifically, we're looking manage the database in such a way that it is safe to use with litestream, which as discussed in benbjohnson/litestream#510 relies on the wal being persisted.

We understand that we could achieve this with a custom build, but this can also be set at runtime using sqlite3_file_control(), which of course would be a more convenient alternative. There's some prior art to setting file control operations at runtime, such as the sqlite3 CLI's .filectrl command and the go driver's SetFileControlInt().

Would the project be open to a contribution that exposes this interface through a method on Database?

@JoshuaWise
Copy link
Member

JoshuaWise commented Apr 3, 2024

better-sqlite3 is designed to be immune to segfaults and undefined behavior, regardless of what the user does. But perhaps this could be enabled for unsafe mode.

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

No branches or pull requests

2 participants