mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
1516 lines
43 KiB
Go
1516 lines
43 KiB
Go
// Copyright 2019-present Facebook Inc. All rights reserved.
|
|
// This source code is licensed under the Apache 2.0 license found
|
|
// in the LICENSE file in the root directory of this source tree.
|
|
|
|
// Code generated by entc, DO NOT EDIT.
|
|
|
|
package user
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
"entgo.io/ent/entc/integration/migrate/entv2/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) {
|
|
// if not arguments were provided, append the FALSE constants,
|
|
// since we can't apply "IN ()". This will make this predicate falsy.
|
|
if len(ids) == 0 {
|
|
s.Where(sql.False())
|
|
return
|
|
}
|
|
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) {
|
|
// if not arguments were provided, append the FALSE constants,
|
|
// since we can't apply "IN ()". This will make this predicate falsy.
|
|
if len(ids) == 0 {
|
|
s.Where(sql.False())
|
|
return
|
|
}
|
|
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))
|
|
})
|
|
}
|
|
|
|
// MixedString applies equality check predicate on the "mixed_string" field. It's identical to MixedStringEQ.
|
|
func MixedString(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// Age applies equality check predicate on the "age" field. It's identical to AgeEQ.
|
|
func Age(v int) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldAge), v))
|
|
})
|
|
}
|
|
|
|
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
|
|
func Name(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// Nickname applies equality check predicate on the "nickname" field. It's identical to NicknameEQ.
|
|
func Nickname(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// Phone applies equality check predicate on the "phone" field. It's identical to PhoneEQ.
|
|
func Phone(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// Buffer applies equality check predicate on the "buffer" field. It's identical to BufferEQ.
|
|
func Buffer(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldBuffer), v))
|
|
})
|
|
}
|
|
|
|
// Title applies equality check predicate on the "title" field. It's identical to TitleEQ.
|
|
func Title(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// NewName applies equality check predicate on the "new_name" field. It's identical to NewNameEQ.
|
|
func NewName(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// Blob applies equality check predicate on the "blob" field. It's identical to BlobEQ.
|
|
func Blob(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldBlob), v))
|
|
})
|
|
}
|
|
|
|
// Workplace applies equality check predicate on the "workplace" field. It's identical to WorkplaceEQ.
|
|
func Workplace(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// MixedStringEQ applies the EQ predicate on the "mixed_string" field.
|
|
func MixedStringEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// MixedStringNEQ applies the NEQ predicate on the "mixed_string" field.
|
|
func MixedStringNEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// MixedStringIn applies the In predicate on the "mixed_string" field.
|
|
func MixedStringIn(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(FieldMixedString), v...))
|
|
})
|
|
}
|
|
|
|
// MixedStringNotIn applies the NotIn predicate on the "mixed_string" field.
|
|
func MixedStringNotIn(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(FieldMixedString), v...))
|
|
})
|
|
}
|
|
|
|
// MixedStringGT applies the GT predicate on the "mixed_string" field.
|
|
func MixedStringGT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// MixedStringGTE applies the GTE predicate on the "mixed_string" field.
|
|
func MixedStringGTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// MixedStringLT applies the LT predicate on the "mixed_string" field.
|
|
func MixedStringLT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// MixedStringLTE applies the LTE predicate on the "mixed_string" field.
|
|
func MixedStringLTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// MixedStringContains applies the Contains predicate on the "mixed_string" field.
|
|
func MixedStringContains(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.Contains(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// MixedStringHasPrefix applies the HasPrefix predicate on the "mixed_string" field.
|
|
func MixedStringHasPrefix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasPrefix(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// MixedStringHasSuffix applies the HasSuffix predicate on the "mixed_string" field.
|
|
func MixedStringHasSuffix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasSuffix(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// MixedStringEqualFold applies the EqualFold predicate on the "mixed_string" field.
|
|
func MixedStringEqualFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EqualFold(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// MixedStringContainsFold applies the ContainsFold predicate on the "mixed_string" field.
|
|
func MixedStringContainsFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.ContainsFold(s.C(FieldMixedString), v))
|
|
})
|
|
}
|
|
|
|
// MixedEnumEQ applies the EQ predicate on the "mixed_enum" field.
|
|
func MixedEnumEQ(v MixedEnum) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldMixedEnum), v))
|
|
})
|
|
}
|
|
|
|
// MixedEnumNEQ applies the NEQ predicate on the "mixed_enum" field.
|
|
func MixedEnumNEQ(v MixedEnum) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldMixedEnum), v))
|
|
})
|
|
}
|
|
|
|
// MixedEnumIn applies the In predicate on the "mixed_enum" field.
|
|
func MixedEnumIn(vs ...MixedEnum) 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(FieldMixedEnum), v...))
|
|
})
|
|
}
|
|
|
|
// MixedEnumNotIn applies the NotIn predicate on the "mixed_enum" field.
|
|
func MixedEnumNotIn(vs ...MixedEnum) 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(FieldMixedEnum), v...))
|
|
})
|
|
}
|
|
|
|
// AgeEQ applies the EQ predicate on the "age" field.
|
|
func AgeEQ(v int) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldAge), v))
|
|
})
|
|
}
|
|
|
|
// AgeNEQ applies the NEQ predicate on the "age" field.
|
|
func AgeNEQ(v int) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldAge), v))
|
|
})
|
|
}
|
|
|
|
// AgeIn applies the In predicate on the "age" field.
|
|
func AgeIn(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(FieldAge), v...))
|
|
})
|
|
}
|
|
|
|
// AgeNotIn applies the NotIn predicate on the "age" field.
|
|
func AgeNotIn(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(FieldAge), v...))
|
|
})
|
|
}
|
|
|
|
// AgeGT applies the GT predicate on the "age" field.
|
|
func AgeGT(v int) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldAge), v))
|
|
})
|
|
}
|
|
|
|
// AgeGTE applies the GTE predicate on the "age" field.
|
|
func AgeGTE(v int) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldAge), v))
|
|
})
|
|
}
|
|
|
|
// AgeLT applies the LT predicate on the "age" field.
|
|
func AgeLT(v int) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldAge), v))
|
|
})
|
|
}
|
|
|
|
// AgeLTE applies the LTE predicate on the "age" field.
|
|
func AgeLTE(v int) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldAge), v))
|
|
})
|
|
}
|
|
|
|
// NameEQ applies the EQ predicate on the "name" field.
|
|
func NameEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// NameNEQ applies the NEQ predicate on the "name" field.
|
|
func NameNEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// NameIn applies the In predicate on the "name" field.
|
|
func NameIn(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(FieldName), v...))
|
|
})
|
|
}
|
|
|
|
// NameNotIn applies the NotIn predicate on the "name" field.
|
|
func NameNotIn(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(FieldName), v...))
|
|
})
|
|
}
|
|
|
|
// NameGT applies the GT predicate on the "name" field.
|
|
func NameGT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// NameGTE applies the GTE predicate on the "name" field.
|
|
func NameGTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// NameLT applies the LT predicate on the "name" field.
|
|
func NameLT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// NameLTE applies the LTE predicate on the "name" field.
|
|
func NameLTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// NameContains applies the Contains predicate on the "name" field.
|
|
func NameContains(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.Contains(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
|
|
func NameHasPrefix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasPrefix(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
|
|
func NameHasSuffix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasSuffix(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// NameEqualFold applies the EqualFold predicate on the "name" field.
|
|
func NameEqualFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EqualFold(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// NameContainsFold applies the ContainsFold predicate on the "name" field.
|
|
func NameContainsFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.ContainsFold(s.C(FieldName), v))
|
|
})
|
|
}
|
|
|
|
// NicknameEQ applies the EQ predicate on the "nickname" field.
|
|
func NicknameEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// NicknameNEQ applies the NEQ predicate on the "nickname" field.
|
|
func NicknameNEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// NicknameIn applies the In predicate on the "nickname" field.
|
|
func NicknameIn(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(FieldNickname), v...))
|
|
})
|
|
}
|
|
|
|
// NicknameNotIn applies the NotIn predicate on the "nickname" field.
|
|
func NicknameNotIn(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(FieldNickname), v...))
|
|
})
|
|
}
|
|
|
|
// NicknameGT applies the GT predicate on the "nickname" field.
|
|
func NicknameGT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// NicknameGTE applies the GTE predicate on the "nickname" field.
|
|
func NicknameGTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// NicknameLT applies the LT predicate on the "nickname" field.
|
|
func NicknameLT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// NicknameLTE applies the LTE predicate on the "nickname" field.
|
|
func NicknameLTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// NicknameContains applies the Contains predicate on the "nickname" field.
|
|
func NicknameContains(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.Contains(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// NicknameHasPrefix applies the HasPrefix predicate on the "nickname" field.
|
|
func NicknameHasPrefix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasPrefix(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// NicknameHasSuffix applies the HasSuffix predicate on the "nickname" field.
|
|
func NicknameHasSuffix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasSuffix(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// NicknameEqualFold applies the EqualFold predicate on the "nickname" field.
|
|
func NicknameEqualFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EqualFold(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// NicknameContainsFold applies the ContainsFold predicate on the "nickname" field.
|
|
func NicknameContainsFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.ContainsFold(s.C(FieldNickname), v))
|
|
})
|
|
}
|
|
|
|
// PhoneEQ applies the EQ predicate on the "phone" field.
|
|
func PhoneEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// PhoneNEQ applies the NEQ predicate on the "phone" field.
|
|
func PhoneNEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// PhoneIn applies the In predicate on the "phone" field.
|
|
func PhoneIn(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(FieldPhone), v...))
|
|
})
|
|
}
|
|
|
|
// PhoneNotIn applies the NotIn predicate on the "phone" field.
|
|
func PhoneNotIn(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(FieldPhone), v...))
|
|
})
|
|
}
|
|
|
|
// PhoneGT applies the GT predicate on the "phone" field.
|
|
func PhoneGT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// PhoneGTE applies the GTE predicate on the "phone" field.
|
|
func PhoneGTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// PhoneLT applies the LT predicate on the "phone" field.
|
|
func PhoneLT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// PhoneLTE applies the LTE predicate on the "phone" field.
|
|
func PhoneLTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// PhoneContains applies the Contains predicate on the "phone" field.
|
|
func PhoneContains(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.Contains(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// PhoneHasPrefix applies the HasPrefix predicate on the "phone" field.
|
|
func PhoneHasPrefix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasPrefix(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// PhoneHasSuffix applies the HasSuffix predicate on the "phone" field.
|
|
func PhoneHasSuffix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasSuffix(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// PhoneEqualFold applies the EqualFold predicate on the "phone" field.
|
|
func PhoneEqualFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EqualFold(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// PhoneContainsFold applies the ContainsFold predicate on the "phone" field.
|
|
func PhoneContainsFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.ContainsFold(s.C(FieldPhone), v))
|
|
})
|
|
}
|
|
|
|
// BufferEQ applies the EQ predicate on the "buffer" field.
|
|
func BufferEQ(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldBuffer), v))
|
|
})
|
|
}
|
|
|
|
// BufferNEQ applies the NEQ predicate on the "buffer" field.
|
|
func BufferNEQ(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldBuffer), v))
|
|
})
|
|
}
|
|
|
|
// BufferIn applies the In predicate on the "buffer" field.
|
|
func BufferIn(vs ...[]byte) 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(FieldBuffer), v...))
|
|
})
|
|
}
|
|
|
|
// BufferNotIn applies the NotIn predicate on the "buffer" field.
|
|
func BufferNotIn(vs ...[]byte) 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(FieldBuffer), v...))
|
|
})
|
|
}
|
|
|
|
// BufferGT applies the GT predicate on the "buffer" field.
|
|
func BufferGT(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldBuffer), v))
|
|
})
|
|
}
|
|
|
|
// BufferGTE applies the GTE predicate on the "buffer" field.
|
|
func BufferGTE(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldBuffer), v))
|
|
})
|
|
}
|
|
|
|
// BufferLT applies the LT predicate on the "buffer" field.
|
|
func BufferLT(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldBuffer), v))
|
|
})
|
|
}
|
|
|
|
// BufferLTE applies the LTE predicate on the "buffer" field.
|
|
func BufferLTE(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldBuffer), v))
|
|
})
|
|
}
|
|
|
|
// BufferIsNil applies the IsNil predicate on the "buffer" field.
|
|
func BufferIsNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.IsNull(s.C(FieldBuffer)))
|
|
})
|
|
}
|
|
|
|
// BufferNotNil applies the NotNil predicate on the "buffer" field.
|
|
func BufferNotNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NotNull(s.C(FieldBuffer)))
|
|
})
|
|
}
|
|
|
|
// TitleEQ applies the EQ predicate on the "title" field.
|
|
func TitleEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// TitleNEQ applies the NEQ predicate on the "title" field.
|
|
func TitleNEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// TitleIn applies the In predicate on the "title" field.
|
|
func TitleIn(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(FieldTitle), v...))
|
|
})
|
|
}
|
|
|
|
// TitleNotIn applies the NotIn predicate on the "title" field.
|
|
func TitleNotIn(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(FieldTitle), v...))
|
|
})
|
|
}
|
|
|
|
// TitleGT applies the GT predicate on the "title" field.
|
|
func TitleGT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// TitleGTE applies the GTE predicate on the "title" field.
|
|
func TitleGTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// TitleLT applies the LT predicate on the "title" field.
|
|
func TitleLT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// TitleLTE applies the LTE predicate on the "title" field.
|
|
func TitleLTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// TitleContains applies the Contains predicate on the "title" field.
|
|
func TitleContains(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.Contains(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// TitleHasPrefix applies the HasPrefix predicate on the "title" field.
|
|
func TitleHasPrefix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasPrefix(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// TitleHasSuffix applies the HasSuffix predicate on the "title" field.
|
|
func TitleHasSuffix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasSuffix(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// TitleEqualFold applies the EqualFold predicate on the "title" field.
|
|
func TitleEqualFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EqualFold(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// TitleContainsFold applies the ContainsFold predicate on the "title" field.
|
|
func TitleContainsFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.ContainsFold(s.C(FieldTitle), v))
|
|
})
|
|
}
|
|
|
|
// NewNameEQ applies the EQ predicate on the "new_name" field.
|
|
func NewNameEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// NewNameNEQ applies the NEQ predicate on the "new_name" field.
|
|
func NewNameNEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// NewNameIn applies the In predicate on the "new_name" field.
|
|
func NewNameIn(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(FieldNewName), v...))
|
|
})
|
|
}
|
|
|
|
// NewNameNotIn applies the NotIn predicate on the "new_name" field.
|
|
func NewNameNotIn(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(FieldNewName), v...))
|
|
})
|
|
}
|
|
|
|
// NewNameGT applies the GT predicate on the "new_name" field.
|
|
func NewNameGT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// NewNameGTE applies the GTE predicate on the "new_name" field.
|
|
func NewNameGTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// NewNameLT applies the LT predicate on the "new_name" field.
|
|
func NewNameLT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// NewNameLTE applies the LTE predicate on the "new_name" field.
|
|
func NewNameLTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// NewNameContains applies the Contains predicate on the "new_name" field.
|
|
func NewNameContains(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.Contains(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// NewNameHasPrefix applies the HasPrefix predicate on the "new_name" field.
|
|
func NewNameHasPrefix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasPrefix(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// NewNameHasSuffix applies the HasSuffix predicate on the "new_name" field.
|
|
func NewNameHasSuffix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasSuffix(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// NewNameIsNil applies the IsNil predicate on the "new_name" field.
|
|
func NewNameIsNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.IsNull(s.C(FieldNewName)))
|
|
})
|
|
}
|
|
|
|
// NewNameNotNil applies the NotNil predicate on the "new_name" field.
|
|
func NewNameNotNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NotNull(s.C(FieldNewName)))
|
|
})
|
|
}
|
|
|
|
// NewNameEqualFold applies the EqualFold predicate on the "new_name" field.
|
|
func NewNameEqualFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EqualFold(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// NewNameContainsFold applies the ContainsFold predicate on the "new_name" field.
|
|
func NewNameContainsFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.ContainsFold(s.C(FieldNewName), v))
|
|
})
|
|
}
|
|
|
|
// BlobEQ applies the EQ predicate on the "blob" field.
|
|
func BlobEQ(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldBlob), v))
|
|
})
|
|
}
|
|
|
|
// BlobNEQ applies the NEQ predicate on the "blob" field.
|
|
func BlobNEQ(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldBlob), v))
|
|
})
|
|
}
|
|
|
|
// BlobIn applies the In predicate on the "blob" field.
|
|
func BlobIn(vs ...[]byte) 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(FieldBlob), v...))
|
|
})
|
|
}
|
|
|
|
// BlobNotIn applies the NotIn predicate on the "blob" field.
|
|
func BlobNotIn(vs ...[]byte) 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(FieldBlob), v...))
|
|
})
|
|
}
|
|
|
|
// BlobGT applies the GT predicate on the "blob" field.
|
|
func BlobGT(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldBlob), v))
|
|
})
|
|
}
|
|
|
|
// BlobGTE applies the GTE predicate on the "blob" field.
|
|
func BlobGTE(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldBlob), v))
|
|
})
|
|
}
|
|
|
|
// BlobLT applies the LT predicate on the "blob" field.
|
|
func BlobLT(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldBlob), v))
|
|
})
|
|
}
|
|
|
|
// BlobLTE applies the LTE predicate on the "blob" field.
|
|
func BlobLTE(v []byte) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldBlob), v))
|
|
})
|
|
}
|
|
|
|
// BlobIsNil applies the IsNil predicate on the "blob" field.
|
|
func BlobIsNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.IsNull(s.C(FieldBlob)))
|
|
})
|
|
}
|
|
|
|
// BlobNotNil applies the NotNil predicate on the "blob" field.
|
|
func BlobNotNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NotNull(s.C(FieldBlob)))
|
|
})
|
|
}
|
|
|
|
// StateEQ applies the EQ predicate on the "state" field.
|
|
func StateEQ(v State) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldState), v))
|
|
})
|
|
}
|
|
|
|
// StateNEQ applies the NEQ predicate on the "state" field.
|
|
func StateNEQ(v State) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldState), v))
|
|
})
|
|
}
|
|
|
|
// StateIn applies the In predicate on the "state" field.
|
|
func StateIn(vs ...State) 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(FieldState), v...))
|
|
})
|
|
}
|
|
|
|
// StateNotIn applies the NotIn predicate on the "state" field.
|
|
func StateNotIn(vs ...State) 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(FieldState), v...))
|
|
})
|
|
}
|
|
|
|
// StateIsNil applies the IsNil predicate on the "state" field.
|
|
func StateIsNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.IsNull(s.C(FieldState)))
|
|
})
|
|
}
|
|
|
|
// StateNotNil applies the NotNil predicate on the "state" field.
|
|
func StateNotNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NotNull(s.C(FieldState)))
|
|
})
|
|
}
|
|
|
|
// StatusEQ applies the EQ predicate on the "status" field.
|
|
func StatusEQ(v Status) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldStatus), v))
|
|
})
|
|
}
|
|
|
|
// StatusNEQ applies the NEQ predicate on the "status" field.
|
|
func StatusNEQ(v Status) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldStatus), v))
|
|
})
|
|
}
|
|
|
|
// StatusIn applies the In predicate on the "status" field.
|
|
func StatusIn(vs ...Status) 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(FieldStatus), v...))
|
|
})
|
|
}
|
|
|
|
// StatusNotIn applies the NotIn predicate on the "status" field.
|
|
func StatusNotIn(vs ...Status) 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(FieldStatus), v...))
|
|
})
|
|
}
|
|
|
|
// StatusIsNil applies the IsNil predicate on the "status" field.
|
|
func StatusIsNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.IsNull(s.C(FieldStatus)))
|
|
})
|
|
}
|
|
|
|
// StatusNotNil applies the NotNil predicate on the "status" field.
|
|
func StatusNotNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NotNull(s.C(FieldStatus)))
|
|
})
|
|
}
|
|
|
|
// WorkplaceEQ applies the EQ predicate on the "workplace" field.
|
|
func WorkplaceEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EQ(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// WorkplaceNEQ applies the NEQ predicate on the "workplace" field.
|
|
func WorkplaceNEQ(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NEQ(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// WorkplaceIn applies the In predicate on the "workplace" field.
|
|
func WorkplaceIn(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(FieldWorkplace), v...))
|
|
})
|
|
}
|
|
|
|
// WorkplaceNotIn applies the NotIn predicate on the "workplace" field.
|
|
func WorkplaceNotIn(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(FieldWorkplace), v...))
|
|
})
|
|
}
|
|
|
|
// WorkplaceGT applies the GT predicate on the "workplace" field.
|
|
func WorkplaceGT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GT(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// WorkplaceGTE applies the GTE predicate on the "workplace" field.
|
|
func WorkplaceGTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.GTE(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// WorkplaceLT applies the LT predicate on the "workplace" field.
|
|
func WorkplaceLT(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LT(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// WorkplaceLTE applies the LTE predicate on the "workplace" field.
|
|
func WorkplaceLTE(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.LTE(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// WorkplaceContains applies the Contains predicate on the "workplace" field.
|
|
func WorkplaceContains(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.Contains(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// WorkplaceHasPrefix applies the HasPrefix predicate on the "workplace" field.
|
|
func WorkplaceHasPrefix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasPrefix(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// WorkplaceHasSuffix applies the HasSuffix predicate on the "workplace" field.
|
|
func WorkplaceHasSuffix(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.HasSuffix(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// WorkplaceIsNil applies the IsNil predicate on the "workplace" field.
|
|
func WorkplaceIsNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.IsNull(s.C(FieldWorkplace)))
|
|
})
|
|
}
|
|
|
|
// WorkplaceNotNil applies the NotNil predicate on the "workplace" field.
|
|
func WorkplaceNotNil() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.NotNull(s.C(FieldWorkplace)))
|
|
})
|
|
}
|
|
|
|
// WorkplaceEqualFold applies the EqualFold predicate on the "workplace" field.
|
|
func WorkplaceEqualFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.EqualFold(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// WorkplaceContainsFold applies the ContainsFold predicate on the "workplace" field.
|
|
func WorkplaceContainsFold(v string) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
s.Where(sql.ContainsFold(s.C(FieldWorkplace), v))
|
|
})
|
|
}
|
|
|
|
// HasCar applies the HasEdge predicate on the "car" edge.
|
|
func HasCar() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
step := sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(CarTable, CarFieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, false, CarTable, CarColumn),
|
|
)
|
|
sqlgraph.HasNeighbors(s, step)
|
|
})
|
|
}
|
|
|
|
// HasCarWith applies the HasEdge predicate on the "car" edge with a given conditions (other predicates).
|
|
func HasCarWith(preds ...predicate.Car) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
step := sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(CarInverseTable, CarFieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, false, CarTable, CarColumn),
|
|
)
|
|
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
|
for _, p := range preds {
|
|
p(s)
|
|
}
|
|
})
|
|
})
|
|
}
|
|
|
|
// HasPets applies the HasEdge predicate on the "pets" edge.
|
|
func HasPets() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
step := sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(PetsTable, PetFieldID),
|
|
sqlgraph.Edge(sqlgraph.O2O, false, PetsTable, PetsColumn),
|
|
)
|
|
sqlgraph.HasNeighbors(s, step)
|
|
})
|
|
}
|
|
|
|
// HasPetsWith applies the HasEdge predicate on the "pets" edge with a given conditions (other predicates).
|
|
func HasPetsWith(preds ...predicate.Pet) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
step := sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(PetsInverseTable, PetFieldID),
|
|
sqlgraph.Edge(sqlgraph.O2O, false, PetsTable, PetsColumn),
|
|
)
|
|
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
|
for _, p := range preds {
|
|
p(s)
|
|
}
|
|
})
|
|
})
|
|
}
|
|
|
|
// HasFriends applies the HasEdge predicate on the "friends" edge.
|
|
func HasFriends() predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
step := sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(FriendsTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2M, false, FriendsTable, FriendsPrimaryKey...),
|
|
)
|
|
sqlgraph.HasNeighbors(s, step)
|
|
})
|
|
}
|
|
|
|
// HasFriendsWith applies the HasEdge predicate on the "friends" edge with a given conditions (other predicates).
|
|
func HasFriendsWith(preds ...predicate.User) predicate.User {
|
|
return predicate.User(func(s *sql.Selector) {
|
|
step := sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(Table, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2M, false, FriendsTable, FriendsPrimaryKey...),
|
|
)
|
|
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
|
for _, p := range preds {
|
|
p(s)
|
|
}
|
|
})
|
|
})
|
|
}
|
|
|
|
// 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())
|
|
})
|
|
}
|