pgsql-parser-testing

Run SQL parser and deparser test suites in the pgsql-parser monorepo.

1|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/constructive-io/constructive-skills --skill pgsql-parser-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pgsql-parser-testing
Source: https://github.com/constructive-io/constructive-skills/tree/main/skills/pgsql-parser-testing
Command: npx skills add https://github.com/constructive-io/constructive-skills --skill pgsql-parser-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pnpm, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of testing the pgsql-parser repository, ensuring the accuracy and reliability of SQL parsing and deparsing functionalities.

Core Features & Use Cases

  • Test Execution: Run comprehensive test suites for the SQL parser and deparser.
  • Deparser Debugging: Facilitates fixing issues within the AST-to-SQL conversion logic.
  • SQL Round-trip Validation: Verifies that SQL can be parsed into an Abstract Syntax Tree (AST) and then deparsed back into SQL without loss of fidelity (AST equality).
  • Use Case: When a bug is reported for the SQL deparser, use this Skill to isolate, test, and fix the specific failing test case.

Quick Start

Use the pgsql-parser-testing skill to run all tests in the deparser package.

Frequently Asked Questions about pgsql-parser-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate SQL round-trip correctness when fixing a Postgres parser bug?

To validate SQL round-trip correctness, run the test suite to verify that SQL parses into an AST and deparses back without fidelity loss. This isolates specific failing cases when fixing Postgres parser bugs.

Do I need pnpm to execute tests in the pgsql-parser monorepo?

Yes, pnpm is required for package management and test execution within the monorepo. The testing workflow uses pnpm to run the comprehensive test suites for the SQL parser and deparser.

What is SQL deparsing and when do I need to test AST-to-SQL conversion?

SQL deparsing converts an Abstract Syntax Tree (AST) back into SQL text. You need to test AST-to-SQL conversion when supporting new SQL syntax or fixing issues where deparsed output does not match expected query text.

How do I run tests to debug the SQL deparser logic?

You can debug the SQL deparser logic by running the comprehensive test suites targeted at the deparser package. This workflow isolates failing AST-to-SQL conversion cases to streamline fixing the conversion logic.

Can I use this testing workflow to validate new Postgres SQL syntax support?

Yes, this workflow validates new Postgres SQL syntax support. Running the parser and deparser tests ensures that newly added syntax correctly parses into an AST and deparses back without losing fidelity.

Why does my SQL parser test fail after modifying the AST conversion logic?

SQL parser tests fail after AST conversion changes when the modified logic breaks round-trip equality. Running the test suite isolates the specific SQL syntax case where parsing or deparsing fidelity is lost.