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,
|
f,
|
||||||
"DEFINE EVENT {} ON {} WHEN {} THEN {}",
|
"DEFINE EVENT {} ON {} WHEN {} THEN {}",
|
||||||
self.name, self.what, self.when, self.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 {
|
if let Some(ref v) = self.assert {
|
||||||
write!(f, " ASSERT {v}")?
|
write!(f, " ASSERT {v}")?
|
||||||
}
|
}
|
||||||
|
if let Some(ref v) = self.comment {
|
||||||
|
write!(f, " COMMENT {v}")?
|
||||||
|
}
|
||||||
if !self.permissions.is_full() {
|
if !self.permissions.is_full() {
|
||||||
write!(f, " {}", self.permissions)?;
|
write!(f, " {}", self.permissions)?;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,9 @@ impl Display for DefineIndexStatement {
|
||||||
if Index::Idx != self.index {
|
if Index::Idx != self.index {
|
||||||
write!(f, " {}", self.index)?;
|
write!(f, " {}", self.index)?;
|
||||||
}
|
}
|
||||||
|
if let Some(ref v) = self.comment {
|
||||||
|
write!(f, " COMMENT {v}")?
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,11 @@ impl DefineParamStatement {
|
||||||
|
|
||||||
impl Display for DefineParamStatement {
|
impl Display for DefineParamStatement {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
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 {
|
if let Some(ref v) = self.signin {
|
||||||
write!(f, " SIGNIN {v}")?
|
write!(f, " SIGNIN {v}")?
|
||||||
}
|
}
|
||||||
|
if let Some(ref v) = self.comment {
|
||||||
|
write!(f, " COMMENT {v}")?
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,6 +113,9 @@ impl Display for DefineTableStatement {
|
||||||
} else {
|
} else {
|
||||||
" SCHEMALESS"
|
" SCHEMALESS"
|
||||||
})?;
|
})?;
|
||||||
|
if let Some(ref v) = self.comment {
|
||||||
|
write!(f, " COMMENT {v}")?
|
||||||
|
}
|
||||||
if let Some(ref v) = self.view {
|
if let Some(ref v) = self.view {
|
||||||
write!(f, " {v}")?
|
write!(f, " {v}")?
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,11 @@ impl Display for DefineUserStatement {
|
||||||
Fmt::comma_separated(
|
Fmt::comma_separated(
|
||||||
&self.roles.iter().map(|r| r.to_string().to_uppercase()).collect::<Vec<String>>()
|
&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