-
Notifications
You must be signed in to change notification settings - Fork 194
Expand file tree
/
Copy pathpgType.ts
More file actions
379 lines (378 loc) · 9.89 KB
/
Copy pathpgType.ts
File metadata and controls
379 lines (378 loc) · 9.89 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
// Note these currently don't contain the parameterized types like
// bit(n), varchar(n) and so on, they have to be specified as strings
/**
* @see https://www.postgresql.org/docs/current/datatype.html
*/
export const PgType = Object.freeze({
/**
* signed eight-byte integer
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT
*/
BIGINT: 'bigint',
/**
* alias for bigint
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT
*/
INT8: 'int8',
/**
* autoincrementing eight-byte integer
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL
*/
BIGSERIAL: 'bigserial',
/**
* alias for bigserial
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL
*/
SERIAL8: 'serial8',
/**
* fixed-length bit string
*
* @see https://www.postgresql.org/docs/current/datatype-bit.html#DATATYPE-BIT
*/
BIT: 'bit',
/**
* fixed-length bit string
*
* @see https://www.postgresql.org/docs/current/datatype-bit.html#DATATYPE-BIT
*/
BIT_1: 'bit',
/**
* variable-length bit string
*
* @see https://www.postgresql.org/docs/current/datatype-bit.html#DATATYPE-BIT
*/
BIT_VARYING: 'bit varying',
/**
* alias for bit varying
*
* @see https://www.postgresql.org/docs/current/datatype-bit.html#DATATYPE-BIT
*/
VARBIT: 'varbit',
/**
* logical Boolean (true/false)
*
* @see https://www.postgresql.org/docs/current/datatype-boolean.html#DATATYPE-BOOLEAN
*/
BOOLEAN: 'boolean',
/**
* alias for boolean
*
* @see https://www.postgresql.org/docs/current/datatype-boolean.html#DATATYPE-BOOLEAN
*/
BOOL: 'bool',
/**
* rectangular box on a plane
*
* @see https://www.postgresql.org/docs/current/datatype-geometric.html#DATATYPE-GEOMETRIC
*/
BOX: 'box',
/**
* binary data ("byte array")
*
* @see https://www.postgresql.org/docs/current/datatype-binary.html#DATATYPE-BINARY
*/
BYTEA: 'bytea',
/**
* fixed-length character string
*
* @see https://www.postgresql.org/docs/current/datatype-character.html#DATATYPE-CHARACTER
*/
CHARACTER: 'character',
/**
* alias for character
*
* @see https://www.postgresql.org/docs/current/datatype-character.html#DATATYPE-CHARACTER
*/
CHAR: 'char',
/**
* variable-length character string
*
* @see https://www.postgresql.org/docs/current/datatype-character.html#DATATYPE-CHARACTER
*/
CHARACTER_VARYING: 'character varying',
/**
* alias for character varying
*
* @see https://www.postgresql.org/docs/current/datatype-character.html#DATATYPE-CHARACTER
*/
VARCHAR: 'varchar',
/**
* IPv4 or IPv6 network address
*
* @see https://www.postgresql.org/docs/current/datatype-net-types.html#DATATYPE-NET-TYPES
*/
CIDR: 'cidr',
/**
* circle on a plane
*
* @see https://www.postgresql.org/docs/current/datatype-geometric.html#DATATYPE-GEOMETRIC
*/
CIRCLE: 'circle',
/**
* calendar date (year, month, day)
*
* @see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME
*/
DATE: 'date',
/**
* float8 double precision floating-point number (8 bytes)
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT
*/
DOUBLE_PRECISION: 'double precision',
/**
* alias for double precision
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT
*/
FLOAT8: 'float8',
/**
* IPv4 or IPv6 host address
*
* @see https://www.postgresql.org/docs/current/datatype-net-types.html#DATATYPE-NET-TYPES
*/
INET: 'inet',
/**
* signed four-byte integer
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT
*/
INTEGER: 'integer',
/**
* alias for integer
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT
*/
INT: 'int',
/**
* alias for integer
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT
*/
INT4: 'int4',
/**
* time span
*
* @see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME
*/
INTERVAL: 'interval',
/**
* textual JSON data
*
* @see https://www.postgresql.org/docs/current/datatype-json.html#DATATYPE-JSON
*/
JSON: 'json',
/**
* binary JSON data, decomposed
*
* @see https://www.postgresql.org/docs/current/datatype-json.html#DATATYPE-JSON
*/
JSONB: 'jsonb',
/**
* infinite line on a plane
*
* @see https://www.postgresql.org/docs/current/datatype-geometric.html#DATATYPE-GEOMETRIC
*/
LINE: 'line',
/**
* line segment on a plane
*
* @see https://www.postgresql.org/docs/current/datatype-geometric.html#DATATYPE-GEOMETRIC
*/
LSEG: 'lseg',
/**
* MAC (Media Access Control) address
*
* @see https://www.postgresql.org/docs/current/datatype-net-types.html#DATATYPE-NET-TYPES
*/
MACADDR: 'macaddr',
/**
* MAC (Media Access Control) address (EUI-64 format)
*
* @see https://www.postgresql.org/docs/current/datatype-net-types.html#DATATYPE-NET-TYPES
*/
MACADDR8: 'macaddr8',
/**
* currency amount
*
* @see https://www.postgresql.org/docs/current/datatype-money.html#DATATYPE-MONEY
*/
MONEY: 'money',
/**
* exact numeric of selectable precision
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL
*/
NUMERIC: 'numeric',
/**
* alias for numeric
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL
*/
DECIMAL: 'decimal',
/**
* geometric path on a plane
*
* @see https://www.postgresql.org/docs/current/datatype-geometric.html#DATATYPE-GEOMETRIC
*/
PATH: 'path',
/**
* PostgreSQL Log Sequence Number
*
* @see https://www.postgresql.org/docs/current/datatype-pg-lsn.html#DATATYPE-PG-LSN
*/
PG_LSN: 'pg_lsn',
/**
* user-level transaction ID snapshot
*/
PG_SNAPSHOT: 'pg_snapshot',
/**
* geometric point on a plane
*
* @see https://www.postgresql.org/docs/current/datatype-geometric.html#DATATYPE-GEOMETRIC
*/
POINT: 'point',
/**
* closed geometric path on a plane
*
* @see https://www.postgresql.org/docs/current/datatype-geometric.html#DATATYPE-GEOMETRIC
*/
POLYGON: 'polygon',
/**
* single precision floating-point number (4 bytes)
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT
*/
REAL: 'real',
/**
* alias for real
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT
*/
FLOAT4: 'float4',
/**
* signed two-byte integer
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT
*/
SMALLINT: 'smallint',
/**
* alias for smallint
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT
*/
INT2: 'int2',
/**
* autoincrementing two-byte integer
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL
*/
SMALLSERIAL: 'smallserial',
/**
* alias for smallserial
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL
*/
SERIAL2: 'serial2',
/**
* autoincrementing four-byte integer
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL
*/
SERIAL: 'serial',
/**
* alias for serial
*
* @see https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL
*/
SERIAL4: 'serial4',
/**
* variable-length character string
*
* @see https://www.postgresql.org/docs/current/datatype-character.html#DATATYPE-CHARACTER
*/
TEXT: 'text',
/**
* time of day (no time zone)
*
* @see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME
*/
TIME: 'time',
/**
* alias of time
*
* @see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME
*/
TIME_WITHOUT_TIME_ZONE: 'time without time zone',
/**
* time of day, including time zone
*
* @see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME
*/
TIME_WITH_TIME_ZONE: 'time with time zone',
/**
* alias of time with time zone
*
* @see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME
*/
TIMETZ: 'timetz',
/**
* date and time (no time zone)
*
* @see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME
*/
TIMESTAMP: 'timestamp',
/**
* alias of timestamp
*
* @see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME
*/
TIMESTAMP_WITHOUT_TIME_ZONE: 'timestamp without time zone',
/**
* date and time, including time zone
*
* @see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME
*/
TIMESTAMP_WITH_TIME_ZONE: 'timestamp with time zone',
/**
* alias of timestamp with time zone
*
* @see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME
*/
TIMESTAMPTZ: 'timestamptz',
/**
* text search query
*
* @see https://www.postgresql.org/docs/current/datatype-textsearch.html#DATATYPE-TSQUERY
*/
TSQUERY: 'tsquery',
/**
* text search document
*
* @see https://www.postgresql.org/docs/current/datatype-textsearch.html#DATATYPE-TSVECTOR
*/
TSVECTOR: 'tsvector',
/**
* user-level transaction ID snapshot
*
* @deprecated see `PG_SNAPSHOT`
*/
TXID_SNAPSHOT: 'txid_snapshot',
/**
* universally unique identifier
*
* @see https://www.postgresql.org/docs/current/datatype-uuid.html#DATATYPE-UUID
*/
UUID: 'uuid',
/**
* XML data
*
* @see https://www.postgresql.org/docs/current/datatype-xml.html#DATATYPE-XML
*/
XML: 'xml',
});
export type PgType = (typeof PgType)[keyof typeof PgType];