A better SQL validator and comparison with existing SQL validators

https://news.ycombinator.com/rss Hits: 3
Summary

How a better SQL validator could look. Most SQL validators do one thing: hand your query to a parser, stop at the first syntax error, and throw a generic message back at you, usually detached from the code and without a minimal fix. For real-world work, that’s not enough. When you’re debugging a gnarly migration, reviewing a teammate’s query, or trying to teach a junior dev why the parser choked, you need more than “syntax error at or near …”. You need precise locations, explanations you can act on, and a way to see and trust the fix without playing whack‑a‑mole through your query. Typical shortcomings: ShortcomingResultOnly the first error is reported; subsequent errors are hidden.You fix one thing just to hit the next; wasted cycles and whack‑a‑mole debugging.Errors are shown outside the editor, not inline at the exact location.Context switching and mis-clicks slow you down and hide the real source of the issue.Messages are vague (“syntax error at or near…”) and lack actionable guidance.You’re left guessing at intent; steeper learning curve for less experienced teammates.No suggested fix, or a “fix” that still fails to parse.Dead ends and eroded trust in the tool.No side-by-side diff to see what changed and why.Harder reviews and risky copy‑paste fixes you can’t audit. Those pain points sketch a straightforward blueprint for a better validator: one that keeps going after the first failure to surface multiple issues in a single pass, explains each error in plain language with exact locations, proposes a corrected query with a clear rationale, and lets you compare the original and the fix side-by-side without leaving the editor. I built one here, with AI assistance to make the explanations and fixes actually useful. Inline comments help, but inline annotations with highlights and per-line explanations are better. SQL validation example Below is an intentionally broken PostgreSQL query (validated against PostgreSQL 17). It includes multiple syntax and dialect errors....

First seen: 2025-10-13 08:22

Last seen: 2025-10-13 10:22