(depth int, w expr.DialectWriter)
| 1694 | |
| 1695 | func (m *SqlWhere) Keyword() lex.TokenType { return m.Op } |
| 1696 | func (m *SqlWhere) writeDialectDepth(depth int, w expr.DialectWriter) { |
| 1697 | if int(m.Op) == 0 && m.Source == nil && m.Expr != nil { |
| 1698 | m.Expr.WriteDialect(w) |
| 1699 | return |
| 1700 | } |
| 1701 | // Op = subselect or in etc |
| 1702 | // SELECT ... WHERE IN (SELECT ...) |
| 1703 | if int(m.Op) != 0 && m.Source != nil { |
| 1704 | io.WriteString(w, m.Op.String()) |
| 1705 | io.WriteString(w, " (") |
| 1706 | m.Source.writeDialectDepth(depth+1, w) |
| 1707 | io.WriteString(w, ")") |
| 1708 | return |
| 1709 | } |
| 1710 | u.Errorf("unrecognized SqlWhere statement? %#v", m) |
| 1711 | } |
| 1712 | func (m *SqlWhere) WriteDialect(w expr.DialectWriter) { m.writeDialectDepth(0, w) } |
| 1713 | func (m *SqlWhere) String() string { |
| 1714 | w := expr.NewDefaultWriter() |
no test coverage detected