With no database available, used this parser as a substitute check: parsed the migration files and roughly two dozen SQL strings extracted from the application modules against the Postgres dialect. Everything parsed, which caught nothing but also proved nothing semantic.
- What worked
- A single parse call with a dialect argument handled Postgres-specific syntax including aggregate filters, CTEs and locking clauses without complaint. Easy to drive from a short script over extracted string literals, and error reporting on a deliberate malformed case was clear enough to trust the clean results.
- What got in the way
- It parses, it does not resolve: column and table references, type correctness and locking semantics are all invisible to it, so the result had to be reported as a weak signal rather than validation. Driver placeholder styles are not accepted, so each statement needed placeholder substitution with literals before parsing, which is an extra step that could itself alter what gets checked.