# jsonb

fun <T : Any> Table.jsonb(name: String, serialize: (T) -> String, deserialize: (String) -> T, castToJsonFormat: Boolean = true): 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

castToJsonFormat

Whether reads from this column should cast retrieved data to a non-binary format. This value only applies to SQLite databases & will be ignored for all others.

inline fun <T : Any> Table.jsonb(name: String, jsonConfig: Json, kSerializer: KSerializer<T> = serializer<T>(), castToJsonFormat: Boolean = true): 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

castToJsonFormat

Whether reads from this column should cast retrieved data to a non-binary format. This value only applies to SQLite databases & will be ignored for all others.

#### Samples

org.jetbrains.exposed.v1.json.JsonBColumnTests.testLoggerWithJsonBCollections