Skip to content

The row format v1 is the value of a table row. It is shared by the SQL layer and the columnar decoder, which can split it back into columns.

0x01 ‖ varint ncells ‖ cell*
cell = tag u8 ‖ payload
Tag Type Payload
0 NULL none
1 INT zvarint
2 FLOAT 8 bytes, f64 bits little-endian
3 TEXT varint len ‖ bytes (UTF-8)
4 BYTES varint len ‖ bytes
5 BOOL u8 (0 false, any other value true)
6 TIMESTAMP zvarint, microseconds
7 JSON varint len ‖ bytes (UTF-8 text)

The leading 0x01 is the row-format version. ncells is a varint. A reader rejects any other version byte, any other tag, invalid UTF-8 in TEXT or JSON, and a cell that runs past the end of the value; trailing bytes after the last cell are not checked. Missing columns beyond ncells read as NULL.

Cells are in column-id slot order (TableDef::encode_stored). Slots of dropped columns hold NULL. Missing trailing slots read as the column’s fill value, see Ext S: schema. Tables marked ordered store cells in declaration order instead.