@@ -132,27 +132,27 @@ pub enum DataType {
132
132
/// Tiny integer with optional display width e.g. TINYINT or TINYINT(3)
133
133
TinyInt ( Option < u64 > ) ,
134
134
/// Unsigned tiny integer with optional display width e.g. TINYINT UNSIGNED or TINYINT(3) UNSIGNED
135
- UnsignedTinyInt ( Option < u64 > ) ,
135
+ TinyIntUnsigned ( Option < u64 > ) ,
136
136
/// Int2 as alias for SmallInt in [postgresql]
137
137
/// Note: Int2 mean 2 bytes in postgres (not 2 bits)
138
138
/// Int2 with optional display width e.g. INT2 or INT2(5)
139
139
///
140
140
/// [postgresql]: https://www.postgresql.org/docs/15/datatype.html
141
141
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 > ) ,
144
144
/// Small integer with optional display width e.g. SMALLINT or SMALLINT(5)
145
145
SmallInt ( Option < u64 > ) ,
146
146
/// Unsigned small integer with optional display width e.g. SMALLINT UNSIGNED or SMALLINT(5) UNSIGNED
147
- UnsignedSmallInt ( Option < u64 > ) ,
147
+ SmallIntUnsigned ( Option < u64 > ) ,
148
148
/// MySQL medium integer ([1]) with optional display width e.g. MEDIUMINT or MEDIUMINT(5)
149
149
///
150
150
/// [1]: https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
151
151
MediumInt ( Option < u64 > ) ,
152
152
/// Unsigned medium integer ([1]) with optional display width e.g. MEDIUMINT UNSIGNED or MEDIUMINT(5) UNSIGNED
153
153
///
154
154
/// [1]: https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
155
- UnsignedMediumInt ( Option < u64 > ) ,
155
+ MediumIntUnsigned ( Option < u64 > ) ,
156
156
/// Int with optional display width e.g. INT or INT(11)
157
157
Int ( Option < u64 > ) ,
158
158
/// Int4 as alias for Integer in [postgresql]
@@ -197,11 +197,11 @@ pub enum DataType {
197
197
/// Integer with optional display width e.g. INTEGER or INTEGER(11)
198
198
Integer ( Option < u64 > ) ,
199
199
/// Unsigned int with optional display width e.g. INT UNSIGNED or INT(11) UNSIGNED
200
- UnsignedInt ( Option < u64 > ) ,
200
+ IntUnsigned ( Option < u64 > ) ,
201
201
/// Unsigned int4 with optional display width e.g. INT4 UNSIGNED or INT4(11) UNSIGNED
202
- UnsignedInt4 ( Option < u64 > ) ,
202
+ Int4Unsigned ( Option < u64 > ) ,
203
203
/// Unsigned integer with optional display width e.g. INTEGER UNSIGNED or INTEGER(11) UNSIGNED
204
- UnsignedInteger ( Option < u64 > ) ,
204
+ IntegerUnsigned ( Option < u64 > ) ,
205
205
/// Unsigned integer type in [clickhouse]
206
206
/// Note: UInt8 mean 8 bits in [clickhouse]
207
207
///
@@ -235,9 +235,29 @@ pub enum DataType {
235
235
/// Big integer with optional display width e.g. BIGINT or BIGINT(20)
236
236
BigInt ( Option < u64 > ) ,
237
237
/// Unsigned big integer with optional display width e.g. BIGINT UNSIGNED or BIGINT(20) UNSIGNED
238
- UnsignedBigInt ( Option < u64 > ) ,
238
+ BigIntUnsigned ( Option < u64 > ) ,
239
239
/// 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 ,
241
261
/// Float4 as alias for Real in [postgresql]
242
262
///
243
263
/// [postgresql]: https://www.postgresql.org/docs/15/datatype.html
@@ -433,29 +453,29 @@ impl fmt::Display for DataType {
433
453
DataType :: TinyInt ( zerofill) => {
434
454
format_type_with_optional_length ( f, "TINYINT" , zerofill, false )
435
455
}
436
- DataType :: UnsignedTinyInt ( zerofill) => {
456
+ DataType :: TinyIntUnsigned ( zerofill) => {
437
457
format_type_with_optional_length ( f, "TINYINT" , zerofill, true )
438
458
}
439
459
DataType :: Int2 ( zerofill) => {
440
460
format_type_with_optional_length ( f, "INT2" , zerofill, false )
441
461
}
442
- DataType :: UnsignedInt2 ( zerofill) => {
462
+ DataType :: Int2Unsigned ( zerofill) => {
443
463
format_type_with_optional_length ( f, "INT2" , zerofill, true )
444
464
}
445
465
DataType :: SmallInt ( zerofill) => {
446
466
format_type_with_optional_length ( f, "SMALLINT" , zerofill, false )
447
467
}
448
- DataType :: UnsignedSmallInt ( zerofill) => {
468
+ DataType :: SmallIntUnsigned ( zerofill) => {
449
469
format_type_with_optional_length ( f, "SMALLINT" , zerofill, true )
450
470
}
451
471
DataType :: MediumInt ( zerofill) => {
452
472
format_type_with_optional_length ( f, "MEDIUMINT" , zerofill, false )
453
473
}
454
- DataType :: UnsignedMediumInt ( zerofill) => {
474
+ DataType :: MediumIntUnsigned ( zerofill) => {
455
475
format_type_with_optional_length ( f, "MEDIUMINT" , zerofill, true )
456
476
}
457
477
DataType :: Int ( zerofill) => format_type_with_optional_length ( f, "INT" , zerofill, false ) ,
458
- DataType :: UnsignedInt ( zerofill) => {
478
+ DataType :: IntUnsigned ( zerofill) => {
459
479
format_type_with_optional_length ( f, "INT" , zerofill, true )
460
480
}
461
481
DataType :: Int4 ( zerofill) => {
@@ -479,22 +499,22 @@ impl fmt::Display for DataType {
479
499
DataType :: Int256 => {
480
500
write ! ( f, "Int256" )
481
501
}
482
- DataType :: UnsignedInt4 ( zerofill) => {
502
+ DataType :: Int4Unsigned ( zerofill) => {
483
503
format_type_with_optional_length ( f, "INT4" , zerofill, true )
484
504
}
485
505
DataType :: Integer ( zerofill) => {
486
506
format_type_with_optional_length ( f, "INTEGER" , zerofill, false )
487
507
}
488
- DataType :: UnsignedInteger ( zerofill) => {
508
+ DataType :: IntegerUnsigned ( zerofill) => {
489
509
format_type_with_optional_length ( f, "INTEGER" , zerofill, true )
490
510
}
491
511
DataType :: BigInt ( zerofill) => {
492
512
format_type_with_optional_length ( f, "BIGINT" , zerofill, false )
493
513
}
494
- DataType :: UnsignedBigInt ( zerofill) => {
514
+ DataType :: BigIntUnsigned ( zerofill) => {
495
515
format_type_with_optional_length ( f, "BIGINT" , zerofill, true )
496
516
}
497
- DataType :: UnsignedInt8 ( zerofill) => {
517
+ DataType :: Int8Unsigned ( zerofill) => {
498
518
format_type_with_optional_length ( f, "INT8" , zerofill, true )
499
519
}
500
520
DataType :: UInt8 => {
@@ -515,6 +535,18 @@ impl fmt::Display for DataType {
515
535
DataType :: UInt256 => {
516
536
write ! ( f, "UInt256" )
517
537
}
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
+ }
518
550
DataType :: Real => write ! ( f, "REAL" ) ,
519
551
DataType :: Float4 => write ! ( f, "FLOAT4" ) ,
520
552
DataType :: Float32 => write ! ( f, "Float32" ) ,
0 commit comments