Or add OR conditions Or is used to chain together queries with an OR. // Find the first user with name equal to jinzhu or john db.Where("name = ?", "jinzhu").Or("name = ?", "john").First(&user)
(query interface{}, args ...interface{})
| 233 | // // Find the first user with name equal to jinzhu or john |
| 234 | // db.Where("name = ?", "jinzhu").Or("name = ?", "john").First(&user) |
| 235 | func (db *DB) Or(query interface{}, args ...interface{}) (tx *DB) { |
| 236 | tx = db.getInstance() |
| 237 | if conds := tx.Statement.BuildCondition(query, args...); len(conds) > 0 { |
| 238 | tx.Statement.AddClause(clause.Where{Exprs: []clause.Expression{clause.Or(clause.And(conds...))}}) |
| 239 | } |
| 240 | return |
| 241 | } |
| 242 | |
| 243 | // Joins specify Joins conditions |
| 244 | // |
nothing calls this directly
no test coverage detected