$ open source · GPL-3.0 — need a commercial license? imqueue.com →

ColumnIndexOptions interface

The clauses of the CREATE INDEX statement that a ColumnIndex declaration turns into.

Signature:

export interface ColumnIndexOptions 

Remarks

Every field is optional in practice — both decorators take a Partial of this, and an empty object declares a plain btree index on the column. The names follow Postgres's own CREATE INDEX syntax, and the values of the raw-SQL fields are emitted as written.

Properties

Property

Modifiers

Type

Description

collation

string

Collation of the index key, where it differs from the column's own.

concurrently

boolean

Builds the index without locking writes out of the table.

expression

string

Indexes this SQL expression rather than the column.

include

string[]

Extra columns to carry in the index without indexing them.

method

IndexMethod

Index method. Postgres uses BTREE when this is left out.

name

string

Name of the index.

nullsFirst

boolean

true sorts nulls first, false sorts them last, and leaving it out follows Postgres.

opClass

string

Operator class for the key.

order

SortOrder

Sort direction of the index key.

predicate

string

Restricts the index to the rows this SQL condition matches.

safe

boolean

Leaves an index that already exists alone rather than rebuilding it.

tablespace

string

Tablespace to build the index in, instead of the database default.

unique

boolean

Rejects duplicate values, enforcing uniqueness through the index.