prorm API Reference
    Preparing search index...

    Function split

    • Split a string on a delimiter, returning an array/collection expression where the dialect has a real mechanism for it.

      • Postgres, CockroachDB: STRING_TO_ARRAY(expr, delimiter) -> text[].
      • Redshift: SPLIT_TO_ARRAY(expr, delimiter) -> SUPER array (Redshift's SUPER-type based array support).
      • Snowflake: SPLIT(expr, delimiter) -> ARRAY (variant).
      • ClickHouse: splitByString(delimiter, expr) -> Array(String). Note the argument order is reversed compared to the others (separator comes first in ClickHouse).
      • MySQL, MariaDB, MSSQL, Oracle, DB2, SQLite: throw. None of these have a clean way to produce an array/collection from a scalar expression:
        • MySQL/MariaDB have no array type at all (only SUBSTRING_INDEX for extracting a single part by position, which is a different contract).
        • MSSQL's STRING_SPLIT is a table-valued function usable only in a FROM clause, not as a scalar expression.
        • Oracle/DB2/SQLite have no built-in split-to-array function; producing one requires CONNECT BY/recursive CTE tricks that cannot be expressed as a single SQL fragment.

      Parameters

      Returns LiteralExpression & { $literal: string }