#[non_exhaustive]pub enum ErrorCode {
Show 14 variants
SyntaxError,
UnknownTable,
UnknownColumn,
UnknownFunction,
AmbiguousColumn,
TypeMismatch,
MissingAnnotation,
InvalidAnnotation,
ColumnCountMismatch,
DuplicateAlias,
InvalidRecursion,
InvalidConfig,
UnresolvedType,
InternalError,
}Expand description
A machine-readable classification for a ScytheError.
Marked #[non_exhaustive] so that adding a variant is not a breaking change
for downstream crates matching on it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SyntaxError
UnknownTable
UnknownColumn
UnknownFunction
AmbiguousColumn
TypeMismatch
MissingAnnotation
InvalidAnnotation
ColumnCountMismatch
DuplicateAlias
InvalidRecursion
InvalidConfig
The user’s configuration is wrong — an unknown [[sql.gen]] key, an
unrecognized option value, a malformed manifest override. Distinct from
ErrorCode::InternalError, which means scythe itself is at fault.
UnresolvedType
A construct the analyzer diagnosed correctly but that has no neutral-type
representation scythe can hand to codegen: a set-returning function’s
anonymous record column referenced in select-list position
(json_each, json_populate_record, …), a multi-element ROW(...)/
tuple constructor, or any other expression infer_expr_type genuinely
cannot resolve. Distinct from ErrorCode::TypeMismatch, which covers
an expression that could have been typed but nothing in the query gave
it one (a bare NULL/placeholder, both arms of a UNION untyped) — this
code is for input scythe understood and rejected on purpose (#223),
mirroring the existing one-code-per-marker-family pattern
(ErrorCode::AmbiguousColumn, ErrorCode::UnknownColumn,
ErrorCode::UnknownFunction) rather than folding into TypeMismatch.