| 58 | } |
| 59 | |
| 60 | func TestDropStatement_SQL(t *testing.T) { |
| 61 | stmt := &DropStatement{ |
| 62 | ObjectType: "TABLE", |
| 63 | IfExists: true, |
| 64 | Names: []string{"users", "orders"}, |
| 65 | CascadeType: "CASCADE", |
| 66 | } |
| 67 | sql := stmt.SQL() |
| 68 | for _, want := range []string{"DROP TABLE", "IF EXISTS", "users, orders", "CASCADE"} { |
| 69 | if !strings.Contains(sql, want) { |
| 70 | t.Errorf("SQL() missing %q, got: %s", want, sql) |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | func TestTruncateStatement_SQL(t *testing.T) { |
| 76 | stmt := &TruncateStatement{Tables: []string{"users"}, RestartIdentity: true, CascadeType: "CASCADE"} |