SQL returns the SQL string representation of the AST.
()
| 54 | |
| 55 | // SQL returns the SQL string representation of the AST. |
| 56 | func (a AST) SQL() string { |
| 57 | parts := make([]string, 0, len(a.Statements)) |
| 58 | for _, stmt := range a.Statements { |
| 59 | if s, ok := stmt.(interface{ SQL() string }); ok { |
| 60 | parts = append(parts, s.SQL()) |
| 61 | } |
| 62 | } |
| 63 | return strings.Join(parts, ";\n") |
| 64 | } |
| 65 | |
| 66 | // ============================================================ |
| 67 | // Expressions |
no outgoing calls