adding validated services? patching forcad_local.py
This commit is contained in:
@@ -0,0 +1,184 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package level
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the level type in the database.
|
||||
Label = "level"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldName holds the string denoting the name field in the database.
|
||||
FieldName = "name"
|
||||
// FieldDescription holds the string denoting the description field in the database.
|
||||
FieldDescription = "description"
|
||||
// FieldVisibility holds the string denoting the visibility field in the database.
|
||||
FieldVisibility = "visibility"
|
||||
// FieldData holds the string denoting the data field in the database.
|
||||
FieldData = "data"
|
||||
// FieldPrize holds the string denoting the prize field in the database.
|
||||
FieldPrize = "prize"
|
||||
// FieldCreatedAt holds the string denoting the createdat field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// EdgeOwner holds the string denoting the owner edge name in mutations.
|
||||
EdgeOwner = "owner"
|
||||
// EdgeInvitedPlayers holds the string denoting the invitedplayers edge name in mutations.
|
||||
EdgeInvitedPlayers = "invitedPlayers"
|
||||
// Table holds the table name of the level in the database.
|
||||
Table = "levels"
|
||||
// OwnerTable is the table that holds the owner relation/edge.
|
||||
OwnerTable = "levels"
|
||||
// OwnerInverseTable is the table name for the User entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "user" package.
|
||||
OwnerInverseTable = "users"
|
||||
// OwnerColumn is the table column denoting the owner relation/edge.
|
||||
OwnerColumn = "user_owned_levels"
|
||||
// InvitedPlayersTable is the table that holds the invitedPlayers relation/edge. The primary key declared below.
|
||||
InvitedPlayersTable = "user_invitedToLevels"
|
||||
// InvitedPlayersInverseTable is the table name for the User entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "user" package.
|
||||
InvitedPlayersInverseTable = "users"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for level fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldName,
|
||||
FieldDescription,
|
||||
FieldVisibility,
|
||||
FieldData,
|
||||
FieldPrize,
|
||||
FieldCreatedAt,
|
||||
}
|
||||
|
||||
// ForeignKeys holds the SQL foreign-keys that are owned by the "levels"
|
||||
// table and are not defined as standalone fields in the schema.
|
||||
var ForeignKeys = []string{
|
||||
"user_owned_levels",
|
||||
}
|
||||
|
||||
var (
|
||||
// InvitedPlayersPrimaryKey and InvitedPlayersColumn2 are the table columns denoting the
|
||||
// primary key for the invitedPlayers relation (M2M).
|
||||
InvitedPlayersPrimaryKey = []string{"user_id", "level_id"}
|
||||
)
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
var (
|
||||
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
||||
NameValidator func(string) error
|
||||
// DefaultCreatedAt holds the default value on creation for the "createdAt" field.
|
||||
DefaultCreatedAt func() time.Time
|
||||
)
|
||||
|
||||
// Visibility defines the type for the "visibility" enum field.
|
||||
type Visibility string
|
||||
|
||||
// Visibility values.
|
||||
const (
|
||||
VisibilityPrivate Visibility = "private"
|
||||
VisibilityPublic Visibility = "public"
|
||||
)
|
||||
|
||||
func (v Visibility) String() string {
|
||||
return string(v)
|
||||
}
|
||||
|
||||
// VisibilityValidator is a validator for the "visibility" field enum values. It is called by the builders before save.
|
||||
func VisibilityValidator(v Visibility) error {
|
||||
switch v {
|
||||
case VisibilityPrivate, VisibilityPublic:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("level: invalid enum value for visibility field: %q", v)
|
||||
}
|
||||
}
|
||||
|
||||
// OrderOption defines the ordering options for the Level 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()
|
||||
}
|
||||
|
||||
// ByName orders the results by the name field.
|
||||
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldName, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByDescription orders the results by the description field.
|
||||
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldDescription, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByVisibility orders the results by the visibility field.
|
||||
func ByVisibility(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldVisibility, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPrize orders the results by the prize field.
|
||||
func ByPrize(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPrize, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the createdAt field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOwnerField orders the results by owner field.
|
||||
func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...))
|
||||
}
|
||||
}
|
||||
|
||||
// ByInvitedPlayersCount orders the results by invitedPlayers count.
|
||||
func ByInvitedPlayersCount(opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborsCount(s, newInvitedPlayersStep(), opts...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByInvitedPlayers orders the results by invitedPlayers terms.
|
||||
func ByInvitedPlayers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newInvitedPlayersStep(), append([]sql.OrderTerm{term}, terms...)...)
|
||||
}
|
||||
}
|
||||
func newOwnerStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(OwnerInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
|
||||
)
|
||||
}
|
||||
func newInvitedPlayersStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(InvitedPlayersInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, true, InvitedPlayersTable, InvitedPlayersPrimaryKey...),
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,392 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package level
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"omctf.ru/block-game-backend/codegen/ent/predicate"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.Level {
|
||||
return predicate.Level(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.Level {
|
||||
return predicate.Level(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.Level {
|
||||
return predicate.Level(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.Level {
|
||||
return predicate.Level(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.Level {
|
||||
return predicate.Level(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.Level {
|
||||
return predicate.Level(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.Level {
|
||||
return predicate.Level(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.Level {
|
||||
return predicate.Level(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.Level {
|
||||
return predicate.Level(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
|
||||
func Name(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ.
|
||||
func Description(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldEQ(FieldDescription, v))
|
||||
}
|
||||
|
||||
// Prize applies equality check predicate on the "prize" field. It's identical to PrizeEQ.
|
||||
func Prize(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldEQ(FieldPrize, v))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "createdAt" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.Level {
|
||||
return predicate.Level(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// NameEQ applies the EQ predicate on the "name" field.
|
||||
func NameEQ(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// NameNEQ applies the NEQ predicate on the "name" field.
|
||||
func NameNEQ(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldNEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// NameIn applies the In predicate on the "name" field.
|
||||
func NameIn(vs ...string) predicate.Level {
|
||||
return predicate.Level(sql.FieldIn(FieldName, vs...))
|
||||
}
|
||||
|
||||
// NameNotIn applies the NotIn predicate on the "name" field.
|
||||
func NameNotIn(vs ...string) predicate.Level {
|
||||
return predicate.Level(sql.FieldNotIn(FieldName, vs...))
|
||||
}
|
||||
|
||||
// NameGT applies the GT predicate on the "name" field.
|
||||
func NameGT(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldGT(FieldName, v))
|
||||
}
|
||||
|
||||
// NameGTE applies the GTE predicate on the "name" field.
|
||||
func NameGTE(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldGTE(FieldName, v))
|
||||
}
|
||||
|
||||
// NameLT applies the LT predicate on the "name" field.
|
||||
func NameLT(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldLT(FieldName, v))
|
||||
}
|
||||
|
||||
// NameLTE applies the LTE predicate on the "name" field.
|
||||
func NameLTE(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldLTE(FieldName, v))
|
||||
}
|
||||
|
||||
// NameContains applies the Contains predicate on the "name" field.
|
||||
func NameContains(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldContains(FieldName, v))
|
||||
}
|
||||
|
||||
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
|
||||
func NameHasPrefix(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldHasPrefix(FieldName, v))
|
||||
}
|
||||
|
||||
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
|
||||
func NameHasSuffix(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldHasSuffix(FieldName, v))
|
||||
}
|
||||
|
||||
// NameEqualFold applies the EqualFold predicate on the "name" field.
|
||||
func NameEqualFold(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldEqualFold(FieldName, v))
|
||||
}
|
||||
|
||||
// NameContainsFold applies the ContainsFold predicate on the "name" field.
|
||||
func NameContainsFold(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldContainsFold(FieldName, v))
|
||||
}
|
||||
|
||||
// DescriptionEQ applies the EQ predicate on the "description" field.
|
||||
func DescriptionEQ(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldEQ(FieldDescription, v))
|
||||
}
|
||||
|
||||
// DescriptionNEQ applies the NEQ predicate on the "description" field.
|
||||
func DescriptionNEQ(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldNEQ(FieldDescription, v))
|
||||
}
|
||||
|
||||
// DescriptionIn applies the In predicate on the "description" field.
|
||||
func DescriptionIn(vs ...string) predicate.Level {
|
||||
return predicate.Level(sql.FieldIn(FieldDescription, vs...))
|
||||
}
|
||||
|
||||
// DescriptionNotIn applies the NotIn predicate on the "description" field.
|
||||
func DescriptionNotIn(vs ...string) predicate.Level {
|
||||
return predicate.Level(sql.FieldNotIn(FieldDescription, vs...))
|
||||
}
|
||||
|
||||
// DescriptionGT applies the GT predicate on the "description" field.
|
||||
func DescriptionGT(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldGT(FieldDescription, v))
|
||||
}
|
||||
|
||||
// DescriptionGTE applies the GTE predicate on the "description" field.
|
||||
func DescriptionGTE(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldGTE(FieldDescription, v))
|
||||
}
|
||||
|
||||
// DescriptionLT applies the LT predicate on the "description" field.
|
||||
func DescriptionLT(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldLT(FieldDescription, v))
|
||||
}
|
||||
|
||||
// DescriptionLTE applies the LTE predicate on the "description" field.
|
||||
func DescriptionLTE(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldLTE(FieldDescription, v))
|
||||
}
|
||||
|
||||
// DescriptionContains applies the Contains predicate on the "description" field.
|
||||
func DescriptionContains(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldContains(FieldDescription, v))
|
||||
}
|
||||
|
||||
// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field.
|
||||
func DescriptionHasPrefix(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldHasPrefix(FieldDescription, v))
|
||||
}
|
||||
|
||||
// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field.
|
||||
func DescriptionHasSuffix(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldHasSuffix(FieldDescription, v))
|
||||
}
|
||||
|
||||
// DescriptionEqualFold applies the EqualFold predicate on the "description" field.
|
||||
func DescriptionEqualFold(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldEqualFold(FieldDescription, v))
|
||||
}
|
||||
|
||||
// DescriptionContainsFold applies the ContainsFold predicate on the "description" field.
|
||||
func DescriptionContainsFold(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldContainsFold(FieldDescription, v))
|
||||
}
|
||||
|
||||
// VisibilityEQ applies the EQ predicate on the "visibility" field.
|
||||
func VisibilityEQ(v Visibility) predicate.Level {
|
||||
return predicate.Level(sql.FieldEQ(FieldVisibility, v))
|
||||
}
|
||||
|
||||
// VisibilityNEQ applies the NEQ predicate on the "visibility" field.
|
||||
func VisibilityNEQ(v Visibility) predicate.Level {
|
||||
return predicate.Level(sql.FieldNEQ(FieldVisibility, v))
|
||||
}
|
||||
|
||||
// VisibilityIn applies the In predicate on the "visibility" field.
|
||||
func VisibilityIn(vs ...Visibility) predicate.Level {
|
||||
return predicate.Level(sql.FieldIn(FieldVisibility, vs...))
|
||||
}
|
||||
|
||||
// VisibilityNotIn applies the NotIn predicate on the "visibility" field.
|
||||
func VisibilityNotIn(vs ...Visibility) predicate.Level {
|
||||
return predicate.Level(sql.FieldNotIn(FieldVisibility, vs...))
|
||||
}
|
||||
|
||||
// PrizeEQ applies the EQ predicate on the "prize" field.
|
||||
func PrizeEQ(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldEQ(FieldPrize, v))
|
||||
}
|
||||
|
||||
// PrizeNEQ applies the NEQ predicate on the "prize" field.
|
||||
func PrizeNEQ(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldNEQ(FieldPrize, v))
|
||||
}
|
||||
|
||||
// PrizeIn applies the In predicate on the "prize" field.
|
||||
func PrizeIn(vs ...string) predicate.Level {
|
||||
return predicate.Level(sql.FieldIn(FieldPrize, vs...))
|
||||
}
|
||||
|
||||
// PrizeNotIn applies the NotIn predicate on the "prize" field.
|
||||
func PrizeNotIn(vs ...string) predicate.Level {
|
||||
return predicate.Level(sql.FieldNotIn(FieldPrize, vs...))
|
||||
}
|
||||
|
||||
// PrizeGT applies the GT predicate on the "prize" field.
|
||||
func PrizeGT(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldGT(FieldPrize, v))
|
||||
}
|
||||
|
||||
// PrizeGTE applies the GTE predicate on the "prize" field.
|
||||
func PrizeGTE(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldGTE(FieldPrize, v))
|
||||
}
|
||||
|
||||
// PrizeLT applies the LT predicate on the "prize" field.
|
||||
func PrizeLT(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldLT(FieldPrize, v))
|
||||
}
|
||||
|
||||
// PrizeLTE applies the LTE predicate on the "prize" field.
|
||||
func PrizeLTE(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldLTE(FieldPrize, v))
|
||||
}
|
||||
|
||||
// PrizeContains applies the Contains predicate on the "prize" field.
|
||||
func PrizeContains(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldContains(FieldPrize, v))
|
||||
}
|
||||
|
||||
// PrizeHasPrefix applies the HasPrefix predicate on the "prize" field.
|
||||
func PrizeHasPrefix(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldHasPrefix(FieldPrize, v))
|
||||
}
|
||||
|
||||
// PrizeHasSuffix applies the HasSuffix predicate on the "prize" field.
|
||||
func PrizeHasSuffix(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldHasSuffix(FieldPrize, v))
|
||||
}
|
||||
|
||||
// PrizeEqualFold applies the EqualFold predicate on the "prize" field.
|
||||
func PrizeEqualFold(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldEqualFold(FieldPrize, v))
|
||||
}
|
||||
|
||||
// PrizeContainsFold applies the ContainsFold predicate on the "prize" field.
|
||||
func PrizeContainsFold(v string) predicate.Level {
|
||||
return predicate.Level(sql.FieldContainsFold(FieldPrize, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "createdAt" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.Level {
|
||||
return predicate.Level(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtNEQ applies the NEQ predicate on the "createdAt" field.
|
||||
func CreatedAtNEQ(v time.Time) predicate.Level {
|
||||
return predicate.Level(sql.FieldNEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtIn applies the In predicate on the "createdAt" field.
|
||||
func CreatedAtIn(vs ...time.Time) predicate.Level {
|
||||
return predicate.Level(sql.FieldIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtNotIn applies the NotIn predicate on the "createdAt" field.
|
||||
func CreatedAtNotIn(vs ...time.Time) predicate.Level {
|
||||
return predicate.Level(sql.FieldNotIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtGT applies the GT predicate on the "createdAt" field.
|
||||
func CreatedAtGT(v time.Time) predicate.Level {
|
||||
return predicate.Level(sql.FieldGT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtGTE applies the GTE predicate on the "createdAt" field.
|
||||
func CreatedAtGTE(v time.Time) predicate.Level {
|
||||
return predicate.Level(sql.FieldGTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLT applies the LT predicate on the "createdAt" field.
|
||||
func CreatedAtLT(v time.Time) predicate.Level {
|
||||
return predicate.Level(sql.FieldLT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLTE applies the LTE predicate on the "createdAt" field.
|
||||
func CreatedAtLTE(v time.Time) predicate.Level {
|
||||
return predicate.Level(sql.FieldLTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// HasOwner applies the HasEdge predicate on the "owner" edge.
|
||||
func HasOwner() predicate.Level {
|
||||
return predicate.Level(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates).
|
||||
func HasOwnerWith(preds ...predicate.User) predicate.Level {
|
||||
return predicate.Level(func(s *sql.Selector) {
|
||||
step := newOwnerStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasInvitedPlayers applies the HasEdge predicate on the "invitedPlayers" edge.
|
||||
func HasInvitedPlayers() predicate.Level {
|
||||
return predicate.Level(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, true, InvitedPlayersTable, InvitedPlayersPrimaryKey...),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasInvitedPlayersWith applies the HasEdge predicate on the "invitedPlayers" edge with a given conditions (other predicates).
|
||||
func HasInvitedPlayersWith(preds ...predicate.User) predicate.Level {
|
||||
return predicate.Level(func(s *sql.Selector) {
|
||||
step := newInvitedPlayersStep()
|
||||
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.Level) predicate.Level {
|
||||
return predicate.Level(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Level) predicate.Level {
|
||||
return predicate.Level(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Level) predicate.Level {
|
||||
return predicate.Level(sql.NotPredicates(p))
|
||||
}
|
||||
Reference in New Issue
Block a user