Skip to content

Latest commit

 

History

History
80 lines (66 loc) · 4.76 KB

README.md

File metadata and controls

80 lines (66 loc) · 4.76 KB

MiniSQL persisted formats

This index describes the unreleased storage-v2 development state. The product version remains 1.1.1 for this patch; that product label alone does not identify the database format. Earlier release evidence and milestone documents describe their original format-1 builds.

All fixed-width numeric storage fields use little-endian encoding. Current storage-v2 readers reject unsupported versions, noncanonical padding, checksum failures and contradictory identities. Page sizes and format versions come from persisted metadata, not from changed global defaults.

Current storage generation 2

Component Version / contract Specification
Database metadata MSDBM001 envelope version 2; database/table/index/WAL/row tuple 2/2/2/1/2 Database metadata v2
User-table file Mandatory identity header on page 0; data pages start at 1 Table file v2
Rows Version 2; aligned fields and binary64 REAL/DOUBLE Row v2
Slotted-page payload Eight-byte-aligned allocations, selected by table format 2 Slotted-page payload v2
Overflow Version 2; U32 total length and separate pointer CRC Overflow pointer/page v2
Index keys and leaf values Typed little-endian numeric keys; INCLUDE payload version 2 SQL index keys and values v2
B+ tree metadata and nodes Version 2 B+ tree v2

Legacy database format 1 is explicitly rejected. There is no implicit conversion, legacy import, or in-place upgrade in this development patch. See format compatibility and the development upgrade guide.

Structural wrappers that remain version 1

These versions identify their own framing. A version-1 wrapper can carry version-2 table or row content and does not make that content readable by an older MiniSQL binary.

Wrapper Current interpretation
Protected envelope v1 Same 32-byte CRC-protected header structure; each enclosed format selects its own version field. db.meta uses 2.
Common page v1 Same 64-byte header; page type 6 identifies the new user-table header.
Paged file / superblocks v1 Same pair of 4096-byte superblocks; table/index payload versions are checked separately. The page-offset formula in the original spec is for plaintext records.
WAL records v1 Same 80-byte framing; page images contain current storage-v2 payloads. Encrypted records use the marker described in the encryption specification.
Checkpoint v1 Same two 256-byte checkpoint slots.
WAL durable marker v1 Same optional durable-prefix record.
Encryption envelope and records v1 Same nonce/ciphertext/tag framing; paged-file stride is pageSize + 28 when encrypted.
Heap forwarding v1 Same 24-byte record; row references in storage-v2 user tables must target pages 1 or later.

Other independently versioned formats

The catalog envelope remains MSCAT001, version 1, with scalable BLB2 continuation pages. The current relationship to db.meta is described in database metadata v2. The original catalog and bootstrap notes are retained as historical M8 sketches.

Optimizer statistics currently write sidecar version 5; this is independent of database storage generation 2. The statistics-v1 note describes the historical baseline, not the current writer's complete layout. Milestone-specific limits in older sidecar notes remain historical; current serializers are authoritative for those independently evolved formats.

Archived storage-v1 material

Database metadata, table files, rows, slotted pages, overflow, index files, and B+ trees are retained for historical reference. Their presence does not indicate legacy read or conversion support.