turso-cli icon indicating copy to clipboard operation
turso-cli copied to clipboard

`turso dev --db-file` needs to better handle the case where the sqlite db file is not suitable for use in sqld

Open CodingDoug opened this issue 11 months ago • 1 comments

Database files created by sqlite3 default to DELETE journal mode

# Create db file
$ sqlite3 test.db

But sqld requires them to be in WAL journal mode. This error surfaces if it is not:

# Try to get sqld to use the file directly
$ turso dev --db-file test.db
...
Error: failed to checkpoint database while recovering replication log

See: https://www.sqlite.org/wal.html#activating_and_configuring_wal_mode

A workaround here is obviously for the user of the CLI to run PRAGMA journal_mode=WAL; prior to using the file with the Turso CLI (and sqld).

On sqld: https://github.com/libsql/sqld/issues/558

cc @gamebox

CodingDoug avatar Jul 28 '23 17:07 CodingDoug