-
Notifications
You must be signed in to change notification settings - Fork 168
/
domainsTypes.ts
44 lines (32 loc) · 952 Bytes
/
domainsTypes.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
import type { DropOptions, Name, Type, Value } from './generalTypes';
export interface DomainOptions {
default?: Value;
notNull?: boolean;
check?: string;
constraintName?: string;
}
export interface DomainOptionsCreate extends DomainOptions {
collation?: string;
}
export interface DomainOptionsAlter extends DomainOptions {
allowNull?: boolean;
}
type CreateDomainFn = (
domainName: Name,
type: Type,
domainOptions?: DomainOptionsCreate & DropOptions
) => string | string[];
export type CreateDomain = CreateDomainFn & { reverse: CreateDomainFn };
export type DropDomain = (
domainName: Name,
dropOptions?: DropOptions
) => string | string[];
export type AlterDomain = (
domainName: Name,
domainOptions: DomainOptionsAlter
) => string | string[];
type RenameDomainFn = (
oldDomainName: Name,
newDomainName: Name
) => string | string[];
export type RenameDomain = RenameDomainFn & { reverse: RenameDomainFn };