(n *chast.TruncateQuery)
| 1000 | } |
| 1001 | |
| 1002 | func (c *cc) convertTruncateQuery(n *chast.TruncateQuery) *ast.TruncateStmt { |
| 1003 | stmt := &ast.TruncateStmt{ |
| 1004 | Relations: &ast.List{}, |
| 1005 | } |
| 1006 | |
| 1007 | tableName := n.Table |
| 1008 | schemaName := n.Database |
| 1009 | |
| 1010 | rv := &ast.RangeVar{ |
| 1011 | Relname: &tableName, |
| 1012 | } |
| 1013 | if schemaName != "" { |
| 1014 | rv.Schemaname = &schemaName |
| 1015 | } |
| 1016 | |
| 1017 | stmt.Relations.Items = append(stmt.Relations.Items, rv) |
| 1018 | |
| 1019 | return stmt |
| 1020 | } |