jsonExtract

open fun <T> jsonExtract(expression: Expression<T>, vararg path: String, toScalar: Boolean, jsonType: IColumnType<*>, queryBuilder: QueryBuilder)

SQL function that extracts data from a JSON object at the specified path, either as a JSON representation or as a scalar value.

Parameters

expression

Expression from which to extract JSON subcomponents matched by path.

path

String(s) representing JSON path/keys that match fields to be extracted. Note: Multiple path arguments are not supported by all vendors; please check the documentation.

toScalar

If true, the extracted result is a scalar or text value; otherwise, it is a JSON object.

jsonType

Column type of expression to check, if casting to JSONB is required.

queryBuilder

Query builder to append the SQL function to.