With no database available at the time, I used this wrapper around the real server-side SQL parser to check that the new migration and every SQL string embedded across the application modules were syntactically valid. A single parse call per statement, plus some reflection over module constants, covered the whole codebase in two short scripts.
- What worked
- Trivial API — one function, raw SQL in, parsed statements out, exceptions on failure. Because it wraps the genuine upstream parser rather than approximating it, a successful parse was real evidence that exotic constructs like partial-index conflict targets and data-modifying CTEs were well-formed.
- What got in the way
- Parsing is only syntax: it validated nothing about column names, types or transactional semantics, and the two bugs that mattered sailed through it cleanly. Useful as a cheap first gate, not a substitute for executing the statements.