99 lines
3.1 KiB
Go
99 lines
3.1 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package messages
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the messages type in the database.
|
|
Label = "messages"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldMessage holds the string denoting the message field in the database.
|
|
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.
|
|
Table = "messages"
|
|
// MatchPlayerTable is the table that holds the match_player relation/edge.
|
|
MatchPlayerTable = "messages"
|
|
// MatchPlayerInverseTable is the table name for the MatchPlayer entity.
|
|
// It exists in this package in order to avoid circular dependency with the "matchplayer" package.
|
|
MatchPlayerInverseTable = "match_players"
|
|
// MatchPlayerColumn is the table column denoting the match_player relation/edge.
|
|
MatchPlayerColumn = "match_player_messages"
|
|
)
|
|
|
|
// Columns holds all SQL columns for messages fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldMessage,
|
|
FieldAllChat,
|
|
FieldTick,
|
|
}
|
|
|
|
// ForeignKeys holds the SQL foreign-keys that are owned by the "messages"
|
|
// table and are not defined as standalone fields in the schema.
|
|
var ForeignKeys = []string{
|
|
"match_player_messages",
|
|
}
|
|
|
|
// 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
|
|
}
|
|
}
|
|
for i := range ForeignKeys {
|
|
if column == ForeignKeys[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// OrderOption defines the ordering options for the Messages 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()
|
|
}
|
|
|
|
// ByMessage orders the results by the message field.
|
|
func ByMessage(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldMessage, opts...).ToFunc()
|
|
}
|
|
|
|
// ByAllChat orders the results by the all_chat field.
|
|
func ByAllChat(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldAllChat, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTick orders the results by the tick field.
|
|
func ByTick(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTick, opts...).ToFunc()
|
|
}
|
|
|
|
// ByMatchPlayerField orders the results by match_player field.
|
|
func ByMatchPlayerField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newMatchPlayerStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
func newMatchPlayerStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(MatchPlayerInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, true, MatchPlayerTable, MatchPlayerColumn),
|
|
)
|
|
}
|