Granary_encoding.RowSourceRow schema and value (de)serialisation.
Defines column types (ty), DEFAULT/CHECK/GENERATED column metadata (column, schema) and the runtime cell values of a row (t), plus the binary encode/decode of a row against its schema.
type column = {name : string;ty : ty;not_null : bool;primary_key : bool;pk_desc : bool;#312: this PK column was declared PRIMARY KEY DESC. A single-column INTEGER PK with pk_desc = true is a NON-alias (hidden rowid + implicit __pk unique index), matching SQLite. Only meaningful when primary_key is set.
default : default_value option;check_sql : string option;generated_as : (string * bool) option;Some (expr_sql, is_stored): GENERATED ALWAYS AS expr. is_stored=true => STORED; false => VIRTUAL (both computed at write time).
*)}encode schema row serialises row to its on-disk byte representation according to schema.
decode schema bytes reconstructs a row from its on-disk representation according to schema.
decode_prefix schema bytes ~upto decodes only columns 0, upto; columns beyond upto are left V_null and never decoded/allocated (#247). Use only when no consumer reads a column index > upto — it skips trailing columns (e.g. a large TEXT payload) an aggregate over a column prefix never needs. Columns in 0, upto are identical to decode.