Documentation menu

Diagnostics#

Every typesql diagnostic carries a stable code, source location, reason, and concrete help when a mechanical repair is known. Human text can improve; automation should key on TS####.

text
TS0400 at 3:10: unknown column `amunt`
help: did you mean `amount`?

Code registry#

CodesClass
TS0001TS0007Lexing, invalid characters, and document size
TS0100TS0105Parsing, unsupported syntax, depth, and malformed literals
TS0200TS0201Annotation erasure guarantees
TS0300TS0301Invalid or over-nested type expressions
TS0400Unknown column
TS0401Type mismatch
TS0402satisfies failed
TS0403Invalid cast
TS0404TS0405Function argument count or type
TS0406Recursive function
TS0407Set-operation column count
TS0408JSON shape mismatch
TS0409Alias column count
TS0410TS0412Masked cast, comparison, or flow
TS0500TS0501Target compilation or functional difference
TS0600TS0609Package reference, lock, artifact, hash, format, export, cycle, shadow, bounds, or unused import
TS0700TS0701Rewrite environment or bound
TS0800TS0803Logical-view environment, cycle, bound, or document

Machine form#

Diagnostics are also JSON. Byte spans remain authoritative and render as 1-based line and column positions. Secondary labels point to related declarations when the cause is elsewhere.

Model lint policy#

A model can reclassify registered diagnostic codes in its first 20 comment lines:

sql
-- lint:
--   TS0400: allow
--   TS0609: deny

The block accepts 1–16 unique codes. allow demotes a matching diagnostic to a warning. deny promotes it to an error. Unknown codes, duplicates, malformed entries, or more than one block refuse the model.