customEnumeration

fun <T : Enum<T>> customEnumeration(name: String, sql: String? = null, fromDb: (Any) -> T, toDb: (T) -> Any): Column<T>

Creates an enumeration column, with the custom SQL type sql, for storing enums of type T using this database-specific type.

See Wiki for more details.

Parameters

name

Name of the column

sql

SQL definition for the column

fromDb

Function that converts a value received from a database to an enumeration instance T

toDb

Function that converts an enumeration instance T to a value that will be stored to a database