Documentation ¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Noder(ctx context.Context, id int, opts ...NodeOption) (_ Noder, err error)
- func (c *Client) Noders(ctx context.Context, ids []int, opts ...NodeOption) ([]Noder, error)
- func (c *Client) OpenTx(ctx context.Context) (context.Context, driver.Tx, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type CreateJudgeInput
- type CreateProblemInput
- type CreateSubmissionInput
- type Cursor
- type Hook
- type InterceptFunc
- type Interceptor
- type Judge
- func (*Judge) IsNode()
- func (j *Judge) NamedProblems(name string) ([]*Problem, error)
- func (j *Judge) Problems(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int) (*ProblemConnection, error)
- func (j *Judge) QueryProblems() *ProblemQuery
- func (j *Judge) String() string
- func (j *Judge) ToEdge(order *JudgeOrder) *JudgeEdge
- func (j *Judge) Unwrap() *Judge
- func (j *Judge) Update() *JudgeUpdateOne
- func (j *Judge) Value(name string) (ent.Value, error)
- type JudgeClient
- func (c *JudgeClient) Create() *JudgeCreate
- func (c *JudgeClient) CreateBulk(builders ...*JudgeCreate) *JudgeCreateBulk
- func (c *JudgeClient) Delete() *JudgeDelete
- func (c *JudgeClient) DeleteOne(j *Judge) *JudgeDeleteOne
- func (c *JudgeClient) DeleteOneID(id int) *JudgeDeleteOne
- func (c *JudgeClient) Get(ctx context.Context, id int) (*Judge, error)
- func (c *JudgeClient) GetX(ctx context.Context, id int) *Judge
- func (c *JudgeClient) Hooks() []Hook
- func (c *JudgeClient) Intercept(interceptors ...Interceptor)
- func (c *JudgeClient) Interceptors() []Interceptor
- func (c *JudgeClient) MapCreateBulk(slice any, setFunc func(*JudgeCreate, int)) *JudgeCreateBulk
- func (c *JudgeClient) Query() *JudgeQuery
- func (c *JudgeClient) QueryProblems(j *Judge) *ProblemQuery
- func (c *JudgeClient) Update() *JudgeUpdate
- func (c *JudgeClient) UpdateOne(j *Judge) *JudgeUpdateOne
- func (c *JudgeClient) UpdateOneID(id int) *JudgeUpdateOne
- func (c *JudgeClient) Use(hooks ...Hook)
- type JudgeConnection
- type JudgeCreate
- func (jc *JudgeCreate) AddProblemIDs(ids ...int) *JudgeCreate
- func (jc *JudgeCreate) AddProblems(p ...*Problem) *JudgeCreate
- func (jc *JudgeCreate) Exec(ctx context.Context) error
- func (jc *JudgeCreate) ExecX(ctx context.Context)
- func (jc *JudgeCreate) Mutation() *JudgeMutation
- func (jc *JudgeCreate) Save(ctx context.Context) (*Judge, error)
- func (jc *JudgeCreate) SaveX(ctx context.Context) *Judge
- func (jc *JudgeCreate) SetCode(s string) *JudgeCreate
- func (jc *JudgeCreate) SetConfiguration(s string) *JudgeCreate
- func (jc *JudgeCreate) SetCreatedAt(t time.Time) *JudgeCreate
- func (c *JudgeCreate) SetInput(i CreateJudgeInput) *JudgeCreate
- func (jc *JudgeCreate) SetName(s string) *JudgeCreate
- func (jc *JudgeCreate) SetNillableCreatedAt(t *time.Time) *JudgeCreate
- func (jc *JudgeCreate) SetNillableType(j *judge.Type) *JudgeCreate
- func (jc *JudgeCreate) SetNillableUpdatedAt(t *time.Time) *JudgeCreate
- func (jc *JudgeCreate) SetType(j judge.Type) *JudgeCreate
- func (jc *JudgeCreate) SetUpdatedAt(t time.Time) *JudgeCreate
- type JudgeCreateBulk
- type JudgeDelete
- type JudgeDeleteOne
- type JudgeEdge
- type JudgeEdges
- type JudgeGroupBy
- func (jgb *JudgeGroupBy) Aggregate(fns ...AggregateFunc) *JudgeGroupBy
- func (s *JudgeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *JudgeGroupBy) BoolX(ctx context.Context) bool
- func (s *JudgeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *JudgeGroupBy) BoolsX(ctx context.Context) []bool
- func (s *JudgeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *JudgeGroupBy) Float64X(ctx context.Context) float64
- func (s *JudgeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *JudgeGroupBy) Float64sX(ctx context.Context) []float64
- func (s *JudgeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *JudgeGroupBy) IntX(ctx context.Context) int
- func (s *JudgeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *JudgeGroupBy) IntsX(ctx context.Context) []int
- func (jgb *JudgeGroupBy) Scan(ctx context.Context, v any) error
- func (s *JudgeGroupBy) ScanX(ctx context.Context, v any)
- func (s *JudgeGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *JudgeGroupBy) StringX(ctx context.Context) string
- func (s *JudgeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *JudgeGroupBy) StringsX(ctx context.Context) []string
- type JudgeMutation
- func (m *JudgeMutation) AddField(name string, value ent.Value) error
- func (m *JudgeMutation) AddProblemIDs(ids ...int)
- func (m *JudgeMutation) AddedEdges() []string
- func (m *JudgeMutation) AddedField(name string) (ent.Value, bool)
- func (m *JudgeMutation) AddedFields() []string
- func (m *JudgeMutation) AddedIDs(name string) []ent.Value
- func (m *JudgeMutation) ClearEdge(name string) error
- func (m *JudgeMutation) ClearField(name string) error
- func (m *JudgeMutation) ClearProblems()
- func (m *JudgeMutation) ClearedEdges() []string
- func (m *JudgeMutation) ClearedFields() []string
- func (m JudgeMutation) Client() *Client
- func (m *JudgeMutation) Code() (r string, exists bool)
- func (m *JudgeMutation) Configuration() (r string, exists bool)
- func (m *JudgeMutation) CreatedAt() (r time.Time, exists bool)
- func (m *JudgeMutation) EdgeCleared(name string) bool
- func (m *JudgeMutation) Field(name string) (ent.Value, bool)
- func (m *JudgeMutation) FieldCleared(name string) bool
- func (m *JudgeMutation) Fields() []string
- func (m *JudgeMutation) GetType() (r judge.Type, exists bool)
- func (m *JudgeMutation) ID() (id int, exists bool)
- func (m *JudgeMutation) IDs(ctx context.Context) ([]int, error)
- func (m *JudgeMutation) Name() (r string, exists bool)
- func (m *JudgeMutation) OldCode(ctx context.Context) (v string, err error)
- func (m *JudgeMutation) OldConfiguration(ctx context.Context) (v string, err error)
- func (m *JudgeMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *JudgeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *JudgeMutation) OldName(ctx context.Context) (v string, err error)
- func (m *JudgeMutation) OldType(ctx context.Context) (v judge.Type, err error)
- func (m *JudgeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *JudgeMutation) Op() Op
- func (m *JudgeMutation) ProblemsCleared() bool
- func (m *JudgeMutation) ProblemsIDs() (ids []int)
- func (m *JudgeMutation) RemoveProblemIDs(ids ...int)
- func (m *JudgeMutation) RemovedEdges() []string
- func (m *JudgeMutation) RemovedIDs(name string) []ent.Value
- func (m *JudgeMutation) RemovedProblemsIDs() (ids []int)
- func (m *JudgeMutation) ResetCode()
- func (m *JudgeMutation) ResetConfiguration()
- func (m *JudgeMutation) ResetCreatedAt()
- func (m *JudgeMutation) ResetEdge(name string) error
- func (m *JudgeMutation) ResetField(name string) error
- func (m *JudgeMutation) ResetName()
- func (m *JudgeMutation) ResetProblems()
- func (m *JudgeMutation) ResetType()
- func (m *JudgeMutation) ResetUpdatedAt()
- func (m *JudgeMutation) SetCode(s string)
- func (m *JudgeMutation) SetConfiguration(s string)
- func (m *JudgeMutation) SetCreatedAt(t time.Time)
- func (m *JudgeMutation) SetField(name string, value ent.Value) error
- func (m *JudgeMutation) SetName(s string)
- func (m *JudgeMutation) SetOp(op Op)
- func (m *JudgeMutation) SetType(j judge.Type)
- func (m *JudgeMutation) SetUpdatedAt(t time.Time)
- func (m JudgeMutation) Tx() (*Tx, error)
- func (m *JudgeMutation) Type() string
- func (m *JudgeMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *JudgeMutation) Where(ps ...predicate.Judge)
- func (m *JudgeMutation) WhereP(ps ...func(*sql.Selector))
- type JudgeOrder
- type JudgeOrderField
- type JudgePaginateOption
- type JudgeQuery
- func (jq *JudgeQuery) Aggregate(fns ...AggregateFunc) *JudgeSelect
- func (jq *JudgeQuery) All(ctx context.Context) ([]*Judge, error)
- func (jq *JudgeQuery) AllX(ctx context.Context) []*Judge
- func (jq *JudgeQuery) Clone() *JudgeQuery
- func (j *JudgeQuery) CollectFields(ctx context.Context, satisfies ...string) (*JudgeQuery, error)
- func (jq *JudgeQuery) Count(ctx context.Context) (int, error)
- func (jq *JudgeQuery) CountX(ctx context.Context) int
- func (jq *JudgeQuery) Exist(ctx context.Context) (bool, error)
- func (jq *JudgeQuery) ExistX(ctx context.Context) bool
- func (jq *JudgeQuery) First(ctx context.Context) (*Judge, error)
- func (jq *JudgeQuery) FirstID(ctx context.Context) (id int, err error)
- func (jq *JudgeQuery) FirstIDX(ctx context.Context) int
- func (jq *JudgeQuery) FirstX(ctx context.Context) *Judge
- func (jq *JudgeQuery) GroupBy(field string, fields ...string) *JudgeGroupBy
- func (jq *JudgeQuery) IDs(ctx context.Context) (ids []int, err error)
- func (jq *JudgeQuery) IDsX(ctx context.Context) []int
- func (jq *JudgeQuery) Limit(limit int) *JudgeQuery
- func (jq *JudgeQuery) Offset(offset int) *JudgeQuery
- func (jq *JudgeQuery) Only(ctx context.Context) (*Judge, error)
- func (jq *JudgeQuery) OnlyID(ctx context.Context) (id int, err error)
- func (jq *JudgeQuery) OnlyIDX(ctx context.Context) int
- func (jq *JudgeQuery) OnlyX(ctx context.Context) *Judge
- func (jq *JudgeQuery) Order(o ...judge.OrderOption) *JudgeQuery
- func (j *JudgeQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*JudgeConnection, error)
- func (jq *JudgeQuery) QueryProblems() *ProblemQuery
- func (jq *JudgeQuery) Select(fields ...string) *JudgeSelect
- func (jq *JudgeQuery) Unique(unique bool) *JudgeQuery
- func (jq *JudgeQuery) Where(ps ...predicate.Judge) *JudgeQuery
- func (jq *JudgeQuery) WithNamedProblems(name string, opts ...func(*ProblemQuery)) *JudgeQuery
- func (jq *JudgeQuery) WithProblems(opts ...func(*ProblemQuery)) *JudgeQuery
- type JudgeSelect
- func (js *JudgeSelect) Aggregate(fns ...AggregateFunc) *JudgeSelect
- func (s *JudgeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *JudgeSelect) BoolX(ctx context.Context) bool
- func (s *JudgeSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *JudgeSelect) BoolsX(ctx context.Context) []bool
- func (s *JudgeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *JudgeSelect) Float64X(ctx context.Context) float64
- func (s *JudgeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *JudgeSelect) Float64sX(ctx context.Context) []float64
- func (s *JudgeSelect) Int(ctx context.Context) (_ int, err error)
- func (s *JudgeSelect) IntX(ctx context.Context) int
- func (s *JudgeSelect) Ints(ctx context.Context) ([]int, error)
- func (s *JudgeSelect) IntsX(ctx context.Context) []int
- func (js *JudgeSelect) Scan(ctx context.Context, v any) error
- func (s *JudgeSelect) ScanX(ctx context.Context, v any)
- func (s *JudgeSelect) String(ctx context.Context) (_ string, err error)
- func (s *JudgeSelect) StringX(ctx context.Context) string
- func (s *JudgeSelect) Strings(ctx context.Context) ([]string, error)
- func (s *JudgeSelect) StringsX(ctx context.Context) []string
- type JudgeUpdate
- func (ju *JudgeUpdate) AddProblemIDs(ids ...int) *JudgeUpdate
- func (ju *JudgeUpdate) AddProblems(p ...*Problem) *JudgeUpdate
- func (ju *JudgeUpdate) ClearProblems() *JudgeUpdate
- func (ju *JudgeUpdate) Exec(ctx context.Context) error
- func (ju *JudgeUpdate) ExecX(ctx context.Context)
- func (ju *JudgeUpdate) Mutation() *JudgeMutation
- func (ju *JudgeUpdate) RemoveProblemIDs(ids ...int) *JudgeUpdate
- func (ju *JudgeUpdate) RemoveProblems(p ...*Problem) *JudgeUpdate
- func (ju *JudgeUpdate) Save(ctx context.Context) (int, error)
- func (ju *JudgeUpdate) SaveX(ctx context.Context) int
- func (ju *JudgeUpdate) SetCode(s string) *JudgeUpdate
- func (ju *JudgeUpdate) SetConfiguration(s string) *JudgeUpdate
- func (c *JudgeUpdate) SetInput(i UpdateJudgeInput) *JudgeUpdate
- func (ju *JudgeUpdate) SetName(s string) *JudgeUpdate
- func (ju *JudgeUpdate) SetNillableCode(s *string) *JudgeUpdate
- func (ju *JudgeUpdate) SetNillableConfiguration(s *string) *JudgeUpdate
- func (ju *JudgeUpdate) SetNillableName(s *string) *JudgeUpdate
- func (ju *JudgeUpdate) SetNillableType(j *judge.Type) *JudgeUpdate
- func (ju *JudgeUpdate) SetType(j judge.Type) *JudgeUpdate
- func (ju *JudgeUpdate) SetUpdatedAt(t time.Time) *JudgeUpdate
- func (ju *JudgeUpdate) Where(ps ...predicate.Judge) *JudgeUpdate
- type JudgeUpdateOne
- func (juo *JudgeUpdateOne) AddProblemIDs(ids ...int) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) AddProblems(p ...*Problem) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) ClearProblems() *JudgeUpdateOne
- func (juo *JudgeUpdateOne) Exec(ctx context.Context) error
- func (juo *JudgeUpdateOne) ExecX(ctx context.Context)
- func (juo *JudgeUpdateOne) Mutation() *JudgeMutation
- func (juo *JudgeUpdateOne) RemoveProblemIDs(ids ...int) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) RemoveProblems(p ...*Problem) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) Save(ctx context.Context) (*Judge, error)
- func (juo *JudgeUpdateOne) SaveX(ctx context.Context) *Judge
- func (juo *JudgeUpdateOne) Select(field string, fields ...string) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) SetCode(s string) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) SetConfiguration(s string) *JudgeUpdateOne
- func (c *JudgeUpdateOne) SetInput(i UpdateJudgeInput) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) SetName(s string) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) SetNillableCode(s *string) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) SetNillableConfiguration(s *string) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) SetNillableName(s *string) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) SetNillableType(j *judge.Type) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) SetType(j judge.Type) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) SetUpdatedAt(t time.Time) *JudgeUpdateOne
- func (juo *JudgeUpdateOne) Where(ps ...predicate.Judge) *JudgeUpdateOne
- type Judges
- type MutateFunc
- type Mutation
- type Mutator
- type NodeOption
- type Noder
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderDirection
- type OrderFunc
- type PageInfo
- type Policy
- type Problem
- func (*Problem) IsNode()
- func (pr *Problem) Judge(ctx context.Context) (*Judge, error)
- func (pr *Problem) NamedSubmissions(name string) ([]*Submission, error)
- func (pr *Problem) QueryJudge() *JudgeQuery
- func (pr *Problem) QuerySubmissions() *SubmissionQuery
- func (pr *Problem) String() string
- func (pr *Problem) Submissions(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int) (*SubmissionConnection, error)
- func (pr *Problem) ToEdge(order *ProblemOrder) *ProblemEdge
- func (pr *Problem) Unwrap() *Problem
- func (pr *Problem) Update() *ProblemUpdateOne
- func (pr *Problem) Value(name string) (ent.Value, error)
- type ProblemClient
- func (c *ProblemClient) Create() *ProblemCreate
- func (c *ProblemClient) CreateBulk(builders ...*ProblemCreate) *ProblemCreateBulk
- func (c *ProblemClient) Delete() *ProblemDelete
- func (c *ProblemClient) DeleteOne(pr *Problem) *ProblemDeleteOne
- func (c *ProblemClient) DeleteOneID(id int) *ProblemDeleteOne
- func (c *ProblemClient) Get(ctx context.Context, id int) (*Problem, error)
- func (c *ProblemClient) GetX(ctx context.Context, id int) *Problem
- func (c *ProblemClient) Hooks() []Hook
- func (c *ProblemClient) Intercept(interceptors ...Interceptor)
- func (c *ProblemClient) Interceptors() []Interceptor
- func (c *ProblemClient) MapCreateBulk(slice any, setFunc func(*ProblemCreate, int)) *ProblemCreateBulk
- func (c *ProblemClient) Query() *ProblemQuery
- func (c *ProblemClient) QueryJudge(pr *Problem) *JudgeQuery
- func (c *ProblemClient) QuerySubmissions(pr *Problem) *SubmissionQuery
- func (c *ProblemClient) Update() *ProblemUpdate
- func (c *ProblemClient) UpdateOne(pr *Problem) *ProblemUpdateOne
- func (c *ProblemClient) UpdateOneID(id int) *ProblemUpdateOne
- func (c *ProblemClient) Use(hooks ...Hook)
- type ProblemConnection
- type ProblemCreate
- func (pc *ProblemCreate) AddSubmissionIDs(ids ...int) *ProblemCreate
- func (pc *ProblemCreate) AddSubmissions(s ...*Submission) *ProblemCreate
- func (pc *ProblemCreate) Exec(ctx context.Context) error
- func (pc *ProblemCreate) ExecX(ctx context.Context)
- func (pc *ProblemCreate) Mutation() *ProblemMutation
- func (pc *ProblemCreate) Save(ctx context.Context) (*Problem, error)
- func (pc *ProblemCreate) SaveX(ctx context.Context) *Problem
- func (pc *ProblemCreate) SetCode(s string) *ProblemCreate
- func (pc *ProblemCreate) SetCreatedAt(t time.Time) *ProblemCreate
- func (c *ProblemCreate) SetInput(i CreateProblemInput) *ProblemCreate
- func (pc *ProblemCreate) SetJudge(j *Judge) *ProblemCreate
- func (pc *ProblemCreate) SetJudgeID(id int) *ProblemCreate
- func (pc *ProblemCreate) SetName(s string) *ProblemCreate
- func (pc *ProblemCreate) SetNillableCreatedAt(t *time.Time) *ProblemCreate
- func (pc *ProblemCreate) SetNillableUpdatedAt(t *time.Time) *ProblemCreate
- func (pc *ProblemCreate) SetUpdatedAt(t time.Time) *ProblemCreate
- type ProblemCreateBulk
- type ProblemDelete
- type ProblemDeleteOne
- type ProblemEdge
- type ProblemEdges
- type ProblemGroupBy
- func (pgb *ProblemGroupBy) Aggregate(fns ...AggregateFunc) *ProblemGroupBy
- func (s *ProblemGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProblemGroupBy) BoolX(ctx context.Context) bool
- func (s *ProblemGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ProblemGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ProblemGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProblemGroupBy) Float64X(ctx context.Context) float64
- func (s *ProblemGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProblemGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ProblemGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ProblemGroupBy) IntX(ctx context.Context) int
- func (s *ProblemGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ProblemGroupBy) IntsX(ctx context.Context) []int
- func (pgb *ProblemGroupBy) Scan(ctx context.Context, v any) error
- func (s *ProblemGroupBy) ScanX(ctx context.Context, v any)
- func (s *ProblemGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ProblemGroupBy) StringX(ctx context.Context) string
- func (s *ProblemGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ProblemGroupBy) StringsX(ctx context.Context) []string
- type ProblemMutation
- func (m *ProblemMutation) AddField(name string, value ent.Value) error
- func (m *ProblemMutation) AddSubmissionIDs(ids ...int)
- func (m *ProblemMutation) AddedEdges() []string
- func (m *ProblemMutation) AddedField(name string) (ent.Value, bool)
- func (m *ProblemMutation) AddedFields() []string
- func (m *ProblemMutation) AddedIDs(name string) []ent.Value
- func (m *ProblemMutation) ClearEdge(name string) error
- func (m *ProblemMutation) ClearField(name string) error
- func (m *ProblemMutation) ClearJudge()
- func (m *ProblemMutation) ClearSubmissions()
- func (m *ProblemMutation) ClearedEdges() []string
- func (m *ProblemMutation) ClearedFields() []string
- func (m ProblemMutation) Client() *Client
- func (m *ProblemMutation) Code() (r string, exists bool)
- func (m *ProblemMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ProblemMutation) EdgeCleared(name string) bool
- func (m *ProblemMutation) Field(name string) (ent.Value, bool)
- func (m *ProblemMutation) FieldCleared(name string) bool
- func (m *ProblemMutation) Fields() []string
- func (m *ProblemMutation) ID() (id int, exists bool)
- func (m *ProblemMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ProblemMutation) JudgeCleared() bool
- func (m *ProblemMutation) JudgeID() (id int, exists bool)
- func (m *ProblemMutation) JudgeIDs() (ids []int)
- func (m *ProblemMutation) Name() (r string, exists bool)
- func (m *ProblemMutation) OldCode(ctx context.Context) (v string, err error)
- func (m *ProblemMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProblemMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ProblemMutation) OldName(ctx context.Context) (v string, err error)
- func (m *ProblemMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProblemMutation) Op() Op
- func (m *ProblemMutation) RemoveSubmissionIDs(ids ...int)
- func (m *ProblemMutation) RemovedEdges() []string
- func (m *ProblemMutation) RemovedIDs(name string) []ent.Value
- func (m *ProblemMutation) RemovedSubmissionsIDs() (ids []int)
- func (m *ProblemMutation) ResetCode()
- func (m *ProblemMutation) ResetCreatedAt()
- func (m *ProblemMutation) ResetEdge(name string) error
- func (m *ProblemMutation) ResetField(name string) error
- func (m *ProblemMutation) ResetJudge()
- func (m *ProblemMutation) ResetName()
- func (m *ProblemMutation) ResetSubmissions()
- func (m *ProblemMutation) ResetUpdatedAt()
- func (m *ProblemMutation) SetCode(s string)
- func (m *ProblemMutation) SetCreatedAt(t time.Time)
- func (m *ProblemMutation) SetField(name string, value ent.Value) error
- func (m *ProblemMutation) SetJudgeID(id int)
- func (m *ProblemMutation) SetName(s string)
- func (m *ProblemMutation) SetOp(op Op)
- func (m *ProblemMutation) SetUpdatedAt(t time.Time)
- func (m *ProblemMutation) SubmissionsCleared() bool
- func (m *ProblemMutation) SubmissionsIDs() (ids []int)
- func (m ProblemMutation) Tx() (*Tx, error)
- func (m *ProblemMutation) Type() string
- func (m *ProblemMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *ProblemMutation) Where(ps ...predicate.Problem)
- func (m *ProblemMutation) WhereP(ps ...func(*sql.Selector))
- type ProblemOrder
- type ProblemOrderField
- type ProblemPaginateOption
- type ProblemQuery
- func (pq *ProblemQuery) Aggregate(fns ...AggregateFunc) *ProblemSelect
- func (pq *ProblemQuery) All(ctx context.Context) ([]*Problem, error)
- func (pq *ProblemQuery) AllX(ctx context.Context) []*Problem
- func (pq *ProblemQuery) Clone() *ProblemQuery
- func (pr *ProblemQuery) CollectFields(ctx context.Context, satisfies ...string) (*ProblemQuery, error)
- func (pq *ProblemQuery) Count(ctx context.Context) (int, error)
- func (pq *ProblemQuery) CountX(ctx context.Context) int
- func (pq *ProblemQuery) Exist(ctx context.Context) (bool, error)
- func (pq *ProblemQuery) ExistX(ctx context.Context) bool
- func (pq *ProblemQuery) First(ctx context.Context) (*Problem, error)
- func (pq *ProblemQuery) FirstID(ctx context.Context) (id int, err error)
- func (pq *ProblemQuery) FirstIDX(ctx context.Context) int
- func (pq *ProblemQuery) FirstX(ctx context.Context) *Problem
- func (pq *ProblemQuery) GroupBy(field string, fields ...string) *ProblemGroupBy
- func (pq *ProblemQuery) IDs(ctx context.Context) (ids []int, err error)
- func (pq *ProblemQuery) IDsX(ctx context.Context) []int
- func (pq *ProblemQuery) Limit(limit int) *ProblemQuery
- func (pq *ProblemQuery) Offset(offset int) *ProblemQuery
- func (pq *ProblemQuery) Only(ctx context.Context) (*Problem, error)
- func (pq *ProblemQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pq *ProblemQuery) OnlyIDX(ctx context.Context) int
- func (pq *ProblemQuery) OnlyX(ctx context.Context) *Problem
- func (pq *ProblemQuery) Order(o ...problem.OrderOption) *ProblemQuery
- func (pr *ProblemQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*ProblemConnection, error)
- func (pq *ProblemQuery) QueryJudge() *JudgeQuery
- func (pq *ProblemQuery) QuerySubmissions() *SubmissionQuery
- func (pq *ProblemQuery) Select(fields ...string) *ProblemSelect
- func (pq *ProblemQuery) Unique(unique bool) *ProblemQuery
- func (pq *ProblemQuery) Where(ps ...predicate.Problem) *ProblemQuery
- func (pq *ProblemQuery) WithJudge(opts ...func(*JudgeQuery)) *ProblemQuery
- func (pq *ProblemQuery) WithNamedSubmissions(name string, opts ...func(*SubmissionQuery)) *ProblemQuery
- func (pq *ProblemQuery) WithSubmissions(opts ...func(*SubmissionQuery)) *ProblemQuery
- type ProblemSelect
- func (ps *ProblemSelect) Aggregate(fns ...AggregateFunc) *ProblemSelect
- func (s *ProblemSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProblemSelect) BoolX(ctx context.Context) bool
- func (s *ProblemSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ProblemSelect) BoolsX(ctx context.Context) []bool
- func (s *ProblemSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProblemSelect) Float64X(ctx context.Context) float64
- func (s *ProblemSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProblemSelect) Float64sX(ctx context.Context) []float64
- func (s *ProblemSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ProblemSelect) IntX(ctx context.Context) int
- func (s *ProblemSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ProblemSelect) IntsX(ctx context.Context) []int
- func (ps *ProblemSelect) Scan(ctx context.Context, v any) error
- func (s *ProblemSelect) ScanX(ctx context.Context, v any)
- func (s *ProblemSelect) String(ctx context.Context) (_ string, err error)
- func (s *ProblemSelect) StringX(ctx context.Context) string
- func (s *ProblemSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ProblemSelect) StringsX(ctx context.Context) []string
- type ProblemUpdate
- func (pu *ProblemUpdate) AddSubmissionIDs(ids ...int) *ProblemUpdate
- func (pu *ProblemUpdate) AddSubmissions(s ...*Submission) *ProblemUpdate
- func (pu *ProblemUpdate) ClearJudge() *ProblemUpdate
- func (pu *ProblemUpdate) ClearSubmissions() *ProblemUpdate
- func (pu *ProblemUpdate) Exec(ctx context.Context) error
- func (pu *ProblemUpdate) ExecX(ctx context.Context)
- func (pu *ProblemUpdate) Mutation() *ProblemMutation
- func (pu *ProblemUpdate) RemoveSubmissionIDs(ids ...int) *ProblemUpdate
- func (pu *ProblemUpdate) RemoveSubmissions(s ...*Submission) *ProblemUpdate
- func (pu *ProblemUpdate) Save(ctx context.Context) (int, error)
- func (pu *ProblemUpdate) SaveX(ctx context.Context) int
- func (pu *ProblemUpdate) SetCode(s string) *ProblemUpdate
- func (c *ProblemUpdate) SetInput(i UpdateProblemInput) *ProblemUpdate
- func (pu *ProblemUpdate) SetJudge(j *Judge) *ProblemUpdate
- func (pu *ProblemUpdate) SetJudgeID(id int) *ProblemUpdate
- func (pu *ProblemUpdate) SetName(s string) *ProblemUpdate
- func (pu *ProblemUpdate) SetNillableCode(s *string) *ProblemUpdate
- func (pu *ProblemUpdate) SetNillableName(s *string) *ProblemUpdate
- func (pu *ProblemUpdate) SetUpdatedAt(t time.Time) *ProblemUpdate
- func (pu *ProblemUpdate) Where(ps ...predicate.Problem) *ProblemUpdate
- type ProblemUpdateOne
- func (puo *ProblemUpdateOne) AddSubmissionIDs(ids ...int) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) AddSubmissions(s ...*Submission) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) ClearJudge() *ProblemUpdateOne
- func (puo *ProblemUpdateOne) ClearSubmissions() *ProblemUpdateOne
- func (puo *ProblemUpdateOne) Exec(ctx context.Context) error
- func (puo *ProblemUpdateOne) ExecX(ctx context.Context)
- func (puo *ProblemUpdateOne) Mutation() *ProblemMutation
- func (puo *ProblemUpdateOne) RemoveSubmissionIDs(ids ...int) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) RemoveSubmissions(s ...*Submission) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) Save(ctx context.Context) (*Problem, error)
- func (puo *ProblemUpdateOne) SaveX(ctx context.Context) *Problem
- func (puo *ProblemUpdateOne) Select(field string, fields ...string) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) SetCode(s string) *ProblemUpdateOne
- func (c *ProblemUpdateOne) SetInput(i UpdateProblemInput) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) SetJudge(j *Judge) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) SetJudgeID(id int) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) SetName(s string) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) SetNillableCode(s *string) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) SetNillableName(s *string) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) SetUpdatedAt(t time.Time) *ProblemUpdateOne
- func (puo *ProblemUpdateOne) Where(ps ...predicate.Problem) *ProblemUpdateOne
- type Problems
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Submission
- func (*Submission) IsNode()
- func (s *Submission) Problem(ctx context.Context) (*Problem, error)
- func (s *Submission) QueryProblem() *ProblemQuery
- func (s *Submission) String() string
- func (s *Submission) ToEdge(order *SubmissionOrder) *SubmissionEdge
- func (s *Submission) Unwrap() *Submission
- func (s *Submission) Update() *SubmissionUpdateOne
- func (s *Submission) Value(name string) (ent.Value, error)
- type SubmissionClient
- func (c *SubmissionClient) Create() *SubmissionCreate
- func (c *SubmissionClient) CreateBulk(builders ...*SubmissionCreate) *SubmissionCreateBulk
- func (c *SubmissionClient) Delete() *SubmissionDelete
- func (c *SubmissionClient) DeleteOne(s *Submission) *SubmissionDeleteOne
- func (c *SubmissionClient) DeleteOneID(id int) *SubmissionDeleteOne
- func (c *SubmissionClient) Get(ctx context.Context, id int) (*Submission, error)
- func (c *SubmissionClient) GetX(ctx context.Context, id int) *Submission
- func (c *SubmissionClient) Hooks() []Hook
- func (c *SubmissionClient) Intercept(interceptors ...Interceptor)
- func (c *SubmissionClient) Interceptors() []Interceptor
- func (c *SubmissionClient) MapCreateBulk(slice any, setFunc func(*SubmissionCreate, int)) *SubmissionCreateBulk
- func (c *SubmissionClient) Query() *SubmissionQuery
- func (c *SubmissionClient) QueryProblem(s *Submission) *ProblemQuery
- func (c *SubmissionClient) Update() *SubmissionUpdate
- func (c *SubmissionClient) UpdateOne(s *Submission) *SubmissionUpdateOne
- func (c *SubmissionClient) UpdateOneID(id int) *SubmissionUpdateOne
- func (c *SubmissionClient) Use(hooks ...Hook)
- type SubmissionConnection
- type SubmissionCreate
- func (sc *SubmissionCreate) Exec(ctx context.Context) error
- func (sc *SubmissionCreate) ExecX(ctx context.Context)
- func (sc *SubmissionCreate) Mutation() *SubmissionMutation
- func (sc *SubmissionCreate) Save(ctx context.Context) (*Submission, error)
- func (sc *SubmissionCreate) SaveX(ctx context.Context) *Submission
- func (sc *SubmissionCreate) SetCreatedAt(t time.Time) *SubmissionCreate
- func (c *SubmissionCreate) SetInput(i CreateSubmissionInput) *SubmissionCreate
- func (sc *SubmissionCreate) SetNillableCreatedAt(t *time.Time) *SubmissionCreate
- func (sc *SubmissionCreate) SetNillableStatus(s *submission.Status) *SubmissionCreate
- func (sc *SubmissionCreate) SetNillableTestCount(i *int) *SubmissionCreate
- func (sc *SubmissionCreate) SetNillableUpdatedAt(t *time.Time) *SubmissionCreate
- func (sc *SubmissionCreate) SetNillableVerdict(s *submission.Verdict) *SubmissionCreate
- func (sc *SubmissionCreate) SetProblem(p *Problem) *SubmissionCreate
- func (sc *SubmissionCreate) SetProblemID(id int) *SubmissionCreate
- func (sc *SubmissionCreate) SetStatus(s submission.Status) *SubmissionCreate
- func (sc *SubmissionCreate) SetTestCount(i int) *SubmissionCreate
- func (sc *SubmissionCreate) SetUpdatedAt(t time.Time) *SubmissionCreate
- func (sc *SubmissionCreate) SetVerdict(s submission.Verdict) *SubmissionCreate
- type SubmissionCreateBulk
- type SubmissionDelete
- type SubmissionDeleteOne
- type SubmissionEdge
- type SubmissionEdges
- type SubmissionGroupBy
- func (sgb *SubmissionGroupBy) Aggregate(fns ...AggregateFunc) *SubmissionGroupBy
- func (s *SubmissionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SubmissionGroupBy) BoolX(ctx context.Context) bool
- func (s *SubmissionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SubmissionGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SubmissionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SubmissionGroupBy) Float64X(ctx context.Context) float64
- func (s *SubmissionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SubmissionGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SubmissionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SubmissionGroupBy) IntX(ctx context.Context) int
- func (s *SubmissionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SubmissionGroupBy) IntsX(ctx context.Context) []int
- func (sgb *SubmissionGroupBy) Scan(ctx context.Context, v any) error
- func (s *SubmissionGroupBy) ScanX(ctx context.Context, v any)
- func (s *SubmissionGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SubmissionGroupBy) StringX(ctx context.Context) string
- func (s *SubmissionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SubmissionGroupBy) StringsX(ctx context.Context) []string
- type SubmissionMutation
- func (m *SubmissionMutation) AddField(name string, value ent.Value) error
- func (m *SubmissionMutation) AddTestCount(i int)
- func (m *SubmissionMutation) AddedEdges() []string
- func (m *SubmissionMutation) AddedField(name string) (ent.Value, bool)
- func (m *SubmissionMutation) AddedFields() []string
- func (m *SubmissionMutation) AddedIDs(name string) []ent.Value
- func (m *SubmissionMutation) AddedTestCount() (r int, exists bool)
- func (m *SubmissionMutation) ClearEdge(name string) error
- func (m *SubmissionMutation) ClearField(name string) error
- func (m *SubmissionMutation) ClearProblem()
- func (m *SubmissionMutation) ClearedEdges() []string
- func (m *SubmissionMutation) ClearedFields() []string
- func (m SubmissionMutation) Client() *Client
- func (m *SubmissionMutation) CreatedAt() (r time.Time, exists bool)
- func (m *SubmissionMutation) EdgeCleared(name string) bool
- func (m *SubmissionMutation) Field(name string) (ent.Value, bool)
- func (m *SubmissionMutation) FieldCleared(name string) bool
- func (m *SubmissionMutation) Fields() []string
- func (m *SubmissionMutation) ID() (id int, exists bool)
- func (m *SubmissionMutation) IDs(ctx context.Context) ([]int, error)
- func (m *SubmissionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *SubmissionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SubmissionMutation) OldStatus(ctx context.Context) (v submission.Status, err error)
- func (m *SubmissionMutation) OldTestCount(ctx context.Context) (v int, err error)
- func (m *SubmissionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *SubmissionMutation) OldVerdict(ctx context.Context) (v submission.Verdict, err error)
- func (m *SubmissionMutation) Op() Op
- func (m *SubmissionMutation) ProblemCleared() bool
- func (m *SubmissionMutation) ProblemID() (id int, exists bool)
- func (m *SubmissionMutation) ProblemIDs() (ids []int)
- func (m *SubmissionMutation) RemovedEdges() []string
- func (m *SubmissionMutation) RemovedIDs(name string) []ent.Value
- func (m *SubmissionMutation) ResetCreatedAt()
- func (m *SubmissionMutation) ResetEdge(name string) error
- func (m *SubmissionMutation) ResetField(name string) error
- func (m *SubmissionMutation) ResetProblem()
- func (m *SubmissionMutation) ResetStatus()
- func (m *SubmissionMutation) ResetTestCount()
- func (m *SubmissionMutation) ResetUpdatedAt()
- func (m *SubmissionMutation) ResetVerdict()
- func (m *SubmissionMutation) SetCreatedAt(t time.Time)
- func (m *SubmissionMutation) SetField(name string, value ent.Value) error
- func (m *SubmissionMutation) SetOp(op Op)
- func (m *SubmissionMutation) SetProblemID(id int)
- func (m *SubmissionMutation) SetStatus(s submission.Status)
- func (m *SubmissionMutation) SetTestCount(i int)
- func (m *SubmissionMutation) SetUpdatedAt(t time.Time)
- func (m *SubmissionMutation) SetVerdict(s submission.Verdict)
- func (m *SubmissionMutation) Status() (r submission.Status, exists bool)
- func (m *SubmissionMutation) TestCount() (r int, exists bool)
- func (m SubmissionMutation) Tx() (*Tx, error)
- func (m *SubmissionMutation) Type() string
- func (m *SubmissionMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *SubmissionMutation) Verdict() (r submission.Verdict, exists bool)
- func (m *SubmissionMutation) Where(ps ...predicate.Submission)
- func (m *SubmissionMutation) WhereP(ps ...func(*sql.Selector))
- type SubmissionOrder
- type SubmissionOrderField
- type SubmissionPaginateOption
- type SubmissionQuery
- func (sq *SubmissionQuery) Aggregate(fns ...AggregateFunc) *SubmissionSelect
- func (sq *SubmissionQuery) All(ctx context.Context) ([]*Submission, error)
- func (sq *SubmissionQuery) AllX(ctx context.Context) []*Submission
- func (sq *SubmissionQuery) Clone() *SubmissionQuery
- func (s *SubmissionQuery) CollectFields(ctx context.Context, satisfies ...string) (*SubmissionQuery, error)
- func (sq *SubmissionQuery) Count(ctx context.Context) (int, error)
- func (sq *SubmissionQuery) CountX(ctx context.Context) int
- func (sq *SubmissionQuery) Exist(ctx context.Context) (bool, error)
- func (sq *SubmissionQuery) ExistX(ctx context.Context) bool
- func (sq *SubmissionQuery) First(ctx context.Context) (*Submission, error)
- func (sq *SubmissionQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *SubmissionQuery) FirstIDX(ctx context.Context) int
- func (sq *SubmissionQuery) FirstX(ctx context.Context) *Submission
- func (sq *SubmissionQuery) GroupBy(field string, fields ...string) *SubmissionGroupBy
- func (sq *SubmissionQuery) IDs(ctx context.Context) (ids []int, err error)
- func (sq *SubmissionQuery) IDsX(ctx context.Context) []int
- func (sq *SubmissionQuery) Limit(limit int) *SubmissionQuery
- func (sq *SubmissionQuery) Offset(offset int) *SubmissionQuery
- func (sq *SubmissionQuery) Only(ctx context.Context) (*Submission, error)
- func (sq *SubmissionQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *SubmissionQuery) OnlyIDX(ctx context.Context) int
- func (sq *SubmissionQuery) OnlyX(ctx context.Context) *Submission
- func (sq *SubmissionQuery) Order(o ...submission.OrderOption) *SubmissionQuery
- func (s *SubmissionQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*SubmissionConnection, error)
- func (sq *SubmissionQuery) QueryProblem() *ProblemQuery
- func (sq *SubmissionQuery) Select(fields ...string) *SubmissionSelect
- func (sq *SubmissionQuery) Unique(unique bool) *SubmissionQuery
- func (sq *SubmissionQuery) Where(ps ...predicate.Submission) *SubmissionQuery
- func (sq *SubmissionQuery) WithProblem(opts ...func(*ProblemQuery)) *SubmissionQuery
- type SubmissionSelect
- func (ss *SubmissionSelect) Aggregate(fns ...AggregateFunc) *SubmissionSelect
- func (s *SubmissionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SubmissionSelect) BoolX(ctx context.Context) bool
- func (s *SubmissionSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SubmissionSelect) BoolsX(ctx context.Context) []bool
- func (s *SubmissionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SubmissionSelect) Float64X(ctx context.Context) float64
- func (s *SubmissionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SubmissionSelect) Float64sX(ctx context.Context) []float64
- func (s *SubmissionSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SubmissionSelect) IntX(ctx context.Context) int
- func (s *SubmissionSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SubmissionSelect) IntsX(ctx context.Context) []int
- func (ss *SubmissionSelect) Scan(ctx context.Context, v any) error
- func (s *SubmissionSelect) ScanX(ctx context.Context, v any)
- func (s *SubmissionSelect) String(ctx context.Context) (_ string, err error)
- func (s *SubmissionSelect) StringX(ctx context.Context) string
- func (s *SubmissionSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SubmissionSelect) StringsX(ctx context.Context) []string
- type SubmissionUpdate
- func (su *SubmissionUpdate) AddTestCount(i int) *SubmissionUpdate
- func (su *SubmissionUpdate) ClearProblem() *SubmissionUpdate
- func (su *SubmissionUpdate) Exec(ctx context.Context) error
- func (su *SubmissionUpdate) ExecX(ctx context.Context)
- func (su *SubmissionUpdate) Mutation() *SubmissionMutation
- func (su *SubmissionUpdate) Save(ctx context.Context) (int, error)
- func (su *SubmissionUpdate) SaveX(ctx context.Context) int
- func (c *SubmissionUpdate) SetInput(i UpdateSubmissionInput) *SubmissionUpdate
- func (su *SubmissionUpdate) SetNillableStatus(s *submission.Status) *SubmissionUpdate
- func (su *SubmissionUpdate) SetNillableTestCount(i *int) *SubmissionUpdate
- func (su *SubmissionUpdate) SetNillableVerdict(s *submission.Verdict) *SubmissionUpdate
- func (su *SubmissionUpdate) SetProblem(p *Problem) *SubmissionUpdate
- func (su *SubmissionUpdate) SetProblemID(id int) *SubmissionUpdate
- func (su *SubmissionUpdate) SetStatus(s submission.Status) *SubmissionUpdate
- func (su *SubmissionUpdate) SetTestCount(i int) *SubmissionUpdate
- func (su *SubmissionUpdate) SetUpdatedAt(t time.Time) *SubmissionUpdate
- func (su *SubmissionUpdate) SetVerdict(s submission.Verdict) *SubmissionUpdate
- func (su *SubmissionUpdate) Where(ps ...predicate.Submission) *SubmissionUpdate
- type SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) AddTestCount(i int) *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) ClearProblem() *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) Exec(ctx context.Context) error
- func (suo *SubmissionUpdateOne) ExecX(ctx context.Context)
- func (suo *SubmissionUpdateOne) Mutation() *SubmissionMutation
- func (suo *SubmissionUpdateOne) Save(ctx context.Context) (*Submission, error)
- func (suo *SubmissionUpdateOne) SaveX(ctx context.Context) *Submission
- func (suo *SubmissionUpdateOne) Select(field string, fields ...string) *SubmissionUpdateOne
- func (c *SubmissionUpdateOne) SetInput(i UpdateSubmissionInput) *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) SetNillableStatus(s *submission.Status) *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) SetNillableTestCount(i *int) *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) SetNillableVerdict(s *submission.Verdict) *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) SetProblem(p *Problem) *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) SetProblemID(id int) *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) SetStatus(s submission.Status) *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) SetTestCount(i int) *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) SetUpdatedAt(t time.Time) *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) SetVerdict(s submission.Verdict) *SubmissionUpdateOne
- func (suo *SubmissionUpdateOne) Where(ps ...predicate.Submission) *SubmissionUpdateOne
- type Submissions
- type TraverseFunc
- type Traverser
- type Tx
- type UpdateJudgeInput
- type UpdateProblemInput
- type UpdateSubmissionInput
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeJudge = "Judge" TypeProblem = "Problem" TypeSubmission = "Submission" )
Variables ¶
var DefaultJudgeOrder = &JudgeOrder{ Direction: entgql.OrderDirectionAsc, Field: &JudgeOrderField{ Value: func(j *Judge) (ent.Value, error) { return j.ID, nil }, column: judge.FieldID, toTerm: judge.ByID, toCursor: func(j *Judge) Cursor { return Cursor{ID: j.ID} }, }, }
DefaultJudgeOrder is the default ordering of Judge.
var DefaultProblemOrder = &ProblemOrder{ Direction: entgql.OrderDirectionAsc, Field: &ProblemOrderField{ Value: func(pr *Problem) (ent.Value, error) { return pr.ID, nil }, column: problem.FieldID, toTerm: problem.ByID, toCursor: func(pr *Problem) Cursor { return Cursor{ID: pr.ID} }, }, }
DefaultProblemOrder is the default ordering of Problem.
var DefaultSubmissionOrder = &SubmissionOrder{ Direction: entgql.OrderDirectionAsc, Field: &SubmissionOrderField{ Value: func(s *Submission) (ent.Value, error) { return s.ID, nil }, column: submission.FieldID, toTerm: submission.ByID, toCursor: func(s *Submission) Cursor { return Cursor{ID: s.ID} }, }, }
DefaultSubmissionOrder is the default ordering of Submission.
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.
var OpenAPIFs embed.FS
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
func NewTxContext ¶
NewTxContext returns a new context with the given Tx attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
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 Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Judge is the client for interacting with the Judge builders. Judge *JudgeClient // Problem is the client for interacting with the Problem builders. Problem *ProblemClient // Submission is the client for interacting with the Submission builders. Submission *SubmissionClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
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) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Judge. 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) Noder ¶
Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.
c.Noder(ctx, id) c.Noder(ctx, id, ent.WithNodeType(typeResolver))
func (*Client) OpenTx ¶
OpenTx opens a transaction and returns a transactional context along with the created transaction.
type CommitFunc ¶
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.
type CommitHook ¶
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 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 CreateJudgeInput ¶
type CreateJudgeInput struct { CreatedAt *time.Time UpdatedAt *time.Time Name string Code string Type *judge.Type Configuration string ProblemIDs []int }
CreateJudgeInput represents a mutation input for creating judges.
func (*CreateJudgeInput) Mutate ¶
func (i *CreateJudgeInput) Mutate(m *JudgeMutation)
Mutate applies the CreateJudgeInput on the JudgeMutation builder.
type CreateProblemInput ¶
type CreateProblemInput struct { CreatedAt *time.Time UpdatedAt *time.Time Name string Code string SubmissionIDs []int JudgeID int }
CreateProblemInput represents a mutation input for creating problems.
func (*CreateProblemInput) Mutate ¶
func (i *CreateProblemInput) Mutate(m *ProblemMutation)
Mutate applies the CreateProblemInput on the ProblemMutation builder.
type CreateSubmissionInput ¶
type CreateSubmissionInput struct { CreatedAt *time.Time UpdatedAt *time.Time Status *submission.Status Verdict *submission.Verdict TestCount *int ProblemID int }
CreateSubmissionInput represents a mutation input for creating submissions.
func (*CreateSubmissionInput) Mutate ¶
func (i *CreateSubmissionInput) Mutate(m *SubmissionMutation)
Mutate applies the CreateSubmissionInput on the SubmissionMutation builder.
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 Judge ¶
type Judge struct { // ID of the ent. ID int `json:"id,omitempty"` // Time when the entity was created. CreatedAt time.Time `json:"created_at,omitempty"` // Time when the entity was last updated. UpdatedAt time.Time `json:"updated_at,omitempty"` // Name of the judge. Example: Aizu Online Judge Name string `json:"name,omitempty"` // Unique codename of the judge. Example: AZOJ Code string `json:"code,omitempty"` // Type of the judge. Example: local Type judge.Type `json:"type,omitempty"` // Configuration of the judge. Encoded in form urlencoded format (key1=value1&key2=value2...). Configuration string `json:"configuration,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the JudgeQuery when eager-loading is set. Edges JudgeEdges `json:"edges"` // contains filtered or unexported fields }
Judge is the model entity for the Judge schema.
func (*Judge) IsNode ¶
func (*Judge) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Judge) NamedProblems ¶
NamedProblems returns the Problems named value or an error if the edge was not loaded in eager-loading with this name.
func (*Judge) QueryProblems ¶
func (j *Judge) QueryProblems() *ProblemQuery
QueryProblems queries the "problems" edge of the Judge entity.
func (*Judge) ToEdge ¶
func (j *Judge) ToEdge(order *JudgeOrder) *JudgeEdge
ToEdge converts Judge into JudgeEdge.
func (*Judge) Unwrap ¶
Unwrap unwraps the Judge 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 (*Judge) Update ¶
func (j *Judge) Update() *JudgeUpdateOne
Update returns a builder for updating this Judge. Note that you need to call Judge.Unwrap() before calling this method if this Judge was returned from a transaction, and the transaction was committed or rolled back.
type JudgeClient ¶
type JudgeClient struct {
// contains filtered or unexported fields
}
JudgeClient is a client for the Judge schema.
func NewJudgeClient ¶
func NewJudgeClient(c config) *JudgeClient
NewJudgeClient returns a client for the Judge from the given config.
func (*JudgeClient) Create ¶
func (c *JudgeClient) Create() *JudgeCreate
Create returns a builder for creating a Judge entity.
func (*JudgeClient) CreateBulk ¶
func (c *JudgeClient) CreateBulk(builders ...*JudgeCreate) *JudgeCreateBulk
CreateBulk returns a builder for creating a bulk of Judge entities.
func (*JudgeClient) Delete ¶
func (c *JudgeClient) Delete() *JudgeDelete
Delete returns a delete builder for Judge.
func (*JudgeClient) DeleteOne ¶
func (c *JudgeClient) DeleteOne(j *Judge) *JudgeDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*JudgeClient) DeleteOneID ¶
func (c *JudgeClient) DeleteOneID(id int) *JudgeDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*JudgeClient) GetX ¶
func (c *JudgeClient) GetX(ctx context.Context, id int) *Judge
GetX is like Get, but panics if an error occurs.
func (*JudgeClient) Intercept ¶
func (c *JudgeClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `judge.Intercept(f(g(h())))`.
func (*JudgeClient) Interceptors ¶
func (c *JudgeClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*JudgeClient) MapCreateBulk ¶
func (c *JudgeClient) MapCreateBulk(slice any, setFunc func(*JudgeCreate, int)) *JudgeCreateBulk
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 (*JudgeClient) Query ¶
func (c *JudgeClient) Query() *JudgeQuery
Query returns a query builder for Judge.
func (*JudgeClient) QueryProblems ¶
func (c *JudgeClient) QueryProblems(j *Judge) *ProblemQuery
QueryProblems queries the problems edge of a Judge.
func (*JudgeClient) Update ¶
func (c *JudgeClient) Update() *JudgeUpdate
Update returns an update builder for Judge.
func (*JudgeClient) UpdateOne ¶
func (c *JudgeClient) UpdateOne(j *Judge) *JudgeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*JudgeClient) UpdateOneID ¶
func (c *JudgeClient) UpdateOneID(id int) *JudgeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*JudgeClient) Use ¶
func (c *JudgeClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `judge.Hooks(f(g(h())))`.
type JudgeConnection ¶
type JudgeConnection struct { Edges []*JudgeEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
JudgeConnection is the connection containing edges to Judge.
type JudgeCreate ¶
type JudgeCreate struct {
// contains filtered or unexported fields
}
JudgeCreate is the builder for creating a Judge entity.
func (*JudgeCreate) AddProblemIDs ¶
func (jc *JudgeCreate) AddProblemIDs(ids ...int) *JudgeCreate
AddProblemIDs adds the "problems" edge to the Problem entity by IDs.
func (*JudgeCreate) AddProblems ¶
func (jc *JudgeCreate) AddProblems(p ...*Problem) *JudgeCreate
AddProblems adds the "problems" edges to the Problem entity.
func (*JudgeCreate) Exec ¶
func (jc *JudgeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*JudgeCreate) ExecX ¶
func (jc *JudgeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JudgeCreate) Mutation ¶
func (jc *JudgeCreate) Mutation() *JudgeMutation
Mutation returns the JudgeMutation object of the builder.
func (*JudgeCreate) Save ¶
func (jc *JudgeCreate) Save(ctx context.Context) (*Judge, error)
Save creates the Judge in the database.
func (*JudgeCreate) SaveX ¶
func (jc *JudgeCreate) SaveX(ctx context.Context) *Judge
SaveX calls Save and panics if Save returns an error.
func (*JudgeCreate) SetCode ¶
func (jc *JudgeCreate) SetCode(s string) *JudgeCreate
SetCode sets the "code" field.
func (*JudgeCreate) SetConfiguration ¶
func (jc *JudgeCreate) SetConfiguration(s string) *JudgeCreate
SetConfiguration sets the "configuration" field.
func (*JudgeCreate) SetCreatedAt ¶
func (jc *JudgeCreate) SetCreatedAt(t time.Time) *JudgeCreate
SetCreatedAt sets the "created_at" field.
func (*JudgeCreate) SetInput ¶
func (c *JudgeCreate) SetInput(i CreateJudgeInput) *JudgeCreate
SetInput applies the change-set in the CreateJudgeInput on the JudgeCreate builder.
func (*JudgeCreate) SetName ¶
func (jc *JudgeCreate) SetName(s string) *JudgeCreate
SetName sets the "name" field.
func (*JudgeCreate) SetNillableCreatedAt ¶
func (jc *JudgeCreate) SetNillableCreatedAt(t *time.Time) *JudgeCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*JudgeCreate) SetNillableType ¶
func (jc *JudgeCreate) SetNillableType(j *judge.Type) *JudgeCreate
SetNillableType sets the "type" field if the given value is not nil.
func (*JudgeCreate) SetNillableUpdatedAt ¶
func (jc *JudgeCreate) SetNillableUpdatedAt(t *time.Time) *JudgeCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*JudgeCreate) SetType ¶
func (jc *JudgeCreate) SetType(j judge.Type) *JudgeCreate
SetType sets the "type" field.
func (*JudgeCreate) SetUpdatedAt ¶
func (jc *JudgeCreate) SetUpdatedAt(t time.Time) *JudgeCreate
SetUpdatedAt sets the "updated_at" field.
type JudgeCreateBulk ¶
type JudgeCreateBulk struct {
// contains filtered or unexported fields
}
JudgeCreateBulk is the builder for creating many Judge entities in bulk.
func (*JudgeCreateBulk) Exec ¶
func (jcb *JudgeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*JudgeCreateBulk) ExecX ¶
func (jcb *JudgeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type JudgeDelete ¶
type JudgeDelete struct {
// contains filtered or unexported fields
}
JudgeDelete is the builder for deleting a Judge entity.
func (*JudgeDelete) Exec ¶
func (jd *JudgeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*JudgeDelete) ExecX ¶
func (jd *JudgeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*JudgeDelete) Where ¶
func (jd *JudgeDelete) Where(ps ...predicate.Judge) *JudgeDelete
Where appends a list predicates to the JudgeDelete builder.
type JudgeDeleteOne ¶
type JudgeDeleteOne struct {
// contains filtered or unexported fields
}
JudgeDeleteOne is the builder for deleting a single Judge entity.
func (*JudgeDeleteOne) Exec ¶
func (jdo *JudgeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*JudgeDeleteOne) ExecX ¶
func (jdo *JudgeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JudgeDeleteOne) Where ¶
func (jdo *JudgeDeleteOne) Where(ps ...predicate.Judge) *JudgeDeleteOne
Where appends a list predicates to the JudgeDelete builder.
type JudgeEdges ¶
type JudgeEdges struct { // Problems holds the value of the problems edge. Problems []*Problem `json:"problems,omitempty"` // contains filtered or unexported fields }
JudgeEdges holds the relations/edges for other nodes in the graph.
func (JudgeEdges) ProblemsOrErr ¶
func (e JudgeEdges) ProblemsOrErr() ([]*Problem, error)
ProblemsOrErr returns the Problems value or an error if the edge was not loaded in eager-loading.
type JudgeGroupBy ¶
type JudgeGroupBy struct {
// contains filtered or unexported fields
}
JudgeGroupBy is the group-by builder for Judge entities.
func (*JudgeGroupBy) Aggregate ¶
func (jgb *JudgeGroupBy) Aggregate(fns ...AggregateFunc) *JudgeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*JudgeGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*JudgeGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*JudgeGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*JudgeGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*JudgeGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*JudgeGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*JudgeGroupBy) Scan ¶
func (jgb *JudgeGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*JudgeGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type JudgeMutation ¶
type JudgeMutation struct {
// contains filtered or unexported fields
}
JudgeMutation represents an operation that mutates the Judge nodes in the graph.
func (*JudgeMutation) AddField ¶
func (m *JudgeMutation) 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 (*JudgeMutation) AddProblemIDs ¶
func (m *JudgeMutation) AddProblemIDs(ids ...int)
AddProblemIDs adds the "problems" edge to the Problem entity by ids.
func (*JudgeMutation) AddedEdges ¶
func (m *JudgeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*JudgeMutation) AddedField ¶
func (m *JudgeMutation) 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 (*JudgeMutation) AddedFields ¶
func (m *JudgeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*JudgeMutation) AddedIDs ¶
func (m *JudgeMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*JudgeMutation) ClearEdge ¶
func (m *JudgeMutation) 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 (*JudgeMutation) ClearField ¶
func (m *JudgeMutation) 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 (*JudgeMutation) ClearProblems ¶
func (m *JudgeMutation) ClearProblems()
ClearProblems clears the "problems" edge to the Problem entity.
func (*JudgeMutation) ClearedEdges ¶
func (m *JudgeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*JudgeMutation) ClearedFields ¶
func (m *JudgeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (JudgeMutation) Client ¶
func (m JudgeMutation) 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 (*JudgeMutation) Code ¶
func (m *JudgeMutation) Code() (r string, exists bool)
Code returns the value of the "code" field in the mutation.
func (*JudgeMutation) Configuration ¶
func (m *JudgeMutation) Configuration() (r string, exists bool)
Configuration returns the value of the "configuration" field in the mutation.
func (*JudgeMutation) CreatedAt ¶
func (m *JudgeMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*JudgeMutation) EdgeCleared ¶
func (m *JudgeMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*JudgeMutation) Field ¶
func (m *JudgeMutation) 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 (*JudgeMutation) FieldCleared ¶
func (m *JudgeMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*JudgeMutation) Fields ¶
func (m *JudgeMutation) 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 (*JudgeMutation) GetType ¶
func (m *JudgeMutation) GetType() (r judge.Type, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*JudgeMutation) ID ¶
func (m *JudgeMutation) 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 (*JudgeMutation) IDs ¶
func (m *JudgeMutation) 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 (*JudgeMutation) Name ¶
func (m *JudgeMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*JudgeMutation) OldCode ¶
func (m *JudgeMutation) OldCode(ctx context.Context) (v string, err error)
OldCode returns the old "code" field's value of the Judge entity. If the Judge 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 (*JudgeMutation) OldConfiguration ¶
func (m *JudgeMutation) OldConfiguration(ctx context.Context) (v string, err error)
OldConfiguration returns the old "configuration" field's value of the Judge entity. If the Judge 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 (*JudgeMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Judge entity. If the Judge 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 (*JudgeMutation) OldField ¶
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 (*JudgeMutation) OldName ¶
func (m *JudgeMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Judge entity. If the Judge 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 (*JudgeMutation) OldType ¶
OldType returns the old "type" field's value of the Judge entity. If the Judge 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 (*JudgeMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Judge entity. If the Judge 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 (*JudgeMutation) ProblemsCleared ¶
func (m *JudgeMutation) ProblemsCleared() bool
ProblemsCleared reports if the "problems" edge to the Problem entity was cleared.
func (*JudgeMutation) ProblemsIDs ¶
func (m *JudgeMutation) ProblemsIDs() (ids []int)
ProblemsIDs returns the "problems" edge IDs in the mutation.
func (*JudgeMutation) RemoveProblemIDs ¶
func (m *JudgeMutation) RemoveProblemIDs(ids ...int)
RemoveProblemIDs removes the "problems" edge to the Problem entity by IDs.
func (*JudgeMutation) RemovedEdges ¶
func (m *JudgeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*JudgeMutation) RemovedIDs ¶
func (m *JudgeMutation) 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 (*JudgeMutation) RemovedProblemsIDs ¶
func (m *JudgeMutation) RemovedProblemsIDs() (ids []int)
RemovedProblems returns the removed IDs of the "problems" edge to the Problem entity.
func (*JudgeMutation) ResetCode ¶
func (m *JudgeMutation) ResetCode()
ResetCode resets all changes to the "code" field.
func (*JudgeMutation) ResetConfiguration ¶
func (m *JudgeMutation) ResetConfiguration()
ResetConfiguration resets all changes to the "configuration" field.
func (*JudgeMutation) ResetCreatedAt ¶
func (m *JudgeMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*JudgeMutation) ResetEdge ¶
func (m *JudgeMutation) 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 (*JudgeMutation) ResetField ¶
func (m *JudgeMutation) 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 (*JudgeMutation) ResetName ¶
func (m *JudgeMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*JudgeMutation) ResetProblems ¶
func (m *JudgeMutation) ResetProblems()
ResetProblems resets all changes to the "problems" edge.
func (*JudgeMutation) ResetType ¶
func (m *JudgeMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*JudgeMutation) ResetUpdatedAt ¶
func (m *JudgeMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*JudgeMutation) SetCode ¶
func (m *JudgeMutation) SetCode(s string)
SetCode sets the "code" field.
func (*JudgeMutation) SetConfiguration ¶
func (m *JudgeMutation) SetConfiguration(s string)
SetConfiguration sets the "configuration" field.
func (*JudgeMutation) SetCreatedAt ¶
func (m *JudgeMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*JudgeMutation) SetField ¶
func (m *JudgeMutation) 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 (*JudgeMutation) SetName ¶
func (m *JudgeMutation) SetName(s string)
SetName sets the "name" field.
func (*JudgeMutation) SetOp ¶
func (m *JudgeMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*JudgeMutation) SetType ¶
func (m *JudgeMutation) SetType(j judge.Type)
SetType sets the "type" field.
func (*JudgeMutation) SetUpdatedAt ¶
func (m *JudgeMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (JudgeMutation) Tx ¶
func (m JudgeMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*JudgeMutation) Type ¶
func (m *JudgeMutation) Type() string
Type returns the node type of this mutation (Judge).
func (*JudgeMutation) UpdatedAt ¶
func (m *JudgeMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*JudgeMutation) Where ¶
func (m *JudgeMutation) Where(ps ...predicate.Judge)
Where appends a list predicates to the JudgeMutation builder.
func (*JudgeMutation) WhereP ¶
func (m *JudgeMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the JudgeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type JudgeOrder ¶
type JudgeOrder struct { Direction OrderDirection `json:"direction"` Field *JudgeOrderField `json:"field"` }
JudgeOrder defines the ordering of Judge.
type JudgeOrderField ¶
type JudgeOrderField struct { // Value extracts the ordering value from the given Judge. Value func(*Judge) (ent.Value, error) // contains filtered or unexported fields }
JudgeOrderField defines the ordering field of Judge.
type JudgePaginateOption ¶
type JudgePaginateOption func(*judgePager) error
JudgePaginateOption enables pagination customization.
func WithJudgeFilter ¶
func WithJudgeFilter(filter func(*JudgeQuery) (*JudgeQuery, error)) JudgePaginateOption
WithJudgeFilter configures pagination filter.
func WithJudgeOrder ¶
func WithJudgeOrder(order *JudgeOrder) JudgePaginateOption
WithJudgeOrder configures pagination ordering.
type JudgeQuery ¶
type JudgeQuery struct {
// contains filtered or unexported fields
}
JudgeQuery is the builder for querying Judge entities.
func (*JudgeQuery) Aggregate ¶
func (jq *JudgeQuery) Aggregate(fns ...AggregateFunc) *JudgeSelect
Aggregate returns a JudgeSelect configured with the given aggregations.
func (*JudgeQuery) All ¶
func (jq *JudgeQuery) All(ctx context.Context) ([]*Judge, error)
All executes the query and returns a list of Judges.
func (*JudgeQuery) AllX ¶
func (jq *JudgeQuery) AllX(ctx context.Context) []*Judge
AllX is like All, but panics if an error occurs.
func (*JudgeQuery) Clone ¶
func (jq *JudgeQuery) Clone() *JudgeQuery
Clone returns a duplicate of the JudgeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*JudgeQuery) CollectFields ¶
func (j *JudgeQuery) CollectFields(ctx context.Context, satisfies ...string) (*JudgeQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*JudgeQuery) Count ¶
func (jq *JudgeQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*JudgeQuery) CountX ¶
func (jq *JudgeQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*JudgeQuery) Exist ¶
func (jq *JudgeQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*JudgeQuery) ExistX ¶
func (jq *JudgeQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*JudgeQuery) First ¶
func (jq *JudgeQuery) First(ctx context.Context) (*Judge, error)
First returns the first Judge entity from the query. Returns a *NotFoundError when no Judge was found.
func (*JudgeQuery) FirstID ¶
func (jq *JudgeQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Judge ID from the query. Returns a *NotFoundError when no Judge ID was found.
func (*JudgeQuery) FirstIDX ¶
func (jq *JudgeQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*JudgeQuery) FirstX ¶
func (jq *JudgeQuery) FirstX(ctx context.Context) *Judge
FirstX is like First, but panics if an error occurs.
func (*JudgeQuery) GroupBy ¶
func (jq *JudgeQuery) GroupBy(field string, fields ...string) *JudgeGroupBy
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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Judge.Query(). GroupBy(judge.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*JudgeQuery) IDs ¶
func (jq *JudgeQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Judge IDs.
func (*JudgeQuery) IDsX ¶
func (jq *JudgeQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*JudgeQuery) Limit ¶
func (jq *JudgeQuery) Limit(limit int) *JudgeQuery
Limit the number of records to be returned by this query.
func (*JudgeQuery) Offset ¶
func (jq *JudgeQuery) Offset(offset int) *JudgeQuery
Offset to start from.
func (*JudgeQuery) Only ¶
func (jq *JudgeQuery) Only(ctx context.Context) (*Judge, error)
Only returns a single Judge entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Judge entity is found. Returns a *NotFoundError when no Judge entities are found.
func (*JudgeQuery) OnlyID ¶
func (jq *JudgeQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Judge ID in the query. Returns a *NotSingularError when more than one Judge ID is found. Returns a *NotFoundError when no entities are found.
func (*JudgeQuery) OnlyIDX ¶
func (jq *JudgeQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*JudgeQuery) OnlyX ¶
func (jq *JudgeQuery) OnlyX(ctx context.Context) *Judge
OnlyX is like Only, but panics if an error occurs.
func (*JudgeQuery) Order ¶
func (jq *JudgeQuery) Order(o ...judge.OrderOption) *JudgeQuery
Order specifies how the records should be ordered.
func (*JudgeQuery) Paginate ¶
func (j *JudgeQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...JudgePaginateOption, ) (*JudgeConnection, error)
Paginate executes the query and returns a relay based cursor connection to Judge.
func (*JudgeQuery) QueryProblems ¶
func (jq *JudgeQuery) QueryProblems() *ProblemQuery
QueryProblems chains the current query on the "problems" edge.
func (*JudgeQuery) Select ¶
func (jq *JudgeQuery) Select(fields ...string) *JudgeSelect
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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.Judge.Query(). Select(judge.FieldCreatedAt). Scan(ctx, &v)
func (*JudgeQuery) Unique ¶
func (jq *JudgeQuery) Unique(unique bool) *JudgeQuery
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 (*JudgeQuery) Where ¶
func (jq *JudgeQuery) Where(ps ...predicate.Judge) *JudgeQuery
Where adds a new predicate for the JudgeQuery builder.
func (*JudgeQuery) WithNamedProblems ¶
func (jq *JudgeQuery) WithNamedProblems(name string, opts ...func(*ProblemQuery)) *JudgeQuery
WithNamedProblems tells the query-builder to eager-load the nodes that are connected to the "problems" edge with the given name. The optional arguments are used to configure the query builder of the edge.
func (*JudgeQuery) WithProblems ¶
func (jq *JudgeQuery) WithProblems(opts ...func(*ProblemQuery)) *JudgeQuery
WithProblems tells the query-builder to eager-load the nodes that are connected to the "problems" edge. The optional arguments are used to configure the query builder of the edge.
type JudgeSelect ¶
type JudgeSelect struct { *JudgeQuery // contains filtered or unexported fields }
JudgeSelect is the builder for selecting fields of Judge entities.
func (*JudgeSelect) Aggregate ¶
func (js *JudgeSelect) Aggregate(fns ...AggregateFunc) *JudgeSelect
Aggregate adds the given aggregation functions to the selector query.
func (*JudgeSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*JudgeSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*JudgeSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*JudgeSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*JudgeSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*JudgeSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*JudgeSelect) Scan ¶
func (js *JudgeSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*JudgeSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type JudgeUpdate ¶
type JudgeUpdate struct {
// contains filtered or unexported fields
}
JudgeUpdate is the builder for updating Judge entities.
func (*JudgeUpdate) AddProblemIDs ¶
func (ju *JudgeUpdate) AddProblemIDs(ids ...int) *JudgeUpdate
AddProblemIDs adds the "problems" edge to the Problem entity by IDs.
func (*JudgeUpdate) AddProblems ¶
func (ju *JudgeUpdate) AddProblems(p ...*Problem) *JudgeUpdate
AddProblems adds the "problems" edges to the Problem entity.
func (*JudgeUpdate) ClearProblems ¶
func (ju *JudgeUpdate) ClearProblems() *JudgeUpdate
ClearProblems clears all "problems" edges to the Problem entity.
func (*JudgeUpdate) Exec ¶
func (ju *JudgeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*JudgeUpdate) ExecX ¶
func (ju *JudgeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JudgeUpdate) Mutation ¶
func (ju *JudgeUpdate) Mutation() *JudgeMutation
Mutation returns the JudgeMutation object of the builder.
func (*JudgeUpdate) RemoveProblemIDs ¶
func (ju *JudgeUpdate) RemoveProblemIDs(ids ...int) *JudgeUpdate
RemoveProblemIDs removes the "problems" edge to Problem entities by IDs.
func (*JudgeUpdate) RemoveProblems ¶
func (ju *JudgeUpdate) RemoveProblems(p ...*Problem) *JudgeUpdate
RemoveProblems removes "problems" edges to Problem entities.
func (*JudgeUpdate) Save ¶
func (ju *JudgeUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*JudgeUpdate) SaveX ¶
func (ju *JudgeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*JudgeUpdate) SetCode ¶
func (ju *JudgeUpdate) SetCode(s string) *JudgeUpdate
SetCode sets the "code" field.
func (*JudgeUpdate) SetConfiguration ¶
func (ju *JudgeUpdate) SetConfiguration(s string) *JudgeUpdate
SetConfiguration sets the "configuration" field.
func (*JudgeUpdate) SetInput ¶
func (c *JudgeUpdate) SetInput(i UpdateJudgeInput) *JudgeUpdate
SetInput applies the change-set in the UpdateJudgeInput on the JudgeUpdate builder.
func (*JudgeUpdate) SetName ¶
func (ju *JudgeUpdate) SetName(s string) *JudgeUpdate
SetName sets the "name" field.
func (*JudgeUpdate) SetNillableCode ¶
func (ju *JudgeUpdate) SetNillableCode(s *string) *JudgeUpdate
SetNillableCode sets the "code" field if the given value is not nil.
func (*JudgeUpdate) SetNillableConfiguration ¶
func (ju *JudgeUpdate) SetNillableConfiguration(s *string) *JudgeUpdate
SetNillableConfiguration sets the "configuration" field if the given value is not nil.
func (*JudgeUpdate) SetNillableName ¶
func (ju *JudgeUpdate) SetNillableName(s *string) *JudgeUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*JudgeUpdate) SetNillableType ¶
func (ju *JudgeUpdate) SetNillableType(j *judge.Type) *JudgeUpdate
SetNillableType sets the "type" field if the given value is not nil.
func (*JudgeUpdate) SetType ¶
func (ju *JudgeUpdate) SetType(j judge.Type) *JudgeUpdate
SetType sets the "type" field.
func (*JudgeUpdate) SetUpdatedAt ¶
func (ju *JudgeUpdate) SetUpdatedAt(t time.Time) *JudgeUpdate
SetUpdatedAt sets the "updated_at" field.
func (*JudgeUpdate) Where ¶
func (ju *JudgeUpdate) Where(ps ...predicate.Judge) *JudgeUpdate
Where appends a list predicates to the JudgeUpdate builder.
type JudgeUpdateOne ¶
type JudgeUpdateOne struct {
// contains filtered or unexported fields
}
JudgeUpdateOne is the builder for updating a single Judge entity.
func (*JudgeUpdateOne) AddProblemIDs ¶
func (juo *JudgeUpdateOne) AddProblemIDs(ids ...int) *JudgeUpdateOne
AddProblemIDs adds the "problems" edge to the Problem entity by IDs.
func (*JudgeUpdateOne) AddProblems ¶
func (juo *JudgeUpdateOne) AddProblems(p ...*Problem) *JudgeUpdateOne
AddProblems adds the "problems" edges to the Problem entity.
func (*JudgeUpdateOne) ClearProblems ¶
func (juo *JudgeUpdateOne) ClearProblems() *JudgeUpdateOne
ClearProblems clears all "problems" edges to the Problem entity.
func (*JudgeUpdateOne) Exec ¶
func (juo *JudgeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*JudgeUpdateOne) ExecX ¶
func (juo *JudgeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JudgeUpdateOne) Mutation ¶
func (juo *JudgeUpdateOne) Mutation() *JudgeMutation
Mutation returns the JudgeMutation object of the builder.
func (*JudgeUpdateOne) RemoveProblemIDs ¶
func (juo *JudgeUpdateOne) RemoveProblemIDs(ids ...int) *JudgeUpdateOne
RemoveProblemIDs removes the "problems" edge to Problem entities by IDs.
func (*JudgeUpdateOne) RemoveProblems ¶
func (juo *JudgeUpdateOne) RemoveProblems(p ...*Problem) *JudgeUpdateOne
RemoveProblems removes "problems" edges to Problem entities.
func (*JudgeUpdateOne) Save ¶
func (juo *JudgeUpdateOne) Save(ctx context.Context) (*Judge, error)
Save executes the query and returns the updated Judge entity.
func (*JudgeUpdateOne) SaveX ¶
func (juo *JudgeUpdateOne) SaveX(ctx context.Context) *Judge
SaveX is like Save, but panics if an error occurs.
func (*JudgeUpdateOne) Select ¶
func (juo *JudgeUpdateOne) Select(field string, fields ...string) *JudgeUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*JudgeUpdateOne) SetCode ¶
func (juo *JudgeUpdateOne) SetCode(s string) *JudgeUpdateOne
SetCode sets the "code" field.
func (*JudgeUpdateOne) SetConfiguration ¶
func (juo *JudgeUpdateOne) SetConfiguration(s string) *JudgeUpdateOne
SetConfiguration sets the "configuration" field.
func (*JudgeUpdateOne) SetInput ¶
func (c *JudgeUpdateOne) SetInput(i UpdateJudgeInput) *JudgeUpdateOne
SetInput applies the change-set in the UpdateJudgeInput on the JudgeUpdateOne builder.
func (*JudgeUpdateOne) SetName ¶
func (juo *JudgeUpdateOne) SetName(s string) *JudgeUpdateOne
SetName sets the "name" field.
func (*JudgeUpdateOne) SetNillableCode ¶
func (juo *JudgeUpdateOne) SetNillableCode(s *string) *JudgeUpdateOne
SetNillableCode sets the "code" field if the given value is not nil.
func (*JudgeUpdateOne) SetNillableConfiguration ¶
func (juo *JudgeUpdateOne) SetNillableConfiguration(s *string) *JudgeUpdateOne
SetNillableConfiguration sets the "configuration" field if the given value is not nil.
func (*JudgeUpdateOne) SetNillableName ¶
func (juo *JudgeUpdateOne) SetNillableName(s *string) *JudgeUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*JudgeUpdateOne) SetNillableType ¶
func (juo *JudgeUpdateOne) SetNillableType(j *judge.Type) *JudgeUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*JudgeUpdateOne) SetType ¶
func (juo *JudgeUpdateOne) SetType(j judge.Type) *JudgeUpdateOne
SetType sets the "type" field.
func (*JudgeUpdateOne) SetUpdatedAt ¶
func (juo *JudgeUpdateOne) SetUpdatedAt(t time.Time) *JudgeUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*JudgeUpdateOne) Where ¶
func (juo *JudgeUpdateOne) Where(ps ...predicate.Judge) *JudgeUpdateOne
Where appends a list predicates to the JudgeUpdate builder.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NodeOption ¶
type NodeOption func(*nodeOptions)
NodeOption allows configuring the Noder execution using functional options.
func WithFixedNodeType ¶
func WithFixedNodeType(t string) NodeOption
WithFixedNodeType sets the Type of the node to a fixed value.
func WithNodeType ¶
WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.
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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type Problem ¶
type Problem struct { // ID of the ent. ID int `json:"id,omitempty"` // Time when the entity was created. CreatedAt time.Time `json:"created_at,omitempty"` // Time when the entity was last updated. UpdatedAt time.Time `json:"updated_at,omitempty"` // Name of the problem. Example: A+B Problem Name string `json:"name,omitempty"` // Unique codename of the problem. Example: AZ2008B Code string `json:"code,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ProblemQuery when eager-loading is set. Edges ProblemEdges `json:"edges"` // contains filtered or unexported fields }
Problem is the model entity for the Problem schema.
func (*Problem) IsNode ¶
func (*Problem) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Problem) NamedSubmissions ¶
func (pr *Problem) NamedSubmissions(name string) ([]*Submission, error)
NamedSubmissions returns the Submissions named value or an error if the edge was not loaded in eager-loading with this name.
func (*Problem) QueryJudge ¶
func (pr *Problem) QueryJudge() *JudgeQuery
QueryJudge queries the "judge" edge of the Problem entity.
func (*Problem) QuerySubmissions ¶
func (pr *Problem) QuerySubmissions() *SubmissionQuery
QuerySubmissions queries the "submissions" edge of the Problem entity.
func (*Problem) Submissions ¶
func (*Problem) ToEdge ¶
func (pr *Problem) ToEdge(order *ProblemOrder) *ProblemEdge
ToEdge converts Problem into ProblemEdge.
func (*Problem) Unwrap ¶
Unwrap unwraps the Problem 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 (*Problem) Update ¶
func (pr *Problem) Update() *ProblemUpdateOne
Update returns a builder for updating this Problem. Note that you need to call Problem.Unwrap() before calling this method if this Problem was returned from a transaction, and the transaction was committed or rolled back.
type ProblemClient ¶
type ProblemClient struct {
// contains filtered or unexported fields
}
ProblemClient is a client for the Problem schema.
func NewProblemClient ¶
func NewProblemClient(c config) *ProblemClient
NewProblemClient returns a client for the Problem from the given config.
func (*ProblemClient) Create ¶
func (c *ProblemClient) Create() *ProblemCreate
Create returns a builder for creating a Problem entity.
func (*ProblemClient) CreateBulk ¶
func (c *ProblemClient) CreateBulk(builders ...*ProblemCreate) *ProblemCreateBulk
CreateBulk returns a builder for creating a bulk of Problem entities.
func (*ProblemClient) Delete ¶
func (c *ProblemClient) Delete() *ProblemDelete
Delete returns a delete builder for Problem.
func (*ProblemClient) DeleteOne ¶
func (c *ProblemClient) DeleteOne(pr *Problem) *ProblemDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ProblemClient) DeleteOneID ¶
func (c *ProblemClient) DeleteOneID(id int) *ProblemDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ProblemClient) GetX ¶
func (c *ProblemClient) GetX(ctx context.Context, id int) *Problem
GetX is like Get, but panics if an error occurs.
func (*ProblemClient) Hooks ¶
func (c *ProblemClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ProblemClient) Intercept ¶
func (c *ProblemClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `problem.Intercept(f(g(h())))`.
func (*ProblemClient) Interceptors ¶
func (c *ProblemClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ProblemClient) MapCreateBulk ¶
func (c *ProblemClient) MapCreateBulk(slice any, setFunc func(*ProblemCreate, int)) *ProblemCreateBulk
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 (*ProblemClient) Query ¶
func (c *ProblemClient) Query() *ProblemQuery
Query returns a query builder for Problem.
func (*ProblemClient) QueryJudge ¶
func (c *ProblemClient) QueryJudge(pr *Problem) *JudgeQuery
QueryJudge queries the judge edge of a Problem.
func (*ProblemClient) QuerySubmissions ¶
func (c *ProblemClient) QuerySubmissions(pr *Problem) *SubmissionQuery
QuerySubmissions queries the submissions edge of a Problem.
func (*ProblemClient) Update ¶
func (c *ProblemClient) Update() *ProblemUpdate
Update returns an update builder for Problem.
func (*ProblemClient) UpdateOne ¶
func (c *ProblemClient) UpdateOne(pr *Problem) *ProblemUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ProblemClient) UpdateOneID ¶
func (c *ProblemClient) UpdateOneID(id int) *ProblemUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ProblemClient) Use ¶
func (c *ProblemClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `problem.Hooks(f(g(h())))`.
type ProblemConnection ¶
type ProblemConnection struct { Edges []*ProblemEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
ProblemConnection is the connection containing edges to Problem.
type ProblemCreate ¶
type ProblemCreate struct {
// contains filtered or unexported fields
}
ProblemCreate is the builder for creating a Problem entity.
func (*ProblemCreate) AddSubmissionIDs ¶
func (pc *ProblemCreate) AddSubmissionIDs(ids ...int) *ProblemCreate
AddSubmissionIDs adds the "submissions" edge to the Submission entity by IDs.
func (*ProblemCreate) AddSubmissions ¶
func (pc *ProblemCreate) AddSubmissions(s ...*Submission) *ProblemCreate
AddSubmissions adds the "submissions" edges to the Submission entity.
func (*ProblemCreate) Exec ¶
func (pc *ProblemCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProblemCreate) ExecX ¶
func (pc *ProblemCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProblemCreate) Mutation ¶
func (pc *ProblemCreate) Mutation() *ProblemMutation
Mutation returns the ProblemMutation object of the builder.
func (*ProblemCreate) Save ¶
func (pc *ProblemCreate) Save(ctx context.Context) (*Problem, error)
Save creates the Problem in the database.
func (*ProblemCreate) SaveX ¶
func (pc *ProblemCreate) SaveX(ctx context.Context) *Problem
SaveX calls Save and panics if Save returns an error.
func (*ProblemCreate) SetCode ¶
func (pc *ProblemCreate) SetCode(s string) *ProblemCreate
SetCode sets the "code" field.
func (*ProblemCreate) SetCreatedAt ¶
func (pc *ProblemCreate) SetCreatedAt(t time.Time) *ProblemCreate
SetCreatedAt sets the "created_at" field.
func (*ProblemCreate) SetInput ¶
func (c *ProblemCreate) SetInput(i CreateProblemInput) *ProblemCreate
SetInput applies the change-set in the CreateProblemInput on the ProblemCreate builder.
func (*ProblemCreate) SetJudge ¶
func (pc *ProblemCreate) SetJudge(j *Judge) *ProblemCreate
SetJudge sets the "judge" edge to the Judge entity.
func (*ProblemCreate) SetJudgeID ¶
func (pc *ProblemCreate) SetJudgeID(id int) *ProblemCreate
SetJudgeID sets the "judge" edge to the Judge entity by ID.
func (*ProblemCreate) SetName ¶
func (pc *ProblemCreate) SetName(s string) *ProblemCreate
SetName sets the "name" field.
func (*ProblemCreate) SetNillableCreatedAt ¶
func (pc *ProblemCreate) SetNillableCreatedAt(t *time.Time) *ProblemCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ProblemCreate) SetNillableUpdatedAt ¶
func (pc *ProblemCreate) SetNillableUpdatedAt(t *time.Time) *ProblemCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ProblemCreate) SetUpdatedAt ¶
func (pc *ProblemCreate) SetUpdatedAt(t time.Time) *ProblemCreate
SetUpdatedAt sets the "updated_at" field.
type ProblemCreateBulk ¶
type ProblemCreateBulk struct {
// contains filtered or unexported fields
}
ProblemCreateBulk is the builder for creating many Problem entities in bulk.
func (*ProblemCreateBulk) Exec ¶
func (pcb *ProblemCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProblemCreateBulk) ExecX ¶
func (pcb *ProblemCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ProblemDelete ¶
type ProblemDelete struct {
// contains filtered or unexported fields
}
ProblemDelete is the builder for deleting a Problem entity.
func (*ProblemDelete) Exec ¶
func (pd *ProblemDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ProblemDelete) ExecX ¶
func (pd *ProblemDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ProblemDelete) Where ¶
func (pd *ProblemDelete) Where(ps ...predicate.Problem) *ProblemDelete
Where appends a list predicates to the ProblemDelete builder.
type ProblemDeleteOne ¶
type ProblemDeleteOne struct {
// contains filtered or unexported fields
}
ProblemDeleteOne is the builder for deleting a single Problem entity.
func (*ProblemDeleteOne) Exec ¶
func (pdo *ProblemDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ProblemDeleteOne) ExecX ¶
func (pdo *ProblemDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProblemDeleteOne) Where ¶
func (pdo *ProblemDeleteOne) Where(ps ...predicate.Problem) *ProblemDeleteOne
Where appends a list predicates to the ProblemDelete builder.
type ProblemEdge ¶
ProblemEdge is the edge representation of Problem.
type ProblemEdges ¶
type ProblemEdges struct { // Submissions holds the value of the submissions edge. Submissions []*Submission `json:"submissions,omitempty"` // Judge holds the value of the judge edge. Judge *Judge `json:"judge,omitempty"` // contains filtered or unexported fields }
ProblemEdges holds the relations/edges for other nodes in the graph.
func (ProblemEdges) JudgeOrErr ¶
func (e ProblemEdges) JudgeOrErr() (*Judge, error)
JudgeOrErr returns the Judge value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ProblemEdges) SubmissionsOrErr ¶
func (e ProblemEdges) SubmissionsOrErr() ([]*Submission, error)
SubmissionsOrErr returns the Submissions value or an error if the edge was not loaded in eager-loading.
type ProblemGroupBy ¶
type ProblemGroupBy struct {
// contains filtered or unexported fields
}
ProblemGroupBy is the group-by builder for Problem entities.
func (*ProblemGroupBy) Aggregate ¶
func (pgb *ProblemGroupBy) Aggregate(fns ...AggregateFunc) *ProblemGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ProblemGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProblemGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProblemGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProblemGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProblemGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProblemGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProblemGroupBy) Scan ¶
func (pgb *ProblemGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProblemGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProblemMutation ¶
type ProblemMutation struct {
// contains filtered or unexported fields
}
ProblemMutation represents an operation that mutates the Problem nodes in the graph.
func (*ProblemMutation) AddField ¶
func (m *ProblemMutation) 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 (*ProblemMutation) AddSubmissionIDs ¶
func (m *ProblemMutation) AddSubmissionIDs(ids ...int)
AddSubmissionIDs adds the "submissions" edge to the Submission entity by ids.
func (*ProblemMutation) AddedEdges ¶
func (m *ProblemMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ProblemMutation) AddedField ¶
func (m *ProblemMutation) 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 (*ProblemMutation) AddedFields ¶
func (m *ProblemMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ProblemMutation) AddedIDs ¶
func (m *ProblemMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ProblemMutation) ClearEdge ¶
func (m *ProblemMutation) 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 (*ProblemMutation) ClearField ¶
func (m *ProblemMutation) 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 (*ProblemMutation) ClearJudge ¶
func (m *ProblemMutation) ClearJudge()
ClearJudge clears the "judge" edge to the Judge entity.
func (*ProblemMutation) ClearSubmissions ¶
func (m *ProblemMutation) ClearSubmissions()
ClearSubmissions clears the "submissions" edge to the Submission entity.
func (*ProblemMutation) ClearedEdges ¶
func (m *ProblemMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ProblemMutation) ClearedFields ¶
func (m *ProblemMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ProblemMutation) Client ¶
func (m ProblemMutation) 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 (*ProblemMutation) Code ¶
func (m *ProblemMutation) Code() (r string, exists bool)
Code returns the value of the "code" field in the mutation.
func (*ProblemMutation) CreatedAt ¶
func (m *ProblemMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ProblemMutation) EdgeCleared ¶
func (m *ProblemMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ProblemMutation) Field ¶
func (m *ProblemMutation) 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 (*ProblemMutation) FieldCleared ¶
func (m *ProblemMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ProblemMutation) Fields ¶
func (m *ProblemMutation) 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 (*ProblemMutation) ID ¶
func (m *ProblemMutation) 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 (*ProblemMutation) IDs ¶
func (m *ProblemMutation) 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 (*ProblemMutation) JudgeCleared ¶
func (m *ProblemMutation) JudgeCleared() bool
JudgeCleared reports if the "judge" edge to the Judge entity was cleared.
func (*ProblemMutation) JudgeID ¶
func (m *ProblemMutation) JudgeID() (id int, exists bool)
JudgeID returns the "judge" edge ID in the mutation.
func (*ProblemMutation) JudgeIDs ¶
func (m *ProblemMutation) JudgeIDs() (ids []int)
JudgeIDs returns the "judge" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use JudgeID instead. It exists only for internal usage by the builders.
func (*ProblemMutation) Name ¶
func (m *ProblemMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*ProblemMutation) OldCode ¶
func (m *ProblemMutation) OldCode(ctx context.Context) (v string, err error)
OldCode returns the old "code" field's value of the Problem entity. If the Problem 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 (*ProblemMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Problem entity. If the Problem 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 (*ProblemMutation) OldField ¶
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 (*ProblemMutation) OldName ¶
func (m *ProblemMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Problem entity. If the Problem 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 (*ProblemMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Problem entity. If the Problem 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 (*ProblemMutation) RemoveSubmissionIDs ¶
func (m *ProblemMutation) RemoveSubmissionIDs(ids ...int)
RemoveSubmissionIDs removes the "submissions" edge to the Submission entity by IDs.
func (*ProblemMutation) RemovedEdges ¶
func (m *ProblemMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ProblemMutation) RemovedIDs ¶
func (m *ProblemMutation) 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 (*ProblemMutation) RemovedSubmissionsIDs ¶
func (m *ProblemMutation) RemovedSubmissionsIDs() (ids []int)
RemovedSubmissions returns the removed IDs of the "submissions" edge to the Submission entity.
func (*ProblemMutation) ResetCode ¶
func (m *ProblemMutation) ResetCode()
ResetCode resets all changes to the "code" field.
func (*ProblemMutation) ResetCreatedAt ¶
func (m *ProblemMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ProblemMutation) ResetEdge ¶
func (m *ProblemMutation) 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 (*ProblemMutation) ResetField ¶
func (m *ProblemMutation) 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 (*ProblemMutation) ResetJudge ¶
func (m *ProblemMutation) ResetJudge()
ResetJudge resets all changes to the "judge" edge.
func (*ProblemMutation) ResetName ¶
func (m *ProblemMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*ProblemMutation) ResetSubmissions ¶
func (m *ProblemMutation) ResetSubmissions()
ResetSubmissions resets all changes to the "submissions" edge.
func (*ProblemMutation) ResetUpdatedAt ¶
func (m *ProblemMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*ProblemMutation) SetCode ¶
func (m *ProblemMutation) SetCode(s string)
SetCode sets the "code" field.
func (*ProblemMutation) SetCreatedAt ¶
func (m *ProblemMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ProblemMutation) SetField ¶
func (m *ProblemMutation) 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 (*ProblemMutation) SetJudgeID ¶
func (m *ProblemMutation) SetJudgeID(id int)
SetJudgeID sets the "judge" edge to the Judge entity by id.
func (*ProblemMutation) SetName ¶
func (m *ProblemMutation) SetName(s string)
SetName sets the "name" field.
func (*ProblemMutation) SetOp ¶
func (m *ProblemMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ProblemMutation) SetUpdatedAt ¶
func (m *ProblemMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*ProblemMutation) SubmissionsCleared ¶
func (m *ProblemMutation) SubmissionsCleared() bool
SubmissionsCleared reports if the "submissions" edge to the Submission entity was cleared.
func (*ProblemMutation) SubmissionsIDs ¶
func (m *ProblemMutation) SubmissionsIDs() (ids []int)
SubmissionsIDs returns the "submissions" edge IDs in the mutation.
func (ProblemMutation) Tx ¶
func (m ProblemMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ProblemMutation) Type ¶
func (m *ProblemMutation) Type() string
Type returns the node type of this mutation (Problem).
func (*ProblemMutation) UpdatedAt ¶
func (m *ProblemMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*ProblemMutation) Where ¶
func (m *ProblemMutation) Where(ps ...predicate.Problem)
Where appends a list predicates to the ProblemMutation builder.
func (*ProblemMutation) WhereP ¶
func (m *ProblemMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ProblemMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ProblemOrder ¶
type ProblemOrder struct { Direction OrderDirection `json:"direction"` Field *ProblemOrderField `json:"field"` }
ProblemOrder defines the ordering of Problem.
type ProblemOrderField ¶
type ProblemOrderField struct { // Value extracts the ordering value from the given Problem. Value func(*Problem) (ent.Value, error) // contains filtered or unexported fields }
ProblemOrderField defines the ordering field of Problem.
type ProblemPaginateOption ¶
type ProblemPaginateOption func(*problemPager) error
ProblemPaginateOption enables pagination customization.
func WithProblemFilter ¶
func WithProblemFilter(filter func(*ProblemQuery) (*ProblemQuery, error)) ProblemPaginateOption
WithProblemFilter configures pagination filter.
func WithProblemOrder ¶
func WithProblemOrder(order *ProblemOrder) ProblemPaginateOption
WithProblemOrder configures pagination ordering.
type ProblemQuery ¶
type ProblemQuery struct {
// contains filtered or unexported fields
}
ProblemQuery is the builder for querying Problem entities.
func (*ProblemQuery) Aggregate ¶
func (pq *ProblemQuery) Aggregate(fns ...AggregateFunc) *ProblemSelect
Aggregate returns a ProblemSelect configured with the given aggregations.
func (*ProblemQuery) All ¶
func (pq *ProblemQuery) All(ctx context.Context) ([]*Problem, error)
All executes the query and returns a list of Problems.
func (*ProblemQuery) AllX ¶
func (pq *ProblemQuery) AllX(ctx context.Context) []*Problem
AllX is like All, but panics if an error occurs.
func (*ProblemQuery) Clone ¶
func (pq *ProblemQuery) Clone() *ProblemQuery
Clone returns a duplicate of the ProblemQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ProblemQuery) CollectFields ¶
func (pr *ProblemQuery) CollectFields(ctx context.Context, satisfies ...string) (*ProblemQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*ProblemQuery) Count ¶
func (pq *ProblemQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ProblemQuery) CountX ¶
func (pq *ProblemQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ProblemQuery) Exist ¶
func (pq *ProblemQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ProblemQuery) ExistX ¶
func (pq *ProblemQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ProblemQuery) First ¶
func (pq *ProblemQuery) First(ctx context.Context) (*Problem, error)
First returns the first Problem entity from the query. Returns a *NotFoundError when no Problem was found.
func (*ProblemQuery) FirstID ¶
func (pq *ProblemQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Problem ID from the query. Returns a *NotFoundError when no Problem ID was found.
func (*ProblemQuery) FirstIDX ¶
func (pq *ProblemQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ProblemQuery) FirstX ¶
func (pq *ProblemQuery) FirstX(ctx context.Context) *Problem
FirstX is like First, but panics if an error occurs.
func (*ProblemQuery) GroupBy ¶
func (pq *ProblemQuery) GroupBy(field string, fields ...string) *ProblemGroupBy
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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Problem.Query(). GroupBy(problem.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ProblemQuery) IDs ¶
func (pq *ProblemQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Problem IDs.
func (*ProblemQuery) IDsX ¶
func (pq *ProblemQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ProblemQuery) Limit ¶
func (pq *ProblemQuery) Limit(limit int) *ProblemQuery
Limit the number of records to be returned by this query.
func (*ProblemQuery) Offset ¶
func (pq *ProblemQuery) Offset(offset int) *ProblemQuery
Offset to start from.
func (*ProblemQuery) Only ¶
func (pq *ProblemQuery) Only(ctx context.Context) (*Problem, error)
Only returns a single Problem entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Problem entity is found. Returns a *NotFoundError when no Problem entities are found.
func (*ProblemQuery) OnlyID ¶
func (pq *ProblemQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Problem ID in the query. Returns a *NotSingularError when more than one Problem ID is found. Returns a *NotFoundError when no entities are found.
func (*ProblemQuery) OnlyIDX ¶
func (pq *ProblemQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ProblemQuery) OnlyX ¶
func (pq *ProblemQuery) OnlyX(ctx context.Context) *Problem
OnlyX is like Only, but panics if an error occurs.
func (*ProblemQuery) Order ¶
func (pq *ProblemQuery) Order(o ...problem.OrderOption) *ProblemQuery
Order specifies how the records should be ordered.
func (*ProblemQuery) Paginate ¶
func (pr *ProblemQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...ProblemPaginateOption, ) (*ProblemConnection, error)
Paginate executes the query and returns a relay based cursor connection to Problem.
func (*ProblemQuery) QueryJudge ¶
func (pq *ProblemQuery) QueryJudge() *JudgeQuery
QueryJudge chains the current query on the "judge" edge.
func (*ProblemQuery) QuerySubmissions ¶
func (pq *ProblemQuery) QuerySubmissions() *SubmissionQuery
QuerySubmissions chains the current query on the "submissions" edge.
func (*ProblemQuery) Select ¶
func (pq *ProblemQuery) Select(fields ...string) *ProblemSelect
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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.Problem.Query(). Select(problem.FieldCreatedAt). Scan(ctx, &v)
func (*ProblemQuery) Unique ¶
func (pq *ProblemQuery) Unique(unique bool) *ProblemQuery
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 (*ProblemQuery) Where ¶
func (pq *ProblemQuery) Where(ps ...predicate.Problem) *ProblemQuery
Where adds a new predicate for the ProblemQuery builder.
func (*ProblemQuery) WithJudge ¶
func (pq *ProblemQuery) WithJudge(opts ...func(*JudgeQuery)) *ProblemQuery
WithJudge tells the query-builder to eager-load the nodes that are connected to the "judge" edge. The optional arguments are used to configure the query builder of the edge.
func (*ProblemQuery) WithNamedSubmissions ¶
func (pq *ProblemQuery) WithNamedSubmissions(name string, opts ...func(*SubmissionQuery)) *ProblemQuery
WithNamedSubmissions tells the query-builder to eager-load the nodes that are connected to the "submissions" edge with the given name. The optional arguments are used to configure the query builder of the edge.
func (*ProblemQuery) WithSubmissions ¶
func (pq *ProblemQuery) WithSubmissions(opts ...func(*SubmissionQuery)) *ProblemQuery
WithSubmissions tells the query-builder to eager-load the nodes that are connected to the "submissions" edge. The optional arguments are used to configure the query builder of the edge.
type ProblemSelect ¶
type ProblemSelect struct { *ProblemQuery // contains filtered or unexported fields }
ProblemSelect is the builder for selecting fields of Problem entities.
func (*ProblemSelect) Aggregate ¶
func (ps *ProblemSelect) Aggregate(fns ...AggregateFunc) *ProblemSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ProblemSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProblemSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProblemSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProblemSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProblemSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProblemSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProblemSelect) Scan ¶
func (ps *ProblemSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProblemSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProblemUpdate ¶
type ProblemUpdate struct {
// contains filtered or unexported fields
}
ProblemUpdate is the builder for updating Problem entities.
func (*ProblemUpdate) AddSubmissionIDs ¶
func (pu *ProblemUpdate) AddSubmissionIDs(ids ...int) *ProblemUpdate
AddSubmissionIDs adds the "submissions" edge to the Submission entity by IDs.
func (*ProblemUpdate) AddSubmissions ¶
func (pu *ProblemUpdate) AddSubmissions(s ...*Submission) *ProblemUpdate
AddSubmissions adds the "submissions" edges to the Submission entity.
func (*ProblemUpdate) ClearJudge ¶
func (pu *ProblemUpdate) ClearJudge() *ProblemUpdate
ClearJudge clears the "judge" edge to the Judge entity.
func (*ProblemUpdate) ClearSubmissions ¶
func (pu *ProblemUpdate) ClearSubmissions() *ProblemUpdate
ClearSubmissions clears all "submissions" edges to the Submission entity.
func (*ProblemUpdate) Exec ¶
func (pu *ProblemUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProblemUpdate) ExecX ¶
func (pu *ProblemUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProblemUpdate) Mutation ¶
func (pu *ProblemUpdate) Mutation() *ProblemMutation
Mutation returns the ProblemMutation object of the builder.
func (*ProblemUpdate) RemoveSubmissionIDs ¶
func (pu *ProblemUpdate) RemoveSubmissionIDs(ids ...int) *ProblemUpdate
RemoveSubmissionIDs removes the "submissions" edge to Submission entities by IDs.
func (*ProblemUpdate) RemoveSubmissions ¶
func (pu *ProblemUpdate) RemoveSubmissions(s ...*Submission) *ProblemUpdate
RemoveSubmissions removes "submissions" edges to Submission entities.
func (*ProblemUpdate) Save ¶
func (pu *ProblemUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ProblemUpdate) SaveX ¶
func (pu *ProblemUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ProblemUpdate) SetCode ¶
func (pu *ProblemUpdate) SetCode(s string) *ProblemUpdate
SetCode sets the "code" field.
func (*ProblemUpdate) SetInput ¶
func (c *ProblemUpdate) SetInput(i UpdateProblemInput) *ProblemUpdate
SetInput applies the change-set in the UpdateProblemInput on the ProblemUpdate builder.
func (*ProblemUpdate) SetJudge ¶
func (pu *ProblemUpdate) SetJudge(j *Judge) *ProblemUpdate
SetJudge sets the "judge" edge to the Judge entity.
func (*ProblemUpdate) SetJudgeID ¶
func (pu *ProblemUpdate) SetJudgeID(id int) *ProblemUpdate
SetJudgeID sets the "judge" edge to the Judge entity by ID.
func (*ProblemUpdate) SetName ¶
func (pu *ProblemUpdate) SetName(s string) *ProblemUpdate
SetName sets the "name" field.
func (*ProblemUpdate) SetNillableCode ¶
func (pu *ProblemUpdate) SetNillableCode(s *string) *ProblemUpdate
SetNillableCode sets the "code" field if the given value is not nil.
func (*ProblemUpdate) SetNillableName ¶
func (pu *ProblemUpdate) SetNillableName(s *string) *ProblemUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*ProblemUpdate) SetUpdatedAt ¶
func (pu *ProblemUpdate) SetUpdatedAt(t time.Time) *ProblemUpdate
SetUpdatedAt sets the "updated_at" field.
func (*ProblemUpdate) Where ¶
func (pu *ProblemUpdate) Where(ps ...predicate.Problem) *ProblemUpdate
Where appends a list predicates to the ProblemUpdate builder.
type ProblemUpdateOne ¶
type ProblemUpdateOne struct {
// contains filtered or unexported fields
}
ProblemUpdateOne is the builder for updating a single Problem entity.
func (*ProblemUpdateOne) AddSubmissionIDs ¶
func (puo *ProblemUpdateOne) AddSubmissionIDs(ids ...int) *ProblemUpdateOne
AddSubmissionIDs adds the "submissions" edge to the Submission entity by IDs.
func (*ProblemUpdateOne) AddSubmissions ¶
func (puo *ProblemUpdateOne) AddSubmissions(s ...*Submission) *ProblemUpdateOne
AddSubmissions adds the "submissions" edges to the Submission entity.
func (*ProblemUpdateOne) ClearJudge ¶
func (puo *ProblemUpdateOne) ClearJudge() *ProblemUpdateOne
ClearJudge clears the "judge" edge to the Judge entity.
func (*ProblemUpdateOne) ClearSubmissions ¶
func (puo *ProblemUpdateOne) ClearSubmissions() *ProblemUpdateOne
ClearSubmissions clears all "submissions" edges to the Submission entity.
func (*ProblemUpdateOne) Exec ¶
func (puo *ProblemUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ProblemUpdateOne) ExecX ¶
func (puo *ProblemUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProblemUpdateOne) Mutation ¶
func (puo *ProblemUpdateOne) Mutation() *ProblemMutation
Mutation returns the ProblemMutation object of the builder.
func (*ProblemUpdateOne) RemoveSubmissionIDs ¶
func (puo *ProblemUpdateOne) RemoveSubmissionIDs(ids ...int) *ProblemUpdateOne
RemoveSubmissionIDs removes the "submissions" edge to Submission entities by IDs.
func (*ProblemUpdateOne) RemoveSubmissions ¶
func (puo *ProblemUpdateOne) RemoveSubmissions(s ...*Submission) *ProblemUpdateOne
RemoveSubmissions removes "submissions" edges to Submission entities.
func (*ProblemUpdateOne) Save ¶
func (puo *ProblemUpdateOne) Save(ctx context.Context) (*Problem, error)
Save executes the query and returns the updated Problem entity.
func (*ProblemUpdateOne) SaveX ¶
func (puo *ProblemUpdateOne) SaveX(ctx context.Context) *Problem
SaveX is like Save, but panics if an error occurs.
func (*ProblemUpdateOne) Select ¶
func (puo *ProblemUpdateOne) Select(field string, fields ...string) *ProblemUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ProblemUpdateOne) SetCode ¶
func (puo *ProblemUpdateOne) SetCode(s string) *ProblemUpdateOne
SetCode sets the "code" field.
func (*ProblemUpdateOne) SetInput ¶
func (c *ProblemUpdateOne) SetInput(i UpdateProblemInput) *ProblemUpdateOne
SetInput applies the change-set in the UpdateProblemInput on the ProblemUpdateOne builder.
func (*ProblemUpdateOne) SetJudge ¶
func (puo *ProblemUpdateOne) SetJudge(j *Judge) *ProblemUpdateOne
SetJudge sets the "judge" edge to the Judge entity.
func (*ProblemUpdateOne) SetJudgeID ¶
func (puo *ProblemUpdateOne) SetJudgeID(id int) *ProblemUpdateOne
SetJudgeID sets the "judge" edge to the Judge entity by ID.
func (*ProblemUpdateOne) SetName ¶
func (puo *ProblemUpdateOne) SetName(s string) *ProblemUpdateOne
SetName sets the "name" field.
func (*ProblemUpdateOne) SetNillableCode ¶
func (puo *ProblemUpdateOne) SetNillableCode(s *string) *ProblemUpdateOne
SetNillableCode sets the "code" field if the given value is not nil.
func (*ProblemUpdateOne) SetNillableName ¶
func (puo *ProblemUpdateOne) SetNillableName(s *string) *ProblemUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*ProblemUpdateOne) SetUpdatedAt ¶
func (puo *ProblemUpdateOne) SetUpdatedAt(t time.Time) *ProblemUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*ProblemUpdateOne) Where ¶
func (puo *ProblemUpdateOne) Where(ps ...predicate.Problem) *ProblemUpdateOne
Where appends a list predicates to the ProblemUpdate builder.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
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 ¶
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.
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 ¶
Rollbacker is the interface that wraps the Rollback method.
type Submission ¶
type Submission struct { // ID of the ent. ID int `json:"id,omitempty"` // Time when the entity was created. CreatedAt time.Time `json:"created_at,omitempty"` // Time when the entity was last updated. UpdatedAt time.Time `json:"updated_at,omitempty"` // Status of the submission. Example: finished Status submission.Status `json:"status,omitempty"` // Verdict of the submission. Example: OK Verdict submission.Verdict `json:"verdict,omitempty"` // Number of test cases finished or currently judging. Example: 13 TestCount int `json:"test_count,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the SubmissionQuery when eager-loading is set. Edges SubmissionEdges `json:"edges"` // contains filtered or unexported fields }
Submission is the model entity for the Submission schema.
func (*Submission) IsNode ¶
func (*Submission) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Submission) QueryProblem ¶
func (s *Submission) QueryProblem() *ProblemQuery
QueryProblem queries the "problem" edge of the Submission entity.
func (*Submission) String ¶
func (s *Submission) String() string
String implements the fmt.Stringer.
func (*Submission) ToEdge ¶
func (s *Submission) ToEdge(order *SubmissionOrder) *SubmissionEdge
ToEdge converts Submission into SubmissionEdge.
func (*Submission) Unwrap ¶
func (s *Submission) Unwrap() *Submission
Unwrap unwraps the Submission 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 (*Submission) Update ¶
func (s *Submission) Update() *SubmissionUpdateOne
Update returns a builder for updating this Submission. Note that you need to call Submission.Unwrap() before calling this method if this Submission was returned from a transaction, and the transaction was committed or rolled back.
type SubmissionClient ¶
type SubmissionClient struct {
// contains filtered or unexported fields
}
SubmissionClient is a client for the Submission schema.
func NewSubmissionClient ¶
func NewSubmissionClient(c config) *SubmissionClient
NewSubmissionClient returns a client for the Submission from the given config.
func (*SubmissionClient) Create ¶
func (c *SubmissionClient) Create() *SubmissionCreate
Create returns a builder for creating a Submission entity.
func (*SubmissionClient) CreateBulk ¶
func (c *SubmissionClient) CreateBulk(builders ...*SubmissionCreate) *SubmissionCreateBulk
CreateBulk returns a builder for creating a bulk of Submission entities.
func (*SubmissionClient) Delete ¶
func (c *SubmissionClient) Delete() *SubmissionDelete
Delete returns a delete builder for Submission.
func (*SubmissionClient) DeleteOne ¶
func (c *SubmissionClient) DeleteOne(s *Submission) *SubmissionDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SubmissionClient) DeleteOneID ¶
func (c *SubmissionClient) DeleteOneID(id int) *SubmissionDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SubmissionClient) Get ¶
func (c *SubmissionClient) Get(ctx context.Context, id int) (*Submission, error)
Get returns a Submission entity by its id.
func (*SubmissionClient) GetX ¶
func (c *SubmissionClient) GetX(ctx context.Context, id int) *Submission
GetX is like Get, but panics if an error occurs.
func (*SubmissionClient) Hooks ¶
func (c *SubmissionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*SubmissionClient) Intercept ¶
func (c *SubmissionClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `submission.Intercept(f(g(h())))`.
func (*SubmissionClient) Interceptors ¶
func (c *SubmissionClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SubmissionClient) MapCreateBulk ¶
func (c *SubmissionClient) MapCreateBulk(slice any, setFunc func(*SubmissionCreate, int)) *SubmissionCreateBulk
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 (*SubmissionClient) Query ¶
func (c *SubmissionClient) Query() *SubmissionQuery
Query returns a query builder for Submission.
func (*SubmissionClient) QueryProblem ¶
func (c *SubmissionClient) QueryProblem(s *Submission) *ProblemQuery
QueryProblem queries the problem edge of a Submission.
func (*SubmissionClient) Update ¶
func (c *SubmissionClient) Update() *SubmissionUpdate
Update returns an update builder for Submission.
func (*SubmissionClient) UpdateOne ¶
func (c *SubmissionClient) UpdateOne(s *Submission) *SubmissionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SubmissionClient) UpdateOneID ¶
func (c *SubmissionClient) UpdateOneID(id int) *SubmissionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SubmissionClient) Use ¶
func (c *SubmissionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `submission.Hooks(f(g(h())))`.
type SubmissionConnection ¶
type SubmissionConnection struct { Edges []*SubmissionEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
SubmissionConnection is the connection containing edges to Submission.
type SubmissionCreate ¶
type SubmissionCreate struct {
// contains filtered or unexported fields
}
SubmissionCreate is the builder for creating a Submission entity.
func (*SubmissionCreate) Exec ¶
func (sc *SubmissionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SubmissionCreate) ExecX ¶
func (sc *SubmissionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SubmissionCreate) Mutation ¶
func (sc *SubmissionCreate) Mutation() *SubmissionMutation
Mutation returns the SubmissionMutation object of the builder.
func (*SubmissionCreate) Save ¶
func (sc *SubmissionCreate) Save(ctx context.Context) (*Submission, error)
Save creates the Submission in the database.
func (*SubmissionCreate) SaveX ¶
func (sc *SubmissionCreate) SaveX(ctx context.Context) *Submission
SaveX calls Save and panics if Save returns an error.
func (*SubmissionCreate) SetCreatedAt ¶
func (sc *SubmissionCreate) SetCreatedAt(t time.Time) *SubmissionCreate
SetCreatedAt sets the "created_at" field.
func (*SubmissionCreate) SetInput ¶
func (c *SubmissionCreate) SetInput(i CreateSubmissionInput) *SubmissionCreate
SetInput applies the change-set in the CreateSubmissionInput on the SubmissionCreate builder.
func (*SubmissionCreate) SetNillableCreatedAt ¶
func (sc *SubmissionCreate) SetNillableCreatedAt(t *time.Time) *SubmissionCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*SubmissionCreate) SetNillableStatus ¶
func (sc *SubmissionCreate) SetNillableStatus(s *submission.Status) *SubmissionCreate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*SubmissionCreate) SetNillableTestCount ¶
func (sc *SubmissionCreate) SetNillableTestCount(i *int) *SubmissionCreate
SetNillableTestCount sets the "test_count" field if the given value is not nil.
func (*SubmissionCreate) SetNillableUpdatedAt ¶
func (sc *SubmissionCreate) SetNillableUpdatedAt(t *time.Time) *SubmissionCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*SubmissionCreate) SetNillableVerdict ¶
func (sc *SubmissionCreate) SetNillableVerdict(s *submission.Verdict) *SubmissionCreate
SetNillableVerdict sets the "verdict" field if the given value is not nil.
func (*SubmissionCreate) SetProblem ¶
func (sc *SubmissionCreate) SetProblem(p *Problem) *SubmissionCreate
SetProblem sets the "problem" edge to the Problem entity.
func (*SubmissionCreate) SetProblemID ¶
func (sc *SubmissionCreate) SetProblemID(id int) *SubmissionCreate
SetProblemID sets the "problem" edge to the Problem entity by ID.
func (*SubmissionCreate) SetStatus ¶
func (sc *SubmissionCreate) SetStatus(s submission.Status) *SubmissionCreate
SetStatus sets the "status" field.
func (*SubmissionCreate) SetTestCount ¶
func (sc *SubmissionCreate) SetTestCount(i int) *SubmissionCreate
SetTestCount sets the "test_count" field.
func (*SubmissionCreate) SetUpdatedAt ¶
func (sc *SubmissionCreate) SetUpdatedAt(t time.Time) *SubmissionCreate
SetUpdatedAt sets the "updated_at" field.
func (*SubmissionCreate) SetVerdict ¶
func (sc *SubmissionCreate) SetVerdict(s submission.Verdict) *SubmissionCreate
SetVerdict sets the "verdict" field.
type SubmissionCreateBulk ¶
type SubmissionCreateBulk struct {
// contains filtered or unexported fields
}
SubmissionCreateBulk is the builder for creating many Submission entities in bulk.
func (*SubmissionCreateBulk) Exec ¶
func (scb *SubmissionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SubmissionCreateBulk) ExecX ¶
func (scb *SubmissionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SubmissionCreateBulk) Save ¶
func (scb *SubmissionCreateBulk) Save(ctx context.Context) ([]*Submission, error)
Save creates the Submission entities in the database.
func (*SubmissionCreateBulk) SaveX ¶
func (scb *SubmissionCreateBulk) SaveX(ctx context.Context) []*Submission
SaveX is like Save, but panics if an error occurs.
type SubmissionDelete ¶
type SubmissionDelete struct {
// contains filtered or unexported fields
}
SubmissionDelete is the builder for deleting a Submission entity.
func (*SubmissionDelete) Exec ¶
func (sd *SubmissionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SubmissionDelete) ExecX ¶
func (sd *SubmissionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SubmissionDelete) Where ¶
func (sd *SubmissionDelete) Where(ps ...predicate.Submission) *SubmissionDelete
Where appends a list predicates to the SubmissionDelete builder.
type SubmissionDeleteOne ¶
type SubmissionDeleteOne struct {
// contains filtered or unexported fields
}
SubmissionDeleteOne is the builder for deleting a single Submission entity.
func (*SubmissionDeleteOne) Exec ¶
func (sdo *SubmissionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SubmissionDeleteOne) ExecX ¶
func (sdo *SubmissionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SubmissionDeleteOne) Where ¶
func (sdo *SubmissionDeleteOne) Where(ps ...predicate.Submission) *SubmissionDeleteOne
Where appends a list predicates to the SubmissionDelete builder.
type SubmissionEdge ¶
type SubmissionEdge struct { Node *Submission `json:"node"` Cursor Cursor `json:"cursor"` }
SubmissionEdge is the edge representation of Submission.
type SubmissionEdges ¶
type SubmissionEdges struct { // Problem holds the value of the problem edge. Problem *Problem `json:"problem,omitempty"` // contains filtered or unexported fields }
SubmissionEdges holds the relations/edges for other nodes in the graph.
func (SubmissionEdges) ProblemOrErr ¶
func (e SubmissionEdges) ProblemOrErr() (*Problem, error)
ProblemOrErr returns the Problem value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type SubmissionGroupBy ¶
type SubmissionGroupBy struct {
// contains filtered or unexported fields
}
SubmissionGroupBy is the group-by builder for Submission entities.
func (*SubmissionGroupBy) Aggregate ¶
func (sgb *SubmissionGroupBy) Aggregate(fns ...AggregateFunc) *SubmissionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SubmissionGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SubmissionGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SubmissionGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SubmissionGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SubmissionGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SubmissionGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SubmissionGroupBy) Scan ¶
func (sgb *SubmissionGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SubmissionGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SubmissionMutation ¶
type SubmissionMutation struct {
// contains filtered or unexported fields
}
SubmissionMutation represents an operation that mutates the Submission nodes in the graph.
func (*SubmissionMutation) AddField ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) AddTestCount ¶
func (m *SubmissionMutation) AddTestCount(i int)
AddTestCount adds i to the "test_count" field.
func (*SubmissionMutation) AddedEdges ¶
func (m *SubmissionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SubmissionMutation) AddedField ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) AddedFields ¶
func (m *SubmissionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SubmissionMutation) AddedIDs ¶
func (m *SubmissionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SubmissionMutation) AddedTestCount ¶
func (m *SubmissionMutation) AddedTestCount() (r int, exists bool)
AddedTestCount returns the value that was added to the "test_count" field in this mutation.
func (*SubmissionMutation) ClearEdge ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) ClearField ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) ClearProblem ¶
func (m *SubmissionMutation) ClearProblem()
ClearProblem clears the "problem" edge to the Problem entity.
func (*SubmissionMutation) ClearedEdges ¶
func (m *SubmissionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SubmissionMutation) ClearedFields ¶
func (m *SubmissionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SubmissionMutation) Client ¶
func (m SubmissionMutation) 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 (*SubmissionMutation) CreatedAt ¶
func (m *SubmissionMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*SubmissionMutation) EdgeCleared ¶
func (m *SubmissionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SubmissionMutation) Field ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) FieldCleared ¶
func (m *SubmissionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SubmissionMutation) Fields ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) ID ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) IDs ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldField ¶
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 (*SubmissionMutation) OldStatus ¶
func (m *SubmissionMutation) OldStatus(ctx context.Context) (v submission.Status, err error)
OldStatus returns the old "status" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldTestCount ¶
func (m *SubmissionMutation) OldTestCount(ctx context.Context) (v int, err error)
OldTestCount returns the old "test_count" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldVerdict ¶
func (m *SubmissionMutation) OldVerdict(ctx context.Context) (v submission.Verdict, err error)
OldVerdict returns the old "verdict" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) ProblemCleared ¶
func (m *SubmissionMutation) ProblemCleared() bool
ProblemCleared reports if the "problem" edge to the Problem entity was cleared.
func (*SubmissionMutation) ProblemID ¶
func (m *SubmissionMutation) ProblemID() (id int, exists bool)
ProblemID returns the "problem" edge ID in the mutation.
func (*SubmissionMutation) ProblemIDs ¶
func (m *SubmissionMutation) ProblemIDs() (ids []int)
ProblemIDs returns the "problem" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProblemID instead. It exists only for internal usage by the builders.
func (*SubmissionMutation) RemovedEdges ¶
func (m *SubmissionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SubmissionMutation) RemovedIDs ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) ResetCreatedAt ¶
func (m *SubmissionMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*SubmissionMutation) ResetEdge ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) ResetField ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) ResetProblem ¶
func (m *SubmissionMutation) ResetProblem()
ResetProblem resets all changes to the "problem" edge.
func (*SubmissionMutation) ResetStatus ¶
func (m *SubmissionMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*SubmissionMutation) ResetTestCount ¶
func (m *SubmissionMutation) ResetTestCount()
ResetTestCount resets all changes to the "test_count" field.
func (*SubmissionMutation) ResetUpdatedAt ¶
func (m *SubmissionMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*SubmissionMutation) ResetVerdict ¶
func (m *SubmissionMutation) ResetVerdict()
ResetVerdict resets all changes to the "verdict" field.
func (*SubmissionMutation) SetCreatedAt ¶
func (m *SubmissionMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*SubmissionMutation) SetField ¶
func (m *SubmissionMutation) 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 (*SubmissionMutation) SetOp ¶
func (m *SubmissionMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*SubmissionMutation) SetProblemID ¶
func (m *SubmissionMutation) SetProblemID(id int)
SetProblemID sets the "problem" edge to the Problem entity by id.
func (*SubmissionMutation) SetStatus ¶
func (m *SubmissionMutation) SetStatus(s submission.Status)
SetStatus sets the "status" field.
func (*SubmissionMutation) SetTestCount ¶
func (m *SubmissionMutation) SetTestCount(i int)
SetTestCount sets the "test_count" field.
func (*SubmissionMutation) SetUpdatedAt ¶
func (m *SubmissionMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*SubmissionMutation) SetVerdict ¶
func (m *SubmissionMutation) SetVerdict(s submission.Verdict)
SetVerdict sets the "verdict" field.
func (*SubmissionMutation) Status ¶
func (m *SubmissionMutation) Status() (r submission.Status, exists bool)
Status returns the value of the "status" field in the mutation.
func (*SubmissionMutation) TestCount ¶
func (m *SubmissionMutation) TestCount() (r int, exists bool)
TestCount returns the value of the "test_count" field in the mutation.
func (SubmissionMutation) Tx ¶
func (m SubmissionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SubmissionMutation) Type ¶
func (m *SubmissionMutation) Type() string
Type returns the node type of this mutation (Submission).
func (*SubmissionMutation) UpdatedAt ¶
func (m *SubmissionMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*SubmissionMutation) Verdict ¶
func (m *SubmissionMutation) Verdict() (r submission.Verdict, exists bool)
Verdict returns the value of the "verdict" field in the mutation.
func (*SubmissionMutation) Where ¶
func (m *SubmissionMutation) Where(ps ...predicate.Submission)
Where appends a list predicates to the SubmissionMutation builder.
func (*SubmissionMutation) WhereP ¶
func (m *SubmissionMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SubmissionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type SubmissionOrder ¶
type SubmissionOrder struct { Direction OrderDirection `json:"direction"` Field *SubmissionOrderField `json:"field"` }
SubmissionOrder defines the ordering of Submission.
type SubmissionOrderField ¶
type SubmissionOrderField struct { // Value extracts the ordering value from the given Submission. Value func(*Submission) (ent.Value, error) // contains filtered or unexported fields }
SubmissionOrderField defines the ordering field of Submission.
type SubmissionPaginateOption ¶
type SubmissionPaginateOption func(*submissionPager) error
SubmissionPaginateOption enables pagination customization.
func WithSubmissionFilter ¶
func WithSubmissionFilter(filter func(*SubmissionQuery) (*SubmissionQuery, error)) SubmissionPaginateOption
WithSubmissionFilter configures pagination filter.
func WithSubmissionOrder ¶
func WithSubmissionOrder(order *SubmissionOrder) SubmissionPaginateOption
WithSubmissionOrder configures pagination ordering.
type SubmissionQuery ¶
type SubmissionQuery struct {
// contains filtered or unexported fields
}
SubmissionQuery is the builder for querying Submission entities.
func (*SubmissionQuery) Aggregate ¶
func (sq *SubmissionQuery) Aggregate(fns ...AggregateFunc) *SubmissionSelect
Aggregate returns a SubmissionSelect configured with the given aggregations.
func (*SubmissionQuery) All ¶
func (sq *SubmissionQuery) All(ctx context.Context) ([]*Submission, error)
All executes the query and returns a list of Submissions.
func (*SubmissionQuery) AllX ¶
func (sq *SubmissionQuery) AllX(ctx context.Context) []*Submission
AllX is like All, but panics if an error occurs.
func (*SubmissionQuery) Clone ¶
func (sq *SubmissionQuery) Clone() *SubmissionQuery
Clone returns a duplicate of the SubmissionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SubmissionQuery) CollectFields ¶
func (s *SubmissionQuery) CollectFields(ctx context.Context, satisfies ...string) (*SubmissionQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*SubmissionQuery) Count ¶
func (sq *SubmissionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SubmissionQuery) CountX ¶
func (sq *SubmissionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SubmissionQuery) Exist ¶
func (sq *SubmissionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SubmissionQuery) ExistX ¶
func (sq *SubmissionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SubmissionQuery) First ¶
func (sq *SubmissionQuery) First(ctx context.Context) (*Submission, error)
First returns the first Submission entity from the query. Returns a *NotFoundError when no Submission was found.
func (*SubmissionQuery) FirstID ¶
func (sq *SubmissionQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Submission ID from the query. Returns a *NotFoundError when no Submission ID was found.
func (*SubmissionQuery) FirstIDX ¶
func (sq *SubmissionQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*SubmissionQuery) FirstX ¶
func (sq *SubmissionQuery) FirstX(ctx context.Context) *Submission
FirstX is like First, but panics if an error occurs.
func (*SubmissionQuery) GroupBy ¶
func (sq *SubmissionQuery) GroupBy(field string, fields ...string) *SubmissionGroupBy
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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Submission.Query(). GroupBy(submission.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*SubmissionQuery) IDs ¶
func (sq *SubmissionQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Submission IDs.
func (*SubmissionQuery) IDsX ¶
func (sq *SubmissionQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*SubmissionQuery) Limit ¶
func (sq *SubmissionQuery) Limit(limit int) *SubmissionQuery
Limit the number of records to be returned by this query.
func (*SubmissionQuery) Offset ¶
func (sq *SubmissionQuery) Offset(offset int) *SubmissionQuery
Offset to start from.
func (*SubmissionQuery) Only ¶
func (sq *SubmissionQuery) Only(ctx context.Context) (*Submission, error)
Only returns a single Submission entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Submission entity is found. Returns a *NotFoundError when no Submission entities are found.
func (*SubmissionQuery) OnlyID ¶
func (sq *SubmissionQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Submission ID in the query. Returns a *NotSingularError when more than one Submission ID is found. Returns a *NotFoundError when no entities are found.
func (*SubmissionQuery) OnlyIDX ¶
func (sq *SubmissionQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SubmissionQuery) OnlyX ¶
func (sq *SubmissionQuery) OnlyX(ctx context.Context) *Submission
OnlyX is like Only, but panics if an error occurs.
func (*SubmissionQuery) Order ¶
func (sq *SubmissionQuery) Order(o ...submission.OrderOption) *SubmissionQuery
Order specifies how the records should be ordered.
func (*SubmissionQuery) Paginate ¶
func (s *SubmissionQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...SubmissionPaginateOption, ) (*SubmissionConnection, error)
Paginate executes the query and returns a relay based cursor connection to Submission.
func (*SubmissionQuery) QueryProblem ¶
func (sq *SubmissionQuery) QueryProblem() *ProblemQuery
QueryProblem chains the current query on the "problem" edge.
func (*SubmissionQuery) Select ¶
func (sq *SubmissionQuery) Select(fields ...string) *SubmissionSelect
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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.Submission.Query(). Select(submission.FieldCreatedAt). Scan(ctx, &v)
func (*SubmissionQuery) Unique ¶
func (sq *SubmissionQuery) Unique(unique bool) *SubmissionQuery
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 (*SubmissionQuery) Where ¶
func (sq *SubmissionQuery) Where(ps ...predicate.Submission) *SubmissionQuery
Where adds a new predicate for the SubmissionQuery builder.
func (*SubmissionQuery) WithProblem ¶
func (sq *SubmissionQuery) WithProblem(opts ...func(*ProblemQuery)) *SubmissionQuery
WithProblem tells the query-builder to eager-load the nodes that are connected to the "problem" edge. The optional arguments are used to configure the query builder of the edge.
type SubmissionSelect ¶
type SubmissionSelect struct { *SubmissionQuery // contains filtered or unexported fields }
SubmissionSelect is the builder for selecting fields of Submission entities.
func (*SubmissionSelect) Aggregate ¶
func (ss *SubmissionSelect) Aggregate(fns ...AggregateFunc) *SubmissionSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SubmissionSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SubmissionSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SubmissionSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SubmissionSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SubmissionSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SubmissionSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SubmissionSelect) Scan ¶
func (ss *SubmissionSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SubmissionSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SubmissionUpdate ¶
type SubmissionUpdate struct {
// contains filtered or unexported fields
}
SubmissionUpdate is the builder for updating Submission entities.
func (*SubmissionUpdate) AddTestCount ¶
func (su *SubmissionUpdate) AddTestCount(i int) *SubmissionUpdate
AddTestCount adds i to the "test_count" field.
func (*SubmissionUpdate) ClearProblem ¶
func (su *SubmissionUpdate) ClearProblem() *SubmissionUpdate
ClearProblem clears the "problem" edge to the Problem entity.
func (*SubmissionUpdate) Exec ¶
func (su *SubmissionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SubmissionUpdate) ExecX ¶
func (su *SubmissionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SubmissionUpdate) Mutation ¶
func (su *SubmissionUpdate) Mutation() *SubmissionMutation
Mutation returns the SubmissionMutation object of the builder.
func (*SubmissionUpdate) Save ¶
func (su *SubmissionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SubmissionUpdate) SaveX ¶
func (su *SubmissionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SubmissionUpdate) SetInput ¶
func (c *SubmissionUpdate) SetInput(i UpdateSubmissionInput) *SubmissionUpdate
SetInput applies the change-set in the UpdateSubmissionInput on the SubmissionUpdate builder.
func (*SubmissionUpdate) SetNillableStatus ¶
func (su *SubmissionUpdate) SetNillableStatus(s *submission.Status) *SubmissionUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*SubmissionUpdate) SetNillableTestCount ¶
func (su *SubmissionUpdate) SetNillableTestCount(i *int) *SubmissionUpdate
SetNillableTestCount sets the "test_count" field if the given value is not nil.
func (*SubmissionUpdate) SetNillableVerdict ¶
func (su *SubmissionUpdate) SetNillableVerdict(s *submission.Verdict) *SubmissionUpdate
SetNillableVerdict sets the "verdict" field if the given value is not nil.
func (*SubmissionUpdate) SetProblem ¶
func (su *SubmissionUpdate) SetProblem(p *Problem) *SubmissionUpdate
SetProblem sets the "problem" edge to the Problem entity.
func (*SubmissionUpdate) SetProblemID ¶
func (su *SubmissionUpdate) SetProblemID(id int) *SubmissionUpdate
SetProblemID sets the "problem" edge to the Problem entity by ID.
func (*SubmissionUpdate) SetStatus ¶
func (su *SubmissionUpdate) SetStatus(s submission.Status) *SubmissionUpdate
SetStatus sets the "status" field.
func (*SubmissionUpdate) SetTestCount ¶
func (su *SubmissionUpdate) SetTestCount(i int) *SubmissionUpdate
SetTestCount sets the "test_count" field.
func (*SubmissionUpdate) SetUpdatedAt ¶
func (su *SubmissionUpdate) SetUpdatedAt(t time.Time) *SubmissionUpdate
SetUpdatedAt sets the "updated_at" field.
func (*SubmissionUpdate) SetVerdict ¶
func (su *SubmissionUpdate) SetVerdict(s submission.Verdict) *SubmissionUpdate
SetVerdict sets the "verdict" field.
func (*SubmissionUpdate) Where ¶
func (su *SubmissionUpdate) Where(ps ...predicate.Submission) *SubmissionUpdate
Where appends a list predicates to the SubmissionUpdate builder.
type SubmissionUpdateOne ¶
type SubmissionUpdateOne struct {
// contains filtered or unexported fields
}
SubmissionUpdateOne is the builder for updating a single Submission entity.
func (*SubmissionUpdateOne) AddTestCount ¶
func (suo *SubmissionUpdateOne) AddTestCount(i int) *SubmissionUpdateOne
AddTestCount adds i to the "test_count" field.
func (*SubmissionUpdateOne) ClearProblem ¶
func (suo *SubmissionUpdateOne) ClearProblem() *SubmissionUpdateOne
ClearProblem clears the "problem" edge to the Problem entity.
func (*SubmissionUpdateOne) Exec ¶
func (suo *SubmissionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SubmissionUpdateOne) ExecX ¶
func (suo *SubmissionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SubmissionUpdateOne) Mutation ¶
func (suo *SubmissionUpdateOne) Mutation() *SubmissionMutation
Mutation returns the SubmissionMutation object of the builder.
func (*SubmissionUpdateOne) Save ¶
func (suo *SubmissionUpdateOne) Save(ctx context.Context) (*Submission, error)
Save executes the query and returns the updated Submission entity.
func (*SubmissionUpdateOne) SaveX ¶
func (suo *SubmissionUpdateOne) SaveX(ctx context.Context) *Submission
SaveX is like Save, but panics if an error occurs.
func (*SubmissionUpdateOne) Select ¶
func (suo *SubmissionUpdateOne) Select(field string, fields ...string) *SubmissionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SubmissionUpdateOne) SetInput ¶
func (c *SubmissionUpdateOne) SetInput(i UpdateSubmissionInput) *SubmissionUpdateOne
SetInput applies the change-set in the UpdateSubmissionInput on the SubmissionUpdateOne builder.
func (*SubmissionUpdateOne) SetNillableStatus ¶
func (suo *SubmissionUpdateOne) SetNillableStatus(s *submission.Status) *SubmissionUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*SubmissionUpdateOne) SetNillableTestCount ¶
func (suo *SubmissionUpdateOne) SetNillableTestCount(i *int) *SubmissionUpdateOne
SetNillableTestCount sets the "test_count" field if the given value is not nil.
func (*SubmissionUpdateOne) SetNillableVerdict ¶
func (suo *SubmissionUpdateOne) SetNillableVerdict(s *submission.Verdict) *SubmissionUpdateOne
SetNillableVerdict sets the "verdict" field if the given value is not nil.
func (*SubmissionUpdateOne) SetProblem ¶
func (suo *SubmissionUpdateOne) SetProblem(p *Problem) *SubmissionUpdateOne
SetProblem sets the "problem" edge to the Problem entity.
func (*SubmissionUpdateOne) SetProblemID ¶
func (suo *SubmissionUpdateOne) SetProblemID(id int) *SubmissionUpdateOne
SetProblemID sets the "problem" edge to the Problem entity by ID.
func (*SubmissionUpdateOne) SetStatus ¶
func (suo *SubmissionUpdateOne) SetStatus(s submission.Status) *SubmissionUpdateOne
SetStatus sets the "status" field.
func (*SubmissionUpdateOne) SetTestCount ¶
func (suo *SubmissionUpdateOne) SetTestCount(i int) *SubmissionUpdateOne
SetTestCount sets the "test_count" field.
func (*SubmissionUpdateOne) SetUpdatedAt ¶
func (suo *SubmissionUpdateOne) SetUpdatedAt(t time.Time) *SubmissionUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*SubmissionUpdateOne) SetVerdict ¶
func (suo *SubmissionUpdateOne) SetVerdict(s submission.Verdict) *SubmissionUpdateOne
SetVerdict sets the "verdict" field.
func (*SubmissionUpdateOne) Where ¶
func (suo *SubmissionUpdateOne) Where(ps ...predicate.Submission) *SubmissionUpdateOne
Where appends a list predicates to the SubmissionUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Judge is the client for interacting with the Judge builders. Judge *JudgeClient // Problem is the client for interacting with the Problem builders. Problem *ProblemClient // Submission is the client for interacting with the Submission builders. Submission *SubmissionClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type UpdateJudgeInput ¶
type UpdateJudgeInput struct { UpdatedAt *time.Time Name *string Code *string Type *judge.Type Configuration *string ClearProblems bool AddProblemIDs []int RemoveProblemIDs []int }
UpdateJudgeInput represents a mutation input for updating judges.
func (*UpdateJudgeInput) Mutate ¶
func (i *UpdateJudgeInput) Mutate(m *JudgeMutation)
Mutate applies the UpdateJudgeInput on the JudgeMutation builder.
type UpdateProblemInput ¶
type UpdateProblemInput struct { UpdatedAt *time.Time Name *string Code *string ClearSubmissions bool AddSubmissionIDs []int RemoveSubmissionIDs []int JudgeID *int }
UpdateProblemInput represents a mutation input for updating problems.
func (*UpdateProblemInput) Mutate ¶
func (i *UpdateProblemInput) Mutate(m *ProblemMutation)
Mutate applies the UpdateProblemInput on the ProblemMutation builder.
type UpdateSubmissionInput ¶
type UpdateSubmissionInput struct { UpdatedAt *time.Time Status *submission.Status Verdict *submission.Verdict TestCount *int ProblemID *int }
UpdateSubmissionInput represents a mutation input for updating submissions.
func (*UpdateSubmissionInput) Mutate ¶
func (i *UpdateSubmissionInput) Mutate(m *SubmissionMutation)
Mutate applies the UpdateSubmissionInput on the SubmissionMutation builder.
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.
Source Files ¶
- client.go
- ent.go
- generate.go
- gql_collection.go
- gql_edge.go
- gql_mutation_input.go
- gql_node.go
- gql_pagination.go
- gql_transaction.go
- judge.go
- judge_create.go
- judge_delete.go
- judge_query.go
- judge_update.go
- mutation.go
- openapi.go
- problem.go
- problem_create.go
- problem_delete.go
- problem_query.go
- problem_update.go
- runtime.go
- submission.go
- submission_create.go
- submission_delete.go
- submission_query.go
- submission_update.go
- tx.go