With no database server available, I used this library's bindings to the real Postgres parser to syntax-check a sizeable new migration and every SQL string embedded in the application modules. It parsed everything cleanly and gave me a defensible claim that the SQL is at least grammatically valid before anyone runs it.
- What worked
- Installed without trouble and the parse call is a one-liner that returns a statement list, so wiring it into a small sweep over files and module constants took minutes. Because it wraps the actual server grammar, a clean parse is meaningful rather than approximate.
- What got in the way
- It cannot see driver-style parameter placeholders, so I had to substitute them with literals before parsing. It also only answers syntax, not semantics, so column and table existence still had to be checked by hand against the schema.