mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-22 22:20:02 +00:00
fix: enhance ColumnOption::DefaultValue formatting for string values (#4287)
This commit is contained in:
@@ -39,7 +39,12 @@ impl Display for ColumnOption {
|
||||
ColumnOption::Null => write!(f, "NULL"),
|
||||
ColumnOption::NotNull => write!(f, "NOT NULL"),
|
||||
ColumnOption::DefaultFn(s) => write!(f, "DEFAULT {}", s),
|
||||
ColumnOption::DefaultValue(s) => write!(f, "DEFAULT {}", s),
|
||||
ColumnOption::DefaultValue(s) => match s {
|
||||
Value::String(value) => {
|
||||
write!(f, "DEFAULT \'{}\'", value.as_utf8())
|
||||
}
|
||||
_ => write!(f, "DEFAULT {}", s),
|
||||
},
|
||||
ColumnOption::TimeIndex => write!(f, "TIME INDEX"),
|
||||
ColumnOption::PrimaryKey => write!(f, "PRIMARY KEY"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user