ent

package
v0.0.0-...-1b9e5be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2024 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeCategory       = "Category"
	TypeChallenge      = "Challenge"
	TypeChallengeGroup = "ChallengeGroup"
	TypeEpisode        = "Episode"
	TypeEpisodeRound   = "EpisodeRound"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Categories

type Categories []*Category

Categories is a parsable slice of Category.

type Category

type Category struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CategoryQuery when eager-loading is set.
	Edges CategoryEdges `json:"edges"`
	// contains filtered or unexported fields
}

Category is the model entity for the Category schema.

func (*Category) QueryChallengeGroups

func (c *Category) QueryChallengeGroups() *ChallengeGroupQuery

QueryChallengeGroups queries the "challenge_groups" edge of the Category entity.

func (*Category) String

func (c *Category) String() string

String implements the fmt.Stringer.

func (*Category) Unwrap

func (c *Category) Unwrap() *Category

Unwrap unwraps the Category entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Category) Update

func (c *Category) Update() *CategoryUpdateOne

Update returns a builder for updating this Category. Note that you need to call Category.Unwrap() before calling this method if this Category was returned from a transaction, and the transaction was committed or rolled back.

func (*Category) Value

func (c *Category) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Category. This includes values selected through modifiers, order, etc.

type CategoryClient

type CategoryClient struct {
	// contains filtered or unexported fields
}

CategoryClient is a client for the Category schema.

func NewCategoryClient

func NewCategoryClient(c config) *CategoryClient

NewCategoryClient returns a client for the Category from the given config.

func (*CategoryClient) Create

func (c *CategoryClient) Create() *CategoryCreate

Create returns a builder for creating a Category entity.

func (*CategoryClient) CreateBulk

func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk

CreateBulk returns a builder for creating a bulk of Category entities.

func (*CategoryClient) Delete

func (c *CategoryClient) Delete() *CategoryDelete

Delete returns a delete builder for Category.

func (*CategoryClient) DeleteOne

func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CategoryClient) DeleteOneID

func (c *CategoryClient) DeleteOneID(id int) *CategoryDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CategoryClient) Get

func (c *CategoryClient) Get(ctx context.Context, id int) (*Category, error)

Get returns a Category entity by its id.

func (*CategoryClient) GetX

func (c *CategoryClient) GetX(ctx context.Context, id int) *Category

GetX is like Get, but panics if an error occurs.

func (*CategoryClient) Hooks

func (c *CategoryClient) Hooks() []Hook

Hooks returns the client hooks.

func (*CategoryClient) Intercept

func (c *CategoryClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `category.Intercept(f(g(h())))`.

func (*CategoryClient) Interceptors

func (c *CategoryClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*CategoryClient) MapCreateBulk

func (c *CategoryClient) MapCreateBulk(slice any, setFunc func(*CategoryCreate, int)) *CategoryCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CategoryClient) Query

func (c *CategoryClient) Query() *CategoryQuery

Query returns a query builder for Category.

func (*CategoryClient) QueryChallengeGroups

func (c *CategoryClient) QueryChallengeGroups(ca *Category) *ChallengeGroupQuery

QueryChallengeGroups queries the challenge_groups edge of a Category.

func (*CategoryClient) Update

func (c *CategoryClient) Update() *CategoryUpdate

Update returns an update builder for Category.

func (*CategoryClient) UpdateOne

func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CategoryClient) UpdateOneID

func (c *CategoryClient) UpdateOneID(id int) *CategoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CategoryClient) Use

func (c *CategoryClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `category.Hooks(f(g(h())))`.

type CategoryCreate

type CategoryCreate struct {
	// contains filtered or unexported fields
}

CategoryCreate is the builder for creating a Category entity.

func (*CategoryCreate) AddChallengeGroupIDs

func (cc *CategoryCreate) AddChallengeGroupIDs(ids ...int) *CategoryCreate

AddChallengeGroupIDs adds the "challenge_groups" edge to the ChallengeGroup entity by IDs.

func (*CategoryCreate) AddChallengeGroups

func (cc *CategoryCreate) AddChallengeGroups(c ...*ChallengeGroup) *CategoryCreate

AddChallengeGroups adds the "challenge_groups" edges to the ChallengeGroup entity.

func (*CategoryCreate) Exec

func (cc *CategoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CategoryCreate) ExecX

func (cc *CategoryCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategoryCreate) Mutation

func (cc *CategoryCreate) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryCreate) Save

func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)

Save creates the Category in the database.

func (*CategoryCreate) SaveX

func (cc *CategoryCreate) SaveX(ctx context.Context) *Category

SaveX calls Save and panics if Save returns an error.

func (*CategoryCreate) SetName

func (cc *CategoryCreate) SetName(s string) *CategoryCreate

SetName sets the "name" field.

type CategoryCreateBulk

type CategoryCreateBulk struct {
	// contains filtered or unexported fields
}

CategoryCreateBulk is the builder for creating many Category entities in bulk.

func (*CategoryCreateBulk) Exec

func (ccb *CategoryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CategoryCreateBulk) ExecX

func (ccb *CategoryCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategoryCreateBulk) Save

func (ccb *CategoryCreateBulk) Save(ctx context.Context) ([]*Category, error)

Save creates the Category entities in the database.

func (*CategoryCreateBulk) SaveX

func (ccb *CategoryCreateBulk) SaveX(ctx context.Context) []*Category

SaveX is like Save, but panics if an error occurs.

type CategoryDelete

type CategoryDelete struct {
	// contains filtered or unexported fields
}

CategoryDelete is the builder for deleting a Category entity.

func (*CategoryDelete) Exec

func (cd *CategoryDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*CategoryDelete) ExecX

func (cd *CategoryDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*CategoryDelete) Where

func (cd *CategoryDelete) Where(ps ...predicate.Category) *CategoryDelete

Where appends a list predicates to the CategoryDelete builder.

type CategoryDeleteOne

type CategoryDeleteOne struct {
	// contains filtered or unexported fields
}

CategoryDeleteOne is the builder for deleting a single Category entity.

func (*CategoryDeleteOne) Exec

func (cdo *CategoryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CategoryDeleteOne) ExecX

func (cdo *CategoryDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategoryDeleteOne) Where

Where appends a list predicates to the CategoryDelete builder.

type CategoryEdges

type CategoryEdges struct {
	// ChallengeGroups holds the value of the challenge_groups edge.
	ChallengeGroups []*ChallengeGroup `json:"challenge_groups,omitempty"`
	// contains filtered or unexported fields
}

CategoryEdges holds the relations/edges for other nodes in the graph.

func (CategoryEdges) ChallengeGroupsOrErr

func (e CategoryEdges) ChallengeGroupsOrErr() ([]*ChallengeGroup, error)

ChallengeGroupsOrErr returns the ChallengeGroups value or an error if the edge was not loaded in eager-loading.

type CategoryGroupBy

type CategoryGroupBy struct {
	// contains filtered or unexported fields
}

CategoryGroupBy is the group-by builder for Category entities.

func (*CategoryGroupBy) Aggregate

func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*CategoryGroupBy) Bool

func (s *CategoryGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) BoolX

func (s *CategoryGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CategoryGroupBy) Bools

func (s *CategoryGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) BoolsX

func (s *CategoryGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CategoryGroupBy) Float64

func (s *CategoryGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) Float64X

func (s *CategoryGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CategoryGroupBy) Float64s

func (s *CategoryGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) Float64sX

func (s *CategoryGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CategoryGroupBy) Int

func (s *CategoryGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) IntX

func (s *CategoryGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CategoryGroupBy) Ints

func (s *CategoryGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) IntsX

func (s *CategoryGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CategoryGroupBy) Scan

func (cgb *CategoryGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CategoryGroupBy) ScanX

func (s *CategoryGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CategoryGroupBy) String

func (s *CategoryGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) StringX

func (s *CategoryGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CategoryGroupBy) Strings

func (s *CategoryGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) StringsX

func (s *CategoryGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CategoryMutation

type CategoryMutation struct {
	// contains filtered or unexported fields
}

CategoryMutation represents an operation that mutates the Category nodes in the graph.

func (*CategoryMutation) AddChallengeGroupIDs

func (m *CategoryMutation) AddChallengeGroupIDs(ids ...int)

AddChallengeGroupIDs adds the "challenge_groups" edge to the ChallengeGroup entity by ids.

func (*CategoryMutation) AddField

func (m *CategoryMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CategoryMutation) AddedEdges

func (m *CategoryMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*CategoryMutation) AddedField

func (m *CategoryMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CategoryMutation) AddedFields

func (m *CategoryMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*CategoryMutation) AddedIDs

func (m *CategoryMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*CategoryMutation) ChallengeGroupsCleared

func (m *CategoryMutation) ChallengeGroupsCleared() bool

ChallengeGroupsCleared reports if the "challenge_groups" edge to the ChallengeGroup entity was cleared.

func (*CategoryMutation) ChallengeGroupsIDs

func (m *CategoryMutation) ChallengeGroupsIDs() (ids []int)

ChallengeGroupsIDs returns the "challenge_groups" edge IDs in the mutation.

func (*CategoryMutation) ClearChallengeGroups

func (m *CategoryMutation) ClearChallengeGroups()

ClearChallengeGroups clears the "challenge_groups" edge to the ChallengeGroup entity.

func (*CategoryMutation) ClearEdge

func (m *CategoryMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*CategoryMutation) ClearField

func (m *CategoryMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*CategoryMutation) ClearedEdges

func (m *CategoryMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*CategoryMutation) ClearedFields

func (m *CategoryMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (CategoryMutation) Client

func (m CategoryMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*CategoryMutation) EdgeCleared

func (m *CategoryMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*CategoryMutation) Field

func (m *CategoryMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CategoryMutation) FieldCleared

func (m *CategoryMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*CategoryMutation) Fields

func (m *CategoryMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*CategoryMutation) ID

func (m *CategoryMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*CategoryMutation) IDs

func (m *CategoryMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*CategoryMutation) Name

func (m *CategoryMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*CategoryMutation) OldField

func (m *CategoryMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*CategoryMutation) OldName

func (m *CategoryMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CategoryMutation) Op

func (m *CategoryMutation) Op() Op

Op returns the operation name.

func (*CategoryMutation) RemoveChallengeGroupIDs

func (m *CategoryMutation) RemoveChallengeGroupIDs(ids ...int)

RemoveChallengeGroupIDs removes the "challenge_groups" edge to the ChallengeGroup entity by IDs.

func (*CategoryMutation) RemovedChallengeGroupsIDs

func (m *CategoryMutation) RemovedChallengeGroupsIDs() (ids []int)

RemovedChallengeGroups returns the removed IDs of the "challenge_groups" edge to the ChallengeGroup entity.

func (*CategoryMutation) RemovedEdges

func (m *CategoryMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*CategoryMutation) RemovedIDs

func (m *CategoryMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*CategoryMutation) ResetChallengeGroups

func (m *CategoryMutation) ResetChallengeGroups()

ResetChallengeGroups resets all changes to the "challenge_groups" edge.

func (*CategoryMutation) ResetEdge

func (m *CategoryMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*CategoryMutation) ResetField

func (m *CategoryMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*CategoryMutation) ResetName

func (m *CategoryMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CategoryMutation) SetField

func (m *CategoryMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CategoryMutation) SetName

func (m *CategoryMutation) SetName(s string)

SetName sets the "name" field.

func (*CategoryMutation) SetOp

func (m *CategoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (CategoryMutation) Tx

func (m CategoryMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*CategoryMutation) Type

func (m *CategoryMutation) Type() string

Type returns the node type of this mutation (Category).

func (*CategoryMutation) Where

func (m *CategoryMutation) Where(ps ...predicate.Category)

Where appends a list predicates to the CategoryMutation builder.

func (*CategoryMutation) WhereP

func (m *CategoryMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the CategoryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type CategoryQuery

type CategoryQuery struct {
	// contains filtered or unexported fields
}

CategoryQuery is the builder for querying Category entities.

func (*CategoryQuery) Aggregate

func (cq *CategoryQuery) Aggregate(fns ...AggregateFunc) *CategorySelect

Aggregate returns a CategorySelect configured with the given aggregations.

func (*CategoryQuery) All

func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)

All executes the query and returns a list of Categories.

func (*CategoryQuery) AllX

func (cq *CategoryQuery) AllX(ctx context.Context) []*Category

AllX is like All, but panics if an error occurs.

func (*CategoryQuery) Clone

func (cq *CategoryQuery) Clone() *CategoryQuery

Clone returns a duplicate of the CategoryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*CategoryQuery) Count

func (cq *CategoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CategoryQuery) CountX

func (cq *CategoryQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*CategoryQuery) Exist

func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*CategoryQuery) ExistX

func (cq *CategoryQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*CategoryQuery) First

func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)

First returns the first Category entity from the query. Returns a *NotFoundError when no Category was found.

func (*CategoryQuery) FirstID

func (cq *CategoryQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Category ID from the query. Returns a *NotFoundError when no Category ID was found.

func (*CategoryQuery) FirstIDX

func (cq *CategoryQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*CategoryQuery) FirstX

func (cq *CategoryQuery) FirstX(ctx context.Context) *Category

FirstX is like First, but panics if an error occurs.

func (*CategoryQuery) GroupBy

func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Category.Query().
	GroupBy(category.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CategoryQuery) IDs

func (cq *CategoryQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Category IDs.

func (*CategoryQuery) IDsX

func (cq *CategoryQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*CategoryQuery) Limit

func (cq *CategoryQuery) Limit(limit int) *CategoryQuery

Limit the number of records to be returned by this query.

func (*CategoryQuery) Offset

func (cq *CategoryQuery) Offset(offset int) *CategoryQuery

Offset to start from.

func (*CategoryQuery) Only

func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)

Only returns a single Category entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Category entity is found. Returns a *NotFoundError when no Category entities are found.

func (*CategoryQuery) OnlyID

func (cq *CategoryQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Category ID in the query. Returns a *NotSingularError when more than one Category ID is found. Returns a *NotFoundError when no entities are found.

func (*CategoryQuery) OnlyIDX

func (cq *CategoryQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*CategoryQuery) OnlyX

func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category

OnlyX is like Only, but panics if an error occurs.

func (*CategoryQuery) Order

Order specifies how the records should be ordered.

func (*CategoryQuery) QueryChallengeGroups

func (cq *CategoryQuery) QueryChallengeGroups() *ChallengeGroupQuery

QueryChallengeGroups chains the current query on the "challenge_groups" edge.

func (*CategoryQuery) Select

func (cq *CategoryQuery) Select(fields ...string) *CategorySelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Category.Query().
	Select(category.FieldName).
	Scan(ctx, &v)

func (*CategoryQuery) Unique

func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*CategoryQuery) Where

func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery

Where adds a new predicate for the CategoryQuery builder.

func (*CategoryQuery) WithChallengeGroups

func (cq *CategoryQuery) WithChallengeGroups(opts ...func(*ChallengeGroupQuery)) *CategoryQuery

WithChallengeGroups tells the query-builder to eager-load the nodes that are connected to the "challenge_groups" edge. The optional arguments are used to configure the query builder of the edge.

type CategorySelect

type CategorySelect struct {
	*CategoryQuery
	// contains filtered or unexported fields
}

CategorySelect is the builder for selecting fields of Category entities.

func (*CategorySelect) Aggregate

func (cs *CategorySelect) Aggregate(fns ...AggregateFunc) *CategorySelect

Aggregate adds the given aggregation functions to the selector query.

func (*CategorySelect) Bool

func (s *CategorySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CategorySelect) BoolX

func (s *CategorySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CategorySelect) Bools

func (s *CategorySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CategorySelect) BoolsX

func (s *CategorySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CategorySelect) Float64

func (s *CategorySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CategorySelect) Float64X

func (s *CategorySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CategorySelect) Float64s

func (s *CategorySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CategorySelect) Float64sX

func (s *CategorySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CategorySelect) Int

func (s *CategorySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CategorySelect) IntX

func (s *CategorySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CategorySelect) Ints

func (s *CategorySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CategorySelect) IntsX

func (s *CategorySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CategorySelect) Scan

func (cs *CategorySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CategorySelect) ScanX

func (s *CategorySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CategorySelect) String

func (s *CategorySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CategorySelect) StringX

func (s *CategorySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CategorySelect) Strings

func (s *CategorySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CategorySelect) StringsX

func (s *CategorySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CategoryUpdate

type CategoryUpdate struct {
	// contains filtered or unexported fields
}

CategoryUpdate is the builder for updating Category entities.

func (*CategoryUpdate) AddChallengeGroupIDs

func (cu *CategoryUpdate) AddChallengeGroupIDs(ids ...int) *CategoryUpdate

AddChallengeGroupIDs adds the "challenge_groups" edge to the ChallengeGroup entity by IDs.

func (*CategoryUpdate) AddChallengeGroups

func (cu *CategoryUpdate) AddChallengeGroups(c ...*ChallengeGroup) *CategoryUpdate

AddChallengeGroups adds the "challenge_groups" edges to the ChallengeGroup entity.

func (*CategoryUpdate) ClearChallengeGroups

func (cu *CategoryUpdate) ClearChallengeGroups() *CategoryUpdate

ClearChallengeGroups clears all "challenge_groups" edges to the ChallengeGroup entity.

func (*CategoryUpdate) Exec

func (cu *CategoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CategoryUpdate) ExecX

func (cu *CategoryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategoryUpdate) Mutation

func (cu *CategoryUpdate) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryUpdate) RemoveChallengeGroupIDs

func (cu *CategoryUpdate) RemoveChallengeGroupIDs(ids ...int) *CategoryUpdate

RemoveChallengeGroupIDs removes the "challenge_groups" edge to ChallengeGroup entities by IDs.

func (*CategoryUpdate) RemoveChallengeGroups

func (cu *CategoryUpdate) RemoveChallengeGroups(c ...*ChallengeGroup) *CategoryUpdate

RemoveChallengeGroups removes "challenge_groups" edges to ChallengeGroup entities.

func (*CategoryUpdate) Save

func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CategoryUpdate) SaveX

func (cu *CategoryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CategoryUpdate) SetName

func (cu *CategoryUpdate) SetName(s string) *CategoryUpdate

SetName sets the "name" field.

func (*CategoryUpdate) SetNillableName

func (cu *CategoryUpdate) SetNillableName(s *string) *CategoryUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*CategoryUpdate) Where

func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate

Where appends a list predicates to the CategoryUpdate builder.

type CategoryUpdateOne

type CategoryUpdateOne struct {
	// contains filtered or unexported fields
}

CategoryUpdateOne is the builder for updating a single Category entity.

func (*CategoryUpdateOne) AddChallengeGroupIDs

func (cuo *CategoryUpdateOne) AddChallengeGroupIDs(ids ...int) *CategoryUpdateOne

AddChallengeGroupIDs adds the "challenge_groups" edge to the ChallengeGroup entity by IDs.

func (*CategoryUpdateOne) AddChallengeGroups

func (cuo *CategoryUpdateOne) AddChallengeGroups(c ...*ChallengeGroup) *CategoryUpdateOne

AddChallengeGroups adds the "challenge_groups" edges to the ChallengeGroup entity.

func (*CategoryUpdateOne) ClearChallengeGroups

func (cuo *CategoryUpdateOne) ClearChallengeGroups() *CategoryUpdateOne

ClearChallengeGroups clears all "challenge_groups" edges to the ChallengeGroup entity.

func (*CategoryUpdateOne) Exec

func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CategoryUpdateOne) ExecX

func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategoryUpdateOne) Mutation

func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryUpdateOne) RemoveChallengeGroupIDs

func (cuo *CategoryUpdateOne) RemoveChallengeGroupIDs(ids ...int) *CategoryUpdateOne

RemoveChallengeGroupIDs removes the "challenge_groups" edge to ChallengeGroup entities by IDs.

func (*CategoryUpdateOne) RemoveChallengeGroups

func (cuo *CategoryUpdateOne) RemoveChallengeGroups(c ...*ChallengeGroup) *CategoryUpdateOne

RemoveChallengeGroups removes "challenge_groups" edges to ChallengeGroup entities.

func (*CategoryUpdateOne) Save

func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)

Save executes the query and returns the updated Category entity.

func (*CategoryUpdateOne) SaveX

func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category

SaveX is like Save, but panics if an error occurs.

func (*CategoryUpdateOne) Select

func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CategoryUpdateOne) SetName

func (cuo *CategoryUpdateOne) SetName(s string) *CategoryUpdateOne

SetName sets the "name" field.

func (*CategoryUpdateOne) SetNillableName

func (cuo *CategoryUpdateOne) SetNillableName(s *string) *CategoryUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*CategoryUpdateOne) Where

Where appends a list predicates to the CategoryUpdate builder.

type Challenge

type Challenge struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Media holds the value of the "media" field.
	Media string `json:"media,omitempty"`
	// May be a URL path if the media type is defined.
	Prompt string `json:"prompt,omitempty"`
	// Response holds the value of the "response" field.
	Response string `json:"response,omitempty"`
	// If positive, the board's given value; if negative, the player's wagered value.
	Value int `json:"value,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ChallengeQuery when eager-loading is set.
	Edges ChallengeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Challenge is the model entity for the Challenge schema.

func (*Challenge) GetValue

func (c *Challenge) GetValue(name string) (ent.Value, error)

GetValue returns the ent.Value that was dynamically selected and assigned to the Challenge. This includes values selected through modifiers, order, etc.

func (*Challenge) QueryChallengeGroup

func (c *Challenge) QueryChallengeGroup() *ChallengeGroupQuery

QueryChallengeGroup queries the "challenge_group" edge of the Challenge entity.

func (*Challenge) String

func (c *Challenge) String() string

String implements the fmt.Stringer.

func (*Challenge) Unwrap

func (c *Challenge) Unwrap() *Challenge

Unwrap unwraps the Challenge entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Challenge) Update

func (c *Challenge) Update() *ChallengeUpdateOne

Update returns a builder for updating this Challenge. Note that you need to call Challenge.Unwrap() before calling this method if this Challenge was returned from a transaction, and the transaction was committed or rolled back.

type ChallengeClient

type ChallengeClient struct {
	// contains filtered or unexported fields
}

ChallengeClient is a client for the Challenge schema.

func NewChallengeClient

func NewChallengeClient(c config) *ChallengeClient

NewChallengeClient returns a client for the Challenge from the given config.

func (*ChallengeClient) Create

func (c *ChallengeClient) Create() *ChallengeCreate

Create returns a builder for creating a Challenge entity.

func (*ChallengeClient) CreateBulk

func (c *ChallengeClient) CreateBulk(builders ...*ChallengeCreate) *ChallengeCreateBulk

CreateBulk returns a builder for creating a bulk of Challenge entities.

func (*ChallengeClient) Delete

func (c *ChallengeClient) Delete() *ChallengeDelete

Delete returns a delete builder for Challenge.

func (*ChallengeClient) DeleteOne

func (c *ChallengeClient) DeleteOne(ch *Challenge) *ChallengeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChallengeClient) DeleteOneID

func (c *ChallengeClient) DeleteOneID(id int) *ChallengeDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ChallengeClient) Get

func (c *ChallengeClient) Get(ctx context.Context, id int) (*Challenge, error)

Get returns a Challenge entity by its id.

func (*ChallengeClient) GetX

func (c *ChallengeClient) GetX(ctx context.Context, id int) *Challenge

GetX is like Get, but panics if an error occurs.

func (*ChallengeClient) Hooks

func (c *ChallengeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ChallengeClient) Intercept

func (c *ChallengeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `challenge.Intercept(f(g(h())))`.

func (*ChallengeClient) Interceptors

func (c *ChallengeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ChallengeClient) MapCreateBulk

func (c *ChallengeClient) MapCreateBulk(slice any, setFunc func(*ChallengeCreate, int)) *ChallengeCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ChallengeClient) Query

func (c *ChallengeClient) Query() *ChallengeQuery

Query returns a query builder for Challenge.

func (*ChallengeClient) QueryChallengeGroup

func (c *ChallengeClient) QueryChallengeGroup(ch *Challenge) *ChallengeGroupQuery

QueryChallengeGroup queries the challenge_group edge of a Challenge.

func (*ChallengeClient) Update

func (c *ChallengeClient) Update() *ChallengeUpdate

Update returns an update builder for Challenge.

func (*ChallengeClient) UpdateOne

func (c *ChallengeClient) UpdateOne(ch *Challenge) *ChallengeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChallengeClient) UpdateOneID

func (c *ChallengeClient) UpdateOneID(id int) *ChallengeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChallengeClient) Use

func (c *ChallengeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `challenge.Hooks(f(g(h())))`.

type ChallengeCreate

type ChallengeCreate struct {
	// contains filtered or unexported fields
}

ChallengeCreate is the builder for creating a Challenge entity.

func (*ChallengeCreate) AddChallengeGroup

func (cc *ChallengeCreate) AddChallengeGroup(c ...*ChallengeGroup) *ChallengeCreate

AddChallengeGroup adds the "challenge_group" edges to the ChallengeGroup entity.

func (*ChallengeCreate) AddChallengeGroupIDs

func (cc *ChallengeCreate) AddChallengeGroupIDs(ids ...int) *ChallengeCreate

AddChallengeGroupIDs adds the "challenge_group" edge to the ChallengeGroup entity by IDs.

func (*ChallengeCreate) Exec

func (cc *ChallengeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChallengeCreate) ExecX

func (cc *ChallengeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeCreate) Mutation

func (cc *ChallengeCreate) Mutation() *ChallengeMutation

Mutation returns the ChallengeMutation object of the builder.

func (*ChallengeCreate) Save

func (cc *ChallengeCreate) Save(ctx context.Context) (*Challenge, error)

Save creates the Challenge in the database.

func (*ChallengeCreate) SaveX

func (cc *ChallengeCreate) SaveX(ctx context.Context) *Challenge

SaveX calls Save and panics if Save returns an error.

func (*ChallengeCreate) SetMedia

func (cc *ChallengeCreate) SetMedia(s string) *ChallengeCreate

SetMedia sets the "media" field.

func (*ChallengeCreate) SetPrompt

func (cc *ChallengeCreate) SetPrompt(s string) *ChallengeCreate

SetPrompt sets the "prompt" field.

func (*ChallengeCreate) SetResponse

func (cc *ChallengeCreate) SetResponse(s string) *ChallengeCreate

SetResponse sets the "response" field.

func (*ChallengeCreate) SetValue

func (cc *ChallengeCreate) SetValue(i int) *ChallengeCreate

SetValue sets the "value" field.

type ChallengeCreateBulk

type ChallengeCreateBulk struct {
	// contains filtered or unexported fields
}

ChallengeCreateBulk is the builder for creating many Challenge entities in bulk.

func (*ChallengeCreateBulk) Exec

func (ccb *ChallengeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ChallengeCreateBulk) ExecX

func (ccb *ChallengeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeCreateBulk) Save

func (ccb *ChallengeCreateBulk) Save(ctx context.Context) ([]*Challenge, error)

Save creates the Challenge entities in the database.

func (*ChallengeCreateBulk) SaveX

func (ccb *ChallengeCreateBulk) SaveX(ctx context.Context) []*Challenge

SaveX is like Save, but panics if an error occurs.

type ChallengeDelete

type ChallengeDelete struct {
	// contains filtered or unexported fields
}

ChallengeDelete is the builder for deleting a Challenge entity.

func (*ChallengeDelete) Exec

func (cd *ChallengeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ChallengeDelete) ExecX

func (cd *ChallengeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeDelete) Where

Where appends a list predicates to the ChallengeDelete builder.

type ChallengeDeleteOne

type ChallengeDeleteOne struct {
	// contains filtered or unexported fields
}

ChallengeDeleteOne is the builder for deleting a single Challenge entity.

func (*ChallengeDeleteOne) Exec

func (cdo *ChallengeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ChallengeDeleteOne) ExecX

func (cdo *ChallengeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeDeleteOne) Where

Where appends a list predicates to the ChallengeDelete builder.

type ChallengeEdges

type ChallengeEdges struct {
	// ChallengeGroup holds the value of the challenge_group edge.
	ChallengeGroup []*ChallengeGroup `json:"challenge_group,omitempty"`
	// contains filtered or unexported fields
}

ChallengeEdges holds the relations/edges for other nodes in the graph.

func (ChallengeEdges) ChallengeGroupOrErr

func (e ChallengeEdges) ChallengeGroupOrErr() ([]*ChallengeGroup, error)

ChallengeGroupOrErr returns the ChallengeGroup value or an error if the edge was not loaded in eager-loading.

type ChallengeGroup

type ChallengeGroup struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ChallengeGroupQuery when eager-loading is set.
	Edges ChallengeGroupEdges `json:"edges"`
	// contains filtered or unexported fields
}

ChallengeGroup is the model entity for the ChallengeGroup schema.

func (*ChallengeGroup) QueryCategory

func (cg *ChallengeGroup) QueryCategory() *CategoryQuery

QueryCategory queries the "category" edge of the ChallengeGroup entity.

func (*ChallengeGroup) QueryChallenges

func (cg *ChallengeGroup) QueryChallenges() *ChallengeQuery

QueryChallenges queries the "challenges" edge of the ChallengeGroup entity.

func (*ChallengeGroup) QueryEpisodeRound

func (cg *ChallengeGroup) QueryEpisodeRound() *EpisodeRoundQuery

QueryEpisodeRound queries the "episode_round" edge of the ChallengeGroup entity.

func (*ChallengeGroup) String

func (cg *ChallengeGroup) String() string

String implements the fmt.Stringer.

func (*ChallengeGroup) Unwrap

func (cg *ChallengeGroup) Unwrap() *ChallengeGroup

Unwrap unwraps the ChallengeGroup entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*ChallengeGroup) Update

Update returns a builder for updating this ChallengeGroup. Note that you need to call ChallengeGroup.Unwrap() before calling this method if this ChallengeGroup was returned from a transaction, and the transaction was committed or rolled back.

func (*ChallengeGroup) Value

func (cg *ChallengeGroup) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ChallengeGroup. This includes values selected through modifiers, order, etc.

type ChallengeGroupBy

type ChallengeGroupBy struct {
	// contains filtered or unexported fields
}

ChallengeGroupBy is the group-by builder for Challenge entities.

func (*ChallengeGroupBy) Aggregate

func (cgb *ChallengeGroupBy) Aggregate(fns ...AggregateFunc) *ChallengeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ChallengeGroupBy) Bool

func (s *ChallengeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupBy) BoolX

func (s *ChallengeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChallengeGroupBy) Bools

func (s *ChallengeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupBy) BoolsX

func (s *ChallengeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChallengeGroupBy) Float64

func (s *ChallengeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupBy) Float64X

func (s *ChallengeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChallengeGroupBy) Float64s

func (s *ChallengeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupBy) Float64sX

func (s *ChallengeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChallengeGroupBy) Int

func (s *ChallengeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupBy) IntX

func (s *ChallengeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChallengeGroupBy) Ints

func (s *ChallengeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupBy) IntsX

func (s *ChallengeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChallengeGroupBy) Scan

func (cgb *ChallengeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChallengeGroupBy) ScanX

func (s *ChallengeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChallengeGroupBy) String

func (s *ChallengeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupBy) StringX

func (s *ChallengeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChallengeGroupBy) Strings

func (s *ChallengeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupBy) StringsX

func (s *ChallengeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChallengeGroupClient

type ChallengeGroupClient struct {
	// contains filtered or unexported fields
}

ChallengeGroupClient is a client for the ChallengeGroup schema.

func NewChallengeGroupClient

func NewChallengeGroupClient(c config) *ChallengeGroupClient

NewChallengeGroupClient returns a client for the ChallengeGroup from the given config.

func (*ChallengeGroupClient) Create

Create returns a builder for creating a ChallengeGroup entity.

func (*ChallengeGroupClient) CreateBulk

CreateBulk returns a builder for creating a bulk of ChallengeGroup entities.

func (*ChallengeGroupClient) Delete

Delete returns a delete builder for ChallengeGroup.

func (*ChallengeGroupClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChallengeGroupClient) DeleteOneID

func (c *ChallengeGroupClient) DeleteOneID(id int) *ChallengeGroupDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ChallengeGroupClient) Get

Get returns a ChallengeGroup entity by its id.

func (*ChallengeGroupClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ChallengeGroupClient) Hooks

func (c *ChallengeGroupClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ChallengeGroupClient) Intercept

func (c *ChallengeGroupClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `challengegroup.Intercept(f(g(h())))`.

func (*ChallengeGroupClient) Interceptors

func (c *ChallengeGroupClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ChallengeGroupClient) MapCreateBulk

func (c *ChallengeGroupClient) MapCreateBulk(slice any, setFunc func(*ChallengeGroupCreate, int)) *ChallengeGroupCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ChallengeGroupClient) Query

Query returns a query builder for ChallengeGroup.

func (*ChallengeGroupClient) QueryCategory

func (c *ChallengeGroupClient) QueryCategory(cg *ChallengeGroup) *CategoryQuery

QueryCategory queries the category edge of a ChallengeGroup.

func (*ChallengeGroupClient) QueryChallenges

func (c *ChallengeGroupClient) QueryChallenges(cg *ChallengeGroup) *ChallengeQuery

QueryChallenges queries the challenges edge of a ChallengeGroup.

func (*ChallengeGroupClient) QueryEpisodeRound

func (c *ChallengeGroupClient) QueryEpisodeRound(cg *ChallengeGroup) *EpisodeRoundQuery

QueryEpisodeRound queries the episode_round edge of a ChallengeGroup.

func (*ChallengeGroupClient) Update

Update returns an update builder for ChallengeGroup.

func (*ChallengeGroupClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChallengeGroupClient) UpdateOneID

func (c *ChallengeGroupClient) UpdateOneID(id int) *ChallengeGroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChallengeGroupClient) Use

func (c *ChallengeGroupClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `challengegroup.Hooks(f(g(h())))`.

type ChallengeGroupCreate

type ChallengeGroupCreate struct {
	// contains filtered or unexported fields
}

ChallengeGroupCreate is the builder for creating a ChallengeGroup entity.

func (*ChallengeGroupCreate) AddCategory

func (cgc *ChallengeGroupCreate) AddCategory(c ...*Category) *ChallengeGroupCreate

AddCategory adds the "category" edges to the Category entity.

func (*ChallengeGroupCreate) AddCategoryIDs

func (cgc *ChallengeGroupCreate) AddCategoryIDs(ids ...int) *ChallengeGroupCreate

AddCategoryIDs adds the "category" edge to the Category entity by IDs.

func (*ChallengeGroupCreate) AddChallengeIDs

func (cgc *ChallengeGroupCreate) AddChallengeIDs(ids ...int) *ChallengeGroupCreate

AddChallengeIDs adds the "challenges" edge to the Challenge entity by IDs.

func (*ChallengeGroupCreate) AddChallenges

func (cgc *ChallengeGroupCreate) AddChallenges(c ...*Challenge) *ChallengeGroupCreate

AddChallenges adds the "challenges" edges to the Challenge entity.

func (*ChallengeGroupCreate) AddEpisodeRound

func (cgc *ChallengeGroupCreate) AddEpisodeRound(e ...*EpisodeRound) *ChallengeGroupCreate

AddEpisodeRound adds the "episode_round" edges to the EpisodeRound entity.

func (*ChallengeGroupCreate) AddEpisodeRoundIDs

func (cgc *ChallengeGroupCreate) AddEpisodeRoundIDs(ids ...int) *ChallengeGroupCreate

AddEpisodeRoundIDs adds the "episode_round" edge to the EpisodeRound entity by IDs.

func (*ChallengeGroupCreate) Exec

func (cgc *ChallengeGroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChallengeGroupCreate) ExecX

func (cgc *ChallengeGroupCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeGroupCreate) Mutation

Mutation returns the ChallengeGroupMutation object of the builder.

func (*ChallengeGroupCreate) Save

Save creates the ChallengeGroup in the database.

func (*ChallengeGroupCreate) SaveX

SaveX calls Save and panics if Save returns an error.

type ChallengeGroupCreateBulk

type ChallengeGroupCreateBulk struct {
	// contains filtered or unexported fields
}

ChallengeGroupCreateBulk is the builder for creating many ChallengeGroup entities in bulk.

func (*ChallengeGroupCreateBulk) Exec

Exec executes the query.

func (*ChallengeGroupCreateBulk) ExecX

func (cgcb *ChallengeGroupCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeGroupCreateBulk) Save

Save creates the ChallengeGroup entities in the database.

func (*ChallengeGroupCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type ChallengeGroupDelete

type ChallengeGroupDelete struct {
	// contains filtered or unexported fields
}

ChallengeGroupDelete is the builder for deleting a ChallengeGroup entity.

func (*ChallengeGroupDelete) Exec

func (cgd *ChallengeGroupDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ChallengeGroupDelete) ExecX

func (cgd *ChallengeGroupDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeGroupDelete) Where

Where appends a list predicates to the ChallengeGroupDelete builder.

type ChallengeGroupDeleteOne

type ChallengeGroupDeleteOne struct {
	// contains filtered or unexported fields
}

ChallengeGroupDeleteOne is the builder for deleting a single ChallengeGroup entity.

func (*ChallengeGroupDeleteOne) Exec

func (cgdo *ChallengeGroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ChallengeGroupDeleteOne) ExecX

func (cgdo *ChallengeGroupDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeGroupDeleteOne) Where

Where appends a list predicates to the ChallengeGroupDelete builder.

type ChallengeGroupEdges

type ChallengeGroupEdges struct {
	// Challenges holds the value of the challenges edge.
	Challenges []*Challenge `json:"challenges,omitempty"`
	// Category holds the value of the category edge.
	Category []*Category `json:"category,omitempty"`
	// EpisodeRound holds the value of the episode_round edge.
	EpisodeRound []*EpisodeRound `json:"episode_round,omitempty"`
	// contains filtered or unexported fields
}

ChallengeGroupEdges holds the relations/edges for other nodes in the graph.

func (ChallengeGroupEdges) CategoryOrErr

func (e ChallengeGroupEdges) CategoryOrErr() ([]*Category, error)

CategoryOrErr returns the Category value or an error if the edge was not loaded in eager-loading.

func (ChallengeGroupEdges) ChallengesOrErr

func (e ChallengeGroupEdges) ChallengesOrErr() ([]*Challenge, error)

ChallengesOrErr returns the Challenges value or an error if the edge was not loaded in eager-loading.

func (ChallengeGroupEdges) EpisodeRoundOrErr

func (e ChallengeGroupEdges) EpisodeRoundOrErr() ([]*EpisodeRound, error)

EpisodeRoundOrErr returns the EpisodeRound value or an error if the edge was not loaded in eager-loading.

type ChallengeGroupGroupBy

type ChallengeGroupGroupBy struct {
	// contains filtered or unexported fields
}

ChallengeGroupGroupBy is the group-by builder for ChallengeGroup entities.

func (*ChallengeGroupGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*ChallengeGroupGroupBy) Bool

func (s *ChallengeGroupGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupGroupBy) BoolX

func (s *ChallengeGroupGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChallengeGroupGroupBy) Bools

func (s *ChallengeGroupGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupGroupBy) BoolsX

func (s *ChallengeGroupGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChallengeGroupGroupBy) Float64

func (s *ChallengeGroupGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupGroupBy) Float64X

func (s *ChallengeGroupGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChallengeGroupGroupBy) Float64s

func (s *ChallengeGroupGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupGroupBy) Float64sX

func (s *ChallengeGroupGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChallengeGroupGroupBy) Int

func (s *ChallengeGroupGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupGroupBy) IntX

func (s *ChallengeGroupGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChallengeGroupGroupBy) Ints

func (s *ChallengeGroupGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupGroupBy) IntsX

func (s *ChallengeGroupGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChallengeGroupGroupBy) Scan

func (cggb *ChallengeGroupGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChallengeGroupGroupBy) ScanX

func (s *ChallengeGroupGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChallengeGroupGroupBy) String

func (s *ChallengeGroupGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupGroupBy) StringX

func (s *ChallengeGroupGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChallengeGroupGroupBy) Strings

func (s *ChallengeGroupGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupGroupBy) StringsX

func (s *ChallengeGroupGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChallengeGroupMutation

type ChallengeGroupMutation struct {
	// contains filtered or unexported fields
}

ChallengeGroupMutation represents an operation that mutates the ChallengeGroup nodes in the graph.

func (*ChallengeGroupMutation) AddCategoryIDs

func (m *ChallengeGroupMutation) AddCategoryIDs(ids ...int)

AddCategoryIDs adds the "category" edge to the Category entity by ids.

func (*ChallengeGroupMutation) AddChallengeIDs

func (m *ChallengeGroupMutation) AddChallengeIDs(ids ...int)

AddChallengeIDs adds the "challenges" edge to the Challenge entity by ids.

func (*ChallengeGroupMutation) AddEpisodeRoundIDs

func (m *ChallengeGroupMutation) AddEpisodeRoundIDs(ids ...int)

AddEpisodeRoundIDs adds the "episode_round" edge to the EpisodeRound entity by ids.

func (*ChallengeGroupMutation) AddField

func (m *ChallengeGroupMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ChallengeGroupMutation) AddedEdges

func (m *ChallengeGroupMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ChallengeGroupMutation) AddedField

func (m *ChallengeGroupMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ChallengeGroupMutation) AddedFields

func (m *ChallengeGroupMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ChallengeGroupMutation) AddedIDs

func (m *ChallengeGroupMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ChallengeGroupMutation) CategoryCleared

func (m *ChallengeGroupMutation) CategoryCleared() bool

CategoryCleared reports if the "category" edge to the Category entity was cleared.

func (*ChallengeGroupMutation) CategoryIDs

func (m *ChallengeGroupMutation) CategoryIDs() (ids []int)

CategoryIDs returns the "category" edge IDs in the mutation.

func (*ChallengeGroupMutation) ChallengesCleared

func (m *ChallengeGroupMutation) ChallengesCleared() bool

ChallengesCleared reports if the "challenges" edge to the Challenge entity was cleared.

func (*ChallengeGroupMutation) ChallengesIDs

func (m *ChallengeGroupMutation) ChallengesIDs() (ids []int)

ChallengesIDs returns the "challenges" edge IDs in the mutation.

func (*ChallengeGroupMutation) ClearCategory

func (m *ChallengeGroupMutation) ClearCategory()

ClearCategory clears the "category" edge to the Category entity.

func (*ChallengeGroupMutation) ClearChallenges

func (m *ChallengeGroupMutation) ClearChallenges()

ClearChallenges clears the "challenges" edge to the Challenge entity.

func (*ChallengeGroupMutation) ClearEdge

func (m *ChallengeGroupMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ChallengeGroupMutation) ClearEpisodeRound

func (m *ChallengeGroupMutation) ClearEpisodeRound()

ClearEpisodeRound clears the "episode_round" edge to the EpisodeRound entity.

func (*ChallengeGroupMutation) ClearField

func (m *ChallengeGroupMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ChallengeGroupMutation) ClearedEdges

func (m *ChallengeGroupMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ChallengeGroupMutation) ClearedFields

func (m *ChallengeGroupMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ChallengeGroupMutation) Client

func (m ChallengeGroupMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ChallengeGroupMutation) EdgeCleared

func (m *ChallengeGroupMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ChallengeGroupMutation) EpisodeRoundCleared

func (m *ChallengeGroupMutation) EpisodeRoundCleared() bool

EpisodeRoundCleared reports if the "episode_round" edge to the EpisodeRound entity was cleared.

func (*ChallengeGroupMutation) EpisodeRoundIDs

func (m *ChallengeGroupMutation) EpisodeRoundIDs() (ids []int)

EpisodeRoundIDs returns the "episode_round" edge IDs in the mutation.

func (*ChallengeGroupMutation) Field

func (m *ChallengeGroupMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ChallengeGroupMutation) FieldCleared

func (m *ChallengeGroupMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ChallengeGroupMutation) Fields

func (m *ChallengeGroupMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ChallengeGroupMutation) ID

func (m *ChallengeGroupMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ChallengeGroupMutation) IDs

func (m *ChallengeGroupMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ChallengeGroupMutation) OldField

func (m *ChallengeGroupMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ChallengeGroupMutation) Op

func (m *ChallengeGroupMutation) Op() Op

Op returns the operation name.

func (*ChallengeGroupMutation) RemoveCategoryIDs

func (m *ChallengeGroupMutation) RemoveCategoryIDs(ids ...int)

RemoveCategoryIDs removes the "category" edge to the Category entity by IDs.

func (*ChallengeGroupMutation) RemoveChallengeIDs

func (m *ChallengeGroupMutation) RemoveChallengeIDs(ids ...int)

RemoveChallengeIDs removes the "challenges" edge to the Challenge entity by IDs.

func (*ChallengeGroupMutation) RemoveEpisodeRoundIDs

func (m *ChallengeGroupMutation) RemoveEpisodeRoundIDs(ids ...int)

RemoveEpisodeRoundIDs removes the "episode_round" edge to the EpisodeRound entity by IDs.

func (*ChallengeGroupMutation) RemovedCategoryIDs

func (m *ChallengeGroupMutation) RemovedCategoryIDs() (ids []int)

RemovedCategory returns the removed IDs of the "category" edge to the Category entity.

func (*ChallengeGroupMutation) RemovedChallengesIDs

func (m *ChallengeGroupMutation) RemovedChallengesIDs() (ids []int)

RemovedChallenges returns the removed IDs of the "challenges" edge to the Challenge entity.

func (*ChallengeGroupMutation) RemovedEdges

func (m *ChallengeGroupMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ChallengeGroupMutation) RemovedEpisodeRoundIDs

func (m *ChallengeGroupMutation) RemovedEpisodeRoundIDs() (ids []int)

RemovedEpisodeRound returns the removed IDs of the "episode_round" edge to the EpisodeRound entity.

func (*ChallengeGroupMutation) RemovedIDs

func (m *ChallengeGroupMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ChallengeGroupMutation) ResetCategory

func (m *ChallengeGroupMutation) ResetCategory()

ResetCategory resets all changes to the "category" edge.

func (*ChallengeGroupMutation) ResetChallenges

func (m *ChallengeGroupMutation) ResetChallenges()

ResetChallenges resets all changes to the "challenges" edge.

func (*ChallengeGroupMutation) ResetEdge

func (m *ChallengeGroupMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ChallengeGroupMutation) ResetEpisodeRound

func (m *ChallengeGroupMutation) ResetEpisodeRound()

ResetEpisodeRound resets all changes to the "episode_round" edge.

func (*ChallengeGroupMutation) ResetField

func (m *ChallengeGroupMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ChallengeGroupMutation) SetField

func (m *ChallengeGroupMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ChallengeGroupMutation) SetOp

func (m *ChallengeGroupMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (ChallengeGroupMutation) Tx

func (m ChallengeGroupMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ChallengeGroupMutation) Type

func (m *ChallengeGroupMutation) Type() string

Type returns the node type of this mutation (ChallengeGroup).

func (*ChallengeGroupMutation) Where

Where appends a list predicates to the ChallengeGroupMutation builder.

func (*ChallengeGroupMutation) WhereP

func (m *ChallengeGroupMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ChallengeGroupMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ChallengeGroupQuery

type ChallengeGroupQuery struct {
	// contains filtered or unexported fields
}

ChallengeGroupQuery is the builder for querying ChallengeGroup entities.

func (*ChallengeGroupQuery) Aggregate

func (cgq *ChallengeGroupQuery) Aggregate(fns ...AggregateFunc) *ChallengeGroupSelect

Aggregate returns a ChallengeGroupSelect configured with the given aggregations.

func (*ChallengeGroupQuery) All

All executes the query and returns a list of ChallengeGroups.

func (*ChallengeGroupQuery) AllX

AllX is like All, but panics if an error occurs.

func (*ChallengeGroupQuery) Clone

Clone returns a duplicate of the ChallengeGroupQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ChallengeGroupQuery) Count

func (cgq *ChallengeGroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ChallengeGroupQuery) CountX

func (cgq *ChallengeGroupQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ChallengeGroupQuery) Exist

func (cgq *ChallengeGroupQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ChallengeGroupQuery) ExistX

func (cgq *ChallengeGroupQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ChallengeGroupQuery) First

First returns the first ChallengeGroup entity from the query. Returns a *NotFoundError when no ChallengeGroup was found.

func (*ChallengeGroupQuery) FirstID

func (cgq *ChallengeGroupQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first ChallengeGroup ID from the query. Returns a *NotFoundError when no ChallengeGroup ID was found.

func (*ChallengeGroupQuery) FirstIDX

func (cgq *ChallengeGroupQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ChallengeGroupQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*ChallengeGroupQuery) GroupBy

func (cgq *ChallengeGroupQuery) GroupBy(field string, fields ...string) *ChallengeGroupGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

func (*ChallengeGroupQuery) IDs

func (cgq *ChallengeGroupQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of ChallengeGroup IDs.

func (*ChallengeGroupQuery) IDsX

func (cgq *ChallengeGroupQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ChallengeGroupQuery) Limit

func (cgq *ChallengeGroupQuery) Limit(limit int) *ChallengeGroupQuery

Limit the number of records to be returned by this query.

func (*ChallengeGroupQuery) Offset

func (cgq *ChallengeGroupQuery) Offset(offset int) *ChallengeGroupQuery

Offset to start from.

func (*ChallengeGroupQuery) Only

Only returns a single ChallengeGroup entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ChallengeGroup entity is found. Returns a *NotFoundError when no ChallengeGroup entities are found.

func (*ChallengeGroupQuery) OnlyID

func (cgq *ChallengeGroupQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only ChallengeGroup ID in the query. Returns a *NotSingularError when more than one ChallengeGroup ID is found. Returns a *NotFoundError when no entities are found.

func (*ChallengeGroupQuery) OnlyIDX

func (cgq *ChallengeGroupQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ChallengeGroupQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*ChallengeGroupQuery) Order

Order specifies how the records should be ordered.

func (*ChallengeGroupQuery) QueryCategory

func (cgq *ChallengeGroupQuery) QueryCategory() *CategoryQuery

QueryCategory chains the current query on the "category" edge.

func (*ChallengeGroupQuery) QueryChallenges

func (cgq *ChallengeGroupQuery) QueryChallenges() *ChallengeQuery

QueryChallenges chains the current query on the "challenges" edge.

func (*ChallengeGroupQuery) QueryEpisodeRound

func (cgq *ChallengeGroupQuery) QueryEpisodeRound() *EpisodeRoundQuery

QueryEpisodeRound chains the current query on the "episode_round" edge.

func (*ChallengeGroupQuery) Select

func (cgq *ChallengeGroupQuery) Select(fields ...string) *ChallengeGroupSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*ChallengeGroupQuery) Unique

func (cgq *ChallengeGroupQuery) Unique(unique bool) *ChallengeGroupQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ChallengeGroupQuery) Where

Where adds a new predicate for the ChallengeGroupQuery builder.

func (*ChallengeGroupQuery) WithCategory

func (cgq *ChallengeGroupQuery) WithCategory(opts ...func(*CategoryQuery)) *ChallengeGroupQuery

WithCategory tells the query-builder to eager-load the nodes that are connected to the "category" edge. The optional arguments are used to configure the query builder of the edge.

func (*ChallengeGroupQuery) WithChallenges

func (cgq *ChallengeGroupQuery) WithChallenges(opts ...func(*ChallengeQuery)) *ChallengeGroupQuery

WithChallenges tells the query-builder to eager-load the nodes that are connected to the "challenges" edge. The optional arguments are used to configure the query builder of the edge.

func (*ChallengeGroupQuery) WithEpisodeRound

func (cgq *ChallengeGroupQuery) WithEpisodeRound(opts ...func(*EpisodeRoundQuery)) *ChallengeGroupQuery

WithEpisodeRound tells the query-builder to eager-load the nodes that are connected to the "episode_round" edge. The optional arguments are used to configure the query builder of the edge.

type ChallengeGroupSelect

type ChallengeGroupSelect struct {
	*ChallengeGroupQuery
	// contains filtered or unexported fields
}

ChallengeGroupSelect is the builder for selecting fields of ChallengeGroup entities.

func (*ChallengeGroupSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*ChallengeGroupSelect) Bool

func (s *ChallengeGroupSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupSelect) BoolX

func (s *ChallengeGroupSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChallengeGroupSelect) Bools

func (s *ChallengeGroupSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupSelect) BoolsX

func (s *ChallengeGroupSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChallengeGroupSelect) Float64

func (s *ChallengeGroupSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupSelect) Float64X

func (s *ChallengeGroupSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChallengeGroupSelect) Float64s

func (s *ChallengeGroupSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupSelect) Float64sX

func (s *ChallengeGroupSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChallengeGroupSelect) Int

func (s *ChallengeGroupSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupSelect) IntX

func (s *ChallengeGroupSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChallengeGroupSelect) Ints

func (s *ChallengeGroupSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupSelect) IntsX

func (s *ChallengeGroupSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChallengeGroupSelect) Scan

func (cgs *ChallengeGroupSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChallengeGroupSelect) ScanX

func (s *ChallengeGroupSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChallengeGroupSelect) String

func (s *ChallengeGroupSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupSelect) StringX

func (s *ChallengeGroupSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChallengeGroupSelect) Strings

func (s *ChallengeGroupSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChallengeGroupSelect) StringsX

func (s *ChallengeGroupSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChallengeGroupUpdate

type ChallengeGroupUpdate struct {
	// contains filtered or unexported fields
}

ChallengeGroupUpdate is the builder for updating ChallengeGroup entities.

func (*ChallengeGroupUpdate) AddCategory

func (cgu *ChallengeGroupUpdate) AddCategory(c ...*Category) *ChallengeGroupUpdate

AddCategory adds the "category" edges to the Category entity.

func (*ChallengeGroupUpdate) AddCategoryIDs

func (cgu *ChallengeGroupUpdate) AddCategoryIDs(ids ...int) *ChallengeGroupUpdate

AddCategoryIDs adds the "category" edge to the Category entity by IDs.

func (*ChallengeGroupUpdate) AddChallengeIDs

func (cgu *ChallengeGroupUpdate) AddChallengeIDs(ids ...int) *ChallengeGroupUpdate

AddChallengeIDs adds the "challenges" edge to the Challenge entity by IDs.

func (*ChallengeGroupUpdate) AddChallenges

func (cgu *ChallengeGroupUpdate) AddChallenges(c ...*Challenge) *ChallengeGroupUpdate

AddChallenges adds the "challenges" edges to the Challenge entity.

func (*ChallengeGroupUpdate) AddEpisodeRound

func (cgu *ChallengeGroupUpdate) AddEpisodeRound(e ...*EpisodeRound) *ChallengeGroupUpdate

AddEpisodeRound adds the "episode_round" edges to the EpisodeRound entity.

func (*ChallengeGroupUpdate) AddEpisodeRoundIDs

func (cgu *ChallengeGroupUpdate) AddEpisodeRoundIDs(ids ...int) *ChallengeGroupUpdate

AddEpisodeRoundIDs adds the "episode_round" edge to the EpisodeRound entity by IDs.

func (*ChallengeGroupUpdate) ClearCategory

func (cgu *ChallengeGroupUpdate) ClearCategory() *ChallengeGroupUpdate

ClearCategory clears all "category" edges to the Category entity.

func (*ChallengeGroupUpdate) ClearChallenges

func (cgu *ChallengeGroupUpdate) ClearChallenges() *ChallengeGroupUpdate

ClearChallenges clears all "challenges" edges to the Challenge entity.

func (*ChallengeGroupUpdate) ClearEpisodeRound

func (cgu *ChallengeGroupUpdate) ClearEpisodeRound() *ChallengeGroupUpdate

ClearEpisodeRound clears all "episode_round" edges to the EpisodeRound entity.

func (*ChallengeGroupUpdate) Exec

func (cgu *ChallengeGroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChallengeGroupUpdate) ExecX

func (cgu *ChallengeGroupUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeGroupUpdate) Mutation

Mutation returns the ChallengeGroupMutation object of the builder.

func (*ChallengeGroupUpdate) RemoveCategory

func (cgu *ChallengeGroupUpdate) RemoveCategory(c ...*Category) *ChallengeGroupUpdate

RemoveCategory removes "category" edges to Category entities.

func (*ChallengeGroupUpdate) RemoveCategoryIDs

func (cgu *ChallengeGroupUpdate) RemoveCategoryIDs(ids ...int) *ChallengeGroupUpdate

RemoveCategoryIDs removes the "category" edge to Category entities by IDs.

func (*ChallengeGroupUpdate) RemoveChallengeIDs

func (cgu *ChallengeGroupUpdate) RemoveChallengeIDs(ids ...int) *ChallengeGroupUpdate

RemoveChallengeIDs removes the "challenges" edge to Challenge entities by IDs.

func (*ChallengeGroupUpdate) RemoveChallenges

func (cgu *ChallengeGroupUpdate) RemoveChallenges(c ...*Challenge) *ChallengeGroupUpdate

RemoveChallenges removes "challenges" edges to Challenge entities.

func (*ChallengeGroupUpdate) RemoveEpisodeRound

func (cgu *ChallengeGroupUpdate) RemoveEpisodeRound(e ...*EpisodeRound) *ChallengeGroupUpdate

RemoveEpisodeRound removes "episode_round" edges to EpisodeRound entities.

func (*ChallengeGroupUpdate) RemoveEpisodeRoundIDs

func (cgu *ChallengeGroupUpdate) RemoveEpisodeRoundIDs(ids ...int) *ChallengeGroupUpdate

RemoveEpisodeRoundIDs removes the "episode_round" edge to EpisodeRound entities by IDs.

func (*ChallengeGroupUpdate) Save

func (cgu *ChallengeGroupUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ChallengeGroupUpdate) SaveX

func (cgu *ChallengeGroupUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ChallengeGroupUpdate) Where

Where appends a list predicates to the ChallengeGroupUpdate builder.

type ChallengeGroupUpdateOne

type ChallengeGroupUpdateOne struct {
	// contains filtered or unexported fields
}

ChallengeGroupUpdateOne is the builder for updating a single ChallengeGroup entity.

func (*ChallengeGroupUpdateOne) AddCategory

func (cguo *ChallengeGroupUpdateOne) AddCategory(c ...*Category) *ChallengeGroupUpdateOne

AddCategory adds the "category" edges to the Category entity.

func (*ChallengeGroupUpdateOne) AddCategoryIDs

func (cguo *ChallengeGroupUpdateOne) AddCategoryIDs(ids ...int) *ChallengeGroupUpdateOne

AddCategoryIDs adds the "category" edge to the Category entity by IDs.

func (*ChallengeGroupUpdateOne) AddChallengeIDs

func (cguo *ChallengeGroupUpdateOne) AddChallengeIDs(ids ...int) *ChallengeGroupUpdateOne

AddChallengeIDs adds the "challenges" edge to the Challenge entity by IDs.

func (*ChallengeGroupUpdateOne) AddChallenges

func (cguo *ChallengeGroupUpdateOne) AddChallenges(c ...*Challenge) *ChallengeGroupUpdateOne

AddChallenges adds the "challenges" edges to the Challenge entity.

func (*ChallengeGroupUpdateOne) AddEpisodeRound

func (cguo *ChallengeGroupUpdateOne) AddEpisodeRound(e ...*EpisodeRound) *ChallengeGroupUpdateOne

AddEpisodeRound adds the "episode_round" edges to the EpisodeRound entity.

func (*ChallengeGroupUpdateOne) AddEpisodeRoundIDs

func (cguo *ChallengeGroupUpdateOne) AddEpisodeRoundIDs(ids ...int) *ChallengeGroupUpdateOne

AddEpisodeRoundIDs adds the "episode_round" edge to the EpisodeRound entity by IDs.

func (*ChallengeGroupUpdateOne) ClearCategory

func (cguo *ChallengeGroupUpdateOne) ClearCategory() *ChallengeGroupUpdateOne

ClearCategory clears all "category" edges to the Category entity.

func (*ChallengeGroupUpdateOne) ClearChallenges

func (cguo *ChallengeGroupUpdateOne) ClearChallenges() *ChallengeGroupUpdateOne

ClearChallenges clears all "challenges" edges to the Challenge entity.

func (*ChallengeGroupUpdateOne) ClearEpisodeRound

func (cguo *ChallengeGroupUpdateOne) ClearEpisodeRound() *ChallengeGroupUpdateOne

ClearEpisodeRound clears all "episode_round" edges to the EpisodeRound entity.

func (*ChallengeGroupUpdateOne) Exec

func (cguo *ChallengeGroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ChallengeGroupUpdateOne) ExecX

func (cguo *ChallengeGroupUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeGroupUpdateOne) Mutation

Mutation returns the ChallengeGroupMutation object of the builder.

func (*ChallengeGroupUpdateOne) RemoveCategory

func (cguo *ChallengeGroupUpdateOne) RemoveCategory(c ...*Category) *ChallengeGroupUpdateOne

RemoveCategory removes "category" edges to Category entities.

func (*ChallengeGroupUpdateOne) RemoveCategoryIDs

func (cguo *ChallengeGroupUpdateOne) RemoveCategoryIDs(ids ...int) *ChallengeGroupUpdateOne

RemoveCategoryIDs removes the "category" edge to Category entities by IDs.

func (*ChallengeGroupUpdateOne) RemoveChallengeIDs

func (cguo *ChallengeGroupUpdateOne) RemoveChallengeIDs(ids ...int) *ChallengeGroupUpdateOne

RemoveChallengeIDs removes the "challenges" edge to Challenge entities by IDs.

func (*ChallengeGroupUpdateOne) RemoveChallenges

func (cguo *ChallengeGroupUpdateOne) RemoveChallenges(c ...*Challenge) *ChallengeGroupUpdateOne

RemoveChallenges removes "challenges" edges to Challenge entities.

func (*ChallengeGroupUpdateOne) RemoveEpisodeRound

func (cguo *ChallengeGroupUpdateOne) RemoveEpisodeRound(e ...*EpisodeRound) *ChallengeGroupUpdateOne

RemoveEpisodeRound removes "episode_round" edges to EpisodeRound entities.

func (*ChallengeGroupUpdateOne) RemoveEpisodeRoundIDs

func (cguo *ChallengeGroupUpdateOne) RemoveEpisodeRoundIDs(ids ...int) *ChallengeGroupUpdateOne

RemoveEpisodeRoundIDs removes the "episode_round" edge to EpisodeRound entities by IDs.

func (*ChallengeGroupUpdateOne) Save

Save executes the query and returns the updated ChallengeGroup entity.

func (*ChallengeGroupUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ChallengeGroupUpdateOne) Select

func (cguo *ChallengeGroupUpdateOne) Select(field string, fields ...string) *ChallengeGroupUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ChallengeGroupUpdateOne) Where

Where appends a list predicates to the ChallengeGroupUpdate builder.

type ChallengeGroups

type ChallengeGroups []*ChallengeGroup

ChallengeGroups is a parsable slice of ChallengeGroup.

type ChallengeMutation

type ChallengeMutation struct {
	// contains filtered or unexported fields
}

ChallengeMutation represents an operation that mutates the Challenge nodes in the graph.

func (*ChallengeMutation) AddChallengeGroupIDs

func (m *ChallengeMutation) AddChallengeGroupIDs(ids ...int)

AddChallengeGroupIDs adds the "challenge_group" edge to the ChallengeGroup entity by ids.

func (*ChallengeMutation) AddField

func (m *ChallengeMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ChallengeMutation) AddValue

func (m *ChallengeMutation) AddValue(i int)

AddValue adds i to the "value" field.

func (*ChallengeMutation) AddedEdges

func (m *ChallengeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ChallengeMutation) AddedField

func (m *ChallengeMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ChallengeMutation) AddedFields

func (m *ChallengeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ChallengeMutation) AddedIDs

func (m *ChallengeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ChallengeMutation) AddedValue

func (m *ChallengeMutation) AddedValue() (r int, exists bool)

AddedValue returns the value that was added to the "value" field in this mutation.

func (*ChallengeMutation) ChallengeGroupCleared

func (m *ChallengeMutation) ChallengeGroupCleared() bool

ChallengeGroupCleared reports if the "challenge_group" edge to the ChallengeGroup entity was cleared.

func (*ChallengeMutation) ChallengeGroupIDs

func (m *ChallengeMutation) ChallengeGroupIDs() (ids []int)

ChallengeGroupIDs returns the "challenge_group" edge IDs in the mutation.

func (*ChallengeMutation) ClearChallengeGroup

func (m *ChallengeMutation) ClearChallengeGroup()

ClearChallengeGroup clears the "challenge_group" edge to the ChallengeGroup entity.

func (*ChallengeMutation) ClearEdge

func (m *ChallengeMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ChallengeMutation) ClearField

func (m *ChallengeMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ChallengeMutation) ClearedEdges

func (m *ChallengeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ChallengeMutation) ClearedFields

func (m *ChallengeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ChallengeMutation) Client

func (m ChallengeMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ChallengeMutation) EdgeCleared

func (m *ChallengeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ChallengeMutation) Field

func (m *ChallengeMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ChallengeMutation) FieldCleared

func (m *ChallengeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ChallengeMutation) Fields

func (m *ChallengeMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ChallengeMutation) ID

func (m *ChallengeMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ChallengeMutation) IDs

func (m *ChallengeMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ChallengeMutation) Media

func (m *ChallengeMutation) Media() (r string, exists bool)

Media returns the value of the "media" field in the mutation.

func (*ChallengeMutation) OldField

func (m *ChallengeMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ChallengeMutation) OldMedia

func (m *ChallengeMutation) OldMedia(ctx context.Context) (v string, err error)

OldMedia returns the old "media" field's value of the Challenge entity. If the Challenge object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChallengeMutation) OldPrompt

func (m *ChallengeMutation) OldPrompt(ctx context.Context) (v string, err error)

OldPrompt returns the old "prompt" field's value of the Challenge entity. If the Challenge object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChallengeMutation) OldResponse

func (m *ChallengeMutation) OldResponse(ctx context.Context) (v string, err error)

OldResponse returns the old "response" field's value of the Challenge entity. If the Challenge object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChallengeMutation) OldValue

func (m *ChallengeMutation) OldValue(ctx context.Context) (v int, err error)

OldValue returns the old "value" field's value of the Challenge entity. If the Challenge object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ChallengeMutation) Op

func (m *ChallengeMutation) Op() Op

Op returns the operation name.

func (*ChallengeMutation) Prompt

func (m *ChallengeMutation) Prompt() (r string, exists bool)

Prompt returns the value of the "prompt" field in the mutation.

func (*ChallengeMutation) RemoveChallengeGroupIDs

func (m *ChallengeMutation) RemoveChallengeGroupIDs(ids ...int)

RemoveChallengeGroupIDs removes the "challenge_group" edge to the ChallengeGroup entity by IDs.

func (*ChallengeMutation) RemovedChallengeGroupIDs

func (m *ChallengeMutation) RemovedChallengeGroupIDs() (ids []int)

RemovedChallengeGroup returns the removed IDs of the "challenge_group" edge to the ChallengeGroup entity.

func (*ChallengeMutation) RemovedEdges

func (m *ChallengeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ChallengeMutation) RemovedIDs

func (m *ChallengeMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ChallengeMutation) ResetChallengeGroup

func (m *ChallengeMutation) ResetChallengeGroup()

ResetChallengeGroup resets all changes to the "challenge_group" edge.

func (*ChallengeMutation) ResetEdge

func (m *ChallengeMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ChallengeMutation) ResetField

func (m *ChallengeMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ChallengeMutation) ResetMedia

func (m *ChallengeMutation) ResetMedia()

ResetMedia resets all changes to the "media" field.

func (*ChallengeMutation) ResetPrompt

func (m *ChallengeMutation) ResetPrompt()

ResetPrompt resets all changes to the "prompt" field.

func (*ChallengeMutation) ResetResponse

func (m *ChallengeMutation) ResetResponse()

ResetResponse resets all changes to the "response" field.

func (*ChallengeMutation) ResetValue

func (m *ChallengeMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*ChallengeMutation) Response

func (m *ChallengeMutation) Response() (r string, exists bool)

Response returns the value of the "response" field in the mutation.

func (*ChallengeMutation) SetField

func (m *ChallengeMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ChallengeMutation) SetMedia

func (m *ChallengeMutation) SetMedia(s string)

SetMedia sets the "media" field.

func (*ChallengeMutation) SetOp

func (m *ChallengeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ChallengeMutation) SetPrompt

func (m *ChallengeMutation) SetPrompt(s string)

SetPrompt sets the "prompt" field.

func (*ChallengeMutation) SetResponse

func (m *ChallengeMutation) SetResponse(s string)

SetResponse sets the "response" field.

func (*ChallengeMutation) SetValue

func (m *ChallengeMutation) SetValue(i int)

SetValue sets the "value" field.

func (ChallengeMutation) Tx

func (m ChallengeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ChallengeMutation) Type

func (m *ChallengeMutation) Type() string

Type returns the node type of this mutation (Challenge).

func (*ChallengeMutation) Value

func (m *ChallengeMutation) Value() (r int, exists bool)

Value returns the value of the "value" field in the mutation.

func (*ChallengeMutation) Where

func (m *ChallengeMutation) Where(ps ...predicate.Challenge)

Where appends a list predicates to the ChallengeMutation builder.

func (*ChallengeMutation) WhereP

func (m *ChallengeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ChallengeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ChallengeQuery

type ChallengeQuery struct {
	// contains filtered or unexported fields
}

ChallengeQuery is the builder for querying Challenge entities.

func (*ChallengeQuery) Aggregate

func (cq *ChallengeQuery) Aggregate(fns ...AggregateFunc) *ChallengeSelect

Aggregate returns a ChallengeSelect configured with the given aggregations.

func (*ChallengeQuery) All

func (cq *ChallengeQuery) All(ctx context.Context) ([]*Challenge, error)

All executes the query and returns a list of Challenges.

func (*ChallengeQuery) AllX

func (cq *ChallengeQuery) AllX(ctx context.Context) []*Challenge

AllX is like All, but panics if an error occurs.

func (*ChallengeQuery) Clone

func (cq *ChallengeQuery) Clone() *ChallengeQuery

Clone returns a duplicate of the ChallengeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ChallengeQuery) Count

func (cq *ChallengeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ChallengeQuery) CountX

func (cq *ChallengeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ChallengeQuery) Exist

func (cq *ChallengeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ChallengeQuery) ExistX

func (cq *ChallengeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ChallengeQuery) First

func (cq *ChallengeQuery) First(ctx context.Context) (*Challenge, error)

First returns the first Challenge entity from the query. Returns a *NotFoundError when no Challenge was found.

func (*ChallengeQuery) FirstID

func (cq *ChallengeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Challenge ID from the query. Returns a *NotFoundError when no Challenge ID was found.

func (*ChallengeQuery) FirstIDX

func (cq *ChallengeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ChallengeQuery) FirstX

func (cq *ChallengeQuery) FirstX(ctx context.Context) *Challenge

FirstX is like First, but panics if an error occurs.

func (*ChallengeQuery) GroupBy

func (cq *ChallengeQuery) GroupBy(field string, fields ...string) *ChallengeGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Media string `json:"media,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Challenge.Query().
	GroupBy(challenge.FieldMedia).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ChallengeQuery) IDs

func (cq *ChallengeQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Challenge IDs.

func (*ChallengeQuery) IDsX

func (cq *ChallengeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ChallengeQuery) Limit

func (cq *ChallengeQuery) Limit(limit int) *ChallengeQuery

Limit the number of records to be returned by this query.

func (*ChallengeQuery) Offset

func (cq *ChallengeQuery) Offset(offset int) *ChallengeQuery

Offset to start from.

func (*ChallengeQuery) Only

func (cq *ChallengeQuery) Only(ctx context.Context) (*Challenge, error)

Only returns a single Challenge entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Challenge entity is found. Returns a *NotFoundError when no Challenge entities are found.

func (*ChallengeQuery) OnlyID

func (cq *ChallengeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Challenge ID in the query. Returns a *NotSingularError when more than one Challenge ID is found. Returns a *NotFoundError when no entities are found.

func (*ChallengeQuery) OnlyIDX

func (cq *ChallengeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ChallengeQuery) OnlyX

func (cq *ChallengeQuery) OnlyX(ctx context.Context) *Challenge

OnlyX is like Only, but panics if an error occurs.

func (*ChallengeQuery) Order

Order specifies how the records should be ordered.

func (*ChallengeQuery) QueryChallengeGroup

func (cq *ChallengeQuery) QueryChallengeGroup() *ChallengeGroupQuery

QueryChallengeGroup chains the current query on the "challenge_group" edge.

func (*ChallengeQuery) Select

func (cq *ChallengeQuery) Select(fields ...string) *ChallengeSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Media string `json:"media,omitempty"`
}

client.Challenge.Query().
	Select(challenge.FieldMedia).
	Scan(ctx, &v)

func (*ChallengeQuery) Unique

func (cq *ChallengeQuery) Unique(unique bool) *ChallengeQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ChallengeQuery) Where

Where adds a new predicate for the ChallengeQuery builder.

func (*ChallengeQuery) WithChallengeGroup

func (cq *ChallengeQuery) WithChallengeGroup(opts ...func(*ChallengeGroupQuery)) *ChallengeQuery

WithChallengeGroup tells the query-builder to eager-load the nodes that are connected to the "challenge_group" edge. The optional arguments are used to configure the query builder of the edge.

type ChallengeSelect

type ChallengeSelect struct {
	*ChallengeQuery
	// contains filtered or unexported fields
}

ChallengeSelect is the builder for selecting fields of Challenge entities.

func (*ChallengeSelect) Aggregate

func (cs *ChallengeSelect) Aggregate(fns ...AggregateFunc) *ChallengeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ChallengeSelect) Bool

func (s *ChallengeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ChallengeSelect) BoolX

func (s *ChallengeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ChallengeSelect) Bools

func (s *ChallengeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ChallengeSelect) BoolsX

func (s *ChallengeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ChallengeSelect) Float64

func (s *ChallengeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ChallengeSelect) Float64X

func (s *ChallengeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ChallengeSelect) Float64s

func (s *ChallengeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ChallengeSelect) Float64sX

func (s *ChallengeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ChallengeSelect) Int

func (s *ChallengeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ChallengeSelect) IntX

func (s *ChallengeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ChallengeSelect) Ints

func (s *ChallengeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ChallengeSelect) IntsX

func (s *ChallengeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ChallengeSelect) Scan

func (cs *ChallengeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ChallengeSelect) ScanX

func (s *ChallengeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ChallengeSelect) String

func (s *ChallengeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ChallengeSelect) StringX

func (s *ChallengeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ChallengeSelect) Strings

func (s *ChallengeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ChallengeSelect) StringsX

func (s *ChallengeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ChallengeUpdate

type ChallengeUpdate struct {
	// contains filtered or unexported fields
}

ChallengeUpdate is the builder for updating Challenge entities.

func (*ChallengeUpdate) AddChallengeGroup

func (cu *ChallengeUpdate) AddChallengeGroup(c ...*ChallengeGroup) *ChallengeUpdate

AddChallengeGroup adds the "challenge_group" edges to the ChallengeGroup entity.

func (*ChallengeUpdate) AddChallengeGroupIDs

func (cu *ChallengeUpdate) AddChallengeGroupIDs(ids ...int) *ChallengeUpdate

AddChallengeGroupIDs adds the "challenge_group" edge to the ChallengeGroup entity by IDs.

func (*ChallengeUpdate) AddValue

func (cu *ChallengeUpdate) AddValue(i int) *ChallengeUpdate

AddValue adds i to the "value" field.

func (*ChallengeUpdate) ClearChallengeGroup

func (cu *ChallengeUpdate) ClearChallengeGroup() *ChallengeUpdate

ClearChallengeGroup clears all "challenge_group" edges to the ChallengeGroup entity.

func (*ChallengeUpdate) Exec

func (cu *ChallengeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChallengeUpdate) ExecX

func (cu *ChallengeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeUpdate) Mutation

func (cu *ChallengeUpdate) Mutation() *ChallengeMutation

Mutation returns the ChallengeMutation object of the builder.

func (*ChallengeUpdate) RemoveChallengeGroup

func (cu *ChallengeUpdate) RemoveChallengeGroup(c ...*ChallengeGroup) *ChallengeUpdate

RemoveChallengeGroup removes "challenge_group" edges to ChallengeGroup entities.

func (*ChallengeUpdate) RemoveChallengeGroupIDs

func (cu *ChallengeUpdate) RemoveChallengeGroupIDs(ids ...int) *ChallengeUpdate

RemoveChallengeGroupIDs removes the "challenge_group" edge to ChallengeGroup entities by IDs.

func (*ChallengeUpdate) Save

func (cu *ChallengeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ChallengeUpdate) SaveX

func (cu *ChallengeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ChallengeUpdate) SetMedia

func (cu *ChallengeUpdate) SetMedia(s string) *ChallengeUpdate

SetMedia sets the "media" field.

func (*ChallengeUpdate) SetNillableMedia

func (cu *ChallengeUpdate) SetNillableMedia(s *string) *ChallengeUpdate

SetNillableMedia sets the "media" field if the given value is not nil.

func (*ChallengeUpdate) SetNillablePrompt

func (cu *ChallengeUpdate) SetNillablePrompt(s *string) *ChallengeUpdate

SetNillablePrompt sets the "prompt" field if the given value is not nil.

func (*ChallengeUpdate) SetNillableResponse

func (cu *ChallengeUpdate) SetNillableResponse(s *string) *ChallengeUpdate

SetNillableResponse sets the "response" field if the given value is not nil.

func (*ChallengeUpdate) SetNillableValue

func (cu *ChallengeUpdate) SetNillableValue(i *int) *ChallengeUpdate

SetNillableValue sets the "value" field if the given value is not nil.

func (*ChallengeUpdate) SetPrompt

func (cu *ChallengeUpdate) SetPrompt(s string) *ChallengeUpdate

SetPrompt sets the "prompt" field.

func (*ChallengeUpdate) SetResponse

func (cu *ChallengeUpdate) SetResponse(s string) *ChallengeUpdate

SetResponse sets the "response" field.

func (*ChallengeUpdate) SetValue

func (cu *ChallengeUpdate) SetValue(i int) *ChallengeUpdate

SetValue sets the "value" field.

func (*ChallengeUpdate) Where

Where appends a list predicates to the ChallengeUpdate builder.

type ChallengeUpdateOne

type ChallengeUpdateOne struct {
	// contains filtered or unexported fields
}

ChallengeUpdateOne is the builder for updating a single Challenge entity.

func (*ChallengeUpdateOne) AddChallengeGroup

func (cuo *ChallengeUpdateOne) AddChallengeGroup(c ...*ChallengeGroup) *ChallengeUpdateOne

AddChallengeGroup adds the "challenge_group" edges to the ChallengeGroup entity.

func (*ChallengeUpdateOne) AddChallengeGroupIDs

func (cuo *ChallengeUpdateOne) AddChallengeGroupIDs(ids ...int) *ChallengeUpdateOne

AddChallengeGroupIDs adds the "challenge_group" edge to the ChallengeGroup entity by IDs.

func (*ChallengeUpdateOne) AddValue

func (cuo *ChallengeUpdateOne) AddValue(i int) *ChallengeUpdateOne

AddValue adds i to the "value" field.

func (*ChallengeUpdateOne) ClearChallengeGroup

func (cuo *ChallengeUpdateOne) ClearChallengeGroup() *ChallengeUpdateOne

ClearChallengeGroup clears all "challenge_group" edges to the ChallengeGroup entity.

func (*ChallengeUpdateOne) Exec

func (cuo *ChallengeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ChallengeUpdateOne) ExecX

func (cuo *ChallengeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ChallengeUpdateOne) Mutation

func (cuo *ChallengeUpdateOne) Mutation() *ChallengeMutation

Mutation returns the ChallengeMutation object of the builder.

func (*ChallengeUpdateOne) RemoveChallengeGroup

func (cuo *ChallengeUpdateOne) RemoveChallengeGroup(c ...*ChallengeGroup) *ChallengeUpdateOne

RemoveChallengeGroup removes "challenge_group" edges to ChallengeGroup entities.

func (*ChallengeUpdateOne) RemoveChallengeGroupIDs

func (cuo *ChallengeUpdateOne) RemoveChallengeGroupIDs(ids ...int) *ChallengeUpdateOne

RemoveChallengeGroupIDs removes the "challenge_group" edge to ChallengeGroup entities by IDs.

func (*ChallengeUpdateOne) Save

func (cuo *ChallengeUpdateOne) Save(ctx context.Context) (*Challenge, error)

Save executes the query and returns the updated Challenge entity.

func (*ChallengeUpdateOne) SaveX

func (cuo *ChallengeUpdateOne) SaveX(ctx context.Context) *Challenge

SaveX is like Save, but panics if an error occurs.

func (*ChallengeUpdateOne) Select

func (cuo *ChallengeUpdateOne) Select(field string, fields ...string) *ChallengeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ChallengeUpdateOne) SetMedia

func (cuo *ChallengeUpdateOne) SetMedia(s string) *ChallengeUpdateOne

SetMedia sets the "media" field.

func (*ChallengeUpdateOne) SetNillableMedia

func (cuo *ChallengeUpdateOne) SetNillableMedia(s *string) *ChallengeUpdateOne

SetNillableMedia sets the "media" field if the given value is not nil.

func (*ChallengeUpdateOne) SetNillablePrompt

func (cuo *ChallengeUpdateOne) SetNillablePrompt(s *string) *ChallengeUpdateOne

SetNillablePrompt sets the "prompt" field if the given value is not nil.

func (*ChallengeUpdateOne) SetNillableResponse

func (cuo *ChallengeUpdateOne) SetNillableResponse(s *string) *ChallengeUpdateOne

SetNillableResponse sets the "response" field if the given value is not nil.

func (*ChallengeUpdateOne) SetNillableValue

func (cuo *ChallengeUpdateOne) SetNillableValue(i *int) *ChallengeUpdateOne

SetNillableValue sets the "value" field if the given value is not nil.

func (*ChallengeUpdateOne) SetPrompt

func (cuo *ChallengeUpdateOne) SetPrompt(s string) *ChallengeUpdateOne

SetPrompt sets the "prompt" field.

func (*ChallengeUpdateOne) SetResponse

func (cuo *ChallengeUpdateOne) SetResponse(s string) *ChallengeUpdateOne

SetResponse sets the "response" field.

func (*ChallengeUpdateOne) SetValue

func (cuo *ChallengeUpdateOne) SetValue(i int) *ChallengeUpdateOne

SetValue sets the "value" field.

func (*ChallengeUpdateOne) Where

Where appends a list predicates to the ChallengeUpdate builder.

type Challenges

type Challenges []*Challenge

Challenges is a parsable slice of Challenge.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Category is the client for interacting with the Category builders.
	Category *CategoryClient
	// Challenge is the client for interacting with the Challenge builders.
	Challenge *ChallengeClient
	// ChallengeGroup is the client for interacting with the ChallengeGroup builders.
	ChallengeGroup *ChallengeGroupClient
	// Episode is the client for interacting with the Episode builders.
	Episode *EpisodeClient
	// EpisodeRound is the client for interacting with the EpisodeRound builders.
	EpisodeRound *EpisodeRoundClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Category.
	Query().
	Count(ctx)

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

type ConstraintError struct {
	// contains filtered or unexported fields
}

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Episode

type Episode struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Aired holds the value of the "aired" field.
	Aired time.Time `json:"aired,omitempty"`
	// Difficulty holds the value of the "difficulty" field.
	Difficulty episode.Difficulty `json:"difficulty,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EpisodeQuery when eager-loading is set.
	Edges EpisodeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Episode is the model entity for the Episode schema.

func (*Episode) QueryRounds

func (e *Episode) QueryRounds() *EpisodeRoundQuery

QueryRounds queries the "rounds" edge of the Episode entity.

func (*Episode) String

func (e *Episode) String() string

String implements the fmt.Stringer.

func (*Episode) Unwrap

func (e *Episode) Unwrap() *Episode

Unwrap unwraps the Episode entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Episode) Update

func (e *Episode) Update() *EpisodeUpdateOne

Update returns a builder for updating this Episode. Note that you need to call Episode.Unwrap() before calling this method if this Episode was returned from a transaction, and the transaction was committed or rolled back.

func (*Episode) Value

func (e *Episode) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Episode. This includes values selected through modifiers, order, etc.

type EpisodeClient

type EpisodeClient struct {
	// contains filtered or unexported fields
}

EpisodeClient is a client for the Episode schema.

func NewEpisodeClient

func NewEpisodeClient(c config) *EpisodeClient

NewEpisodeClient returns a client for the Episode from the given config.

func (*EpisodeClient) Create

func (c *EpisodeClient) Create() *EpisodeCreate

Create returns a builder for creating a Episode entity.

func (*EpisodeClient) CreateBulk

func (c *EpisodeClient) CreateBulk(builders ...*EpisodeCreate) *EpisodeCreateBulk

CreateBulk returns a builder for creating a bulk of Episode entities.

func (*EpisodeClient) Delete

func (c *EpisodeClient) Delete() *EpisodeDelete

Delete returns a delete builder for Episode.

func (*EpisodeClient) DeleteOne

func (c *EpisodeClient) DeleteOne(e *Episode) *EpisodeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EpisodeClient) DeleteOneID

func (c *EpisodeClient) DeleteOneID(id int) *EpisodeDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*EpisodeClient) Get

func (c *EpisodeClient) Get(ctx context.Context, id int) (*Episode, error)

Get returns a Episode entity by its id.

func (*EpisodeClient) GetX

func (c *EpisodeClient) GetX(ctx context.Context, id int) *Episode

GetX is like Get, but panics if an error occurs.

func (*EpisodeClient) Hooks

func (c *EpisodeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*EpisodeClient) Intercept

func (c *EpisodeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `episode.Intercept(f(g(h())))`.

func (*EpisodeClient) Interceptors

func (c *EpisodeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*EpisodeClient) MapCreateBulk

func (c *EpisodeClient) MapCreateBulk(slice any, setFunc func(*EpisodeCreate, int)) *EpisodeCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*EpisodeClient) Query

func (c *EpisodeClient) Query() *EpisodeQuery

Query returns a query builder for Episode.

func (*EpisodeClient) QueryRounds

func (c *EpisodeClient) QueryRounds(e *Episode) *EpisodeRoundQuery

QueryRounds queries the rounds edge of a Episode.

func (*EpisodeClient) Update

func (c *EpisodeClient) Update() *EpisodeUpdate

Update returns an update builder for Episode.

func (*EpisodeClient) UpdateOne

func (c *EpisodeClient) UpdateOne(e *Episode) *EpisodeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EpisodeClient) UpdateOneID

func (c *EpisodeClient) UpdateOneID(id int) *EpisodeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EpisodeClient) Use

func (c *EpisodeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `episode.Hooks(f(g(h())))`.

type EpisodeCreate

type EpisodeCreate struct {
	// contains filtered or unexported fields
}

EpisodeCreate is the builder for creating a Episode entity.

func (*EpisodeCreate) AddRoundIDs

func (ec *EpisodeCreate) AddRoundIDs(ids ...int) *EpisodeCreate

AddRoundIDs adds the "rounds" edge to the EpisodeRound entity by IDs.

func (*EpisodeCreate) AddRounds

func (ec *EpisodeCreate) AddRounds(e ...*EpisodeRound) *EpisodeCreate

AddRounds adds the "rounds" edges to the EpisodeRound entity.

func (*EpisodeCreate) Exec

func (ec *EpisodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EpisodeCreate) ExecX

func (ec *EpisodeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeCreate) Mutation

func (ec *EpisodeCreate) Mutation() *EpisodeMutation

Mutation returns the EpisodeMutation object of the builder.

func (*EpisodeCreate) Save

func (ec *EpisodeCreate) Save(ctx context.Context) (*Episode, error)

Save creates the Episode in the database.

func (*EpisodeCreate) SaveX

func (ec *EpisodeCreate) SaveX(ctx context.Context) *Episode

SaveX calls Save and panics if Save returns an error.

func (*EpisodeCreate) SetAired

func (ec *EpisodeCreate) SetAired(t time.Time) *EpisodeCreate

SetAired sets the "aired" field.

func (*EpisodeCreate) SetDifficulty

func (ec *EpisodeCreate) SetDifficulty(e episode.Difficulty) *EpisodeCreate

SetDifficulty sets the "difficulty" field.

type EpisodeCreateBulk

type EpisodeCreateBulk struct {
	// contains filtered or unexported fields
}

EpisodeCreateBulk is the builder for creating many Episode entities in bulk.

func (*EpisodeCreateBulk) Exec

func (ecb *EpisodeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EpisodeCreateBulk) ExecX

func (ecb *EpisodeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeCreateBulk) Save

func (ecb *EpisodeCreateBulk) Save(ctx context.Context) ([]*Episode, error)

Save creates the Episode entities in the database.

func (*EpisodeCreateBulk) SaveX

func (ecb *EpisodeCreateBulk) SaveX(ctx context.Context) []*Episode

SaveX is like Save, but panics if an error occurs.

type EpisodeDelete

type EpisodeDelete struct {
	// contains filtered or unexported fields
}

EpisodeDelete is the builder for deleting a Episode entity.

func (*EpisodeDelete) Exec

func (ed *EpisodeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*EpisodeDelete) ExecX

func (ed *EpisodeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeDelete) Where

func (ed *EpisodeDelete) Where(ps ...predicate.Episode) *EpisodeDelete

Where appends a list predicates to the EpisodeDelete builder.

type EpisodeDeleteOne

type EpisodeDeleteOne struct {
	// contains filtered or unexported fields
}

EpisodeDeleteOne is the builder for deleting a single Episode entity.

func (*EpisodeDeleteOne) Exec

func (edo *EpisodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EpisodeDeleteOne) ExecX

func (edo *EpisodeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeDeleteOne) Where

Where appends a list predicates to the EpisodeDelete builder.

type EpisodeEdges

type EpisodeEdges struct {
	// Rounds holds the value of the rounds edge.
	Rounds []*EpisodeRound `json:"rounds,omitempty"`
	// contains filtered or unexported fields
}

EpisodeEdges holds the relations/edges for other nodes in the graph.

func (EpisodeEdges) RoundsOrErr

func (e EpisodeEdges) RoundsOrErr() ([]*EpisodeRound, error)

RoundsOrErr returns the Rounds value or an error if the edge was not loaded in eager-loading.

type EpisodeGroupBy

type EpisodeGroupBy struct {
	// contains filtered or unexported fields
}

EpisodeGroupBy is the group-by builder for Episode entities.

func (*EpisodeGroupBy) Aggregate

func (egb *EpisodeGroupBy) Aggregate(fns ...AggregateFunc) *EpisodeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*EpisodeGroupBy) Bool

func (s *EpisodeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EpisodeGroupBy) BoolX

func (s *EpisodeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EpisodeGroupBy) Bools

func (s *EpisodeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EpisodeGroupBy) BoolsX

func (s *EpisodeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EpisodeGroupBy) Float64

func (s *EpisodeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EpisodeGroupBy) Float64X

func (s *EpisodeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EpisodeGroupBy) Float64s

func (s *EpisodeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EpisodeGroupBy) Float64sX

func (s *EpisodeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EpisodeGroupBy) Int

func (s *EpisodeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EpisodeGroupBy) IntX

func (s *EpisodeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EpisodeGroupBy) Ints

func (s *EpisodeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EpisodeGroupBy) IntsX

func (s *EpisodeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EpisodeGroupBy) Scan

func (egb *EpisodeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EpisodeGroupBy) ScanX

func (s *EpisodeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EpisodeGroupBy) String

func (s *EpisodeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EpisodeGroupBy) StringX

func (s *EpisodeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EpisodeGroupBy) Strings

func (s *EpisodeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EpisodeGroupBy) StringsX

func (s *EpisodeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EpisodeMutation

type EpisodeMutation struct {
	// contains filtered or unexported fields
}

EpisodeMutation represents an operation that mutates the Episode nodes in the graph.

func (*EpisodeMutation) AddField

func (m *EpisodeMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*EpisodeMutation) AddRoundIDs

func (m *EpisodeMutation) AddRoundIDs(ids ...int)

AddRoundIDs adds the "rounds" edge to the EpisodeRound entity by ids.

func (*EpisodeMutation) AddedEdges

func (m *EpisodeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*EpisodeMutation) AddedField

func (m *EpisodeMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*EpisodeMutation) AddedFields

func (m *EpisodeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*EpisodeMutation) AddedIDs

func (m *EpisodeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*EpisodeMutation) Aired

func (m *EpisodeMutation) Aired() (r time.Time, exists bool)

Aired returns the value of the "aired" field in the mutation.

func (*EpisodeMutation) ClearEdge

func (m *EpisodeMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*EpisodeMutation) ClearField

func (m *EpisodeMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*EpisodeMutation) ClearRounds

func (m *EpisodeMutation) ClearRounds()

ClearRounds clears the "rounds" edge to the EpisodeRound entity.

func (*EpisodeMutation) ClearedEdges

func (m *EpisodeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*EpisodeMutation) ClearedFields

func (m *EpisodeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (EpisodeMutation) Client

func (m EpisodeMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*EpisodeMutation) Difficulty

func (m *EpisodeMutation) Difficulty() (r episode.Difficulty, exists bool)

Difficulty returns the value of the "difficulty" field in the mutation.

func (*EpisodeMutation) EdgeCleared

func (m *EpisodeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*EpisodeMutation) Field

func (m *EpisodeMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*EpisodeMutation) FieldCleared

func (m *EpisodeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*EpisodeMutation) Fields

func (m *EpisodeMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*EpisodeMutation) ID

func (m *EpisodeMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*EpisodeMutation) IDs

func (m *EpisodeMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*EpisodeMutation) OldAired

func (m *EpisodeMutation) OldAired(ctx context.Context) (v time.Time, err error)

OldAired returns the old "aired" field's value of the Episode entity. If the Episode object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*EpisodeMutation) OldDifficulty

func (m *EpisodeMutation) OldDifficulty(ctx context.Context) (v episode.Difficulty, err error)

OldDifficulty returns the old "difficulty" field's value of the Episode entity. If the Episode object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*EpisodeMutation) OldField

func (m *EpisodeMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*EpisodeMutation) Op

func (m *EpisodeMutation) Op() Op

Op returns the operation name.

func (*EpisodeMutation) RemoveRoundIDs

func (m *EpisodeMutation) RemoveRoundIDs(ids ...int)

RemoveRoundIDs removes the "rounds" edge to the EpisodeRound entity by IDs.

func (*EpisodeMutation) RemovedEdges

func (m *EpisodeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*EpisodeMutation) RemovedIDs

func (m *EpisodeMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*EpisodeMutation) RemovedRoundsIDs

func (m *EpisodeMutation) RemovedRoundsIDs() (ids []int)

RemovedRounds returns the removed IDs of the "rounds" edge to the EpisodeRound entity.

func (*EpisodeMutation) ResetAired

func (m *EpisodeMutation) ResetAired()

ResetAired resets all changes to the "aired" field.

func (*EpisodeMutation) ResetDifficulty

func (m *EpisodeMutation) ResetDifficulty()

ResetDifficulty resets all changes to the "difficulty" field.

func (*EpisodeMutation) ResetEdge

func (m *EpisodeMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*EpisodeMutation) ResetField

func (m *EpisodeMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*EpisodeMutation) ResetRounds

func (m *EpisodeMutation) ResetRounds()

ResetRounds resets all changes to the "rounds" edge.

func (*EpisodeMutation) RoundsCleared

func (m *EpisodeMutation) RoundsCleared() bool

RoundsCleared reports if the "rounds" edge to the EpisodeRound entity was cleared.

func (*EpisodeMutation) RoundsIDs

func (m *EpisodeMutation) RoundsIDs() (ids []int)

RoundsIDs returns the "rounds" edge IDs in the mutation.

func (*EpisodeMutation) SetAired

func (m *EpisodeMutation) SetAired(t time.Time)

SetAired sets the "aired" field.

func (*EpisodeMutation) SetDifficulty

func (m *EpisodeMutation) SetDifficulty(e episode.Difficulty)

SetDifficulty sets the "difficulty" field.

func (*EpisodeMutation) SetField

func (m *EpisodeMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*EpisodeMutation) SetOp

func (m *EpisodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (EpisodeMutation) Tx

func (m EpisodeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*EpisodeMutation) Type

func (m *EpisodeMutation) Type() string

Type returns the node type of this mutation (Episode).

func (*EpisodeMutation) Where

func (m *EpisodeMutation) Where(ps ...predicate.Episode)

Where appends a list predicates to the EpisodeMutation builder.

func (*EpisodeMutation) WhereP

func (m *EpisodeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the EpisodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type EpisodeQuery

type EpisodeQuery struct {
	// contains filtered or unexported fields
}

EpisodeQuery is the builder for querying Episode entities.

func (*EpisodeQuery) Aggregate

func (eq *EpisodeQuery) Aggregate(fns ...AggregateFunc) *EpisodeSelect

Aggregate returns a EpisodeSelect configured with the given aggregations.

func (*EpisodeQuery) All

func (eq *EpisodeQuery) All(ctx context.Context) ([]*Episode, error)

All executes the query and returns a list of Episodes.

func (*EpisodeQuery) AllX

func (eq *EpisodeQuery) AllX(ctx context.Context) []*Episode

AllX is like All, but panics if an error occurs.

func (*EpisodeQuery) Clone

func (eq *EpisodeQuery) Clone() *EpisodeQuery

Clone returns a duplicate of the EpisodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*EpisodeQuery) Count

func (eq *EpisodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EpisodeQuery) CountX

func (eq *EpisodeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*EpisodeQuery) Exist

func (eq *EpisodeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*EpisodeQuery) ExistX

func (eq *EpisodeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*EpisodeQuery) First

func (eq *EpisodeQuery) First(ctx context.Context) (*Episode, error)

First returns the first Episode entity from the query. Returns a *NotFoundError when no Episode was found.

func (*EpisodeQuery) FirstID

func (eq *EpisodeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Episode ID from the query. Returns a *NotFoundError when no Episode ID was found.

func (*EpisodeQuery) FirstIDX

func (eq *EpisodeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*EpisodeQuery) FirstX

func (eq *EpisodeQuery) FirstX(ctx context.Context) *Episode

FirstX is like First, but panics if an error occurs.

func (*EpisodeQuery) GroupBy

func (eq *EpisodeQuery) GroupBy(field string, fields ...string) *EpisodeGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Aired time.Time `json:"aired,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Episode.Query().
	GroupBy(episode.FieldAired).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EpisodeQuery) IDs

func (eq *EpisodeQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Episode IDs.

func (*EpisodeQuery) IDsX

func (eq *EpisodeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*EpisodeQuery) Limit

func (eq *EpisodeQuery) Limit(limit int) *EpisodeQuery

Limit the number of records to be returned by this query.

func (*EpisodeQuery) Offset

func (eq *EpisodeQuery) Offset(offset int) *EpisodeQuery

Offset to start from.

func (*EpisodeQuery) Only

func (eq *EpisodeQuery) Only(ctx context.Context) (*Episode, error)

Only returns a single Episode entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Episode entity is found. Returns a *NotFoundError when no Episode entities are found.

func (*EpisodeQuery) OnlyID

func (eq *EpisodeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Episode ID in the query. Returns a *NotSingularError when more than one Episode ID is found. Returns a *NotFoundError when no entities are found.

func (*EpisodeQuery) OnlyIDX

func (eq *EpisodeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*EpisodeQuery) OnlyX

func (eq *EpisodeQuery) OnlyX(ctx context.Context) *Episode

OnlyX is like Only, but panics if an error occurs.

func (*EpisodeQuery) Order

func (eq *EpisodeQuery) Order(o ...episode.OrderOption) *EpisodeQuery

Order specifies how the records should be ordered.

func (*EpisodeQuery) QueryRounds

func (eq *EpisodeQuery) QueryRounds() *EpisodeRoundQuery

QueryRounds chains the current query on the "rounds" edge.

func (*EpisodeQuery) Select

func (eq *EpisodeQuery) Select(fields ...string) *EpisodeSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Aired time.Time `json:"aired,omitempty"`
}

client.Episode.Query().
	Select(episode.FieldAired).
	Scan(ctx, &v)

func (*EpisodeQuery) Unique

func (eq *EpisodeQuery) Unique(unique bool) *EpisodeQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*EpisodeQuery) Where

func (eq *EpisodeQuery) Where(ps ...predicate.Episode) *EpisodeQuery

Where adds a new predicate for the EpisodeQuery builder.

func (*EpisodeQuery) WithRounds

func (eq *EpisodeQuery) WithRounds(opts ...func(*EpisodeRoundQuery)) *EpisodeQuery

WithRounds tells the query-builder to eager-load the nodes that are connected to the "rounds" edge. The optional arguments are used to configure the query builder of the edge.

type EpisodeRound

type EpisodeRound struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Round holds the value of the "round" field.
	Round episoderound.Round `json:"round,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EpisodeRoundQuery when eager-loading is set.
	Edges EpisodeRoundEdges `json:"edges"`
	// contains filtered or unexported fields
}

EpisodeRound is the model entity for the EpisodeRound schema.

func (*EpisodeRound) QueryCategories

func (er *EpisodeRound) QueryCategories() *ChallengeGroupQuery

QueryCategories queries the "categories" edge of the EpisodeRound entity.

func (*EpisodeRound) QueryEpisode

func (er *EpisodeRound) QueryEpisode() *EpisodeQuery

QueryEpisode queries the "episode" edge of the EpisodeRound entity.

func (*EpisodeRound) String

func (er *EpisodeRound) String() string

String implements the fmt.Stringer.

func (*EpisodeRound) Unwrap

func (er *EpisodeRound) Unwrap() *EpisodeRound

Unwrap unwraps the EpisodeRound entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*EpisodeRound) Update

func (er *EpisodeRound) Update() *EpisodeRoundUpdateOne

Update returns a builder for updating this EpisodeRound. Note that you need to call EpisodeRound.Unwrap() before calling this method if this EpisodeRound was returned from a transaction, and the transaction was committed or rolled back.

func (*EpisodeRound) Value

func (er *EpisodeRound) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the EpisodeRound. This includes values selected through modifiers, order, etc.

type EpisodeRoundClient

type EpisodeRoundClient struct {
	// contains filtered or unexported fields
}

EpisodeRoundClient is a client for the EpisodeRound schema.

func NewEpisodeRoundClient

func NewEpisodeRoundClient(c config) *EpisodeRoundClient

NewEpisodeRoundClient returns a client for the EpisodeRound from the given config.

func (*EpisodeRoundClient) Create

Create returns a builder for creating a EpisodeRound entity.

func (*EpisodeRoundClient) CreateBulk

func (c *EpisodeRoundClient) CreateBulk(builders ...*EpisodeRoundCreate) *EpisodeRoundCreateBulk

CreateBulk returns a builder for creating a bulk of EpisodeRound entities.

func (*EpisodeRoundClient) Delete

Delete returns a delete builder for EpisodeRound.

func (*EpisodeRoundClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EpisodeRoundClient) DeleteOneID

func (c *EpisodeRoundClient) DeleteOneID(id int) *EpisodeRoundDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*EpisodeRoundClient) Get

Get returns a EpisodeRound entity by its id.

func (*EpisodeRoundClient) GetX

GetX is like Get, but panics if an error occurs.

func (*EpisodeRoundClient) Hooks

func (c *EpisodeRoundClient) Hooks() []Hook

Hooks returns the client hooks.

func (*EpisodeRoundClient) Intercept

func (c *EpisodeRoundClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `episoderound.Intercept(f(g(h())))`.

func (*EpisodeRoundClient) Interceptors

func (c *EpisodeRoundClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*EpisodeRoundClient) MapCreateBulk

func (c *EpisodeRoundClient) MapCreateBulk(slice any, setFunc func(*EpisodeRoundCreate, int)) *EpisodeRoundCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*EpisodeRoundClient) Query

Query returns a query builder for EpisodeRound.

func (*EpisodeRoundClient) QueryCategories

func (c *EpisodeRoundClient) QueryCategories(er *EpisodeRound) *ChallengeGroupQuery

QueryCategories queries the categories edge of a EpisodeRound.

func (*EpisodeRoundClient) QueryEpisode

func (c *EpisodeRoundClient) QueryEpisode(er *EpisodeRound) *EpisodeQuery

QueryEpisode queries the episode edge of a EpisodeRound.

func (*EpisodeRoundClient) Update

Update returns an update builder for EpisodeRound.

func (*EpisodeRoundClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*EpisodeRoundClient) UpdateOneID

func (c *EpisodeRoundClient) UpdateOneID(id int) *EpisodeRoundUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EpisodeRoundClient) Use

func (c *EpisodeRoundClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `episoderound.Hooks(f(g(h())))`.

type EpisodeRoundCreate

type EpisodeRoundCreate struct {
	// contains filtered or unexported fields
}

EpisodeRoundCreate is the builder for creating a EpisodeRound entity.

func (*EpisodeRoundCreate) AddCategories

func (erc *EpisodeRoundCreate) AddCategories(c ...*ChallengeGroup) *EpisodeRoundCreate

AddCategories adds the "categories" edges to the ChallengeGroup entity.

func (*EpisodeRoundCreate) AddCategoryIDs

func (erc *EpisodeRoundCreate) AddCategoryIDs(ids ...int) *EpisodeRoundCreate

AddCategoryIDs adds the "categories" edge to the ChallengeGroup entity by IDs.

func (*EpisodeRoundCreate) AddEpisode

func (erc *EpisodeRoundCreate) AddEpisode(e ...*Episode) *EpisodeRoundCreate

AddEpisode adds the "episode" edges to the Episode entity.

func (*EpisodeRoundCreate) AddEpisodeIDs

func (erc *EpisodeRoundCreate) AddEpisodeIDs(ids ...int) *EpisodeRoundCreate

AddEpisodeIDs adds the "episode" edge to the Episode entity by IDs.

func (*EpisodeRoundCreate) Exec

func (erc *EpisodeRoundCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EpisodeRoundCreate) ExecX

func (erc *EpisodeRoundCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeRoundCreate) Mutation

func (erc *EpisodeRoundCreate) Mutation() *EpisodeRoundMutation

Mutation returns the EpisodeRoundMutation object of the builder.

func (*EpisodeRoundCreate) Save

Save creates the EpisodeRound in the database.

func (*EpisodeRoundCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*EpisodeRoundCreate) SetRound

SetRound sets the "round" field.

type EpisodeRoundCreateBulk

type EpisodeRoundCreateBulk struct {
	// contains filtered or unexported fields
}

EpisodeRoundCreateBulk is the builder for creating many EpisodeRound entities in bulk.

func (*EpisodeRoundCreateBulk) Exec

func (ercb *EpisodeRoundCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EpisodeRoundCreateBulk) ExecX

func (ercb *EpisodeRoundCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeRoundCreateBulk) Save

Save creates the EpisodeRound entities in the database.

func (*EpisodeRoundCreateBulk) SaveX

func (ercb *EpisodeRoundCreateBulk) SaveX(ctx context.Context) []*EpisodeRound

SaveX is like Save, but panics if an error occurs.

type EpisodeRoundDelete

type EpisodeRoundDelete struct {
	// contains filtered or unexported fields
}

EpisodeRoundDelete is the builder for deleting a EpisodeRound entity.

func (*EpisodeRoundDelete) Exec

func (erd *EpisodeRoundDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*EpisodeRoundDelete) ExecX

func (erd *EpisodeRoundDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeRoundDelete) Where

Where appends a list predicates to the EpisodeRoundDelete builder.

type EpisodeRoundDeleteOne

type EpisodeRoundDeleteOne struct {
	// contains filtered or unexported fields
}

EpisodeRoundDeleteOne is the builder for deleting a single EpisodeRound entity.

func (*EpisodeRoundDeleteOne) Exec

func (erdo *EpisodeRoundDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EpisodeRoundDeleteOne) ExecX

func (erdo *EpisodeRoundDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeRoundDeleteOne) Where

Where appends a list predicates to the EpisodeRoundDelete builder.

type EpisodeRoundEdges

type EpisodeRoundEdges struct {
	// Categories holds the value of the categories edge.
	Categories []*ChallengeGroup `json:"categories,omitempty"`
	// Episode holds the value of the episode edge.
	Episode []*Episode `json:"episode,omitempty"`
	// contains filtered or unexported fields
}

EpisodeRoundEdges holds the relations/edges for other nodes in the graph.

func (EpisodeRoundEdges) CategoriesOrErr

func (e EpisodeRoundEdges) CategoriesOrErr() ([]*ChallengeGroup, error)

CategoriesOrErr returns the Categories value or an error if the edge was not loaded in eager-loading.

func (EpisodeRoundEdges) EpisodeOrErr

func (e EpisodeRoundEdges) EpisodeOrErr() ([]*Episode, error)

EpisodeOrErr returns the Episode value or an error if the edge was not loaded in eager-loading.

type EpisodeRoundGroupBy

type EpisodeRoundGroupBy struct {
	// contains filtered or unexported fields
}

EpisodeRoundGroupBy is the group-by builder for EpisodeRound entities.

func (*EpisodeRoundGroupBy) Aggregate

func (ergb *EpisodeRoundGroupBy) Aggregate(fns ...AggregateFunc) *EpisodeRoundGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*EpisodeRoundGroupBy) Bool

func (s *EpisodeRoundGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundGroupBy) BoolX

func (s *EpisodeRoundGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EpisodeRoundGroupBy) Bools

func (s *EpisodeRoundGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundGroupBy) BoolsX

func (s *EpisodeRoundGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EpisodeRoundGroupBy) Float64

func (s *EpisodeRoundGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundGroupBy) Float64X

func (s *EpisodeRoundGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EpisodeRoundGroupBy) Float64s

func (s *EpisodeRoundGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundGroupBy) Float64sX

func (s *EpisodeRoundGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EpisodeRoundGroupBy) Int

func (s *EpisodeRoundGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundGroupBy) IntX

func (s *EpisodeRoundGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EpisodeRoundGroupBy) Ints

func (s *EpisodeRoundGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundGroupBy) IntsX

func (s *EpisodeRoundGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EpisodeRoundGroupBy) Scan

func (ergb *EpisodeRoundGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EpisodeRoundGroupBy) ScanX

func (s *EpisodeRoundGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EpisodeRoundGroupBy) String

func (s *EpisodeRoundGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundGroupBy) StringX

func (s *EpisodeRoundGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EpisodeRoundGroupBy) Strings

func (s *EpisodeRoundGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundGroupBy) StringsX

func (s *EpisodeRoundGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EpisodeRoundMutation

type EpisodeRoundMutation struct {
	// contains filtered or unexported fields
}

EpisodeRoundMutation represents an operation that mutates the EpisodeRound nodes in the graph.

func (*EpisodeRoundMutation) AddCategoryIDs

func (m *EpisodeRoundMutation) AddCategoryIDs(ids ...int)

AddCategoryIDs adds the "categories" edge to the ChallengeGroup entity by ids.

func (*EpisodeRoundMutation) AddEpisodeIDs

func (m *EpisodeRoundMutation) AddEpisodeIDs(ids ...int)

AddEpisodeIDs adds the "episode" edge to the Episode entity by ids.

func (*EpisodeRoundMutation) AddField

func (m *EpisodeRoundMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*EpisodeRoundMutation) AddedEdges

func (m *EpisodeRoundMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*EpisodeRoundMutation) AddedField

func (m *EpisodeRoundMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*EpisodeRoundMutation) AddedFields

func (m *EpisodeRoundMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*EpisodeRoundMutation) AddedIDs

func (m *EpisodeRoundMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*EpisodeRoundMutation) CategoriesCleared

func (m *EpisodeRoundMutation) CategoriesCleared() bool

CategoriesCleared reports if the "categories" edge to the ChallengeGroup entity was cleared.

func (*EpisodeRoundMutation) CategoriesIDs

func (m *EpisodeRoundMutation) CategoriesIDs() (ids []int)

CategoriesIDs returns the "categories" edge IDs in the mutation.

func (*EpisodeRoundMutation) ClearCategories

func (m *EpisodeRoundMutation) ClearCategories()

ClearCategories clears the "categories" edge to the ChallengeGroup entity.

func (*EpisodeRoundMutation) ClearEdge

func (m *EpisodeRoundMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*EpisodeRoundMutation) ClearEpisode

func (m *EpisodeRoundMutation) ClearEpisode()

ClearEpisode clears the "episode" edge to the Episode entity.

func (*EpisodeRoundMutation) ClearField

func (m *EpisodeRoundMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*EpisodeRoundMutation) ClearedEdges

func (m *EpisodeRoundMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*EpisodeRoundMutation) ClearedFields

func (m *EpisodeRoundMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (EpisodeRoundMutation) Client

func (m EpisodeRoundMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*EpisodeRoundMutation) EdgeCleared

func (m *EpisodeRoundMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*EpisodeRoundMutation) EpisodeCleared

func (m *EpisodeRoundMutation) EpisodeCleared() bool

EpisodeCleared reports if the "episode" edge to the Episode entity was cleared.

func (*EpisodeRoundMutation) EpisodeIDs

func (m *EpisodeRoundMutation) EpisodeIDs() (ids []int)

EpisodeIDs returns the "episode" edge IDs in the mutation.

func (*EpisodeRoundMutation) Field

func (m *EpisodeRoundMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*EpisodeRoundMutation) FieldCleared

func (m *EpisodeRoundMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*EpisodeRoundMutation) Fields

func (m *EpisodeRoundMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*EpisodeRoundMutation) ID

func (m *EpisodeRoundMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*EpisodeRoundMutation) IDs

func (m *EpisodeRoundMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*EpisodeRoundMutation) OldField

func (m *EpisodeRoundMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*EpisodeRoundMutation) OldRound

func (m *EpisodeRoundMutation) OldRound(ctx context.Context) (v episoderound.Round, err error)

OldRound returns the old "round" field's value of the EpisodeRound entity. If the EpisodeRound object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*EpisodeRoundMutation) Op

func (m *EpisodeRoundMutation) Op() Op

Op returns the operation name.

func (*EpisodeRoundMutation) RemoveCategoryIDs

func (m *EpisodeRoundMutation) RemoveCategoryIDs(ids ...int)

RemoveCategoryIDs removes the "categories" edge to the ChallengeGroup entity by IDs.

func (*EpisodeRoundMutation) RemoveEpisodeIDs

func (m *EpisodeRoundMutation) RemoveEpisodeIDs(ids ...int)

RemoveEpisodeIDs removes the "episode" edge to the Episode entity by IDs.

func (*EpisodeRoundMutation) RemovedCategoriesIDs

func (m *EpisodeRoundMutation) RemovedCategoriesIDs() (ids []int)

RemovedCategories returns the removed IDs of the "categories" edge to the ChallengeGroup entity.

func (*EpisodeRoundMutation) RemovedEdges

func (m *EpisodeRoundMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*EpisodeRoundMutation) RemovedEpisodeIDs

func (m *EpisodeRoundMutation) RemovedEpisodeIDs() (ids []int)

RemovedEpisode returns the removed IDs of the "episode" edge to the Episode entity.

func (*EpisodeRoundMutation) RemovedIDs

func (m *EpisodeRoundMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*EpisodeRoundMutation) ResetCategories

func (m *EpisodeRoundMutation) ResetCategories()

ResetCategories resets all changes to the "categories" edge.

func (*EpisodeRoundMutation) ResetEdge

func (m *EpisodeRoundMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*EpisodeRoundMutation) ResetEpisode

func (m *EpisodeRoundMutation) ResetEpisode()

ResetEpisode resets all changes to the "episode" edge.

func (*EpisodeRoundMutation) ResetField

func (m *EpisodeRoundMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*EpisodeRoundMutation) ResetRound

func (m *EpisodeRoundMutation) ResetRound()

ResetRound resets all changes to the "round" field.

func (*EpisodeRoundMutation) Round

func (m *EpisodeRoundMutation) Round() (r episoderound.Round, exists bool)

Round returns the value of the "round" field in the mutation.

func (*EpisodeRoundMutation) SetField

func (m *EpisodeRoundMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*EpisodeRoundMutation) SetOp

func (m *EpisodeRoundMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EpisodeRoundMutation) SetRound

func (m *EpisodeRoundMutation) SetRound(e episoderound.Round)

SetRound sets the "round" field.

func (EpisodeRoundMutation) Tx

func (m EpisodeRoundMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*EpisodeRoundMutation) Type

func (m *EpisodeRoundMutation) Type() string

Type returns the node type of this mutation (EpisodeRound).

func (*EpisodeRoundMutation) Where

Where appends a list predicates to the EpisodeRoundMutation builder.

func (*EpisodeRoundMutation) WhereP

func (m *EpisodeRoundMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the EpisodeRoundMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type EpisodeRoundQuery

type EpisodeRoundQuery struct {
	// contains filtered or unexported fields
}

EpisodeRoundQuery is the builder for querying EpisodeRound entities.

func (*EpisodeRoundQuery) Aggregate

func (erq *EpisodeRoundQuery) Aggregate(fns ...AggregateFunc) *EpisodeRoundSelect

Aggregate returns a EpisodeRoundSelect configured with the given aggregations.

func (*EpisodeRoundQuery) All

func (erq *EpisodeRoundQuery) All(ctx context.Context) ([]*EpisodeRound, error)

All executes the query and returns a list of EpisodeRounds.

func (*EpisodeRoundQuery) AllX

func (erq *EpisodeRoundQuery) AllX(ctx context.Context) []*EpisodeRound

AllX is like All, but panics if an error occurs.

func (*EpisodeRoundQuery) Clone

func (erq *EpisodeRoundQuery) Clone() *EpisodeRoundQuery

Clone returns a duplicate of the EpisodeRoundQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*EpisodeRoundQuery) Count

func (erq *EpisodeRoundQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EpisodeRoundQuery) CountX

func (erq *EpisodeRoundQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*EpisodeRoundQuery) Exist

func (erq *EpisodeRoundQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*EpisodeRoundQuery) ExistX

func (erq *EpisodeRoundQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*EpisodeRoundQuery) First

func (erq *EpisodeRoundQuery) First(ctx context.Context) (*EpisodeRound, error)

First returns the first EpisodeRound entity from the query. Returns a *NotFoundError when no EpisodeRound was found.

func (*EpisodeRoundQuery) FirstID

func (erq *EpisodeRoundQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first EpisodeRound ID from the query. Returns a *NotFoundError when no EpisodeRound ID was found.

func (*EpisodeRoundQuery) FirstIDX

func (erq *EpisodeRoundQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*EpisodeRoundQuery) FirstX

func (erq *EpisodeRoundQuery) FirstX(ctx context.Context) *EpisodeRound

FirstX is like First, but panics if an error occurs.

func (*EpisodeRoundQuery) GroupBy

func (erq *EpisodeRoundQuery) GroupBy(field string, fields ...string) *EpisodeRoundGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Round episoderound.Round `json:"round,omitempty"`
	Count int `json:"count,omitempty"`
}

client.EpisodeRound.Query().
	GroupBy(episoderound.FieldRound).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EpisodeRoundQuery) IDs

func (erq *EpisodeRoundQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of EpisodeRound IDs.

func (*EpisodeRoundQuery) IDsX

func (erq *EpisodeRoundQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*EpisodeRoundQuery) Limit

func (erq *EpisodeRoundQuery) Limit(limit int) *EpisodeRoundQuery

Limit the number of records to be returned by this query.

func (*EpisodeRoundQuery) Offset

func (erq *EpisodeRoundQuery) Offset(offset int) *EpisodeRoundQuery

Offset to start from.

func (*EpisodeRoundQuery) Only

func (erq *EpisodeRoundQuery) Only(ctx context.Context) (*EpisodeRound, error)

Only returns a single EpisodeRound entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one EpisodeRound entity is found. Returns a *NotFoundError when no EpisodeRound entities are found.

func (*EpisodeRoundQuery) OnlyID

func (erq *EpisodeRoundQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only EpisodeRound ID in the query. Returns a *NotSingularError when more than one EpisodeRound ID is found. Returns a *NotFoundError when no entities are found.

func (*EpisodeRoundQuery) OnlyIDX

func (erq *EpisodeRoundQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*EpisodeRoundQuery) OnlyX

func (erq *EpisodeRoundQuery) OnlyX(ctx context.Context) *EpisodeRound

OnlyX is like Only, but panics if an error occurs.

func (*EpisodeRoundQuery) Order

Order specifies how the records should be ordered.

func (*EpisodeRoundQuery) QueryCategories

func (erq *EpisodeRoundQuery) QueryCategories() *ChallengeGroupQuery

QueryCategories chains the current query on the "categories" edge.

func (*EpisodeRoundQuery) QueryEpisode

func (erq *EpisodeRoundQuery) QueryEpisode() *EpisodeQuery

QueryEpisode chains the current query on the "episode" edge.

func (*EpisodeRoundQuery) Select

func (erq *EpisodeRoundQuery) Select(fields ...string) *EpisodeRoundSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Round episoderound.Round `json:"round,omitempty"`
}

client.EpisodeRound.Query().
	Select(episoderound.FieldRound).
	Scan(ctx, &v)

func (*EpisodeRoundQuery) Unique

func (erq *EpisodeRoundQuery) Unique(unique bool) *EpisodeRoundQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*EpisodeRoundQuery) Where

Where adds a new predicate for the EpisodeRoundQuery builder.

func (*EpisodeRoundQuery) WithCategories

func (erq *EpisodeRoundQuery) WithCategories(opts ...func(*ChallengeGroupQuery)) *EpisodeRoundQuery

WithCategories tells the query-builder to eager-load the nodes that are connected to the "categories" edge. The optional arguments are used to configure the query builder of the edge.

func (*EpisodeRoundQuery) WithEpisode

func (erq *EpisodeRoundQuery) WithEpisode(opts ...func(*EpisodeQuery)) *EpisodeRoundQuery

WithEpisode tells the query-builder to eager-load the nodes that are connected to the "episode" edge. The optional arguments are used to configure the query builder of the edge.

type EpisodeRoundSelect

type EpisodeRoundSelect struct {
	*EpisodeRoundQuery
	// contains filtered or unexported fields
}

EpisodeRoundSelect is the builder for selecting fields of EpisodeRound entities.

func (*EpisodeRoundSelect) Aggregate

func (ers *EpisodeRoundSelect) Aggregate(fns ...AggregateFunc) *EpisodeRoundSelect

Aggregate adds the given aggregation functions to the selector query.

func (*EpisodeRoundSelect) Bool

func (s *EpisodeRoundSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundSelect) BoolX

func (s *EpisodeRoundSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EpisodeRoundSelect) Bools

func (s *EpisodeRoundSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundSelect) BoolsX

func (s *EpisodeRoundSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EpisodeRoundSelect) Float64

func (s *EpisodeRoundSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundSelect) Float64X

func (s *EpisodeRoundSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EpisodeRoundSelect) Float64s

func (s *EpisodeRoundSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundSelect) Float64sX

func (s *EpisodeRoundSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EpisodeRoundSelect) Int

func (s *EpisodeRoundSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundSelect) IntX

func (s *EpisodeRoundSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EpisodeRoundSelect) Ints

func (s *EpisodeRoundSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundSelect) IntsX

func (s *EpisodeRoundSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EpisodeRoundSelect) Scan

func (ers *EpisodeRoundSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EpisodeRoundSelect) ScanX

func (s *EpisodeRoundSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EpisodeRoundSelect) String

func (s *EpisodeRoundSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundSelect) StringX

func (s *EpisodeRoundSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EpisodeRoundSelect) Strings

func (s *EpisodeRoundSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EpisodeRoundSelect) StringsX

func (s *EpisodeRoundSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EpisodeRoundUpdate

type EpisodeRoundUpdate struct {
	// contains filtered or unexported fields
}

EpisodeRoundUpdate is the builder for updating EpisodeRound entities.

func (*EpisodeRoundUpdate) AddCategories

func (eru *EpisodeRoundUpdate) AddCategories(c ...*ChallengeGroup) *EpisodeRoundUpdate

AddCategories adds the "categories" edges to the ChallengeGroup entity.

func (*EpisodeRoundUpdate) AddCategoryIDs

func (eru *EpisodeRoundUpdate) AddCategoryIDs(ids ...int) *EpisodeRoundUpdate

AddCategoryIDs adds the "categories" edge to the ChallengeGroup entity by IDs.

func (*EpisodeRoundUpdate) AddEpisode

func (eru *EpisodeRoundUpdate) AddEpisode(e ...*Episode) *EpisodeRoundUpdate

AddEpisode adds the "episode" edges to the Episode entity.

func (*EpisodeRoundUpdate) AddEpisodeIDs

func (eru *EpisodeRoundUpdate) AddEpisodeIDs(ids ...int) *EpisodeRoundUpdate

AddEpisodeIDs adds the "episode" edge to the Episode entity by IDs.

func (*EpisodeRoundUpdate) ClearCategories

func (eru *EpisodeRoundUpdate) ClearCategories() *EpisodeRoundUpdate

ClearCategories clears all "categories" edges to the ChallengeGroup entity.

func (*EpisodeRoundUpdate) ClearEpisode

func (eru *EpisodeRoundUpdate) ClearEpisode() *EpisodeRoundUpdate

ClearEpisode clears all "episode" edges to the Episode entity.

func (*EpisodeRoundUpdate) Exec

func (eru *EpisodeRoundUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EpisodeRoundUpdate) ExecX

func (eru *EpisodeRoundUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeRoundUpdate) Mutation

func (eru *EpisodeRoundUpdate) Mutation() *EpisodeRoundMutation

Mutation returns the EpisodeRoundMutation object of the builder.

func (*EpisodeRoundUpdate) RemoveCategories

func (eru *EpisodeRoundUpdate) RemoveCategories(c ...*ChallengeGroup) *EpisodeRoundUpdate

RemoveCategories removes "categories" edges to ChallengeGroup entities.

func (*EpisodeRoundUpdate) RemoveCategoryIDs

func (eru *EpisodeRoundUpdate) RemoveCategoryIDs(ids ...int) *EpisodeRoundUpdate

RemoveCategoryIDs removes the "categories" edge to ChallengeGroup entities by IDs.

func (*EpisodeRoundUpdate) RemoveEpisode

func (eru *EpisodeRoundUpdate) RemoveEpisode(e ...*Episode) *EpisodeRoundUpdate

RemoveEpisode removes "episode" edges to Episode entities.

func (*EpisodeRoundUpdate) RemoveEpisodeIDs

func (eru *EpisodeRoundUpdate) RemoveEpisodeIDs(ids ...int) *EpisodeRoundUpdate

RemoveEpisodeIDs removes the "episode" edge to Episode entities by IDs.

func (*EpisodeRoundUpdate) Save

func (eru *EpisodeRoundUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*EpisodeRoundUpdate) SaveX

func (eru *EpisodeRoundUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*EpisodeRoundUpdate) SetNillableRound

func (eru *EpisodeRoundUpdate) SetNillableRound(e *episoderound.Round) *EpisodeRoundUpdate

SetNillableRound sets the "round" field if the given value is not nil.

func (*EpisodeRoundUpdate) SetRound

SetRound sets the "round" field.

func (*EpisodeRoundUpdate) Where

Where appends a list predicates to the EpisodeRoundUpdate builder.

type EpisodeRoundUpdateOne

type EpisodeRoundUpdateOne struct {
	// contains filtered or unexported fields
}

EpisodeRoundUpdateOne is the builder for updating a single EpisodeRound entity.

func (*EpisodeRoundUpdateOne) AddCategories

func (eruo *EpisodeRoundUpdateOne) AddCategories(c ...*ChallengeGroup) *EpisodeRoundUpdateOne

AddCategories adds the "categories" edges to the ChallengeGroup entity.

func (*EpisodeRoundUpdateOne) AddCategoryIDs

func (eruo *EpisodeRoundUpdateOne) AddCategoryIDs(ids ...int) *EpisodeRoundUpdateOne

AddCategoryIDs adds the "categories" edge to the ChallengeGroup entity by IDs.

func (*EpisodeRoundUpdateOne) AddEpisode

func (eruo *EpisodeRoundUpdateOne) AddEpisode(e ...*Episode) *EpisodeRoundUpdateOne

AddEpisode adds the "episode" edges to the Episode entity.

func (*EpisodeRoundUpdateOne) AddEpisodeIDs

func (eruo *EpisodeRoundUpdateOne) AddEpisodeIDs(ids ...int) *EpisodeRoundUpdateOne

AddEpisodeIDs adds the "episode" edge to the Episode entity by IDs.

func (*EpisodeRoundUpdateOne) ClearCategories

func (eruo *EpisodeRoundUpdateOne) ClearCategories() *EpisodeRoundUpdateOne

ClearCategories clears all "categories" edges to the ChallengeGroup entity.

func (*EpisodeRoundUpdateOne) ClearEpisode

func (eruo *EpisodeRoundUpdateOne) ClearEpisode() *EpisodeRoundUpdateOne

ClearEpisode clears all "episode" edges to the Episode entity.

func (*EpisodeRoundUpdateOne) Exec

func (eruo *EpisodeRoundUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EpisodeRoundUpdateOne) ExecX

func (eruo *EpisodeRoundUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeRoundUpdateOne) Mutation

func (eruo *EpisodeRoundUpdateOne) Mutation() *EpisodeRoundMutation

Mutation returns the EpisodeRoundMutation object of the builder.

func (*EpisodeRoundUpdateOne) RemoveCategories

func (eruo *EpisodeRoundUpdateOne) RemoveCategories(c ...*ChallengeGroup) *EpisodeRoundUpdateOne

RemoveCategories removes "categories" edges to ChallengeGroup entities.

func (*EpisodeRoundUpdateOne) RemoveCategoryIDs

func (eruo *EpisodeRoundUpdateOne) RemoveCategoryIDs(ids ...int) *EpisodeRoundUpdateOne

RemoveCategoryIDs removes the "categories" edge to ChallengeGroup entities by IDs.

func (*EpisodeRoundUpdateOne) RemoveEpisode

func (eruo *EpisodeRoundUpdateOne) RemoveEpisode(e ...*Episode) *EpisodeRoundUpdateOne

RemoveEpisode removes "episode" edges to Episode entities.

func (*EpisodeRoundUpdateOne) RemoveEpisodeIDs

func (eruo *EpisodeRoundUpdateOne) RemoveEpisodeIDs(ids ...int) *EpisodeRoundUpdateOne

RemoveEpisodeIDs removes the "episode" edge to Episode entities by IDs.

func (*EpisodeRoundUpdateOne) Save

Save executes the query and returns the updated EpisodeRound entity.

func (*EpisodeRoundUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*EpisodeRoundUpdateOne) Select

func (eruo *EpisodeRoundUpdateOne) Select(field string, fields ...string) *EpisodeRoundUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*EpisodeRoundUpdateOne) SetNillableRound

func (eruo *EpisodeRoundUpdateOne) SetNillableRound(e *episoderound.Round) *EpisodeRoundUpdateOne

SetNillableRound sets the "round" field if the given value is not nil.

func (*EpisodeRoundUpdateOne) SetRound

SetRound sets the "round" field.

func (*EpisodeRoundUpdateOne) Where

Where appends a list predicates to the EpisodeRoundUpdate builder.

type EpisodeRounds

type EpisodeRounds []*EpisodeRound

EpisodeRounds is a parsable slice of EpisodeRound.

type EpisodeSelect

type EpisodeSelect struct {
	*EpisodeQuery
	// contains filtered or unexported fields
}

EpisodeSelect is the builder for selecting fields of Episode entities.

func (*EpisodeSelect) Aggregate

func (es *EpisodeSelect) Aggregate(fns ...AggregateFunc) *EpisodeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*EpisodeSelect) Bool

func (s *EpisodeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EpisodeSelect) BoolX

func (s *EpisodeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EpisodeSelect) Bools

func (s *EpisodeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EpisodeSelect) BoolsX

func (s *EpisodeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EpisodeSelect) Float64

func (s *EpisodeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EpisodeSelect) Float64X

func (s *EpisodeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EpisodeSelect) Float64s

func (s *EpisodeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EpisodeSelect) Float64sX

func (s *EpisodeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EpisodeSelect) Int

func (s *EpisodeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EpisodeSelect) IntX

func (s *EpisodeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EpisodeSelect) Ints

func (s *EpisodeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EpisodeSelect) IntsX

func (s *EpisodeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EpisodeSelect) Scan

func (es *EpisodeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EpisodeSelect) ScanX

func (s *EpisodeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EpisodeSelect) String

func (s *EpisodeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EpisodeSelect) StringX

func (s *EpisodeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EpisodeSelect) Strings

func (s *EpisodeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EpisodeSelect) StringsX

func (s *EpisodeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EpisodeUpdate

type EpisodeUpdate struct {
	// contains filtered or unexported fields
}

EpisodeUpdate is the builder for updating Episode entities.

func (*EpisodeUpdate) AddRoundIDs

func (eu *EpisodeUpdate) AddRoundIDs(ids ...int) *EpisodeUpdate

AddRoundIDs adds the "rounds" edge to the EpisodeRound entity by IDs.

func (*EpisodeUpdate) AddRounds

func (eu *EpisodeUpdate) AddRounds(e ...*EpisodeRound) *EpisodeUpdate

AddRounds adds the "rounds" edges to the EpisodeRound entity.

func (*EpisodeUpdate) ClearRounds

func (eu *EpisodeUpdate) ClearRounds() *EpisodeUpdate

ClearRounds clears all "rounds" edges to the EpisodeRound entity.

func (*EpisodeUpdate) Exec

func (eu *EpisodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EpisodeUpdate) ExecX

func (eu *EpisodeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeUpdate) Mutation

func (eu *EpisodeUpdate) Mutation() *EpisodeMutation

Mutation returns the EpisodeMutation object of the builder.

func (*EpisodeUpdate) RemoveRoundIDs

func (eu *EpisodeUpdate) RemoveRoundIDs(ids ...int) *EpisodeUpdate

RemoveRoundIDs removes the "rounds" edge to EpisodeRound entities by IDs.

func (*EpisodeUpdate) RemoveRounds

func (eu *EpisodeUpdate) RemoveRounds(e ...*EpisodeRound) *EpisodeUpdate

RemoveRounds removes "rounds" edges to EpisodeRound entities.

func (*EpisodeUpdate) Save

func (eu *EpisodeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*EpisodeUpdate) SaveX

func (eu *EpisodeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*EpisodeUpdate) SetAired

func (eu *EpisodeUpdate) SetAired(t time.Time) *EpisodeUpdate

SetAired sets the "aired" field.

func (*EpisodeUpdate) SetDifficulty

func (eu *EpisodeUpdate) SetDifficulty(e episode.Difficulty) *EpisodeUpdate

SetDifficulty sets the "difficulty" field.

func (*EpisodeUpdate) SetNillableAired

func (eu *EpisodeUpdate) SetNillableAired(t *time.Time) *EpisodeUpdate

SetNillableAired sets the "aired" field if the given value is not nil.

func (*EpisodeUpdate) SetNillableDifficulty

func (eu *EpisodeUpdate) SetNillableDifficulty(e *episode.Difficulty) *EpisodeUpdate

SetNillableDifficulty sets the "difficulty" field if the given value is not nil.

func (*EpisodeUpdate) Where

func (eu *EpisodeUpdate) Where(ps ...predicate.Episode) *EpisodeUpdate

Where appends a list predicates to the EpisodeUpdate builder.

type EpisodeUpdateOne

type EpisodeUpdateOne struct {
	// contains filtered or unexported fields
}

EpisodeUpdateOne is the builder for updating a single Episode entity.

func (*EpisodeUpdateOne) AddRoundIDs

func (euo *EpisodeUpdateOne) AddRoundIDs(ids ...int) *EpisodeUpdateOne

AddRoundIDs adds the "rounds" edge to the EpisodeRound entity by IDs.

func (*EpisodeUpdateOne) AddRounds

func (euo *EpisodeUpdateOne) AddRounds(e ...*EpisodeRound) *EpisodeUpdateOne

AddRounds adds the "rounds" edges to the EpisodeRound entity.

func (*EpisodeUpdateOne) ClearRounds

func (euo *EpisodeUpdateOne) ClearRounds() *EpisodeUpdateOne

ClearRounds clears all "rounds" edges to the EpisodeRound entity.

func (*EpisodeUpdateOne) Exec

func (euo *EpisodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EpisodeUpdateOne) ExecX

func (euo *EpisodeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EpisodeUpdateOne) Mutation

func (euo *EpisodeUpdateOne) Mutation() *EpisodeMutation

Mutation returns the EpisodeMutation object of the builder.

func (*EpisodeUpdateOne) RemoveRoundIDs

func (euo *EpisodeUpdateOne) RemoveRoundIDs(ids ...int) *EpisodeUpdateOne

RemoveRoundIDs removes the "rounds" edge to EpisodeRound entities by IDs.

func (*EpisodeUpdateOne) RemoveRounds

func (euo *EpisodeUpdateOne) RemoveRounds(e ...*EpisodeRound) *EpisodeUpdateOne

RemoveRounds removes "rounds" edges to EpisodeRound entities.

func (*EpisodeUpdateOne) Save

func (euo *EpisodeUpdateOne) Save(ctx context.Context) (*Episode, error)

Save executes the query and returns the updated Episode entity.

func (*EpisodeUpdateOne) SaveX

func (euo *EpisodeUpdateOne) SaveX(ctx context.Context) *Episode

SaveX is like Save, but panics if an error occurs.

func (*EpisodeUpdateOne) Select

func (euo *EpisodeUpdateOne) Select(field string, fields ...string) *EpisodeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*EpisodeUpdateOne) SetAired

func (euo *EpisodeUpdateOne) SetAired(t time.Time) *EpisodeUpdateOne

SetAired sets the "aired" field.

func (*EpisodeUpdateOne) SetDifficulty

func (euo *EpisodeUpdateOne) SetDifficulty(e episode.Difficulty) *EpisodeUpdateOne

SetDifficulty sets the "difficulty" field.

func (*EpisodeUpdateOne) SetNillableAired

func (euo *EpisodeUpdateOne) SetNillableAired(t *time.Time) *EpisodeUpdateOne

SetNillableAired sets the "aired" field if the given value is not nil.

func (*EpisodeUpdateOne) SetNillableDifficulty

func (euo *EpisodeUpdateOne) SetNillableDifficulty(e *episode.Difficulty) *EpisodeUpdateOne

SetNillableDifficulty sets the "difficulty" field if the given value is not nil.

func (*EpisodeUpdateOne) Where

Where appends a list predicates to the EpisodeUpdate builder.

type Episodes

type Episodes []*Episode

Episodes is a parsable slice of Episode.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Category is the client for interacting with the Category builders.
	Category *CategoryClient
	// Challenge is the client for interacting with the Challenge builders.
	Challenge *ChallengeClient
	// ChallengeGroup is the client for interacting with the ChallengeGroup builders.
	ChallengeGroup *ChallengeGroupClient
	// Episode is the client for interacting with the Episode builders.
	Episode *EpisodeClient
	// EpisodeRound is the client for interacting with the EpisodeRound builders.
	EpisodeRound *EpisodeRoundClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL