Polyglot SQL API Documentation - v0.2.0
    Preparing search index...

    Function findAncestor

    • Find the nearest ancestor of a target node that matches a predicate.

      Walks the tree from the root, tracking the ancestor stack. When the target is found, searches ancestors from nearest to farthest.

      Uses reference equality (===) to identify the target.

      Parameters

      Returns Expression | null

      The matching ancestor, or null if none matches or target not found.