@@ -76,6 +76,18 @@ pub enum DataType {
7676 /// [standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#binary-large-object-string-type
7777 /// [Oracle]: https://docs.oracle.com/javadb/10.8.3.0/ref/rrefblob.html
7878 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 ,
7991 /// Variable-length binary data with optional length.
8092 ///
8193 /// [bigquery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#bytes_type
@@ -275,6 +287,18 @@ pub enum DataType {
275287 Regclass ,
276288 /// Text
277289 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 ,
278302 /// String with optional length.
279303 String ( Option < u64 > ) ,
280304 /// A fixed-length string e.g [ClickHouse][1].
@@ -355,6 +379,9 @@ impl fmt::Display for DataType {
355379 format_type_with_optional_length ( f, "VARBINARY" , size, false )
356380 }
357381 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" ) ,
358385 DataType :: Bytes ( size) => format_type_with_optional_length ( f, "BYTES" , size, false ) ,
359386 DataType :: Numeric ( info) => {
360387 write ! ( f, "NUMERIC{info}" )
@@ -486,6 +513,9 @@ impl fmt::Display for DataType {
486513 DataType :: JSONB => write ! ( f, "JSONB" ) ,
487514 DataType :: Regclass => write ! ( f, "REGCLASS" ) ,
488515 DataType :: Text => write ! ( f, "TEXT" ) ,
516+ DataType :: TinyText => write ! ( f, "TINYTEXT" ) ,
517+ DataType :: MediumText => write ! ( f, "MEDIUMTEXT" ) ,
518+ DataType :: LongText => write ! ( f, "LONGTEXT" ) ,
489519 DataType :: String ( size) => format_type_with_optional_length ( f, "STRING" , size, false ) ,
490520 DataType :: Bytea => write ! ( f, "BYTEA" ) ,
491521 DataType :: Array ( ty) => match ty {
0 commit comments