mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 03:54:21 +01:00
closes #1893 Adds some fairly extensive tests but I'll continue to add some python tests on top of the unit tests. ## Restart: tested ✅ - open new DB - create table and do a bunch of inserts - `pragma wal_checkpoint(RESTART);` - close db file - re-open and verify we can read the wal/repopulate the frame cache - verify min|max frame tested ✅ - open same DB - add more inserts - `pragma wal_checkpoint(RESTART);` - do _more_ inserts - close - re-open - verify checksums/max_frame are valid - verify row count ## Truncate tested ✅ - open new db - create table and add inserts - `pragma wal_checkpoint(truncate);` - close file - verify WAL file is empty (32 bytes, header only) - re-open file - verify content/row count tested ✅ - open db - create table and insert many rows - `pragma wal_checkpoint(truncate);` - insert _more_ rows - close db file - verify WAL file is valid - re-open file - verify we can read entire file/repopulate the frame cache <img width="541" height="315" alt="image" src="https://github.com/user- attachments/assets/0470c795-5116-4866-b913-78c07b06b68c" /> ``` # header magic=0x377f0682 version=3007000 page_size=4096 seq=2 salt=ec475ff2-7ea94342 checksum=c9464aff-c571cc22 ``` Closes #2179