array

fun <E> array(name: String, columnType: ColumnType<E & Any>, maximumCardinality: Int? = null): Column<List<E>>

Creates an array column, with the specified name, for storing elements of a List using a base columnType.

Note This column type is only supported by H2 and PostgreSQL dialects.

Parameters

name

Name of the column.

columnType

Base column type for the individual elements.

maximumCardinality

The maximum amount of allowed elements. Note Providing an array size limit when using the PostgreSQL dialect is allowed, but this value will be ignored by the database.


inline fun <E : Any> array(name: String, maximumCardinality: Int? = null): Column<List<E>>

Creates an array column, with the specified name, for storing elements of a List.

Note This column type is only supported by H2 and PostgreSQL dialects.

Note The base column type associated with storing elements of type E will be resolved according to the internal mapping in resolveColumnType. To avoid this type reflection, or if a mapping does not exist for the elements being stored, please provide an explicit column type to the array overload. If the elements to be stored are nullable, an explicit column type will also need to be provided.

Parameters

name

Name of the column.

maximumCardinality

The maximum amount of allowed elements. Note Providing an array size limit when using the PostgreSQL dialect is allowed, but this value will be ignored by the database.

Throws

If no column type mapping is found.