prorm API Reference
    Preparing search index...

    Function jsonExtract

    • Extract a value at a JSON path from expr as a typed, cross-dialect SQL expression usable in attributes / SELECT.

      Dialect syntax sources (matched against this codebase's existing internal dialect helpers where they exist):

      • mysql/mariadb: src/dialects/{mysql,mariadb}/index.ts buildJsonExtract -> JSON_UNQUOTE(JSON_EXTRACT(col, '$.path')) (asText) / JSON_EXTRACT(col, '$.path').
      • mssql: src/dialects/mssql/index.ts buildJsonExtract -> JSON_VALUE(col, '$.path') (asText) / JSON_QUERY(col, '$.path').
      • sqlite: src/dialects/sqlite/index.ts buildJsonExtract -> CAST(json_extract(col, '$.path') AS TEXT) (asText) / json_extract(col, '$.path').
      • postgres/cockroachdb: src/query-builders/where-builder.ts #>>/#> handling -> col #>> '{a,b}' (asText) / col #> '{a,b}'.
      • oracle: Oracle SQL/JSON functions -> JSON_VALUE(col, '$.path') (asText) / JSON_QUERY(col, '$.path').
      • snowflake: src/dialects/snowflake/index.ts buildJsonQuery -> col:a.b::STRING (asText) / col:a.b (VARIANT, non-text).
      • redshift: SUPER-type dot navigation (see getDataTypeSql mapping JSON/JSONB -> SUPER in src/dialects/redshift/index.ts) -> CAST(col.a.b AS VARCHAR) (asText) / col.a.b.
      • db2: Db2 JSON_VAL/JSON_QUERY path functions -> JSON_VAL(col, 'a.b') (asText) / JSON_QUERY(col, '$.a.b').
      • clickhouse: JSONExtractString(col, 'a', 'b') (asText) / JSONExtractRaw(col, 'a', 'b').

      Parameters

      Returns { $literal: string }