mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-02 10:32:29 +00:00
chore: bump all go dependencies (#614)
* bump all
* code-generation
Former-commit-id: c0e8e34065
This commit is contained in:
parent
742ece7923
commit
1adf24e109
40 changed files with 659 additions and 292 deletions
|
@ -424,32 +424,15 @@ func HasItemsWith(preds ...predicate.Item) predicate.Label {
|
|||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Label) predicate.Label {
|
||||
return predicate.Label(func(s *sql.Selector) {
|
||||
s1 := s.Clone().SetP(nil)
|
||||
for _, p := range predicates {
|
||||
p(s1)
|
||||
}
|
||||
s.Where(s1.P())
|
||||
})
|
||||
return predicate.Label(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Label) predicate.Label {
|
||||
return predicate.Label(func(s *sql.Selector) {
|
||||
s1 := s.Clone().SetP(nil)
|
||||
for i, p := range predicates {
|
||||
if i > 0 {
|
||||
s1.Or()
|
||||
}
|
||||
p(s1)
|
||||
}
|
||||
s.Where(s1.P())
|
||||
})
|
||||
return predicate.Label(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Label) predicate.Label {
|
||||
return predicate.Label(func(s *sql.Selector) {
|
||||
p(s.Not())
|
||||
})
|
||||
return predicate.Label(sql.NotPredicates(p))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue