mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-08 18:54:21 +01:00
add paranthesis to the unary expression printer
This commit is contained in:
@@ -262,9 +262,11 @@ impl ToSqlString for Expr {
|
||||
ret.push(')');
|
||||
}
|
||||
Expr::Unary(unary_operator, expr) => {
|
||||
ret.push('(');
|
||||
ret.push_str(&unary_operator.to_string());
|
||||
ret.push(' ');
|
||||
ret.push_str(&expr.to_sql_string(context));
|
||||
ret.push(')');
|
||||
}
|
||||
Expr::Variable(variable) => {
|
||||
ret.push_str(variable);
|
||||
|
||||
@@ -77,7 +77,7 @@ impl ToSqlString for ast::OneSelect {
|
||||
|
||||
impl ToSqlString for ast::SelectInner {
|
||||
fn to_sql_string<C: ToSqlContext>(&self, context: &C) -> String {
|
||||
dbg!(&self);
|
||||
// dbg!(&self);
|
||||
let mut ret = Vec::with_capacity(2 + self.columns.len());
|
||||
ret.push("SELECT".to_string());
|
||||
if let Some(distinct) = self.distinctness {
|
||||
|
||||
Reference in New Issue
Block a user