# ColumnIndex() function · @imqueue/pg-sequelize

Source: https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.columnindex/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-sequelize 4.2.0 — generated reference, not hand-written

Declares an index on a model column, with Postgres's own index options.

**Signature:**

```typescript
export declare function ColumnIndex(options: Partial<ColumnIndexOptions>): FunctionType;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| options | Partial<[ColumnIndexOptions](https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.columnindexoptions/)> | The clauses to build into the statement. |


**Returns:**

[FunctionType](https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.functiontype/)

A property decorator.

## Remarks

`Index` from `sequelize-typescript` is re-exported here and covers the ordinary cases through sequelize's own sync. This declares the index as a `CREATE INDEX` statement instead, which is what makes the Postgres-specific clauses reachable — partial indices, expression keys, operator classes, concurrent builds, covering columns. `Sequelize.sync()` runs them after the tables and views are in place.

Declarations accumulate, so a column can carry several, and each is named by its position unless you name it.

## Example


```typescript
@Table
export class Lead extends BaseModel<Lead> {
    // case-insensitive lookups, over live rows only
    @ColumnIndex({
        expression: 'lower("email")',
        predicate: '"deletedAt" IS NULL',
        unique: true,
    })
    @Column(DataType.STRING)
    public email: string;
}
```

