Skip to main content

Module header

Module header 

Source
Expand description

Database file header (page 0).

The first 28 bytes of every .sqlrite file identify the format and point at the schema catalog. The rest of page 0 is reserved for future use.

Structs§

DbHeader
Parsed header. page_count includes page 0 itself.

Constants§

FORMAT_VERSION
On-disk format revision. Bump when the page layout changes incompatibly.
MAGIC
File magic. Distinct from SQLite’s "SQLite format 3\0" so the formats can’t be confused on inspection.

Functions§

decode_header
Decodes the header from a PAGE_SIZE-sized buffer. Returns an error if magic bytes, format version, or page size don’t match what we wrote.
encode_header
Encodes the header into a PAGE_SIZE-sized buffer.