Support minimum display width for integer data types (#337)

* Support minimum display width for integers

* make fmt happy, updated docstrings
This commit is contained in:
Alex Vasilev 2021-08-29 14:13:10 +03:00 committed by GitHub
parent 9a5716d94b
commit 77d90d3b85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 81 additions and 36 deletions

View file

@ -2008,10 +2008,12 @@ impl<'a> Parser<'a> {
let _ = self.parse_keyword(Keyword::PRECISION);
Ok(DataType::Double)
}
Keyword::TINYINT => Ok(DataType::TinyInt),
Keyword::SMALLINT => Ok(DataType::SmallInt),
Keyword::INT | Keyword::INTEGER => Ok(DataType::Int),
Keyword::BIGINT => Ok(DataType::BigInt),
Keyword::TINYINT => Ok(DataType::TinyInt(self.parse_optional_precision()?)),
Keyword::SMALLINT => Ok(DataType::SmallInt(self.parse_optional_precision()?)),
Keyword::INT | Keyword::INTEGER => {
Ok(DataType::Int(self.parse_optional_precision()?))
}
Keyword::BIGINT => Ok(DataType::BigInt(self.parse_optional_precision()?)),
Keyword::VARCHAR => Ok(DataType::Varchar(self.parse_optional_precision()?)),
Keyword::CHAR | Keyword::CHARACTER => {
if self.parse_keyword(Keyword::VARYING) {