import type { Expr, GenericSQLExpr, StructDef } from './malloy_types'; import type { DialectFieldList } from '../dialect'; /** simple indent function */ export declare function indent(s: string): string; /** * Generate a SQL string literal from a given `input` string, safe, e.g., to be used in `WHERE` clauses. */ export declare function generateSQLStringLiteral(input: string): string; /** * WHERE and HAVING clauses are built out of a chain of boolean experssions * joined with AND. */ export declare class AndChain { private clauses; constructor(intial?: string); clone(): AndChain; add(clause: string): AndChain; addChain(andChain: AndChain): AndChain; empty(): boolean; present(): boolean; sqlOr(): string; sql(whereOrHaving?: 'where' | 'having'): string; } export declare function generateHash(input: string): string; export declare function joinWith(els: T[][], sep: T): T[]; export declare function range(start: number, end: number): number[]; export declare function exprKids(eNode: Expr): IterableIterator; export declare function exprWalk(eNode: Expr, order?: 'pre' | 'post'): IterableIterator; export declare function exprMap(eNode: Expr, mapFunc: (e: Expr) => Expr): Expr; export type SQLExprElement = string | Expr; /** * Take a mixed array of strings and Expr and turn it into an SQLExpr * expression node. */ export declare function composeSQLExpr(from: SQLExprElement[]): GenericSQLExpr; export declare function getDialectFieldList(structDef: StructDef): DialectFieldList; /** * A little extra paranoia to save us from fields which contain the special * characters used to build the grouping key. */ export declare function pathToKey(node: string, fields: string[]): string; export declare function groupingKey(node: string, fields: string[]): string; export declare function caseGroup(groupSets: number[], s: string): string; export declare class GenerateState { whereSQL?: string; applyValue?: string; totalGroupSet: number; withWhere(s?: string): GenerateState; withApply(s: string): GenerateState; withTotal(groupSet: number): GenerateState; }