stmtTypeName returns a human-readable name for a statement type.
(stmt ast.Statement)
| 163 | |
| 164 | // stmtTypeName returns a human-readable name for a statement type. |
| 165 | func stmtTypeName(stmt ast.Statement) string { |
| 166 | switch stmt.(type) { |
| 167 | case *ast.SelectStatement: |
| 168 | return "SELECT" |
| 169 | case *ast.UpdateStatement: |
| 170 | return "UPDATE" |
| 171 | case *ast.DeleteStatement: |
| 172 | return "DELETE" |
| 173 | case *ast.InsertStatement: |
| 174 | return "INSERT" |
| 175 | default: |
| 176 | return fmt.Sprintf("%T", stmt) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | // ParseSQL parses a SQL string into a full AST containing all statements. This is |
| 181 | // a convenience wrapper around the tokenizer and parser pipeline that handles |
no outgoing calls
no test coverage detected