-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Since withClause has type WithClause and walk only handles Node type, the entire withClause is skipped.
pgsql-parser/packages/traverse/src/17/runtime-schema.ts
Lines 8514 to 8519 in 7e4343a
| { | |
| name: 'withClause', | |
| type: 'WithClause', | |
| isArray: false, | |
| optional: true | |
| } |
pgsql-parser/packages/traverse/src/traverse.ts
Lines 72 to 83 in 7e4343a
| for (const field of nodeSpec.fields) { | |
| if (field.type === 'Node' && nodeData[field.name] != null) { | |
| const value = nodeData[field.name]; | |
| if (field.isArray && Array.isArray(value)) { | |
| value.forEach((item, index) => { | |
| walk(item, actualCallback, path, [...path.keyPath, field.name, index]); | |
| }); | |
| } else if (!field.isArray) { | |
| walk(value, actualCallback, path, [...path.keyPath, field.name]); | |
| } | |
| } | |
| } |
Same issue applies to union larg and rarg.
Expected behavior
Walk should traverse with clause and union.
Actual behavior
Walk skips with clause and union.
Metadata
Metadata
Assignees
Labels
No labels