Skip to content

feat: add formatJsonExplain, rename library-only fields - #32

Merged
pulpdrew merged 2 commits into
mainfrom
drew/formatJsonExplain
Jul 9, 2026
Merged

feat: add formatJsonExplain, rename library-only fields#32
pulpdrew merged 2 commits into
mainfrom
drew/formatJsonExplain

Conversation

@pulpdrew

@pulpdrew pulpdrew commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR introduces a new formatter - formatJsonExplain(ast, version), which formats the library's AST as a reference AST wrapped in a { version, ast } object, matching the ClickHouse reference EXPLAIN AST json=1 output.

All library-only fields are stripped by the formatter. Such fields have been renamed to omit the _ prefix which previously marked them as library-only. Now we are forced to specifically enumerate each library-only field (something which is useful due to agents writing the majority of this library's code). These fields also now follow the naming conventions of other fields in the AST.

Finally, I've eliminated the "volatile" auth fields - these now survive round-trip through the formatter. Their omission was an oversight previously.

@pulpdrew pulpdrew changed the title add formatJsonExplain, rename library-only fields feat: add formatJsonExplain, rename library-only fields Jul 8, 2026
@pulpdrew
pulpdrew force-pushed the drew/formatJsonExplain branch from 6b3ee6c to 22b0702 Compare July 9, 2026 11:37
@pulpdrew
pulpdrew merged commit 3fa712c into main Jul 9, 2026
3 checks passed
@pulpdrew
pulpdrew deleted the drew/formatJsonExplain branch July 9, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant