Skip to main content

Module page

Module page 

Source
Expand description

Page layout primitives.

Every database file is a sequence of fixed-size pages. Page 0 holds the DbHeader; every other page is a typed, chained payload container.

Layout of a non-header page (PAGE_SIZE bytes total):

  0..1      PageType tag   (u8)
  1..5      next-page      (u32 LE; 0 = end of chain)
  5..7      payload length (u16 LE; bytes used in the payload area)
  7..end    payload bytes

Enums§

PageType
Identifies what kind of content a page holds.

Constants§

PAGE_HEADER_SIZE
Bytes consumed by the per-page header (type + next-ptr + payload-len).
PAGE_SIZE
Size of every page in bytes. SQLite’s default too — small enough to fit in one disk sector group, large enough to carry meaningful payload.
PAYLOAD_PER_PAGE
Usable payload bytes per page after subtracting the header.