# 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

IllegalStateException

If no column type mapping is found.

inline fun <T : Any, R : List<Any>> Table.array(name: String, maximumCardinality: List<Int>? = null, dimensions: Int): Column<R>

Creates a multi-dimensional array column, with the specified name, for storing elements of a nested `List`. The number of dimensions is specified by the dimensions parameter.

Note: This column type is only supported by PostgreSQL dialect.

#### Return

A column instance that represents a multi-dimensional list of elements of type T.

#### Parameters

name

Name of the column.

maximumCardinality

The maximum cardinality (number of allowed elements) for each dimension in the array.

dimensions

The number of dimensions of the array.

Note: Providing an array size limit when using the PostgreSQL dialect is allowed, but this value will be ignored by the database.

#### Throws

IllegalStateException

If no column type mapping is found.

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

Creates a multi-dimensional array column, with the specified name, for storing elements of a nested `List`. The number of dimensions is specified by the dimensions parameter.

Note: This column type is only supported by PostgreSQL dialect.

#### Return

A column instance that represents a multi-dimensional list of elements of type E.

#### Parameters

name

Name of the column.

maximumCardinality

The maximum cardinality (number of allowed elements) for each dimension in the array.

dimensions

The number of dimensions of the array.

Note: Providing an array size limit when using the PostgreSQL dialect is allowed, but this value will be ignored by the database.

#### Throws

IllegalStateException

If no column type mapping is found.