Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Virtual Schema

The SQL engine exposes two virtual tables backed directly by the in-memory store — there is no separate schema to migrate.

SELECT id, path, title, tags FROM documents;

SELECT id, document_id, block_type, content, pre, post,
       depth, lang, properties FROM blocks;

documents

ColumnTypeDescription
idintegerDocument ID (matches blocks.document_id)
pathtextSource file path, or NULL for in-memory-only documents
titletextFront-matter / first-heading title, if any
tagstextFront-matter tags, comma-joined

blocks

ColumnTypeDescription
idintegerBlock ID
document_idintegerOwning document ID
block_typetext'heading', 'paragraph', 'code', 'list', 'blockquote', 'table_cell', 'table_row', 'table_align', 'yaml', 'toml', 'html', 'horizontal_rule', 'math', 'definition', 'footnote'
contenttextRaw block content
preintegerInterval-index pre-order boundary
postintegerInterval-index post-order boundary
depthintegerHeading depth (16); NULL/0 for non-headings
langtextCode fence language, when block_type = 'code'
propertiestextRemaining block-type-specific properties as JSON

pre/post are the Nested-Set interval-index boundaries described in Index Layers — they encode heading hierarchy as a pure integer range, which is what the under() function operates on.