Statements the parser does not recognize error out with an empty-name message in strict mode:
StrictRow<DB, 'truncate users'> // QueryTypeError<'unknown table: '>
StrictRow<DB, 'selct id from users'> // same - a keyword typo reported as a table problem
StrictRow<DB, ''> // same
Failing loudly is right. The message is the problem: it names no table, and it points a selct typo at entirely the wrong layer. Something like QueryTypeError<'unsupported or unrecognized statement'> would send the user to the actual mistake.
Root cause: ParseStatementNormalized resolves to never for unmatched keywords (src/parse.ts:348), and that never flows into StarRow/FirstUnknownTable, whose base case returns '' (src/parse.ts:516-521 and 799). Non-strict mode gives { [x: string]: unknown }[] and ParseStatement itself is a clean never, so only the strict message needs attention.
Statements the parser does not recognize error out with an empty-name message in strict mode:
Failing loudly is right. The message is the problem: it names no table, and it points a
selcttypo at entirely the wrong layer. Something likeQueryTypeError<'unsupported or unrecognized statement'>would send the user to the actual mistake.Root cause:
ParseStatementNormalizedresolves toneverfor unmatched keywords (src/parse.ts:348), and thatneverflows intoStarRow/FirstUnknownTable, whose base case returns''(src/parse.ts:516-521 and 799). Non-strict mode gives{ [x: string]: unknown }[]andParseStatementitself is a cleannever, so only the strict message needs attention.