(w expr.DialectWriter)
| 54 | } |
| 55 | |
| 56 | func (m *FilterStatement) WriteDialect(w expr.DialectWriter) { |
| 57 | |
| 58 | if m.Description != "" { |
| 59 | if !strings.Contains(m.Description, "\n") { |
| 60 | io.WriteString(w, "--") |
| 61 | io.WriteString(w, m.Description) |
| 62 | io.WriteString(w, "\n") |
| 63 | } |
| 64 | } |
| 65 | io.WriteString(w, "FILTER ") |
| 66 | m.Filter.WriteDialect(w) |
| 67 | |
| 68 | if m.From != "" { |
| 69 | io.WriteString(w, " FROM ") |
| 70 | w.WriteIdentity(m.From) |
| 71 | } |
| 72 | if m.Limit > 0 { |
| 73 | io.WriteString(w, fmt.Sprintf(" LIMIT %d", m.Limit)) |
| 74 | } |
| 75 | if len(m.With) > 0 { |
| 76 | io.WriteString(w, " WITH ") |
| 77 | HelperString(w, m.With) |
| 78 | } |
| 79 | if m.Alias != "" { |
| 80 | io.WriteString(w, " ALIAS ") |
| 81 | w.WriteIdentity(m.Alias) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | // String representation of FilterStatement |
| 86 | func (m *FilterStatement) String() string { |
no test coverage detected