(n *chast.ColumnDeclaration)
| 819 | } |
| 820 | |
| 821 | func (c *cc) convertColumnDeclaration(n *chast.ColumnDeclaration) *ast.ColumnDef { |
| 822 | colDef := &ast.ColumnDef{ |
| 823 | Colname: identifier(n.Name), |
| 824 | IsNotNull: isNotNull(n), |
| 825 | } |
| 826 | |
| 827 | if n.Type != nil { |
| 828 | colDef.TypeName = &ast.TypeName{ |
| 829 | Name: n.Type.Name, |
| 830 | } |
| 831 | // Handle type parameters (e.g., Decimal(10, 2)) |
| 832 | if len(n.Type.Parameters) > 0 { |
| 833 | colDef.TypeName.Typmods = &ast.List{} |
| 834 | for _, param := range n.Type.Parameters { |
| 835 | colDef.TypeName.Typmods.Items = append(colDef.TypeName.Typmods.Items, c.convertExpr(param)) |
| 836 | } |
| 837 | } |
| 838 | } |
| 839 | |
| 840 | // Handle PRIMARY KEY constraint |
| 841 | if n.PrimaryKey { |
| 842 | colDef.PrimaryKey = true |
| 843 | } |
| 844 | |
| 845 | // Handle DEFAULT |
| 846 | if n.Default != nil { |
| 847 | // colDef.RawDefault = c.convertExpr(n.Default) |
| 848 | } |
| 849 | |
| 850 | // Handle comment |
| 851 | if n.Comment != "" { |
| 852 | colDef.Comment = n.Comment |
| 853 | } |
| 854 | |
| 855 | return colDef |
| 856 | } |
| 857 | |
| 858 | func (c *cc) convertUpdateQuery(n *chast.UpdateQuery) *ast.UpdateStmt { |
| 859 | rv := &ast.RangeVar{ |
no test coverage detected