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

The better-sqlite3 driver should support the enableWal flag #9410

Closed
xtremebiker opened this issue Sep 26, 2022 · 0 comments · Fixed by #9619
Closed

The better-sqlite3 driver should support the enableWal flag #9410

xtremebiker opened this issue Sep 26, 2022 · 0 comments · Fixed by #9619

Comments

@xtremebiker
Copy link
Contributor

xtremebiker commented Sep 26, 2022

The better-sqlite3 driver should support the enableWal configuration flag, the same way the sqlite3 driver does

The Problem

The current better-sqlite3 driver implementation hardcodes WAL mode for each connection being created. This doesn't make much sense, since the default better-sqlite3 library configuration is not enabling it (even though it recommendeds it).

The Solution

The WAL mode should be set only when enabling WAL in the connection options (similar to the sqlite driver implementation). If not, the DB WAL configuration should be kept (no PRAGMA applied).

Considered Alternatives

When enableWal set to false, set the DB PRAGMA journal_mode to the default Sqlite3 behaviour, which is DELETE, instead.

Relevant Database Driver(s)

DB Type Relevant
aurora-mysql no
aurora-postgres no
better-sqlite3 yes
cockroachdb no
cordova no
expo no
mongodb no
mysql no
nativescript no
oracle no
postgres no
react-native no
sap no
spanner no
sqlite no
sqlite-abstract no
sqljs no
sqlserver no

Are you willing to resolve this issue by submitting a Pull Request?

  • ✖️ Yes, I have the time, and I know how to start.
  • ✅ Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️ No, I don’t have the time, but I can support (using donations) development.
  • ✖️ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant