@uwdata/mosaic-sql
Version:
SQL query construction and analysis.
32 lines • 1.37 kB
TypeScript
import { type AggregateNode } from '../ast/aggregate.js';
import type { ColumnRefNode } from '../ast/column-ref.js';
import type { SQLNode } from '../ast/node.js';
import type { ParamLike } from '../types.js';
/**
* Indicate if the input AST contains an aggregate expression.
* The string content of verbatim nodes is analyzed to try to identify
* unparsed aggregate functions calls within SQL strings.
* @param root The root of the AST to search.
* @returns Return 0 if no aggregate functions are found.
* Sets bit 1 if an AggregateFunction instance is found.
* Sets bit 2 if an aggregate embedded in verbatim text is found.
*/
export declare function isAggregateExpression(root: SQLNode): number;
/**
* Collect all aggregate function nodes.
* @param root The root of the AST to search.
*/
export declare function collectAggregates(root: SQLNode): AggregateNode[];
/**
* Collect all unique column references.
* Multiple references to the same column are de-duplicated, even if
* they are not object-equal node instances.
* @param root The root of the AST to search.
*/
export declare function collectColumns(root: SQLNode): ColumnRefNode[];
/**
* Collect all unique dynamic parameter instances.
* @param root The root of the AST to search.
*/
export declare function collectParams(root: SQLNode): ParamLike[];
//# sourceMappingURL=visitors.d.ts.map