mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-26 20:44:23 +01:00
Table ID is an opaque identifier that is only meaningful to the MV store. Each checkpointed MVCC table corresponds to a single B-tree on the pager, which naturally has a root page. We cannot use root page as the MVCC table ID directly because: - We assign table IDs during MVCC commit, but - we commit pages to the pager only during checkpoint which means the root page is not easily knowable ahead of time. Hence, we: - store the mapping between table id and btree rootpage - sqlite_schema rows will have a negative rootpage column if the table has not been checkpointed yet.
Integration and regression test suite.
# run all tests
cargo test
# run individual test
cargo test test_sequential_write -- --nocapture