-
Notifications
You must be signed in to change notification settings - Fork 31
v16->v17 #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
v16->v17 #177
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
- Fixed syntax error by removing orphaned character - Removed btrim from sqlSyntaxFunctions to prevent unwanted pg_catalog prefixes - Added context-aware substring funcformat handling based on pg_catalog prefix - Improved test count from 230/258 to 237/258 passing tests - Remaining 21 failures mainly involve variadic parameter handling Co-Authored-By: Dan Lynch <[email protected]>
- Added 'DO NOT LOOK AT CI' rule to RULES.md as requested - Enhanced isVariadicParameterType to detect anyarray/variadic types but return false in DropStmt contexts - Should fix polymorphism test expecting FUNC_PARAM_DEFAULT instead of FUNC_PARAM_VARIADIC - Maintains 237/258 passing tests in kitchen-sink/13-14 Co-Authored-By: Dan Lynch <[email protected]>
- Removed aggressive check that treated any single anyarray parameter as variadic - Now only treats single array parameters as variadic if they have specific patterns (ival: -1) - Fixes original-upstream-arrays test regression - Improves test count from 236 to 237 passing tests Co-Authored-By: Dan Lynch <[email protected]>
…s support - Enhanced objfuncargs creation logic for CreateTransformStmt contexts - Fixed variadic parameter detection to be more conservative - Added comprehensive debug scripts for transformation analysis - Current status: 235/258 tests passing (improvement from previous iterations) Co-Authored-By: Dan Lynch <[email protected]>
…o-v15 node wrapping - Add STATUS-13-14.md documenting 235/258 tests passing with failure analysis - Add STATUS-14-15.md documenting 2/258 tests passing with node wrapping issues - Fix transformGenericNode in v14-to-v15 to avoid extra wrapper types - Core transformations (A_Const, String, Float, BitString) working correctly - Node wrapping fix should significantly improve 14-15 test pass rate Co-Authored-By: Dan Lynch <[email protected]>
- Fixed version number: 150000 → 160000 in ParseResult method - Added proper node wrapping for CreateStmt, CommentStmt, List, String, RangeVar, ResTarget - Added proper node wrapping for TypeCast, AlterTableCmd, TypeName methods - Following v13-to-v14 transformer patterns for consistent node wrapping - Updated STATUS-14-15.md to track v15-to-v16 transformer fixes - v14-to-v15 transformer improved from 2/258 to 5/258 passing tests Co-Authored-By: Dan Lynch <[email protected]>
…methods - Fixed ColumnRef, A_Const, FuncCall, Integer, Float, BitString node wrapping - Improved v15-to-v16 transformer from 2/258 to 7/258 passing tests - Following v13-to-v14 transformer patterns for consistent node wrapping - All methods now properly transform child nodes and return wrapped results Co-Authored-By: Dan Lynch <[email protected]>
…-v16 transformer - Fixed A_Expr with proper name, lexpr, rexpr transformation - Fixed BoolExpr with args array transformation - Fixed Alias with colnames array transformation - Fixed Boolean with boolval field transformation - Continuing systematic node wrapping approach following v13-to-v14 patterns Co-Authored-By: Dan Lynch <[email protected]>
…tar in v15-to-v16 - Fixed A_ArrayExpr with elements array transformation - Fixed A_Indices with lidx/uidx transformation - Fixed A_Indirection with arg and indirection array transformation - Fixed A_Star with empty result wrapper - Switching focus back to v14-to-v15 transformer as requested Co-Authored-By: Dan Lynch <[email protected]>
…-v14 patterns - Updated visit method to use transformGenericNode as fallback when no specific method exists - Made transformGenericNode private for consistency with v13-to-v14 transformer - This should fix the core issue where String and other node transformations weren't being called - Updated STATUS files to reflect current progress: 13-14 at 237/258, 14-15 at 5/258 (testing improvements) - Following Dan's request to focus on 14-15 transformer instead of 15-16 Co-Authored-By: Dan Lynch <[email protected]>
- Updated test results: 6/258 passing (improved from 2/258) - Noted that String transformation issues persist despite visit method fixes - Ready to stop work as requested by Dan Co-Authored-By: Dan Lynch <[email protected]>
- Add TypeName method to handle pg_catalog prefix for JSON types - Implement VALUES context detection to exclude JSON types in VALUES clauses - Fix List method to properly propagate transformation context - Add context helper methods for different transformation scenarios - Update version number to 170004 for PG17 compatibility Current status: VALUES context detection working but still debugging test failures Co-Authored-By: Dan Lynch <[email protected]>
- Removed all pg_catalog prefix logic for JSON types - Still investigating root cause of test failures - 9 tests still failing, need to understand structural differences Co-Authored-By: Dan Lynch <[email protected]>
…race transformation issues Co-Authored-By: Dan Lynch <[email protected]>
… add pg_catalog prefix for JSON types - Fixed critical issue where TypeName nodes were unwrapped when reaching TypeCast method - Added direct handling of unwrapped TypeName data in TypeCast method - Implemented pg_catalog prefix logic for JSON types in PG17 - Reduced failing tests from 11 to 4 out of 258 total tests - JSON type transformation now working correctly for most cases Co-Authored-By: Dan Lynch <[email protected]>
Co-Authored-By: Dan Lynch <[email protected]>
- Removed unconditional JSON pg_catalog prefix addition from TypeName method - Down to 8 failing tests out of 258 total (250 passing) - All remaining failures are related to pg_catalog prefixes being added to JSON types - Need to investigate source of pg_catalog prefixes since they persist after removal Co-Authored-By: Dan Lynch <[email protected]>
…st methods Co-Authored-By: Dan Lynch <[email protected]>
…pattern Co-Authored-By: Dan Lynch <[email protected]>
…refix handling - Add TypeCast method to handle both wrapped and unwrapped TypeName results - Implement JSON type detection and pg_catalog prefix addition - Achieve 255/258 tests passing (98.8% success rate) in kitchen-sink/16-17 suite - Follow v13-to-v14 transformer patterns for consistency - Handle edge cases in TypeName transformation for JSON types Co-Authored-By: Dan Lynch <[email protected]>
Co-Authored-By: Dan Lynch <[email protected]>
…ethod - Simplified TypeCast method to basic pass-through transformation - Removed context-insensitive JSON prefix addition that was causing test failures - Current status: 249/258 tests passing (9 failures remaining) - Need targeted approach for JSON prefix logic based on specific contexts Co-Authored-By: Dan Lynch <[email protected]>
…st methods - Simplified both methods to basic pass-through transformations - Current status: 250/258 tests passing (8 failures remaining) - Ready to implement targeted JSON prefix logic for specific contexts Co-Authored-By: Dan Lynch <[email protected]>
…sing, 98.8%) Co-Authored-By: Dan Lynch <[email protected]>
bfc2184 to
413a21a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PostgreSQL 16-to-17 AST Transformer Implementation
Summary
This PR implements a comprehensive PostgreSQL 16-to-17 AST transformer for the launchql/pgsql-parser repository, achieving 255/258 tests passing (98.8% success rate) in the 16-17 test suite. The transformer handles complex AST node transformations including JSON type prefixing, context-aware transformations, and various PostgreSQL syntax differences between versions 16 and 17.
Key accomplishments:
Review & Testing Checklist for Human
::jsonand::jsonbcasts in different contexts (CREATE DOMAIN, WITH clauses, simple SELECT statements) to verify the context-aware prefix logic works correctlyisInWithClauseContext,isInCreateDomainContext, and related methods to ensure they correctly identify AST contexts for transformation rulesDiagram
%%{ init : { "theme" : "default" }}%% graph TD subgraph "Core Transformer Files" V16ToV17["packages/transform/src/transformers/v16-to-v17.ts"]:::major-edit STATUS["packages/transform/STATUS-16-17.md"]:::minor-edit end subgraph "Test Infrastructure" TestSuite["__tests__/kitchen-sink/16-17/*.test.ts"]:::context Fixtures["__fixtures__/kitchen-sink/**/*.sql"]:::context end subgraph "Key Transformation Methods" TypeName["TypeName() - JSON prefix logic"]:::major-edit TypeCast["TypeCast() - Context-aware transforms"]:::major-edit Context["Context detection methods"]:::major-edit end subgraph "Remaining Issues" JSON["pretty-misc.test.ts - JSON prefixes"]:::context Escaping["misc-quotes_etc.test.ts - String escaping"]:::context AccessMethod["latest-postgres-create_am.test.ts - PG16 parser limit"]:::context end V16ToV17 --> TypeName V16ToV17 --> TypeCast V16ToV17 --> Context TestSuite --> JSON TestSuite --> Escaping TestSuite --> AccessMethod subgraph Legend L1["Major Edit"]:::major-edit L2["Minor Edit"]:::minor-edit L3["Context/No Edit"]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
pg_catalogprefixes in some contexts but not others