import { type ProtocolExpression } from '@hypequery/protocol'; /** * SQL portability compiler (R1A-07). * * Parses the supported ClickHouse SQL-expression subset used by SQL-backed * dimensions and measures into an RFC 0003 expression AST. Unsupported syntax * becomes a source-located incompatibility issue instead of executing or * silently changing meaning. */ export type SqlPortabilityIssueCode = 'HQ_SQL_PORT_SYNTAX' | 'HQ_SQL_PORT_UNSUPPORTED_FUNCTION' | 'HQ_SQL_PORT_UNSUPPORTED_OPERATOR' | 'HQ_SQL_PORT_UNSUPPORTED_LITERAL' | 'HQ_SQL_PORT_UNSUPPORTED_SYNTAX' | 'HQ_SQL_PORT_TOO_COMPLEX' | 'HQ_SQL_PORT_TOO_LARGE'; export interface SqlPortabilityIssue { readonly code: SqlPortabilityIssueCode; readonly message: string; readonly start: number; readonly end: number; } export interface SqlPortabilityLimits { readonly maxInputBytes: number; readonly maxDepth: number; readonly maxNodes: number; } export interface SqlPortabilityOptions { readonly limits?: Partial; } export interface SqlPortabilitySuccess { readonly portable: true; readonly expression: ProtocolExpression; readonly dependencies: readonly string[]; } export interface SqlPortabilityFailure { readonly portable: false; readonly issues: readonly SqlPortabilityIssue[]; } export type SqlPortabilityResult = SqlPortabilitySuccess | SqlPortabilityFailure; export declare const DEFAULT_SQL_PORTABILITY_LIMITS: Readonly; /** * Compile a SQL expression fragment into an RFC 0003 expression. The result * expression always passes RFC 0003 validation; dependencies are the sorted, * deduplicated referenced identifiers. */ export declare function compilePortableSqlExpression(sql: string, options?: SqlPortabilityOptions): SqlPortabilityResult; //# sourceMappingURL=sql-portability.d.ts.map