Ensure comments are output with DEFINE
statements (#2500)
This commit is contained in:
parent
b1275ed565
commit
495f69d618
7 changed files with 27 additions and 3 deletions
|
@ -66,7 +66,11 @@ impl Display for DefineEventStatement {
|
|||
f,
|
||||
"DEFINE EVENT {} ON {} WHEN {} THEN {}",
|
||||
self.name, self.what, self.when, self.then
|
||||
)
|
||||
)?;
|
||||
if let Some(ref v) = self.comment {
|
||||
write!(f, " COMMENT {v}")?
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -84,6 +84,9 @@ impl Display for DefineFieldStatement {
|
|||
if let Some(ref v) = self.assert {
|
||||
write!(f, " ASSERT {v}")?
|
||||
}
|
||||
if let Some(ref v) = self.comment {
|
||||
write!(f, " COMMENT {v}")?
|
||||
}
|
||||
if !self.permissions.is_full() {
|
||||
write!(f, " {}", self.permissions)?;
|
||||
}
|
||||
|
|
|
@ -90,6 +90,9 @@ impl Display for DefineIndexStatement {
|
|||
if Index::Idx != self.index {
|
||||
write!(f, " {}", self.index)?;
|
||||
}
|
||||
if let Some(ref v) = self.comment {
|
||||
write!(f, " COMMENT {v}")?
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,11 @@ impl DefineParamStatement {
|
|||
|
||||
impl Display for DefineParamStatement {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "DEFINE PARAM ${} VALUE {}", self.name, self.value)
|
||||
write!(f, "DEFINE PARAM ${} VALUE {}", self.name, self.value)?;
|
||||
if let Some(ref v) = self.comment {
|
||||
write!(f, " COMMENT {v}")?
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,6 +70,9 @@ impl Display for DefineScopeStatement {
|
|||
if let Some(ref v) = self.signin {
|
||||
write!(f, " SIGNIN {v}")?
|
||||
}
|
||||
if let Some(ref v) = self.comment {
|
||||
write!(f, " COMMENT {v}")?
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,6 +113,9 @@ impl Display for DefineTableStatement {
|
|||
} else {
|
||||
" SCHEMALESS"
|
||||
})?;
|
||||
if let Some(ref v) = self.comment {
|
||||
write!(f, " COMMENT {v}")?
|
||||
}
|
||||
if let Some(ref v) = self.view {
|
||||
write!(f, " {v}")?
|
||||
}
|
||||
|
|
|
@ -128,7 +128,11 @@ impl Display for DefineUserStatement {
|
|||
Fmt::comma_separated(
|
||||
&self.roles.iter().map(|r| r.to_string().to_uppercase()).collect::<Vec<String>>()
|
||||
)
|
||||
)
|
||||
)?;
|
||||
if let Some(ref v) = self.comment {
|
||||
write!(f, " COMMENT {v}")?
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue