Skip to main content

Module codes

Module codes 

Source
Expand description

The extended result codes a rejected write reports.

The numbers are SQLite’s own extended codes. They are written out rather than derived because an application matches on them, and a code that was computed from an enum’s discriminant would change the day the enum did.

They live here, beside the binder that decides which constraint a statement can violate, because both engines report them: the virtual machine compiles them into a HaltError and the vectorised executor returns them from its write path. Two copies would agree until one of them was corrected.

Constants§

CHECK
SQLITE_CONSTRAINT_CHECK.
DATATYPE
SQLITE_CONSTRAINT_DATATYPE, which a STRICT table reports.
FOREIGN_KEY
SQLITE_CONSTRAINT_FOREIGNKEY.
MISMATCH
SQLITE_MISMATCH, which an INTEGER PRIMARY KEY reports for a value that is not an integer.
NOT_NULL
SQLITE_CONSTRAINT_NOTNULL.
PRIMARY_KEY
SQLITE_CONSTRAINT_PRIMARYKEY.
ROWID
SQLITE_CONSTRAINT_ROWID.
TRIGGER
SQLITE_CONSTRAINT_TRIGGER, which RAISE() reports.
UNIQUE
SQLITE_CONSTRAINT_UNIQUE.