func (db *DB) DropTable(st interface{}, ifexists bool) error { t, err := NewTable(st) if err != nil { return err } _, err = db.Exec(sql.DropTableQuery(t.SQLName, true)) return err }
func TestDropTableQuery(t *testing.T) { assert.Equal(t, sql.DropTableQuery("yolo", false), "DROP TABLE yolo") assert.Equal(t, sql.DropTableQuery("yolo", true), "DROP TABLE IF EXISTS yolo") }