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

    Type Alias DataType

    DataType:
        | { data_type: "boolean" }
        | { data_type: "tiny_int"; length: number | null }
        | { data_type: "small_int"; length: number | null }
        | { data_type: "int"; integer_spelling?: boolean; length: number | null }
        | { data_type: "big_int"; length: number | null }
        | {
            data_type: "float";
            precision: number | null;
            real_spelling?: boolean;
            scale: number | null;
        }
        | { data_type: "double"; precision: number
        | null; scale: number | null }
        | { data_type: "decimal"; precision: number | null; scale: number | null }
        | { data_type: "char"; length: number | null }
        | {
            data_type: "var_char";
            length: number | null;
            parenthesized_length?: boolean;
        }
        | { data_type: "string"; length: number
        | null }
        | { data_type: "text" }
        | { data_type: "binary"; length: number | null }
        | { data_type: "var_binary"; length: number | null }
        | { data_type: "blob" }
        | { data_type: "bit"; length: number | null }
        | { data_type: "var_bit"; length: number | null }
        | { data_type: "date" }
        | { data_type: "time"; precision: number | null; timezone: boolean }
        | { data_type: "timestamp"; precision: number | null; timezone: boolean }
        | { data_type: "interval"; to?: string | null; unit: string | null }
        | { data_type: "json" }
        | { data_type: "json_b" }
        | { data_type: "uuid" }
        | { data_type: "array"; dimension?: number | null; element_type: DataType }
        | { data_type: "list"; element_type: DataType }
        | { data_type: "struct"; fields: StructField[]; nested: boolean }
        | { data_type: "map"; key_type: DataType; value_type: DataType }
        | { assignments?: (string | null)[]; data_type: "enum"; values: string[] }
        | { data_type: "set"; values: string[] }
        | { data_type: "union"; fields: [string, DataType][] }
        | {
            data_type: "vector";
            dimension: number | null;
            element_type: DataType | null;
        }
        | {
            data_type: "object";
            fields: [string, DataType, boolean][];
            modifier: string | null;
        }
        | { data_type: "custom"; name: string }
        | { data_type: "geometry"; srid: number | null; subtype: string | null }
        | { data_type: "geography"; srid: number | null; subtype: string | null }
        | { data_type: "character_set"; name: string }
        | { data_type: "unknown" }

    Enumerate all SQL data types recognized by the parser.

    Covers standard SQL types (BOOLEAN, INT, VARCHAR, TIMESTAMP, etc.) as well as dialect-specific types (JSONB, VECTOR, OBJECT, etc.). Parametric types like ARRAY, MAP, and STRUCT are represented with nested [DataType] fields.

    This enum is used in CAST expressions, column definitions, function return types, and anywhere a data type specification appears in SQL.

    Types that do not match any known variant fall through to Custom { name }, preserving the original type name for round-trip fidelity.

    Type Declaration

    • { data_type: "boolean" }
    • { data_type: "tiny_int"; length: number | null }
    • { data_type: "small_int"; length: number | null }
    • { data_type: "int"; integer_spelling?: boolean; length: number | null }
    • { data_type: "big_int"; length: number | null }
    • {
          data_type: "float";
          precision: number | null;
          real_spelling?: boolean;
          scale: number | null;
      }
    • { data_type: "double"; precision: number | null; scale: number | null }
    • { data_type: "decimal"; precision: number | null; scale: number | null }
    • { data_type: "char"; length: number | null }
    • { data_type: "var_char"; length: number | null; parenthesized_length?: boolean }
    • { data_type: "string"; length: number | null }
    • { data_type: "text" }
    • { data_type: "binary"; length: number | null }
    • { data_type: "var_binary"; length: number | null }
    • { data_type: "blob" }
    • { data_type: "bit"; length: number | null }
    • { data_type: "var_bit"; length: number | null }
    • { data_type: "date" }
    • { data_type: "time"; precision: number | null; timezone: boolean }
    • { data_type: "timestamp"; precision: number | null; timezone: boolean }
    • { data_type: "interval"; to?: string | null; unit: string | null }
      • data_type: "interval"
      • Optionalto?: string | null

        For range intervals like INTERVAL DAY TO HOUR

      • unit: string | null
    • { data_type: "json" }
    • { data_type: "json_b" }
    • { data_type: "uuid" }
    • { data_type: "array"; dimension?: number | null; element_type: DataType }
      • data_type: "array"
      • Optionaldimension?: number | null

        Optional dimension size for PostgreSQL (e.g., [3] in INT[3])

      • element_type: DataType
    • { data_type: "list"; element_type: DataType }
    • { data_type: "struct"; fields: StructField[]; nested: boolean }
    • { data_type: "map"; key_type: DataType; value_type: DataType }
    • { assignments?: (string | null)[]; data_type: "enum"; values: string[] }
    • { data_type: "set"; values: string[] }
    • { data_type: "union"; fields: [string, DataType][] }
    • { data_type: "vector"; dimension: number | null; element_type: DataType | null }
    • {
          data_type: "object";
          fields: [string, DataType, boolean][];
          modifier: string | null;
      }
    • { data_type: "custom"; name: string }
    • { data_type: "geometry"; srid: number | null; subtype: string | null }
    • { data_type: "geography"; srid: number | null; subtype: string | null }
    • { data_type: "character_set"; name: string }
    • { data_type: "unknown" }