package granary
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8b18780ea373be48301d9f333925860a2f9110fc0ac28684295118d72b65a67e
sha512=25ca3c9c5e2b528704a542502e0f37dc33ba003f65622d969b8c2b800778585f8ef0cf89b36e6679832e3993e8303aecddfc662742baf7044d6afe4a796b8f11
doc/granary.encoding/Granary_encoding/Row/index.html
Module Granary_encoding.RowSource
Row 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 withpk_desc = trueis a NON-alias (hidden rowid + implicit__pkunique index), matching SQLite. Only meaningful whenprimary_keyis 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.