// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { DataType } from "./DataType";
import type { Expression } from "./Expression";

/**
 * Represent a type cast expression.
 *
 * Covers both the standard `CAST(expr AS type)` syntax and the PostgreSQL
 * shorthand `expr::type`. Also used as the payload for `TryCast` and
 * `SafeCast` variants. Supports optional FORMAT (BigQuery) and DEFAULT ON
 * CONVERSION ERROR (Oracle) clauses.
 */
export type Cast = { 
/**
 * The expression being cast.
 */
this: Expression, 
/**
 * The target data type.
 */
to: DataType, trailing_comments: Array<string>, 
/**
 * Whether PostgreSQL `::` syntax was used (true) vs CAST() function (false)
 */
double_colon_syntax: boolean, 
/**
 * FORMAT clause for BigQuery: CAST(x AS STRING FORMAT 'format_string')
 */
format?: Expression | null, 
/**
 * DEFAULT value ON CONVERSION ERROR (Oracle): CAST(x AS type DEFAULT val ON CONVERSION ERROR)
 */
default?: Expression | null, };
