prorm API Reference
    Preparing search index...

    Interface IndexOptions

    Options for CREATE INDEX: uniqueness, method, included columns, and the where predicate that makes it partial. Not every engine supports partial indexes; the dialect rejects the option rather than silently dropping it.

    interface IndexOptions {
        name?: string;
        unique?: boolean;
        type?: string;
        using?: string;
        where?: string | WhereOptions;
        expression?: string;
        include?: string[];
        ifNotExists?: boolean;
        tablespace?: string;
        compress?: number | boolean;
        invisible?: boolean;
    }
    Index
    name?: string

    Explicit index name (used by the (tableName, fields, options) addIndex shorthand)

    unique?: boolean
    type?: string
    using?: string
    where?: string | WhereOptions

    Partial (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.

    expression?: string

    Expression for expression-based indexes (e.g., LOWER(column))

    include?: string[]

    Include columns for covering index (PostgreSQL 11+, MySQL 8.0.17+)

    ifNotExists?: boolean

    If true, does not throw error if index already exists

    tablespace?: string

    Oracle: tablespace for the index

    compress?: number | boolean

    Oracle: compress index storage

    invisible?: boolean

    Create 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.