(formatter *Formatter)
| 144 | } |
| 145 | |
| 146 | func (p *BinaryOperation) FormatSQL(formatter *Formatter) { |
| 147 | if p.isLogicalOp() && formatter.mode == FormatModeBeautify { |
| 148 | p.writeLogicalOperand(formatter, p.LeftExpr) |
| 149 | formatter.NewLine() |
| 150 | if p.HasNot { |
| 151 | formatter.WriteString("NOT ") |
| 152 | } else if p.HasGlobal { |
| 153 | formatter.WriteString("GLOBAL ") |
| 154 | } |
| 155 | formatter.WriteString(string(p.Operation)) |
| 156 | formatter.NewLine() |
| 157 | p.writeLogicalOperand(formatter, p.RightExpr) |
| 158 | return |
| 159 | } |
| 160 | formatter.WriteExpr(p.LeftExpr) |
| 161 | if p.Operation != TokenKindDash { |
| 162 | formatter.WriteByte(whitespace) |
| 163 | } |
| 164 | if p.HasNot { |
| 165 | formatter.WriteString("NOT ") |
| 166 | } else if p.HasGlobal { |
| 167 | formatter.WriteString("GLOBAL ") |
| 168 | } |
| 169 | formatter.WriteString(string(p.Operation)) |
| 170 | if p.Operation != TokenKindDash { |
| 171 | formatter.WriteByte(whitespace) |
| 172 | } |
| 173 | formatter.WriteExpr(p.RightExpr) |
| 174 | } |
| 175 | |
| 176 | func (a *AliasExpr) FormatSQL(formatter *Formatter) { |
| 177 | if _, isSelect := a.Expr.(*SelectQuery); isSelect { |
nothing calls this directly
no test coverage detected