1 /*
2  * Copyright (C) 2019, HuntLabs
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 module hunt.database.driver.postgresql.impl.codec.DataType;
18 
19 // import io.netty.util.collection.IntObjectHashMap;
20 // import io.netty.util.collection.IntObjectMap;
21 
22 import hunt.database.driver.postgresql.data.Box;
23 import hunt.database.driver.postgresql.data.Circle;
24 import hunt.database.driver.postgresql.data.Line;
25 import hunt.database.driver.postgresql.data.LineSegment;
26 import hunt.database.driver.postgresql.data.Interval;
27 import hunt.database.driver.postgresql.data.Path;
28 import hunt.database.driver.postgresql.data.Point;
29 import hunt.database.driver.postgresql.data.Polygon;
30 
31 import hunt.database.base.Numeric;
32 
33 // import io.vertx.core.buffer.Buffer;
34 // import io.vertx.core.logging.Logger;
35 // import io.vertx.core.logging.LoggerFactory;
36 
37 // import java.time.*;
38 // import java.util.UUID;
39 
40 /**
41  * PostgreSQL <a href="https://github.com/postgres/postgres/blob/master/src/include/catalog/pg_type.h">object
42  * identifiers (OIDs)</a> for data types
43  *
44  * @author <a href="mailto:emad.albloushi@gmail.com">Emad Alblueshi</a>
45  */
46 enum DataType {
47     BOOL = 16,
48     BOOL_ARRAY = 1000,
49     INT2 = 21,
50     INT2_ARRAY = 1005,
51     INT4 = 23,
52     INT4_ARRAY = 1007,
53     INT8 = 20,
54     INT8_ARRAY = 1016,
55     FLOAT4 = 700,
56     FLOAT4_ARRAY = 1021,
57     FLOAT8 = 701,
58     FLOAT8_ARRAY = 1022,
59     NUMERIC = 1700,
60     NUMERIC_ARRAY = 1231,
61     MONEY = 790,
62     MONEY_ARRAY = 791,
63     BIT = 1560,
64     BIT_ARRAY = 1561,
65     VARBIT = 1562,
66     VARBIT_ARRAY = 1563,
67     CHAR = 18,
68     CHAR_ARRAY = 1002,
69     VARCHAR = 1043,
70     VARCHAR_ARRAY = 1015,
71     BPCHAR = 1042,
72     BPCHAR_ARRAY = 1014,
73     TEXT = 25,
74     TEXT_ARRAY = 1009,
75     NAME = 19,
76     NAME_ARRAY = 1003,
77     DATE = 1082,
78     DATE_ARRAY = 1182,
79     TIME = 1083,
80     TIME_ARRAY = 1183,
81     TIMETZ = 1266,
82     TIMETZ_ARRAY = 1270,
83     TIMESTAMP = 1114,
84     TIMESTAMP_ARRAY = 1115,
85     TIMESTAMPTZ = 1184,
86     TIMESTAMPTZ_ARRAY = 1185,
87     INTERVAL = 1186,
88     INTERVAL_ARRAY = 1187,
89     BYTEA = 17,
90     BYTEA_ARRAY = 1001,
91     MACADDR = 829,
92     INET = 869,
93     CIDR = 650,
94     MACADDR8 = 774,
95     UUID = 2950,
96     UUID_ARRAY = 2951,
97     JSON = 114,
98     JSON_ARRAY = 199,
99     JSONB = 3802,
100     JSONB_ARRAY = 3807,
101     XML = 142,
102     XML_ARRAY = 143,
103     POINT = 600,
104     POINT_ARRAY = 1017,
105     LINE = 628,
106     LINE_ARRAY = 629,
107     LSEG = 601,
108     LSEG_ARRAY = 1018,
109     BOX = 603,
110     BOX_ARRAY = 1020,
111     PATH = 602,
112     PATH_ARRAY = 1019,
113     POLYGON = 604,
114     POLYGON_ARRAY = 1027,
115     CIRCLE = 718,
116     CIRCLE_ARRAY = 719,
117     HSTORE = 33670,
118     OID = 26,
119     OID_ARRAY = 1028,
120     VOID = 2278,
121     UNKNOWN = 705
122 }