@@ -97,6 +97,14 @@ pub enum DataType {
9797 TinyInt ( Option < u64 > ) ,
9898 /// Unsigned tiny integer with optional display width e.g. TINYINT UNSIGNED or TINYINT(3) UNSIGNED
9999 UnsignedTinyInt ( Option < u64 > ) ,
100+ /// Int2 as alias for SmallInt in [postgresql]
101+ /// Note: Int2 mean 2 bytes in postgres (not 2 bits)
102+ /// Int2 with optional display width e.g. INT2 or INT2(5)
103+ ///
104+ /// [postgresql]: https://www.postgresql.org/docs/15/datatype.html
105+ Int2 ( Option < u64 > ) ,
106+ /// Unsigned Int2 with optional display width e.g. INT2 Unsigned or INT2(5) Unsigned
107+ UnsignedInt2 ( Option < u64 > ) ,
100108 /// Small integer with optional display width e.g. SMALLINT or SMALLINT(5)
101109 SmallInt ( Option < u64 > ) ,
102110 /// Unsigned small integer with optional display width e.g. SMALLINT UNSIGNED or SMALLINT(5) UNSIGNED
@@ -109,27 +117,55 @@ pub enum DataType {
109117 ///
110118 /// [1]: https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
111119 UnsignedMediumInt ( Option < u64 > ) ,
112- /// Integer with optional display width e.g. INT or INT(11)
120+ /// Int with optional display width e.g. INT or INT(11)
113121 Int ( Option < u64 > ) ,
122+ /// Int4 as alias for Integer in [postgresql]
123+ /// Note: Int4 mean 4 bytes in postgres (not 4 bits)
124+ /// Int4 with optional display width e.g. Int4 or Int4(11)
125+ ///
126+ /// [postgresql]: https://www.postgresql.org/docs/15/datatype.html
127+ Int4 ( Option < u64 > ) ,
114128 /// Integer with optional display width e.g. INTEGER or INTEGER(11)
115129 Integer ( Option < u64 > ) ,
116- /// Unsigned integer with optional display width e.g. INT UNSIGNED or INT(11) UNSIGNED
130+ /// Unsigned int with optional display width e.g. INT UNSIGNED or INT(11) UNSIGNED
117131 UnsignedInt ( Option < u64 > ) ,
132+ /// Unsigned int4 with optional display width e.g. INT4 UNSIGNED or INT4(11) UNSIGNED
133+ UnsignedInt4 ( Option < u64 > ) ,
118134 /// Unsigned integer with optional display width e.g. INTGER UNSIGNED or INTEGER(11) UNSIGNED
119135 UnsignedInteger ( Option < u64 > ) ,
120136 /// Big integer with optional display width e.g. BIGINT or BIGINT(20)
121137 BigInt ( Option < u64 > ) ,
122138 /// Unsigned big integer with optional display width e.g. BIGINT UNSIGNED or BIGINT(20) UNSIGNED
123139 UnsignedBigInt ( Option < u64 > ) ,
140+ /// Int8 as alias for Bigint in [postgresql]
141+ /// Note: Int8 mean 8 bytes in postgres (not 8 bits)
142+ /// Int8 with optional display width e.g. INT8 or INT8(11)
143+ ///
144+ /// [postgresql]: https://www.postgresql.org/docs/15/datatype.html
145+ Int8 ( Option < u64 > ) ,
146+ /// Unsigned Int8 with optional display width e.g. INT8 UNSIGNED or INT8(11) UNSIGNED
147+ UnsignedInt8 ( Option < u64 > ) ,
148+ /// FLOAT4 as alias for Real in [postgresql]
149+ ///
150+ /// [postgresql]: https://www.postgresql.org/docs/15/datatype.html
151+ FLOAT4 ,
124152 /// Floating point e.g. REAL
125153 Real ,
154+ /// FLOAT8 as alias for Double in [postgresql]
155+ ///
156+ /// [postgresql]: https://www.postgresql.org/docs/15/datatype.html
157+ FLOAT8 ,
126158 /// Double
127159 Double ,
128160 /// Double PRECISION e.g. [standard], [postgresql]
129161 ///
130162 /// [standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#approximate-numeric-type
131163 /// [postgresql]: https://www.postgresql.org/docs/current/datatype-numeric.html
132164 DoublePrecision ,
165+ /// Bool as alias for Boolean in [postgresql]
166+ ///
167+ /// [postgresql]: https://www.postgresql.org/docs/15/datatype.html
168+ Bool ,
133169 /// Boolean
134170 Boolean ,
135171 /// Date
@@ -213,6 +249,12 @@ impl fmt::Display for DataType {
213249 DataType :: UnsignedTinyInt ( zerofill) => {
214250 format_type_with_optional_length ( f, "TINYINT" , zerofill, true )
215251 }
252+ DataType :: Int2 ( zerofill) => {
253+ format_type_with_optional_length ( f, "INT2" , zerofill, false )
254+ }
255+ DataType :: UnsignedInt2 ( zerofill) => {
256+ format_type_with_optional_length ( f, "INT2" , zerofill, true )
257+ }
216258 DataType :: SmallInt ( zerofill) => {
217259 format_type_with_optional_length ( f, "SMALLINT" , zerofill, false )
218260 }
@@ -229,6 +271,12 @@ impl fmt::Display for DataType {
229271 DataType :: UnsignedInt ( zerofill) => {
230272 format_type_with_optional_length ( f, "INT" , zerofill, true )
231273 }
274+ DataType :: Int4 ( zerofill) => {
275+ format_type_with_optional_length ( f, "INT4" , zerofill, false )
276+ }
277+ DataType :: UnsignedInt4 ( zerofill) => {
278+ format_type_with_optional_length ( f, "INT4" , zerofill, true )
279+ }
232280 DataType :: Integer ( zerofill) => {
233281 format_type_with_optional_length ( f, "INTEGER" , zerofill, false )
234282 }
@@ -241,9 +289,18 @@ impl fmt::Display for DataType {
241289 DataType :: UnsignedBigInt ( zerofill) => {
242290 format_type_with_optional_length ( f, "BIGINT" , zerofill, true )
243291 }
292+ DataType :: Int8 ( zerofill) => {
293+ format_type_with_optional_length ( f, "INT8" , zerofill, false )
294+ }
295+ DataType :: UnsignedInt8 ( zerofill) => {
296+ format_type_with_optional_length ( f, "INT8" , zerofill, true )
297+ }
244298 DataType :: Real => write ! ( f, "REAL" ) ,
299+ DataType :: FLOAT4 => write ! ( f, "FLOAT4" ) ,
245300 DataType :: Double => write ! ( f, "DOUBLE" ) ,
301+ DataType :: FLOAT8 => write ! ( f, "FLOAT8" ) ,
246302 DataType :: DoublePrecision => write ! ( f, "DOUBLE PRECISION" ) ,
303+ DataType :: Bool => write ! ( f, "BOOL" ) ,
247304 DataType :: Boolean => write ! ( f, "BOOLEAN" ) ,
248305 DataType :: Date => write ! ( f, "DATE" ) ,
249306 DataType :: Time ( precision, timezone_info) => {
0 commit comments