/** * Compare expression tokens while preserving quoted values and identifier case. * SQL the lexer cannot read (e.g. an unterminated quote) falls back to its * normalizeSQLFragment form, encoded as a JSON string so it never equals a token * list. */ export declare function sqlExpressionFingerprint(value: string): string; /** * Whether `expression` is the default ClickHouse stores for a bare EPHEMERAL * column. ClickHouse synthesizes defaultValueOfTypeName(''); * the literal keeps alias spellings (BIGINT, TEXT) that system.columns.type * canonicalizes, so any single string literal counts. */ export declare function isSyntheticEphemeralDefault(expression: string): boolean; /** * Canonical one-line form of a SQL fragment: a view or materialized view `as`, * `partitionBy`, `ttl`, a skip index expression, a projection, a dictionary * `source`/`layout`/`lifetime`, or the same clauses read back from ClickHouse. * * Comments are dropped and every run of whitespace becomes one space, inside * string literals too. Comments must go before the newlines do: a `--`, `//`, * `# ` or `#!` comment ends at its newline, so on a single line it would swallow * the rest of the fragment and the `;` the renderer appends after it (#232). * Comment syntax is ClickHouse's, from the shared lexer: markers inside string * literals, quoted identifiers and heredocs are text, and an unterminated block * comment or string is kept as written for ClickHouse to report. * * A dropped comment leaves one space, so the tokens around it never fuse: a * minus, an empty block comment and a minus become `- -`, not a `--` comment. * Text without comments or a stray `#` normalizes exactly as a plain * whitespace collapse would, and the result is stable: normalizing it again * changes nothing. */ export declare function normalizeSQLFragment(value: string): string; /** * SQL text without its comments, trimmed. Unlike normalizeSQLFragment, all * other text stays as written, including whitespace inside string literals. * chkit renders a column default expression on one line of a CREATE or ALTER * statement, where a `--` comment would swallow the `,`, `COMMENT`, `CODEC` or * `;` after it (#234). * * A run of whitespace and comments that holds a comment becomes one space, so * the tokens around it never fuse, or a newline after a stray `#`, for the * reason normalizeSQLFragment gives. A stray `#` at the end is followed by a * newline too: the ` COMMENT` or ` CODEC` rendered after it would otherwise * turn it into a `# ` comment that hides them. An unterminated block comment * or string is kept as written for ClickHouse to report. */ export declare function stripSQLComments(value: string): string; export declare function normalizeEngine(engine: string): string; //# sourceMappingURL=sql-normalizer.d.ts.map