(n *pcast.CreateTableStmt)
| 218 | } |
| 219 | |
| 220 | func (c *cc) convertCreateTableStmt(n *pcast.CreateTableStmt) ast.Node { |
| 221 | create := &ast.CreateTableStmt{ |
| 222 | Name: parseTableName(n.Table), |
| 223 | IfNotExists: n.IfNotExists, |
| 224 | } |
| 225 | if n.ReferTable != nil { |
| 226 | create.ReferTable = parseTableName(n.ReferTable) |
| 227 | } |
| 228 | for _, def := range n.Cols { |
| 229 | create.Cols = append(create.Cols, convertColumnDef(def)) |
| 230 | } |
| 231 | for _, opt := range n.Options { |
| 232 | switch opt.Tp { |
| 233 | case pcast.TableOptionComment: |
| 234 | create.Comment = opt.StrValue |
| 235 | } |
| 236 | } |
| 237 | return create |
| 238 | } |
| 239 | |
| 240 | func convertColumnDef(def *pcast.ColumnDef) *ast.ColumnDef { |
| 241 | var vals *ast.List |
no test coverage detected