Files
Zane Walker 7e940c83a7
Some checks failed
Build & Test / build-test (push) Has been cancelled
Build & Test / swagger-codegen-cli (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
(Feat): Initial Commit
2026-07-03 19:41:31 +05:30

23 lines
488 B
Go

package db
import "github.com/aarondl/sqlboiler/v4/queries/qm"
// CombineWithOr receives a slice of query mods and returns a new slice with
// a single query mod, combining all other query mods into an OR expression.
func CombineWithOr(qms []qm.QueryMod) []qm.QueryMod {
if len(qms) == 0 {
return []qm.QueryMod{}
}
if len(qms) == 1 {
return qms
}
q := []qm.QueryMod{qms[0]}
for _, sq := range qms[1:] {
q = append(q, qm.Or2(sq))
}
return []qm.QueryMod{qm.Expr(q...)}
}