Skip to content

fix(diagnostics): give unaliased output names their own code and help - #79

Merged
kvlonge merged 5 commits into
mainfrom
fix/unaliased-output-names
Nov 5, 2026
Merged

kvlonge merged 5 commits into
mainfrom
fix/unaliased-output-names

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Why

SELECT 1 FROM orders, the first thing many people type, was refused as SQ0003, an operand type problem. Its help suggested a cast and its span covered the whole statement. The real cause is the unaliased output name, which SQLQuack has not verified for that shape.

Changes

  • New code SQ0009 unaliased_output_name, appended to the code registry and its lock. Title: "this column has no alias, and SQLQuack has not verified the name Snowflake gives it". Help: "add an alias, e.g. AS one". sqlquack explain SQ0009 documents it.
  • The refusal is placed on the select item. Known gap: a bare literal still spans the statement, because the parser records no position for literals.

Verification

  • A CLI end-to-end test asserts the text and JSON diagnostic (code, span, label, help).
  • Core, rules, semantics and CLI tests pass; clippy and fensu check pass.
  • Merged onto feat: measure translation results by catalogue form #69, the translation checker holds its baseline, with unchanged figures.
  • D94 gate result follows as a comment.

An unaliased select item whose generated name is not verified was refused as SQ0003,
an operand type problem with a cast as help. Refuse it as SQ0009 unaliased_output_name,
placed on the item, with an alias as the help.
…efusals

Regenerate the diagnostics reference, list SQ0009 among convert's refusals, and give
it an example that stays refused once verified names convert.

kvlonge commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

D94 gate passed for head 73e55ab against main 292aca7 (clean checkout, RECORDER=0):

  • make check-ci: exit 0
  • make test: exit 0
  • verify-recorded coverage, head and base: both exit 0, and the coverage reports are byte-identical (8,459 cases, 0 failed). Coverage didn't change.

Landing by fast-forward.

@kvlonge
kvlonge merged commit 73e55ab into main Nov 5, 2026
1 check passed
@kvlonge
kvlonge deleted the fix/unaliased-output-names branch November 9, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant