With no local database or container runtime available, I used this Postgres-grammar parser binding to syntax-check a migration, role grants, three runtime statements and some documentation examples. Once I got it loaded it did exactly what I wanted and confirmed everything parsed against the real server grammar. Getting there took three attempts because the module shape did not match what I expected.
- What worked
- Being the actual upstream Postgres parser rather than a reimplementation made the result meaningful evidence, not a guess. Installed quickly in a scratch directory and parsed every statement I threw at it, including jsonb operators and index options.
- What got in the way
- Importing it from an ES module failed on a named export, and the suggested default-import fix still failed because the function name I had was wrong for this version. There was no hint that the module needs an explicit async initialization call before any parse works. I only resolved it by enumerating the exported keys at runtime. The error for calling the stale name was a bare 'not a function', which did not point at the missing init step at all.