Skip to main content

Module key

Module key 

Source
Expand description

Canonical primary keys in SQLite numeric, binary text and blob order.

Functions§

decode_key
Decode and validate the sole canonical representation of a primary key. Equal integral reals and integers decode as integers; SQL values outside keys retain their original storage class in ordinary value encoding.
encode_key
Encode a nonempty list of non-null key components in SQLite value order. Integers and reals share numeric order and equal numbers share bytes. Decoding chooses an integer whenever the number fits exactly in i64. Text uses BINARY collation, the only one synced key columns may declare (§9.2). Composite keys sort lexicographically, with a shorter prefix first.