OptionalnameExplicit index name (used by the (tableName, fields, options) addIndex shorthand)
OptionaluniqueOptionaltypeOptionalusingOptionalwherePartial (filtered) index predicate.
Compiled into the CREATE INDEX ... WHERE ... clause with every value
inlined as an escaped literal, because DDL is executed without a parameter
list - see src/dialects/partial-index.ts. A string is taken as a
predicate the caller already wrote and passed through unchanged.
Only databases with real partial indexes accept this (PostgreSQL family,
SQLite/Turso, SQL Server filtered indexes); the rest throw an
UnsupportedSchemaObjectError rather than emit SQL the server rejects.
OptionalexpressionExpression for expression-based indexes (e.g., LOWER(column))
OptionalincludeInclude columns for covering index (PostgreSQL 11+, MySQL 8.0.17+)
OptionalifIf true, does not throw error if index already exists
OptionaltablespaceOracle: tablespace for the index
OptionalcompressOracle: compress index storage
OptionalinvisibleCreate the index as invisible/ignored to the query optimizer (MySQL
8.0+ uses INVISIBLE; MariaDB 10.6+ uses IGNORED — the keyword
differs between the two dialects even though the concept is the
same). Useful for zero-downtime index rollout: add the index
invisible, let it build and backfill, then flip it visible once
verified. Indexes are visible/not-ignored by default.
Options for
CREATE INDEX: uniqueness, method, included columns, and thewherepredicate that makes it partial. Not every engine supports partial indexes; the dialect rejects the option rather than silently dropping it.