Skip to content

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

@xtremebiker

Description

@xtremebiker

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions