Index

data class Index(val columns: List<Column<*>>, val unique: Boolean, val customName: String? = null, val indexType: String? = null, val filterCondition: Op<Boolean>? = null, val functions: List<ExpressionWithColumnType<*>>? = null, val functionsTable: Table? = null) : DdlAware

Represents an index.

Constructors

Link copied to clipboard
constructor(columns: List<Column<*>>, unique: Boolean, customName: String? = null, indexType: String? = null, filterCondition: Op<Boolean>? = null, functions: List<ExpressionWithColumnType<*>>? = null, functionsTable: Table? = null)

Properties

Link copied to clipboard

Columns that are part of the index.

Link copied to clipboard
val customName: String? = null

Optional custom name for the index.

Link copied to clipboard
open val ddl: List<String>

Returns the list of DDL statements that create this DdlAware instance.

Link copied to clipboard
val filterCondition: Op<Boolean>? = null

Partial index filter condition

Link copied to clipboard

Functions that are part of the index.

Link copied to clipboard
val functionsTable: Table? = null

Table where the functional index should be defined.

Link copied to clipboard

Name of the index.

Link copied to clipboard
val indexType: String? = null

Optional custom index type (e.g, BTREE or HASH)

Link copied to clipboard

Table where the index is defined.

Link copied to clipboard

Whether the index in unique or not.

Functions

Link copied to clipboard
open override fun createStatement(): List<String>

Returns the list of DDL statements that create this object.

Link copied to clipboard
open override fun dropStatement(): List<String>

Returns the list of DDL statements that drops this object.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun modifyStatement(): List<String>

Returns the list of DDL statements that modify this object.

Link copied to clipboard

Returns true if the other index has the same columns and uniqueness as this index, but a different name, false otherwise

Link copied to clipboard
open override fun toString(): String