Skip to main content

FORMAT_VERSION

Constant FORMAT_VERSION 

Source
pub const FORMAT_VERSION: u16 = 4;
Expand description

On-disk format revision. Bump when the page layout changes incompatibly.

History:

  • Version 1 (Phases 2 / 3a / 3b): schema catalog and table data were opaque bincode blobs chained across typed payload pages.
  • Version 2 (Phases 3c / 3d): tables are stored as cell-based B-Trees; the schema catalog is itself a table called sqlrite_master with four columns (name, sql, rootpage, last_rowid).
  • Version 3 (Phase 3e): sqlrite_master gains a type column (first), distinguishing 'table' and 'index' rows; secondary indexes persist as their own cell-based B-Trees whose cells use the new KIND_INDEX format.
  • Version 4 (Phase 7): cell encoding gains the KIND_VECTOR value tag (length-prefixed dense f32 array) for the new VECTOR(N) column type. Per the Phase 7 plan (docs/phase-7-plan.md Q8), later Phase 7 sub-phases (JSON, HNSW indexes) will add their own value/cell tags inside this same v4 envelope — no v5 mid-Phase-7.