Repository navigation
Expand file tree
/
Copy pathpostgresColumnTypes.ts
More file actions
94 lines (81 loc) · 1.85 KB
/
Copy pathpostgresColumnTypes.ts
File metadata and controls
94 lines (81 loc) · 1.85 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/**
* THIS IS A WORK IN PROGRESS
*/
export interface IntegerColumnType {
int2: number;
int4: number;
int8: number;
smallint: number;
int: number;
bigint: number;
}
export interface PrecisionColumnType {
real: number;
float4: number;
float: number;
float8: number;
numeric: number;
decimal: number;
}
export interface SerialColumnType {
smallserial: number;
serial: number;
bigserial: number;
}
export interface StringColumnType {
uuid: string;
text: string;
varchar: string;
char: string;
citext: string;
}
export interface BooleanColumnType {
bit: boolean;
bool: boolean;
boolean: boolean;
}
export interface DateTimeColumnType {
date: string;
timestamp: string;
timestamptz: string;
time: string;
timetz: string;
interval: string;
}
export interface NetworkAddressColumnType {
inet: string;
cidr: string;
macaddr: string;
macaddr8: string;
}
export interface MiscellaneousColumnType {
money: number;
}
export interface JSONColumnType {
json: Record<string, unknown>;
jsonb: Record<string, unknown>;
}
export type JSONColumn = keyof JSONColumnType;
export interface ByteColumnType {
bytea: string;
}
export type IntegerColumn = keyof IntegerColumnType;
export type PrecisionColumn = keyof PrecisionColumnType;
export type SerialColumn = keyof SerialColumnType;
export type StringColumn = keyof StringColumnType;
export type BooleanColumn = keyof BooleanColumnType;
export type DateTimeColumn = keyof DateTimeColumnType;
export type NetworkAddressColumn = keyof NetworkAddressColumnType;
export type MiscellaneousColumn = keyof MiscellaneousColumnType;
export type ByteColumn = keyof ByteColumnType;
export type Column =
| IntegerColumn
| PrecisionColumn
| SerialColumn
| StringColumn
| BooleanColumn
| DateTimeColumn
| NetworkAddressColumn
| MiscellaneousColumn
| JSONColumn
| ByteColumn;