UNPKG

typeorm

Version:

Data-Mapper ORM for TypeScript and ES2023+. Supports MySQL/MariaDB, PostgreSQL, MS SQL Server, Oracle, SAP HANA, SQLite, MongoDB databases.

71 lines (70 loc) 2.09 kB
import type { IndexMetadata } from "../../metadata/IndexMetadata"; import type { TableIndexOptions } from "../options/TableIndexOptions"; import type { TableIndexTypes } from "../options/TableIndexTypes"; /** * Database's table index stored in this class. */ export declare class TableIndex { readonly "@instanceof": symbol; /** * Index name. */ name?: string; /** * Columns included in this index. */ columnNames: string[]; /** * Indicates if this index is unique. */ isUnique: boolean; /** * The SPATIAL modifier indexes the entire column and does not allow indexed columns to contain NULL values. * Works only in MySQL. */ isSpatial: boolean; /** * Create the index using the CONCURRENTLY modifier * Works only in postgres. */ isConcurrent: boolean; /** * The FULLTEXT modifier indexes the entire column and does not allow prefixing. * Works only in MySQL. */ isFulltext: boolean; /** * NULL_FILTERED indexes are particularly useful for indexing sparse columns, where most rows contain a NULL value. * In these cases, the NULL_FILTERED index can be considerably smaller and more efficient to maintain than * a normal index that includes NULL values. * * Works only in Spanner. */ isNullFiltered: boolean; /** * Fulltext parser. * Works only in MySQL. */ parser?: string; /** * The `type` option defines the type of the index being created. * Supported types include B-tree, Hash, GiST, SP-GiST, GIN, and BRIN * This option is only applicable in PostgreSQL. */ type?: TableIndexTypes; /** * Index filter condition. */ where: string; constructor(options: TableIndexOptions); /** * Creates a new copy of this index with exactly same properties. */ clone(): TableIndex; /** * Creates index from the index metadata object. * * @param indexMetadata */ static create(indexMetadata: IndexMetadata): TableIndex; }