GORM Playground Link
https://github.com/go-gorm/playground/pull/565
Description
If you chain two clauses together, the library doesn't properly parenthesize the combined expression. e.g.
DB.Clauses(&clause.Expr{
SQL: `id = 1 OR id = 2`,
}, &clause.Expr{
SQL: `name = "bar"`,
}).Find(&results)
generates the following SQL query: SELECT * FROM `companies` WHERE id = 1 OR id = 2 AND name = "bar"
but it should be SELECT * FROM `companies` WHERE (id = 1 OR id = 2) AND name = "bar"
Comment From: a631807682
clause.Expr is designed to be used in raw sql. use clause.Or