initial commit
This commit is contained in:
57
ent/user/user.go
Normal file
57
ent/user/user.go
Normal file
@ -0,0 +1,57 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package user
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the user type in the database.
|
||||
Label = "user"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldServerid holds the string denoting the serverid field in the database.
|
||||
FieldServerid = "serverid"
|
||||
// FieldUserid holds the string denoting the userid field in the database.
|
||||
FieldUserid = "userid"
|
||||
// FieldUsername holds the string denoting the username field in the database.
|
||||
FieldUsername = "username"
|
||||
// FieldXp holds the string denoting the xp field in the database.
|
||||
FieldXp = "xp"
|
||||
// FieldLevel holds the string denoting the level field in the database.
|
||||
FieldLevel = "level"
|
||||
// FieldMsgs holds the string denoting the msgs field in the database.
|
||||
FieldMsgs = "msgs"
|
||||
// FieldCreated holds the string denoting the created field in the database.
|
||||
FieldCreated = "created"
|
||||
// Table holds the table name of the user in the database.
|
||||
Table = "users"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for user fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldServerid,
|
||||
FieldUserid,
|
||||
FieldUsername,
|
||||
FieldXp,
|
||||
FieldLevel,
|
||||
FieldMsgs,
|
||||
FieldCreated,
|
||||
}
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
func ValidColumn(column string) bool {
|
||||
for i := range Columns {
|
||||
if column == Columns[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// DefaultXp holds the default value on creation for the "xp" field.
|
||||
DefaultXp int
|
||||
// DefaultLevel holds the default value on creation for the "level" field.
|
||||
DefaultLevel int
|
||||
// DefaultMsgs holds the default value on creation for the "msgs" field.
|
||||
DefaultMsgs int
|
||||
)
|
799
ent/user/where.go
Normal file
799
ent/user/where.go
Normal file
@ -0,0 +1,799 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"github.com/FrankenBotDev/FrankenAPI/ent/predicate"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// Serverid applies equality check predicate on the "serverid" field. It's identical to ServeridEQ.
|
||||
func Serverid(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldServerid), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Userid applies equality check predicate on the "userid" field. It's identical to UseridEQ.
|
||||
func Userid(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldUserid), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Username applies equality check predicate on the "username" field. It's identical to UsernameEQ.
|
||||
func Username(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Xp applies equality check predicate on the "xp" field. It's identical to XpEQ.
|
||||
func Xp(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldXp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Level applies equality check predicate on the "level" field. It's identical to LevelEQ.
|
||||
func Level(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldLevel), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Msgs applies equality check predicate on the "msgs" field. It's identical to MsgsEQ.
|
||||
func Msgs(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldMsgs), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Created applies equality check predicate on the "created" field. It's identical to CreatedEQ.
|
||||
func Created(v time.Time) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldCreated), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ServeridEQ applies the EQ predicate on the "serverid" field.
|
||||
func ServeridEQ(v string) predicate.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.ContainsFold(s.C(FieldServerid), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UseridEQ applies the EQ predicate on the "userid" field.
|
||||
func UseridEQ(v string) predicate.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(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.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.ContainsFold(s.C(FieldUserid), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameEQ applies the EQ predicate on the "username" field.
|
||||
func UsernameEQ(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameNEQ applies the NEQ predicate on the "username" field.
|
||||
func UsernameNEQ(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameIn applies the In predicate on the "username" field.
|
||||
func UsernameIn(vs ...string) predicate.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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(FieldUsername), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameNotIn applies the NotIn predicate on the "username" field.
|
||||
func UsernameNotIn(vs ...string) predicate.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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(FieldUsername), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameGT applies the GT predicate on the "username" field.
|
||||
func UsernameGT(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameGTE applies the GTE predicate on the "username" field.
|
||||
func UsernameGTE(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameLT applies the LT predicate on the "username" field.
|
||||
func UsernameLT(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameLTE applies the LTE predicate on the "username" field.
|
||||
func UsernameLTE(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameContains applies the Contains predicate on the "username" field.
|
||||
func UsernameContains(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.Contains(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameHasPrefix applies the HasPrefix predicate on the "username" field.
|
||||
func UsernameHasPrefix(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.HasPrefix(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameHasSuffix applies the HasSuffix predicate on the "username" field.
|
||||
func UsernameHasSuffix(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.HasSuffix(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameEqualFold applies the EqualFold predicate on the "username" field.
|
||||
func UsernameEqualFold(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EqualFold(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// UsernameContainsFold applies the ContainsFold predicate on the "username" field.
|
||||
func UsernameContainsFold(v string) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.ContainsFold(s.C(FieldUsername), v))
|
||||
})
|
||||
}
|
||||
|
||||
// XpEQ applies the EQ predicate on the "xp" field.
|
||||
func XpEQ(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldXp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// XpNEQ applies the NEQ predicate on the "xp" field.
|
||||
func XpNEQ(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldXp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// XpIn applies the In predicate on the "xp" field.
|
||||
func XpIn(vs ...int) predicate.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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(FieldXp), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// XpNotIn applies the NotIn predicate on the "xp" field.
|
||||
func XpNotIn(vs ...int) predicate.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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(FieldXp), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// XpGT applies the GT predicate on the "xp" field.
|
||||
func XpGT(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldXp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// XpGTE applies the GTE predicate on the "xp" field.
|
||||
func XpGTE(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldXp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// XpLT applies the LT predicate on the "xp" field.
|
||||
func XpLT(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldXp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// XpLTE applies the LTE predicate on the "xp" field.
|
||||
func XpLTE(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldXp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// LevelEQ applies the EQ predicate on the "level" field.
|
||||
func LevelEQ(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldLevel), v))
|
||||
})
|
||||
}
|
||||
|
||||
// LevelNEQ applies the NEQ predicate on the "level" field.
|
||||
func LevelNEQ(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldLevel), v))
|
||||
})
|
||||
}
|
||||
|
||||
// LevelIn applies the In predicate on the "level" field.
|
||||
func LevelIn(vs ...int) predicate.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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(FieldLevel), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// LevelNotIn applies the NotIn predicate on the "level" field.
|
||||
func LevelNotIn(vs ...int) predicate.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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(FieldLevel), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// LevelGT applies the GT predicate on the "level" field.
|
||||
func LevelGT(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldLevel), v))
|
||||
})
|
||||
}
|
||||
|
||||
// LevelGTE applies the GTE predicate on the "level" field.
|
||||
func LevelGTE(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldLevel), v))
|
||||
})
|
||||
}
|
||||
|
||||
// LevelLT applies the LT predicate on the "level" field.
|
||||
func LevelLT(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldLevel), v))
|
||||
})
|
||||
}
|
||||
|
||||
// LevelLTE applies the LTE predicate on the "level" field.
|
||||
func LevelLTE(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldLevel), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MsgsEQ applies the EQ predicate on the "msgs" field.
|
||||
func MsgsEQ(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldMsgs), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MsgsNEQ applies the NEQ predicate on the "msgs" field.
|
||||
func MsgsNEQ(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldMsgs), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MsgsIn applies the In predicate on the "msgs" field.
|
||||
func MsgsIn(vs ...int) predicate.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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(FieldMsgs), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// MsgsNotIn applies the NotIn predicate on the "msgs" field.
|
||||
func MsgsNotIn(vs ...int) predicate.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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(FieldMsgs), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// MsgsGT applies the GT predicate on the "msgs" field.
|
||||
func MsgsGT(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldMsgs), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MsgsGTE applies the GTE predicate on the "msgs" field.
|
||||
func MsgsGTE(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldMsgs), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MsgsLT applies the LT predicate on the "msgs" field.
|
||||
func MsgsLT(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldMsgs), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MsgsLTE applies the LTE predicate on the "msgs" field.
|
||||
func MsgsLTE(v int) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldMsgs), v))
|
||||
})
|
||||
}
|
||||
|
||||
// CreatedEQ applies the EQ predicate on the "created" field.
|
||||
func CreatedEQ(v time.Time) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldCreated), v))
|
||||
})
|
||||
}
|
||||
|
||||
// CreatedNEQ applies the NEQ predicate on the "created" field.
|
||||
func CreatedNEQ(v time.Time) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldCreated), v))
|
||||
})
|
||||
}
|
||||
|
||||
// CreatedIn applies the In predicate on the "created" field.
|
||||
func CreatedIn(vs ...time.Time) predicate.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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(FieldCreated), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// CreatedNotIn applies the NotIn predicate on the "created" field.
|
||||
func CreatedNotIn(vs ...time.Time) predicate.User {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.User(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(FieldCreated), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// CreatedGT applies the GT predicate on the "created" field.
|
||||
func CreatedGT(v time.Time) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldCreated), v))
|
||||
})
|
||||
}
|
||||
|
||||
// CreatedGTE applies the GTE predicate on the "created" field.
|
||||
func CreatedGTE(v time.Time) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldCreated), v))
|
||||
})
|
||||
}
|
||||
|
||||
// CreatedLT applies the LT predicate on the "created" field.
|
||||
func CreatedLT(v time.Time) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldCreated), v))
|
||||
})
|
||||
}
|
||||
|
||||
// CreatedLTE applies the LTE predicate on the "created" field.
|
||||
func CreatedLTE(v time.Time) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldCreated), v))
|
||||
})
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.User) predicate.User {
|
||||
return predicate.User(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.User) predicate.User {
|
||||
return predicate.User(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.User) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
p(s.Not())
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user