tursodatabase / tursodatabase/libsql
Improve error handling on databases without metadata
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 17.2k
- Forks
- 531
- Avg merge
- 1h 12m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the documented dump and SQLite commands, then trace the sync path for a database file with no previous sync metadata. The work is done when that case is detected and synchronization is refused with a clear error instead of proceeding toward corruption; no file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sqlite
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100