ent

package
v0.0.0-...-492a0b1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeProblemCaseRun = "ProblemCaseRun"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// ProblemCaseRun is the client for interacting with the ProblemCaseRun builders.
	ProblemCaseRun *ProblemCaseRunClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	ProblemCaseRun.
	Query().
	Count(ctx)

func (*Client) Intercept

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

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

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

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type ProblemCaseRun

type ProblemCaseRun struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// repo full name
	Repo string `json:"repo,omitempty"`
	// base branch
	Branch string `json:"branch,omitempty"`
	// suite name, target name in bazel.
	SuiteName string `json:"suite_name,omitempty"`
	// case name, may be TextXxx.TestYyy format.
	CaseName string `json:"case_name,omitempty"`
	// is it a flay run?
	Flaky bool `json:"flaky,omitempty"`
	// timecost(milliseconds) of the test case run
	TimecostMs int `json:"timecost_ms,omitempty"`
	// report unit timestamp
	ReportTime time.Time `json:"report_time,omitempty"`
	// CI build url
	BuildURL string `json:"build_url,omitempty"`
	// failure reason
	Reason string `json:"reason,omitempty"`
	// contains filtered or unexported fields
}

ProblemCaseRun is the model entity for the ProblemCaseRun schema.

func (*ProblemCaseRun) String

func (pcr *ProblemCaseRun) String() string

String implements the fmt.Stringer.

func (*ProblemCaseRun) Unwrap

func (pcr *ProblemCaseRun) Unwrap() *ProblemCaseRun

Unwrap unwraps the ProblemCaseRun 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 (*ProblemCaseRun) Update

func (pcr *ProblemCaseRun) Update() *ProblemCaseRunUpdateOne

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

func (*ProblemCaseRun) Value

func (pcr *ProblemCaseRun) Value(name string) (ent.Value, error)

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

type ProblemCaseRunClient

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

ProblemCaseRunClient is a client for the ProblemCaseRun schema.

func NewProblemCaseRunClient

func NewProblemCaseRunClient(c config) *ProblemCaseRunClient

NewProblemCaseRunClient returns a client for the ProblemCaseRun from the given config.

func (*ProblemCaseRunClient) Create

Create returns a builder for creating a ProblemCaseRun entity.

func (*ProblemCaseRunClient) CreateBulk

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

func (*ProblemCaseRunClient) Delete

Delete returns a delete builder for ProblemCaseRun.

func (*ProblemCaseRunClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProblemCaseRunClient) DeleteOneID

func (c *ProblemCaseRunClient) DeleteOneID(id int) *ProblemCaseRunDeleteOne

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

func (*ProblemCaseRunClient) Get

Get returns a ProblemCaseRun entity by its id.

func (*ProblemCaseRunClient) GetX

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

func (*ProblemCaseRunClient) Hooks

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

Hooks returns the client hooks.

func (*ProblemCaseRunClient) Intercept

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

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

func (*ProblemCaseRunClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ProblemCaseRunClient) MapCreateBulk

func (c *ProblemCaseRunClient) MapCreateBulk(slice any, setFunc func(*ProblemCaseRunCreate, int)) *ProblemCaseRunCreateBulk

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 (*ProblemCaseRunClient) Query

Query returns a query builder for ProblemCaseRun.

func (*ProblemCaseRunClient) Update

Update returns an update builder for ProblemCaseRun.

func (*ProblemCaseRunClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProblemCaseRunClient) UpdateOneID

func (c *ProblemCaseRunClient) UpdateOneID(id int) *ProblemCaseRunUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProblemCaseRunClient) Use

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

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

type ProblemCaseRunCreate

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

ProblemCaseRunCreate is the builder for creating a ProblemCaseRun entity.

func (*ProblemCaseRunCreate) Exec

func (pcrc *ProblemCaseRunCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProblemCaseRunCreate) ExecX

func (pcrc *ProblemCaseRunCreate) ExecX(ctx context.Context)

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

func (*ProblemCaseRunCreate) Mutation

func (pcrc *ProblemCaseRunCreate) Mutation() *ProblemCaseRunMutation

Mutation returns the ProblemCaseRunMutation object of the builder.

func (*ProblemCaseRunCreate) Save

Save creates the ProblemCaseRun in the database.

func (*ProblemCaseRunCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ProblemCaseRunCreate) SetBranch

func (pcrc *ProblemCaseRunCreate) SetBranch(s string) *ProblemCaseRunCreate

SetBranch sets the "branch" field.

func (*ProblemCaseRunCreate) SetBuildURL

func (pcrc *ProblemCaseRunCreate) SetBuildURL(s string) *ProblemCaseRunCreate

SetBuildURL sets the "build_url" field.

func (*ProblemCaseRunCreate) SetCaseName

func (pcrc *ProblemCaseRunCreate) SetCaseName(s string) *ProblemCaseRunCreate

SetCaseName sets the "case_name" field.

func (*ProblemCaseRunCreate) SetFlaky

func (pcrc *ProblemCaseRunCreate) SetFlaky(b bool) *ProblemCaseRunCreate

SetFlaky sets the "flaky" field.

func (*ProblemCaseRunCreate) SetNillableFlaky

func (pcrc *ProblemCaseRunCreate) SetNillableFlaky(b *bool) *ProblemCaseRunCreate

SetNillableFlaky sets the "flaky" field if the given value is not nil.

func (*ProblemCaseRunCreate) SetReason

func (pcrc *ProblemCaseRunCreate) SetReason(s string) *ProblemCaseRunCreate

SetReason sets the "reason" field.

func (*ProblemCaseRunCreate) SetRepo

SetRepo sets the "repo" field.

func (*ProblemCaseRunCreate) SetReportTime

func (pcrc *ProblemCaseRunCreate) SetReportTime(t time.Time) *ProblemCaseRunCreate

SetReportTime sets the "report_time" field.

func (*ProblemCaseRunCreate) SetSuiteName

func (pcrc *ProblemCaseRunCreate) SetSuiteName(s string) *ProblemCaseRunCreate

SetSuiteName sets the "suite_name" field.

func (*ProblemCaseRunCreate) SetTimecostMs

func (pcrc *ProblemCaseRunCreate) SetTimecostMs(i int) *ProblemCaseRunCreate

SetTimecostMs sets the "timecost_ms" field.

type ProblemCaseRunCreateBulk

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

ProblemCaseRunCreateBulk is the builder for creating many ProblemCaseRun entities in bulk.

func (*ProblemCaseRunCreateBulk) Exec

func (pcrcb *ProblemCaseRunCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProblemCaseRunCreateBulk) ExecX

func (pcrcb *ProblemCaseRunCreateBulk) ExecX(ctx context.Context)

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

func (*ProblemCaseRunCreateBulk) Save

Save creates the ProblemCaseRun entities in the database.

func (*ProblemCaseRunCreateBulk) SaveX

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

type ProblemCaseRunDelete

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

ProblemCaseRunDelete is the builder for deleting a ProblemCaseRun entity.

func (*ProblemCaseRunDelete) Exec

func (pcrd *ProblemCaseRunDelete) Exec(ctx context.Context) (int, error)

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

func (*ProblemCaseRunDelete) ExecX

func (pcrd *ProblemCaseRunDelete) ExecX(ctx context.Context) int

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

func (*ProblemCaseRunDelete) Where

Where appends a list predicates to the ProblemCaseRunDelete builder.

type ProblemCaseRunDeleteOne

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

ProblemCaseRunDeleteOne is the builder for deleting a single ProblemCaseRun entity.

func (*ProblemCaseRunDeleteOne) Exec

func (pcrdo *ProblemCaseRunDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProblemCaseRunDeleteOne) ExecX

func (pcrdo *ProblemCaseRunDeleteOne) ExecX(ctx context.Context)

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

func (*ProblemCaseRunDeleteOne) Where

Where appends a list predicates to the ProblemCaseRunDelete builder.

type ProblemCaseRunGroupBy

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

ProblemCaseRunGroupBy is the group-by builder for ProblemCaseRun entities.

func (*ProblemCaseRunGroupBy) Aggregate

func (pcrgb *ProblemCaseRunGroupBy) Aggregate(fns ...AggregateFunc) *ProblemCaseRunGroupBy

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

func (*ProblemCaseRunGroupBy) Bool

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

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

func (*ProblemCaseRunGroupBy) BoolX

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

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

func (*ProblemCaseRunGroupBy) Bools

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

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

func (*ProblemCaseRunGroupBy) BoolsX

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

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

func (*ProblemCaseRunGroupBy) Float64

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

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

func (*ProblemCaseRunGroupBy) Float64X

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

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

func (*ProblemCaseRunGroupBy) Float64s

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

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

func (*ProblemCaseRunGroupBy) Float64sX

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

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

func (*ProblemCaseRunGroupBy) Int

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

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

func (*ProblemCaseRunGroupBy) IntX

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

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

func (*ProblemCaseRunGroupBy) Ints

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

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

func (*ProblemCaseRunGroupBy) IntsX

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

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

func (*ProblemCaseRunGroupBy) Scan

func (pcrgb *ProblemCaseRunGroupBy) Scan(ctx context.Context, v any) error

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

func (*ProblemCaseRunGroupBy) ScanX

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

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

func (*ProblemCaseRunGroupBy) String

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

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

func (*ProblemCaseRunGroupBy) StringX

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

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

func (*ProblemCaseRunGroupBy) Strings

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

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

func (*ProblemCaseRunGroupBy) StringsX

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

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

type ProblemCaseRunMutation

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

ProblemCaseRunMutation represents an operation that mutates the ProblemCaseRun nodes in the graph.

func (*ProblemCaseRunMutation) AddField

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) AddTimecostMs

func (m *ProblemCaseRunMutation) AddTimecostMs(i int)

AddTimecostMs adds i to the "timecost_ms" field.

func (*ProblemCaseRunMutation) AddedEdges

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

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

func (*ProblemCaseRunMutation) AddedField

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) AddedFields

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

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

func (*ProblemCaseRunMutation) AddedIDs

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

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

func (*ProblemCaseRunMutation) AddedTimecostMs

func (m *ProblemCaseRunMutation) AddedTimecostMs() (r int, exists bool)

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

func (*ProblemCaseRunMutation) Branch

func (m *ProblemCaseRunMutation) Branch() (r string, exists bool)

Branch returns the value of the "branch" field in the mutation.

func (*ProblemCaseRunMutation) BuildURL

func (m *ProblemCaseRunMutation) BuildURL() (r string, exists bool)

BuildURL returns the value of the "build_url" field in the mutation.

func (*ProblemCaseRunMutation) CaseName

func (m *ProblemCaseRunMutation) CaseName() (r string, exists bool)

CaseName returns the value of the "case_name" field in the mutation.

func (*ProblemCaseRunMutation) ClearEdge

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) ClearField

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) ClearedEdges

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

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

func (*ProblemCaseRunMutation) ClearedFields

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

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

func (ProblemCaseRunMutation) Client

func (m ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) EdgeCleared

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

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

func (*ProblemCaseRunMutation) Field

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) FieldCleared

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

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

func (*ProblemCaseRunMutation) Fields

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) Flaky

func (m *ProblemCaseRunMutation) Flaky() (r bool, exists bool)

Flaky returns the value of the "flaky" field in the mutation.

func (*ProblemCaseRunMutation) ID

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) IDs

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) OldBranch

func (m *ProblemCaseRunMutation) OldBranch(ctx context.Context) (v string, err error)

OldBranch returns the old "branch" field's value of the ProblemCaseRun entity. If the ProblemCaseRun 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 (*ProblemCaseRunMutation) OldBuildURL

func (m *ProblemCaseRunMutation) OldBuildURL(ctx context.Context) (v string, err error)

OldBuildURL returns the old "build_url" field's value of the ProblemCaseRun entity. If the ProblemCaseRun 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 (*ProblemCaseRunMutation) OldCaseName

func (m *ProblemCaseRunMutation) OldCaseName(ctx context.Context) (v string, err error)

OldCaseName returns the old "case_name" field's value of the ProblemCaseRun entity. If the ProblemCaseRun 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 (*ProblemCaseRunMutation) OldField

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

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

func (*ProblemCaseRunMutation) OldFlaky

func (m *ProblemCaseRunMutation) OldFlaky(ctx context.Context) (v bool, err error)

OldFlaky returns the old "flaky" field's value of the ProblemCaseRun entity. If the ProblemCaseRun 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 (*ProblemCaseRunMutation) OldReason

func (m *ProblemCaseRunMutation) OldReason(ctx context.Context) (v string, err error)

OldReason returns the old "reason" field's value of the ProblemCaseRun entity. If the ProblemCaseRun 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 (*ProblemCaseRunMutation) OldRepo

func (m *ProblemCaseRunMutation) OldRepo(ctx context.Context) (v string, err error)

OldRepo returns the old "repo" field's value of the ProblemCaseRun entity. If the ProblemCaseRun 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 (*ProblemCaseRunMutation) OldReportTime

func (m *ProblemCaseRunMutation) OldReportTime(ctx context.Context) (v time.Time, err error)

OldReportTime returns the old "report_time" field's value of the ProblemCaseRun entity. If the ProblemCaseRun 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 (*ProblemCaseRunMutation) OldSuiteName

func (m *ProblemCaseRunMutation) OldSuiteName(ctx context.Context) (v string, err error)

OldSuiteName returns the old "suite_name" field's value of the ProblemCaseRun entity. If the ProblemCaseRun 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 (*ProblemCaseRunMutation) OldTimecostMs

func (m *ProblemCaseRunMutation) OldTimecostMs(ctx context.Context) (v int, err error)

OldTimecostMs returns the old "timecost_ms" field's value of the ProblemCaseRun entity. If the ProblemCaseRun 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 (*ProblemCaseRunMutation) Op

func (m *ProblemCaseRunMutation) Op() Op

Op returns the operation name.

func (*ProblemCaseRunMutation) Reason

func (m *ProblemCaseRunMutation) Reason() (r string, exists bool)

Reason returns the value of the "reason" field in the mutation.

func (*ProblemCaseRunMutation) RemovedEdges

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

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

func (*ProblemCaseRunMutation) RemovedIDs

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) Repo

func (m *ProblemCaseRunMutation) Repo() (r string, exists bool)

Repo returns the value of the "repo" field in the mutation.

func (*ProblemCaseRunMutation) ReportTime

func (m *ProblemCaseRunMutation) ReportTime() (r time.Time, exists bool)

ReportTime returns the value of the "report_time" field in the mutation.

func (*ProblemCaseRunMutation) ResetBranch

func (m *ProblemCaseRunMutation) ResetBranch()

ResetBranch resets all changes to the "branch" field.

func (*ProblemCaseRunMutation) ResetBuildURL

func (m *ProblemCaseRunMutation) ResetBuildURL()

ResetBuildURL resets all changes to the "build_url" field.

func (*ProblemCaseRunMutation) ResetCaseName

func (m *ProblemCaseRunMutation) ResetCaseName()

ResetCaseName resets all changes to the "case_name" field.

func (*ProblemCaseRunMutation) ResetEdge

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) ResetField

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) ResetFlaky

func (m *ProblemCaseRunMutation) ResetFlaky()

ResetFlaky resets all changes to the "flaky" field.

func (*ProblemCaseRunMutation) ResetReason

func (m *ProblemCaseRunMutation) ResetReason()

ResetReason resets all changes to the "reason" field.

func (*ProblemCaseRunMutation) ResetRepo

func (m *ProblemCaseRunMutation) ResetRepo()

ResetRepo resets all changes to the "repo" field.

func (*ProblemCaseRunMutation) ResetReportTime

func (m *ProblemCaseRunMutation) ResetReportTime()

ResetReportTime resets all changes to the "report_time" field.

func (*ProblemCaseRunMutation) ResetSuiteName

func (m *ProblemCaseRunMutation) ResetSuiteName()

ResetSuiteName resets all changes to the "suite_name" field.

func (*ProblemCaseRunMutation) ResetTimecostMs

func (m *ProblemCaseRunMutation) ResetTimecostMs()

ResetTimecostMs resets all changes to the "timecost_ms" field.

func (*ProblemCaseRunMutation) SetBranch

func (m *ProblemCaseRunMutation) SetBranch(s string)

SetBranch sets the "branch" field.

func (*ProblemCaseRunMutation) SetBuildURL

func (m *ProblemCaseRunMutation) SetBuildURL(s string)

SetBuildURL sets the "build_url" field.

func (*ProblemCaseRunMutation) SetCaseName

func (m *ProblemCaseRunMutation) SetCaseName(s string)

SetCaseName sets the "case_name" field.

func (*ProblemCaseRunMutation) SetField

func (m *ProblemCaseRunMutation) 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 (*ProblemCaseRunMutation) SetFlaky

func (m *ProblemCaseRunMutation) SetFlaky(b bool)

SetFlaky sets the "flaky" field.

func (*ProblemCaseRunMutation) SetOp

func (m *ProblemCaseRunMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProblemCaseRunMutation) SetReason

func (m *ProblemCaseRunMutation) SetReason(s string)

SetReason sets the "reason" field.

func (*ProblemCaseRunMutation) SetRepo

func (m *ProblemCaseRunMutation) SetRepo(s string)

SetRepo sets the "repo" field.

func (*ProblemCaseRunMutation) SetReportTime

func (m *ProblemCaseRunMutation) SetReportTime(t time.Time)

SetReportTime sets the "report_time" field.

func (*ProblemCaseRunMutation) SetSuiteName

func (m *ProblemCaseRunMutation) SetSuiteName(s string)

SetSuiteName sets the "suite_name" field.

func (*ProblemCaseRunMutation) SetTimecostMs

func (m *ProblemCaseRunMutation) SetTimecostMs(i int)

SetTimecostMs sets the "timecost_ms" field.

func (*ProblemCaseRunMutation) SuiteName

func (m *ProblemCaseRunMutation) SuiteName() (r string, exists bool)

SuiteName returns the value of the "suite_name" field in the mutation.

func (*ProblemCaseRunMutation) TimecostMs

func (m *ProblemCaseRunMutation) TimecostMs() (r int, exists bool)

TimecostMs returns the value of the "timecost_ms" field in the mutation.

func (ProblemCaseRunMutation) Tx

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

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

func (*ProblemCaseRunMutation) Type

func (m *ProblemCaseRunMutation) Type() string

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

func (*ProblemCaseRunMutation) Where

Where appends a list predicates to the ProblemCaseRunMutation builder.

func (*ProblemCaseRunMutation) WhereP

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

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

type ProblemCaseRunQuery

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

ProblemCaseRunQuery is the builder for querying ProblemCaseRun entities.

func (*ProblemCaseRunQuery) Aggregate

func (pcrq *ProblemCaseRunQuery) Aggregate(fns ...AggregateFunc) *ProblemCaseRunSelect

Aggregate returns a ProblemCaseRunSelect configured with the given aggregations.

func (*ProblemCaseRunQuery) All

All executes the query and returns a list of ProblemCaseRuns.

func (*ProblemCaseRunQuery) AllX

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

func (*ProblemCaseRunQuery) Clone

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

func (*ProblemCaseRunQuery) Count

func (pcrq *ProblemCaseRunQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProblemCaseRunQuery) CountX

func (pcrq *ProblemCaseRunQuery) CountX(ctx context.Context) int

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

func (*ProblemCaseRunQuery) Exist

func (pcrq *ProblemCaseRunQuery) Exist(ctx context.Context) (bool, error)

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

func (*ProblemCaseRunQuery) ExistX

func (pcrq *ProblemCaseRunQuery) ExistX(ctx context.Context) bool

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

func (*ProblemCaseRunQuery) First

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

func (*ProblemCaseRunQuery) FirstID

func (pcrq *ProblemCaseRunQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ProblemCaseRunQuery) FirstIDX

func (pcrq *ProblemCaseRunQuery) FirstIDX(ctx context.Context) int

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

func (*ProblemCaseRunQuery) FirstX

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

func (*ProblemCaseRunQuery) GroupBy

func (pcrq *ProblemCaseRunQuery) GroupBy(field string, fields ...string) *ProblemCaseRunGroupBy

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 {
	Repo string `json:"repo,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ProblemCaseRun.Query().
	GroupBy(problemcaserun.FieldRepo).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProblemCaseRunQuery) IDs

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

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

func (*ProblemCaseRunQuery) IDsX

func (pcrq *ProblemCaseRunQuery) IDsX(ctx context.Context) []int

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

func (*ProblemCaseRunQuery) Limit

func (pcrq *ProblemCaseRunQuery) Limit(limit int) *ProblemCaseRunQuery

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

func (*ProblemCaseRunQuery) Offset

func (pcrq *ProblemCaseRunQuery) Offset(offset int) *ProblemCaseRunQuery

Offset to start from.

func (*ProblemCaseRunQuery) Only

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

func (*ProblemCaseRunQuery) OnlyID

func (pcrq *ProblemCaseRunQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ProblemCaseRunQuery) OnlyIDX

func (pcrq *ProblemCaseRunQuery) OnlyIDX(ctx context.Context) int

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

func (*ProblemCaseRunQuery) OnlyX

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

func (*ProblemCaseRunQuery) Order

Order specifies how the records should be ordered.

func (*ProblemCaseRunQuery) Select

func (pcrq *ProblemCaseRunQuery) Select(fields ...string) *ProblemCaseRunSelect

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 {
	Repo string `json:"repo,omitempty"`
}

client.ProblemCaseRun.Query().
	Select(problemcaserun.FieldRepo).
	Scan(ctx, &v)

func (*ProblemCaseRunQuery) Unique

func (pcrq *ProblemCaseRunQuery) Unique(unique bool) *ProblemCaseRunQuery

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 (*ProblemCaseRunQuery) Where

Where adds a new predicate for the ProblemCaseRunQuery builder.

type ProblemCaseRunSelect

type ProblemCaseRunSelect struct {
	*ProblemCaseRunQuery
	// contains filtered or unexported fields
}

ProblemCaseRunSelect is the builder for selecting fields of ProblemCaseRun entities.

func (*ProblemCaseRunSelect) Aggregate

func (pcrs *ProblemCaseRunSelect) Aggregate(fns ...AggregateFunc) *ProblemCaseRunSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProblemCaseRunSelect) Bool

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

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

func (*ProblemCaseRunSelect) BoolX

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

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

func (*ProblemCaseRunSelect) Bools

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

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

func (*ProblemCaseRunSelect) BoolsX

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

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

func (*ProblemCaseRunSelect) Float64

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

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

func (*ProblemCaseRunSelect) Float64X

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

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

func (*ProblemCaseRunSelect) Float64s

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

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

func (*ProblemCaseRunSelect) Float64sX

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

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

func (*ProblemCaseRunSelect) Int

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

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

func (*ProblemCaseRunSelect) IntX

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

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

func (*ProblemCaseRunSelect) Ints

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

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

func (*ProblemCaseRunSelect) IntsX

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

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

func (*ProblemCaseRunSelect) Scan

func (pcrs *ProblemCaseRunSelect) Scan(ctx context.Context, v any) error

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

func (*ProblemCaseRunSelect) ScanX

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

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

func (*ProblemCaseRunSelect) String

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

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

func (*ProblemCaseRunSelect) StringX

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

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

func (*ProblemCaseRunSelect) Strings

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

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

func (*ProblemCaseRunSelect) StringsX

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

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

type ProblemCaseRunUpdate

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

ProblemCaseRunUpdate is the builder for updating ProblemCaseRun entities.

func (*ProblemCaseRunUpdate) AddTimecostMs

func (pcru *ProblemCaseRunUpdate) AddTimecostMs(i int) *ProblemCaseRunUpdate

AddTimecostMs adds i to the "timecost_ms" field.

func (*ProblemCaseRunUpdate) Exec

func (pcru *ProblemCaseRunUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProblemCaseRunUpdate) ExecX

func (pcru *ProblemCaseRunUpdate) ExecX(ctx context.Context)

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

func (*ProblemCaseRunUpdate) Mutation

func (pcru *ProblemCaseRunUpdate) Mutation() *ProblemCaseRunMutation

Mutation returns the ProblemCaseRunMutation object of the builder.

func (*ProblemCaseRunUpdate) Save

func (pcru *ProblemCaseRunUpdate) Save(ctx context.Context) (int, error)

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

func (*ProblemCaseRunUpdate) SaveX

func (pcru *ProblemCaseRunUpdate) SaveX(ctx context.Context) int

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

func (*ProblemCaseRunUpdate) SetBranch

func (pcru *ProblemCaseRunUpdate) SetBranch(s string) *ProblemCaseRunUpdate

SetBranch sets the "branch" field.

func (*ProblemCaseRunUpdate) SetBuildURL

func (pcru *ProblemCaseRunUpdate) SetBuildURL(s string) *ProblemCaseRunUpdate

SetBuildURL sets the "build_url" field.

func (*ProblemCaseRunUpdate) SetCaseName

func (pcru *ProblemCaseRunUpdate) SetCaseName(s string) *ProblemCaseRunUpdate

SetCaseName sets the "case_name" field.

func (*ProblemCaseRunUpdate) SetFlaky

func (pcru *ProblemCaseRunUpdate) SetFlaky(b bool) *ProblemCaseRunUpdate

SetFlaky sets the "flaky" field.

func (*ProblemCaseRunUpdate) SetNillableBranch

func (pcru *ProblemCaseRunUpdate) SetNillableBranch(s *string) *ProblemCaseRunUpdate

SetNillableBranch sets the "branch" field if the given value is not nil.

func (*ProblemCaseRunUpdate) SetNillableBuildURL

func (pcru *ProblemCaseRunUpdate) SetNillableBuildURL(s *string) *ProblemCaseRunUpdate

SetNillableBuildURL sets the "build_url" field if the given value is not nil.

func (*ProblemCaseRunUpdate) SetNillableCaseName

func (pcru *ProblemCaseRunUpdate) SetNillableCaseName(s *string) *ProblemCaseRunUpdate

SetNillableCaseName sets the "case_name" field if the given value is not nil.

func (*ProblemCaseRunUpdate) SetNillableFlaky

func (pcru *ProblemCaseRunUpdate) SetNillableFlaky(b *bool) *ProblemCaseRunUpdate

SetNillableFlaky sets the "flaky" field if the given value is not nil.

func (*ProblemCaseRunUpdate) SetNillableReason

func (pcru *ProblemCaseRunUpdate) SetNillableReason(s *string) *ProblemCaseRunUpdate

SetNillableReason sets the "reason" field if the given value is not nil.

func (*ProblemCaseRunUpdate) SetNillableRepo

func (pcru *ProblemCaseRunUpdate) SetNillableRepo(s *string) *ProblemCaseRunUpdate

SetNillableRepo sets the "repo" field if the given value is not nil.

func (*ProblemCaseRunUpdate) SetNillableReportTime

func (pcru *ProblemCaseRunUpdate) SetNillableReportTime(t *time.Time) *ProblemCaseRunUpdate

SetNillableReportTime sets the "report_time" field if the given value is not nil.

func (*ProblemCaseRunUpdate) SetNillableSuiteName

func (pcru *ProblemCaseRunUpdate) SetNillableSuiteName(s *string) *ProblemCaseRunUpdate

SetNillableSuiteName sets the "suite_name" field if the given value is not nil.

func (*ProblemCaseRunUpdate) SetNillableTimecostMs

func (pcru *ProblemCaseRunUpdate) SetNillableTimecostMs(i *int) *ProblemCaseRunUpdate

SetNillableTimecostMs sets the "timecost_ms" field if the given value is not nil.

func (*ProblemCaseRunUpdate) SetReason

func (pcru *ProblemCaseRunUpdate) SetReason(s string) *ProblemCaseRunUpdate

SetReason sets the "reason" field.

func (*ProblemCaseRunUpdate) SetRepo

SetRepo sets the "repo" field.

func (*ProblemCaseRunUpdate) SetReportTime

func (pcru *ProblemCaseRunUpdate) SetReportTime(t time.Time) *ProblemCaseRunUpdate

SetReportTime sets the "report_time" field.

func (*ProblemCaseRunUpdate) SetSuiteName

func (pcru *ProblemCaseRunUpdate) SetSuiteName(s string) *ProblemCaseRunUpdate

SetSuiteName sets the "suite_name" field.

func (*ProblemCaseRunUpdate) SetTimecostMs

func (pcru *ProblemCaseRunUpdate) SetTimecostMs(i int) *ProblemCaseRunUpdate

SetTimecostMs sets the "timecost_ms" field.

func (*ProblemCaseRunUpdate) Where

Where appends a list predicates to the ProblemCaseRunUpdate builder.

type ProblemCaseRunUpdateOne

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

ProblemCaseRunUpdateOne is the builder for updating a single ProblemCaseRun entity.

func (*ProblemCaseRunUpdateOne) AddTimecostMs

func (pcruo *ProblemCaseRunUpdateOne) AddTimecostMs(i int) *ProblemCaseRunUpdateOne

AddTimecostMs adds i to the "timecost_ms" field.

func (*ProblemCaseRunUpdateOne) Exec

func (pcruo *ProblemCaseRunUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProblemCaseRunUpdateOne) ExecX

func (pcruo *ProblemCaseRunUpdateOne) ExecX(ctx context.Context)

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

func (*ProblemCaseRunUpdateOne) Mutation

Mutation returns the ProblemCaseRunMutation object of the builder.

func (*ProblemCaseRunUpdateOne) Save

Save executes the query and returns the updated ProblemCaseRun entity.

func (*ProblemCaseRunUpdateOne) SaveX

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

func (*ProblemCaseRunUpdateOne) Select

func (pcruo *ProblemCaseRunUpdateOne) Select(field string, fields ...string) *ProblemCaseRunUpdateOne

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

func (*ProblemCaseRunUpdateOne) SetBranch

SetBranch sets the "branch" field.

func (*ProblemCaseRunUpdateOne) SetBuildURL

SetBuildURL sets the "build_url" field.

func (*ProblemCaseRunUpdateOne) SetCaseName

SetCaseName sets the "case_name" field.

func (*ProblemCaseRunUpdateOne) SetFlaky

SetFlaky sets the "flaky" field.

func (*ProblemCaseRunUpdateOne) SetNillableBranch

func (pcruo *ProblemCaseRunUpdateOne) SetNillableBranch(s *string) *ProblemCaseRunUpdateOne

SetNillableBranch sets the "branch" field if the given value is not nil.

func (*ProblemCaseRunUpdateOne) SetNillableBuildURL

func (pcruo *ProblemCaseRunUpdateOne) SetNillableBuildURL(s *string) *ProblemCaseRunUpdateOne

SetNillableBuildURL sets the "build_url" field if the given value is not nil.

func (*ProblemCaseRunUpdateOne) SetNillableCaseName

func (pcruo *ProblemCaseRunUpdateOne) SetNillableCaseName(s *string) *ProblemCaseRunUpdateOne

SetNillableCaseName sets the "case_name" field if the given value is not nil.

func (*ProblemCaseRunUpdateOne) SetNillableFlaky

func (pcruo *ProblemCaseRunUpdateOne) SetNillableFlaky(b *bool) *ProblemCaseRunUpdateOne

SetNillableFlaky sets the "flaky" field if the given value is not nil.

func (*ProblemCaseRunUpdateOne) SetNillableReason

func (pcruo *ProblemCaseRunUpdateOne) SetNillableReason(s *string) *ProblemCaseRunUpdateOne

SetNillableReason sets the "reason" field if the given value is not nil.

func (*ProblemCaseRunUpdateOne) SetNillableRepo

func (pcruo *ProblemCaseRunUpdateOne) SetNillableRepo(s *string) *ProblemCaseRunUpdateOne

SetNillableRepo sets the "repo" field if the given value is not nil.

func (*ProblemCaseRunUpdateOne) SetNillableReportTime

func (pcruo *ProblemCaseRunUpdateOne) SetNillableReportTime(t *time.Time) *ProblemCaseRunUpdateOne

SetNillableReportTime sets the "report_time" field if the given value is not nil.

func (*ProblemCaseRunUpdateOne) SetNillableSuiteName

func (pcruo *ProblemCaseRunUpdateOne) SetNillableSuiteName(s *string) *ProblemCaseRunUpdateOne

SetNillableSuiteName sets the "suite_name" field if the given value is not nil.

func (*ProblemCaseRunUpdateOne) SetNillableTimecostMs

func (pcruo *ProblemCaseRunUpdateOne) SetNillableTimecostMs(i *int) *ProblemCaseRunUpdateOne

SetNillableTimecostMs sets the "timecost_ms" field if the given value is not nil.

func (*ProblemCaseRunUpdateOne) SetReason

SetReason sets the "reason" field.

func (*ProblemCaseRunUpdateOne) SetRepo

SetRepo sets the "repo" field.

func (*ProblemCaseRunUpdateOne) SetReportTime

func (pcruo *ProblemCaseRunUpdateOne) SetReportTime(t time.Time) *ProblemCaseRunUpdateOne

SetReportTime sets the "report_time" field.

func (*ProblemCaseRunUpdateOne) SetSuiteName

func (pcruo *ProblemCaseRunUpdateOne) SetSuiteName(s string) *ProblemCaseRunUpdateOne

SetSuiteName sets the "suite_name" field.

func (*ProblemCaseRunUpdateOne) SetTimecostMs

func (pcruo *ProblemCaseRunUpdateOne) SetTimecostMs(i int) *ProblemCaseRunUpdateOne

SetTimecostMs sets the "timecost_ms" field.

func (*ProblemCaseRunUpdateOne) Where

Where appends a list predicates to the ProblemCaseRunUpdate builder.

type ProblemCaseRuns

type ProblemCaseRuns []*ProblemCaseRun

ProblemCaseRuns is a parsable slice of ProblemCaseRun.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// ProblemCaseRun is the client for interacting with the ProblemCaseRun builders.
	ProblemCaseRun *ProblemCaseRunClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL