-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathindexesTypes.ts
52 lines (35 loc) · 985 Bytes
/
indexesTypes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import type { DropOptions, Name } from './generalTypes';
export interface IndexColumn {
name: string;
opclass?: Name;
sort?: 'ASC' | 'DESC';
}
export interface CreateIndexOptions {
name?: string;
unique?: boolean;
where?: string;
concurrently?: boolean;
ifNotExists?: boolean;
/**
* @deprecated should be parameter of IndexColumn
*/
opclass?: Name;
method?: 'btree' | 'hash' | 'gist' | 'spgist' | 'gin';
include?: string | string[];
}
export interface DropIndexOptions extends DropOptions {
unique?: boolean;
name?: string;
concurrently?: boolean;
}
type CreateIndexFn = (
tableName: Name,
columns: string | Array<string | IndexColumn>,
options?: CreateIndexOptions & DropIndexOptions
) => string | string[];
export type CreateIndex = CreateIndexFn & { reverse: CreateIndexFn };
export type DropIndex = (
tableName: Name,
columns: string | Array<string | IndexColumn>,
options?: DropIndexOptions
) => string | string[];