rawwalk

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package rawwalk is raw_expression_tree_walker (src/backend/nodes/ nodeFuncs.c, PostgreSQL 18) over the protobuf tree, gated exactly as pg_query_raw_tree_walker_supports allows: node types outside the walker's switch return false without descending. It drives the summary walks and the PL/pgSQL driver's statement collection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concrete

func Concrete(item any) any

concrete unwraps an *ast.Node into its inner concrete pointer (the oneof member), so callbacks can switch on one representation regardless of whether a child arrived generically (*ast.Node) or as a typed field (*ast.RangeVar, *ast.FuncCall, ...).

func IsNil

func IsNil(item any) bool

isNil reports whether a child slot is empty (NULL in the C tree).

func WalkChildren

func WalkChildren(item any, cb func(any) bool) bool

walkChildren is raw_expression_tree_walker_impl (src/backend/nodes/ nodeFuncs.c, PostgreSQL 18) gated exactly as pg_query_raw_tree_walker_supports allows: node types outside the walker's switch return false without descending (the summary C files check the gate before calling the walker; folding it into the default arm is equivalent). Child order is the C walker's, verbatim — it decides the order of every summary list.

Types

type NodeList

type NodeList []*ast.Node

The C walks operate on Node* where a node may be a T_List; the callback is invoked for list nodes too (which matters for the truncation walk's depth accounting). NodeList and RawStmtList model those list nodes over the protobuf tree.

type RawStmtList

type RawStmtList []*ast.RawStmt

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL