refactor(query): fix pretty name
@@ -64,7 +64,7 @@ impl Expression {
match self {
Expression::Constant { value, .. } => value.to_string(),
Expression::Function { name, args, .. } => match name.as_str() {
- "+" | "-" | "*" | "/" | "%" => {
+ "+" | "-" | "*" | "/" | "%" if args.len() == 2 => {
format!(
"({})",
args.iter()
@@ -73,6 +73,14 @@ impl Expression {
.join(name)
)
}
+ ">=" | "<=" | "=" | ">" | "<" if args.len() == 2 => {
+ format!(
+ "({} {} {})",
+ args[0].column_name(),
+ name,
+ args[1].column_name()
+ )
+ }
_ => {
let args = args
.iter()
