libsql icon indicating copy to clipboard operation
libsql copied to clipboard

Improve error handling on databases without metadata

Open penberg opened this issue 9 months ago • 0 comments

If you dump a database and create a database file out of it:

turso db shell example .dump > example.sql
cat example.sql | sqlite3 example.db
sqlite3 example.db 'PRAGMA journal_mode = WAL'

The sync code happily allows to sync this with no knowledge of the previous sync point and, therefore, eventually corrupt the database.

Let's add error handling to detect a SQLite file without sync metadata and refuse to sync.

penberg avatar Apr 01 '25 09:04 penberg