mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-08 01:15:00 +00:00
Add support for unit on char length units for small character string types. (#663)
This results in complete support for ANSI CHARACTER, CHAR, CHARACTER VARYING, CHAR VARYING, and VARCHAR.
This commit is contained in:
parent
777672625f
commit
cacdf3305f
6 changed files with 244 additions and 34 deletions
|
@ -74,7 +74,10 @@ fn parse_create_table_with_defaults() {
|
|||
},
|
||||
ColumnDef {
|
||||
name: "first_name".into(),
|
||||
data_type: DataType::CharacterVarying(Some(45)),
|
||||
data_type: DataType::CharacterVarying(Some(CharacterLength {
|
||||
length: 45,
|
||||
unit: None
|
||||
})),
|
||||
collation: None,
|
||||
options: vec![ColumnOptionDef {
|
||||
name: None,
|
||||
|
@ -83,7 +86,10 @@ fn parse_create_table_with_defaults() {
|
|||
},
|
||||
ColumnDef {
|
||||
name: "last_name".into(),
|
||||
data_type: DataType::CharacterVarying(Some(45)),
|
||||
data_type: DataType::CharacterVarying(Some(CharacterLength {
|
||||
length: 45,
|
||||
unit: None
|
||||
})),
|
||||
collation: Some(ObjectName(vec![Ident::with_quote('"', "es_ES")])),
|
||||
options: vec![ColumnOptionDef {
|
||||
name: None,
|
||||
|
@ -92,7 +98,10 @@ fn parse_create_table_with_defaults() {
|
|||
},
|
||||
ColumnDef {
|
||||
name: "email".into(),
|
||||
data_type: DataType::CharacterVarying(Some(50)),
|
||||
data_type: DataType::CharacterVarying(Some(CharacterLength {
|
||||
length: 50,
|
||||
unit: None
|
||||
})),
|
||||
collation: None,
|
||||
options: vec![],
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue