ent schema post generation
This commit is contained in:
69
ent/logentry/logentry.go
Normal file
69
ent/logentry/logentry.go
Normal file
@ -0,0 +1,69 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
|
||||
package logentry
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the logentry type in the database.
|
||||
Label = "logentry"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldTimestamp holds the string denoting the timestamp field in the database.
|
||||
FieldTimestamp = "timestamp"
|
||||
// FieldAction holds the string denoting the action field in the database.
|
||||
FieldAction = "action"
|
||||
// FieldData holds the string denoting the data field in the database.
|
||||
FieldData = "data"
|
||||
// FieldAccountID holds the string denoting the account_id field in the database.
|
||||
FieldAccountID = "account_id"
|
||||
// FieldDomainID holds the string denoting the domain_id field in the database.
|
||||
FieldDomainID = "domain_id"
|
||||
// EdgeAccount holds the string denoting the account edge name in mutations.
|
||||
EdgeAccount = "account"
|
||||
// EdgeDomain holds the string denoting the domain edge name in mutations.
|
||||
EdgeDomain = "domain"
|
||||
// Table holds the table name of the logentry in the database.
|
||||
Table = "logentries"
|
||||
// AccountTable is the table that holds the account relation/edge.
|
||||
AccountTable = "logentries"
|
||||
// AccountInverseTable is the table name for the Account entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "account" package.
|
||||
AccountInverseTable = "accounts"
|
||||
// AccountColumn is the table column denoting the account relation/edge.
|
||||
AccountColumn = "account_id"
|
||||
// DomainTable is the table that holds the domain relation/edge.
|
||||
DomainTable = "logentries"
|
||||
// DomainInverseTable is the table name for the Domain entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "domain" package.
|
||||
DomainInverseTable = "domains"
|
||||
// DomainColumn is the table column denoting the domain relation/edge.
|
||||
DomainColumn = "domain_id"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for logentry fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldTimestamp,
|
||||
FieldAction,
|
||||
FieldData,
|
||||
FieldAccountID,
|
||||
FieldDomainID,
|
||||
}
|
||||
|
||||
// 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 (
|
||||
// DefaultTimestamp holds the default value on creation for the "timestamp" field.
|
||||
DefaultTimestamp func() time.Time
|
||||
)
|
653
ent/logentry/where.go
Normal file
653
ent/logentry/where.go
Normal file
@ -0,0 +1,653 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
|
||||
package logentry
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"code.icod.de/postfix/manager/ent/predicate"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int64) predicate.Logentry {
|
||||
return predicate.Logentry(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 ...int64) predicate.Logentry {
|
||||
return predicate.Logentry(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 int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// Timestamp applies equality check predicate on the "timestamp" field. It's identical to TimestampEQ.
|
||||
func Timestamp(v time.Time) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldTimestamp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Action applies equality check predicate on the "action" field. It's identical to ActionEQ.
|
||||
func Action(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Data applies equality check predicate on the "data" field. It's identical to DataEQ.
|
||||
func Data(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// AccountID applies equality check predicate on the "account_id" field. It's identical to AccountIDEQ.
|
||||
func AccountID(v int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldAccountID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DomainID applies equality check predicate on the "domain_id" field. It's identical to DomainIDEQ.
|
||||
func DomainID(v int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldDomainID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TimestampEQ applies the EQ predicate on the "timestamp" field.
|
||||
func TimestampEQ(v time.Time) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldTimestamp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TimestampNEQ applies the NEQ predicate on the "timestamp" field.
|
||||
func TimestampNEQ(v time.Time) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldTimestamp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TimestampIn applies the In predicate on the "timestamp" field.
|
||||
func TimestampIn(vs ...time.Time) predicate.Logentry {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Logentry(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(FieldTimestamp), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// TimestampNotIn applies the NotIn predicate on the "timestamp" field.
|
||||
func TimestampNotIn(vs ...time.Time) predicate.Logentry {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Logentry(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(FieldTimestamp), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// TimestampGT applies the GT predicate on the "timestamp" field.
|
||||
func TimestampGT(v time.Time) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldTimestamp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TimestampGTE applies the GTE predicate on the "timestamp" field.
|
||||
func TimestampGTE(v time.Time) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldTimestamp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TimestampLT applies the LT predicate on the "timestamp" field.
|
||||
func TimestampLT(v time.Time) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldTimestamp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TimestampLTE applies the LTE predicate on the "timestamp" field.
|
||||
func TimestampLTE(v time.Time) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldTimestamp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionEQ applies the EQ predicate on the "action" field.
|
||||
func ActionEQ(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionNEQ applies the NEQ predicate on the "action" field.
|
||||
func ActionNEQ(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionIn applies the In predicate on the "action" field.
|
||||
func ActionIn(vs ...string) predicate.Logentry {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Logentry(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(FieldAction), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionNotIn applies the NotIn predicate on the "action" field.
|
||||
func ActionNotIn(vs ...string) predicate.Logentry {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Logentry(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(FieldAction), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionGT applies the GT predicate on the "action" field.
|
||||
func ActionGT(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionGTE applies the GTE predicate on the "action" field.
|
||||
func ActionGTE(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionLT applies the LT predicate on the "action" field.
|
||||
func ActionLT(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionLTE applies the LTE predicate on the "action" field.
|
||||
func ActionLTE(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionContains applies the Contains predicate on the "action" field.
|
||||
func ActionContains(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.Contains(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionHasPrefix applies the HasPrefix predicate on the "action" field.
|
||||
func ActionHasPrefix(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.HasPrefix(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionHasSuffix applies the HasSuffix predicate on the "action" field.
|
||||
func ActionHasSuffix(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.HasSuffix(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionEqualFold applies the EqualFold predicate on the "action" field.
|
||||
func ActionEqualFold(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EqualFold(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ActionContainsFold applies the ContainsFold predicate on the "action" field.
|
||||
func ActionContainsFold(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.ContainsFold(s.C(FieldAction), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DataEQ applies the EQ predicate on the "data" field.
|
||||
func DataEQ(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DataNEQ applies the NEQ predicate on the "data" field.
|
||||
func DataNEQ(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DataIn applies the In predicate on the "data" field.
|
||||
func DataIn(vs ...string) predicate.Logentry {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Logentry(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(FieldData), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// DataNotIn applies the NotIn predicate on the "data" field.
|
||||
func DataNotIn(vs ...string) predicate.Logentry {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Logentry(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(FieldData), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// DataGT applies the GT predicate on the "data" field.
|
||||
func DataGT(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DataGTE applies the GTE predicate on the "data" field.
|
||||
func DataGTE(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DataLT applies the LT predicate on the "data" field.
|
||||
func DataLT(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DataLTE applies the LTE predicate on the "data" field.
|
||||
func DataLTE(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DataContains applies the Contains predicate on the "data" field.
|
||||
func DataContains(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.Contains(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DataHasPrefix applies the HasPrefix predicate on the "data" field.
|
||||
func DataHasPrefix(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.HasPrefix(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DataHasSuffix applies the HasSuffix predicate on the "data" field.
|
||||
func DataHasSuffix(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.HasSuffix(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DataIsNil applies the IsNil predicate on the "data" field.
|
||||
func DataIsNil() predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.IsNull(s.C(FieldData)))
|
||||
})
|
||||
}
|
||||
|
||||
// DataNotNil applies the NotNil predicate on the "data" field.
|
||||
func DataNotNil() predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.NotNull(s.C(FieldData)))
|
||||
})
|
||||
}
|
||||
|
||||
// DataEqualFold applies the EqualFold predicate on the "data" field.
|
||||
func DataEqualFold(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EqualFold(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DataContainsFold applies the ContainsFold predicate on the "data" field.
|
||||
func DataContainsFold(v string) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.ContainsFold(s.C(FieldData), v))
|
||||
})
|
||||
}
|
||||
|
||||
// AccountIDEQ applies the EQ predicate on the "account_id" field.
|
||||
func AccountIDEQ(v int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldAccountID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// AccountIDNEQ applies the NEQ predicate on the "account_id" field.
|
||||
func AccountIDNEQ(v int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldAccountID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// AccountIDIn applies the In predicate on the "account_id" field.
|
||||
func AccountIDIn(vs ...int64) predicate.Logentry {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Logentry(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(FieldAccountID), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// AccountIDNotIn applies the NotIn predicate on the "account_id" field.
|
||||
func AccountIDNotIn(vs ...int64) predicate.Logentry {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Logentry(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(FieldAccountID), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// AccountIDIsNil applies the IsNil predicate on the "account_id" field.
|
||||
func AccountIDIsNil() predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.IsNull(s.C(FieldAccountID)))
|
||||
})
|
||||
}
|
||||
|
||||
// AccountIDNotNil applies the NotNil predicate on the "account_id" field.
|
||||
func AccountIDNotNil() predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.NotNull(s.C(FieldAccountID)))
|
||||
})
|
||||
}
|
||||
|
||||
// DomainIDEQ applies the EQ predicate on the "domain_id" field.
|
||||
func DomainIDEQ(v int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldDomainID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DomainIDNEQ applies the NEQ predicate on the "domain_id" field.
|
||||
func DomainIDNEQ(v int64) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldDomainID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DomainIDIn applies the In predicate on the "domain_id" field.
|
||||
func DomainIDIn(vs ...int64) predicate.Logentry {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Logentry(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(FieldDomainID), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// DomainIDNotIn applies the NotIn predicate on the "domain_id" field.
|
||||
func DomainIDNotIn(vs ...int64) predicate.Logentry {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Logentry(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(FieldDomainID), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// DomainIDIsNil applies the IsNil predicate on the "domain_id" field.
|
||||
func DomainIDIsNil() predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.IsNull(s.C(FieldDomainID)))
|
||||
})
|
||||
}
|
||||
|
||||
// DomainIDNotNil applies the NotNil predicate on the "domain_id" field.
|
||||
func DomainIDNotNil() predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
s.Where(sql.NotNull(s.C(FieldDomainID)))
|
||||
})
|
||||
}
|
||||
|
||||
// HasAccount applies the HasEdge predicate on the "account" edge.
|
||||
func HasAccount() predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(AccountTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, AccountTable, AccountColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasAccountWith applies the HasEdge predicate on the "account" edge with a given conditions (other predicates).
|
||||
func HasAccountWith(preds ...predicate.Account) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(AccountInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, AccountTable, AccountColumn),
|
||||
)
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasDomain applies the HasEdge predicate on the "domain" edge.
|
||||
func HasDomain() predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(DomainTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, DomainTable, DomainColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasDomainWith applies the HasEdge predicate on the "domain" edge with a given conditions (other predicates).
|
||||
func HasDomainWith(preds ...predicate.Domain) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(DomainInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, DomainTable, DomainColumn),
|
||||
)
|
||||
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.Logentry) predicate.Logentry {
|
||||
return predicate.Logentry(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.Logentry) predicate.Logentry {
|
||||
return predicate.Logentry(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.Logentry) predicate.Logentry {
|
||||
return predicate.Logentry(func(s *sql.Selector) {
|
||||
p(s.Not())
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user