Skip to content

Commit 3d9f2c4

Browse files
committed
fixup bq args bs
1 parent 35b9f2b commit 3d9f2c4

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/ast/mod.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,11 +1078,26 @@ impl fmt::Display for Function {
10781078
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10791079
write!(
10801080
f,
1081-
"{}({}{})",
1081+
"{}({}{}",
10821082
self.name,
10831083
if self.distinct { "DISTINCT " } else { "" },
10841084
display_comma_separated(&self.args),
10851085
)?;
1086+
if let Some(b) = self.ignore_respect_nulls {
1087+
write!(f, " {} NULLS", if b { "IGNORE" } else { "RESPECT" })?;
1088+
}
1089+
if !self.order_by.is_empty() {
1090+
write!(f, " ORDER BY ")?;
1091+
let mut delim = "";
1092+
for order_by in &self.order_by {
1093+
write!(f, "{}{}", delim, order_by)?;
1094+
delim = ", ";
1095+
}
1096+
}
1097+
if let Some(ref lim) = self.limit {
1098+
write!(f, " LIMIT {}", lim)?;
1099+
}
1100+
write!(f, ")")?;
10861101
if !self.within_group.is_empty() {
10871102
write!(
10881103
f,

src/parser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ impl fmt::Display for ParserError {
8282

8383
impl Error for ParserError {}
8484

85+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
8586
pub struct FunctionArgsRes {
8687
pub args: Vec<FunctionArg>,
8788
/// Some(true) for IGNORE NULLS, Some(false) for RESPECT NULLS

0 commit comments

Comments
 (0)