@@ -33,8 +33,11 @@ pub enum DataType {
33
33
Nvarchar ( Option < u64 > ) ,
34
34
/// Uuid type
35
35
Uuid ,
36
- /// Large character object e.g. CLOB(1000)
37
- Clob ( u64 ) ,
36
+ /// Large character object with optional length e.g. CLOB, CLOB(1000), [standard], [Oracle]
37
+ ///
38
+ /// [standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#character-large-object-type
39
+ /// [Oracle]: https://docs.oracle.com/javadb/10.10.1.2/ref/rrefclob.html
40
+ Clob ( Option < u64 > ) ,
38
41
/// Fixed-length binary type with optional length e.g. [standard], [MS SQL Server]
39
42
///
40
43
/// [standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#binary-string-type
@@ -45,8 +48,11 @@ pub enum DataType {
45
48
/// [standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#binary-string-type
46
49
/// [MS SQL Server]: https://learn.microsoft.com/pt-br/sql/t-sql/data-types/binary-and-varbinary-transact-sql?view=sql-server-ver16
47
50
Varbinary ( Option < u64 > ) ,
48
- /// Large binary object e.g. BLOB(1000)
49
- Blob ( u64 ) ,
51
+ /// Large binary object with optional length e.g. BLOB, BLOB(1000), [standard], [Oracle]
52
+ ///
53
+ /// [standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#binary-large-object-string-type
54
+ /// [Oracle]: https://docs.oracle.com/javadb/10.8.3.0/ref/rrefblob.html
55
+ Blob ( Option < u64 > ) ,
50
56
/// Decimal type with optional precision and scale e.g. DECIMAL(10,2)
51
57
Decimal ( Option < u64 > , Option < u64 > ) ,
52
58
/// Floating point with optional precision e.g. FLOAT(8)
@@ -131,12 +137,12 @@ impl fmt::Display for DataType {
131
137
format_type_with_optional_length ( f, "NVARCHAR" , size, false )
132
138
}
133
139
DataType :: Uuid => write ! ( f, "UUID" ) ,
134
- DataType :: Clob ( size) => write ! ( f, "CLOB({}) " , size) ,
140
+ DataType :: Clob ( size) => format_type_with_optional_length ( f, "CLOB" , size, false ) ,
135
141
DataType :: Binary ( size) => format_type_with_optional_length ( f, "BINARY" , size, false ) ,
136
142
DataType :: Varbinary ( size) => {
137
143
format_type_with_optional_length ( f, "VARBINARY" , size, false )
138
144
}
139
- DataType :: Blob ( size) => write ! ( f, "BLOB({}) " , size) ,
145
+ DataType :: Blob ( size) => format_type_with_optional_length ( f, "BLOB" , size, false ) ,
140
146
DataType :: Decimal ( precision, scale) => {
141
147
if let Some ( scale) = scale {
142
148
write ! ( f, "NUMERIC({},{})" , precision. unwrap( ) , scale)
0 commit comments