Polyglot SQL API Documentation - v0.1.0
    Preparing search index...

    Type Alias Cast

    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.

    type Cast = {
        default?: Expression | null;
        double_colon_syntax: boolean;
        format?: Expression | null;
        this: Expression;
        to: DataType;
        trailing_comments: string[];
    }
    Index

    Properties

    default?: Expression | null

    DEFAULT value ON CONVERSION ERROR (Oracle): CAST(x AS type DEFAULT val ON CONVERSION ERROR)

    double_colon_syntax: boolean

    Whether PostgreSQL :: syntax was used (true) vs CAST() function (false)

    format?: Expression | null

    FORMAT clause for BigQuery: CAST(x AS STRING FORMAT 'format_string')

    The expression being cast.

    The target data type.

    trailing_comments: string[]