SQL returns the SQL representation of this DROP statement, including the object type, optional IF EXISTS, object names, and CASCADE/RESTRICT behavior.
()
| 888 | // SQL returns the SQL representation of this DROP statement, including the |
| 889 | // object type, optional IF EXISTS, object names, and CASCADE/RESTRICT behavior. |
| 890 | func (d *DropStatement) SQL() string { |
| 891 | if d == nil { |
| 892 | return "" |
| 893 | } |
| 894 | sb := getBuilder() |
| 895 | defer putBuilder(sb) |
| 896 | sb.WriteString("DROP ") |
| 897 | sb.WriteString(d.ObjectType) |
| 898 | sb.WriteString(" ") |
| 899 | if d.IfExists { |
| 900 | sb.WriteString("IF EXISTS ") |
| 901 | } |
| 902 | sb.WriteString(strings.Join(d.Names, ", ")) |
| 903 | if d.CascadeType != "" { |
| 904 | sb.WriteString(" ") |
| 905 | sb.WriteString(d.CascadeType) |
| 906 | } |
| 907 | return sb.String() |
| 908 | } |
| 909 | |
| 910 | // SQL returns the SQL representation of this TRUNCATE statement, including |
| 911 | // table names, RESTART/CONTINUE IDENTITY options, and CASCADE/RESTRICT behavior. |