Skip to main content

lora_snapshot/
format.rs

1//! On-disk format constants for the columnar snapshot.
2
3pub(crate) const MAGIC: &[u8; 8] = b"LORACOL1";
4pub const DATABASE_SNAPSHOT_MAGIC: &[u8; 8] = MAGIC;
5pub(crate) const FORMAT_VERSION: u32 = 2;
6pub(crate) const HEADER_LEN: usize = 8 + 4 + 4 + 8 + 32;
7/// `2` was the last release before the catalog trailer; readable on this branch
8/// for forward compatibility with older snapshots that lack indexes.
9pub(crate) const BODY_FORMAT_VERSION_V2: u32 = 2;
10/// `3` introduced the index-catalog trailer.
11pub(crate) const BODY_FORMAT_VERSION_V3: u32 = 3;
12/// `4` added the constraint-catalog trailer (after indexes).
13pub(crate) const BODY_FORMAT_VERSION_V4: u32 = 4;
14/// `5` added the vector-index backend trailer (HNSW graph state)
15/// after constraints. JSON-encoded payload for now — a follow-up
16/// can swap to a hand-rolled binary format without a version bump
17/// if the JSON-byte framing is preserved.
18pub(crate) const BODY_FORMAT_VERSION: u32 = 5;