You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add critical async parser requirement to RULES.md
- Document that @pgsql/parser methods are async and require await
- Explain impact on visitor pattern when not properly awaited
- Add common symptoms and correct usage examples
- Remove debug logging from v13-to-v14 transformer
Investigation revealed that FuncCall visitor pattern IS working correctly
in real test suite - the issue was a misunderstanding, not a broken pattern.
Co-Authored-By: Dan Lynch <[email protected]>
constresult=awaitparser.parse(sql, { version:'13' }); // With await
166
+
```
167
+
168
+
**Impact on Transformers:** If parser calls are not properly awaited, the transformer will receive empty objects `{}` instead of AST structures, causing visitor pattern methods (like `FuncCall`) to never be invoked.
169
+
170
+
**Common Symptoms:**
171
+
- Transformer methods like `FuncCall` never get called
172
+
- Empty AST objects `{}` instead of proper structures
173
+
- Visitor pattern appears broken but works with mock data
174
+
- Tests fail because transformations aren't applied
175
+
150
176
## Summary
151
177
152
-
Always use `@pgsql/parser` for multi-version PostgreSQL AST parsing in the transform package. This is the only way to get accurate version-specific results and build working transformers.
178
+
Always use `@pgsql/parser` for multi-version PostgreSQL AST parsing in the transform package. This is the only way to get accurate version-specific results and build working transformers. Remember that all parser methods are async and must be awaited.
0 commit comments