Skip to content

Commit

Permalink
fixup bq args bs
Browse files Browse the repository at this point in the history
  • Loading branch information
donhcd committed Dec 12, 2020
1 parent 35b9f2b commit 3d9f2c4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1078,11 +1078,26 @@ impl fmt::Display for Function {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"{}({}{})",
"{}({}{}",
self.name,
if self.distinct { "DISTINCT " } else { "" },
display_comma_separated(&self.args),
)?;
if let Some(b) = self.ignore_respect_nulls {
write!(f, " {} NULLS", if b { "IGNORE" } else { "RESPECT" })?;
}
if !self.order_by.is_empty() {
write!(f, " ORDER BY ")?;
let mut delim = "";
for order_by in &self.order_by {
write!(f, "{}{}", delim, order_by)?;
delim = ", ";
}
}
if let Some(ref lim) = self.limit {
write!(f, " LIMIT {}", lim)?;
}
write!(f, ")")?;
if !self.within_group.is_empty() {
write!(
f,
Expand Down
1 change: 1 addition & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ impl fmt::Display for ParserError {

impl Error for ParserError {}

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

0 comments on commit 3d9f2c4

Please sign in to comment.