mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 06:18:17 +00:00
fix column COLLATE
not displayed (#1012)
This commit is contained in:
parent
c68e9775a2
commit
88510f6625
2 changed files with 8 additions and 0 deletions
|
@ -517,6 +517,9 @@ pub struct ColumnDef {
|
|||
impl fmt::Display for ColumnDef {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{} {}", self.name, self.data_type)?;
|
||||
if let Some(collation) = &self.collation {
|
||||
write!(f, " COLLATE {collation}")?;
|
||||
}
|
||||
for option in &self.options {
|
||||
write!(f, " {option}")?;
|
||||
}
|
||||
|
|
|
@ -7635,3 +7635,8 @@ fn parse_create_type() {
|
|||
create_type
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_create_table_collate() {
|
||||
pg_and_generic().verified_stmt("CREATE TABLE tbl (foo INT, bar TEXT COLLATE \"de_DE\")");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue