added tick to messages

This commit is contained in:
2022-01-29 20:46:11 +01:00
parent 2f15560d84
commit 3bdcdecb68
10 changed files with 271 additions and 5 deletions

View File

@@ -11,6 +11,8 @@ const (
FieldMessage = "message"
// FieldAllChat holds the string denoting the all_chat field in the database.
FieldAllChat = "all_chat"
// FieldTick holds the string denoting the tick field in the database.
FieldTick = "tick"
// EdgeMatchPlayer holds the string denoting the match_player edge name in mutations.
EdgeMatchPlayer = "match_player"
// Table holds the table name of the messages in the database.
@@ -29,6 +31,7 @@ var Columns = []string{
FieldID,
FieldMessage,
FieldAllChat,
FieldTick,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "messages"

View File

@@ -106,6 +106,13 @@ func AllChat(v bool) predicate.Messages {
})
}
// Tick applies equality check predicate on the "tick" field. It's identical to TickEQ.
func Tick(v int) predicate.Messages {
return predicate.Messages(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldTick), v))
})
}
// MessageEQ applies the EQ predicate on the "message" field.
func MessageEQ(v string) predicate.Messages {
return predicate.Messages(func(s *sql.Selector) {
@@ -231,6 +238,82 @@ func AllChatNEQ(v bool) predicate.Messages {
})
}
// TickEQ applies the EQ predicate on the "tick" field.
func TickEQ(v int) predicate.Messages {
return predicate.Messages(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldTick), v))
})
}
// TickNEQ applies the NEQ predicate on the "tick" field.
func TickNEQ(v int) predicate.Messages {
return predicate.Messages(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldTick), v))
})
}
// TickIn applies the In predicate on the "tick" field.
func TickIn(vs ...int) predicate.Messages {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Messages(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(FieldTick), v...))
})
}
// TickNotIn applies the NotIn predicate on the "tick" field.
func TickNotIn(vs ...int) predicate.Messages {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Messages(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(FieldTick), v...))
})
}
// TickGT applies the GT predicate on the "tick" field.
func TickGT(v int) predicate.Messages {
return predicate.Messages(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldTick), v))
})
}
// TickGTE applies the GTE predicate on the "tick" field.
func TickGTE(v int) predicate.Messages {
return predicate.Messages(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldTick), v))
})
}
// TickLT applies the LT predicate on the "tick" field.
func TickLT(v int) predicate.Messages {
return predicate.Messages(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldTick), v))
})
}
// TickLTE applies the LTE predicate on the "tick" field.
func TickLTE(v int) predicate.Messages {
return predicate.Messages(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldTick), v))
})
}
// HasMatchPlayer applies the HasEdge predicate on the "match_player" edge.
func HasMatchPlayer() predicate.Messages {
return predicate.Messages(func(s *sql.Selector) {