@@ -76,6 +76,18 @@ pub enum DataType {
76
76
/// [standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#binary-large-object-string-type
77
77
/// [Oracle]: https://docs.oracle.com/javadb/10.8.3.0/ref/rrefblob.html
78
78
Blob ( Option < u64 > ) ,
79
+ /// [MySQL] blob with up to 2**8 bytes
80
+ ///
81
+ /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
82
+ TinyBlob ,
83
+ /// [MySQL] blob with up to 2**24 bytes
84
+ ///
85
+ /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
86
+ MediumBlob ,
87
+ /// [MySQL] blob with up to 2**32 bytes
88
+ ///
89
+ /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
90
+ LongBlob ,
79
91
/// Variable-length binary data with optional length.
80
92
///
81
93
/// [bigquery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#bytes_type
@@ -275,6 +287,18 @@ pub enum DataType {
275
287
Regclass ,
276
288
/// Text
277
289
Text ,
290
+ /// [MySQL] text with up to 2**8 bytes
291
+ ///
292
+ /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
293
+ TinyText ,
294
+ /// [MySQL] text with up to 2**24 bytes
295
+ ///
296
+ /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
297
+ MediumText ,
298
+ /// [MySQL] text with up to 2**32 bytes
299
+ ///
300
+ /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
301
+ LongText ,
278
302
/// String with optional length.
279
303
String ( Option < u64 > ) ,
280
304
/// A fixed-length string e.g [ClickHouse][1].
@@ -355,6 +379,9 @@ impl fmt::Display for DataType {
355
379
format_type_with_optional_length ( f, "VARBINARY" , size, false )
356
380
}
357
381
DataType :: Blob ( size) => format_type_with_optional_length ( f, "BLOB" , size, false ) ,
382
+ DataType :: TinyBlob => write ! ( f, "TINYBLOB" ) ,
383
+ DataType :: MediumBlob => write ! ( f, "MEDIUMBLOB" ) ,
384
+ DataType :: LongBlob => write ! ( f, "LONGBLOB" ) ,
358
385
DataType :: Bytes ( size) => format_type_with_optional_length ( f, "BYTES" , size, false ) ,
359
386
DataType :: Numeric ( info) => {
360
387
write ! ( f, "NUMERIC{info}" )
@@ -486,6 +513,9 @@ impl fmt::Display for DataType {
486
513
DataType :: JSONB => write ! ( f, "JSONB" ) ,
487
514
DataType :: Regclass => write ! ( f, "REGCLASS" ) ,
488
515
DataType :: Text => write ! ( f, "TEXT" ) ,
516
+ DataType :: TinyText => write ! ( f, "TINYTEXT" ) ,
517
+ DataType :: MediumText => write ! ( f, "MEDIUMTEXT" ) ,
518
+ DataType :: LongText => write ! ( f, "LONGTEXT" ) ,
489
519
DataType :: String ( size) => format_type_with_optional_length ( f, "STRING" , size, false ) ,
490
520
DataType :: Bytea => write ! ( f, "BYTEA" ) ,
491
521
DataType :: Array ( ty) => match ty {
0 commit comments