import { astVisitor } from "https://deno.land/x/pgsql_ast_parser@11.2.0/index.ts";
Builds an AST visitor based on the default implementation, merged with the one you provide.
Example of visitor which counts references to a column 'foo':
let cnt = 0;
const visitor = astVisitor(v => ({
ref: r => {
if (r.name === 'foo') {
cnt++;
}
v.super().ref(r);
}
}));
visitor.statement(myStatementToCount);
console.log(`${cnt} references to foo !`);
Type Parameters
optional
T extends IAstPartialVisitor = IAstPartialVisitorParameters
visitorBuilder: (defaultImplem: IAstVisitor) => T