pgsql-parser
PostgreSQL SQL parsing, deparsing, and AST traversal
All Skills in This Repository (2)
Pure Emerald Level IndicatorsFrequently Asked Questions
FAQPage SchemaHow to install pgsql-parser?โผ
Run `npx skills add constructive-io/pgsql-parser --all -g -y` in your terminal to install all skills in this suite globally.
How to parse PostgreSQL SQL into an AST?โผ
Use the parse function from pgsql-parser, which runs the real PostgreSQL parser via WebAssembly and returns a fully typed syntax tree. You can then modify the tree and deparse it back into valid SQL.
How to walk or rewrite a SQL syntax tree?โผ
Use the walk function from @pgsql/traverse with visitor callbacks keyed by node type, or walkSql from plpgsql-parser when starting from raw SQL text. Field-level edits like renaming schemas work directly on the visited nodes.
Can it lint SQL and PL/pgSQL code?โผ
Yes. The pgsql-lint skill checks source files for issues like unqualified table references, dynamic SQL, and search_path dependencies, with configurable severity and inline suppressions.
Does pgsql-parser support multiple PostgreSQL versions?โผ
Yes. It handles AST transformation across PostgreSQL versions 13 through 17, so you can parse and deparse queries written for older database versions.
Related Repositories in Software Engineering
View All in Software Engineeringโopenclaw
Run a personal AI assistant across your devices and chat apps
superpowers
Gives coding agents a disciplined workflow from idea to merged code
react
AI agent skills for building, testing, and porting React core