@@ -132,27 +132,27 @@ pub enum DataType {
132132 /// Tiny integer with optional display width e.g. TINYINT or TINYINT(3)
133133 TinyInt ( Option < u64 > ) ,
134134 /// Unsigned tiny integer with optional display width e.g. TINYINT UNSIGNED or TINYINT(3) UNSIGNED
135- UnsignedTinyInt ( Option < u64 > ) ,
135+ TinyIntUnsigned ( Option < u64 > ) ,
136136 /// Int2 as alias for SmallInt in [postgresql]
137137 /// Note: Int2 mean 2 bytes in postgres (not 2 bits)
138138 /// Int2 with optional display width e.g. INT2 or INT2(5)
139139 ///
140140 /// [postgresql]: https://www.postgresql.org/docs/15/datatype.html
141141 Int2 ( Option < u64 > ) ,
142- /// Unsigned Int2 with optional display width e.g. INT2 Unsigned or INT2(5) Unsigned
143- UnsignedInt2 ( Option < u64 > ) ,
142+ /// Unsigned Int2 with optional display width e.g. INT2 UNSIGNED or INT2(5) UNSIGNED
143+ Int2Unsigned ( Option < u64 > ) ,
144144 /// Small integer with optional display width e.g. SMALLINT or SMALLINT(5)
145145 SmallInt ( Option < u64 > ) ,
146146 /// Unsigned small integer with optional display width e.g. SMALLINT UNSIGNED or SMALLINT(5) UNSIGNED
147- UnsignedSmallInt ( Option < u64 > ) ,
147+ SmallIntUnsigned ( Option < u64 > ) ,
148148 /// MySQL medium integer ([1]) with optional display width e.g. MEDIUMINT or MEDIUMINT(5)
149149 ///
150150 /// [1]: https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
151151 MediumInt ( Option < u64 > ) ,
152152 /// Unsigned medium integer ([1]) with optional display width e.g. MEDIUMINT UNSIGNED or MEDIUMINT(5) UNSIGNED
153153 ///
154154 /// [1]: https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
155- UnsignedMediumInt ( Option < u64 > ) ,
155+ MediumIntUnsigned ( Option < u64 > ) ,
156156 /// Int with optional display width e.g. INT or INT(11)
157157 Int ( Option < u64 > ) ,
158158 /// Int4 as alias for Integer in [postgresql]
@@ -197,11 +197,11 @@ pub enum DataType {
197197 /// Integer with optional display width e.g. INTEGER or INTEGER(11)
198198 Integer ( Option < u64 > ) ,
199199 /// Unsigned int with optional display width e.g. INT UNSIGNED or INT(11) UNSIGNED
200- UnsignedInt ( Option < u64 > ) ,
200+ IntUnsigned ( Option < u64 > ) ,
201201 /// Unsigned int4 with optional display width e.g. INT4 UNSIGNED or INT4(11) UNSIGNED
202- UnsignedInt4 ( Option < u64 > ) ,
202+ Int4Unsigned ( Option < u64 > ) ,
203203 /// Unsigned integer with optional display width e.g. INTEGER UNSIGNED or INTEGER(11) UNSIGNED
204- UnsignedInteger ( Option < u64 > ) ,
204+ IntegerUnsigned ( Option < u64 > ) ,
205205 /// Unsigned integer type in [clickhouse]
206206 /// Note: UInt8 mean 8 bits in [clickhouse]
207207 ///
@@ -235,9 +235,29 @@ pub enum DataType {
235235 /// Big integer with optional display width e.g. BIGINT or BIGINT(20)
236236 BigInt ( Option < u64 > ) ,
237237 /// Unsigned big integer with optional display width e.g. BIGINT UNSIGNED or BIGINT(20) UNSIGNED
238- UnsignedBigInt ( Option < u64 > ) ,
238+ BigIntUnsigned ( Option < u64 > ) ,
239239 /// Unsigned Int8 with optional display width e.g. INT8 UNSIGNED or INT8(11) UNSIGNED
240- UnsignedInt8 ( Option < u64 > ) ,
240+ Int8Unsigned ( Option < u64 > ) ,
241+ /// Signed integer as used in [MySQL CAST] target types, without optional `INTEGER` suffix:
242+ /// `SIGNED`
243+ ///
244+ /// [MySQL CAST]: https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html
245+ Signed ,
246+ /// Signed integer as used in [MySQL CAST] target types, with optional `INTEGER` suffix:
247+ /// `SIGNED INTEGER`
248+ ///
249+ /// [MySQL CAST]: https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html
250+ SignedInteger ,
251+ /// Signed integer as used in [MySQL CAST] target types, without optional `INTEGER` suffix:
252+ /// `SIGNED`
253+ ///
254+ /// [MySQL CAST]: https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html
255+ Unsigned ,
256+ /// Unsigned integer as used in [MySQL CAST] target types, with optional `INTEGER` suffix:
257+ /// `UNSIGNED INTEGER`
258+ ///
259+ /// [MySQL CAST]: https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html
260+ UnsignedInteger ,
241261 /// Float4 as alias for Real in [postgresql]
242262 ///
243263 /// [postgresql]: https://www.postgresql.org/docs/15/datatype.html
@@ -433,29 +453,29 @@ impl fmt::Display for DataType {
433453 DataType :: TinyInt ( zerofill) => {
434454 format_type_with_optional_length ( f, "TINYINT" , zerofill, false )
435455 }
436- DataType :: UnsignedTinyInt ( zerofill) => {
456+ DataType :: TinyIntUnsigned ( zerofill) => {
437457 format_type_with_optional_length ( f, "TINYINT" , zerofill, true )
438458 }
439459 DataType :: Int2 ( zerofill) => {
440460 format_type_with_optional_length ( f, "INT2" , zerofill, false )
441461 }
442- DataType :: UnsignedInt2 ( zerofill) => {
462+ DataType :: Int2Unsigned ( zerofill) => {
443463 format_type_with_optional_length ( f, "INT2" , zerofill, true )
444464 }
445465 DataType :: SmallInt ( zerofill) => {
446466 format_type_with_optional_length ( f, "SMALLINT" , zerofill, false )
447467 }
448- DataType :: UnsignedSmallInt ( zerofill) => {
468+ DataType :: SmallIntUnsigned ( zerofill) => {
449469 format_type_with_optional_length ( f, "SMALLINT" , zerofill, true )
450470 }
451471 DataType :: MediumInt ( zerofill) => {
452472 format_type_with_optional_length ( f, "MEDIUMINT" , zerofill, false )
453473 }
454- DataType :: UnsignedMediumInt ( zerofill) => {
474+ DataType :: MediumIntUnsigned ( zerofill) => {
455475 format_type_with_optional_length ( f, "MEDIUMINT" , zerofill, true )
456476 }
457477 DataType :: Int ( zerofill) => format_type_with_optional_length ( f, "INT" , zerofill, false ) ,
458- DataType :: UnsignedInt ( zerofill) => {
478+ DataType :: IntUnsigned ( zerofill) => {
459479 format_type_with_optional_length ( f, "INT" , zerofill, true )
460480 }
461481 DataType :: Int4 ( zerofill) => {
@@ -479,22 +499,22 @@ impl fmt::Display for DataType {
479499 DataType :: Int256 => {
480500 write ! ( f, "Int256" )
481501 }
482- DataType :: UnsignedInt4 ( zerofill) => {
502+ DataType :: Int4Unsigned ( zerofill) => {
483503 format_type_with_optional_length ( f, "INT4" , zerofill, true )
484504 }
485505 DataType :: Integer ( zerofill) => {
486506 format_type_with_optional_length ( f, "INTEGER" , zerofill, false )
487507 }
488- DataType :: UnsignedInteger ( zerofill) => {
508+ DataType :: IntegerUnsigned ( zerofill) => {
489509 format_type_with_optional_length ( f, "INTEGER" , zerofill, true )
490510 }
491511 DataType :: BigInt ( zerofill) => {
492512 format_type_with_optional_length ( f, "BIGINT" , zerofill, false )
493513 }
494- DataType :: UnsignedBigInt ( zerofill) => {
514+ DataType :: BigIntUnsigned ( zerofill) => {
495515 format_type_with_optional_length ( f, "BIGINT" , zerofill, true )
496516 }
497- DataType :: UnsignedInt8 ( zerofill) => {
517+ DataType :: Int8Unsigned ( zerofill) => {
498518 format_type_with_optional_length ( f, "INT8" , zerofill, true )
499519 }
500520 DataType :: UInt8 => {
@@ -515,6 +535,18 @@ impl fmt::Display for DataType {
515535 DataType :: UInt256 => {
516536 write ! ( f, "UInt256" )
517537 }
538+ DataType :: Signed => {
539+ write ! ( f, "SIGNED" )
540+ }
541+ DataType :: SignedInteger => {
542+ write ! ( f, "SIGNED INTEGER" )
543+ }
544+ DataType :: Unsigned => {
545+ write ! ( f, "UNSIGNED" )
546+ }
547+ DataType :: UnsignedInteger => {
548+ write ! ( f, "UNSIGNED INTEGER" )
549+ }
518550 DataType :: Real => write ! ( f, "REAL" ) ,
519551 DataType :: Float4 => write ! ( f, "FLOAT4" ) ,
520552 DataType :: Float32 => write ! ( f, "Float32" ) ,
0 commit comments