(n *chast.DropQuery)
| 910 | } |
| 911 | |
| 912 | func (c *cc) convertDropQuery(n *chast.DropQuery) ast.Node { |
| 913 | // Handle DROP TABLE |
| 914 | if n.Table != "" { |
| 915 | tableName := &ast.TableName{ |
| 916 | Name: identifier(n.Table), |
| 917 | } |
| 918 | if n.Database != "" { |
| 919 | tableName.Schema = identifier(n.Database) |
| 920 | } |
| 921 | return &ast.DropTableStmt{ |
| 922 | IfExists: n.IfExists, |
| 923 | Tables: []*ast.TableName{tableName}, |
| 924 | } |
| 925 | } |
| 926 | |
| 927 | // Handle DROP TABLE with multiple tables |
| 928 | if len(n.Tables) > 0 { |
| 929 | tables := make([]*ast.TableName, 0, len(n.Tables)) |
| 930 | for _, t := range n.Tables { |
| 931 | tables = append(tables, parseTableName(t)) |
| 932 | } |
| 933 | return &ast.DropTableStmt{ |
| 934 | IfExists: n.IfExists, |
| 935 | Tables: tables, |
| 936 | } |
| 937 | } |
| 938 | |
| 939 | // Handle DROP DATABASE - return TODO for now |
| 940 | // Handle DROP VIEW - return TODO for now |
| 941 | return &ast.TODO{} |
| 942 | } |
| 943 | |
| 944 | func (c *cc) convertAlterQuery(n *chast.AlterQuery) ast.Node { |
| 945 | alt := &ast.AlterTableStmt{ |
no test coverage detected