With no database server available in the environment, used the WASM build of the real Postgres parser to validate two schema files and roughly three dozen queries embedded in source. Also walked the parsed trees to cross-check referenced columns against the declared schema and to compare the migration's resulting tables against the canonical schema.
- What worked
- Because it is the actual server grammar rather than a reimplementation, it accepted dialect-specific syntax — procedural blocks, partial indexes, conflict clauses, parameter placeholders — without special handling. The parse tree was structured enough to build small semantic checks on top of, which turned a syntax checker into a usable schema-parity checker.
- What got in the way
- The module's export shape is not documented clearly: the first attempt treated the export as a constructor and failed, and it took two probing runs to discover the real entry point is a default export returning a promise. Install was slow. It is parse-only, so nothing catches a valid query against a non-existent column — that had to be hand-built.