feat(parser): add SQL Server PIVOT/UNPIVOT clause parsing#477
feat(parser): add SQL Server PIVOT/UNPIVOT clause parsing#477ajitpratap0 wants to merge 3 commits intomainfrom
Conversation
Add support for SQL Server and Oracle PIVOT/UNPIVOT operators in FROM clauses. PIVOT transforms rows to columns via an aggregate function, while UNPIVOT performs the reverse column-to-row transformation. - Add PivotClause and UnpivotClause AST node types - Add Pivot/Unpivot fields to TableReference struct - Implement parsePivotClause/parseUnpivotClause in new pivot.go - Wire parsing into parseFromTableReference and parseJoinedTableRef - Add PIVOT/UNPIVOT to tokenizer keyword map for correct token typing - Update formatter to render PIVOT/UNPIVOT clauses - Enable testdata/mssql/11_pivot.sql and 12_unpivot.sql - Add 4 dedicated tests covering subquery+alias, plain table, AS alias Closes #456 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @ajitpratap0's task —— View job PR Review: PIVOT/UNPIVOT Parsing ImplementationI've completed a comprehensive review of this PIVOT/UNPIVOT implementation. Review SummaryAST Node Implementation ✅Strengths:
Minor Issues:
Parsing Logic Analysis ✅Strengths:
Improvements Needed:
Formatter Integration ❌Critical Issue - Keyword casing not respected:
Test Coverage Analysis ✅Excellent coverage:
Memory Management & Object Pooling ✅Good practices followed:
Security & Performance ✅Security:
Performance:
Final RecommendationOverall Assessment: Strong implementation with one critical formatter fix needed Required Changes:
Suggested Improvements:
What's Working Well:
The implementation demonstrates strong understanding of the codebase architecture and SQL parsing requirements. The formatter fix is the only blocking issue. |
CVE-2026-32285 affects github.com/buger/jsonparser v1.1.1, which is a transitive dependency via mark3labs/mcp-go → invopop/jsonschema → wk8/go-ordered-map → buger/jsonparser. No fixed version is available upstream. The package is not called directly by any GoSQLX code and risk is scoped to MCP JSON schema generation. Added to .trivyignore until a patched version is released. Fixes Trivy Repository Scan CI failures in PR #475 and #477.
|
Claude finished @ajitpratap0's task —— View job PR Review: PIVOT/UNPIVOT Parsing ImplementationI've completed a comprehensive review of this PIVOT/UNPIVOT implementation focusing on code quality, potential issues, performance, security, and test coverage. Review Checklist
Review SummaryAST Node Implementation ✅Strengths:
Minor Issues:
Parsing Logic Analysis ✅Strengths:
Improvements Needed:
Formatter Integration ❌Critical Issue - Keyword casing not respected:
Test Coverage Analysis ✅Excellent coverage:
Memory Management & Object Pooling ✅Good practices followed:
Security & Performance ✅Security:
Performance:
Final RecommendationOverall Assessment: Strong implementation with one critical formatter fix needed Required Changes:
Suggested Improvements:
What's Working Well:
The implementation demonstrates strong understanding of the codebase architecture and SQL parsing requirements. The formatter fix is the only blocking issue. |
Summary
PIVOT (SUM(sales) FOR region IN ([North], [South]))UNPIVOT (sales FOR region IN (north_sales, south_sales))PivotClauseandUnpivotClauseAST nodes withPivot/Unpivotfields onTableReferenceTest plan
11_pivot.sqland12_unpivot.sqlnow enabled and passingCloses #456
Generated with Claude Code