We ran into the same challenge with SQL parsing and validation early on. Most open-source parsers tend to either choke on dialect quirks or fail silently when dealing with incomplete queries, which makes proper linting or fault tolerance a nightmare. For DB Pro, I ended up writing a lightweight validation layer on top of the parser that can recover gracefully and still provide syntax hints or AI-assisted corrections.
The LLM side gets especially tricky when you want to offer reliable query generation but still ensure correctness and safety. That’s why DB Pro lets users optionally download and run a local model for SQL assistance — so everything stays on the machine and we can still iterate safely without sending any data to the cloud.
Curious how you approached error recovery — did you build your parser from scratch or extend an existing one? And do you plan to release it as a standalone library?
I really think what you showcase in the start of the article is the best thing, being able to statically highlight error in a text form for a user (or for a LLM) to iterate on the fixes is the best thing.