# 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

Index
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

columns
Link copied to clipboard
val columns: List<Column<*>>

Columns that are part of the index.

customName
Link copied to clipboard
val customName: String? = null

Optional custom name for the index.

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

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

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

Partial index filter condition

functions
Link copied to clipboard
val functions: List<ExpressionWithColumnType<*>>? = null

Functions that are part of the index.

functionsTable
Link copied to clipboard
val functionsTable: Table? = null

Table where the functional index should be defined.

indexName
Link copied to clipboard
val indexName: String

Name of the index.

indexType
Link copied to clipboard
val indexType: String? = null

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

table
Link copied to clipboard
val table: Table

Table where the index is defined.

unique
Link copied to clipboard
val unique: Boolean

Whether the index in unique or not.

## Functions

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

Returns the list of DDL statements that create this object.

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

Returns the list of DDL statements that drops this object.

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

Returns the list of DDL statements that modify this object.

onlyNameDiffer
Link copied to clipboard
fun onlyNameDiffer(other: Index): Boolean

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

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