pgsql-ast-parser

JSON →
library 10.5.10 ·javascript
verified Jun 5, 2026

A TypeScript Postgres SQL syntax parser that produces a typed AST (Abstract Syntax Tree) covering common PostgreSQL syntaxes. Current stable version is 10.5.10, released frequently with CI. Key differentiators: works in both Node.js and browser, provides typed ASTs for TypeScript users, includes AST visitors/mappers for traversal and modification, and supports converting AST back to SQL. It does not support PL/pgSQL and may not cover all edge cases. Built primarily for pg-mem, an in-memory PostgreSQL emulator.