dep upgrade, regenerate
This commit is contained in:
@ -1,9 +1,12 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package account
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -78,3 +81,78 @@ var (
|
||||
// UpdateDefaultModified holds the default value on update for the "modified" field.
|
||||
UpdateDefaultModified func() time.Time
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the Account queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
// ByID orders the results by the id field.
|
||||
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreated orders the results by the created field.
|
||||
func ByCreated(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreated, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByModified orders the results by the modified field.
|
||||
func ByModified(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldModified, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUsername orders the results by the username field.
|
||||
func ByUsername(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUsername, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySuper orders the results by the super field.
|
||||
func BySuper(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSuper, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByActive orders the results by the active field.
|
||||
func ByActive(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldActive, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByDomainsCount orders the results by domains count.
|
||||
func ByDomainsCount(opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborsCount(s, newDomainsStep(), opts...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByDomains orders the results by domains terms.
|
||||
func ByDomains(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newDomainsStep(), append([]sql.OrderTerm{term}, terms...)...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByLogsCount orders the results by logs count.
|
||||
func ByLogsCount(opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborsCount(s, newLogsStep(), opts...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByLogs orders the results by logs terms.
|
||||
func ByLogs(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newLogsStep(), append([]sql.OrderTerm{term}, terms...)...)
|
||||
}
|
||||
}
|
||||
func newDomainsStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(DomainsInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, false, DomainsTable, DomainsPrimaryKey...),
|
||||
)
|
||||
}
|
||||
func newLogsStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(LogsInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, LogsTable, LogsColumn),
|
||||
)
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package account
|
||||
|
||||
@ -12,508 +12,292 @@ import (
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int64) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldID), id))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int64) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldID), id))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int64) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldID), id))
|
||||
})
|
||||
return predicate.Account(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int64) predicate.Account {
|
||||
return predicate.Account(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...))
|
||||
})
|
||||
return predicate.Account(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int64) predicate.Account {
|
||||
return predicate.Account(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...))
|
||||
})
|
||||
return predicate.Account(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int64) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldID), id))
|
||||
})
|
||||
return predicate.Account(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int64) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldID), id))
|
||||
})
|
||||
return predicate.Account(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int64) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldID), id))
|
||||
})
|
||||
return predicate.Account(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int64) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldID), id))
|
||||
})
|
||||
return predicate.Account(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// Created applies equality check predicate on the "created" field. It's identical to CreatedEQ.
|
||||
func Created(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldCreated), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldCreated, v))
|
||||
}
|
||||
|
||||
// Modified applies equality check predicate on the "modified" field. It's identical to ModifiedEQ.
|
||||
func Modified(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldModified), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldModified, v))
|
||||
}
|
||||
|
||||
// Username applies equality check predicate on the "username" field. It's identical to UsernameEQ.
|
||||
func Username(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldUsername, v))
|
||||
}
|
||||
|
||||
// Password applies equality check predicate on the "password" field. It's identical to PasswordEQ.
|
||||
func Password(v []byte) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldPassword), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldPassword, v))
|
||||
}
|
||||
|
||||
// Super applies equality check predicate on the "super" field. It's identical to SuperEQ.
|
||||
func Super(v bool) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldSuper), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldSuper, v))
|
||||
}
|
||||
|
||||
// Active applies equality check predicate on the "active" field. It's identical to ActiveEQ.
|
||||
func Active(v bool) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldActive), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldActive, v))
|
||||
}
|
||||
|
||||
// CreatedEQ applies the EQ predicate on the "created" field.
|
||||
func CreatedEQ(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldCreated), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldCreated, v))
|
||||
}
|
||||
|
||||
// CreatedNEQ applies the NEQ predicate on the "created" field.
|
||||
func CreatedNEQ(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldCreated), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldNEQ(FieldCreated, v))
|
||||
}
|
||||
|
||||
// CreatedIn applies the In predicate on the "created" field.
|
||||
func CreatedIn(vs ...time.Time) predicate.Account {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Account(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...))
|
||||
})
|
||||
return predicate.Account(sql.FieldIn(FieldCreated, vs...))
|
||||
}
|
||||
|
||||
// CreatedNotIn applies the NotIn predicate on the "created" field.
|
||||
func CreatedNotIn(vs ...time.Time) predicate.Account {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Account(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...))
|
||||
})
|
||||
return predicate.Account(sql.FieldNotIn(FieldCreated, vs...))
|
||||
}
|
||||
|
||||
// CreatedGT applies the GT predicate on the "created" field.
|
||||
func CreatedGT(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldCreated), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldGT(FieldCreated, v))
|
||||
}
|
||||
|
||||
// CreatedGTE applies the GTE predicate on the "created" field.
|
||||
func CreatedGTE(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldCreated), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldGTE(FieldCreated, v))
|
||||
}
|
||||
|
||||
// CreatedLT applies the LT predicate on the "created" field.
|
||||
func CreatedLT(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldCreated), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldLT(FieldCreated, v))
|
||||
}
|
||||
|
||||
// CreatedLTE applies the LTE predicate on the "created" field.
|
||||
func CreatedLTE(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldCreated), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldLTE(FieldCreated, v))
|
||||
}
|
||||
|
||||
// ModifiedEQ applies the EQ predicate on the "modified" field.
|
||||
func ModifiedEQ(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldModified), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldModified, v))
|
||||
}
|
||||
|
||||
// ModifiedNEQ applies the NEQ predicate on the "modified" field.
|
||||
func ModifiedNEQ(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldModified), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldNEQ(FieldModified, v))
|
||||
}
|
||||
|
||||
// ModifiedIn applies the In predicate on the "modified" field.
|
||||
func ModifiedIn(vs ...time.Time) predicate.Account {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Account(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(FieldModified), v...))
|
||||
})
|
||||
return predicate.Account(sql.FieldIn(FieldModified, vs...))
|
||||
}
|
||||
|
||||
// ModifiedNotIn applies the NotIn predicate on the "modified" field.
|
||||
func ModifiedNotIn(vs ...time.Time) predicate.Account {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Account(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(FieldModified), v...))
|
||||
})
|
||||
return predicate.Account(sql.FieldNotIn(FieldModified, vs...))
|
||||
}
|
||||
|
||||
// ModifiedGT applies the GT predicate on the "modified" field.
|
||||
func ModifiedGT(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldModified), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldGT(FieldModified, v))
|
||||
}
|
||||
|
||||
// ModifiedGTE applies the GTE predicate on the "modified" field.
|
||||
func ModifiedGTE(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldModified), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldGTE(FieldModified, v))
|
||||
}
|
||||
|
||||
// ModifiedLT applies the LT predicate on the "modified" field.
|
||||
func ModifiedLT(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldModified), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldLT(FieldModified, v))
|
||||
}
|
||||
|
||||
// ModifiedLTE applies the LTE predicate on the "modified" field.
|
||||
func ModifiedLTE(v time.Time) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldModified), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldLTE(FieldModified, v))
|
||||
}
|
||||
|
||||
// ModifiedIsNil applies the IsNil predicate on the "modified" field.
|
||||
func ModifiedIsNil() predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.IsNull(s.C(FieldModified)))
|
||||
})
|
||||
return predicate.Account(sql.FieldIsNull(FieldModified))
|
||||
}
|
||||
|
||||
// ModifiedNotNil applies the NotNil predicate on the "modified" field.
|
||||
func ModifiedNotNil() predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.NotNull(s.C(FieldModified)))
|
||||
})
|
||||
return predicate.Account(sql.FieldNotNull(FieldModified))
|
||||
}
|
||||
|
||||
// UsernameEQ applies the EQ predicate on the "username" field.
|
||||
func UsernameEQ(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameNEQ applies the NEQ predicate on the "username" field.
|
||||
func UsernameNEQ(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldNEQ(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameIn applies the In predicate on the "username" field.
|
||||
func UsernameIn(vs ...string) predicate.Account {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Account(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...))
|
||||
})
|
||||
return predicate.Account(sql.FieldIn(FieldUsername, vs...))
|
||||
}
|
||||
|
||||
// UsernameNotIn applies the NotIn predicate on the "username" field.
|
||||
func UsernameNotIn(vs ...string) predicate.Account {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Account(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...))
|
||||
})
|
||||
return predicate.Account(sql.FieldNotIn(FieldUsername, vs...))
|
||||
}
|
||||
|
||||
// UsernameGT applies the GT predicate on the "username" field.
|
||||
func UsernameGT(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldGT(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameGTE applies the GTE predicate on the "username" field.
|
||||
func UsernameGTE(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldGTE(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameLT applies the LT predicate on the "username" field.
|
||||
func UsernameLT(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldLT(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameLTE applies the LTE predicate on the "username" field.
|
||||
func UsernameLTE(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldLTE(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameContains applies the Contains predicate on the "username" field.
|
||||
func UsernameContains(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.Contains(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldContains(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameHasPrefix applies the HasPrefix predicate on the "username" field.
|
||||
func UsernameHasPrefix(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.HasPrefix(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldHasPrefix(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameHasSuffix applies the HasSuffix predicate on the "username" field.
|
||||
func UsernameHasSuffix(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.HasSuffix(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldHasSuffix(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameEqualFold applies the EqualFold predicate on the "username" field.
|
||||
func UsernameEqualFold(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EqualFold(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEqualFold(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameContainsFold applies the ContainsFold predicate on the "username" field.
|
||||
func UsernameContainsFold(v string) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.ContainsFold(s.C(FieldUsername), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldContainsFold(FieldUsername, v))
|
||||
}
|
||||
|
||||
// PasswordEQ applies the EQ predicate on the "password" field.
|
||||
func PasswordEQ(v []byte) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldPassword), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordNEQ applies the NEQ predicate on the "password" field.
|
||||
func PasswordNEQ(v []byte) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldPassword), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldNEQ(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordIn applies the In predicate on the "password" field.
|
||||
func PasswordIn(vs ...[]byte) predicate.Account {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Account(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(FieldPassword), v...))
|
||||
})
|
||||
return predicate.Account(sql.FieldIn(FieldPassword, vs...))
|
||||
}
|
||||
|
||||
// PasswordNotIn applies the NotIn predicate on the "password" field.
|
||||
func PasswordNotIn(vs ...[]byte) predicate.Account {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Account(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(FieldPassword), v...))
|
||||
})
|
||||
return predicate.Account(sql.FieldNotIn(FieldPassword, vs...))
|
||||
}
|
||||
|
||||
// PasswordGT applies the GT predicate on the "password" field.
|
||||
func PasswordGT(v []byte) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldPassword), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldGT(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordGTE applies the GTE predicate on the "password" field.
|
||||
func PasswordGTE(v []byte) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldPassword), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldGTE(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordLT applies the LT predicate on the "password" field.
|
||||
func PasswordLT(v []byte) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldPassword), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldLT(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordLTE applies the LTE predicate on the "password" field.
|
||||
func PasswordLTE(v []byte) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldPassword), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldLTE(FieldPassword, v))
|
||||
}
|
||||
|
||||
// SuperEQ applies the EQ predicate on the "super" field.
|
||||
func SuperEQ(v bool) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldSuper), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldSuper, v))
|
||||
}
|
||||
|
||||
// SuperNEQ applies the NEQ predicate on the "super" field.
|
||||
func SuperNEQ(v bool) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldSuper), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldNEQ(FieldSuper, v))
|
||||
}
|
||||
|
||||
// ActiveEQ applies the EQ predicate on the "active" field.
|
||||
func ActiveEQ(v bool) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldActive), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldEQ(FieldActive, v))
|
||||
}
|
||||
|
||||
// ActiveNEQ applies the NEQ predicate on the "active" field.
|
||||
func ActiveNEQ(v bool) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldActive), v))
|
||||
})
|
||||
return predicate.Account(sql.FieldNEQ(FieldActive, v))
|
||||
}
|
||||
|
||||
// HasDomains applies the HasEdge predicate on the "domains" edge.
|
||||
@ -521,7 +305,6 @@ func HasDomains() predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(DomainsTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, false, DomainsTable, DomainsPrimaryKey...),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
@ -531,11 +314,7 @@ func HasDomains() predicate.Account {
|
||||
// HasDomainsWith applies the HasEdge predicate on the "domains" edge with a given conditions (other predicates).
|
||||
func HasDomainsWith(preds ...predicate.Domain) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(DomainsInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, false, DomainsTable, DomainsPrimaryKey...),
|
||||
)
|
||||
step := newDomainsStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
@ -549,7 +328,6 @@ func HasLogs() predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(LogsTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, LogsTable, LogsColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
@ -559,11 +337,7 @@ func HasLogs() predicate.Account {
|
||||
// HasLogsWith applies the HasEdge predicate on the "logs" edge with a given conditions (other predicates).
|
||||
func HasLogsWith(preds ...predicate.Logentry) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(LogsInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, LogsTable, LogsColumn),
|
||||
)
|
||||
step := newLogsStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
@ -574,32 +348,15 @@ func HasLogsWith(preds ...predicate.Logentry) predicate.Account {
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Account) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s1 := s.Clone().SetP(nil)
|
||||
for _, p := range predicates {
|
||||
p(s1)
|
||||
}
|
||||
s.Where(s1.P())
|
||||
})
|
||||
return predicate.Account(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Account) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
s1 := s.Clone().SetP(nil)
|
||||
for i, p := range predicates {
|
||||
if i > 0 {
|
||||
s1.Or()
|
||||
}
|
||||
p(s1)
|
||||
}
|
||||
s.Where(s1.P())
|
||||
})
|
||||
return predicate.Account(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Account) predicate.Account {
|
||||
return predicate.Account(func(s *sql.Selector) {
|
||||
p(s.Not())
|
||||
})
|
||||
return predicate.Account(sql.NotPredicates(p))
|
||||
}
|
||||
|
Reference in New Issue
Block a user