jsonb

fun <T : Any> Table.jsonb(name: String, serialize: (T) -> String, deserialize: (String) -> T): Column<T>

Creates a column, with the specified name, for storing JSON data in decomposed binary format.

Note: JSON storage in binary format is not supported by all vendors; please check the documentation.

Parameters

name

Name of the column

serialize

Function that encodes an object of type T to a JSON String

deserialize

Function that decodes a JSON string to an object of type T


inline fun <T : Any> Table.jsonb(name: String, jsonConfig: Json, kSerializer: KSerializer<T> = serializer<T>()): Column<T>

Creates a column, with the specified name, for storing JSON data in decomposed binary format.

Note: JSON storage in binary format is not supported by all vendors; please check the documentation.

Parameters

name

Name of the column

jsonConfig

Configured instance of the Json class

kSerializer

Serializer responsible for the representation of a serial form of type T. Defaults to a generic serializer for type T

Samples

org.jetbrains.exposed.sql.json.JsonBColumnTests.testLoggerWithJsonBCollections