execStmt:=dryRunDB.Exec("WHERE (pizza = ? AND (size = ? OR size = ?)) OR (pizza = ? AND size = ?)","pepperoni","small","medium","hawaiian","xlarge").Statement
sql:=dryRunDB.Where("a = ? or b = ?","a","b").Find(&User{}).Statement.SQL.String()
if!regexp.MustCompile(`WHERE \(a = .+ or b = .+\) AND .users.\..deleted_at. IS NULL`).MatchString(sql){
t.Fatalf("invalid sql generated, got %v",sql)
}
sql=dryRunDB.Where("a = ? or b = ?","a","b").Or("c = ? and d = ?","c","d").Find(&User{}).Statement.SQL.String()
if!regexp.MustCompile(`WHERE \(a = .+ or b = .+\) OR \(c = .+ and d = .+\) AND .users.\..deleted_at. IS NULL`).MatchString(sql){
t.Fatalf("invalid sql generated, got %v",sql)
}
sql=dryRunDB.Where("a = ? or b = ?","a","b").Or("c = ?","c").Find(&User{}).Statement.SQL.String()
if!regexp.MustCompile(`WHERE \(a = .+ or b = .+\) OR c = .+ AND .users.\..deleted_at. IS NULL`).MatchString(sql){
t.Fatalf("invalid sql generated, got %v",sql)
}
sql=dryRunDB.Where("a = ? or b = ?","a","b").Or("c = ? and d = ?","c","d").Or("e = ? and f = ?","e","f").Find(&User{}).Statement.SQL.String()
if!regexp.MustCompile(`WHERE \(a = .+ or b = .+\) OR \(c = .+ and d = .+\) OR \(e = .+ and f = .+\) AND .users.\..deleted_at. IS NULL`).MatchString(sql){
t.Fatalf("invalid sql generated, got %v",sql)
}
sql=dryRunDB.Where("a = ? or b = ?","a","b").Where("c = ? and d = ?","c","d").Not("e = ? and f = ?","e","f").Find(&User{}).Statement.SQL.String()
if!regexp.MustCompile(`WHERE \(a = .+ or b = .+\) AND \(c = .+ and d = .+\) AND NOT \(e = .+ and f = .+\) AND .users.\..deleted_at. IS NULL`).MatchString(sql){
t.Fatalf("invalid sql generated, got %v",sql)
}
sql=dryRunDB.Where("a = ? or b = ?","a","b").Where("c = ?","c").Not("e = ? and f = ?","e","f").Find(&User{}).Statement.SQL.String()
if!regexp.MustCompile(`WHERE \(a = .+ or b = .+\) AND c = .+ AND NOT \(e = .+ and f = .+\) AND .users.\..deleted_at. IS NULL`).MatchString(sql){
t.Fatalf("invalid sql generated, got %v",sql)
}
sql=dryRunDB.Where("a = ? or b = ?","a","b").Where("c = ? and d = ?","c","d").Not("e = ?","e").Find(&User{}).Statement.SQL.String()
if!regexp.MustCompile(`WHERE \(a = .+ or b = .+\) AND \(c = .+ and d = .+\) AND NOT e = .+ AND .users.\..deleted_at. IS NULL`).MatchString(sql){
t.Fatalf("invalid sql generated, got %v",sql)
}
sql=dryRunDB.Where("a = ? or b = ?","a","b").Unscoped().Find(&User{}).Statement.SQL.String()
if!regexp.MustCompile(`WHERE a = .+ or b = .+$`).MatchString(sql){
t.Fatalf("invalid sql generated, got %v",sql)
}
sql=dryRunDB.Or("a = ? or b = ?","a","b").Unscoped().Find(&User{}).Statement.SQL.String()
if!regexp.MustCompile(`WHERE a = .+ or b = .+$`).MatchString(sql){
t.Fatalf("invalid sql generated, got %v",sql)
}
sql=dryRunDB.Not("a = ? or b = ?","a","b").Unscoped().Find(&User{}).Statement.SQL.String()
if!regexp.MustCompile(`WHERE NOT \(a = .+ or b = .+\)$`).MatchString(sql){