/** * Domain-specific AST helpers for the safegres auditor, layered on top of * `@pgsql/traverse`'s `walk` / `NodePath`. */ import type { PgAstNode } from './parse'; /** Find every node tagged with `tag` (e.g. `FuncCall`, `ColumnRef`). */ export declare function findAll(root: PgAstNode, tag: string): Record[]; /** Visit every tagged node. `visit(node, tag, parent)` matches the old API. */ export type Visitor = (node: Record, tag: string, parent: Record | null) => void; export declare function visitAll(root: PgAstNode, visit: Visitor): void; /** * Extract the printable name of a `FuncCall.funcname` field. * * `funcname` is an array of `{ String: { sval: "..." } }` nodes — usually one * element (bare name) or two (schema-qualified). */ export declare function funcNameParts(funcCall: Record): { schema?: string; name: string; }; /** Get the printable qualified name (`schema.name` or `name`). */ export declare function funcNameQualified(funcCall: Record): string; /** * Get a ColumnRef's dotted name path. Example: `s.actor_id` → `['s', 'actor_id']`. * Returns `['*']` for `SELECT *`. */ export declare function columnRefPath(columnRef: Record): string[];