Skip to main content
Version: Next

IndexDef

Index

Properties

optionalclustered

clustered?: boolean

Whether the index should be clustered (MariaDB, MSSQL).

columnNames

columnNames: string[]

optionalcolumns

columns?: IndexColumnOptions[]

Advanced column options for the index. When specified, these options override the simple columnNames for index generation.

optionalcomposite

composite?: boolean

constraint

constraint: boolean

optionaldeferMode

deferMode?: DeferMode | immediate | deferred

optionaldisabled

disabled?: boolean

Whether the index is disabled (MSSQL only).

optionalexpression

expression?: string

optionalfillFactor

fillFactor?: number

Fill factor for the index as a percentage 0-100 (PostgreSQL, MSSQL).

optionalinclude

include?: string[]

Columns to include in the index but not as part of the key (PostgreSQL, MSSQL).

optionalinvisible

invisible?: boolean

Whether the index is invisible/hidden from the query optimizer (MySQL 8+, MariaDB 10.6+, MongoDB).

keyName

keyName: string

optionaloptions

options?: Dictionary

primary

primary: boolean

optionaltype

type?: string | Readonly<{ indexType?: string; predicate?: string; storageEngineIndexType?: hash | btree }>

unique

unique: boolean