
transaction-correctness
How WAL mechanics, checkpointing, concurrency rules, recovery work in tursodb
by tursodatabaseFree
Description
Transaction correctness is an agent skill that explains how transactions work in the Turso database, tursodb. Turso uses write-ahead logging mode exclusively. Its files are a main database file and a separate WAL file, and there is no shared-memory index file because Turso keeps the WAL index in memory. On the write path, the writer appends page frames to the WAL file in sequence, and a commit is the frame whose header carries a non-zero database size, which marks the end of the transaction. The main database is left unchanged until a checkpoint. On the read path, a reader takes a read mark, which is the last valid commit frame, and for each page it checks the WAL up to that mark before falling back to the main database. Each reader therefore sees a consistent snapshot at its read mark. The checkpointing section explains how WAL content is transferred back into the main file. The listing also covers concurrency rules and recovery. The skill is listed on skills.sh under the Turso repository and is meant for contributors working on durability and concurrency. Its audit results are Gen Agent Trust Hub: Pass, Socket: Pass and Snyk: Pass.…
Highlights
- Explains WAL mode and the commit frame
- Describes the write and read paths
- Snapshot reads at a read mark
- Checkpointing and recovery rules
Ratings & Reviews
No ratings yet
Be the first to rate transaction-correctness.
People also visit

code-quality
General Correctness rules, Rust patterns, comments, avoiding over-engineering
transaction-correctness FAQ
What does the skill cover?
How write-ahead logging, checkpointing, concurrency and recovery work inside tursodb.
Which files does Turso use?
A .db file and a .db-wal file. Turso keeps its WAL index in memory, so there is no .db-shm file.
How does a commit work?
A commit is the WAL frame that carries a non-zero database size in its header. The main database is unchanged until a checkpoint.
What does a reader see?
A consistent snapshot as of its read mark, taken from the WAL up to that point and the main database for other pages.
How do I install it?
Run npx skills add https://github.com/tursodatabase/turso --skill transaction-correctness.
What security audits has it passed?
skills.sh lists three audits: Gen Agent Trust Hub Pass, Socket Pass and Snyk Pass.
What are the best transaction-correctness alternatives?
Popular alternatives to transaction-correctness include async-io-model, code-quality and debugging. See all transaction-correctness alternatives








