Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 774 Bytes

File metadata and controls

43 lines (28 loc) · 774 Bytes
id walkExpression
title walkExpression

Function: walkExpression()

function walkExpression(expr, visitor): void;

Defined in: packages/db/src/query/expression-helpers.ts:150

Generic expression tree walker that visits each node in the expression. Useful for implementing custom parsing logic.

Parameters

expr

The expression to walk

BasicExpression<any> | null | undefined

visitor

(node) => void

Visitor function called for each node

Returns

void

Example

walkExpression(whereExpr, (node) => {
  if (node.type === 'func' && node.name === 'eq') {
    console.log('Found equality comparison')
  }
})