487 lines
14 KiB
Go
487 lines
14 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package servers
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
"github.com/FrankenBotDev/FrankenAPI/ent/predicate"
|
|
)
|
|
|
|
// ID filters vertices based on their ID field.
|
|
func ID(id int) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldID), id))
|
|
})
|
|
}
|
|
|
|
// IDEQ applies the EQ predicate on the ID field.
|
|
func IDEQ(id int) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldID), id))
|
|
})
|
|
}
|
|
|
|
// IDNEQ applies the NEQ predicate on the ID field.
|
|
func IDNEQ(id int) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldID), id))
|
|
})
|
|
}
|
|
|
|
// IDIn applies the In predicate on the ID field.
|
|
func IDIn(ids ...int) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
v := make([]interface{}, len(ids))
|
|
for i := range v {
|
|
v[i] = ids[i]
|
|
}
|
|
s.Where(sql.In(s.C(FieldID), v...))
|
|
})
|
|
}
|
|
|
|
// IDNotIn applies the NotIn predicate on the ID field.
|
|
func IDNotIn(ids ...int) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
v := make([]interface{}, len(ids))
|
|
for i := range v {
|
|
v[i] = ids[i]
|
|
}
|
|
s.Where(sql.NotIn(s.C(FieldID), v...))
|
|
})
|
|
}
|
|
|
|
// IDGT applies the GT predicate on the ID field.
|
|
func IDGT(id int) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldID), id))
|
|
})
|
|
}
|
|
|
|
// IDGTE applies the GTE predicate on the ID field.
|
|
func IDGTE(id int) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldID), id))
|
|
})
|
|
}
|
|
|
|
// IDLT applies the LT predicate on the ID field.
|
|
func IDLT(id int) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldID), id))
|
|
})
|
|
}
|
|
|
|
// IDLTE applies the LTE predicate on the ID field.
|
|
func IDLTE(id int) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldID), id))
|
|
})
|
|
}
|
|
|
|
// Userid applies equality check predicate on the "userid" field. It's identical to UseridEQ.
|
|
func Userid(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// Serverid applies equality check predicate on the "serverid" field. It's identical to ServeridEQ.
|
|
func Serverid(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// IsOwner applies equality check predicate on the "isOwner" field. It's identical to IsOwnerEQ.
|
|
func IsOwner(v bool) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldIsOwner), v))
|
|
})
|
|
}
|
|
|
|
// Permission applies equality check predicate on the "permission" field. It's identical to PermissionEQ.
|
|
func Permission(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// UseridEQ applies the EQ predicate on the "userid" field.
|
|
func UseridEQ(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// UseridNEQ applies the NEQ predicate on the "userid" field.
|
|
func UseridNEQ(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// UseridIn applies the In predicate on the "userid" field.
|
|
func UseridIn(vs ...string) predicate.Servers {
|
|
v := make([]interface{}, len(vs))
|
|
for i := range v {
|
|
v[i] = vs[i]
|
|
}
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
// if not arguments were provided, append the FALSE constants,
|
|
// since we can't apply "IN ()". This will make this predicate falsy.
|
|
if len(v) == 0 {
|
|
s.Where(sql.False())
|
|
return
|
|
}
|
|
s.Where(sql.In(s.C(FieldUserid), v...))
|
|
})
|
|
}
|
|
|
|
// UseridNotIn applies the NotIn predicate on the "userid" field.
|
|
func UseridNotIn(vs ...string) predicate.Servers {
|
|
v := make([]interface{}, len(vs))
|
|
for i := range v {
|
|
v[i] = vs[i]
|
|
}
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
// if not arguments were provided, append the FALSE constants,
|
|
// since we can't apply "IN ()". This will make this predicate falsy.
|
|
if len(v) == 0 {
|
|
s.Where(sql.False())
|
|
return
|
|
}
|
|
s.Where(sql.NotIn(s.C(FieldUserid), v...))
|
|
})
|
|
}
|
|
|
|
// UseridGT applies the GT predicate on the "userid" field.
|
|
func UseridGT(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// UseridGTE applies the GTE predicate on the "userid" field.
|
|
func UseridGTE(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// UseridLT applies the LT predicate on the "userid" field.
|
|
func UseridLT(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// UseridLTE applies the LTE predicate on the "userid" field.
|
|
func UseridLTE(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// UseridContains applies the Contains predicate on the "userid" field.
|
|
func UseridContains(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.Contains(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// UseridHasPrefix applies the HasPrefix predicate on the "userid" field.
|
|
func UseridHasPrefix(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.HasPrefix(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// UseridHasSuffix applies the HasSuffix predicate on the "userid" field.
|
|
func UseridHasSuffix(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.HasSuffix(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// UseridEqualFold applies the EqualFold predicate on the "userid" field.
|
|
func UseridEqualFold(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EqualFold(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// UseridContainsFold applies the ContainsFold predicate on the "userid" field.
|
|
func UseridContainsFold(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.ContainsFold(s.C(FieldUserid), v))
|
|
})
|
|
}
|
|
|
|
// ServeridEQ applies the EQ predicate on the "serverid" field.
|
|
func ServeridEQ(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// ServeridNEQ applies the NEQ predicate on the "serverid" field.
|
|
func ServeridNEQ(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// ServeridIn applies the In predicate on the "serverid" field.
|
|
func ServeridIn(vs ...string) predicate.Servers {
|
|
v := make([]interface{}, len(vs))
|
|
for i := range v {
|
|
v[i] = vs[i]
|
|
}
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
// if not arguments were provided, append the FALSE constants,
|
|
// since we can't apply "IN ()". This will make this predicate falsy.
|
|
if len(v) == 0 {
|
|
s.Where(sql.False())
|
|
return
|
|
}
|
|
s.Where(sql.In(s.C(FieldServerid), v...))
|
|
})
|
|
}
|
|
|
|
// ServeridNotIn applies the NotIn predicate on the "serverid" field.
|
|
func ServeridNotIn(vs ...string) predicate.Servers {
|
|
v := make([]interface{}, len(vs))
|
|
for i := range v {
|
|
v[i] = vs[i]
|
|
}
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
// if not arguments were provided, append the FALSE constants,
|
|
// since we can't apply "IN ()". This will make this predicate falsy.
|
|
if len(v) == 0 {
|
|
s.Where(sql.False())
|
|
return
|
|
}
|
|
s.Where(sql.NotIn(s.C(FieldServerid), v...))
|
|
})
|
|
}
|
|
|
|
// ServeridGT applies the GT predicate on the "serverid" field.
|
|
func ServeridGT(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// ServeridGTE applies the GTE predicate on the "serverid" field.
|
|
func ServeridGTE(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// ServeridLT applies the LT predicate on the "serverid" field.
|
|
func ServeridLT(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// ServeridLTE applies the LTE predicate on the "serverid" field.
|
|
func ServeridLTE(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// ServeridContains applies the Contains predicate on the "serverid" field.
|
|
func ServeridContains(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.Contains(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// ServeridHasPrefix applies the HasPrefix predicate on the "serverid" field.
|
|
func ServeridHasPrefix(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.HasPrefix(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// ServeridHasSuffix applies the HasSuffix predicate on the "serverid" field.
|
|
func ServeridHasSuffix(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.HasSuffix(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// ServeridEqualFold applies the EqualFold predicate on the "serverid" field.
|
|
func ServeridEqualFold(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EqualFold(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// ServeridContainsFold applies the ContainsFold predicate on the "serverid" field.
|
|
func ServeridContainsFold(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.ContainsFold(s.C(FieldServerid), v))
|
|
})
|
|
}
|
|
|
|
// IsOwnerEQ applies the EQ predicate on the "isOwner" field.
|
|
func IsOwnerEQ(v bool) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldIsOwner), v))
|
|
})
|
|
}
|
|
|
|
// IsOwnerNEQ applies the NEQ predicate on the "isOwner" field.
|
|
func IsOwnerNEQ(v bool) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldIsOwner), v))
|
|
})
|
|
}
|
|
|
|
// PermissionEQ applies the EQ predicate on the "permission" field.
|
|
func PermissionEQ(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// PermissionNEQ applies the NEQ predicate on the "permission" field.
|
|
func PermissionNEQ(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// PermissionIn applies the In predicate on the "permission" field.
|
|
func PermissionIn(vs ...string) predicate.Servers {
|
|
v := make([]interface{}, len(vs))
|
|
for i := range v {
|
|
v[i] = vs[i]
|
|
}
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
// if not arguments were provided, append the FALSE constants,
|
|
// since we can't apply "IN ()". This will make this predicate falsy.
|
|
if len(v) == 0 {
|
|
s.Where(sql.False())
|
|
return
|
|
}
|
|
s.Where(sql.In(s.C(FieldPermission), v...))
|
|
})
|
|
}
|
|
|
|
// PermissionNotIn applies the NotIn predicate on the "permission" field.
|
|
func PermissionNotIn(vs ...string) predicate.Servers {
|
|
v := make([]interface{}, len(vs))
|
|
for i := range v {
|
|
v[i] = vs[i]
|
|
}
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
// if not arguments were provided, append the FALSE constants,
|
|
// since we can't apply "IN ()". This will make this predicate falsy.
|
|
if len(v) == 0 {
|
|
s.Where(sql.False())
|
|
return
|
|
}
|
|
s.Where(sql.NotIn(s.C(FieldPermission), v...))
|
|
})
|
|
}
|
|
|
|
// PermissionGT applies the GT predicate on the "permission" field.
|
|
func PermissionGT(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// PermissionGTE applies the GTE predicate on the "permission" field.
|
|
func PermissionGTE(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// PermissionLT applies the LT predicate on the "permission" field.
|
|
func PermissionLT(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// PermissionLTE applies the LTE predicate on the "permission" field.
|
|
func PermissionLTE(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// PermissionContains applies the Contains predicate on the "permission" field.
|
|
func PermissionContains(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.Contains(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// PermissionHasPrefix applies the HasPrefix predicate on the "permission" field.
|
|
func PermissionHasPrefix(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.HasPrefix(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// PermissionHasSuffix applies the HasSuffix predicate on the "permission" field.
|
|
func PermissionHasSuffix(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.HasSuffix(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// PermissionEqualFold applies the EqualFold predicate on the "permission" field.
|
|
func PermissionEqualFold(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.EqualFold(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// PermissionContainsFold applies the ContainsFold predicate on the "permission" field.
|
|
func PermissionContainsFold(v string) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s.Where(sql.ContainsFold(s.C(FieldPermission), v))
|
|
})
|
|
}
|
|
|
|
// And groups predicates with the AND operator between them.
|
|
func And(predicates ...predicate.Servers) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
s1 := s.Clone().SetP(nil)
|
|
for _, p := range predicates {
|
|
p(s1)
|
|
}
|
|
s.Where(s1.P())
|
|
})
|
|
}
|
|
|
|
// Or groups predicates with the OR operator between them.
|
|
func Or(predicates ...predicate.Servers) predicate.Servers {
|
|
return predicate.Servers(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())
|
|
})
|
|
}
|
|
|
|
// Not applies the not operator on the given predicate.
|
|
func Not(p predicate.Servers) predicate.Servers {
|
|
return predicate.Servers(func(s *sql.Selector) {
|
|
p(s.Not())
|
|
})
|
|
}
|