ent

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: AGPL-3.0 Imports: 41 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.
	TypeInterpretation            = "Interpretation"
	TypeInterpretationTranslation = "InterpretationTranslation"
	TypeItem                      = "Item"
	TypeItemTranslation           = "ItemTranslation"
	TypeNorm                      = "Norm"
	TypeQuestion                  = "Question"
	TypeQuestionTranslation       = "QuestionTranslation"
	TypeResponse                  = "Response"
	TypeResult                    = "Result"
	TypeSample                    = "Sample"
	TypeScale                     = "Scale"
	TypeScaleItem                 = "ScaleItem"
	TypeScaleTranslation          = "ScaleTranslation"
	TypeTag                       = "Tag"
	TypeTagTranslation            = "TagTranslation"
	TypeTake                      = "Take"
	TypeTest                      = "Test"
	TypeTestDisplay               = "TestDisplay"
	TypeTestTranslation           = "TestTranslation"
	TypeUser                      = "User"
	TypeUserSession               = "UserSession"
)

Variables

This section is empty.

Functions

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
	// Interpretation is the client for interacting with the Interpretation builders.
	Interpretation *InterpretationClient
	// InterpretationTranslation is the client for interacting with the InterpretationTranslation builders.
	InterpretationTranslation *InterpretationTranslationClient
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// ItemTranslation is the client for interacting with the ItemTranslation builders.
	ItemTranslation *ItemTranslationClient
	// Norm is the client for interacting with the Norm builders.
	Norm *NormClient
	// Question is the client for interacting with the Question builders.
	Question *QuestionClient
	// QuestionTranslation is the client for interacting with the QuestionTranslation builders.
	QuestionTranslation *QuestionTranslationClient
	// Response is the client for interacting with the Response builders.
	Response *ResponseClient
	// Result is the client for interacting with the Result builders.
	Result *ResultClient
	// Sample is the client for interacting with the Sample builders.
	Sample *SampleClient
	// Scale is the client for interacting with the Scale builders.
	Scale *ScaleClient
	// ScaleItem is the client for interacting with the ScaleItem builders.
	ScaleItem *ScaleItemClient
	// ScaleTranslation is the client for interacting with the ScaleTranslation builders.
	ScaleTranslation *ScaleTranslationClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// TagTranslation is the client for interacting with the TagTranslation builders.
	TagTranslation *TagTranslationClient
	// Take is the client for interacting with the Take builders.
	Take *TakeClient
	// Test is the client for interacting with the Test builders.
	Test *TestClient
	// TestDisplay is the client for interacting with the TestDisplay builders.
	TestDisplay *TestDisplayClient
	// TestTranslation is the client for interacting with the TestTranslation builders.
	TestTranslation *TestTranslationClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserSession is the client for interacting with the UserSession builders.
	UserSession *UserSessionClient
	// 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().
	Interpretation.
	Query().
	Count(ctx)

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 Interpretation

type Interpretation struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Range holds the value of the "range" field.
	Range [2]float64 `json:"range,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InterpretationQuery when eager-loading is set.
	Edges InterpretationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Interpretation is the model entity for the Interpretation schema.

func (*Interpretation) QueryScale

func (i *Interpretation) QueryScale() *ScaleQuery

QueryScale queries the "scale" edge of the Interpretation entity.

func (*Interpretation) QueryTranslations

func (i *Interpretation) QueryTranslations() *InterpretationTranslationQuery

QueryTranslations queries the "translations" edge of the Interpretation entity.

func (*Interpretation) String

func (i *Interpretation) String() string

String implements the fmt.Stringer.

func (*Interpretation) Unwrap

func (i *Interpretation) Unwrap() *Interpretation

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

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

type InterpretationClient

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

InterpretationClient is a client for the Interpretation schema.

func NewInterpretationClient

func NewInterpretationClient(c config) *InterpretationClient

NewInterpretationClient returns a client for the Interpretation from the given config.

func (*InterpretationClient) Create

Create returns a builder for creating a Interpretation entity.

func (*InterpretationClient) CreateBulk

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

func (*InterpretationClient) Delete

Delete returns a delete builder for Interpretation.

func (*InterpretationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InterpretationClient) DeleteOneID

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

func (*InterpretationClient) Get

Get returns a Interpretation entity by its id.

func (*InterpretationClient) GetX

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

func (*InterpretationClient) Hooks

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

Hooks returns the client hooks.

func (*InterpretationClient) Query

Query returns a query builder for Interpretation.

func (*InterpretationClient) QueryScale

func (c *InterpretationClient) QueryScale(i *Interpretation) *ScaleQuery

QueryScale queries the scale edge of a Interpretation.

func (*InterpretationClient) QueryTranslations

QueryTranslations queries the translations edge of a Interpretation.

func (*InterpretationClient) Update

Update returns an update builder for Interpretation.

func (*InterpretationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*InterpretationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*InterpretationClient) Use

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

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

type InterpretationCreate

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

InterpretationCreate is the builder for creating a Interpretation entity.

func (*InterpretationCreate) AddTranslationIDs

func (ic *InterpretationCreate) AddTranslationIDs(ids ...uuid.UUID) *InterpretationCreate

AddTranslationIDs adds the "translations" edge to the InterpretationTranslation entity by IDs.

func (*InterpretationCreate) AddTranslations

AddTranslations adds the "translations" edges to the InterpretationTranslation entity.

func (*InterpretationCreate) Exec

func (ic *InterpretationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*InterpretationCreate) ExecX

func (ic *InterpretationCreate) ExecX(ctx context.Context)

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

func (*InterpretationCreate) Mutation

Mutation returns the InterpretationMutation object of the builder.

func (*InterpretationCreate) Save

Save creates the Interpretation in the database.

func (*InterpretationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*InterpretationCreate) SetCreateTime

func (ic *InterpretationCreate) SetCreateTime(t time.Time) *InterpretationCreate

SetCreateTime sets the "create_time" field.

func (*InterpretationCreate) SetID

SetID sets the "id" field.

func (*InterpretationCreate) SetNillableCreateTime

func (ic *InterpretationCreate) SetNillableCreateTime(t *time.Time) *InterpretationCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*InterpretationCreate) SetNillableID

func (ic *InterpretationCreate) SetNillableID(u *uuid.UUID) *InterpretationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*InterpretationCreate) SetNillableScaleID

func (ic *InterpretationCreate) SetNillableScaleID(id *uuid.UUID) *InterpretationCreate

SetNillableScaleID sets the "scale" edge to the Scale entity by ID if the given value is not nil.

func (*InterpretationCreate) SetNillableUpdateTime

func (ic *InterpretationCreate) SetNillableUpdateTime(t *time.Time) *InterpretationCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*InterpretationCreate) SetRange

SetRange sets the "range" field.

func (*InterpretationCreate) SetScale

SetScale sets the "scale" edge to the Scale entity.

func (*InterpretationCreate) SetScaleID

func (ic *InterpretationCreate) SetScaleID(id uuid.UUID) *InterpretationCreate

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*InterpretationCreate) SetUpdateTime

func (ic *InterpretationCreate) SetUpdateTime(t time.Time) *InterpretationCreate

SetUpdateTime sets the "update_time" field.

type InterpretationCreateBulk

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

InterpretationCreateBulk is the builder for creating many Interpretation entities in bulk.

func (*InterpretationCreateBulk) Exec

Exec executes the query.

func (*InterpretationCreateBulk) ExecX

func (icb *InterpretationCreateBulk) ExecX(ctx context.Context)

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

func (*InterpretationCreateBulk) Save

Save creates the Interpretation entities in the database.

func (*InterpretationCreateBulk) SaveX

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

type InterpretationDelete

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

InterpretationDelete is the builder for deleting a Interpretation entity.

func (*InterpretationDelete) Exec

func (id *InterpretationDelete) Exec(ctx context.Context) (int, error)

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

func (*InterpretationDelete) ExecX

func (id *InterpretationDelete) ExecX(ctx context.Context) int

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

func (*InterpretationDelete) Where

Where appends a list predicates to the InterpretationDelete builder.

type InterpretationDeleteOne

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

InterpretationDeleteOne is the builder for deleting a single Interpretation entity.

func (*InterpretationDeleteOne) Exec

Exec executes the deletion query.

func (*InterpretationDeleteOne) ExecX

func (ido *InterpretationDeleteOne) ExecX(ctx context.Context)

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

type InterpretationEdges

type InterpretationEdges struct {
	// Translations holds the value of the translations edge.
	Translations []*InterpretationTranslation `json:"translations,omitempty"`
	// Scale holds the value of the scale edge.
	Scale *Scale `json:"scale,omitempty"`
	// contains filtered or unexported fields
}

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

func (InterpretationEdges) ScaleOrErr

func (e InterpretationEdges) ScaleOrErr() (*Scale, error)

ScaleOrErr returns the Scale value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (InterpretationEdges) TranslationsOrErr

func (e InterpretationEdges) TranslationsOrErr() ([]*InterpretationTranslation, error)

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

type InterpretationGroupBy

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

InterpretationGroupBy is the group-by builder for Interpretation entities.

func (*InterpretationGroupBy) Aggregate

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

func (*InterpretationGroupBy) Bool

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

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

func (*InterpretationGroupBy) BoolX

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

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

func (*InterpretationGroupBy) Bools

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

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

func (*InterpretationGroupBy) BoolsX

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

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

func (*InterpretationGroupBy) Float64

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

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

func (*InterpretationGroupBy) Float64X

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

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

func (*InterpretationGroupBy) Float64s

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

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

func (*InterpretationGroupBy) Float64sX

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

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

func (*InterpretationGroupBy) Int

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

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

func (*InterpretationGroupBy) IntX

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

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

func (*InterpretationGroupBy) Ints

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

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

func (*InterpretationGroupBy) IntsX

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

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

func (*InterpretationGroupBy) Scan

func (igb *InterpretationGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*InterpretationGroupBy) ScanX

func (s *InterpretationGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*InterpretationGroupBy) String

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

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

func (*InterpretationGroupBy) StringX

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

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

func (*InterpretationGroupBy) Strings

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

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

func (*InterpretationGroupBy) StringsX

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

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

type InterpretationMutation

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

InterpretationMutation represents an operation that mutates the Interpretation nodes in the graph.

func (*InterpretationMutation) AddField

func (m *InterpretationMutation) 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 (*InterpretationMutation) AddTranslationIDs

func (m *InterpretationMutation) AddTranslationIDs(ids ...uuid.UUID)

AddTranslationIDs adds the "translations" edge to the InterpretationTranslation entity by ids.

func (*InterpretationMutation) AddedEdges

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

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

func (*InterpretationMutation) AddedField

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

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

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

func (*InterpretationMutation) AddedIDs

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

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

func (*InterpretationMutation) ClearEdge

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

func (m *InterpretationMutation) 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 (*InterpretationMutation) ClearScale

func (m *InterpretationMutation) ClearScale()

ClearScale clears the "scale" edge to the Scale entity.

func (*InterpretationMutation) ClearTranslations

func (m *InterpretationMutation) ClearTranslations()

ClearTranslations clears the "translations" edge to the InterpretationTranslation entity.

func (*InterpretationMutation) ClearedEdges

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

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

func (*InterpretationMutation) ClearedFields

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

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

func (InterpretationMutation) Client

func (m InterpretationMutation) 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 (*InterpretationMutation) CreateTime

func (m *InterpretationMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*InterpretationMutation) EdgeCleared

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

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

func (*InterpretationMutation) Field

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

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

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

func (*InterpretationMutation) Fields

func (m *InterpretationMutation) 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 (*InterpretationMutation) ID

func (m *InterpretationMutation) ID() (id uuid.UUID, 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 (*InterpretationMutation) IDs

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 (*InterpretationMutation) OldCreateTime

func (m *InterpretationMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Interpretation entity. If the Interpretation 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 (*InterpretationMutation) OldField

func (m *InterpretationMutation) 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 (*InterpretationMutation) OldRange

func (m *InterpretationMutation) OldRange(ctx context.Context) (v [2]float64, err error)

OldRange returns the old "range" field's value of the Interpretation entity. If the Interpretation 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 (*InterpretationMutation) OldUpdateTime

func (m *InterpretationMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Interpretation entity. If the Interpretation 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 (*InterpretationMutation) Op

func (m *InterpretationMutation) Op() Op

Op returns the operation name.

func (*InterpretationMutation) Range

func (m *InterpretationMutation) Range() (r [2]float64, exists bool)

Range returns the value of the "range" field in the mutation.

func (*InterpretationMutation) RemoveTranslationIDs

func (m *InterpretationMutation) RemoveTranslationIDs(ids ...uuid.UUID)

RemoveTranslationIDs removes the "translations" edge to the InterpretationTranslation entity by IDs.

func (*InterpretationMutation) RemovedEdges

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

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

func (*InterpretationMutation) RemovedIDs

func (m *InterpretationMutation) 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 (*InterpretationMutation) RemovedTranslationsIDs

func (m *InterpretationMutation) RemovedTranslationsIDs() (ids []uuid.UUID)

RemovedTranslations returns the removed IDs of the "translations" edge to the InterpretationTranslation entity.

func (*InterpretationMutation) ResetCreateTime

func (m *InterpretationMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*InterpretationMutation) ResetEdge

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

func (m *InterpretationMutation) 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 (*InterpretationMutation) ResetRange

func (m *InterpretationMutation) ResetRange()

ResetRange resets all changes to the "range" field.

func (*InterpretationMutation) ResetScale

func (m *InterpretationMutation) ResetScale()

ResetScale resets all changes to the "scale" edge.

func (*InterpretationMutation) ResetTranslations

func (m *InterpretationMutation) ResetTranslations()

ResetTranslations resets all changes to the "translations" edge.

func (*InterpretationMutation) ResetUpdateTime

func (m *InterpretationMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*InterpretationMutation) ScaleCleared

func (m *InterpretationMutation) ScaleCleared() bool

ScaleCleared reports if the "scale" edge to the Scale entity was cleared.

func (*InterpretationMutation) ScaleID

func (m *InterpretationMutation) ScaleID() (id uuid.UUID, exists bool)

ScaleID returns the "scale" edge ID in the mutation.

func (*InterpretationMutation) ScaleIDs

func (m *InterpretationMutation) ScaleIDs() (ids []uuid.UUID)

ScaleIDs returns the "scale" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ScaleID instead. It exists only for internal usage by the builders.

func (*InterpretationMutation) SetCreateTime

func (m *InterpretationMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*InterpretationMutation) SetField

func (m *InterpretationMutation) 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 (*InterpretationMutation) SetID

func (m *InterpretationMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Interpretation entities.

func (*InterpretationMutation) SetRange

func (m *InterpretationMutation) SetRange(f [2]float64)

SetRange sets the "range" field.

func (*InterpretationMutation) SetScaleID

func (m *InterpretationMutation) SetScaleID(id uuid.UUID)

SetScaleID sets the "scale" edge to the Scale entity by id.

func (*InterpretationMutation) SetUpdateTime

func (m *InterpretationMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*InterpretationMutation) TranslationsCleared

func (m *InterpretationMutation) TranslationsCleared() bool

TranslationsCleared reports if the "translations" edge to the InterpretationTranslation entity was cleared.

func (*InterpretationMutation) TranslationsIDs

func (m *InterpretationMutation) TranslationsIDs() (ids []uuid.UUID)

TranslationsIDs returns the "translations" edge IDs in the mutation.

func (InterpretationMutation) Tx

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

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

func (*InterpretationMutation) Type

func (m *InterpretationMutation) Type() string

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

func (*InterpretationMutation) UpdateTime

func (m *InterpretationMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*InterpretationMutation) Where

Where appends a list predicates to the InterpretationMutation builder.

type InterpretationQuery

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

InterpretationQuery is the builder for querying Interpretation entities.

func (*InterpretationQuery) All

All executes the query and returns a list of Interpretations.

func (*InterpretationQuery) AllX

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

func (*InterpretationQuery) Clone

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

func (*InterpretationQuery) Count

func (iq *InterpretationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InterpretationQuery) CountX

func (iq *InterpretationQuery) CountX(ctx context.Context) int

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

func (*InterpretationQuery) Exist

func (iq *InterpretationQuery) Exist(ctx context.Context) (bool, error)

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

func (*InterpretationQuery) ExistX

func (iq *InterpretationQuery) ExistX(ctx context.Context) bool

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

func (*InterpretationQuery) First

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

func (*InterpretationQuery) FirstID

func (iq *InterpretationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InterpretationQuery) FirstIDX

func (iq *InterpretationQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*InterpretationQuery) FirstX

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

func (*InterpretationQuery) GroupBy

func (iq *InterpretationQuery) GroupBy(field string, fields ...string) *InterpretationGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Interpretation.Query().
	GroupBy(interpretation.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InterpretationQuery) IDs

func (iq *InterpretationQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*InterpretationQuery) IDsX

func (iq *InterpretationQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*InterpretationQuery) Limit

func (iq *InterpretationQuery) Limit(limit int) *InterpretationQuery

Limit adds a limit step to the query.

func (*InterpretationQuery) Offset

func (iq *InterpretationQuery) Offset(offset int) *InterpretationQuery

Offset adds an offset step to the query.

func (*InterpretationQuery) Only

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

func (*InterpretationQuery) OnlyID

func (iq *InterpretationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InterpretationQuery) OnlyIDX

func (iq *InterpretationQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*InterpretationQuery) OnlyX

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

func (*InterpretationQuery) Order

Order adds an order step to the query.

func (*InterpretationQuery) QueryScale

func (iq *InterpretationQuery) QueryScale() *ScaleQuery

QueryScale chains the current query on the "scale" edge.

func (*InterpretationQuery) QueryTranslations

func (iq *InterpretationQuery) QueryTranslations() *InterpretationTranslationQuery

QueryTranslations chains the current query on the "translations" edge.

func (*InterpretationQuery) Select

func (iq *InterpretationQuery) Select(fields ...string) *InterpretationSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Interpretation.Query().
	Select(interpretation.FieldCreateTime).
	Scan(ctx, &v)

func (*InterpretationQuery) Unique

func (iq *InterpretationQuery) Unique(unique bool) *InterpretationQuery

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

Where adds a new predicate for the InterpretationQuery builder.

func (*InterpretationQuery) WithScale

func (iq *InterpretationQuery) WithScale(opts ...func(*ScaleQuery)) *InterpretationQuery

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

func (*InterpretationQuery) WithTranslations

func (iq *InterpretationQuery) WithTranslations(opts ...func(*InterpretationTranslationQuery)) *InterpretationQuery

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

type InterpretationSelect

type InterpretationSelect struct {
	*InterpretationQuery
	// contains filtered or unexported fields
}

InterpretationSelect is the builder for selecting fields of Interpretation entities.

func (*InterpretationSelect) Bool

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

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

func (*InterpretationSelect) BoolX

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

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

func (*InterpretationSelect) Bools

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

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

func (*InterpretationSelect) BoolsX

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

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

func (*InterpretationSelect) Float64

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

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

func (*InterpretationSelect) Float64X

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

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

func (*InterpretationSelect) Float64s

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

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

func (*InterpretationSelect) Float64sX

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

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

func (*InterpretationSelect) Int

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

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

func (*InterpretationSelect) IntX

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

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

func (*InterpretationSelect) Ints

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

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

func (*InterpretationSelect) IntsX

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

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

func (*InterpretationSelect) Scan

func (is *InterpretationSelect) Scan(ctx context.Context, v interface{}) error

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

func (*InterpretationSelect) ScanX

func (s *InterpretationSelect) ScanX(ctx context.Context, v interface{})

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

func (*InterpretationSelect) String

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

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

func (*InterpretationSelect) StringX

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

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

func (*InterpretationSelect) Strings

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

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

func (*InterpretationSelect) StringsX

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

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

type InterpretationTranslation

type InterpretationTranslation struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Locale holds the value of the "locale" field.
	Locale interpretationtranslation.Locale `json:"locale,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InterpretationTranslationQuery when eager-loading is set.
	Edges InterpretationTranslationEdges `json:"edges"`
	// contains filtered or unexported fields
}

InterpretationTranslation is the model entity for the InterpretationTranslation schema.

func (*InterpretationTranslation) QueryInterpretation

func (it *InterpretationTranslation) QueryInterpretation() *InterpretationQuery

QueryInterpretation queries the "interpretation" edge of the InterpretationTranslation entity.

func (*InterpretationTranslation) String

func (it *InterpretationTranslation) String() string

String implements the fmt.Stringer.

func (*InterpretationTranslation) Unwrap

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

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

type InterpretationTranslationClient

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

InterpretationTranslationClient is a client for the InterpretationTranslation schema.

func NewInterpretationTranslationClient

func NewInterpretationTranslationClient(c config) *InterpretationTranslationClient

NewInterpretationTranslationClient returns a client for the InterpretationTranslation from the given config.

func (*InterpretationTranslationClient) Create

Create returns a builder for creating a InterpretationTranslation entity.

func (*InterpretationTranslationClient) CreateBulk

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

func (*InterpretationTranslationClient) Delete

Delete returns a delete builder for InterpretationTranslation.

func (*InterpretationTranslationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InterpretationTranslationClient) DeleteOneID

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

func (*InterpretationTranslationClient) Get

Get returns a InterpretationTranslation entity by its id.

func (*InterpretationTranslationClient) GetX

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

func (*InterpretationTranslationClient) Hooks

Hooks returns the client hooks.

func (*InterpretationTranslationClient) Query

Query returns a query builder for InterpretationTranslation.

func (*InterpretationTranslationClient) QueryInterpretation

QueryInterpretation queries the interpretation edge of a InterpretationTranslation.

func (*InterpretationTranslationClient) Update

Update returns an update builder for InterpretationTranslation.

func (*InterpretationTranslationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*InterpretationTranslationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*InterpretationTranslationClient) Use

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

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

type InterpretationTranslationCreate

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

InterpretationTranslationCreate is the builder for creating a InterpretationTranslation entity.

func (*InterpretationTranslationCreate) Exec

Exec executes the query.

func (*InterpretationTranslationCreate) ExecX

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

func (*InterpretationTranslationCreate) Mutation

Mutation returns the InterpretationTranslationMutation object of the builder.

func (*InterpretationTranslationCreate) Save

Save creates the InterpretationTranslation in the database.

func (*InterpretationTranslationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*InterpretationTranslationCreate) SetContent

SetContent sets the "content" field.

func (*InterpretationTranslationCreate) SetID

SetID sets the "id" field.

func (*InterpretationTranslationCreate) SetInterpretation

SetInterpretation sets the "interpretation" edge to the Interpretation entity.

func (*InterpretationTranslationCreate) SetInterpretationID

SetInterpretationID sets the "interpretation" edge to the Interpretation entity by ID.

func (*InterpretationTranslationCreate) SetLocale

SetLocale sets the "locale" field.

func (*InterpretationTranslationCreate) SetNillableID

SetNillableID sets the "id" field if the given value is not nil.

func (*InterpretationTranslationCreate) SetNillableInterpretationID

func (itc *InterpretationTranslationCreate) SetNillableInterpretationID(id *uuid.UUID) *InterpretationTranslationCreate

SetNillableInterpretationID sets the "interpretation" edge to the Interpretation entity by ID if the given value is not nil.

type InterpretationTranslationCreateBulk

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

InterpretationTranslationCreateBulk is the builder for creating many InterpretationTranslation entities in bulk.

func (*InterpretationTranslationCreateBulk) Exec

Exec executes the query.

func (*InterpretationTranslationCreateBulk) ExecX

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

func (*InterpretationTranslationCreateBulk) Save

Save creates the InterpretationTranslation entities in the database.

func (*InterpretationTranslationCreateBulk) SaveX

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

type InterpretationTranslationDelete

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

InterpretationTranslationDelete is the builder for deleting a InterpretationTranslation entity.

func (*InterpretationTranslationDelete) Exec

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

func (*InterpretationTranslationDelete) ExecX

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

func (*InterpretationTranslationDelete) Where

Where appends a list predicates to the InterpretationTranslationDelete builder.

type InterpretationTranslationDeleteOne

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

InterpretationTranslationDeleteOne is the builder for deleting a single InterpretationTranslation entity.

func (*InterpretationTranslationDeleteOne) Exec

Exec executes the deletion query.

func (*InterpretationTranslationDeleteOne) ExecX

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

type InterpretationTranslationEdges

type InterpretationTranslationEdges struct {
	// Interpretation holds the value of the interpretation edge.
	Interpretation *Interpretation `json:"interpretation,omitempty"`
	// contains filtered or unexported fields
}

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

func (InterpretationTranslationEdges) InterpretationOrErr

func (e InterpretationTranslationEdges) InterpretationOrErr() (*Interpretation, error)

InterpretationOrErr returns the Interpretation value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type InterpretationTranslationGroupBy

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

InterpretationTranslationGroupBy is the group-by builder for InterpretationTranslation entities.

func (*InterpretationTranslationGroupBy) Aggregate

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

func (*InterpretationTranslationGroupBy) Bool

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

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

func (*InterpretationTranslationGroupBy) BoolX

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

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

func (*InterpretationTranslationGroupBy) Bools

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

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

func (*InterpretationTranslationGroupBy) BoolsX

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

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

func (*InterpretationTranslationGroupBy) Float64

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

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

func (*InterpretationTranslationGroupBy) Float64X

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

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

func (*InterpretationTranslationGroupBy) Float64s

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

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

func (*InterpretationTranslationGroupBy) Float64sX

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

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

func (*InterpretationTranslationGroupBy) Int

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

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

func (*InterpretationTranslationGroupBy) IntX

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

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

func (*InterpretationTranslationGroupBy) Ints

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

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

func (*InterpretationTranslationGroupBy) IntsX

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

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

func (*InterpretationTranslationGroupBy) Scan

func (itgb *InterpretationTranslationGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*InterpretationTranslationGroupBy) ScanX

func (s *InterpretationTranslationGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*InterpretationTranslationGroupBy) String

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

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

func (*InterpretationTranslationGroupBy) StringX

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

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

func (*InterpretationTranslationGroupBy) Strings

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

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

func (*InterpretationTranslationGroupBy) StringsX

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

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

type InterpretationTranslationMutation

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

InterpretationTranslationMutation represents an operation that mutates the InterpretationTranslation nodes in the graph.

func (*InterpretationTranslationMutation) AddField

func (m *InterpretationTranslationMutation) 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 (*InterpretationTranslationMutation) AddedEdges

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

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

func (*InterpretationTranslationMutation) AddedField

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

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

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

func (*InterpretationTranslationMutation) AddedIDs

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

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

func (*InterpretationTranslationMutation) ClearEdge

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

func (m *InterpretationTranslationMutation) 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 (*InterpretationTranslationMutation) ClearInterpretation

func (m *InterpretationTranslationMutation) ClearInterpretation()

ClearInterpretation clears the "interpretation" edge to the Interpretation entity.

func (*InterpretationTranslationMutation) ClearedEdges

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

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

func (*InterpretationTranslationMutation) ClearedFields

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

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

func (InterpretationTranslationMutation) 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 (*InterpretationTranslationMutation) Content

func (m *InterpretationTranslationMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*InterpretationTranslationMutation) EdgeCleared

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

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

func (*InterpretationTranslationMutation) Field

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 (*InterpretationTranslationMutation) FieldCleared

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

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

func (*InterpretationTranslationMutation) Fields

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 (*InterpretationTranslationMutation) ID

func (m *InterpretationTranslationMutation) ID() (id uuid.UUID, 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 (*InterpretationTranslationMutation) IDs

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 (*InterpretationTranslationMutation) InterpretationCleared

func (m *InterpretationTranslationMutation) InterpretationCleared() bool

InterpretationCleared reports if the "interpretation" edge to the Interpretation entity was cleared.

func (*InterpretationTranslationMutation) InterpretationID

func (m *InterpretationTranslationMutation) InterpretationID() (id uuid.UUID, exists bool)

InterpretationID returns the "interpretation" edge ID in the mutation.

func (*InterpretationTranslationMutation) InterpretationIDs

func (m *InterpretationTranslationMutation) InterpretationIDs() (ids []uuid.UUID)

InterpretationIDs returns the "interpretation" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use InterpretationID instead. It exists only for internal usage by the builders.

func (*InterpretationTranslationMutation) Locale

Locale returns the value of the "locale" field in the mutation.

func (*InterpretationTranslationMutation) OldContent

func (m *InterpretationTranslationMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the InterpretationTranslation entity. If the InterpretationTranslation 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 (*InterpretationTranslationMutation) 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 (*InterpretationTranslationMutation) OldLocale

OldLocale returns the old "locale" field's value of the InterpretationTranslation entity. If the InterpretationTranslation 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 (*InterpretationTranslationMutation) Op

Op returns the operation name.

func (*InterpretationTranslationMutation) RemovedEdges

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

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

func (*InterpretationTranslationMutation) RemovedIDs

func (m *InterpretationTranslationMutation) 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 (*InterpretationTranslationMutation) ResetContent

func (m *InterpretationTranslationMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*InterpretationTranslationMutation) ResetEdge

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

func (m *InterpretationTranslationMutation) 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 (*InterpretationTranslationMutation) ResetInterpretation

func (m *InterpretationTranslationMutation) ResetInterpretation()

ResetInterpretation resets all changes to the "interpretation" edge.

func (*InterpretationTranslationMutation) ResetLocale

func (m *InterpretationTranslationMutation) ResetLocale()

ResetLocale resets all changes to the "locale" field.

func (*InterpretationTranslationMutation) SetContent

func (m *InterpretationTranslationMutation) SetContent(s string)

SetContent sets the "content" field.

func (*InterpretationTranslationMutation) SetField

func (m *InterpretationTranslationMutation) 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 (*InterpretationTranslationMutation) SetID

SetID sets the value of the id field. Note that this operation is only accepted on creation of InterpretationTranslation entities.

func (*InterpretationTranslationMutation) SetInterpretationID

func (m *InterpretationTranslationMutation) SetInterpretationID(id uuid.UUID)

SetInterpretationID sets the "interpretation" edge to the Interpretation entity by id.

func (*InterpretationTranslationMutation) SetLocale

SetLocale sets the "locale" field.

func (InterpretationTranslationMutation) Tx

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

func (*InterpretationTranslationMutation) Type

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

func (*InterpretationTranslationMutation) Where

Where appends a list predicates to the InterpretationTranslationMutation builder.

type InterpretationTranslationQuery

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

InterpretationTranslationQuery is the builder for querying InterpretationTranslation entities.

func (*InterpretationTranslationQuery) All

All executes the query and returns a list of InterpretationTranslations.

func (*InterpretationTranslationQuery) AllX

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

func (*InterpretationTranslationQuery) Clone

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

func (*InterpretationTranslationQuery) Count

Count returns the count of the given query.

func (*InterpretationTranslationQuery) CountX

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

func (*InterpretationTranslationQuery) Exist

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

func (*InterpretationTranslationQuery) ExistX

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

func (*InterpretationTranslationQuery) First

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

func (*InterpretationTranslationQuery) FirstID

func (itq *InterpretationTranslationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InterpretationTranslationQuery) FirstIDX

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

func (*InterpretationTranslationQuery) FirstX

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

func (*InterpretationTranslationQuery) GroupBy

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 {
	Locale interpretationtranslation.Locale `json:"locale,omitempty"`
	Count int `json:"count,omitempty"`
}

client.InterpretationTranslation.Query().
	GroupBy(interpretationtranslation.FieldLocale).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InterpretationTranslationQuery) IDs

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

func (*InterpretationTranslationQuery) IDsX

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

func (*InterpretationTranslationQuery) Limit

Limit adds a limit step to the query.

func (*InterpretationTranslationQuery) Offset

Offset adds an offset step to the query.

func (*InterpretationTranslationQuery) Only

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

func (*InterpretationTranslationQuery) OnlyID

func (itq *InterpretationTranslationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InterpretationTranslationQuery) OnlyIDX

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

func (*InterpretationTranslationQuery) OnlyX

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

func (*InterpretationTranslationQuery) Order

Order adds an order step to the query.

func (*InterpretationTranslationQuery) QueryInterpretation

func (itq *InterpretationTranslationQuery) QueryInterpretation() *InterpretationQuery

QueryInterpretation chains the current query on the "interpretation" edge.

func (*InterpretationTranslationQuery) Select

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 {
	Locale interpretationtranslation.Locale `json:"locale,omitempty"`
}

client.InterpretationTranslation.Query().
	Select(interpretationtranslation.FieldLocale).
	Scan(ctx, &v)

func (*InterpretationTranslationQuery) Unique

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

Where adds a new predicate for the InterpretationTranslationQuery builder.

func (*InterpretationTranslationQuery) WithInterpretation

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

type InterpretationTranslationSelect

type InterpretationTranslationSelect struct {
	*InterpretationTranslationQuery
	// contains filtered or unexported fields
}

InterpretationTranslationSelect is the builder for selecting fields of InterpretationTranslation entities.

func (*InterpretationTranslationSelect) Bool

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

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

func (*InterpretationTranslationSelect) BoolX

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

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

func (*InterpretationTranslationSelect) Bools

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

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

func (*InterpretationTranslationSelect) BoolsX

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

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

func (*InterpretationTranslationSelect) Float64

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

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

func (*InterpretationTranslationSelect) Float64X

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

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

func (*InterpretationTranslationSelect) Float64s

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

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

func (*InterpretationTranslationSelect) Float64sX

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

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

func (*InterpretationTranslationSelect) Int

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

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

func (*InterpretationTranslationSelect) IntX

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

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

func (*InterpretationTranslationSelect) Ints

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

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

func (*InterpretationTranslationSelect) IntsX

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

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

func (*InterpretationTranslationSelect) Scan

func (its *InterpretationTranslationSelect) Scan(ctx context.Context, v interface{}) error

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

func (*InterpretationTranslationSelect) ScanX

func (s *InterpretationTranslationSelect) ScanX(ctx context.Context, v interface{})

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

func (*InterpretationTranslationSelect) String

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

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

func (*InterpretationTranslationSelect) StringX

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

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

func (*InterpretationTranslationSelect) Strings

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

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

func (*InterpretationTranslationSelect) StringsX

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

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

type InterpretationTranslationUpdate

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

InterpretationTranslationUpdate is the builder for updating InterpretationTranslation entities.

func (*InterpretationTranslationUpdate) ClearInterpretation

ClearInterpretation clears the "interpretation" edge to the Interpretation entity.

func (*InterpretationTranslationUpdate) Exec

Exec executes the query.

func (*InterpretationTranslationUpdate) ExecX

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

func (*InterpretationTranslationUpdate) Mutation

Mutation returns the InterpretationTranslationMutation object of the builder.

func (*InterpretationTranslationUpdate) Save

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

func (*InterpretationTranslationUpdate) SaveX

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

func (*InterpretationTranslationUpdate) SetContent

SetContent sets the "content" field.

func (*InterpretationTranslationUpdate) SetInterpretation

SetInterpretation sets the "interpretation" edge to the Interpretation entity.

func (*InterpretationTranslationUpdate) SetInterpretationID

SetInterpretationID sets the "interpretation" edge to the Interpretation entity by ID.

func (*InterpretationTranslationUpdate) SetNillableInterpretationID

func (itu *InterpretationTranslationUpdate) SetNillableInterpretationID(id *uuid.UUID) *InterpretationTranslationUpdate

SetNillableInterpretationID sets the "interpretation" edge to the Interpretation entity by ID if the given value is not nil.

func (*InterpretationTranslationUpdate) Where

Where appends a list predicates to the InterpretationTranslationUpdate builder.

type InterpretationTranslationUpdateOne

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

InterpretationTranslationUpdateOne is the builder for updating a single InterpretationTranslation entity.

func (*InterpretationTranslationUpdateOne) ClearInterpretation

ClearInterpretation clears the "interpretation" edge to the Interpretation entity.

func (*InterpretationTranslationUpdateOne) Exec

Exec executes the query on the entity.

func (*InterpretationTranslationUpdateOne) ExecX

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

func (*InterpretationTranslationUpdateOne) Mutation

Mutation returns the InterpretationTranslationMutation object of the builder.

func (*InterpretationTranslationUpdateOne) Save

Save executes the query and returns the updated InterpretationTranslation entity.

func (*InterpretationTranslationUpdateOne) SaveX

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

func (*InterpretationTranslationUpdateOne) Select

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

func (*InterpretationTranslationUpdateOne) SetContent

SetContent sets the "content" field.

func (*InterpretationTranslationUpdateOne) SetInterpretation

SetInterpretation sets the "interpretation" edge to the Interpretation entity.

func (*InterpretationTranslationUpdateOne) SetInterpretationID

SetInterpretationID sets the "interpretation" edge to the Interpretation entity by ID.

func (*InterpretationTranslationUpdateOne) SetNillableInterpretationID

func (ituo *InterpretationTranslationUpdateOne) SetNillableInterpretationID(id *uuid.UUID) *InterpretationTranslationUpdateOne

SetNillableInterpretationID sets the "interpretation" edge to the Interpretation entity by ID if the given value is not nil.

type InterpretationTranslations

type InterpretationTranslations []*InterpretationTranslation

InterpretationTranslations is a parsable slice of InterpretationTranslation.

type InterpretationUpdate

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

InterpretationUpdate is the builder for updating Interpretation entities.

func (*InterpretationUpdate) AddTranslationIDs

func (iu *InterpretationUpdate) AddTranslationIDs(ids ...uuid.UUID) *InterpretationUpdate

AddTranslationIDs adds the "translations" edge to the InterpretationTranslation entity by IDs.

func (*InterpretationUpdate) AddTranslations

AddTranslations adds the "translations" edges to the InterpretationTranslation entity.

func (*InterpretationUpdate) ClearScale

func (iu *InterpretationUpdate) ClearScale() *InterpretationUpdate

ClearScale clears the "scale" edge to the Scale entity.

func (*InterpretationUpdate) ClearTranslations

func (iu *InterpretationUpdate) ClearTranslations() *InterpretationUpdate

ClearTranslations clears all "translations" edges to the InterpretationTranslation entity.

func (*InterpretationUpdate) Exec

func (iu *InterpretationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*InterpretationUpdate) ExecX

func (iu *InterpretationUpdate) ExecX(ctx context.Context)

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

func (*InterpretationUpdate) Mutation

Mutation returns the InterpretationMutation object of the builder.

func (*InterpretationUpdate) RemoveTranslationIDs

func (iu *InterpretationUpdate) RemoveTranslationIDs(ids ...uuid.UUID) *InterpretationUpdate

RemoveTranslationIDs removes the "translations" edge to InterpretationTranslation entities by IDs.

func (*InterpretationUpdate) RemoveTranslations

RemoveTranslations removes "translations" edges to InterpretationTranslation entities.

func (*InterpretationUpdate) Save

func (iu *InterpretationUpdate) Save(ctx context.Context) (int, error)

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

func (*InterpretationUpdate) SaveX

func (iu *InterpretationUpdate) SaveX(ctx context.Context) int

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

func (*InterpretationUpdate) SetNillableScaleID

func (iu *InterpretationUpdate) SetNillableScaleID(id *uuid.UUID) *InterpretationUpdate

SetNillableScaleID sets the "scale" edge to the Scale entity by ID if the given value is not nil.

func (*InterpretationUpdate) SetRange

SetRange sets the "range" field.

func (*InterpretationUpdate) SetScale

SetScale sets the "scale" edge to the Scale entity.

func (*InterpretationUpdate) SetScaleID

func (iu *InterpretationUpdate) SetScaleID(id uuid.UUID) *InterpretationUpdate

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*InterpretationUpdate) SetUpdateTime

func (iu *InterpretationUpdate) SetUpdateTime(t time.Time) *InterpretationUpdate

SetUpdateTime sets the "update_time" field.

func (*InterpretationUpdate) Where

Where appends a list predicates to the InterpretationUpdate builder.

type InterpretationUpdateOne

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

InterpretationUpdateOne is the builder for updating a single Interpretation entity.

func (*InterpretationUpdateOne) AddTranslationIDs

func (iuo *InterpretationUpdateOne) AddTranslationIDs(ids ...uuid.UUID) *InterpretationUpdateOne

AddTranslationIDs adds the "translations" edge to the InterpretationTranslation entity by IDs.

func (*InterpretationUpdateOne) AddTranslations

AddTranslations adds the "translations" edges to the InterpretationTranslation entity.

func (*InterpretationUpdateOne) ClearScale

ClearScale clears the "scale" edge to the Scale entity.

func (*InterpretationUpdateOne) ClearTranslations

func (iuo *InterpretationUpdateOne) ClearTranslations() *InterpretationUpdateOne

ClearTranslations clears all "translations" edges to the InterpretationTranslation entity.

func (*InterpretationUpdateOne) Exec

Exec executes the query on the entity.

func (*InterpretationUpdateOne) ExecX

func (iuo *InterpretationUpdateOne) ExecX(ctx context.Context)

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

func (*InterpretationUpdateOne) Mutation

Mutation returns the InterpretationMutation object of the builder.

func (*InterpretationUpdateOne) RemoveTranslationIDs

func (iuo *InterpretationUpdateOne) RemoveTranslationIDs(ids ...uuid.UUID) *InterpretationUpdateOne

RemoveTranslationIDs removes the "translations" edge to InterpretationTranslation entities by IDs.

func (*InterpretationUpdateOne) RemoveTranslations

RemoveTranslations removes "translations" edges to InterpretationTranslation entities.

func (*InterpretationUpdateOne) Save

Save executes the query and returns the updated Interpretation entity.

func (*InterpretationUpdateOne) SaveX

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

func (*InterpretationUpdateOne) Select

func (iuo *InterpretationUpdateOne) Select(field string, fields ...string) *InterpretationUpdateOne

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

func (*InterpretationUpdateOne) SetNillableScaleID

func (iuo *InterpretationUpdateOne) SetNillableScaleID(id *uuid.UUID) *InterpretationUpdateOne

SetNillableScaleID sets the "scale" edge to the Scale entity by ID if the given value is not nil.

func (*InterpretationUpdateOne) SetRange

SetRange sets the "range" field.

func (*InterpretationUpdateOne) SetScale

SetScale sets the "scale" edge to the Scale entity.

func (*InterpretationUpdateOne) SetScaleID

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*InterpretationUpdateOne) SetUpdateTime

SetUpdateTime sets the "update_time" field.

type Interpretations

type Interpretations []*Interpretation

Interpretations is a parsable slice of Interpretation.

type Item

type Item struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Code holds the value of the "code" field.
	Code string `json:"code,omitempty"`
	// Steps holds the value of the "steps" field.
	Steps int `json:"steps,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ItemQuery when eager-loading is set.
	Edges ItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

Item is the model entity for the Item schema.

func (*Item) QueryQuestion

func (i *Item) QueryQuestion() *QuestionQuery

QueryQuestion queries the "question" edge of the Item entity.

func (*Item) QueryResponses

func (i *Item) QueryResponses() *ResponseQuery

QueryResponses queries the "responses" edge of the Item entity.

func (*Item) QueryScale

func (i *Item) QueryScale() *ScaleQuery

QueryScale queries the "scale" edge of the Item entity.

func (*Item) QueryScaleItem

func (i *Item) QueryScaleItem() *ScaleItemQuery

QueryScaleItem queries the "scale_item" edge of the Item entity.

func (*Item) QueryTranslations

func (i *Item) QueryTranslations() *ItemTranslationQuery

QueryTranslations queries the "translations" edge of the Item entity.

func (*Item) String

func (i *Item) String() string

String implements the fmt.Stringer.

func (*Item) Unwrap

func (i *Item) Unwrap() *Item

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

func (i *Item) Update() *ItemUpdateOne

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

type ItemClient

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

ItemClient is a client for the Item schema.

func NewItemClient

func NewItemClient(c config) *ItemClient

NewItemClient returns a client for the Item from the given config.

func (*ItemClient) Create

func (c *ItemClient) Create() *ItemCreate

Create returns a builder for creating a Item entity.

func (*ItemClient) CreateBulk

func (c *ItemClient) CreateBulk(builders ...*ItemCreate) *ItemCreateBulk

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

func (*ItemClient) Delete

func (c *ItemClient) Delete() *ItemDelete

Delete returns a delete builder for Item.

func (*ItemClient) DeleteOne

func (c *ItemClient) DeleteOne(i *Item) *ItemDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ItemClient) DeleteOneID

func (c *ItemClient) DeleteOneID(id uuid.UUID) *ItemDeleteOne

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

func (*ItemClient) Get

func (c *ItemClient) Get(ctx context.Context, id uuid.UUID) (*Item, error)

Get returns a Item entity by its id.

func (*ItemClient) GetX

func (c *ItemClient) GetX(ctx context.Context, id uuid.UUID) *Item

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

func (*ItemClient) Hooks

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

Hooks returns the client hooks.

func (*ItemClient) Query

func (c *ItemClient) Query() *ItemQuery

Query returns a query builder for Item.

func (*ItemClient) QueryQuestion

func (c *ItemClient) QueryQuestion(i *Item) *QuestionQuery

QueryQuestion queries the question edge of a Item.

func (*ItemClient) QueryResponses

func (c *ItemClient) QueryResponses(i *Item) *ResponseQuery

QueryResponses queries the responses edge of a Item.

func (*ItemClient) QueryScale

func (c *ItemClient) QueryScale(i *Item) *ScaleQuery

QueryScale queries the scale edge of a Item.

func (*ItemClient) QueryScaleItem

func (c *ItemClient) QueryScaleItem(i *Item) *ScaleItemQuery

QueryScaleItem queries the scale_item edge of a Item.

func (*ItemClient) QueryTranslations

func (c *ItemClient) QueryTranslations(i *Item) *ItemTranslationQuery

QueryTranslations queries the translations edge of a Item.

func (*ItemClient) Update

func (c *ItemClient) Update() *ItemUpdate

Update returns an update builder for Item.

func (*ItemClient) UpdateOne

func (c *ItemClient) UpdateOne(i *Item) *ItemUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ItemClient) UpdateOneID

func (c *ItemClient) UpdateOneID(id uuid.UUID) *ItemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ItemClient) Use

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

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

type ItemCreate

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

ItemCreate is the builder for creating a Item entity.

func (*ItemCreate) AddQuestion

func (ic *ItemCreate) AddQuestion(q ...*Question) *ItemCreate

AddQuestion adds the "question" edges to the Question entity.

func (*ItemCreate) AddQuestionIDs

func (ic *ItemCreate) AddQuestionIDs(ids ...uuid.UUID) *ItemCreate

AddQuestionIDs adds the "question" edge to the Question entity by IDs.

func (*ItemCreate) AddResponseIDs

func (ic *ItemCreate) AddResponseIDs(ids ...uuid.UUID) *ItemCreate

AddResponseIDs adds the "responses" edge to the Response entity by IDs.

func (*ItemCreate) AddResponses

func (ic *ItemCreate) AddResponses(r ...*Response) *ItemCreate

AddResponses adds the "responses" edges to the Response entity.

func (*ItemCreate) AddScale

func (ic *ItemCreate) AddScale(s ...*Scale) *ItemCreate

AddScale adds the "scale" edges to the Scale entity.

func (*ItemCreate) AddScaleIDs

func (ic *ItemCreate) AddScaleIDs(ids ...uuid.UUID) *ItemCreate

AddScaleIDs adds the "scale" edge to the Scale entity by IDs.

func (*ItemCreate) AddTranslationIDs

func (ic *ItemCreate) AddTranslationIDs(ids ...uuid.UUID) *ItemCreate

AddTranslationIDs adds the "translations" edge to the ItemTranslation entity by IDs.

func (*ItemCreate) AddTranslations

func (ic *ItemCreate) AddTranslations(i ...*ItemTranslation) *ItemCreate

AddTranslations adds the "translations" edges to the ItemTranslation entity.

func (*ItemCreate) Exec

func (ic *ItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreate) ExecX

func (ic *ItemCreate) ExecX(ctx context.Context)

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

func (*ItemCreate) Mutation

func (ic *ItemCreate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemCreate) Save

func (ic *ItemCreate) Save(ctx context.Context) (*Item, error)

Save creates the Item in the database.

func (*ItemCreate) SaveX

func (ic *ItemCreate) SaveX(ctx context.Context) *Item

SaveX calls Save and panics if Save returns an error.

func (*ItemCreate) SetCode

func (ic *ItemCreate) SetCode(s string) *ItemCreate

SetCode sets the "code" field.

func (*ItemCreate) SetCreateTime

func (ic *ItemCreate) SetCreateTime(t time.Time) *ItemCreate

SetCreateTime sets the "create_time" field.

func (*ItemCreate) SetID

func (ic *ItemCreate) SetID(u uuid.UUID) *ItemCreate

SetID sets the "id" field.

func (*ItemCreate) SetNillableCreateTime

func (ic *ItemCreate) SetNillableCreateTime(t *time.Time) *ItemCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ItemCreate) SetNillableID

func (ic *ItemCreate) SetNillableID(u *uuid.UUID) *ItemCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ItemCreate) SetNillableSteps

func (ic *ItemCreate) SetNillableSteps(i *int) *ItemCreate

SetNillableSteps sets the "steps" field if the given value is not nil.

func (*ItemCreate) SetNillableUpdateTime

func (ic *ItemCreate) SetNillableUpdateTime(t *time.Time) *ItemCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ItemCreate) SetSteps

func (ic *ItemCreate) SetSteps(i int) *ItemCreate

SetSteps sets the "steps" field.

func (*ItemCreate) SetUpdateTime

func (ic *ItemCreate) SetUpdateTime(t time.Time) *ItemCreate

SetUpdateTime sets the "update_time" field.

type ItemCreateBulk

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

ItemCreateBulk is the builder for creating many Item entities in bulk.

func (*ItemCreateBulk) Exec

func (icb *ItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreateBulk) ExecX

func (icb *ItemCreateBulk) ExecX(ctx context.Context)

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

func (*ItemCreateBulk) Save

func (icb *ItemCreateBulk) Save(ctx context.Context) ([]*Item, error)

Save creates the Item entities in the database.

func (*ItemCreateBulk) SaveX

func (icb *ItemCreateBulk) SaveX(ctx context.Context) []*Item

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

type ItemDelete

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

ItemDelete is the builder for deleting a Item entity.

func (*ItemDelete) Exec

func (id *ItemDelete) Exec(ctx context.Context) (int, error)

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

func (*ItemDelete) ExecX

func (id *ItemDelete) ExecX(ctx context.Context) int

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

func (*ItemDelete) Where

func (id *ItemDelete) Where(ps ...predicate.Item) *ItemDelete

Where appends a list predicates to the ItemDelete builder.

type ItemDeleteOne

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

ItemDeleteOne is the builder for deleting a single Item entity.

func (*ItemDeleteOne) Exec

func (ido *ItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ItemDeleteOne) ExecX

func (ido *ItemDeleteOne) ExecX(ctx context.Context)

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

type ItemEdges

type ItemEdges struct {
	// Responses holds the value of the responses edge.
	Responses []*Response `json:"responses,omitempty"`
	// Translations holds the value of the translations edge.
	Translations []*ItemTranslation `json:"translations,omitempty"`
	// Scale holds the value of the scale edge.
	Scale []*Scale `json:"scale,omitempty"`
	// Question holds the value of the question edge.
	Question []*Question `json:"question,omitempty"`
	// ScaleItem holds the value of the scale_item edge.
	ScaleItem []*ScaleItem `json:"scale_item,omitempty"`
	// contains filtered or unexported fields
}

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

func (ItemEdges) QuestionOrErr

func (e ItemEdges) QuestionOrErr() ([]*Question, error)

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

func (ItemEdges) ResponsesOrErr

func (e ItemEdges) ResponsesOrErr() ([]*Response, error)

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

func (ItemEdges) ScaleItemOrErr

func (e ItemEdges) ScaleItemOrErr() ([]*ScaleItem, error)

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

func (ItemEdges) ScaleOrErr

func (e ItemEdges) ScaleOrErr() ([]*Scale, error)

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

func (ItemEdges) TranslationsOrErr

func (e ItemEdges) TranslationsOrErr() ([]*ItemTranslation, error)

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

type ItemGroupBy

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

ItemGroupBy is the group-by builder for Item entities.

func (*ItemGroupBy) Aggregate

func (igb *ItemGroupBy) Aggregate(fns ...AggregateFunc) *ItemGroupBy

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

func (*ItemGroupBy) Bool

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

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

func (*ItemGroupBy) BoolX

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

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

func (*ItemGroupBy) Bools

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

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

func (*ItemGroupBy) BoolsX

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

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

func (*ItemGroupBy) Float64

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

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

func (*ItemGroupBy) Float64X

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

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

func (*ItemGroupBy) Float64s

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

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

func (*ItemGroupBy) Float64sX

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

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

func (*ItemGroupBy) Int

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

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

func (*ItemGroupBy) IntX

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

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

func (*ItemGroupBy) Ints

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

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

func (*ItemGroupBy) IntsX

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

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

func (*ItemGroupBy) Scan

func (igb *ItemGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ItemGroupBy) ScanX

func (s *ItemGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ItemGroupBy) String

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

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

func (*ItemGroupBy) StringX

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

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

func (*ItemGroupBy) Strings

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

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

func (*ItemGroupBy) StringsX

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

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

type ItemMutation

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

ItemMutation represents an operation that mutates the Item nodes in the graph.

func (*ItemMutation) AddField

func (m *ItemMutation) 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 (*ItemMutation) AddQuestionIDs

func (m *ItemMutation) AddQuestionIDs(ids ...uuid.UUID)

AddQuestionIDs adds the "question" edge to the Question entity by ids.

func (*ItemMutation) AddResponseIDs

func (m *ItemMutation) AddResponseIDs(ids ...uuid.UUID)

AddResponseIDs adds the "responses" edge to the Response entity by ids.

func (*ItemMutation) AddScaleIDs

func (m *ItemMutation) AddScaleIDs(ids ...uuid.UUID)

AddScaleIDs adds the "scale" edge to the Scale entity by ids.

func (*ItemMutation) AddSteps

func (m *ItemMutation) AddSteps(i int)

AddSteps adds i to the "steps" field.

func (*ItemMutation) AddTranslationIDs

func (m *ItemMutation) AddTranslationIDs(ids ...uuid.UUID)

AddTranslationIDs adds the "translations" edge to the ItemTranslation entity by ids.

func (*ItemMutation) AddedEdges

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

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

func (*ItemMutation) AddedField

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

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

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

func (*ItemMutation) AddedIDs

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

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

func (*ItemMutation) AddedSteps

func (m *ItemMutation) AddedSteps() (r int, exists bool)

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

func (*ItemMutation) ClearEdge

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

func (m *ItemMutation) 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 (*ItemMutation) ClearQuestion

func (m *ItemMutation) ClearQuestion()

ClearQuestion clears the "question" edge to the Question entity.

func (*ItemMutation) ClearResponses

func (m *ItemMutation) ClearResponses()

ClearResponses clears the "responses" edge to the Response entity.

func (*ItemMutation) ClearScale

func (m *ItemMutation) ClearScale()

ClearScale clears the "scale" edge to the Scale entity.

func (*ItemMutation) ClearTranslations

func (m *ItemMutation) ClearTranslations()

ClearTranslations clears the "translations" edge to the ItemTranslation entity.

func (*ItemMutation) ClearedEdges

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

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

func (*ItemMutation) ClearedFields

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

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

func (ItemMutation) Client

func (m ItemMutation) 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 (*ItemMutation) Code

func (m *ItemMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*ItemMutation) CreateTime

func (m *ItemMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ItemMutation) EdgeCleared

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

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

func (*ItemMutation) Field

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

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

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

func (*ItemMutation) Fields

func (m *ItemMutation) 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 (*ItemMutation) ID

func (m *ItemMutation) ID() (id uuid.UUID, 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 (*ItemMutation) IDs

func (m *ItemMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ItemMutation) OldCode

func (m *ItemMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Item entity. If the Item 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 (*ItemMutation) OldCreateTime

func (m *ItemMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Item entity. If the Item 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 (*ItemMutation) OldField

func (m *ItemMutation) 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 (*ItemMutation) OldSteps

func (m *ItemMutation) OldSteps(ctx context.Context) (v int, err error)

OldSteps returns the old "steps" field's value of the Item entity. If the Item 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 (*ItemMutation) OldUpdateTime

func (m *ItemMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Item entity. If the Item 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 (*ItemMutation) Op

func (m *ItemMutation) Op() Op

Op returns the operation name.

func (*ItemMutation) QuestionCleared

func (m *ItemMutation) QuestionCleared() bool

QuestionCleared reports if the "question" edge to the Question entity was cleared.

func (*ItemMutation) QuestionIDs

func (m *ItemMutation) QuestionIDs() (ids []uuid.UUID)

QuestionIDs returns the "question" edge IDs in the mutation.

func (*ItemMutation) RemoveQuestionIDs

func (m *ItemMutation) RemoveQuestionIDs(ids ...uuid.UUID)

RemoveQuestionIDs removes the "question" edge to the Question entity by IDs.

func (*ItemMutation) RemoveResponseIDs

func (m *ItemMutation) RemoveResponseIDs(ids ...uuid.UUID)

RemoveResponseIDs removes the "responses" edge to the Response entity by IDs.

func (*ItemMutation) RemoveScaleIDs

func (m *ItemMutation) RemoveScaleIDs(ids ...uuid.UUID)

RemoveScaleIDs removes the "scale" edge to the Scale entity by IDs.

func (*ItemMutation) RemoveTranslationIDs

func (m *ItemMutation) RemoveTranslationIDs(ids ...uuid.UUID)

RemoveTranslationIDs removes the "translations" edge to the ItemTranslation entity by IDs.

func (*ItemMutation) RemovedEdges

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

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

func (*ItemMutation) RemovedIDs

func (m *ItemMutation) 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 (*ItemMutation) RemovedQuestionIDs

func (m *ItemMutation) RemovedQuestionIDs() (ids []uuid.UUID)

RemovedQuestion returns the removed IDs of the "question" edge to the Question entity.

func (*ItemMutation) RemovedResponsesIDs

func (m *ItemMutation) RemovedResponsesIDs() (ids []uuid.UUID)

RemovedResponses returns the removed IDs of the "responses" edge to the Response entity.

func (*ItemMutation) RemovedScaleIDs

func (m *ItemMutation) RemovedScaleIDs() (ids []uuid.UUID)

RemovedScale returns the removed IDs of the "scale" edge to the Scale entity.

func (*ItemMutation) RemovedTranslationsIDs

func (m *ItemMutation) RemovedTranslationsIDs() (ids []uuid.UUID)

RemovedTranslations returns the removed IDs of the "translations" edge to the ItemTranslation entity.

func (*ItemMutation) ResetCode

func (m *ItemMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*ItemMutation) ResetCreateTime

func (m *ItemMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ItemMutation) ResetEdge

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

func (m *ItemMutation) 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 (*ItemMutation) ResetQuestion

func (m *ItemMutation) ResetQuestion()

ResetQuestion resets all changes to the "question" edge.

func (*ItemMutation) ResetResponses

func (m *ItemMutation) ResetResponses()

ResetResponses resets all changes to the "responses" edge.

func (*ItemMutation) ResetScale

func (m *ItemMutation) ResetScale()

ResetScale resets all changes to the "scale" edge.

func (*ItemMutation) ResetSteps

func (m *ItemMutation) ResetSteps()

ResetSteps resets all changes to the "steps" field.

func (*ItemMutation) ResetTranslations

func (m *ItemMutation) ResetTranslations()

ResetTranslations resets all changes to the "translations" edge.

func (*ItemMutation) ResetUpdateTime

func (m *ItemMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ItemMutation) ResponsesCleared

func (m *ItemMutation) ResponsesCleared() bool

ResponsesCleared reports if the "responses" edge to the Response entity was cleared.

func (*ItemMutation) ResponsesIDs

func (m *ItemMutation) ResponsesIDs() (ids []uuid.UUID)

ResponsesIDs returns the "responses" edge IDs in the mutation.

func (*ItemMutation) ScaleCleared

func (m *ItemMutation) ScaleCleared() bool

ScaleCleared reports if the "scale" edge to the Scale entity was cleared.

func (*ItemMutation) ScaleIDs

func (m *ItemMutation) ScaleIDs() (ids []uuid.UUID)

ScaleIDs returns the "scale" edge IDs in the mutation.

func (*ItemMutation) SetCode

func (m *ItemMutation) SetCode(s string)

SetCode sets the "code" field.

func (*ItemMutation) SetCreateTime

func (m *ItemMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ItemMutation) SetField

func (m *ItemMutation) 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 (*ItemMutation) SetID

func (m *ItemMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Item entities.

func (*ItemMutation) SetSteps

func (m *ItemMutation) SetSteps(i int)

SetSteps sets the "steps" field.

func (*ItemMutation) SetUpdateTime

func (m *ItemMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ItemMutation) Steps

func (m *ItemMutation) Steps() (r int, exists bool)

Steps returns the value of the "steps" field in the mutation.

func (*ItemMutation) TranslationsCleared

func (m *ItemMutation) TranslationsCleared() bool

TranslationsCleared reports if the "translations" edge to the ItemTranslation entity was cleared.

func (*ItemMutation) TranslationsIDs

func (m *ItemMutation) TranslationsIDs() (ids []uuid.UUID)

TranslationsIDs returns the "translations" edge IDs in the mutation.

func (ItemMutation) Tx

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

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

func (*ItemMutation) Type

func (m *ItemMutation) Type() string

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

func (*ItemMutation) UpdateTime

func (m *ItemMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ItemMutation) Where

func (m *ItemMutation) Where(ps ...predicate.Item)

Where appends a list predicates to the ItemMutation builder.

type ItemQuery

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

ItemQuery is the builder for querying Item entities.

func (*ItemQuery) All

func (iq *ItemQuery) All(ctx context.Context) ([]*Item, error)

All executes the query and returns a list of Items.

func (*ItemQuery) AllX

func (iq *ItemQuery) AllX(ctx context.Context) []*Item

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

func (*ItemQuery) Clone

func (iq *ItemQuery) Clone() *ItemQuery

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

func (*ItemQuery) Count

func (iq *ItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ItemQuery) CountX

func (iq *ItemQuery) CountX(ctx context.Context) int

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

func (*ItemQuery) Exist

func (iq *ItemQuery) Exist(ctx context.Context) (bool, error)

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

func (*ItemQuery) ExistX

func (iq *ItemQuery) ExistX(ctx context.Context) bool

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

func (*ItemQuery) First

func (iq *ItemQuery) First(ctx context.Context) (*Item, error)

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

func (*ItemQuery) FirstID

func (iq *ItemQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ItemQuery) FirstIDX

func (iq *ItemQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ItemQuery) FirstX

func (iq *ItemQuery) FirstX(ctx context.Context) *Item

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

func (*ItemQuery) GroupBy

func (iq *ItemQuery) GroupBy(field string, fields ...string) *ItemGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Item.Query().
	GroupBy(item.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ItemQuery) IDs

func (iq *ItemQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*ItemQuery) IDsX

func (iq *ItemQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ItemQuery) Limit

func (iq *ItemQuery) Limit(limit int) *ItemQuery

Limit adds a limit step to the query.

func (*ItemQuery) Offset

func (iq *ItemQuery) Offset(offset int) *ItemQuery

Offset adds an offset step to the query.

func (*ItemQuery) Only

func (iq *ItemQuery) Only(ctx context.Context) (*Item, error)

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

func (*ItemQuery) OnlyID

func (iq *ItemQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ItemQuery) OnlyIDX

func (iq *ItemQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ItemQuery) OnlyX

func (iq *ItemQuery) OnlyX(ctx context.Context) *Item

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

func (*ItemQuery) Order

func (iq *ItemQuery) Order(o ...OrderFunc) *ItemQuery

Order adds an order step to the query.

func (*ItemQuery) QueryQuestion

func (iq *ItemQuery) QueryQuestion() *QuestionQuery

QueryQuestion chains the current query on the "question" edge.

func (*ItemQuery) QueryResponses

func (iq *ItemQuery) QueryResponses() *ResponseQuery

QueryResponses chains the current query on the "responses" edge.

func (*ItemQuery) QueryScale

func (iq *ItemQuery) QueryScale() *ScaleQuery

QueryScale chains the current query on the "scale" edge.

func (*ItemQuery) QueryScaleItem

func (iq *ItemQuery) QueryScaleItem() *ScaleItemQuery

QueryScaleItem chains the current query on the "scale_item" edge.

func (*ItemQuery) QueryTranslations

func (iq *ItemQuery) QueryTranslations() *ItemTranslationQuery

QueryTranslations chains the current query on the "translations" edge.

func (*ItemQuery) Select

func (iq *ItemQuery) Select(fields ...string) *ItemSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Item.Query().
	Select(item.FieldCreateTime).
	Scan(ctx, &v)

func (*ItemQuery) Unique

func (iq *ItemQuery) Unique(unique bool) *ItemQuery

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

func (iq *ItemQuery) Where(ps ...predicate.Item) *ItemQuery

Where adds a new predicate for the ItemQuery builder.

func (*ItemQuery) WithQuestion

func (iq *ItemQuery) WithQuestion(opts ...func(*QuestionQuery)) *ItemQuery

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

func (*ItemQuery) WithResponses

func (iq *ItemQuery) WithResponses(opts ...func(*ResponseQuery)) *ItemQuery

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

func (*ItemQuery) WithScale

func (iq *ItemQuery) WithScale(opts ...func(*ScaleQuery)) *ItemQuery

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

func (*ItemQuery) WithScaleItem

func (iq *ItemQuery) WithScaleItem(opts ...func(*ScaleItemQuery)) *ItemQuery

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

func (*ItemQuery) WithTranslations

func (iq *ItemQuery) WithTranslations(opts ...func(*ItemTranslationQuery)) *ItemQuery

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

type ItemSelect

type ItemSelect struct {
	*ItemQuery
	// contains filtered or unexported fields
}

ItemSelect is the builder for selecting fields of Item entities.

func (*ItemSelect) Bool

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

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

func (*ItemSelect) BoolX

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

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

func (*ItemSelect) Bools

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

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

func (*ItemSelect) BoolsX

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

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

func (*ItemSelect) Float64

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

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

func (*ItemSelect) Float64X

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

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

func (*ItemSelect) Float64s

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

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

func (*ItemSelect) Float64sX

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

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

func (*ItemSelect) Int

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

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

func (*ItemSelect) IntX

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

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

func (*ItemSelect) Ints

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

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

func (*ItemSelect) IntsX

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

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

func (*ItemSelect) Scan

func (is *ItemSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ItemSelect) ScanX

func (s *ItemSelect) ScanX(ctx context.Context, v interface{})

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

func (*ItemSelect) String

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

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

func (*ItemSelect) StringX

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

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

func (*ItemSelect) Strings

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

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

func (*ItemSelect) StringsX

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

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

type ItemTranslation

type ItemTranslation struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Locale holds the value of the "locale" field.
	Locale itemtranslation.Locale `json:"locale,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ItemTranslationQuery when eager-loading is set.
	Edges ItemTranslationEdges `json:"edges"`
	// contains filtered or unexported fields
}

ItemTranslation is the model entity for the ItemTranslation schema.

func (*ItemTranslation) QueryItem

func (it *ItemTranslation) QueryItem() *ItemQuery

QueryItem queries the "item" edge of the ItemTranslation entity.

func (*ItemTranslation) String

func (it *ItemTranslation) String() string

String implements the fmt.Stringer.

func (*ItemTranslation) Unwrap

func (it *ItemTranslation) Unwrap() *ItemTranslation

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

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

type ItemTranslationClient

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

ItemTranslationClient is a client for the ItemTranslation schema.

func NewItemTranslationClient

func NewItemTranslationClient(c config) *ItemTranslationClient

NewItemTranslationClient returns a client for the ItemTranslation from the given config.

func (*ItemTranslationClient) Create

Create returns a builder for creating a ItemTranslation entity.

func (*ItemTranslationClient) CreateBulk

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

func (*ItemTranslationClient) Delete

Delete returns a delete builder for ItemTranslation.

func (*ItemTranslationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ItemTranslationClient) DeleteOneID

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

func (*ItemTranslationClient) Get

Get returns a ItemTranslation entity by its id.

func (*ItemTranslationClient) GetX

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

func (*ItemTranslationClient) Hooks

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

Hooks returns the client hooks.

func (*ItemTranslationClient) Query

Query returns a query builder for ItemTranslation.

func (*ItemTranslationClient) QueryItem

func (c *ItemTranslationClient) QueryItem(it *ItemTranslation) *ItemQuery

QueryItem queries the item edge of a ItemTranslation.

func (*ItemTranslationClient) Update

Update returns an update builder for ItemTranslation.

func (*ItemTranslationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ItemTranslationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ItemTranslationClient) Use

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

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

type ItemTranslationCreate

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

ItemTranslationCreate is the builder for creating a ItemTranslation entity.

func (*ItemTranslationCreate) Exec

func (itc *ItemTranslationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemTranslationCreate) ExecX

func (itc *ItemTranslationCreate) ExecX(ctx context.Context)

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

func (*ItemTranslationCreate) Mutation

Mutation returns the ItemTranslationMutation object of the builder.

func (*ItemTranslationCreate) Save

Save creates the ItemTranslation in the database.

func (*ItemTranslationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ItemTranslationCreate) SetContent

SetContent sets the "content" field.

func (*ItemTranslationCreate) SetID

SetID sets the "id" field.

func (*ItemTranslationCreate) SetItem

SetItem sets the "item" edge to the Item entity.

func (*ItemTranslationCreate) SetItemID

SetItemID sets the "item" edge to the Item entity by ID.

func (*ItemTranslationCreate) SetLocale

SetLocale sets the "locale" field.

func (*ItemTranslationCreate) SetNillableID

func (itc *ItemTranslationCreate) SetNillableID(u *uuid.UUID) *ItemTranslationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ItemTranslationCreate) SetNillableItemID

func (itc *ItemTranslationCreate) SetNillableItemID(id *uuid.UUID) *ItemTranslationCreate

SetNillableItemID sets the "item" edge to the Item entity by ID if the given value is not nil.

type ItemTranslationCreateBulk

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

ItemTranslationCreateBulk is the builder for creating many ItemTranslation entities in bulk.

func (*ItemTranslationCreateBulk) Exec

Exec executes the query.

func (*ItemTranslationCreateBulk) ExecX

func (itcb *ItemTranslationCreateBulk) ExecX(ctx context.Context)

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

func (*ItemTranslationCreateBulk) Save

Save creates the ItemTranslation entities in the database.

func (*ItemTranslationCreateBulk) SaveX

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

type ItemTranslationDelete

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

ItemTranslationDelete is the builder for deleting a ItemTranslation entity.

func (*ItemTranslationDelete) Exec

func (itd *ItemTranslationDelete) Exec(ctx context.Context) (int, error)

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

func (*ItemTranslationDelete) ExecX

func (itd *ItemTranslationDelete) ExecX(ctx context.Context) int

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

func (*ItemTranslationDelete) Where

Where appends a list predicates to the ItemTranslationDelete builder.

type ItemTranslationDeleteOne

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

ItemTranslationDeleteOne is the builder for deleting a single ItemTranslation entity.

func (*ItemTranslationDeleteOne) Exec

Exec executes the deletion query.

func (*ItemTranslationDeleteOne) ExecX

func (itdo *ItemTranslationDeleteOne) ExecX(ctx context.Context)

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

type ItemTranslationEdges

type ItemTranslationEdges struct {
	// Item holds the value of the item edge.
	Item *Item `json:"item,omitempty"`
	// contains filtered or unexported fields
}

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

func (ItemTranslationEdges) ItemOrErr

func (e ItemTranslationEdges) ItemOrErr() (*Item, error)

ItemOrErr returns the Item value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ItemTranslationGroupBy

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

ItemTranslationGroupBy is the group-by builder for ItemTranslation entities.

func (*ItemTranslationGroupBy) Aggregate

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

func (*ItemTranslationGroupBy) Bool

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

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

func (*ItemTranslationGroupBy) BoolX

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

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

func (*ItemTranslationGroupBy) Bools

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

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

func (*ItemTranslationGroupBy) BoolsX

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

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

func (*ItemTranslationGroupBy) Float64

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

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

func (*ItemTranslationGroupBy) Float64X

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

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

func (*ItemTranslationGroupBy) Float64s

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

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

func (*ItemTranslationGroupBy) Float64sX

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

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

func (*ItemTranslationGroupBy) Int

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

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

func (*ItemTranslationGroupBy) IntX

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

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

func (*ItemTranslationGroupBy) Ints

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

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

func (*ItemTranslationGroupBy) IntsX

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

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

func (*ItemTranslationGroupBy) Scan

func (itgb *ItemTranslationGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ItemTranslationGroupBy) ScanX

func (s *ItemTranslationGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ItemTranslationGroupBy) String

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

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

func (*ItemTranslationGroupBy) StringX

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

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

func (*ItemTranslationGroupBy) Strings

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

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

func (*ItemTranslationGroupBy) StringsX

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

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

type ItemTranslationMutation

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

ItemTranslationMutation represents an operation that mutates the ItemTranslation nodes in the graph.

func (*ItemTranslationMutation) AddField

func (m *ItemTranslationMutation) 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 (*ItemTranslationMutation) AddedEdges

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

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

func (*ItemTranslationMutation) AddedField

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

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

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

func (*ItemTranslationMutation) AddedIDs

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

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

func (*ItemTranslationMutation) ClearEdge

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

func (m *ItemTranslationMutation) 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 (*ItemTranslationMutation) ClearItem

func (m *ItemTranslationMutation) ClearItem()

ClearItem clears the "item" edge to the Item entity.

func (*ItemTranslationMutation) ClearedEdges

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

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

func (*ItemTranslationMutation) ClearedFields

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

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

func (ItemTranslationMutation) Client

func (m ItemTranslationMutation) 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 (*ItemTranslationMutation) Content

func (m *ItemTranslationMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*ItemTranslationMutation) EdgeCleared

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

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

func (*ItemTranslationMutation) Field

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

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

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

func (*ItemTranslationMutation) Fields

func (m *ItemTranslationMutation) 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 (*ItemTranslationMutation) ID

func (m *ItemTranslationMutation) ID() (id uuid.UUID, 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 (*ItemTranslationMutation) IDs

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 (*ItemTranslationMutation) ItemCleared

func (m *ItemTranslationMutation) ItemCleared() bool

ItemCleared reports if the "item" edge to the Item entity was cleared.

func (*ItemTranslationMutation) ItemID

func (m *ItemTranslationMutation) ItemID() (id uuid.UUID, exists bool)

ItemID returns the "item" edge ID in the mutation.

func (*ItemTranslationMutation) ItemIDs

func (m *ItemTranslationMutation) ItemIDs() (ids []uuid.UUID)

ItemIDs returns the "item" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ItemID instead. It exists only for internal usage by the builders.

func (*ItemTranslationMutation) Locale

func (m *ItemTranslationMutation) Locale() (r itemtranslation.Locale, exists bool)

Locale returns the value of the "locale" field in the mutation.

func (*ItemTranslationMutation) OldContent

func (m *ItemTranslationMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the ItemTranslation entity. If the ItemTranslation 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 (*ItemTranslationMutation) OldField

func (m *ItemTranslationMutation) 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 (*ItemTranslationMutation) OldLocale

OldLocale returns the old "locale" field's value of the ItemTranslation entity. If the ItemTranslation 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 (*ItemTranslationMutation) Op

func (m *ItemTranslationMutation) Op() Op

Op returns the operation name.

func (*ItemTranslationMutation) RemovedEdges

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

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

func (*ItemTranslationMutation) RemovedIDs

func (m *ItemTranslationMutation) 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 (*ItemTranslationMutation) ResetContent

func (m *ItemTranslationMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*ItemTranslationMutation) ResetEdge

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

func (m *ItemTranslationMutation) 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 (*ItemTranslationMutation) ResetItem

func (m *ItemTranslationMutation) ResetItem()

ResetItem resets all changes to the "item" edge.

func (*ItemTranslationMutation) ResetLocale

func (m *ItemTranslationMutation) ResetLocale()

ResetLocale resets all changes to the "locale" field.

func (*ItemTranslationMutation) SetContent

func (m *ItemTranslationMutation) SetContent(s string)

SetContent sets the "content" field.

func (*ItemTranslationMutation) SetField

func (m *ItemTranslationMutation) 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 (*ItemTranslationMutation) SetID

func (m *ItemTranslationMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ItemTranslation entities.

func (*ItemTranslationMutation) SetItemID

func (m *ItemTranslationMutation) SetItemID(id uuid.UUID)

SetItemID sets the "item" edge to the Item entity by id.

func (*ItemTranslationMutation) SetLocale

SetLocale sets the "locale" field.

func (ItemTranslationMutation) Tx

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

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

func (*ItemTranslationMutation) Type

func (m *ItemTranslationMutation) Type() string

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

func (*ItemTranslationMutation) Where

Where appends a list predicates to the ItemTranslationMutation builder.

type ItemTranslationQuery

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

ItemTranslationQuery is the builder for querying ItemTranslation entities.

func (*ItemTranslationQuery) All

All executes the query and returns a list of ItemTranslations.

func (*ItemTranslationQuery) AllX

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

func (*ItemTranslationQuery) Clone

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

func (*ItemTranslationQuery) Count

func (itq *ItemTranslationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ItemTranslationQuery) CountX

func (itq *ItemTranslationQuery) CountX(ctx context.Context) int

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

func (*ItemTranslationQuery) Exist

func (itq *ItemTranslationQuery) Exist(ctx context.Context) (bool, error)

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

func (*ItemTranslationQuery) ExistX

func (itq *ItemTranslationQuery) ExistX(ctx context.Context) bool

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

func (*ItemTranslationQuery) First

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

func (*ItemTranslationQuery) FirstID

func (itq *ItemTranslationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ItemTranslationQuery) FirstIDX

func (itq *ItemTranslationQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ItemTranslationQuery) FirstX

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

func (*ItemTranslationQuery) GroupBy

func (itq *ItemTranslationQuery) GroupBy(field string, fields ...string) *ItemTranslationGroupBy

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 {
	Locale itemtranslation.Locale `json:"locale,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ItemTranslation.Query().
	GroupBy(itemtranslation.FieldLocale).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ItemTranslationQuery) IDs

func (itq *ItemTranslationQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*ItemTranslationQuery) IDsX

func (itq *ItemTranslationQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ItemTranslationQuery) Limit

func (itq *ItemTranslationQuery) Limit(limit int) *ItemTranslationQuery

Limit adds a limit step to the query.

func (*ItemTranslationQuery) Offset

func (itq *ItemTranslationQuery) Offset(offset int) *ItemTranslationQuery

Offset adds an offset step to the query.

func (*ItemTranslationQuery) Only

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

func (*ItemTranslationQuery) OnlyID

func (itq *ItemTranslationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ItemTranslationQuery) OnlyIDX

func (itq *ItemTranslationQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ItemTranslationQuery) OnlyX

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

func (*ItemTranslationQuery) Order

Order adds an order step to the query.

func (*ItemTranslationQuery) QueryItem

func (itq *ItemTranslationQuery) QueryItem() *ItemQuery

QueryItem chains the current query on the "item" edge.

func (*ItemTranslationQuery) Select

func (itq *ItemTranslationQuery) Select(fields ...string) *ItemTranslationSelect

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 {
	Locale itemtranslation.Locale `json:"locale,omitempty"`
}

client.ItemTranslation.Query().
	Select(itemtranslation.FieldLocale).
	Scan(ctx, &v)

func (*ItemTranslationQuery) Unique

func (itq *ItemTranslationQuery) Unique(unique bool) *ItemTranslationQuery

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

Where adds a new predicate for the ItemTranslationQuery builder.

func (*ItemTranslationQuery) WithItem

func (itq *ItemTranslationQuery) WithItem(opts ...func(*ItemQuery)) *ItemTranslationQuery

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

type ItemTranslationSelect

type ItemTranslationSelect struct {
	*ItemTranslationQuery
	// contains filtered or unexported fields
}

ItemTranslationSelect is the builder for selecting fields of ItemTranslation entities.

func (*ItemTranslationSelect) Bool

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

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

func (*ItemTranslationSelect) BoolX

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

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

func (*ItemTranslationSelect) Bools

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

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

func (*ItemTranslationSelect) BoolsX

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

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

func (*ItemTranslationSelect) Float64

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

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

func (*ItemTranslationSelect) Float64X

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

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

func (*ItemTranslationSelect) Float64s

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

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

func (*ItemTranslationSelect) Float64sX

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

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

func (*ItemTranslationSelect) Int

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

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

func (*ItemTranslationSelect) IntX

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

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

func (*ItemTranslationSelect) Ints

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

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

func (*ItemTranslationSelect) IntsX

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

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

func (*ItemTranslationSelect) Scan

func (its *ItemTranslationSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ItemTranslationSelect) ScanX

func (s *ItemTranslationSelect) ScanX(ctx context.Context, v interface{})

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

func (*ItemTranslationSelect) String

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

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

func (*ItemTranslationSelect) StringX

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

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

func (*ItemTranslationSelect) Strings

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

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

func (*ItemTranslationSelect) StringsX

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

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

type ItemTranslationUpdate

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

ItemTranslationUpdate is the builder for updating ItemTranslation entities.

func (*ItemTranslationUpdate) ClearItem

func (itu *ItemTranslationUpdate) ClearItem() *ItemTranslationUpdate

ClearItem clears the "item" edge to the Item entity.

func (*ItemTranslationUpdate) Exec

func (itu *ItemTranslationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemTranslationUpdate) ExecX

func (itu *ItemTranslationUpdate) ExecX(ctx context.Context)

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

func (*ItemTranslationUpdate) Mutation

Mutation returns the ItemTranslationMutation object of the builder.

func (*ItemTranslationUpdate) Save

func (itu *ItemTranslationUpdate) Save(ctx context.Context) (int, error)

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

func (*ItemTranslationUpdate) SaveX

func (itu *ItemTranslationUpdate) SaveX(ctx context.Context) int

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

func (*ItemTranslationUpdate) SetContent

SetContent sets the "content" field.

func (*ItemTranslationUpdate) SetItem

SetItem sets the "item" edge to the Item entity.

func (*ItemTranslationUpdate) SetItemID

SetItemID sets the "item" edge to the Item entity by ID.

func (*ItemTranslationUpdate) SetNillableItemID

func (itu *ItemTranslationUpdate) SetNillableItemID(id *uuid.UUID) *ItemTranslationUpdate

SetNillableItemID sets the "item" edge to the Item entity by ID if the given value is not nil.

func (*ItemTranslationUpdate) Where

Where appends a list predicates to the ItemTranslationUpdate builder.

type ItemTranslationUpdateOne

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

ItemTranslationUpdateOne is the builder for updating a single ItemTranslation entity.

func (*ItemTranslationUpdateOne) ClearItem

ClearItem clears the "item" edge to the Item entity.

func (*ItemTranslationUpdateOne) Exec

Exec executes the query on the entity.

func (*ItemTranslationUpdateOne) ExecX

func (ituo *ItemTranslationUpdateOne) ExecX(ctx context.Context)

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

func (*ItemTranslationUpdateOne) Mutation

Mutation returns the ItemTranslationMutation object of the builder.

func (*ItemTranslationUpdateOne) Save

Save executes the query and returns the updated ItemTranslation entity.

func (*ItemTranslationUpdateOne) SaveX

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

func (*ItemTranslationUpdateOne) Select

func (ituo *ItemTranslationUpdateOne) Select(field string, fields ...string) *ItemTranslationUpdateOne

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

func (*ItemTranslationUpdateOne) SetContent

SetContent sets the "content" field.

func (*ItemTranslationUpdateOne) SetItem

SetItem sets the "item" edge to the Item entity.

func (*ItemTranslationUpdateOne) SetItemID

SetItemID sets the "item" edge to the Item entity by ID.

func (*ItemTranslationUpdateOne) SetNillableItemID

func (ituo *ItemTranslationUpdateOne) SetNillableItemID(id *uuid.UUID) *ItemTranslationUpdateOne

SetNillableItemID sets the "item" edge to the Item entity by ID if the given value is not nil.

type ItemTranslations

type ItemTranslations []*ItemTranslation

ItemTranslations is a parsable slice of ItemTranslation.

type ItemUpdate

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

ItemUpdate is the builder for updating Item entities.

func (*ItemUpdate) AddQuestion

func (iu *ItemUpdate) AddQuestion(q ...*Question) *ItemUpdate

AddQuestion adds the "question" edges to the Question entity.

func (*ItemUpdate) AddQuestionIDs

func (iu *ItemUpdate) AddQuestionIDs(ids ...uuid.UUID) *ItemUpdate

AddQuestionIDs adds the "question" edge to the Question entity by IDs.

func (*ItemUpdate) AddResponseIDs

func (iu *ItemUpdate) AddResponseIDs(ids ...uuid.UUID) *ItemUpdate

AddResponseIDs adds the "responses" edge to the Response entity by IDs.

func (*ItemUpdate) AddResponses

func (iu *ItemUpdate) AddResponses(r ...*Response) *ItemUpdate

AddResponses adds the "responses" edges to the Response entity.

func (*ItemUpdate) AddScale

func (iu *ItemUpdate) AddScale(s ...*Scale) *ItemUpdate

AddScale adds the "scale" edges to the Scale entity.

func (*ItemUpdate) AddScaleIDs

func (iu *ItemUpdate) AddScaleIDs(ids ...uuid.UUID) *ItemUpdate

AddScaleIDs adds the "scale" edge to the Scale entity by IDs.

func (*ItemUpdate) AddSteps

func (iu *ItemUpdate) AddSteps(i int) *ItemUpdate

AddSteps adds i to the "steps" field.

func (*ItemUpdate) AddTranslationIDs

func (iu *ItemUpdate) AddTranslationIDs(ids ...uuid.UUID) *ItemUpdate

AddTranslationIDs adds the "translations" edge to the ItemTranslation entity by IDs.

func (*ItemUpdate) AddTranslations

func (iu *ItemUpdate) AddTranslations(i ...*ItemTranslation) *ItemUpdate

AddTranslations adds the "translations" edges to the ItemTranslation entity.

func (*ItemUpdate) ClearQuestion

func (iu *ItemUpdate) ClearQuestion() *ItemUpdate

ClearQuestion clears all "question" edges to the Question entity.

func (*ItemUpdate) ClearResponses

func (iu *ItemUpdate) ClearResponses() *ItemUpdate

ClearResponses clears all "responses" edges to the Response entity.

func (*ItemUpdate) ClearScale

func (iu *ItemUpdate) ClearScale() *ItemUpdate

ClearScale clears all "scale" edges to the Scale entity.

func (*ItemUpdate) ClearTranslations

func (iu *ItemUpdate) ClearTranslations() *ItemUpdate

ClearTranslations clears all "translations" edges to the ItemTranslation entity.

func (*ItemUpdate) Exec

func (iu *ItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemUpdate) ExecX

func (iu *ItemUpdate) ExecX(ctx context.Context)

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

func (*ItemUpdate) Mutation

func (iu *ItemUpdate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdate) RemoveQuestion

func (iu *ItemUpdate) RemoveQuestion(q ...*Question) *ItemUpdate

RemoveQuestion removes "question" edges to Question entities.

func (*ItemUpdate) RemoveQuestionIDs

func (iu *ItemUpdate) RemoveQuestionIDs(ids ...uuid.UUID) *ItemUpdate

RemoveQuestionIDs removes the "question" edge to Question entities by IDs.

func (*ItemUpdate) RemoveResponseIDs

func (iu *ItemUpdate) RemoveResponseIDs(ids ...uuid.UUID) *ItemUpdate

RemoveResponseIDs removes the "responses" edge to Response entities by IDs.

func (*ItemUpdate) RemoveResponses

func (iu *ItemUpdate) RemoveResponses(r ...*Response) *ItemUpdate

RemoveResponses removes "responses" edges to Response entities.

func (*ItemUpdate) RemoveScale

func (iu *ItemUpdate) RemoveScale(s ...*Scale) *ItemUpdate

RemoveScale removes "scale" edges to Scale entities.

func (*ItemUpdate) RemoveScaleIDs

func (iu *ItemUpdate) RemoveScaleIDs(ids ...uuid.UUID) *ItemUpdate

RemoveScaleIDs removes the "scale" edge to Scale entities by IDs.

func (*ItemUpdate) RemoveTranslationIDs

func (iu *ItemUpdate) RemoveTranslationIDs(ids ...uuid.UUID) *ItemUpdate

RemoveTranslationIDs removes the "translations" edge to ItemTranslation entities by IDs.

func (*ItemUpdate) RemoveTranslations

func (iu *ItemUpdate) RemoveTranslations(i ...*ItemTranslation) *ItemUpdate

RemoveTranslations removes "translations" edges to ItemTranslation entities.

func (*ItemUpdate) Save

func (iu *ItemUpdate) Save(ctx context.Context) (int, error)

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

func (*ItemUpdate) SaveX

func (iu *ItemUpdate) SaveX(ctx context.Context) int

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

func (*ItemUpdate) SetNillableSteps

func (iu *ItemUpdate) SetNillableSteps(i *int) *ItemUpdate

SetNillableSteps sets the "steps" field if the given value is not nil.

func (*ItemUpdate) SetSteps

func (iu *ItemUpdate) SetSteps(i int) *ItemUpdate

SetSteps sets the "steps" field.

func (*ItemUpdate) SetUpdateTime

func (iu *ItemUpdate) SetUpdateTime(t time.Time) *ItemUpdate

SetUpdateTime sets the "update_time" field.

func (*ItemUpdate) Where

func (iu *ItemUpdate) Where(ps ...predicate.Item) *ItemUpdate

Where appends a list predicates to the ItemUpdate builder.

type ItemUpdateOne

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

ItemUpdateOne is the builder for updating a single Item entity.

func (*ItemUpdateOne) AddQuestion

func (iuo *ItemUpdateOne) AddQuestion(q ...*Question) *ItemUpdateOne

AddQuestion adds the "question" edges to the Question entity.

func (*ItemUpdateOne) AddQuestionIDs

func (iuo *ItemUpdateOne) AddQuestionIDs(ids ...uuid.UUID) *ItemUpdateOne

AddQuestionIDs adds the "question" edge to the Question entity by IDs.

func (*ItemUpdateOne) AddResponseIDs

func (iuo *ItemUpdateOne) AddResponseIDs(ids ...uuid.UUID) *ItemUpdateOne

AddResponseIDs adds the "responses" edge to the Response entity by IDs.

func (*ItemUpdateOne) AddResponses

func (iuo *ItemUpdateOne) AddResponses(r ...*Response) *ItemUpdateOne

AddResponses adds the "responses" edges to the Response entity.

func (*ItemUpdateOne) AddScale

func (iuo *ItemUpdateOne) AddScale(s ...*Scale) *ItemUpdateOne

AddScale adds the "scale" edges to the Scale entity.

func (*ItemUpdateOne) AddScaleIDs

func (iuo *ItemUpdateOne) AddScaleIDs(ids ...uuid.UUID) *ItemUpdateOne

AddScaleIDs adds the "scale" edge to the Scale entity by IDs.

func (*ItemUpdateOne) AddSteps

func (iuo *ItemUpdateOne) AddSteps(i int) *ItemUpdateOne

AddSteps adds i to the "steps" field.

func (*ItemUpdateOne) AddTranslationIDs

func (iuo *ItemUpdateOne) AddTranslationIDs(ids ...uuid.UUID) *ItemUpdateOne

AddTranslationIDs adds the "translations" edge to the ItemTranslation entity by IDs.

func (*ItemUpdateOne) AddTranslations

func (iuo *ItemUpdateOne) AddTranslations(i ...*ItemTranslation) *ItemUpdateOne

AddTranslations adds the "translations" edges to the ItemTranslation entity.

func (*ItemUpdateOne) ClearQuestion

func (iuo *ItemUpdateOne) ClearQuestion() *ItemUpdateOne

ClearQuestion clears all "question" edges to the Question entity.

func (*ItemUpdateOne) ClearResponses

func (iuo *ItemUpdateOne) ClearResponses() *ItemUpdateOne

ClearResponses clears all "responses" edges to the Response entity.

func (*ItemUpdateOne) ClearScale

func (iuo *ItemUpdateOne) ClearScale() *ItemUpdateOne

ClearScale clears all "scale" edges to the Scale entity.

func (*ItemUpdateOne) ClearTranslations

func (iuo *ItemUpdateOne) ClearTranslations() *ItemUpdateOne

ClearTranslations clears all "translations" edges to the ItemTranslation entity.

func (*ItemUpdateOne) Exec

func (iuo *ItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ItemUpdateOne) ExecX

func (iuo *ItemUpdateOne) ExecX(ctx context.Context)

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

func (*ItemUpdateOne) Mutation

func (iuo *ItemUpdateOne) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdateOne) RemoveQuestion

func (iuo *ItemUpdateOne) RemoveQuestion(q ...*Question) *ItemUpdateOne

RemoveQuestion removes "question" edges to Question entities.

func (*ItemUpdateOne) RemoveQuestionIDs

func (iuo *ItemUpdateOne) RemoveQuestionIDs(ids ...uuid.UUID) *ItemUpdateOne

RemoveQuestionIDs removes the "question" edge to Question entities by IDs.

func (*ItemUpdateOne) RemoveResponseIDs

func (iuo *ItemUpdateOne) RemoveResponseIDs(ids ...uuid.UUID) *ItemUpdateOne

RemoveResponseIDs removes the "responses" edge to Response entities by IDs.

func (*ItemUpdateOne) RemoveResponses

func (iuo *ItemUpdateOne) RemoveResponses(r ...*Response) *ItemUpdateOne

RemoveResponses removes "responses" edges to Response entities.

func (*ItemUpdateOne) RemoveScale

func (iuo *ItemUpdateOne) RemoveScale(s ...*Scale) *ItemUpdateOne

RemoveScale removes "scale" edges to Scale entities.

func (*ItemUpdateOne) RemoveScaleIDs

func (iuo *ItemUpdateOne) RemoveScaleIDs(ids ...uuid.UUID) *ItemUpdateOne

RemoveScaleIDs removes the "scale" edge to Scale entities by IDs.

func (*ItemUpdateOne) RemoveTranslationIDs

func (iuo *ItemUpdateOne) RemoveTranslationIDs(ids ...uuid.UUID) *ItemUpdateOne

RemoveTranslationIDs removes the "translations" edge to ItemTranslation entities by IDs.

func (*ItemUpdateOne) RemoveTranslations

func (iuo *ItemUpdateOne) RemoveTranslations(i ...*ItemTranslation) *ItemUpdateOne

RemoveTranslations removes "translations" edges to ItemTranslation entities.

func (*ItemUpdateOne) Save

func (iuo *ItemUpdateOne) Save(ctx context.Context) (*Item, error)

Save executes the query and returns the updated Item entity.

func (*ItemUpdateOne) SaveX

func (iuo *ItemUpdateOne) SaveX(ctx context.Context) *Item

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

func (*ItemUpdateOne) Select

func (iuo *ItemUpdateOne) Select(field string, fields ...string) *ItemUpdateOne

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

func (*ItemUpdateOne) SetNillableSteps

func (iuo *ItemUpdateOne) SetNillableSteps(i *int) *ItemUpdateOne

SetNillableSteps sets the "steps" field if the given value is not nil.

func (*ItemUpdateOne) SetSteps

func (iuo *ItemUpdateOne) SetSteps(i int) *ItemUpdateOne

SetSteps sets the "steps" field.

func (*ItemUpdateOne) SetUpdateTime

func (iuo *ItemUpdateOne) SetUpdateTime(t time.Time) *ItemUpdateOne

SetUpdateTime sets the "update_time" field.

type Items

type Items []*Item

Items is a parsable slice of Item.

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 Norm

type Norm struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Base holds the value of the "base" field.
	Base int `json:"base,omitempty"`
	// Mean holds the value of the "mean" field.
	Mean float64 `json:"mean,omitempty"`
	// Sigma holds the value of the "sigma" field.
	Sigma float64 `json:"sigma,omitempty"`
	// Rank holds the value of the "rank" field.
	Rank int `json:"rank,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NormQuery when eager-loading is set.
	Edges NormEdges `json:"edges"`
	// contains filtered or unexported fields
}

Norm is the model entity for the Norm schema.

func (*Norm) QuerySample

func (n *Norm) QuerySample() *SampleQuery

QuerySample queries the "sample" edge of the Norm entity.

func (*Norm) QueryScale

func (n *Norm) QueryScale() *ScaleQuery

QueryScale queries the "scale" edge of the Norm entity.

func (*Norm) String

func (n *Norm) String() string

String implements the fmt.Stringer.

func (*Norm) Unwrap

func (n *Norm) Unwrap() *Norm

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

func (n *Norm) Update() *NormUpdateOne

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

type NormClient

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

NormClient is a client for the Norm schema.

func NewNormClient

func NewNormClient(c config) *NormClient

NewNormClient returns a client for the Norm from the given config.

func (*NormClient) Create

func (c *NormClient) Create() *NormCreate

Create returns a builder for creating a Norm entity.

func (*NormClient) CreateBulk

func (c *NormClient) CreateBulk(builders ...*NormCreate) *NormCreateBulk

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

func (*NormClient) Delete

func (c *NormClient) Delete() *NormDelete

Delete returns a delete builder for Norm.

func (*NormClient) DeleteOne

func (c *NormClient) DeleteOne(n *Norm) *NormDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NormClient) DeleteOneID

func (c *NormClient) DeleteOneID(id uuid.UUID) *NormDeleteOne

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

func (*NormClient) Get

func (c *NormClient) Get(ctx context.Context, id uuid.UUID) (*Norm, error)

Get returns a Norm entity by its id.

func (*NormClient) GetX

func (c *NormClient) GetX(ctx context.Context, id uuid.UUID) *Norm

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

func (*NormClient) Hooks

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

Hooks returns the client hooks.

func (*NormClient) Query

func (c *NormClient) Query() *NormQuery

Query returns a query builder for Norm.

func (*NormClient) QuerySample

func (c *NormClient) QuerySample(n *Norm) *SampleQuery

QuerySample queries the sample edge of a Norm.

func (*NormClient) QueryScale

func (c *NormClient) QueryScale(n *Norm) *ScaleQuery

QueryScale queries the scale edge of a Norm.

func (*NormClient) Update

func (c *NormClient) Update() *NormUpdate

Update returns an update builder for Norm.

func (*NormClient) UpdateOne

func (c *NormClient) UpdateOne(n *Norm) *NormUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NormClient) UpdateOneID

func (c *NormClient) UpdateOneID(id uuid.UUID) *NormUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NormClient) Use

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

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

type NormCreate

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

NormCreate is the builder for creating a Norm entity.

func (*NormCreate) Exec

func (nc *NormCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NormCreate) ExecX

func (nc *NormCreate) ExecX(ctx context.Context)

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

func (*NormCreate) Mutation

func (nc *NormCreate) Mutation() *NormMutation

Mutation returns the NormMutation object of the builder.

func (*NormCreate) Save

func (nc *NormCreate) Save(ctx context.Context) (*Norm, error)

Save creates the Norm in the database.

func (*NormCreate) SaveX

func (nc *NormCreate) SaveX(ctx context.Context) *Norm

SaveX calls Save and panics if Save returns an error.

func (*NormCreate) SetBase

func (nc *NormCreate) SetBase(i int) *NormCreate

SetBase sets the "base" field.

func (*NormCreate) SetCreateTime

func (nc *NormCreate) SetCreateTime(t time.Time) *NormCreate

SetCreateTime sets the "create_time" field.

func (*NormCreate) SetID

func (nc *NormCreate) SetID(u uuid.UUID) *NormCreate

SetID sets the "id" field.

func (*NormCreate) SetMean

func (nc *NormCreate) SetMean(f float64) *NormCreate

SetMean sets the "mean" field.

func (*NormCreate) SetMeta

func (nc *NormCreate) SetMeta(m map[string]interface{}) *NormCreate

SetMeta sets the "meta" field.

func (*NormCreate) SetName

func (nc *NormCreate) SetName(s string) *NormCreate

SetName sets the "name" field.

func (*NormCreate) SetNillableBase

func (nc *NormCreate) SetNillableBase(i *int) *NormCreate

SetNillableBase sets the "base" field if the given value is not nil.

func (*NormCreate) SetNillableCreateTime

func (nc *NormCreate) SetNillableCreateTime(t *time.Time) *NormCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*NormCreate) SetNillableID

func (nc *NormCreate) SetNillableID(u *uuid.UUID) *NormCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*NormCreate) SetNillableRank

func (nc *NormCreate) SetNillableRank(i *int) *NormCreate

SetNillableRank sets the "rank" field if the given value is not nil.

func (*NormCreate) SetNillableUpdateTime

func (nc *NormCreate) SetNillableUpdateTime(t *time.Time) *NormCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*NormCreate) SetRank

func (nc *NormCreate) SetRank(i int) *NormCreate

SetRank sets the "rank" field.

func (*NormCreate) SetSample

func (nc *NormCreate) SetSample(s *Sample) *NormCreate

SetSample sets the "sample" edge to the Sample entity.

func (*NormCreate) SetSampleID

func (nc *NormCreate) SetSampleID(id uuid.UUID) *NormCreate

SetSampleID sets the "sample" edge to the Sample entity by ID.

func (*NormCreate) SetScale

func (nc *NormCreate) SetScale(s *Scale) *NormCreate

SetScale sets the "scale" edge to the Scale entity.

func (*NormCreate) SetScaleID

func (nc *NormCreate) SetScaleID(id uuid.UUID) *NormCreate

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*NormCreate) SetSigma

func (nc *NormCreate) SetSigma(f float64) *NormCreate

SetSigma sets the "sigma" field.

func (*NormCreate) SetUpdateTime

func (nc *NormCreate) SetUpdateTime(t time.Time) *NormCreate

SetUpdateTime sets the "update_time" field.

type NormCreateBulk

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

NormCreateBulk is the builder for creating many Norm entities in bulk.

func (*NormCreateBulk) Exec

func (ncb *NormCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NormCreateBulk) ExecX

func (ncb *NormCreateBulk) ExecX(ctx context.Context)

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

func (*NormCreateBulk) Save

func (ncb *NormCreateBulk) Save(ctx context.Context) ([]*Norm, error)

Save creates the Norm entities in the database.

func (*NormCreateBulk) SaveX

func (ncb *NormCreateBulk) SaveX(ctx context.Context) []*Norm

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

type NormDelete

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

NormDelete is the builder for deleting a Norm entity.

func (*NormDelete) Exec

func (nd *NormDelete) Exec(ctx context.Context) (int, error)

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

func (*NormDelete) ExecX

func (nd *NormDelete) ExecX(ctx context.Context) int

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

func (*NormDelete) Where

func (nd *NormDelete) Where(ps ...predicate.Norm) *NormDelete

Where appends a list predicates to the NormDelete builder.

type NormDeleteOne

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

NormDeleteOne is the builder for deleting a single Norm entity.

func (*NormDeleteOne) Exec

func (ndo *NormDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NormDeleteOne) ExecX

func (ndo *NormDeleteOne) ExecX(ctx context.Context)

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

type NormEdges

type NormEdges struct {
	// Sample holds the value of the sample edge.
	Sample *Sample `json:"sample,omitempty"`
	// Scale holds the value of the scale edge.
	Scale *Scale `json:"scale,omitempty"`
	// contains filtered or unexported fields
}

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

func (NormEdges) SampleOrErr

func (e NormEdges) SampleOrErr() (*Sample, error)

SampleOrErr returns the Sample value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NormEdges) ScaleOrErr

func (e NormEdges) ScaleOrErr() (*Scale, error)

ScaleOrErr returns the Scale value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type NormGroupBy

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

NormGroupBy is the group-by builder for Norm entities.

func (*NormGroupBy) Aggregate

func (ngb *NormGroupBy) Aggregate(fns ...AggregateFunc) *NormGroupBy

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

func (*NormGroupBy) Bool

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

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

func (*NormGroupBy) BoolX

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

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

func (*NormGroupBy) Bools

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

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

func (*NormGroupBy) BoolsX

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

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

func (*NormGroupBy) Float64

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

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

func (*NormGroupBy) Float64X

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

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

func (*NormGroupBy) Float64s

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

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

func (*NormGroupBy) Float64sX

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

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

func (*NormGroupBy) Int

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

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

func (*NormGroupBy) IntX

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

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

func (*NormGroupBy) Ints

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

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

func (*NormGroupBy) IntsX

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

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

func (*NormGroupBy) Scan

func (ngb *NormGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*NormGroupBy) ScanX

func (s *NormGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*NormGroupBy) String

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

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

func (*NormGroupBy) StringX

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

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

func (*NormGroupBy) Strings

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

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

func (*NormGroupBy) StringsX

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

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

type NormMutation

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

NormMutation represents an operation that mutates the Norm nodes in the graph.

func (*NormMutation) AddBase

func (m *NormMutation) AddBase(i int)

AddBase adds i to the "base" field.

func (*NormMutation) AddField

func (m *NormMutation) 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 (*NormMutation) AddMean

func (m *NormMutation) AddMean(f float64)

AddMean adds f to the "mean" field.

func (*NormMutation) AddRank

func (m *NormMutation) AddRank(i int)

AddRank adds i to the "rank" field.

func (*NormMutation) AddSigma

func (m *NormMutation) AddSigma(f float64)

AddSigma adds f to the "sigma" field.

func (*NormMutation) AddedBase

func (m *NormMutation) AddedBase() (r int, exists bool)

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

func (*NormMutation) AddedEdges

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

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

func (*NormMutation) AddedField

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

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

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

func (*NormMutation) AddedIDs

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

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

func (*NormMutation) AddedMean

func (m *NormMutation) AddedMean() (r float64, exists bool)

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

func (*NormMutation) AddedRank

func (m *NormMutation) AddedRank() (r int, exists bool)

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

func (*NormMutation) AddedSigma

func (m *NormMutation) AddedSigma() (r float64, exists bool)

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

func (*NormMutation) Base

func (m *NormMutation) Base() (r int, exists bool)

Base returns the value of the "base" field in the mutation.

func (*NormMutation) ClearEdge

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

func (m *NormMutation) 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 (*NormMutation) ClearMeta

func (m *NormMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*NormMutation) ClearSample

func (m *NormMutation) ClearSample()

ClearSample clears the "sample" edge to the Sample entity.

func (*NormMutation) ClearScale

func (m *NormMutation) ClearScale()

ClearScale clears the "scale" edge to the Scale entity.

func (*NormMutation) ClearedEdges

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

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

func (*NormMutation) ClearedFields

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

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

func (NormMutation) Client

func (m NormMutation) 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 (*NormMutation) CreateTime

func (m *NormMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*NormMutation) EdgeCleared

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

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

func (*NormMutation) Field

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

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

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

func (*NormMutation) Fields

func (m *NormMutation) 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 (*NormMutation) ID

func (m *NormMutation) ID() (id uuid.UUID, 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 (*NormMutation) IDs

func (m *NormMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*NormMutation) Mean

func (m *NormMutation) Mean() (r float64, exists bool)

Mean returns the value of the "mean" field in the mutation.

func (*NormMutation) Meta

func (m *NormMutation) Meta() (r map[string]interface{}, exists bool)

Meta returns the value of the "meta" field in the mutation.

func (*NormMutation) MetaCleared

func (m *NormMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*NormMutation) Name

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

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

func (*NormMutation) OldBase

func (m *NormMutation) OldBase(ctx context.Context) (v int, err error)

OldBase returns the old "base" field's value of the Norm entity. If the Norm 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 (*NormMutation) OldCreateTime

func (m *NormMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Norm entity. If the Norm 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 (*NormMutation) OldField

func (m *NormMutation) 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 (*NormMutation) OldMean

func (m *NormMutation) OldMean(ctx context.Context) (v float64, err error)

OldMean returns the old "mean" field's value of the Norm entity. If the Norm 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 (*NormMutation) OldMeta

func (m *NormMutation) OldMeta(ctx context.Context) (v map[string]interface{}, err error)

OldMeta returns the old "meta" field's value of the Norm entity. If the Norm 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 (*NormMutation) OldName

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

OldName returns the old "name" field's value of the Norm entity. If the Norm 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 (*NormMutation) OldRank

func (m *NormMutation) OldRank(ctx context.Context) (v int, err error)

OldRank returns the old "rank" field's value of the Norm entity. If the Norm 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 (*NormMutation) OldSigma

func (m *NormMutation) OldSigma(ctx context.Context) (v float64, err error)

OldSigma returns the old "sigma" field's value of the Norm entity. If the Norm 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 (*NormMutation) OldUpdateTime

func (m *NormMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Norm entity. If the Norm 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 (*NormMutation) Op

func (m *NormMutation) Op() Op

Op returns the operation name.

func (*NormMutation) Rank

func (m *NormMutation) Rank() (r int, exists bool)

Rank returns the value of the "rank" field in the mutation.

func (*NormMutation) RemovedEdges

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

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

func (*NormMutation) RemovedIDs

func (m *NormMutation) 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 (*NormMutation) ResetBase

func (m *NormMutation) ResetBase()

ResetBase resets all changes to the "base" field.

func (*NormMutation) ResetCreateTime

func (m *NormMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*NormMutation) ResetEdge

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

func (m *NormMutation) 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 (*NormMutation) ResetMean

func (m *NormMutation) ResetMean()

ResetMean resets all changes to the "mean" field.

func (*NormMutation) ResetMeta

func (m *NormMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*NormMutation) ResetName

func (m *NormMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*NormMutation) ResetRank

func (m *NormMutation) ResetRank()

ResetRank resets all changes to the "rank" field.

func (*NormMutation) ResetSample

func (m *NormMutation) ResetSample()

ResetSample resets all changes to the "sample" edge.

func (*NormMutation) ResetScale

func (m *NormMutation) ResetScale()

ResetScale resets all changes to the "scale" edge.

func (*NormMutation) ResetSigma

func (m *NormMutation) ResetSigma()

ResetSigma resets all changes to the "sigma" field.

func (*NormMutation) ResetUpdateTime

func (m *NormMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*NormMutation) SampleCleared

func (m *NormMutation) SampleCleared() bool

SampleCleared reports if the "sample" edge to the Sample entity was cleared.

func (*NormMutation) SampleID

func (m *NormMutation) SampleID() (id uuid.UUID, exists bool)

SampleID returns the "sample" edge ID in the mutation.

func (*NormMutation) SampleIDs

func (m *NormMutation) SampleIDs() (ids []uuid.UUID)

SampleIDs returns the "sample" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SampleID instead. It exists only for internal usage by the builders.

func (*NormMutation) ScaleCleared

func (m *NormMutation) ScaleCleared() bool

ScaleCleared reports if the "scale" edge to the Scale entity was cleared.

func (*NormMutation) ScaleID

func (m *NormMutation) ScaleID() (id uuid.UUID, exists bool)

ScaleID returns the "scale" edge ID in the mutation.

func (*NormMutation) ScaleIDs

func (m *NormMutation) ScaleIDs() (ids []uuid.UUID)

ScaleIDs returns the "scale" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ScaleID instead. It exists only for internal usage by the builders.

func (*NormMutation) SetBase

func (m *NormMutation) SetBase(i int)

SetBase sets the "base" field.

func (*NormMutation) SetCreateTime

func (m *NormMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*NormMutation) SetField

func (m *NormMutation) 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 (*NormMutation) SetID

func (m *NormMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Norm entities.

func (*NormMutation) SetMean

func (m *NormMutation) SetMean(f float64)

SetMean sets the "mean" field.

func (*NormMutation) SetMeta

func (m *NormMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*NormMutation) SetName

func (m *NormMutation) SetName(s string)

SetName sets the "name" field.

func (*NormMutation) SetRank

func (m *NormMutation) SetRank(i int)

SetRank sets the "rank" field.

func (*NormMutation) SetSampleID

func (m *NormMutation) SetSampleID(id uuid.UUID)

SetSampleID sets the "sample" edge to the Sample entity by id.

func (*NormMutation) SetScaleID

func (m *NormMutation) SetScaleID(id uuid.UUID)

SetScaleID sets the "scale" edge to the Scale entity by id.

func (*NormMutation) SetSigma

func (m *NormMutation) SetSigma(f float64)

SetSigma sets the "sigma" field.

func (*NormMutation) SetUpdateTime

func (m *NormMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*NormMutation) Sigma

func (m *NormMutation) Sigma() (r float64, exists bool)

Sigma returns the value of the "sigma" field in the mutation.

func (NormMutation) Tx

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

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

func (*NormMutation) Type

func (m *NormMutation) Type() string

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

func (*NormMutation) UpdateTime

func (m *NormMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*NormMutation) Where

func (m *NormMutation) Where(ps ...predicate.Norm)

Where appends a list predicates to the NormMutation builder.

type NormQuery

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

NormQuery is the builder for querying Norm entities.

func (*NormQuery) All

func (nq *NormQuery) All(ctx context.Context) ([]*Norm, error)

All executes the query and returns a list of Norms.

func (*NormQuery) AllX

func (nq *NormQuery) AllX(ctx context.Context) []*Norm

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

func (*NormQuery) Clone

func (nq *NormQuery) Clone() *NormQuery

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

func (*NormQuery) Count

func (nq *NormQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NormQuery) CountX

func (nq *NormQuery) CountX(ctx context.Context) int

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

func (*NormQuery) Exist

func (nq *NormQuery) Exist(ctx context.Context) (bool, error)

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

func (*NormQuery) ExistX

func (nq *NormQuery) ExistX(ctx context.Context) bool

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

func (*NormQuery) First

func (nq *NormQuery) First(ctx context.Context) (*Norm, error)

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

func (*NormQuery) FirstID

func (nq *NormQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*NormQuery) FirstIDX

func (nq *NormQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*NormQuery) FirstX

func (nq *NormQuery) FirstX(ctx context.Context) *Norm

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

func (*NormQuery) GroupBy

func (nq *NormQuery) GroupBy(field string, fields ...string) *NormGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Norm.Query().
	GroupBy(norm.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NormQuery) IDs

func (nq *NormQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*NormQuery) IDsX

func (nq *NormQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*NormQuery) Limit

func (nq *NormQuery) Limit(limit int) *NormQuery

Limit adds a limit step to the query.

func (*NormQuery) Offset

func (nq *NormQuery) Offset(offset int) *NormQuery

Offset adds an offset step to the query.

func (*NormQuery) Only

func (nq *NormQuery) Only(ctx context.Context) (*Norm, error)

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

func (*NormQuery) OnlyID

func (nq *NormQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*NormQuery) OnlyIDX

func (nq *NormQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*NormQuery) OnlyX

func (nq *NormQuery) OnlyX(ctx context.Context) *Norm

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

func (*NormQuery) Order

func (nq *NormQuery) Order(o ...OrderFunc) *NormQuery

Order adds an order step to the query.

func (*NormQuery) QuerySample

func (nq *NormQuery) QuerySample() *SampleQuery

QuerySample chains the current query on the "sample" edge.

func (*NormQuery) QueryScale

func (nq *NormQuery) QueryScale() *ScaleQuery

QueryScale chains the current query on the "scale" edge.

func (*NormQuery) Select

func (nq *NormQuery) Select(fields ...string) *NormSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Norm.Query().
	Select(norm.FieldCreateTime).
	Scan(ctx, &v)

func (*NormQuery) Unique

func (nq *NormQuery) Unique(unique bool) *NormQuery

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

func (nq *NormQuery) Where(ps ...predicate.Norm) *NormQuery

Where adds a new predicate for the NormQuery builder.

func (*NormQuery) WithSample

func (nq *NormQuery) WithSample(opts ...func(*SampleQuery)) *NormQuery

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

func (*NormQuery) WithScale

func (nq *NormQuery) WithScale(opts ...func(*ScaleQuery)) *NormQuery

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

type NormSelect

type NormSelect struct {
	*NormQuery
	// contains filtered or unexported fields
}

NormSelect is the builder for selecting fields of Norm entities.

func (*NormSelect) Bool

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

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

func (*NormSelect) BoolX

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

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

func (*NormSelect) Bools

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

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

func (*NormSelect) BoolsX

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

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

func (*NormSelect) Float64

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

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

func (*NormSelect) Float64X

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

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

func (*NormSelect) Float64s

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

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

func (*NormSelect) Float64sX

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

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

func (*NormSelect) Int

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

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

func (*NormSelect) IntX

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

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

func (*NormSelect) Ints

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

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

func (*NormSelect) IntsX

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

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

func (*NormSelect) Scan

func (ns *NormSelect) Scan(ctx context.Context, v interface{}) error

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

func (*NormSelect) ScanX

func (s *NormSelect) ScanX(ctx context.Context, v interface{})

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

func (*NormSelect) String

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

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

func (*NormSelect) StringX

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

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

func (*NormSelect) Strings

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

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

func (*NormSelect) StringsX

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

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

type NormUpdate

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

NormUpdate is the builder for updating Norm entities.

func (*NormUpdate) AddBase

func (nu *NormUpdate) AddBase(i int) *NormUpdate

AddBase adds i to the "base" field.

func (*NormUpdate) AddMean

func (nu *NormUpdate) AddMean(f float64) *NormUpdate

AddMean adds f to the "mean" field.

func (*NormUpdate) AddRank

func (nu *NormUpdate) AddRank(i int) *NormUpdate

AddRank adds i to the "rank" field.

func (*NormUpdate) AddSigma

func (nu *NormUpdate) AddSigma(f float64) *NormUpdate

AddSigma adds f to the "sigma" field.

func (*NormUpdate) ClearMeta

func (nu *NormUpdate) ClearMeta() *NormUpdate

ClearMeta clears the value of the "meta" field.

func (*NormUpdate) ClearSample

func (nu *NormUpdate) ClearSample() *NormUpdate

ClearSample clears the "sample" edge to the Sample entity.

func (*NormUpdate) ClearScale

func (nu *NormUpdate) ClearScale() *NormUpdate

ClearScale clears the "scale" edge to the Scale entity.

func (*NormUpdate) Exec

func (nu *NormUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NormUpdate) ExecX

func (nu *NormUpdate) ExecX(ctx context.Context)

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

func (*NormUpdate) Mutation

func (nu *NormUpdate) Mutation() *NormMutation

Mutation returns the NormMutation object of the builder.

func (*NormUpdate) Save

func (nu *NormUpdate) Save(ctx context.Context) (int, error)

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

func (*NormUpdate) SaveX

func (nu *NormUpdate) SaveX(ctx context.Context) int

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

func (*NormUpdate) SetBase

func (nu *NormUpdate) SetBase(i int) *NormUpdate

SetBase sets the "base" field.

func (*NormUpdate) SetMean

func (nu *NormUpdate) SetMean(f float64) *NormUpdate

SetMean sets the "mean" field.

func (*NormUpdate) SetMeta

func (nu *NormUpdate) SetMeta(m map[string]interface{}) *NormUpdate

SetMeta sets the "meta" field.

func (*NormUpdate) SetName

func (nu *NormUpdate) SetName(s string) *NormUpdate

SetName sets the "name" field.

func (*NormUpdate) SetNillableBase

func (nu *NormUpdate) SetNillableBase(i *int) *NormUpdate

SetNillableBase sets the "base" field if the given value is not nil.

func (*NormUpdate) SetNillableRank

func (nu *NormUpdate) SetNillableRank(i *int) *NormUpdate

SetNillableRank sets the "rank" field if the given value is not nil.

func (*NormUpdate) SetRank

func (nu *NormUpdate) SetRank(i int) *NormUpdate

SetRank sets the "rank" field.

func (*NormUpdate) SetSample

func (nu *NormUpdate) SetSample(s *Sample) *NormUpdate

SetSample sets the "sample" edge to the Sample entity.

func (*NormUpdate) SetSampleID

func (nu *NormUpdate) SetSampleID(id uuid.UUID) *NormUpdate

SetSampleID sets the "sample" edge to the Sample entity by ID.

func (*NormUpdate) SetScale

func (nu *NormUpdate) SetScale(s *Scale) *NormUpdate

SetScale sets the "scale" edge to the Scale entity.

func (*NormUpdate) SetScaleID

func (nu *NormUpdate) SetScaleID(id uuid.UUID) *NormUpdate

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*NormUpdate) SetSigma

func (nu *NormUpdate) SetSigma(f float64) *NormUpdate

SetSigma sets the "sigma" field.

func (*NormUpdate) SetUpdateTime

func (nu *NormUpdate) SetUpdateTime(t time.Time) *NormUpdate

SetUpdateTime sets the "update_time" field.

func (*NormUpdate) Where

func (nu *NormUpdate) Where(ps ...predicate.Norm) *NormUpdate

Where appends a list predicates to the NormUpdate builder.

type NormUpdateOne

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

NormUpdateOne is the builder for updating a single Norm entity.

func (*NormUpdateOne) AddBase

func (nuo *NormUpdateOne) AddBase(i int) *NormUpdateOne

AddBase adds i to the "base" field.

func (*NormUpdateOne) AddMean

func (nuo *NormUpdateOne) AddMean(f float64) *NormUpdateOne

AddMean adds f to the "mean" field.

func (*NormUpdateOne) AddRank

func (nuo *NormUpdateOne) AddRank(i int) *NormUpdateOne

AddRank adds i to the "rank" field.

func (*NormUpdateOne) AddSigma

func (nuo *NormUpdateOne) AddSigma(f float64) *NormUpdateOne

AddSigma adds f to the "sigma" field.

func (*NormUpdateOne) ClearMeta

func (nuo *NormUpdateOne) ClearMeta() *NormUpdateOne

ClearMeta clears the value of the "meta" field.

func (*NormUpdateOne) ClearSample

func (nuo *NormUpdateOne) ClearSample() *NormUpdateOne

ClearSample clears the "sample" edge to the Sample entity.

func (*NormUpdateOne) ClearScale

func (nuo *NormUpdateOne) ClearScale() *NormUpdateOne

ClearScale clears the "scale" edge to the Scale entity.

func (*NormUpdateOne) Exec

func (nuo *NormUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NormUpdateOne) ExecX

func (nuo *NormUpdateOne) ExecX(ctx context.Context)

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

func (*NormUpdateOne) Mutation

func (nuo *NormUpdateOne) Mutation() *NormMutation

Mutation returns the NormMutation object of the builder.

func (*NormUpdateOne) Save

func (nuo *NormUpdateOne) Save(ctx context.Context) (*Norm, error)

Save executes the query and returns the updated Norm entity.

func (*NormUpdateOne) SaveX

func (nuo *NormUpdateOne) SaveX(ctx context.Context) *Norm

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

func (*NormUpdateOne) Select

func (nuo *NormUpdateOne) Select(field string, fields ...string) *NormUpdateOne

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

func (*NormUpdateOne) SetBase

func (nuo *NormUpdateOne) SetBase(i int) *NormUpdateOne

SetBase sets the "base" field.

func (*NormUpdateOne) SetMean

func (nuo *NormUpdateOne) SetMean(f float64) *NormUpdateOne

SetMean sets the "mean" field.

func (*NormUpdateOne) SetMeta

func (nuo *NormUpdateOne) SetMeta(m map[string]interface{}) *NormUpdateOne

SetMeta sets the "meta" field.

func (*NormUpdateOne) SetName

func (nuo *NormUpdateOne) SetName(s string) *NormUpdateOne

SetName sets the "name" field.

func (*NormUpdateOne) SetNillableBase

func (nuo *NormUpdateOne) SetNillableBase(i *int) *NormUpdateOne

SetNillableBase sets the "base" field if the given value is not nil.

func (*NormUpdateOne) SetNillableRank

func (nuo *NormUpdateOne) SetNillableRank(i *int) *NormUpdateOne

SetNillableRank sets the "rank" field if the given value is not nil.

func (*NormUpdateOne) SetRank

func (nuo *NormUpdateOne) SetRank(i int) *NormUpdateOne

SetRank sets the "rank" field.

func (*NormUpdateOne) SetSample

func (nuo *NormUpdateOne) SetSample(s *Sample) *NormUpdateOne

SetSample sets the "sample" edge to the Sample entity.

func (*NormUpdateOne) SetSampleID

func (nuo *NormUpdateOne) SetSampleID(id uuid.UUID) *NormUpdateOne

SetSampleID sets the "sample" edge to the Sample entity by ID.

func (*NormUpdateOne) SetScale

func (nuo *NormUpdateOne) SetScale(s *Scale) *NormUpdateOne

SetScale sets the "scale" edge to the Scale entity.

func (*NormUpdateOne) SetScaleID

func (nuo *NormUpdateOne) SetScaleID(id uuid.UUID) *NormUpdateOne

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*NormUpdateOne) SetSigma

func (nuo *NormUpdateOne) SetSigma(f float64) *NormUpdateOne

SetSigma sets the "sigma" field.

func (*NormUpdateOne) SetUpdateTime

func (nuo *NormUpdateOne) SetUpdateTime(t time.Time) *NormUpdateOne

SetUpdateTime sets the "update_time" field.

type Norms

type Norms []*Norm

Norms is a parsable slice of Norm.

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(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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 Question

type Question struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Order holds the value of the "order" field.
	Order int `json:"order,omitempty"`
	// Code holds the value of the "code" field.
	Code string `json:"code,omitempty"`
	// Type holds the value of the "type" field.
	Type question.Type `json:"type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the QuestionQuery when eager-loading is set.
	Edges QuestionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Question is the model entity for the Question schema.

func (*Question) QueryItems

func (q *Question) QueryItems() *ItemQuery

QueryItems queries the "items" edge of the Question entity.

func (*Question) QueryTest

func (q *Question) QueryTest() *TestQuery

QueryTest queries the "test" edge of the Question entity.

func (*Question) QueryTranslations

func (q *Question) QueryTranslations() *QuestionTranslationQuery

QueryTranslations queries the "translations" edge of the Question entity.

func (*Question) String

func (q *Question) String() string

String implements the fmt.Stringer.

func (*Question) Unwrap

func (q *Question) Unwrap() *Question

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

func (q *Question) Update() *QuestionUpdateOne

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

type QuestionClient

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

QuestionClient is a client for the Question schema.

func NewQuestionClient

func NewQuestionClient(c config) *QuestionClient

NewQuestionClient returns a client for the Question from the given config.

func (*QuestionClient) Create

func (c *QuestionClient) Create() *QuestionCreate

Create returns a builder for creating a Question entity.

func (*QuestionClient) CreateBulk

func (c *QuestionClient) CreateBulk(builders ...*QuestionCreate) *QuestionCreateBulk

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

func (*QuestionClient) Delete

func (c *QuestionClient) Delete() *QuestionDelete

Delete returns a delete builder for Question.

func (*QuestionClient) DeleteOne

func (c *QuestionClient) DeleteOne(q *Question) *QuestionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*QuestionClient) DeleteOneID

func (c *QuestionClient) DeleteOneID(id uuid.UUID) *QuestionDeleteOne

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

func (*QuestionClient) Get

func (c *QuestionClient) Get(ctx context.Context, id uuid.UUID) (*Question, error)

Get returns a Question entity by its id.

func (*QuestionClient) GetX

func (c *QuestionClient) GetX(ctx context.Context, id uuid.UUID) *Question

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

func (*QuestionClient) Hooks

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

Hooks returns the client hooks.

func (*QuestionClient) Query

func (c *QuestionClient) Query() *QuestionQuery

Query returns a query builder for Question.

func (*QuestionClient) QueryItems

func (c *QuestionClient) QueryItems(q *Question) *ItemQuery

QueryItems queries the items edge of a Question.

func (*QuestionClient) QueryTest

func (c *QuestionClient) QueryTest(q *Question) *TestQuery

QueryTest queries the test edge of a Question.

func (*QuestionClient) QueryTranslations

func (c *QuestionClient) QueryTranslations(q *Question) *QuestionTranslationQuery

QueryTranslations queries the translations edge of a Question.

func (*QuestionClient) Update

func (c *QuestionClient) Update() *QuestionUpdate

Update returns an update builder for Question.

func (*QuestionClient) UpdateOne

func (c *QuestionClient) UpdateOne(q *Question) *QuestionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*QuestionClient) UpdateOneID

func (c *QuestionClient) UpdateOneID(id uuid.UUID) *QuestionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*QuestionClient) Use

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

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

type QuestionCreate

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

QuestionCreate is the builder for creating a Question entity.

func (*QuestionCreate) AddItemIDs

func (qc *QuestionCreate) AddItemIDs(ids ...uuid.UUID) *QuestionCreate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*QuestionCreate) AddItems

func (qc *QuestionCreate) AddItems(i ...*Item) *QuestionCreate

AddItems adds the "items" edges to the Item entity.

func (*QuestionCreate) AddTest

func (qc *QuestionCreate) AddTest(t ...*Test) *QuestionCreate

AddTest adds the "test" edges to the Test entity.

func (*QuestionCreate) AddTestIDs

func (qc *QuestionCreate) AddTestIDs(ids ...uuid.UUID) *QuestionCreate

AddTestIDs adds the "test" edge to the Test entity by IDs.

func (*QuestionCreate) AddTranslationIDs

func (qc *QuestionCreate) AddTranslationIDs(ids ...uuid.UUID) *QuestionCreate

AddTranslationIDs adds the "translations" edge to the QuestionTranslation entity by IDs.

func (*QuestionCreate) AddTranslations

func (qc *QuestionCreate) AddTranslations(q ...*QuestionTranslation) *QuestionCreate

AddTranslations adds the "translations" edges to the QuestionTranslation entity.

func (*QuestionCreate) Exec

func (qc *QuestionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*QuestionCreate) ExecX

func (qc *QuestionCreate) ExecX(ctx context.Context)

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

func (*QuestionCreate) Mutation

func (qc *QuestionCreate) Mutation() *QuestionMutation

Mutation returns the QuestionMutation object of the builder.

func (*QuestionCreate) Save

func (qc *QuestionCreate) Save(ctx context.Context) (*Question, error)

Save creates the Question in the database.

func (*QuestionCreate) SaveX

func (qc *QuestionCreate) SaveX(ctx context.Context) *Question

SaveX calls Save and panics if Save returns an error.

func (*QuestionCreate) SetCode

func (qc *QuestionCreate) SetCode(s string) *QuestionCreate

SetCode sets the "code" field.

func (*QuestionCreate) SetCreateTime

func (qc *QuestionCreate) SetCreateTime(t time.Time) *QuestionCreate

SetCreateTime sets the "create_time" field.

func (*QuestionCreate) SetID

func (qc *QuestionCreate) SetID(u uuid.UUID) *QuestionCreate

SetID sets the "id" field.

func (*QuestionCreate) SetNillableCreateTime

func (qc *QuestionCreate) SetNillableCreateTime(t *time.Time) *QuestionCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*QuestionCreate) SetNillableID

func (qc *QuestionCreate) SetNillableID(u *uuid.UUID) *QuestionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*QuestionCreate) SetNillableOrder

func (qc *QuestionCreate) SetNillableOrder(i *int) *QuestionCreate

SetNillableOrder sets the "order" field if the given value is not nil.

func (*QuestionCreate) SetNillableType

func (qc *QuestionCreate) SetNillableType(q *question.Type) *QuestionCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*QuestionCreate) SetNillableUpdateTime

func (qc *QuestionCreate) SetNillableUpdateTime(t *time.Time) *QuestionCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*QuestionCreate) SetOrder

func (qc *QuestionCreate) SetOrder(i int) *QuestionCreate

SetOrder sets the "order" field.

func (*QuestionCreate) SetType

func (qc *QuestionCreate) SetType(q question.Type) *QuestionCreate

SetType sets the "type" field.

func (*QuestionCreate) SetUpdateTime

func (qc *QuestionCreate) SetUpdateTime(t time.Time) *QuestionCreate

SetUpdateTime sets the "update_time" field.

type QuestionCreateBulk

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

QuestionCreateBulk is the builder for creating many Question entities in bulk.

func (*QuestionCreateBulk) Exec

func (qcb *QuestionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*QuestionCreateBulk) ExecX

func (qcb *QuestionCreateBulk) ExecX(ctx context.Context)

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

func (*QuestionCreateBulk) Save

func (qcb *QuestionCreateBulk) Save(ctx context.Context) ([]*Question, error)

Save creates the Question entities in the database.

func (*QuestionCreateBulk) SaveX

func (qcb *QuestionCreateBulk) SaveX(ctx context.Context) []*Question

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

type QuestionDelete

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

QuestionDelete is the builder for deleting a Question entity.

func (*QuestionDelete) Exec

func (qd *QuestionDelete) Exec(ctx context.Context) (int, error)

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

func (*QuestionDelete) ExecX

func (qd *QuestionDelete) ExecX(ctx context.Context) int

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

func (*QuestionDelete) Where

func (qd *QuestionDelete) Where(ps ...predicate.Question) *QuestionDelete

Where appends a list predicates to the QuestionDelete builder.

type QuestionDeleteOne

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

QuestionDeleteOne is the builder for deleting a single Question entity.

func (*QuestionDeleteOne) Exec

func (qdo *QuestionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*QuestionDeleteOne) ExecX

func (qdo *QuestionDeleteOne) ExecX(ctx context.Context)

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

type QuestionEdges

type QuestionEdges struct {
	// Items holds the value of the items edge.
	Items []*Item `json:"items,omitempty"`
	// Translations holds the value of the translations edge.
	Translations []*QuestionTranslation `json:"translations,omitempty"`
	// Test holds the value of the test edge.
	Test []*Test `json:"test,omitempty"`
	// contains filtered or unexported fields
}

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

func (QuestionEdges) ItemsOrErr

func (e QuestionEdges) ItemsOrErr() ([]*Item, error)

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

func (QuestionEdges) TestOrErr

func (e QuestionEdges) TestOrErr() ([]*Test, error)

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

func (QuestionEdges) TranslationsOrErr

func (e QuestionEdges) TranslationsOrErr() ([]*QuestionTranslation, error)

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

type QuestionGroupBy

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

QuestionGroupBy is the group-by builder for Question entities.

func (*QuestionGroupBy) Aggregate

func (qgb *QuestionGroupBy) Aggregate(fns ...AggregateFunc) *QuestionGroupBy

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

func (*QuestionGroupBy) Bool

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

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

func (*QuestionGroupBy) BoolX

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

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

func (*QuestionGroupBy) Bools

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

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

func (*QuestionGroupBy) BoolsX

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

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

func (*QuestionGroupBy) Float64

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

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

func (*QuestionGroupBy) Float64X

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

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

func (*QuestionGroupBy) Float64s

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

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

func (*QuestionGroupBy) Float64sX

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

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

func (*QuestionGroupBy) Int

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

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

func (*QuestionGroupBy) IntX

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

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

func (*QuestionGroupBy) Ints

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

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

func (*QuestionGroupBy) IntsX

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

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

func (*QuestionGroupBy) Scan

func (qgb *QuestionGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*QuestionGroupBy) ScanX

func (s *QuestionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*QuestionGroupBy) String

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

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

func (*QuestionGroupBy) StringX

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

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

func (*QuestionGroupBy) Strings

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

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

func (*QuestionGroupBy) StringsX

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

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

type QuestionMutation

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

QuestionMutation represents an operation that mutates the Question nodes in the graph.

func (*QuestionMutation) AddField

func (m *QuestionMutation) 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 (*QuestionMutation) AddItemIDs

func (m *QuestionMutation) AddItemIDs(ids ...uuid.UUID)

AddItemIDs adds the "items" edge to the Item entity by ids.

func (*QuestionMutation) AddOrder

func (m *QuestionMutation) AddOrder(i int)

AddOrder adds i to the "order" field.

func (*QuestionMutation) AddTestIDs

func (m *QuestionMutation) AddTestIDs(ids ...uuid.UUID)

AddTestIDs adds the "test" edge to the Test entity by ids.

func (*QuestionMutation) AddTranslationIDs

func (m *QuestionMutation) AddTranslationIDs(ids ...uuid.UUID)

AddTranslationIDs adds the "translations" edge to the QuestionTranslation entity by ids.

func (*QuestionMutation) AddedEdges

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

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

func (*QuestionMutation) AddedField

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

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

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

func (*QuestionMutation) AddedIDs

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

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

func (*QuestionMutation) AddedOrder

func (m *QuestionMutation) AddedOrder() (r int, exists bool)

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

func (*QuestionMutation) ClearEdge

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

func (m *QuestionMutation) 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 (*QuestionMutation) ClearItems

func (m *QuestionMutation) ClearItems()

ClearItems clears the "items" edge to the Item entity.

func (*QuestionMutation) ClearTest

func (m *QuestionMutation) ClearTest()

ClearTest clears the "test" edge to the Test entity.

func (*QuestionMutation) ClearTranslations

func (m *QuestionMutation) ClearTranslations()

ClearTranslations clears the "translations" edge to the QuestionTranslation entity.

func (*QuestionMutation) ClearedEdges

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

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

func (*QuestionMutation) ClearedFields

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

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

func (QuestionMutation) Client

func (m QuestionMutation) 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 (*QuestionMutation) Code

func (m *QuestionMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*QuestionMutation) CreateTime

func (m *QuestionMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*QuestionMutation) EdgeCleared

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

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

func (*QuestionMutation) Field

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

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

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

func (*QuestionMutation) Fields

func (m *QuestionMutation) 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 (*QuestionMutation) GetType

func (m *QuestionMutation) GetType() (r question.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*QuestionMutation) ID

func (m *QuestionMutation) ID() (id uuid.UUID, 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 (*QuestionMutation) IDs

func (m *QuestionMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*QuestionMutation) ItemsCleared

func (m *QuestionMutation) ItemsCleared() bool

ItemsCleared reports if the "items" edge to the Item entity was cleared.

func (*QuestionMutation) ItemsIDs

func (m *QuestionMutation) ItemsIDs() (ids []uuid.UUID)

ItemsIDs returns the "items" edge IDs in the mutation.

func (*QuestionMutation) OldCode

func (m *QuestionMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Question entity. If the Question 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 (*QuestionMutation) OldCreateTime

func (m *QuestionMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Question entity. If the Question 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 (*QuestionMutation) OldField

func (m *QuestionMutation) 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 (*QuestionMutation) OldOrder

func (m *QuestionMutation) OldOrder(ctx context.Context) (v int, err error)

OldOrder returns the old "order" field's value of the Question entity. If the Question 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 (*QuestionMutation) OldType

func (m *QuestionMutation) OldType(ctx context.Context) (v question.Type, err error)

OldType returns the old "type" field's value of the Question entity. If the Question 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 (*QuestionMutation) OldUpdateTime

func (m *QuestionMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Question entity. If the Question 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 (*QuestionMutation) Op

func (m *QuestionMutation) Op() Op

Op returns the operation name.

func (*QuestionMutation) Order

func (m *QuestionMutation) Order() (r int, exists bool)

Order returns the value of the "order" field in the mutation.

func (*QuestionMutation) RemoveItemIDs

func (m *QuestionMutation) RemoveItemIDs(ids ...uuid.UUID)

RemoveItemIDs removes the "items" edge to the Item entity by IDs.

func (*QuestionMutation) RemoveTestIDs

func (m *QuestionMutation) RemoveTestIDs(ids ...uuid.UUID)

RemoveTestIDs removes the "test" edge to the Test entity by IDs.

func (*QuestionMutation) RemoveTranslationIDs

func (m *QuestionMutation) RemoveTranslationIDs(ids ...uuid.UUID)

RemoveTranslationIDs removes the "translations" edge to the QuestionTranslation entity by IDs.

func (*QuestionMutation) RemovedEdges

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

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

func (*QuestionMutation) RemovedIDs

func (m *QuestionMutation) 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 (*QuestionMutation) RemovedItemsIDs

func (m *QuestionMutation) RemovedItemsIDs() (ids []uuid.UUID)

RemovedItems returns the removed IDs of the "items" edge to the Item entity.

func (*QuestionMutation) RemovedTestIDs

func (m *QuestionMutation) RemovedTestIDs() (ids []uuid.UUID)

RemovedTest returns the removed IDs of the "test" edge to the Test entity.

func (*QuestionMutation) RemovedTranslationsIDs

func (m *QuestionMutation) RemovedTranslationsIDs() (ids []uuid.UUID)

RemovedTranslations returns the removed IDs of the "translations" edge to the QuestionTranslation entity.

func (*QuestionMutation) ResetCode

func (m *QuestionMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*QuestionMutation) ResetCreateTime

func (m *QuestionMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*QuestionMutation) ResetEdge

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

func (m *QuestionMutation) 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 (*QuestionMutation) ResetItems

func (m *QuestionMutation) ResetItems()

ResetItems resets all changes to the "items" edge.

func (*QuestionMutation) ResetOrder

func (m *QuestionMutation) ResetOrder()

ResetOrder resets all changes to the "order" field.

func (*QuestionMutation) ResetTest

func (m *QuestionMutation) ResetTest()

ResetTest resets all changes to the "test" edge.

func (*QuestionMutation) ResetTranslations

func (m *QuestionMutation) ResetTranslations()

ResetTranslations resets all changes to the "translations" edge.

func (*QuestionMutation) ResetType

func (m *QuestionMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*QuestionMutation) ResetUpdateTime

func (m *QuestionMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*QuestionMutation) SetCode

func (m *QuestionMutation) SetCode(s string)

SetCode sets the "code" field.

func (*QuestionMutation) SetCreateTime

func (m *QuestionMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*QuestionMutation) SetField

func (m *QuestionMutation) 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 (*QuestionMutation) SetID

func (m *QuestionMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Question entities.

func (*QuestionMutation) SetOrder

func (m *QuestionMutation) SetOrder(i int)

SetOrder sets the "order" field.

func (*QuestionMutation) SetType

func (m *QuestionMutation) SetType(q question.Type)

SetType sets the "type" field.

func (*QuestionMutation) SetUpdateTime

func (m *QuestionMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*QuestionMutation) TestCleared

func (m *QuestionMutation) TestCleared() bool

TestCleared reports if the "test" edge to the Test entity was cleared.

func (*QuestionMutation) TestIDs

func (m *QuestionMutation) TestIDs() (ids []uuid.UUID)

TestIDs returns the "test" edge IDs in the mutation.

func (*QuestionMutation) TranslationsCleared

func (m *QuestionMutation) TranslationsCleared() bool

TranslationsCleared reports if the "translations" edge to the QuestionTranslation entity was cleared.

func (*QuestionMutation) TranslationsIDs

func (m *QuestionMutation) TranslationsIDs() (ids []uuid.UUID)

TranslationsIDs returns the "translations" edge IDs in the mutation.

func (QuestionMutation) Tx

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

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

func (*QuestionMutation) Type

func (m *QuestionMutation) Type() string

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

func (*QuestionMutation) UpdateTime

func (m *QuestionMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*QuestionMutation) Where

func (m *QuestionMutation) Where(ps ...predicate.Question)

Where appends a list predicates to the QuestionMutation builder.

type QuestionQuery

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

QuestionQuery is the builder for querying Question entities.

func (*QuestionQuery) All

func (qq *QuestionQuery) All(ctx context.Context) ([]*Question, error)

All executes the query and returns a list of Questions.

func (*QuestionQuery) AllX

func (qq *QuestionQuery) AllX(ctx context.Context) []*Question

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

func (*QuestionQuery) Clone

func (qq *QuestionQuery) Clone() *QuestionQuery

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

func (*QuestionQuery) Count

func (qq *QuestionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*QuestionQuery) CountX

func (qq *QuestionQuery) CountX(ctx context.Context) int

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

func (*QuestionQuery) Exist

func (qq *QuestionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*QuestionQuery) ExistX

func (qq *QuestionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*QuestionQuery) First

func (qq *QuestionQuery) First(ctx context.Context) (*Question, error)

First returns the first Question entity from the query. Returns a *NotFoundError when no Question was found.

func (*QuestionQuery) FirstID

func (qq *QuestionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Question ID from the query. Returns a *NotFoundError when no Question ID was found.

func (*QuestionQuery) FirstIDX

func (qq *QuestionQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*QuestionQuery) FirstX

func (qq *QuestionQuery) FirstX(ctx context.Context) *Question

FirstX is like First, but panics if an error occurs.

func (*QuestionQuery) GroupBy

func (qq *QuestionQuery) GroupBy(field string, fields ...string) *QuestionGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Question.Query().
	GroupBy(question.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*QuestionQuery) IDs

func (qq *QuestionQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Question IDs.

func (*QuestionQuery) IDsX

func (qq *QuestionQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*QuestionQuery) Limit

func (qq *QuestionQuery) Limit(limit int) *QuestionQuery

Limit adds a limit step to the query.

func (*QuestionQuery) Offset

func (qq *QuestionQuery) Offset(offset int) *QuestionQuery

Offset adds an offset step to the query.

func (*QuestionQuery) Only

func (qq *QuestionQuery) Only(ctx context.Context) (*Question, error)

Only returns a single Question entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Question entity is found. Returns a *NotFoundError when no Question entities are found.

func (*QuestionQuery) OnlyID

func (qq *QuestionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Question ID in the query. Returns a *NotSingularError when more than one Question ID is found. Returns a *NotFoundError when no entities are found.

func (*QuestionQuery) OnlyIDX

func (qq *QuestionQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*QuestionQuery) OnlyX

func (qq *QuestionQuery) OnlyX(ctx context.Context) *Question

OnlyX is like Only, but panics if an error occurs.

func (*QuestionQuery) Order

func (qq *QuestionQuery) Order(o ...OrderFunc) *QuestionQuery

Order adds an order step to the query.

func (*QuestionQuery) QueryItems

func (qq *QuestionQuery) QueryItems() *ItemQuery

QueryItems chains the current query on the "items" edge.

func (*QuestionQuery) QueryTest

func (qq *QuestionQuery) QueryTest() *TestQuery

QueryTest chains the current query on the "test" edge.

func (*QuestionQuery) QueryTranslations

func (qq *QuestionQuery) QueryTranslations() *QuestionTranslationQuery

QueryTranslations chains the current query on the "translations" edge.

func (*QuestionQuery) Select

func (qq *QuestionQuery) Select(fields ...string) *QuestionSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Question.Query().
	Select(question.FieldCreateTime).
	Scan(ctx, &v)

func (*QuestionQuery) Unique

func (qq *QuestionQuery) Unique(unique bool) *QuestionQuery

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 (*QuestionQuery) Where

func (qq *QuestionQuery) Where(ps ...predicate.Question) *QuestionQuery

Where adds a new predicate for the QuestionQuery builder.

func (*QuestionQuery) WithItems

func (qq *QuestionQuery) WithItems(opts ...func(*ItemQuery)) *QuestionQuery

WithItems tells the query-builder to eager-load the nodes that are connected to the "items" edge. The optional arguments are used to configure the query builder of the edge.

func (*QuestionQuery) WithTest

func (qq *QuestionQuery) WithTest(opts ...func(*TestQuery)) *QuestionQuery

WithTest tells the query-builder to eager-load the nodes that are connected to the "test" edge. The optional arguments are used to configure the query builder of the edge.

func (*QuestionQuery) WithTranslations

func (qq *QuestionQuery) WithTranslations(opts ...func(*QuestionTranslationQuery)) *QuestionQuery

WithTranslations tells the query-builder to eager-load the nodes that are connected to the "translations" edge. The optional arguments are used to configure the query builder of the edge.

type QuestionSelect

type QuestionSelect struct {
	*QuestionQuery
	// contains filtered or unexported fields
}

QuestionSelect is the builder for selecting fields of Question entities.

func (*QuestionSelect) Bool

func (s *QuestionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*QuestionSelect) BoolX

func (s *QuestionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*QuestionSelect) Bools

func (s *QuestionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*QuestionSelect) BoolsX

func (s *QuestionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*QuestionSelect) Float64

func (s *QuestionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*QuestionSelect) Float64X

func (s *QuestionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*QuestionSelect) Float64s

func (s *QuestionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*QuestionSelect) Float64sX

func (s *QuestionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*QuestionSelect) Int

func (s *QuestionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*QuestionSelect) IntX

func (s *QuestionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*QuestionSelect) Ints

func (s *QuestionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*QuestionSelect) IntsX

func (s *QuestionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*QuestionSelect) Scan

func (qs *QuestionSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*QuestionSelect) ScanX

func (s *QuestionSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*QuestionSelect) String

func (s *QuestionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*QuestionSelect) StringX

func (s *QuestionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*QuestionSelect) Strings

func (s *QuestionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*QuestionSelect) StringsX

func (s *QuestionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type QuestionTranslation

type QuestionTranslation struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Locale holds the value of the "locale" field.
	Locale questiontranslation.Locale `json:"locale,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// HeaderContent holds the value of the "header_content" field.
	HeaderContent string `json:"header_content,omitempty"`
	// FooterContent holds the value of the "footer_content" field.
	FooterContent string `json:"footer_content,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the QuestionTranslationQuery when eager-loading is set.
	Edges QuestionTranslationEdges `json:"edges"`
	// contains filtered or unexported fields
}

QuestionTranslation is the model entity for the QuestionTranslation schema.

func (*QuestionTranslation) QueryQuestion

func (qt *QuestionTranslation) QueryQuestion() *QuestionQuery

QueryQuestion queries the "question" edge of the QuestionTranslation entity.

func (*QuestionTranslation) String

func (qt *QuestionTranslation) String() string

String implements the fmt.Stringer.

func (*QuestionTranslation) Unwrap

Unwrap unwraps the QuestionTranslation 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 (*QuestionTranslation) Update

Update returns a builder for updating this QuestionTranslation. Note that you need to call QuestionTranslation.Unwrap() before calling this method if this QuestionTranslation was returned from a transaction, and the transaction was committed or rolled back.

type QuestionTranslationClient

type QuestionTranslationClient struct {
	// contains filtered or unexported fields
}

QuestionTranslationClient is a client for the QuestionTranslation schema.

func NewQuestionTranslationClient

func NewQuestionTranslationClient(c config) *QuestionTranslationClient

NewQuestionTranslationClient returns a client for the QuestionTranslation from the given config.

func (*QuestionTranslationClient) Create

Create returns a builder for creating a QuestionTranslation entity.

func (*QuestionTranslationClient) CreateBulk

CreateBulk returns a builder for creating a bulk of QuestionTranslation entities.

func (*QuestionTranslationClient) Delete

Delete returns a delete builder for QuestionTranslation.

func (*QuestionTranslationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*QuestionTranslationClient) DeleteOneID

DeleteOne returns a builder for deleting the given entity by its id.

func (*QuestionTranslationClient) Get

Get returns a QuestionTranslation entity by its id.

func (*QuestionTranslationClient) GetX

GetX is like Get, but panics if an error occurs.

func (*QuestionTranslationClient) Hooks

func (c *QuestionTranslationClient) Hooks() []Hook

Hooks returns the client hooks.

func (*QuestionTranslationClient) Query

Query returns a query builder for QuestionTranslation.

func (*QuestionTranslationClient) QueryQuestion

QueryQuestion queries the question edge of a QuestionTranslation.

func (*QuestionTranslationClient) Update

Update returns an update builder for QuestionTranslation.

func (*QuestionTranslationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*QuestionTranslationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*QuestionTranslationClient) Use

func (c *QuestionTranslationClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `questiontranslation.Hooks(f(g(h())))`.

type QuestionTranslationCreate

type QuestionTranslationCreate struct {
	// contains filtered or unexported fields
}

QuestionTranslationCreate is the builder for creating a QuestionTranslation entity.

func (*QuestionTranslationCreate) Exec

Exec executes the query.

func (*QuestionTranslationCreate) ExecX

func (qtc *QuestionTranslationCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*QuestionTranslationCreate) Mutation

Mutation returns the QuestionTranslationMutation object of the builder.

func (*QuestionTranslationCreate) Save

Save creates the QuestionTranslation in the database.

func (*QuestionTranslationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*QuestionTranslationCreate) SetContent

SetContent sets the "content" field.

func (*QuestionTranslationCreate) SetFooterContent

SetFooterContent sets the "footer_content" field.

func (*QuestionTranslationCreate) SetHeaderContent

SetHeaderContent sets the "header_content" field.

func (*QuestionTranslationCreate) SetID

SetID sets the "id" field.

func (*QuestionTranslationCreate) SetLocale

SetLocale sets the "locale" field.

func (*QuestionTranslationCreate) SetNillableContent

func (qtc *QuestionTranslationCreate) SetNillableContent(s *string) *QuestionTranslationCreate

SetNillableContent sets the "content" field if the given value is not nil.

func (*QuestionTranslationCreate) SetNillableFooterContent

func (qtc *QuestionTranslationCreate) SetNillableFooterContent(s *string) *QuestionTranslationCreate

SetNillableFooterContent sets the "footer_content" field if the given value is not nil.

func (*QuestionTranslationCreate) SetNillableHeaderContent

func (qtc *QuestionTranslationCreate) SetNillableHeaderContent(s *string) *QuestionTranslationCreate

SetNillableHeaderContent sets the "header_content" field if the given value is not nil.

func (*QuestionTranslationCreate) SetNillableID

SetNillableID sets the "id" field if the given value is not nil.

func (*QuestionTranslationCreate) SetNillableQuestionID

func (qtc *QuestionTranslationCreate) SetNillableQuestionID(id *uuid.UUID) *QuestionTranslationCreate

SetNillableQuestionID sets the "question" edge to the Question entity by ID if the given value is not nil.

func (*QuestionTranslationCreate) SetQuestion

SetQuestion sets the "question" edge to the Question entity.

func (*QuestionTranslationCreate) SetQuestionID

SetQuestionID sets the "question" edge to the Question entity by ID.

type QuestionTranslationCreateBulk

type QuestionTranslationCreateBulk struct {
	// contains filtered or unexported fields
}

QuestionTranslationCreateBulk is the builder for creating many QuestionTranslation entities in bulk.

func (*QuestionTranslationCreateBulk) Exec

Exec executes the query.

func (*QuestionTranslationCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*QuestionTranslationCreateBulk) Save

Save creates the QuestionTranslation entities in the database.

func (*QuestionTranslationCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type QuestionTranslationDelete

type QuestionTranslationDelete struct {
	// contains filtered or unexported fields
}

QuestionTranslationDelete is the builder for deleting a QuestionTranslation entity.

func (*QuestionTranslationDelete) Exec

Exec executes the deletion query and returns how many vertices were deleted.

func (*QuestionTranslationDelete) ExecX

func (qtd *QuestionTranslationDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*QuestionTranslationDelete) Where

Where appends a list predicates to the QuestionTranslationDelete builder.

type QuestionTranslationDeleteOne

type QuestionTranslationDeleteOne struct {
	// contains filtered or unexported fields
}

QuestionTranslationDeleteOne is the builder for deleting a single QuestionTranslation entity.

func (*QuestionTranslationDeleteOne) Exec

Exec executes the deletion query.

func (*QuestionTranslationDeleteOne) ExecX

func (qtdo *QuestionTranslationDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type QuestionTranslationEdges

type QuestionTranslationEdges struct {
	// Question holds the value of the question edge.
	Question *Question `json:"question,omitempty"`
	// contains filtered or unexported fields
}

QuestionTranslationEdges holds the relations/edges for other nodes in the graph.

func (QuestionTranslationEdges) QuestionOrErr

func (e QuestionTranslationEdges) QuestionOrErr() (*Question, error)

QuestionOrErr returns the Question value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type QuestionTranslationGroupBy

type QuestionTranslationGroupBy struct {
	// contains filtered or unexported fields
}

QuestionTranslationGroupBy is the group-by builder for QuestionTranslation entities.

func (*QuestionTranslationGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*QuestionTranslationGroupBy) Bool

func (s *QuestionTranslationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationGroupBy) BoolX

func (s *QuestionTranslationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*QuestionTranslationGroupBy) Bools

func (s *QuestionTranslationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationGroupBy) BoolsX

func (s *QuestionTranslationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*QuestionTranslationGroupBy) Float64

func (s *QuestionTranslationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationGroupBy) Float64X

func (s *QuestionTranslationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*QuestionTranslationGroupBy) Float64s

func (s *QuestionTranslationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationGroupBy) Float64sX

func (s *QuestionTranslationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*QuestionTranslationGroupBy) Int

func (s *QuestionTranslationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationGroupBy) IntX

func (s *QuestionTranslationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*QuestionTranslationGroupBy) Ints

func (s *QuestionTranslationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationGroupBy) IntsX

func (s *QuestionTranslationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*QuestionTranslationGroupBy) Scan

func (qtgb *QuestionTranslationGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*QuestionTranslationGroupBy) ScanX

func (s *QuestionTranslationGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*QuestionTranslationGroupBy) String

func (s *QuestionTranslationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationGroupBy) StringX

func (s *QuestionTranslationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*QuestionTranslationGroupBy) Strings

func (s *QuestionTranslationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationGroupBy) StringsX

func (s *QuestionTranslationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type QuestionTranslationMutation

type QuestionTranslationMutation struct {
	// contains filtered or unexported fields
}

QuestionTranslationMutation represents an operation that mutates the QuestionTranslation nodes in the graph.

func (*QuestionTranslationMutation) AddField

func (m *QuestionTranslationMutation) 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 (*QuestionTranslationMutation) AddedEdges

func (m *QuestionTranslationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*QuestionTranslationMutation) AddedField

func (m *QuestionTranslationMutation) 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 (*QuestionTranslationMutation) AddedFields

func (m *QuestionTranslationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*QuestionTranslationMutation) AddedIDs

func (m *QuestionTranslationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*QuestionTranslationMutation) ClearContent

func (m *QuestionTranslationMutation) ClearContent()

ClearContent clears the value of the "content" field.

func (*QuestionTranslationMutation) ClearEdge

func (m *QuestionTranslationMutation) 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 (*QuestionTranslationMutation) ClearField

func (m *QuestionTranslationMutation) 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 (*QuestionTranslationMutation) ClearFooterContent

func (m *QuestionTranslationMutation) ClearFooterContent()

ClearFooterContent clears the value of the "footer_content" field.

func (*QuestionTranslationMutation) ClearHeaderContent

func (m *QuestionTranslationMutation) ClearHeaderContent()

ClearHeaderContent clears the value of the "header_content" field.

func (*QuestionTranslationMutation) ClearQuestion

func (m *QuestionTranslationMutation) ClearQuestion()

ClearQuestion clears the "question" edge to the Question entity.

func (*QuestionTranslationMutation) ClearedEdges

func (m *QuestionTranslationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*QuestionTranslationMutation) ClearedFields

func (m *QuestionTranslationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (QuestionTranslationMutation) Client

func (m QuestionTranslationMutation) 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 (*QuestionTranslationMutation) Content

func (m *QuestionTranslationMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*QuestionTranslationMutation) ContentCleared

func (m *QuestionTranslationMutation) ContentCleared() bool

ContentCleared returns if the "content" field was cleared in this mutation.

func (*QuestionTranslationMutation) EdgeCleared

func (m *QuestionTranslationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*QuestionTranslationMutation) Field

func (m *QuestionTranslationMutation) 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 (*QuestionTranslationMutation) FieldCleared

func (m *QuestionTranslationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*QuestionTranslationMutation) Fields

func (m *QuestionTranslationMutation) 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 (*QuestionTranslationMutation) FooterContent

func (m *QuestionTranslationMutation) FooterContent() (r string, exists bool)

FooterContent returns the value of the "footer_content" field in the mutation.

func (*QuestionTranslationMutation) FooterContentCleared

func (m *QuestionTranslationMutation) FooterContentCleared() bool

FooterContentCleared returns if the "footer_content" field was cleared in this mutation.

func (*QuestionTranslationMutation) HeaderContent

func (m *QuestionTranslationMutation) HeaderContent() (r string, exists bool)

HeaderContent returns the value of the "header_content" field in the mutation.

func (*QuestionTranslationMutation) HeaderContentCleared

func (m *QuestionTranslationMutation) HeaderContentCleared() bool

HeaderContentCleared returns if the "header_content" field was cleared in this mutation.

func (*QuestionTranslationMutation) ID

func (m *QuestionTranslationMutation) ID() (id uuid.UUID, 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 (*QuestionTranslationMutation) IDs

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 (*QuestionTranslationMutation) Locale

Locale returns the value of the "locale" field in the mutation.

func (*QuestionTranslationMutation) OldContent

func (m *QuestionTranslationMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the QuestionTranslation entity. If the QuestionTranslation 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 (*QuestionTranslationMutation) OldField

func (m *QuestionTranslationMutation) 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 (*QuestionTranslationMutation) OldFooterContent

func (m *QuestionTranslationMutation) OldFooterContent(ctx context.Context) (v string, err error)

OldFooterContent returns the old "footer_content" field's value of the QuestionTranslation entity. If the QuestionTranslation 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 (*QuestionTranslationMutation) OldHeaderContent

func (m *QuestionTranslationMutation) OldHeaderContent(ctx context.Context) (v string, err error)

OldHeaderContent returns the old "header_content" field's value of the QuestionTranslation entity. If the QuestionTranslation 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 (*QuestionTranslationMutation) OldLocale

OldLocale returns the old "locale" field's value of the QuestionTranslation entity. If the QuestionTranslation 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 (*QuestionTranslationMutation) Op

Op returns the operation name.

func (*QuestionTranslationMutation) QuestionCleared

func (m *QuestionTranslationMutation) QuestionCleared() bool

QuestionCleared reports if the "question" edge to the Question entity was cleared.

func (*QuestionTranslationMutation) QuestionID

func (m *QuestionTranslationMutation) QuestionID() (id uuid.UUID, exists bool)

QuestionID returns the "question" edge ID in the mutation.

func (*QuestionTranslationMutation) QuestionIDs

func (m *QuestionTranslationMutation) QuestionIDs() (ids []uuid.UUID)

QuestionIDs returns the "question" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use QuestionID instead. It exists only for internal usage by the builders.

func (*QuestionTranslationMutation) RemovedEdges

func (m *QuestionTranslationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*QuestionTranslationMutation) RemovedIDs

func (m *QuestionTranslationMutation) 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 (*QuestionTranslationMutation) ResetContent

func (m *QuestionTranslationMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*QuestionTranslationMutation) ResetEdge

func (m *QuestionTranslationMutation) 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 (*QuestionTranslationMutation) ResetField

func (m *QuestionTranslationMutation) 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 (*QuestionTranslationMutation) ResetFooterContent

func (m *QuestionTranslationMutation) ResetFooterContent()

ResetFooterContent resets all changes to the "footer_content" field.

func (*QuestionTranslationMutation) ResetHeaderContent

func (m *QuestionTranslationMutation) ResetHeaderContent()

ResetHeaderContent resets all changes to the "header_content" field.

func (*QuestionTranslationMutation) ResetLocale

func (m *QuestionTranslationMutation) ResetLocale()

ResetLocale resets all changes to the "locale" field.

func (*QuestionTranslationMutation) ResetQuestion

func (m *QuestionTranslationMutation) ResetQuestion()

ResetQuestion resets all changes to the "question" edge.

func (*QuestionTranslationMutation) SetContent

func (m *QuestionTranslationMutation) SetContent(s string)

SetContent sets the "content" field.

func (*QuestionTranslationMutation) SetField

func (m *QuestionTranslationMutation) 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 (*QuestionTranslationMutation) SetFooterContent

func (m *QuestionTranslationMutation) SetFooterContent(s string)

SetFooterContent sets the "footer_content" field.

func (*QuestionTranslationMutation) SetHeaderContent

func (m *QuestionTranslationMutation) SetHeaderContent(s string)

SetHeaderContent sets the "header_content" field.

func (*QuestionTranslationMutation) SetID

func (m *QuestionTranslationMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of QuestionTranslation entities.

func (*QuestionTranslationMutation) SetLocale

SetLocale sets the "locale" field.

func (*QuestionTranslationMutation) SetQuestionID

func (m *QuestionTranslationMutation) SetQuestionID(id uuid.UUID)

SetQuestionID sets the "question" edge to the Question entity by id.

func (QuestionTranslationMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*QuestionTranslationMutation) Type

Type returns the node type of this mutation (QuestionTranslation).

func (*QuestionTranslationMutation) Where

Where appends a list predicates to the QuestionTranslationMutation builder.

type QuestionTranslationQuery

type QuestionTranslationQuery struct {
	// contains filtered or unexported fields
}

QuestionTranslationQuery is the builder for querying QuestionTranslation entities.

func (*QuestionTranslationQuery) All

All executes the query and returns a list of QuestionTranslations.

func (*QuestionTranslationQuery) AllX

AllX is like All, but panics if an error occurs.

func (*QuestionTranslationQuery) Clone

Clone returns a duplicate of the QuestionTranslationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*QuestionTranslationQuery) Count

func (qtq *QuestionTranslationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*QuestionTranslationQuery) CountX

func (qtq *QuestionTranslationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*QuestionTranslationQuery) Exist

func (qtq *QuestionTranslationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*QuestionTranslationQuery) ExistX

func (qtq *QuestionTranslationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*QuestionTranslationQuery) First

First returns the first QuestionTranslation entity from the query. Returns a *NotFoundError when no QuestionTranslation was found.

func (*QuestionTranslationQuery) FirstID

func (qtq *QuestionTranslationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first QuestionTranslation ID from the query. Returns a *NotFoundError when no QuestionTranslation ID was found.

func (*QuestionTranslationQuery) FirstIDX

func (qtq *QuestionTranslationQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*QuestionTranslationQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*QuestionTranslationQuery) GroupBy

func (qtq *QuestionTranslationQuery) GroupBy(field string, fields ...string) *QuestionTranslationGroupBy

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 {
	Locale questiontranslation.Locale `json:"locale,omitempty"`
	Count int `json:"count,omitempty"`
}

client.QuestionTranslation.Query().
	GroupBy(questiontranslation.FieldLocale).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*QuestionTranslationQuery) IDs

IDs executes the query and returns a list of QuestionTranslation IDs.

func (*QuestionTranslationQuery) IDsX

IDsX is like IDs, but panics if an error occurs.

func (*QuestionTranslationQuery) Limit

Limit adds a limit step to the query.

func (*QuestionTranslationQuery) Offset

Offset adds an offset step to the query.

func (*QuestionTranslationQuery) Only

Only returns a single QuestionTranslation entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one QuestionTranslation entity is found. Returns a *NotFoundError when no QuestionTranslation entities are found.

func (*QuestionTranslationQuery) OnlyID

func (qtq *QuestionTranslationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only QuestionTranslation ID in the query. Returns a *NotSingularError when more than one QuestionTranslation ID is found. Returns a *NotFoundError when no entities are found.

func (*QuestionTranslationQuery) OnlyIDX

func (qtq *QuestionTranslationQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*QuestionTranslationQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*QuestionTranslationQuery) Order

Order adds an order step to the query.

func (*QuestionTranslationQuery) QueryQuestion

func (qtq *QuestionTranslationQuery) QueryQuestion() *QuestionQuery

QueryQuestion chains the current query on the "question" edge.

func (*QuestionTranslationQuery) Select

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 {
	Locale questiontranslation.Locale `json:"locale,omitempty"`
}

client.QuestionTranslation.Query().
	Select(questiontranslation.FieldLocale).
	Scan(ctx, &v)

func (*QuestionTranslationQuery) Unique

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 (*QuestionTranslationQuery) Where

Where adds a new predicate for the QuestionTranslationQuery builder.

func (*QuestionTranslationQuery) WithQuestion

func (qtq *QuestionTranslationQuery) WithQuestion(opts ...func(*QuestionQuery)) *QuestionTranslationQuery

WithQuestion tells the query-builder to eager-load the nodes that are connected to the "question" edge. The optional arguments are used to configure the query builder of the edge.

type QuestionTranslationSelect

type QuestionTranslationSelect struct {
	*QuestionTranslationQuery
	// contains filtered or unexported fields
}

QuestionTranslationSelect is the builder for selecting fields of QuestionTranslation entities.

func (*QuestionTranslationSelect) Bool

func (s *QuestionTranslationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationSelect) BoolX

func (s *QuestionTranslationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*QuestionTranslationSelect) Bools

func (s *QuestionTranslationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationSelect) BoolsX

func (s *QuestionTranslationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*QuestionTranslationSelect) Float64

func (s *QuestionTranslationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationSelect) Float64X

func (s *QuestionTranslationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*QuestionTranslationSelect) Float64s

func (s *QuestionTranslationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationSelect) Float64sX

func (s *QuestionTranslationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*QuestionTranslationSelect) Int

func (s *QuestionTranslationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationSelect) IntX

func (s *QuestionTranslationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*QuestionTranslationSelect) Ints

func (s *QuestionTranslationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationSelect) IntsX

func (s *QuestionTranslationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*QuestionTranslationSelect) Scan

func (qts *QuestionTranslationSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*QuestionTranslationSelect) ScanX

func (s *QuestionTranslationSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*QuestionTranslationSelect) String

func (s *QuestionTranslationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationSelect) StringX

func (s *QuestionTranslationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*QuestionTranslationSelect) Strings

func (s *QuestionTranslationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*QuestionTranslationSelect) StringsX

func (s *QuestionTranslationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type QuestionTranslationUpdate

type QuestionTranslationUpdate struct {
	// contains filtered or unexported fields
}

QuestionTranslationUpdate is the builder for updating QuestionTranslation entities.

func (*QuestionTranslationUpdate) ClearContent

ClearContent clears the value of the "content" field.

func (*QuestionTranslationUpdate) ClearFooterContent

func (qtu *QuestionTranslationUpdate) ClearFooterContent() *QuestionTranslationUpdate

ClearFooterContent clears the value of the "footer_content" field.

func (*QuestionTranslationUpdate) ClearHeaderContent

func (qtu *QuestionTranslationUpdate) ClearHeaderContent() *QuestionTranslationUpdate

ClearHeaderContent clears the value of the "header_content" field.

func (*QuestionTranslationUpdate) ClearQuestion

ClearQuestion clears the "question" edge to the Question entity.

func (*QuestionTranslationUpdate) Exec

Exec executes the query.

func (*QuestionTranslationUpdate) ExecX

func (qtu *QuestionTranslationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*QuestionTranslationUpdate) Mutation

Mutation returns the QuestionTranslationMutation object of the builder.

func (*QuestionTranslationUpdate) Save

Save executes the query and returns the number of nodes affected by the update operation.

func (*QuestionTranslationUpdate) SaveX

func (qtu *QuestionTranslationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*QuestionTranslationUpdate) SetContent

SetContent sets the "content" field.

func (*QuestionTranslationUpdate) SetFooterContent

SetFooterContent sets the "footer_content" field.

func (*QuestionTranslationUpdate) SetHeaderContent

SetHeaderContent sets the "header_content" field.

func (*QuestionTranslationUpdate) SetNillableContent

func (qtu *QuestionTranslationUpdate) SetNillableContent(s *string) *QuestionTranslationUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*QuestionTranslationUpdate) SetNillableFooterContent

func (qtu *QuestionTranslationUpdate) SetNillableFooterContent(s *string) *QuestionTranslationUpdate

SetNillableFooterContent sets the "footer_content" field if the given value is not nil.

func (*QuestionTranslationUpdate) SetNillableHeaderContent

func (qtu *QuestionTranslationUpdate) SetNillableHeaderContent(s *string) *QuestionTranslationUpdate

SetNillableHeaderContent sets the "header_content" field if the given value is not nil.

func (*QuestionTranslationUpdate) SetNillableQuestionID

func (qtu *QuestionTranslationUpdate) SetNillableQuestionID(id *uuid.UUID) *QuestionTranslationUpdate

SetNillableQuestionID sets the "question" edge to the Question entity by ID if the given value is not nil.

func (*QuestionTranslationUpdate) SetQuestion

SetQuestion sets the "question" edge to the Question entity.

func (*QuestionTranslationUpdate) SetQuestionID

SetQuestionID sets the "question" edge to the Question entity by ID.

func (*QuestionTranslationUpdate) Where

Where appends a list predicates to the QuestionTranslationUpdate builder.

type QuestionTranslationUpdateOne

type QuestionTranslationUpdateOne struct {
	// contains filtered or unexported fields
}

QuestionTranslationUpdateOne is the builder for updating a single QuestionTranslation entity.

func (*QuestionTranslationUpdateOne) ClearContent

ClearContent clears the value of the "content" field.

func (*QuestionTranslationUpdateOne) ClearFooterContent

func (qtuo *QuestionTranslationUpdateOne) ClearFooterContent() *QuestionTranslationUpdateOne

ClearFooterContent clears the value of the "footer_content" field.

func (*QuestionTranslationUpdateOne) ClearHeaderContent

func (qtuo *QuestionTranslationUpdateOne) ClearHeaderContent() *QuestionTranslationUpdateOne

ClearHeaderContent clears the value of the "header_content" field.

func (*QuestionTranslationUpdateOne) ClearQuestion

ClearQuestion clears the "question" edge to the Question entity.

func (*QuestionTranslationUpdateOne) Exec

Exec executes the query on the entity.

func (*QuestionTranslationUpdateOne) ExecX

func (qtuo *QuestionTranslationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*QuestionTranslationUpdateOne) Mutation

Mutation returns the QuestionTranslationMutation object of the builder.

func (*QuestionTranslationUpdateOne) Save

Save executes the query and returns the updated QuestionTranslation entity.

func (*QuestionTranslationUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*QuestionTranslationUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*QuestionTranslationUpdateOne) SetContent

SetContent sets the "content" field.

func (*QuestionTranslationUpdateOne) SetFooterContent

SetFooterContent sets the "footer_content" field.

func (*QuestionTranslationUpdateOne) SetHeaderContent

SetHeaderContent sets the "header_content" field.

func (*QuestionTranslationUpdateOne) SetNillableContent

SetNillableContent sets the "content" field if the given value is not nil.

func (*QuestionTranslationUpdateOne) SetNillableFooterContent

func (qtuo *QuestionTranslationUpdateOne) SetNillableFooterContent(s *string) *QuestionTranslationUpdateOne

SetNillableFooterContent sets the "footer_content" field if the given value is not nil.

func (*QuestionTranslationUpdateOne) SetNillableHeaderContent

func (qtuo *QuestionTranslationUpdateOne) SetNillableHeaderContent(s *string) *QuestionTranslationUpdateOne

SetNillableHeaderContent sets the "header_content" field if the given value is not nil.

func (*QuestionTranslationUpdateOne) SetNillableQuestionID

func (qtuo *QuestionTranslationUpdateOne) SetNillableQuestionID(id *uuid.UUID) *QuestionTranslationUpdateOne

SetNillableQuestionID sets the "question" edge to the Question entity by ID if the given value is not nil.

func (*QuestionTranslationUpdateOne) SetQuestion

SetQuestion sets the "question" edge to the Question entity.

func (*QuestionTranslationUpdateOne) SetQuestionID

SetQuestionID sets the "question" edge to the Question entity by ID.

type QuestionTranslations

type QuestionTranslations []*QuestionTranslation

QuestionTranslations is a parsable slice of QuestionTranslation.

type QuestionUpdate

type QuestionUpdate struct {
	// contains filtered or unexported fields
}

QuestionUpdate is the builder for updating Question entities.

func (*QuestionUpdate) AddItemIDs

func (qu *QuestionUpdate) AddItemIDs(ids ...uuid.UUID) *QuestionUpdate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*QuestionUpdate) AddItems

func (qu *QuestionUpdate) AddItems(i ...*Item) *QuestionUpdate

AddItems adds the "items" edges to the Item entity.

func (*QuestionUpdate) AddOrder

func (qu *QuestionUpdate) AddOrder(i int) *QuestionUpdate

AddOrder adds i to the "order" field.

func (*QuestionUpdate) AddTest

func (qu *QuestionUpdate) AddTest(t ...*Test) *QuestionUpdate

AddTest adds the "test" edges to the Test entity.

func (*QuestionUpdate) AddTestIDs

func (qu *QuestionUpdate) AddTestIDs(ids ...uuid.UUID) *QuestionUpdate

AddTestIDs adds the "test" edge to the Test entity by IDs.

func (*QuestionUpdate) AddTranslationIDs

func (qu *QuestionUpdate) AddTranslationIDs(ids ...uuid.UUID) *QuestionUpdate

AddTranslationIDs adds the "translations" edge to the QuestionTranslation entity by IDs.

func (*QuestionUpdate) AddTranslations

func (qu *QuestionUpdate) AddTranslations(q ...*QuestionTranslation) *QuestionUpdate

AddTranslations adds the "translations" edges to the QuestionTranslation entity.

func (*QuestionUpdate) ClearItems

func (qu *QuestionUpdate) ClearItems() *QuestionUpdate

ClearItems clears all "items" edges to the Item entity.

func (*QuestionUpdate) ClearTest

func (qu *QuestionUpdate) ClearTest() *QuestionUpdate

ClearTest clears all "test" edges to the Test entity.

func (*QuestionUpdate) ClearTranslations

func (qu *QuestionUpdate) ClearTranslations() *QuestionUpdate

ClearTranslations clears all "translations" edges to the QuestionTranslation entity.

func (*QuestionUpdate) Exec

func (qu *QuestionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*QuestionUpdate) ExecX

func (qu *QuestionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*QuestionUpdate) Mutation

func (qu *QuestionUpdate) Mutation() *QuestionMutation

Mutation returns the QuestionMutation object of the builder.

func (*QuestionUpdate) RemoveItemIDs

func (qu *QuestionUpdate) RemoveItemIDs(ids ...uuid.UUID) *QuestionUpdate

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*QuestionUpdate) RemoveItems

func (qu *QuestionUpdate) RemoveItems(i ...*Item) *QuestionUpdate

RemoveItems removes "items" edges to Item entities.

func (*QuestionUpdate) RemoveTest

func (qu *QuestionUpdate) RemoveTest(t ...*Test) *QuestionUpdate

RemoveTest removes "test" edges to Test entities.

func (*QuestionUpdate) RemoveTestIDs

func (qu *QuestionUpdate) RemoveTestIDs(ids ...uuid.UUID) *QuestionUpdate

RemoveTestIDs removes the "test" edge to Test entities by IDs.

func (*QuestionUpdate) RemoveTranslationIDs

func (qu *QuestionUpdate) RemoveTranslationIDs(ids ...uuid.UUID) *QuestionUpdate

RemoveTranslationIDs removes the "translations" edge to QuestionTranslation entities by IDs.

func (*QuestionUpdate) RemoveTranslations

func (qu *QuestionUpdate) RemoveTranslations(q ...*QuestionTranslation) *QuestionUpdate

RemoveTranslations removes "translations" edges to QuestionTranslation entities.

func (*QuestionUpdate) Save

func (qu *QuestionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*QuestionUpdate) SaveX

func (qu *QuestionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*QuestionUpdate) SetNillableOrder

func (qu *QuestionUpdate) SetNillableOrder(i *int) *QuestionUpdate

SetNillableOrder sets the "order" field if the given value is not nil.

func (*QuestionUpdate) SetNillableType

func (qu *QuestionUpdate) SetNillableType(q *question.Type) *QuestionUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*QuestionUpdate) SetOrder

func (qu *QuestionUpdate) SetOrder(i int) *QuestionUpdate

SetOrder sets the "order" field.

func (*QuestionUpdate) SetType

func (qu *QuestionUpdate) SetType(q question.Type) *QuestionUpdate

SetType sets the "type" field.

func (*QuestionUpdate) SetUpdateTime

func (qu *QuestionUpdate) SetUpdateTime(t time.Time) *QuestionUpdate

SetUpdateTime sets the "update_time" field.

func (*QuestionUpdate) Where

func (qu *QuestionUpdate) Where(ps ...predicate.Question) *QuestionUpdate

Where appends a list predicates to the QuestionUpdate builder.

type QuestionUpdateOne

type QuestionUpdateOne struct {
	// contains filtered or unexported fields
}

QuestionUpdateOne is the builder for updating a single Question entity.

func (*QuestionUpdateOne) AddItemIDs

func (quo *QuestionUpdateOne) AddItemIDs(ids ...uuid.UUID) *QuestionUpdateOne

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*QuestionUpdateOne) AddItems

func (quo *QuestionUpdateOne) AddItems(i ...*Item) *QuestionUpdateOne

AddItems adds the "items" edges to the Item entity.

func (*QuestionUpdateOne) AddOrder

func (quo *QuestionUpdateOne) AddOrder(i int) *QuestionUpdateOne

AddOrder adds i to the "order" field.

func (*QuestionUpdateOne) AddTest

func (quo *QuestionUpdateOne) AddTest(t ...*Test) *QuestionUpdateOne

AddTest adds the "test" edges to the Test entity.

func (*QuestionUpdateOne) AddTestIDs

func (quo *QuestionUpdateOne) AddTestIDs(ids ...uuid.UUID) *QuestionUpdateOne

AddTestIDs adds the "test" edge to the Test entity by IDs.

func (*QuestionUpdateOne) AddTranslationIDs

func (quo *QuestionUpdateOne) AddTranslationIDs(ids ...uuid.UUID) *QuestionUpdateOne

AddTranslationIDs adds the "translations" edge to the QuestionTranslation entity by IDs.

func (*QuestionUpdateOne) AddTranslations

func (quo *QuestionUpdateOne) AddTranslations(q ...*QuestionTranslation) *QuestionUpdateOne

AddTranslations adds the "translations" edges to the QuestionTranslation entity.

func (*QuestionUpdateOne) ClearItems

func (quo *QuestionUpdateOne) ClearItems() *QuestionUpdateOne

ClearItems clears all "items" edges to the Item entity.

func (*QuestionUpdateOne) ClearTest

func (quo *QuestionUpdateOne) ClearTest() *QuestionUpdateOne

ClearTest clears all "test" edges to the Test entity.

func (*QuestionUpdateOne) ClearTranslations

func (quo *QuestionUpdateOne) ClearTranslations() *QuestionUpdateOne

ClearTranslations clears all "translations" edges to the QuestionTranslation entity.

func (*QuestionUpdateOne) Exec

func (quo *QuestionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*QuestionUpdateOne) ExecX

func (quo *QuestionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*QuestionUpdateOne) Mutation

func (quo *QuestionUpdateOne) Mutation() *QuestionMutation

Mutation returns the QuestionMutation object of the builder.

func (*QuestionUpdateOne) RemoveItemIDs

func (quo *QuestionUpdateOne) RemoveItemIDs(ids ...uuid.UUID) *QuestionUpdateOne

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*QuestionUpdateOne) RemoveItems

func (quo *QuestionUpdateOne) RemoveItems(i ...*Item) *QuestionUpdateOne

RemoveItems removes "items" edges to Item entities.

func (*QuestionUpdateOne) RemoveTest

func (quo *QuestionUpdateOne) RemoveTest(t ...*Test) *QuestionUpdateOne

RemoveTest removes "test" edges to Test entities.

func (*QuestionUpdateOne) RemoveTestIDs

func (quo *QuestionUpdateOne) RemoveTestIDs(ids ...uuid.UUID) *QuestionUpdateOne

RemoveTestIDs removes the "test" edge to Test entities by IDs.

func (*QuestionUpdateOne) RemoveTranslationIDs

func (quo *QuestionUpdateOne) RemoveTranslationIDs(ids ...uuid.UUID) *QuestionUpdateOne

RemoveTranslationIDs removes the "translations" edge to QuestionTranslation entities by IDs.

func (*QuestionUpdateOne) RemoveTranslations

func (quo *QuestionUpdateOne) RemoveTranslations(q ...*QuestionTranslation) *QuestionUpdateOne

RemoveTranslations removes "translations" edges to QuestionTranslation entities.

func (*QuestionUpdateOne) Save

func (quo *QuestionUpdateOne) Save(ctx context.Context) (*Question, error)

Save executes the query and returns the updated Question entity.

func (*QuestionUpdateOne) SaveX

func (quo *QuestionUpdateOne) SaveX(ctx context.Context) *Question

SaveX is like Save, but panics if an error occurs.

func (*QuestionUpdateOne) Select

func (quo *QuestionUpdateOne) Select(field string, fields ...string) *QuestionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*QuestionUpdateOne) SetNillableOrder

func (quo *QuestionUpdateOne) SetNillableOrder(i *int) *QuestionUpdateOne

SetNillableOrder sets the "order" field if the given value is not nil.

func (*QuestionUpdateOne) SetNillableType

func (quo *QuestionUpdateOne) SetNillableType(q *question.Type) *QuestionUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*QuestionUpdateOne) SetOrder

func (quo *QuestionUpdateOne) SetOrder(i int) *QuestionUpdateOne

SetOrder sets the "order" field.

func (*QuestionUpdateOne) SetType

SetType sets the "type" field.

func (*QuestionUpdateOne) SetUpdateTime

func (quo *QuestionUpdateOne) SetUpdateTime(t time.Time) *QuestionUpdateOne

SetUpdateTime sets the "update_time" field.

type Questions

type Questions []*Question

Questions is a parsable slice of Question.

type Response

type Response struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Value holds the value of the "value" field.
	Value int `json:"value,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ResponseQuery when eager-loading is set.
	Edges ResponseEdges `json:"edges"`
	// contains filtered or unexported fields
}

Response is the model entity for the Response schema.

func (*Response) QueryItem

func (r *Response) QueryItem() *ItemQuery

QueryItem queries the "item" edge of the Response entity.

func (*Response) QueryTake

func (r *Response) QueryTake() *TakeQuery

QueryTake queries the "take" edge of the Response entity.

func (*Response) String

func (r *Response) String() string

String implements the fmt.Stringer.

func (*Response) Unwrap

func (r *Response) Unwrap() *Response

Unwrap unwraps the Response 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 (*Response) Update

func (r *Response) Update() *ResponseUpdateOne

Update returns a builder for updating this Response. Note that you need to call Response.Unwrap() before calling this method if this Response was returned from a transaction, and the transaction was committed or rolled back.

type ResponseClient

type ResponseClient struct {
	// contains filtered or unexported fields
}

ResponseClient is a client for the Response schema.

func NewResponseClient

func NewResponseClient(c config) *ResponseClient

NewResponseClient returns a client for the Response from the given config.

func (*ResponseClient) Create

func (c *ResponseClient) Create() *ResponseCreate

Create returns a builder for creating a Response entity.

func (*ResponseClient) CreateBulk

func (c *ResponseClient) CreateBulk(builders ...*ResponseCreate) *ResponseCreateBulk

CreateBulk returns a builder for creating a bulk of Response entities.

func (*ResponseClient) Delete

func (c *ResponseClient) Delete() *ResponseDelete

Delete returns a delete builder for Response.

func (*ResponseClient) DeleteOne

func (c *ResponseClient) DeleteOne(r *Response) *ResponseDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ResponseClient) DeleteOneID

func (c *ResponseClient) DeleteOneID(id uuid.UUID) *ResponseDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*ResponseClient) Get

func (c *ResponseClient) Get(ctx context.Context, id uuid.UUID) (*Response, error)

Get returns a Response entity by its id.

func (*ResponseClient) GetX

func (c *ResponseClient) GetX(ctx context.Context, id uuid.UUID) *Response

GetX is like Get, but panics if an error occurs.

func (*ResponseClient) Hooks

func (c *ResponseClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ResponseClient) Query

func (c *ResponseClient) Query() *ResponseQuery

Query returns a query builder for Response.

func (*ResponseClient) QueryItem

func (c *ResponseClient) QueryItem(r *Response) *ItemQuery

QueryItem queries the item edge of a Response.

func (*ResponseClient) QueryTake

func (c *ResponseClient) QueryTake(r *Response) *TakeQuery

QueryTake queries the take edge of a Response.

func (*ResponseClient) Update

func (c *ResponseClient) Update() *ResponseUpdate

Update returns an update builder for Response.

func (*ResponseClient) UpdateOne

func (c *ResponseClient) UpdateOne(r *Response) *ResponseUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ResponseClient) UpdateOneID

func (c *ResponseClient) UpdateOneID(id uuid.UUID) *ResponseUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ResponseClient) Use

func (c *ResponseClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `response.Hooks(f(g(h())))`.

type ResponseCreate

type ResponseCreate struct {
	// contains filtered or unexported fields
}

ResponseCreate is the builder for creating a Response entity.

func (*ResponseCreate) Exec

func (rc *ResponseCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResponseCreate) ExecX

func (rc *ResponseCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResponseCreate) Mutation

func (rc *ResponseCreate) Mutation() *ResponseMutation

Mutation returns the ResponseMutation object of the builder.

func (*ResponseCreate) Save

func (rc *ResponseCreate) Save(ctx context.Context) (*Response, error)

Save creates the Response in the database.

func (*ResponseCreate) SaveX

func (rc *ResponseCreate) SaveX(ctx context.Context) *Response

SaveX calls Save and panics if Save returns an error.

func (*ResponseCreate) SetCreateTime

func (rc *ResponseCreate) SetCreateTime(t time.Time) *ResponseCreate

SetCreateTime sets the "create_time" field.

func (*ResponseCreate) SetID

func (rc *ResponseCreate) SetID(u uuid.UUID) *ResponseCreate

SetID sets the "id" field.

func (*ResponseCreate) SetItem

func (rc *ResponseCreate) SetItem(i *Item) *ResponseCreate

SetItem sets the "item" edge to the Item entity.

func (*ResponseCreate) SetItemID

func (rc *ResponseCreate) SetItemID(id uuid.UUID) *ResponseCreate

SetItemID sets the "item" edge to the Item entity by ID.

func (*ResponseCreate) SetMeta

func (rc *ResponseCreate) SetMeta(m map[string]interface{}) *ResponseCreate

SetMeta sets the "meta" field.

func (*ResponseCreate) SetNillableCreateTime

func (rc *ResponseCreate) SetNillableCreateTime(t *time.Time) *ResponseCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ResponseCreate) SetNillableID

func (rc *ResponseCreate) SetNillableID(u *uuid.UUID) *ResponseCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ResponseCreate) SetNillableUpdateTime

func (rc *ResponseCreate) SetNillableUpdateTime(t *time.Time) *ResponseCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ResponseCreate) SetNillableValue

func (rc *ResponseCreate) SetNillableValue(i *int) *ResponseCreate

SetNillableValue sets the "value" field if the given value is not nil.

func (*ResponseCreate) SetTake

func (rc *ResponseCreate) SetTake(t *Take) *ResponseCreate

SetTake sets the "take" edge to the Take entity.

func (*ResponseCreate) SetTakeID

func (rc *ResponseCreate) SetTakeID(id uuid.UUID) *ResponseCreate

SetTakeID sets the "take" edge to the Take entity by ID.

func (*ResponseCreate) SetUpdateTime

func (rc *ResponseCreate) SetUpdateTime(t time.Time) *ResponseCreate

SetUpdateTime sets the "update_time" field.

func (*ResponseCreate) SetValue

func (rc *ResponseCreate) SetValue(i int) *ResponseCreate

SetValue sets the "value" field.

type ResponseCreateBulk

type ResponseCreateBulk struct {
	// contains filtered or unexported fields
}

ResponseCreateBulk is the builder for creating many Response entities in bulk.

func (*ResponseCreateBulk) Exec

func (rcb *ResponseCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ResponseCreateBulk) ExecX

func (rcb *ResponseCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResponseCreateBulk) Save

func (rcb *ResponseCreateBulk) Save(ctx context.Context) ([]*Response, error)

Save creates the Response entities in the database.

func (*ResponseCreateBulk) SaveX

func (rcb *ResponseCreateBulk) SaveX(ctx context.Context) []*Response

SaveX is like Save, but panics if an error occurs.

type ResponseDelete

type ResponseDelete struct {
	// contains filtered or unexported fields
}

ResponseDelete is the builder for deleting a Response entity.

func (*ResponseDelete) Exec

func (rd *ResponseDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ResponseDelete) ExecX

func (rd *ResponseDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ResponseDelete) Where

func (rd *ResponseDelete) Where(ps ...predicate.Response) *ResponseDelete

Where appends a list predicates to the ResponseDelete builder.

type ResponseDeleteOne

type ResponseDeleteOne struct {
	// contains filtered or unexported fields
}

ResponseDeleteOne is the builder for deleting a single Response entity.

func (*ResponseDeleteOne) Exec

func (rdo *ResponseDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ResponseDeleteOne) ExecX

func (rdo *ResponseDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ResponseEdges

type ResponseEdges struct {
	// Item holds the value of the item edge.
	Item *Item `json:"item,omitempty"`
	// Take holds the value of the take edge.
	Take *Take `json:"take,omitempty"`
	// contains filtered or unexported fields
}

ResponseEdges holds the relations/edges for other nodes in the graph.

func (ResponseEdges) ItemOrErr

func (e ResponseEdges) ItemOrErr() (*Item, error)

ItemOrErr returns the Item value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ResponseEdges) TakeOrErr

func (e ResponseEdges) TakeOrErr() (*Take, error)

TakeOrErr returns the Take value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ResponseGroupBy

type ResponseGroupBy struct {
	// contains filtered or unexported fields
}

ResponseGroupBy is the group-by builder for Response entities.

func (*ResponseGroupBy) Aggregate

func (rgb *ResponseGroupBy) Aggregate(fns ...AggregateFunc) *ResponseGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ResponseGroupBy) Bool

func (s *ResponseGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ResponseGroupBy) BoolX

func (s *ResponseGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ResponseGroupBy) Bools

func (s *ResponseGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ResponseGroupBy) BoolsX

func (s *ResponseGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ResponseGroupBy) Float64

func (s *ResponseGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ResponseGroupBy) Float64X

func (s *ResponseGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ResponseGroupBy) Float64s

func (s *ResponseGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ResponseGroupBy) Float64sX

func (s *ResponseGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ResponseGroupBy) Int

func (s *ResponseGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ResponseGroupBy) IntX

func (s *ResponseGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ResponseGroupBy) Ints

func (s *ResponseGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ResponseGroupBy) IntsX

func (s *ResponseGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ResponseGroupBy) Scan

func (rgb *ResponseGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ResponseGroupBy) ScanX

func (s *ResponseGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ResponseGroupBy) String

func (s *ResponseGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ResponseGroupBy) StringX

func (s *ResponseGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ResponseGroupBy) Strings

func (s *ResponseGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ResponseGroupBy) StringsX

func (s *ResponseGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ResponseMutation

type ResponseMutation struct {
	// contains filtered or unexported fields
}

ResponseMutation represents an operation that mutates the Response nodes in the graph.

func (*ResponseMutation) AddField

func (m *ResponseMutation) 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 (*ResponseMutation) AddValue

func (m *ResponseMutation) AddValue(i int)

AddValue adds i to the "value" field.

func (*ResponseMutation) AddedEdges

func (m *ResponseMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ResponseMutation) AddedField

func (m *ResponseMutation) 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 (*ResponseMutation) AddedFields

func (m *ResponseMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ResponseMutation) AddedIDs

func (m *ResponseMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ResponseMutation) AddedValue

func (m *ResponseMutation) AddedValue() (r int, exists bool)

AddedValue returns the value that was added to the "value" field in this mutation.

func (*ResponseMutation) ClearEdge

func (m *ResponseMutation) 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 (*ResponseMutation) ClearField

func (m *ResponseMutation) 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 (*ResponseMutation) ClearItem

func (m *ResponseMutation) ClearItem()

ClearItem clears the "item" edge to the Item entity.

func (*ResponseMutation) ClearMeta

func (m *ResponseMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*ResponseMutation) ClearTake

func (m *ResponseMutation) ClearTake()

ClearTake clears the "take" edge to the Take entity.

func (*ResponseMutation) ClearedEdges

func (m *ResponseMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ResponseMutation) ClearedFields

func (m *ResponseMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ResponseMutation) Client

func (m ResponseMutation) 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 (*ResponseMutation) CreateTime

func (m *ResponseMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ResponseMutation) EdgeCleared

func (m *ResponseMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ResponseMutation) Field

func (m *ResponseMutation) 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 (*ResponseMutation) FieldCleared

func (m *ResponseMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ResponseMutation) Fields

func (m *ResponseMutation) 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 (*ResponseMutation) ID

func (m *ResponseMutation) ID() (id uuid.UUID, 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 (*ResponseMutation) IDs

func (m *ResponseMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ResponseMutation) ItemCleared

func (m *ResponseMutation) ItemCleared() bool

ItemCleared reports if the "item" edge to the Item entity was cleared.

func (*ResponseMutation) ItemID

func (m *ResponseMutation) ItemID() (id uuid.UUID, exists bool)

ItemID returns the "item" edge ID in the mutation.

func (*ResponseMutation) ItemIDs

func (m *ResponseMutation) ItemIDs() (ids []uuid.UUID)

ItemIDs returns the "item" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ItemID instead. It exists only for internal usage by the builders.

func (*ResponseMutation) Meta

func (m *ResponseMutation) Meta() (r map[string]interface{}, exists bool)

Meta returns the value of the "meta" field in the mutation.

func (*ResponseMutation) MetaCleared

func (m *ResponseMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*ResponseMutation) OldCreateTime

func (m *ResponseMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Response entity. If the Response 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 (*ResponseMutation) OldField

func (m *ResponseMutation) 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 (*ResponseMutation) OldMeta

func (m *ResponseMutation) OldMeta(ctx context.Context) (v map[string]interface{}, err error)

OldMeta returns the old "meta" field's value of the Response entity. If the Response 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 (*ResponseMutation) OldUpdateTime

func (m *ResponseMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Response entity. If the Response 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 (*ResponseMutation) OldValue

func (m *ResponseMutation) OldValue(ctx context.Context) (v int, err error)

OldValue returns the old "value" field's value of the Response entity. If the Response 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 (*ResponseMutation) Op

func (m *ResponseMutation) Op() Op

Op returns the operation name.

func (*ResponseMutation) RemovedEdges

func (m *ResponseMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ResponseMutation) RemovedIDs

func (m *ResponseMutation) 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 (*ResponseMutation) ResetCreateTime

func (m *ResponseMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ResponseMutation) ResetEdge

func (m *ResponseMutation) 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 (*ResponseMutation) ResetField

func (m *ResponseMutation) 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 (*ResponseMutation) ResetItem

func (m *ResponseMutation) ResetItem()

ResetItem resets all changes to the "item" edge.

func (*ResponseMutation) ResetMeta

func (m *ResponseMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*ResponseMutation) ResetTake

func (m *ResponseMutation) ResetTake()

ResetTake resets all changes to the "take" edge.

func (*ResponseMutation) ResetUpdateTime

func (m *ResponseMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ResponseMutation) ResetValue

func (m *ResponseMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*ResponseMutation) SetCreateTime

func (m *ResponseMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ResponseMutation) SetField

func (m *ResponseMutation) 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 (*ResponseMutation) SetID

func (m *ResponseMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Response entities.

func (*ResponseMutation) SetItemID

func (m *ResponseMutation) SetItemID(id uuid.UUID)

SetItemID sets the "item" edge to the Item entity by id.

func (*ResponseMutation) SetMeta

func (m *ResponseMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*ResponseMutation) SetTakeID

func (m *ResponseMutation) SetTakeID(id uuid.UUID)

SetTakeID sets the "take" edge to the Take entity by id.

func (*ResponseMutation) SetUpdateTime

func (m *ResponseMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ResponseMutation) SetValue

func (m *ResponseMutation) SetValue(i int)

SetValue sets the "value" field.

func (*ResponseMutation) TakeCleared

func (m *ResponseMutation) TakeCleared() bool

TakeCleared reports if the "take" edge to the Take entity was cleared.

func (*ResponseMutation) TakeID

func (m *ResponseMutation) TakeID() (id uuid.UUID, exists bool)

TakeID returns the "take" edge ID in the mutation.

func (*ResponseMutation) TakeIDs

func (m *ResponseMutation) TakeIDs() (ids []uuid.UUID)

TakeIDs returns the "take" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TakeID instead. It exists only for internal usage by the builders.

func (ResponseMutation) Tx

func (m ResponseMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ResponseMutation) Type

func (m *ResponseMutation) Type() string

Type returns the node type of this mutation (Response).

func (*ResponseMutation) UpdateTime

func (m *ResponseMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ResponseMutation) Value

func (m *ResponseMutation) Value() (r int, exists bool)

Value returns the value of the "value" field in the mutation.

func (*ResponseMutation) Where

func (m *ResponseMutation) Where(ps ...predicate.Response)

Where appends a list predicates to the ResponseMutation builder.

type ResponseQuery

type ResponseQuery struct {
	// contains filtered or unexported fields
}

ResponseQuery is the builder for querying Response entities.

func (*ResponseQuery) All

func (rq *ResponseQuery) All(ctx context.Context) ([]*Response, error)

All executes the query and returns a list of Responses.

func (*ResponseQuery) AllX

func (rq *ResponseQuery) AllX(ctx context.Context) []*Response

AllX is like All, but panics if an error occurs.

func (*ResponseQuery) Clone

func (rq *ResponseQuery) Clone() *ResponseQuery

Clone returns a duplicate of the ResponseQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ResponseQuery) Count

func (rq *ResponseQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ResponseQuery) CountX

func (rq *ResponseQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ResponseQuery) Exist

func (rq *ResponseQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ResponseQuery) ExistX

func (rq *ResponseQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ResponseQuery) First

func (rq *ResponseQuery) First(ctx context.Context) (*Response, error)

First returns the first Response entity from the query. Returns a *NotFoundError when no Response was found.

func (*ResponseQuery) FirstID

func (rq *ResponseQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Response ID from the query. Returns a *NotFoundError when no Response ID was found.

func (*ResponseQuery) FirstIDX

func (rq *ResponseQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ResponseQuery) FirstX

func (rq *ResponseQuery) FirstX(ctx context.Context) *Response

FirstX is like First, but panics if an error occurs.

func (*ResponseQuery) GroupBy

func (rq *ResponseQuery) GroupBy(field string, fields ...string) *ResponseGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Response.Query().
	GroupBy(response.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ResponseQuery) IDs

func (rq *ResponseQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Response IDs.

func (*ResponseQuery) IDsX

func (rq *ResponseQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ResponseQuery) Limit

func (rq *ResponseQuery) Limit(limit int) *ResponseQuery

Limit adds a limit step to the query.

func (*ResponseQuery) Offset

func (rq *ResponseQuery) Offset(offset int) *ResponseQuery

Offset adds an offset step to the query.

func (*ResponseQuery) Only

func (rq *ResponseQuery) Only(ctx context.Context) (*Response, error)

Only returns a single Response entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Response entity is found. Returns a *NotFoundError when no Response entities are found.

func (*ResponseQuery) OnlyID

func (rq *ResponseQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Response ID in the query. Returns a *NotSingularError when more than one Response ID is found. Returns a *NotFoundError when no entities are found.

func (*ResponseQuery) OnlyIDX

func (rq *ResponseQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ResponseQuery) OnlyX

func (rq *ResponseQuery) OnlyX(ctx context.Context) *Response

OnlyX is like Only, but panics if an error occurs.

func (*ResponseQuery) Order

func (rq *ResponseQuery) Order(o ...OrderFunc) *ResponseQuery

Order adds an order step to the query.

func (*ResponseQuery) QueryItem

func (rq *ResponseQuery) QueryItem() *ItemQuery

QueryItem chains the current query on the "item" edge.

func (*ResponseQuery) QueryTake

func (rq *ResponseQuery) QueryTake() *TakeQuery

QueryTake chains the current query on the "take" edge.

func (*ResponseQuery) Select

func (rq *ResponseQuery) Select(fields ...string) *ResponseSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Response.Query().
	Select(response.FieldCreateTime).
	Scan(ctx, &v)

func (*ResponseQuery) Unique

func (rq *ResponseQuery) Unique(unique bool) *ResponseQuery

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 (*ResponseQuery) Where

func (rq *ResponseQuery) Where(ps ...predicate.Response) *ResponseQuery

Where adds a new predicate for the ResponseQuery builder.

func (*ResponseQuery) WithItem

func (rq *ResponseQuery) WithItem(opts ...func(*ItemQuery)) *ResponseQuery

WithItem tells the query-builder to eager-load the nodes that are connected to the "item" edge. The optional arguments are used to configure the query builder of the edge.

func (*ResponseQuery) WithTake

func (rq *ResponseQuery) WithTake(opts ...func(*TakeQuery)) *ResponseQuery

WithTake tells the query-builder to eager-load the nodes that are connected to the "take" edge. The optional arguments are used to configure the query builder of the edge.

type ResponseSelect

type ResponseSelect struct {
	*ResponseQuery
	// contains filtered or unexported fields
}

ResponseSelect is the builder for selecting fields of Response entities.

func (*ResponseSelect) Bool

func (s *ResponseSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) BoolX

func (s *ResponseSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ResponseSelect) Bools

func (s *ResponseSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) BoolsX

func (s *ResponseSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ResponseSelect) Float64

func (s *ResponseSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) Float64X

func (s *ResponseSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ResponseSelect) Float64s

func (s *ResponseSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) Float64sX

func (s *ResponseSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ResponseSelect) Int

func (s *ResponseSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) IntX

func (s *ResponseSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ResponseSelect) Ints

func (s *ResponseSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) IntsX

func (s *ResponseSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ResponseSelect) Scan

func (rs *ResponseSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*ResponseSelect) ScanX

func (s *ResponseSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ResponseSelect) String

func (s *ResponseSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) StringX

func (s *ResponseSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ResponseSelect) Strings

func (s *ResponseSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ResponseSelect) StringsX

func (s *ResponseSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ResponseUpdate

type ResponseUpdate struct {
	// contains filtered or unexported fields
}

ResponseUpdate is the builder for updating Response entities.

func (*ResponseUpdate) AddValue

func (ru *ResponseUpdate) AddValue(i int) *ResponseUpdate

AddValue adds i to the "value" field.

func (*ResponseUpdate) ClearItem

func (ru *ResponseUpdate) ClearItem() *ResponseUpdate

ClearItem clears the "item" edge to the Item entity.

func (*ResponseUpdate) ClearMeta

func (ru *ResponseUpdate) ClearMeta() *ResponseUpdate

ClearMeta clears the value of the "meta" field.

func (*ResponseUpdate) ClearTake

func (ru *ResponseUpdate) ClearTake() *ResponseUpdate

ClearTake clears the "take" edge to the Take entity.

func (*ResponseUpdate) Exec

func (ru *ResponseUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResponseUpdate) ExecX

func (ru *ResponseUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResponseUpdate) Mutation

func (ru *ResponseUpdate) Mutation() *ResponseMutation

Mutation returns the ResponseMutation object of the builder.

func (*ResponseUpdate) Save

func (ru *ResponseUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ResponseUpdate) SaveX

func (ru *ResponseUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ResponseUpdate) SetItem

func (ru *ResponseUpdate) SetItem(i *Item) *ResponseUpdate

SetItem sets the "item" edge to the Item entity.

func (*ResponseUpdate) SetItemID

func (ru *ResponseUpdate) SetItemID(id uuid.UUID) *ResponseUpdate

SetItemID sets the "item" edge to the Item entity by ID.

func (*ResponseUpdate) SetMeta

func (ru *ResponseUpdate) SetMeta(m map[string]interface{}) *ResponseUpdate

SetMeta sets the "meta" field.

func (*ResponseUpdate) SetNillableValue

func (ru *ResponseUpdate) SetNillableValue(i *int) *ResponseUpdate

SetNillableValue sets the "value" field if the given value is not nil.

func (*ResponseUpdate) SetTake

func (ru *ResponseUpdate) SetTake(t *Take) *ResponseUpdate

SetTake sets the "take" edge to the Take entity.

func (*ResponseUpdate) SetTakeID

func (ru *ResponseUpdate) SetTakeID(id uuid.UUID) *ResponseUpdate

SetTakeID sets the "take" edge to the Take entity by ID.

func (*ResponseUpdate) SetUpdateTime

func (ru *ResponseUpdate) SetUpdateTime(t time.Time) *ResponseUpdate

SetUpdateTime sets the "update_time" field.

func (*ResponseUpdate) SetValue

func (ru *ResponseUpdate) SetValue(i int) *ResponseUpdate

SetValue sets the "value" field.

func (*ResponseUpdate) Where

func (ru *ResponseUpdate) Where(ps ...predicate.Response) *ResponseUpdate

Where appends a list predicates to the ResponseUpdate builder.

type ResponseUpdateOne

type ResponseUpdateOne struct {
	// contains filtered or unexported fields
}

ResponseUpdateOne is the builder for updating a single Response entity.

func (*ResponseUpdateOne) AddValue

func (ruo *ResponseUpdateOne) AddValue(i int) *ResponseUpdateOne

AddValue adds i to the "value" field.

func (*ResponseUpdateOne) ClearItem

func (ruo *ResponseUpdateOne) ClearItem() *ResponseUpdateOne

ClearItem clears the "item" edge to the Item entity.

func (*ResponseUpdateOne) ClearMeta

func (ruo *ResponseUpdateOne) ClearMeta() *ResponseUpdateOne

ClearMeta clears the value of the "meta" field.

func (*ResponseUpdateOne) ClearTake

func (ruo *ResponseUpdateOne) ClearTake() *ResponseUpdateOne

ClearTake clears the "take" edge to the Take entity.

func (*ResponseUpdateOne) Exec

func (ruo *ResponseUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ResponseUpdateOne) ExecX

func (ruo *ResponseUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResponseUpdateOne) Mutation

func (ruo *ResponseUpdateOne) Mutation() *ResponseMutation

Mutation returns the ResponseMutation object of the builder.

func (*ResponseUpdateOne) Save

func (ruo *ResponseUpdateOne) Save(ctx context.Context) (*Response, error)

Save executes the query and returns the updated Response entity.

func (*ResponseUpdateOne) SaveX

func (ruo *ResponseUpdateOne) SaveX(ctx context.Context) *Response

SaveX is like Save, but panics if an error occurs.

func (*ResponseUpdateOne) Select

func (ruo *ResponseUpdateOne) Select(field string, fields ...string) *ResponseUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ResponseUpdateOne) SetItem

func (ruo *ResponseUpdateOne) SetItem(i *Item) *ResponseUpdateOne

SetItem sets the "item" edge to the Item entity.

func (*ResponseUpdateOne) SetItemID

func (ruo *ResponseUpdateOne) SetItemID(id uuid.UUID) *ResponseUpdateOne

SetItemID sets the "item" edge to the Item entity by ID.

func (*ResponseUpdateOne) SetMeta

func (ruo *ResponseUpdateOne) SetMeta(m map[string]interface{}) *ResponseUpdateOne

SetMeta sets the "meta" field.

func (*ResponseUpdateOne) SetNillableValue

func (ruo *ResponseUpdateOne) SetNillableValue(i *int) *ResponseUpdateOne

SetNillableValue sets the "value" field if the given value is not nil.

func (*ResponseUpdateOne) SetTake

func (ruo *ResponseUpdateOne) SetTake(t *Take) *ResponseUpdateOne

SetTake sets the "take" edge to the Take entity.

func (*ResponseUpdateOne) SetTakeID

func (ruo *ResponseUpdateOne) SetTakeID(id uuid.UUID) *ResponseUpdateOne

SetTakeID sets the "take" edge to the Take entity by ID.

func (*ResponseUpdateOne) SetUpdateTime

func (ruo *ResponseUpdateOne) SetUpdateTime(t time.Time) *ResponseUpdateOne

SetUpdateTime sets the "update_time" field.

func (*ResponseUpdateOne) SetValue

func (ruo *ResponseUpdateOne) SetValue(i int) *ResponseUpdateOne

SetValue sets the "value" field.

type Responses

type Responses []*Response

Responses is a parsable slice of Response.

type Result

type Result struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// RawScore holds the value of the "raw_score" field.
	RawScore float64 `json:"raw_score,omitempty"`
	// FinalScore holds the value of the "final_score" field.
	FinalScore float64 `json:"final_score,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ResultQuery when eager-loading is set.
	Edges ResultEdges `json:"edges"`
	// contains filtered or unexported fields
}

Result is the model entity for the Result schema.

func (*Result) QueryScale

func (r *Result) QueryScale() *ScaleQuery

QueryScale queries the "scale" edge of the Result entity.

func (*Result) QueryTake

func (r *Result) QueryTake() *TakeQuery

QueryTake queries the "take" edge of the Result entity.

func (*Result) String

func (r *Result) String() string

String implements the fmt.Stringer.

func (*Result) Unwrap

func (r *Result) Unwrap() *Result

Unwrap unwraps the Result 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 (*Result) Update

func (r *Result) Update() *ResultUpdateOne

Update returns a builder for updating this Result. Note that you need to call Result.Unwrap() before calling this method if this Result was returned from a transaction, and the transaction was committed or rolled back.

type ResultClient

type ResultClient struct {
	// contains filtered or unexported fields
}

ResultClient is a client for the Result schema.

func NewResultClient

func NewResultClient(c config) *ResultClient

NewResultClient returns a client for the Result from the given config.

func (*ResultClient) Create

func (c *ResultClient) Create() *ResultCreate

Create returns a builder for creating a Result entity.

func (*ResultClient) CreateBulk

func (c *ResultClient) CreateBulk(builders ...*ResultCreate) *ResultCreateBulk

CreateBulk returns a builder for creating a bulk of Result entities.

func (*ResultClient) Delete

func (c *ResultClient) Delete() *ResultDelete

Delete returns a delete builder for Result.

func (*ResultClient) DeleteOne

func (c *ResultClient) DeleteOne(r *Result) *ResultDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ResultClient) DeleteOneID

func (c *ResultClient) DeleteOneID(id uuid.UUID) *ResultDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*ResultClient) Get

func (c *ResultClient) Get(ctx context.Context, id uuid.UUID) (*Result, error)

Get returns a Result entity by its id.

func (*ResultClient) GetX

func (c *ResultClient) GetX(ctx context.Context, id uuid.UUID) *Result

GetX is like Get, but panics if an error occurs.

func (*ResultClient) Hooks

func (c *ResultClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ResultClient) Query

func (c *ResultClient) Query() *ResultQuery

Query returns a query builder for Result.

func (*ResultClient) QueryScale

func (c *ResultClient) QueryScale(r *Result) *ScaleQuery

QueryScale queries the scale edge of a Result.

func (*ResultClient) QueryTake

func (c *ResultClient) QueryTake(r *Result) *TakeQuery

QueryTake queries the take edge of a Result.

func (*ResultClient) Update

func (c *ResultClient) Update() *ResultUpdate

Update returns an update builder for Result.

func (*ResultClient) UpdateOne

func (c *ResultClient) UpdateOne(r *Result) *ResultUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ResultClient) UpdateOneID

func (c *ResultClient) UpdateOneID(id uuid.UUID) *ResultUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ResultClient) Use

func (c *ResultClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `result.Hooks(f(g(h())))`.

type ResultCreate

type ResultCreate struct {
	// contains filtered or unexported fields
}

ResultCreate is the builder for creating a Result entity.

func (*ResultCreate) Exec

func (rc *ResultCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResultCreate) ExecX

func (rc *ResultCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResultCreate) Mutation

func (rc *ResultCreate) Mutation() *ResultMutation

Mutation returns the ResultMutation object of the builder.

func (*ResultCreate) Save

func (rc *ResultCreate) Save(ctx context.Context) (*Result, error)

Save creates the Result in the database.

func (*ResultCreate) SaveX

func (rc *ResultCreate) SaveX(ctx context.Context) *Result

SaveX calls Save and panics if Save returns an error.

func (*ResultCreate) SetCreateTime

func (rc *ResultCreate) SetCreateTime(t time.Time) *ResultCreate

SetCreateTime sets the "create_time" field.

func (*ResultCreate) SetFinalScore

func (rc *ResultCreate) SetFinalScore(f float64) *ResultCreate

SetFinalScore sets the "final_score" field.

func (*ResultCreate) SetID

func (rc *ResultCreate) SetID(u uuid.UUID) *ResultCreate

SetID sets the "id" field.

func (*ResultCreate) SetMeta

func (rc *ResultCreate) SetMeta(m map[string]interface{}) *ResultCreate

SetMeta sets the "meta" field.

func (*ResultCreate) SetNillableCreateTime

func (rc *ResultCreate) SetNillableCreateTime(t *time.Time) *ResultCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ResultCreate) SetNillableID

func (rc *ResultCreate) SetNillableID(u *uuid.UUID) *ResultCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ResultCreate) SetNillableUpdateTime

func (rc *ResultCreate) SetNillableUpdateTime(t *time.Time) *ResultCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ResultCreate) SetRawScore

func (rc *ResultCreate) SetRawScore(f float64) *ResultCreate

SetRawScore sets the "raw_score" field.

func (*ResultCreate) SetScale

func (rc *ResultCreate) SetScale(s *Scale) *ResultCreate

SetScale sets the "scale" edge to the Scale entity.

func (*ResultCreate) SetScaleID

func (rc *ResultCreate) SetScaleID(id uuid.UUID) *ResultCreate

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*ResultCreate) SetTake

func (rc *ResultCreate) SetTake(t *Take) *ResultCreate

SetTake sets the "take" edge to the Take entity.

func (*ResultCreate) SetTakeID

func (rc *ResultCreate) SetTakeID(id uuid.UUID) *ResultCreate

SetTakeID sets the "take" edge to the Take entity by ID.

func (*ResultCreate) SetUpdateTime

func (rc *ResultCreate) SetUpdateTime(t time.Time) *ResultCreate

SetUpdateTime sets the "update_time" field.

type ResultCreateBulk

type ResultCreateBulk struct {
	// contains filtered or unexported fields
}

ResultCreateBulk is the builder for creating many Result entities in bulk.

func (*ResultCreateBulk) Exec

func (rcb *ResultCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ResultCreateBulk) ExecX

func (rcb *ResultCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResultCreateBulk) Save

func (rcb *ResultCreateBulk) Save(ctx context.Context) ([]*Result, error)

Save creates the Result entities in the database.

func (*ResultCreateBulk) SaveX

func (rcb *ResultCreateBulk) SaveX(ctx context.Context) []*Result

SaveX is like Save, but panics if an error occurs.

type ResultDelete

type ResultDelete struct {
	// contains filtered or unexported fields
}

ResultDelete is the builder for deleting a Result entity.

func (*ResultDelete) Exec

func (rd *ResultDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ResultDelete) ExecX

func (rd *ResultDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ResultDelete) Where

func (rd *ResultDelete) Where(ps ...predicate.Result) *ResultDelete

Where appends a list predicates to the ResultDelete builder.

type ResultDeleteOne

type ResultDeleteOne struct {
	// contains filtered or unexported fields
}

ResultDeleteOne is the builder for deleting a single Result entity.

func (*ResultDeleteOne) Exec

func (rdo *ResultDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ResultDeleteOne) ExecX

func (rdo *ResultDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ResultEdges

type ResultEdges struct {
	// Scale holds the value of the scale edge.
	Scale *Scale `json:"scale,omitempty"`
	// Take holds the value of the take edge.
	Take *Take `json:"take,omitempty"`
	// contains filtered or unexported fields
}

ResultEdges holds the relations/edges for other nodes in the graph.

func (ResultEdges) ScaleOrErr

func (e ResultEdges) ScaleOrErr() (*Scale, error)

ScaleOrErr returns the Scale value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ResultEdges) TakeOrErr

func (e ResultEdges) TakeOrErr() (*Take, error)

TakeOrErr returns the Take value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ResultGroupBy

type ResultGroupBy struct {
	// contains filtered or unexported fields
}

ResultGroupBy is the group-by builder for Result entities.

func (*ResultGroupBy) Aggregate

func (rgb *ResultGroupBy) Aggregate(fns ...AggregateFunc) *ResultGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ResultGroupBy) Bool

func (s *ResultGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ResultGroupBy) BoolX

func (s *ResultGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ResultGroupBy) Bools

func (s *ResultGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ResultGroupBy) BoolsX

func (s *ResultGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ResultGroupBy) Float64

func (s *ResultGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ResultGroupBy) Float64X

func (s *ResultGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ResultGroupBy) Float64s

func (s *ResultGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ResultGroupBy) Float64sX

func (s *ResultGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ResultGroupBy) Int

func (s *ResultGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ResultGroupBy) IntX

func (s *ResultGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ResultGroupBy) Ints

func (s *ResultGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ResultGroupBy) IntsX

func (s *ResultGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ResultGroupBy) Scan

func (rgb *ResultGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ResultGroupBy) ScanX

func (s *ResultGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ResultGroupBy) String

func (s *ResultGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ResultGroupBy) StringX

func (s *ResultGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ResultGroupBy) Strings

func (s *ResultGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ResultGroupBy) StringsX

func (s *ResultGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ResultMutation

type ResultMutation struct {
	// contains filtered or unexported fields
}

ResultMutation represents an operation that mutates the Result nodes in the graph.

func (*ResultMutation) AddField

func (m *ResultMutation) 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 (*ResultMutation) AddFinalScore

func (m *ResultMutation) AddFinalScore(f float64)

AddFinalScore adds f to the "final_score" field.

func (*ResultMutation) AddRawScore

func (m *ResultMutation) AddRawScore(f float64)

AddRawScore adds f to the "raw_score" field.

func (*ResultMutation) AddedEdges

func (m *ResultMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ResultMutation) AddedField

func (m *ResultMutation) 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 (*ResultMutation) AddedFields

func (m *ResultMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ResultMutation) AddedFinalScore

func (m *ResultMutation) AddedFinalScore() (r float64, exists bool)

AddedFinalScore returns the value that was added to the "final_score" field in this mutation.

func (*ResultMutation) AddedIDs

func (m *ResultMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ResultMutation) AddedRawScore

func (m *ResultMutation) AddedRawScore() (r float64, exists bool)

AddedRawScore returns the value that was added to the "raw_score" field in this mutation.

func (*ResultMutation) ClearEdge

func (m *ResultMutation) 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 (*ResultMutation) ClearField

func (m *ResultMutation) 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 (*ResultMutation) ClearMeta

func (m *ResultMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*ResultMutation) ClearScale

func (m *ResultMutation) ClearScale()

ClearScale clears the "scale" edge to the Scale entity.

func (*ResultMutation) ClearTake

func (m *ResultMutation) ClearTake()

ClearTake clears the "take" edge to the Take entity.

func (*ResultMutation) ClearedEdges

func (m *ResultMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ResultMutation) ClearedFields

func (m *ResultMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ResultMutation) Client

func (m ResultMutation) 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 (*ResultMutation) CreateTime

func (m *ResultMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ResultMutation) EdgeCleared

func (m *ResultMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ResultMutation) Field

func (m *ResultMutation) 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 (*ResultMutation) FieldCleared

func (m *ResultMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ResultMutation) Fields

func (m *ResultMutation) 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 (*ResultMutation) FinalScore

func (m *ResultMutation) FinalScore() (r float64, exists bool)

FinalScore returns the value of the "final_score" field in the mutation.

func (*ResultMutation) ID

func (m *ResultMutation) ID() (id uuid.UUID, 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 (*ResultMutation) IDs

func (m *ResultMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ResultMutation) Meta

func (m *ResultMutation) Meta() (r map[string]interface{}, exists bool)

Meta returns the value of the "meta" field in the mutation.

func (*ResultMutation) MetaCleared

func (m *ResultMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*ResultMutation) OldCreateTime

func (m *ResultMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Result entity. If the Result 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 (*ResultMutation) OldField

func (m *ResultMutation) 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 (*ResultMutation) OldFinalScore

func (m *ResultMutation) OldFinalScore(ctx context.Context) (v float64, err error)

OldFinalScore returns the old "final_score" field's value of the Result entity. If the Result 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 (*ResultMutation) OldMeta

func (m *ResultMutation) OldMeta(ctx context.Context) (v map[string]interface{}, err error)

OldMeta returns the old "meta" field's value of the Result entity. If the Result 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 (*ResultMutation) OldRawScore

func (m *ResultMutation) OldRawScore(ctx context.Context) (v float64, err error)

OldRawScore returns the old "raw_score" field's value of the Result entity. If the Result 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 (*ResultMutation) OldUpdateTime

func (m *ResultMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Result entity. If the Result 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 (*ResultMutation) Op

func (m *ResultMutation) Op() Op

Op returns the operation name.

func (*ResultMutation) RawScore

func (m *ResultMutation) RawScore() (r float64, exists bool)

RawScore returns the value of the "raw_score" field in the mutation.

func (*ResultMutation) RemovedEdges

func (m *ResultMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ResultMutation) RemovedIDs

func (m *ResultMutation) 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 (*ResultMutation) ResetCreateTime

func (m *ResultMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ResultMutation) ResetEdge

func (m *ResultMutation) 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 (*ResultMutation) ResetField

func (m *ResultMutation) 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 (*ResultMutation) ResetFinalScore

func (m *ResultMutation) ResetFinalScore()

ResetFinalScore resets all changes to the "final_score" field.

func (*ResultMutation) ResetMeta

func (m *ResultMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*ResultMutation) ResetRawScore

func (m *ResultMutation) ResetRawScore()

ResetRawScore resets all changes to the "raw_score" field.

func (*ResultMutation) ResetScale

func (m *ResultMutation) ResetScale()

ResetScale resets all changes to the "scale" edge.

func (*ResultMutation) ResetTake

func (m *ResultMutation) ResetTake()

ResetTake resets all changes to the "take" edge.

func (*ResultMutation) ResetUpdateTime

func (m *ResultMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ResultMutation) ScaleCleared

func (m *ResultMutation) ScaleCleared() bool

ScaleCleared reports if the "scale" edge to the Scale entity was cleared.

func (*ResultMutation) ScaleID

func (m *ResultMutation) ScaleID() (id uuid.UUID, exists bool)

ScaleID returns the "scale" edge ID in the mutation.

func (*ResultMutation) ScaleIDs

func (m *ResultMutation) ScaleIDs() (ids []uuid.UUID)

ScaleIDs returns the "scale" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ScaleID instead. It exists only for internal usage by the builders.

func (*ResultMutation) SetCreateTime

func (m *ResultMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ResultMutation) SetField

func (m *ResultMutation) 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 (*ResultMutation) SetFinalScore

func (m *ResultMutation) SetFinalScore(f float64)

SetFinalScore sets the "final_score" field.

func (*ResultMutation) SetID

func (m *ResultMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Result entities.

func (*ResultMutation) SetMeta

func (m *ResultMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*ResultMutation) SetRawScore

func (m *ResultMutation) SetRawScore(f float64)

SetRawScore sets the "raw_score" field.

func (*ResultMutation) SetScaleID

func (m *ResultMutation) SetScaleID(id uuid.UUID)

SetScaleID sets the "scale" edge to the Scale entity by id.

func (*ResultMutation) SetTakeID

func (m *ResultMutation) SetTakeID(id uuid.UUID)

SetTakeID sets the "take" edge to the Take entity by id.

func (*ResultMutation) SetUpdateTime

func (m *ResultMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ResultMutation) TakeCleared

func (m *ResultMutation) TakeCleared() bool

TakeCleared reports if the "take" edge to the Take entity was cleared.

func (*ResultMutation) TakeID

func (m *ResultMutation) TakeID() (id uuid.UUID, exists bool)

TakeID returns the "take" edge ID in the mutation.

func (*ResultMutation) TakeIDs

func (m *ResultMutation) TakeIDs() (ids []uuid.UUID)

TakeIDs returns the "take" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TakeID instead. It exists only for internal usage by the builders.

func (ResultMutation) Tx

func (m ResultMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ResultMutation) Type

func (m *ResultMutation) Type() string

Type returns the node type of this mutation (Result).

func (*ResultMutation) UpdateTime

func (m *ResultMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ResultMutation) Where

func (m *ResultMutation) Where(ps ...predicate.Result)

Where appends a list predicates to the ResultMutation builder.

type ResultQuery

type ResultQuery struct {
	// contains filtered or unexported fields
}

ResultQuery is the builder for querying Result entities.

func (*ResultQuery) All

func (rq *ResultQuery) All(ctx context.Context) ([]*Result, error)

All executes the query and returns a list of Results.

func (*ResultQuery) AllX

func (rq *ResultQuery) AllX(ctx context.Context) []*Result

AllX is like All, but panics if an error occurs.

func (*ResultQuery) Clone

func (rq *ResultQuery) Clone() *ResultQuery

Clone returns a duplicate of the ResultQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ResultQuery) Count

func (rq *ResultQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ResultQuery) CountX

func (rq *ResultQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ResultQuery) Exist

func (rq *ResultQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ResultQuery) ExistX

func (rq *ResultQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ResultQuery) First

func (rq *ResultQuery) First(ctx context.Context) (*Result, error)

First returns the first Result entity from the query. Returns a *NotFoundError when no Result was found.

func (*ResultQuery) FirstID

func (rq *ResultQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Result ID from the query. Returns a *NotFoundError when no Result ID was found.

func (*ResultQuery) FirstIDX

func (rq *ResultQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ResultQuery) FirstX

func (rq *ResultQuery) FirstX(ctx context.Context) *Result

FirstX is like First, but panics if an error occurs.

func (*ResultQuery) GroupBy

func (rq *ResultQuery) GroupBy(field string, fields ...string) *ResultGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Result.Query().
	GroupBy(result.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ResultQuery) IDs

func (rq *ResultQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Result IDs.

func (*ResultQuery) IDsX

func (rq *ResultQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ResultQuery) Limit

func (rq *ResultQuery) Limit(limit int) *ResultQuery

Limit adds a limit step to the query.

func (*ResultQuery) Offset

func (rq *ResultQuery) Offset(offset int) *ResultQuery

Offset adds an offset step to the query.

func (*ResultQuery) Only

func (rq *ResultQuery) Only(ctx context.Context) (*Result, error)

Only returns a single Result entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Result entity is found. Returns a *NotFoundError when no Result entities are found.

func (*ResultQuery) OnlyID

func (rq *ResultQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Result ID in the query. Returns a *NotSingularError when more than one Result ID is found. Returns a *NotFoundError when no entities are found.

func (*ResultQuery) OnlyIDX

func (rq *ResultQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ResultQuery) OnlyX

func (rq *ResultQuery) OnlyX(ctx context.Context) *Result

OnlyX is like Only, but panics if an error occurs.

func (*ResultQuery) Order

func (rq *ResultQuery) Order(o ...OrderFunc) *ResultQuery

Order adds an order step to the query.

func (*ResultQuery) QueryScale

func (rq *ResultQuery) QueryScale() *ScaleQuery

QueryScale chains the current query on the "scale" edge.

func (*ResultQuery) QueryTake

func (rq *ResultQuery) QueryTake() *TakeQuery

QueryTake chains the current query on the "take" edge.

func (*ResultQuery) Select

func (rq *ResultQuery) Select(fields ...string) *ResultSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Result.Query().
	Select(result.FieldCreateTime).
	Scan(ctx, &v)

func (*ResultQuery) Unique

func (rq *ResultQuery) Unique(unique bool) *ResultQuery

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 (*ResultQuery) Where

func (rq *ResultQuery) Where(ps ...predicate.Result) *ResultQuery

Where adds a new predicate for the ResultQuery builder.

func (*ResultQuery) WithScale

func (rq *ResultQuery) WithScale(opts ...func(*ScaleQuery)) *ResultQuery

WithScale tells the query-builder to eager-load the nodes that are connected to the "scale" edge. The optional arguments are used to configure the query builder of the edge.

func (*ResultQuery) WithTake

func (rq *ResultQuery) WithTake(opts ...func(*TakeQuery)) *ResultQuery

WithTake tells the query-builder to eager-load the nodes that are connected to the "take" edge. The optional arguments are used to configure the query builder of the edge.

type ResultSelect

type ResultSelect struct {
	*ResultQuery
	// contains filtered or unexported fields
}

ResultSelect is the builder for selecting fields of Result entities.

func (*ResultSelect) Bool

func (s *ResultSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ResultSelect) BoolX

func (s *ResultSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ResultSelect) Bools

func (s *ResultSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ResultSelect) BoolsX

func (s *ResultSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ResultSelect) Float64

func (s *ResultSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ResultSelect) Float64X

func (s *ResultSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ResultSelect) Float64s

func (s *ResultSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ResultSelect) Float64sX

func (s *ResultSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ResultSelect) Int

func (s *ResultSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ResultSelect) IntX

func (s *ResultSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ResultSelect) Ints

func (s *ResultSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ResultSelect) IntsX

func (s *ResultSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ResultSelect) Scan

func (rs *ResultSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*ResultSelect) ScanX

func (s *ResultSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ResultSelect) String

func (s *ResultSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ResultSelect) StringX

func (s *ResultSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ResultSelect) Strings

func (s *ResultSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ResultSelect) StringsX

func (s *ResultSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ResultUpdate

type ResultUpdate struct {
	// contains filtered or unexported fields
}

ResultUpdate is the builder for updating Result entities.

func (*ResultUpdate) AddFinalScore

func (ru *ResultUpdate) AddFinalScore(f float64) *ResultUpdate

AddFinalScore adds f to the "final_score" field.

func (*ResultUpdate) AddRawScore

func (ru *ResultUpdate) AddRawScore(f float64) *ResultUpdate

AddRawScore adds f to the "raw_score" field.

func (*ResultUpdate) ClearMeta

func (ru *ResultUpdate) ClearMeta() *ResultUpdate

ClearMeta clears the value of the "meta" field.

func (*ResultUpdate) ClearScale

func (ru *ResultUpdate) ClearScale() *ResultUpdate

ClearScale clears the "scale" edge to the Scale entity.

func (*ResultUpdate) ClearTake

func (ru *ResultUpdate) ClearTake() *ResultUpdate

ClearTake clears the "take" edge to the Take entity.

func (*ResultUpdate) Exec

func (ru *ResultUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResultUpdate) ExecX

func (ru *ResultUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResultUpdate) Mutation

func (ru *ResultUpdate) Mutation() *ResultMutation

Mutation returns the ResultMutation object of the builder.

func (*ResultUpdate) Save

func (ru *ResultUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ResultUpdate) SaveX

func (ru *ResultUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ResultUpdate) SetFinalScore

func (ru *ResultUpdate) SetFinalScore(f float64) *ResultUpdate

SetFinalScore sets the "final_score" field.

func (*ResultUpdate) SetMeta

func (ru *ResultUpdate) SetMeta(m map[string]interface{}) *ResultUpdate

SetMeta sets the "meta" field.

func (*ResultUpdate) SetRawScore

func (ru *ResultUpdate) SetRawScore(f float64) *ResultUpdate

SetRawScore sets the "raw_score" field.

func (*ResultUpdate) SetScale

func (ru *ResultUpdate) SetScale(s *Scale) *ResultUpdate

SetScale sets the "scale" edge to the Scale entity.

func (*ResultUpdate) SetScaleID

func (ru *ResultUpdate) SetScaleID(id uuid.UUID) *ResultUpdate

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*ResultUpdate) SetTake

func (ru *ResultUpdate) SetTake(t *Take) *ResultUpdate

SetTake sets the "take" edge to the Take entity.

func (*ResultUpdate) SetTakeID

func (ru *ResultUpdate) SetTakeID(id uuid.UUID) *ResultUpdate

SetTakeID sets the "take" edge to the Take entity by ID.

func (*ResultUpdate) SetUpdateTime

func (ru *ResultUpdate) SetUpdateTime(t time.Time) *ResultUpdate

SetUpdateTime sets the "update_time" field.

func (*ResultUpdate) Where

func (ru *ResultUpdate) Where(ps ...predicate.Result) *ResultUpdate

Where appends a list predicates to the ResultUpdate builder.

type ResultUpdateOne

type ResultUpdateOne struct {
	// contains filtered or unexported fields
}

ResultUpdateOne is the builder for updating a single Result entity.

func (*ResultUpdateOne) AddFinalScore

func (ruo *ResultUpdateOne) AddFinalScore(f float64) *ResultUpdateOne

AddFinalScore adds f to the "final_score" field.

func (*ResultUpdateOne) AddRawScore

func (ruo *ResultUpdateOne) AddRawScore(f float64) *ResultUpdateOne

AddRawScore adds f to the "raw_score" field.

func (*ResultUpdateOne) ClearMeta

func (ruo *ResultUpdateOne) ClearMeta() *ResultUpdateOne

ClearMeta clears the value of the "meta" field.

func (*ResultUpdateOne) ClearScale

func (ruo *ResultUpdateOne) ClearScale() *ResultUpdateOne

ClearScale clears the "scale" edge to the Scale entity.

func (*ResultUpdateOne) ClearTake

func (ruo *ResultUpdateOne) ClearTake() *ResultUpdateOne

ClearTake clears the "take" edge to the Take entity.

func (*ResultUpdateOne) Exec

func (ruo *ResultUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ResultUpdateOne) ExecX

func (ruo *ResultUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResultUpdateOne) Mutation

func (ruo *ResultUpdateOne) Mutation() *ResultMutation

Mutation returns the ResultMutation object of the builder.

func (*ResultUpdateOne) Save

func (ruo *ResultUpdateOne) Save(ctx context.Context) (*Result, error)

Save executes the query and returns the updated Result entity.

func (*ResultUpdateOne) SaveX

func (ruo *ResultUpdateOne) SaveX(ctx context.Context) *Result

SaveX is like Save, but panics if an error occurs.

func (*ResultUpdateOne) Select

func (ruo *ResultUpdateOne) Select(field string, fields ...string) *ResultUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ResultUpdateOne) SetFinalScore

func (ruo *ResultUpdateOne) SetFinalScore(f float64) *ResultUpdateOne

SetFinalScore sets the "final_score" field.

func (*ResultUpdateOne) SetMeta

func (ruo *ResultUpdateOne) SetMeta(m map[string]interface{}) *ResultUpdateOne

SetMeta sets the "meta" field.

func (*ResultUpdateOne) SetRawScore

func (ruo *ResultUpdateOne) SetRawScore(f float64) *ResultUpdateOne

SetRawScore sets the "raw_score" field.

func (*ResultUpdateOne) SetScale

func (ruo *ResultUpdateOne) SetScale(s *Scale) *ResultUpdateOne

SetScale sets the "scale" edge to the Scale entity.

func (*ResultUpdateOne) SetScaleID

func (ruo *ResultUpdateOne) SetScaleID(id uuid.UUID) *ResultUpdateOne

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*ResultUpdateOne) SetTake

func (ruo *ResultUpdateOne) SetTake(t *Take) *ResultUpdateOne

SetTake sets the "take" edge to the Take entity.

func (*ResultUpdateOne) SetTakeID

func (ruo *ResultUpdateOne) SetTakeID(id uuid.UUID) *ResultUpdateOne

SetTakeID sets the "take" edge to the Take entity by ID.

func (*ResultUpdateOne) SetUpdateTime

func (ruo *ResultUpdateOne) SetUpdateTime(t time.Time) *ResultUpdateOne

SetUpdateTime sets the "update_time" field.

type Results

type Results []*Result

Results is a parsable slice of Result.

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 Sample

type Sample struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Code holds the value of the "code" field.
	Code string `json:"code,omitempty"`
	// Criteria holds the value of the "criteria" field.
	Criteria domain.SampleCriteria `json:"criteria,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SampleQuery when eager-loading is set.
	Edges SampleEdges `json:"edges"`
	// contains filtered or unexported fields
}

Sample is the model entity for the Sample schema.

func (*Sample) QueryNorms

func (s *Sample) QueryNorms() *NormQuery

QueryNorms queries the "norms" edge of the Sample entity.

func (*Sample) String

func (s *Sample) String() string

String implements the fmt.Stringer.

func (*Sample) Unwrap

func (s *Sample) Unwrap() *Sample

Unwrap unwraps the Sample 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 (*Sample) Update

func (s *Sample) Update() *SampleUpdateOne

Update returns a builder for updating this Sample. Note that you need to call Sample.Unwrap() before calling this method if this Sample was returned from a transaction, and the transaction was committed or rolled back.

type SampleClient

type SampleClient struct {
	// contains filtered or unexported fields
}

SampleClient is a client for the Sample schema.

func NewSampleClient

func NewSampleClient(c config) *SampleClient

NewSampleClient returns a client for the Sample from the given config.

func (*SampleClient) Create

func (c *SampleClient) Create() *SampleCreate

Create returns a builder for creating a Sample entity.

func (*SampleClient) CreateBulk

func (c *SampleClient) CreateBulk(builders ...*SampleCreate) *SampleCreateBulk

CreateBulk returns a builder for creating a bulk of Sample entities.

func (*SampleClient) Delete

func (c *SampleClient) Delete() *SampleDelete

Delete returns a delete builder for Sample.

func (*SampleClient) DeleteOne

func (c *SampleClient) DeleteOne(s *Sample) *SampleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SampleClient) DeleteOneID

func (c *SampleClient) DeleteOneID(id uuid.UUID) *SampleDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*SampleClient) Get

func (c *SampleClient) Get(ctx context.Context, id uuid.UUID) (*Sample, error)

Get returns a Sample entity by its id.

func (*SampleClient) GetX

func (c *SampleClient) GetX(ctx context.Context, id uuid.UUID) *Sample

GetX is like Get, but panics if an error occurs.

func (*SampleClient) Hooks

func (c *SampleClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SampleClient) Query

func (c *SampleClient) Query() *SampleQuery

Query returns a query builder for Sample.

func (*SampleClient) QueryNorms

func (c *SampleClient) QueryNorms(s *Sample) *NormQuery

QueryNorms queries the norms edge of a Sample.

func (*SampleClient) Update

func (c *SampleClient) Update() *SampleUpdate

Update returns an update builder for Sample.

func (*SampleClient) UpdateOne

func (c *SampleClient) UpdateOne(s *Sample) *SampleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SampleClient) UpdateOneID

func (c *SampleClient) UpdateOneID(id uuid.UUID) *SampleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SampleClient) Use

func (c *SampleClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `sample.Hooks(f(g(h())))`.

type SampleCreate

type SampleCreate struct {
	// contains filtered or unexported fields
}

SampleCreate is the builder for creating a Sample entity.

func (*SampleCreate) AddNormIDs

func (sc *SampleCreate) AddNormIDs(ids ...uuid.UUID) *SampleCreate

AddNormIDs adds the "norms" edge to the Norm entity by IDs.

func (*SampleCreate) AddNorms

func (sc *SampleCreate) AddNorms(n ...*Norm) *SampleCreate

AddNorms adds the "norms" edges to the Norm entity.

func (*SampleCreate) Exec

func (sc *SampleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SampleCreate) ExecX

func (sc *SampleCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SampleCreate) Mutation

func (sc *SampleCreate) Mutation() *SampleMutation

Mutation returns the SampleMutation object of the builder.

func (*SampleCreate) Save

func (sc *SampleCreate) Save(ctx context.Context) (*Sample, error)

Save creates the Sample in the database.

func (*SampleCreate) SaveX

func (sc *SampleCreate) SaveX(ctx context.Context) *Sample

SaveX calls Save and panics if Save returns an error.

func (*SampleCreate) SetCode

func (sc *SampleCreate) SetCode(s string) *SampleCreate

SetCode sets the "code" field.

func (*SampleCreate) SetCreateTime

func (sc *SampleCreate) SetCreateTime(t time.Time) *SampleCreate

SetCreateTime sets the "create_time" field.

func (*SampleCreate) SetCriteria

func (sc *SampleCreate) SetCriteria(dc domain.SampleCriteria) *SampleCreate

SetCriteria sets the "criteria" field.

func (*SampleCreate) SetID

func (sc *SampleCreate) SetID(u uuid.UUID) *SampleCreate

SetID sets the "id" field.

func (*SampleCreate) SetNillableCreateTime

func (sc *SampleCreate) SetNillableCreateTime(t *time.Time) *SampleCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*SampleCreate) SetNillableID

func (sc *SampleCreate) SetNillableID(u *uuid.UUID) *SampleCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SampleCreate) SetNillableUpdateTime

func (sc *SampleCreate) SetNillableUpdateTime(t *time.Time) *SampleCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*SampleCreate) SetUpdateTime

func (sc *SampleCreate) SetUpdateTime(t time.Time) *SampleCreate

SetUpdateTime sets the "update_time" field.

type SampleCreateBulk

type SampleCreateBulk struct {
	// contains filtered or unexported fields
}

SampleCreateBulk is the builder for creating many Sample entities in bulk.

func (*SampleCreateBulk) Exec

func (scb *SampleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SampleCreateBulk) ExecX

func (scb *SampleCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SampleCreateBulk) Save

func (scb *SampleCreateBulk) Save(ctx context.Context) ([]*Sample, error)

Save creates the Sample entities in the database.

func (*SampleCreateBulk) SaveX

func (scb *SampleCreateBulk) SaveX(ctx context.Context) []*Sample

SaveX is like Save, but panics if an error occurs.

type SampleDelete

type SampleDelete struct {
	// contains filtered or unexported fields
}

SampleDelete is the builder for deleting a Sample entity.

func (*SampleDelete) Exec

func (sd *SampleDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SampleDelete) ExecX

func (sd *SampleDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SampleDelete) Where

func (sd *SampleDelete) Where(ps ...predicate.Sample) *SampleDelete

Where appends a list predicates to the SampleDelete builder.

type SampleDeleteOne

type SampleDeleteOne struct {
	// contains filtered or unexported fields
}

SampleDeleteOne is the builder for deleting a single Sample entity.

func (*SampleDeleteOne) Exec

func (sdo *SampleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SampleDeleteOne) ExecX

func (sdo *SampleDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type SampleEdges

type SampleEdges struct {
	// Norms holds the value of the norms edge.
	Norms []*Norm `json:"norms,omitempty"`
	// contains filtered or unexported fields
}

SampleEdges holds the relations/edges for other nodes in the graph.

func (SampleEdges) NormsOrErr

func (e SampleEdges) NormsOrErr() ([]*Norm, error)

NormsOrErr returns the Norms value or an error if the edge was not loaded in eager-loading.

type SampleGroupBy

type SampleGroupBy struct {
	// contains filtered or unexported fields
}

SampleGroupBy is the group-by builder for Sample entities.

func (*SampleGroupBy) Aggregate

func (sgb *SampleGroupBy) Aggregate(fns ...AggregateFunc) *SampleGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SampleGroupBy) Bool

func (s *SampleGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SampleGroupBy) BoolX

func (s *SampleGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SampleGroupBy) Bools

func (s *SampleGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SampleGroupBy) BoolsX

func (s *SampleGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SampleGroupBy) Float64

func (s *SampleGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SampleGroupBy) Float64X

func (s *SampleGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SampleGroupBy) Float64s

func (s *SampleGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SampleGroupBy) Float64sX

func (s *SampleGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SampleGroupBy) Int

func (s *SampleGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SampleGroupBy) IntX

func (s *SampleGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SampleGroupBy) Ints

func (s *SampleGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SampleGroupBy) IntsX

func (s *SampleGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SampleGroupBy) Scan

func (sgb *SampleGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*SampleGroupBy) ScanX

func (s *SampleGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*SampleGroupBy) String

func (s *SampleGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SampleGroupBy) StringX

func (s *SampleGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SampleGroupBy) Strings

func (s *SampleGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SampleGroupBy) StringsX

func (s *SampleGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SampleMutation

type SampleMutation struct {
	// contains filtered or unexported fields
}

SampleMutation represents an operation that mutates the Sample nodes in the graph.

func (*SampleMutation) AddField

func (m *SampleMutation) 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 (*SampleMutation) AddNormIDs

func (m *SampleMutation) AddNormIDs(ids ...uuid.UUID)

AddNormIDs adds the "norms" edge to the Norm entity by ids.

func (*SampleMutation) AddedEdges

func (m *SampleMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SampleMutation) AddedField

func (m *SampleMutation) 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 (*SampleMutation) AddedFields

func (m *SampleMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SampleMutation) AddedIDs

func (m *SampleMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SampleMutation) ClearEdge

func (m *SampleMutation) 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 (*SampleMutation) ClearField

func (m *SampleMutation) 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 (*SampleMutation) ClearNorms

func (m *SampleMutation) ClearNorms()

ClearNorms clears the "norms" edge to the Norm entity.

func (*SampleMutation) ClearedEdges

func (m *SampleMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SampleMutation) ClearedFields

func (m *SampleMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SampleMutation) Client

func (m SampleMutation) 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 (*SampleMutation) Code

func (m *SampleMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*SampleMutation) CreateTime

func (m *SampleMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*SampleMutation) Criteria

func (m *SampleMutation) Criteria() (r domain.SampleCriteria, exists bool)

Criteria returns the value of the "criteria" field in the mutation.

func (*SampleMutation) EdgeCleared

func (m *SampleMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SampleMutation) Field

func (m *SampleMutation) 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 (*SampleMutation) FieldCleared

func (m *SampleMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SampleMutation) Fields

func (m *SampleMutation) 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 (*SampleMutation) ID

func (m *SampleMutation) ID() (id uuid.UUID, 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 (*SampleMutation) IDs

func (m *SampleMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*SampleMutation) NormsCleared

func (m *SampleMutation) NormsCleared() bool

NormsCleared reports if the "norms" edge to the Norm entity was cleared.

func (*SampleMutation) NormsIDs

func (m *SampleMutation) NormsIDs() (ids []uuid.UUID)

NormsIDs returns the "norms" edge IDs in the mutation.

func (*SampleMutation) OldCode

func (m *SampleMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Sample entity. If the Sample 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 (*SampleMutation) OldCreateTime

func (m *SampleMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Sample entity. If the Sample 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 (*SampleMutation) OldCriteria

func (m *SampleMutation) OldCriteria(ctx context.Context) (v domain.SampleCriteria, err error)

OldCriteria returns the old "criteria" field's value of the Sample entity. If the Sample 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 (*SampleMutation) OldField

func (m *SampleMutation) 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 (*SampleMutation) OldUpdateTime

func (m *SampleMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Sample entity. If the Sample 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 (*SampleMutation) Op

func (m *SampleMutation) Op() Op

Op returns the operation name.

func (*SampleMutation) RemoveNormIDs

func (m *SampleMutation) RemoveNormIDs(ids ...uuid.UUID)

RemoveNormIDs removes the "norms" edge to the Norm entity by IDs.

func (*SampleMutation) RemovedEdges

func (m *SampleMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SampleMutation) RemovedIDs

func (m *SampleMutation) 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 (*SampleMutation) RemovedNormsIDs

func (m *SampleMutation) RemovedNormsIDs() (ids []uuid.UUID)

RemovedNorms returns the removed IDs of the "norms" edge to the Norm entity.

func (*SampleMutation) ResetCode

func (m *SampleMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*SampleMutation) ResetCreateTime

func (m *SampleMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*SampleMutation) ResetCriteria

func (m *SampleMutation) ResetCriteria()

ResetCriteria resets all changes to the "criteria" field.

func (*SampleMutation) ResetEdge

func (m *SampleMutation) 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 (*SampleMutation) ResetField

func (m *SampleMutation) 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 (*SampleMutation) ResetNorms

func (m *SampleMutation) ResetNorms()

ResetNorms resets all changes to the "norms" edge.

func (*SampleMutation) ResetUpdateTime

func (m *SampleMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*SampleMutation) SetCode

func (m *SampleMutation) SetCode(s string)

SetCode sets the "code" field.

func (*SampleMutation) SetCreateTime

func (m *SampleMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*SampleMutation) SetCriteria

func (m *SampleMutation) SetCriteria(dc domain.SampleCriteria)

SetCriteria sets the "criteria" field.

func (*SampleMutation) SetField

func (m *SampleMutation) 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 (*SampleMutation) SetID

func (m *SampleMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Sample entities.

func (*SampleMutation) SetUpdateTime

func (m *SampleMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (SampleMutation) Tx

func (m SampleMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SampleMutation) Type

func (m *SampleMutation) Type() string

Type returns the node type of this mutation (Sample).

func (*SampleMutation) UpdateTime

func (m *SampleMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*SampleMutation) Where

func (m *SampleMutation) Where(ps ...predicate.Sample)

Where appends a list predicates to the SampleMutation builder.

type SampleQuery

type SampleQuery struct {
	// contains filtered or unexported fields
}

SampleQuery is the builder for querying Sample entities.

func (*SampleQuery) All

func (sq *SampleQuery) All(ctx context.Context) ([]*Sample, error)

All executes the query and returns a list of Samples.

func (*SampleQuery) AllX

func (sq *SampleQuery) AllX(ctx context.Context) []*Sample

AllX is like All, but panics if an error occurs.

func (*SampleQuery) Clone

func (sq *SampleQuery) Clone() *SampleQuery

Clone returns a duplicate of the SampleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SampleQuery) Count

func (sq *SampleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SampleQuery) CountX

func (sq *SampleQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SampleQuery) Exist

func (sq *SampleQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SampleQuery) ExistX

func (sq *SampleQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SampleQuery) First

func (sq *SampleQuery) First(ctx context.Context) (*Sample, error)

First returns the first Sample entity from the query. Returns a *NotFoundError when no Sample was found.

func (*SampleQuery) FirstID

func (sq *SampleQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Sample ID from the query. Returns a *NotFoundError when no Sample ID was found.

func (*SampleQuery) FirstIDX

func (sq *SampleQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*SampleQuery) FirstX

func (sq *SampleQuery) FirstX(ctx context.Context) *Sample

FirstX is like First, but panics if an error occurs.

func (*SampleQuery) GroupBy

func (sq *SampleQuery) GroupBy(field string, fields ...string) *SampleGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Sample.Query().
	GroupBy(sample.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SampleQuery) IDs

func (sq *SampleQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Sample IDs.

func (*SampleQuery) IDsX

func (sq *SampleQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*SampleQuery) Limit

func (sq *SampleQuery) Limit(limit int) *SampleQuery

Limit adds a limit step to the query.

func (*SampleQuery) Offset

func (sq *SampleQuery) Offset(offset int) *SampleQuery

Offset adds an offset step to the query.

func (*SampleQuery) Only

func (sq *SampleQuery) Only(ctx context.Context) (*Sample, error)

Only returns a single Sample entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Sample entity is found. Returns a *NotFoundError when no Sample entities are found.

func (*SampleQuery) OnlyID

func (sq *SampleQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Sample ID in the query. Returns a *NotSingularError when more than one Sample ID is found. Returns a *NotFoundError when no entities are found.

func (*SampleQuery) OnlyIDX

func (sq *SampleQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SampleQuery) OnlyX

func (sq *SampleQuery) OnlyX(ctx context.Context) *Sample

OnlyX is like Only, but panics if an error occurs.

func (*SampleQuery) Order

func (sq *SampleQuery) Order(o ...OrderFunc) *SampleQuery

Order adds an order step to the query.

func (*SampleQuery) QueryNorms

func (sq *SampleQuery) QueryNorms() *NormQuery

QueryNorms chains the current query on the "norms" edge.

func (*SampleQuery) Select

func (sq *SampleQuery) Select(fields ...string) *SampleSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Sample.Query().
	Select(sample.FieldCreateTime).
	Scan(ctx, &v)

func (*SampleQuery) Unique

func (sq *SampleQuery) Unique(unique bool) *SampleQuery

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 (*SampleQuery) Where

func (sq *SampleQuery) Where(ps ...predicate.Sample) *SampleQuery

Where adds a new predicate for the SampleQuery builder.

func (*SampleQuery) WithNorms

func (sq *SampleQuery) WithNorms(opts ...func(*NormQuery)) *SampleQuery

WithNorms tells the query-builder to eager-load the nodes that are connected to the "norms" edge. The optional arguments are used to configure the query builder of the edge.

type SampleSelect

type SampleSelect struct {
	*SampleQuery
	// contains filtered or unexported fields
}

SampleSelect is the builder for selecting fields of Sample entities.

func (*SampleSelect) Bool

func (s *SampleSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SampleSelect) BoolX

func (s *SampleSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SampleSelect) Bools

func (s *SampleSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SampleSelect) BoolsX

func (s *SampleSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SampleSelect) Float64

func (s *SampleSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SampleSelect) Float64X

func (s *SampleSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SampleSelect) Float64s

func (s *SampleSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SampleSelect) Float64sX

func (s *SampleSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SampleSelect) Int

func (s *SampleSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SampleSelect) IntX

func (s *SampleSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SampleSelect) Ints

func (s *SampleSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SampleSelect) IntsX

func (s *SampleSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SampleSelect) Scan

func (ss *SampleSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*SampleSelect) ScanX

func (s *SampleSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*SampleSelect) String

func (s *SampleSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SampleSelect) StringX

func (s *SampleSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SampleSelect) Strings

func (s *SampleSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SampleSelect) StringsX

func (s *SampleSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SampleUpdate

type SampleUpdate struct {
	// contains filtered or unexported fields
}

SampleUpdate is the builder for updating Sample entities.

func (*SampleUpdate) AddNormIDs

func (su *SampleUpdate) AddNormIDs(ids ...uuid.UUID) *SampleUpdate

AddNormIDs adds the "norms" edge to the Norm entity by IDs.

func (*SampleUpdate) AddNorms

func (su *SampleUpdate) AddNorms(n ...*Norm) *SampleUpdate

AddNorms adds the "norms" edges to the Norm entity.

func (*SampleUpdate) ClearNorms

func (su *SampleUpdate) ClearNorms() *SampleUpdate

ClearNorms clears all "norms" edges to the Norm entity.

func (*SampleUpdate) Exec

func (su *SampleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SampleUpdate) ExecX

func (su *SampleUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SampleUpdate) Mutation

func (su *SampleUpdate) Mutation() *SampleMutation

Mutation returns the SampleMutation object of the builder.

func (*SampleUpdate) RemoveNormIDs

func (su *SampleUpdate) RemoveNormIDs(ids ...uuid.UUID) *SampleUpdate

RemoveNormIDs removes the "norms" edge to Norm entities by IDs.

func (*SampleUpdate) RemoveNorms

func (su *SampleUpdate) RemoveNorms(n ...*Norm) *SampleUpdate

RemoveNorms removes "norms" edges to Norm entities.

func (*SampleUpdate) Save

func (su *SampleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SampleUpdate) SaveX

func (su *SampleUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SampleUpdate) SetCriteria

func (su *SampleUpdate) SetCriteria(dc domain.SampleCriteria) *SampleUpdate

SetCriteria sets the "criteria" field.

func (*SampleUpdate) SetUpdateTime

func (su *SampleUpdate) SetUpdateTime(t time.Time) *SampleUpdate

SetUpdateTime sets the "update_time" field.

func (*SampleUpdate) Where

func (su *SampleUpdate) Where(ps ...predicate.Sample) *SampleUpdate

Where appends a list predicates to the SampleUpdate builder.

type SampleUpdateOne

type SampleUpdateOne struct {
	// contains filtered or unexported fields
}

SampleUpdateOne is the builder for updating a single Sample entity.

func (*SampleUpdateOne) AddNormIDs

func (suo *SampleUpdateOne) AddNormIDs(ids ...uuid.UUID) *SampleUpdateOne

AddNormIDs adds the "norms" edge to the Norm entity by IDs.

func (*SampleUpdateOne) AddNorms

func (suo *SampleUpdateOne) AddNorms(n ...*Norm) *SampleUpdateOne

AddNorms adds the "norms" edges to the Norm entity.

func (*SampleUpdateOne) ClearNorms

func (suo *SampleUpdateOne) ClearNorms() *SampleUpdateOne

ClearNorms clears all "norms" edges to the Norm entity.

func (*SampleUpdateOne) Exec

func (suo *SampleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SampleUpdateOne) ExecX

func (suo *SampleUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SampleUpdateOne) Mutation

func (suo *SampleUpdateOne) Mutation() *SampleMutation

Mutation returns the SampleMutation object of the builder.

func (*SampleUpdateOne) RemoveNormIDs

func (suo *SampleUpdateOne) RemoveNormIDs(ids ...uuid.UUID) *SampleUpdateOne

RemoveNormIDs removes the "norms" edge to Norm entities by IDs.

func (*SampleUpdateOne) RemoveNorms

func (suo *SampleUpdateOne) RemoveNorms(n ...*Norm) *SampleUpdateOne

RemoveNorms removes "norms" edges to Norm entities.

func (*SampleUpdateOne) Save

func (suo *SampleUpdateOne) Save(ctx context.Context) (*Sample, error)

Save executes the query and returns the updated Sample entity.

func (*SampleUpdateOne) SaveX

func (suo *SampleUpdateOne) SaveX(ctx context.Context) *Sample

SaveX is like Save, but panics if an error occurs.

func (*SampleUpdateOne) Select

func (suo *SampleUpdateOne) Select(field string, fields ...string) *SampleUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SampleUpdateOne) SetCriteria

func (suo *SampleUpdateOne) SetCriteria(dc domain.SampleCriteria) *SampleUpdateOne

SetCriteria sets the "criteria" field.

func (*SampleUpdateOne) SetUpdateTime

func (suo *SampleUpdateOne) SetUpdateTime(t time.Time) *SampleUpdateOne

SetUpdateTime sets the "update_time" field.

type Samples

type Samples []*Sample

Samples is a parsable slice of Sample.

type Scale

type Scale struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Code holds the value of the "code" field.
	Code string `json:"code,omitempty"`
	// Global holds the value of the "global" field.
	Global bool `json:"global,omitempty"`
	// Type holds the value of the "type" field.
	Type scale.Type `json:"type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ScaleQuery when eager-loading is set.
	Edges ScaleEdges `json:"edges"`
	// contains filtered or unexported fields
}

Scale is the model entity for the Scale schema.

func (*Scale) QueryInterpretations

func (s *Scale) QueryInterpretations() *InterpretationQuery

QueryInterpretations queries the "interpretations" edge of the Scale entity.

func (*Scale) QueryItems

func (s *Scale) QueryItems() *ItemQuery

QueryItems queries the "items" edge of the Scale entity.

func (*Scale) QueryNorms

func (s *Scale) QueryNorms() *NormQuery

QueryNorms queries the "norms" edge of the Scale entity.

func (*Scale) QueryResults

func (s *Scale) QueryResults() *ResultQuery

QueryResults queries the "results" edge of the Scale entity.

func (*Scale) QueryScaleItem

func (s *Scale) QueryScaleItem() *ScaleItemQuery

QueryScaleItem queries the "scale_item" edge of the Scale entity.

func (*Scale) QueryTest

func (s *Scale) QueryTest() *TestQuery

QueryTest queries the "test" edge of the Scale entity.

func (*Scale) QueryTranslations

func (s *Scale) QueryTranslations() *ScaleTranslationQuery

QueryTranslations queries the "translations" edge of the Scale entity.

func (*Scale) String

func (s *Scale) String() string

String implements the fmt.Stringer.

func (*Scale) Unwrap

func (s *Scale) Unwrap() *Scale

Unwrap unwraps the Scale 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 (*Scale) Update

func (s *Scale) Update() *ScaleUpdateOne

Update returns a builder for updating this Scale. Note that you need to call Scale.Unwrap() before calling this method if this Scale was returned from a transaction, and the transaction was committed or rolled back.

type ScaleClient

type ScaleClient struct {
	// contains filtered or unexported fields
}

ScaleClient is a client for the Scale schema.

func NewScaleClient

func NewScaleClient(c config) *ScaleClient

NewScaleClient returns a client for the Scale from the given config.

func (*ScaleClient) Create

func (c *ScaleClient) Create() *ScaleCreate

Create returns a builder for creating a Scale entity.

func (*ScaleClient) CreateBulk

func (c *ScaleClient) CreateBulk(builders ...*ScaleCreate) *ScaleCreateBulk

CreateBulk returns a builder for creating a bulk of Scale entities.

func (*ScaleClient) Delete

func (c *ScaleClient) Delete() *ScaleDelete

Delete returns a delete builder for Scale.

func (*ScaleClient) DeleteOne

func (c *ScaleClient) DeleteOne(s *Scale) *ScaleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ScaleClient) DeleteOneID

func (c *ScaleClient) DeleteOneID(id uuid.UUID) *ScaleDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*ScaleClient) Get

func (c *ScaleClient) Get(ctx context.Context, id uuid.UUID) (*Scale, error)

Get returns a Scale entity by its id.

func (*ScaleClient) GetX

func (c *ScaleClient) GetX(ctx context.Context, id uuid.UUID) *Scale

GetX is like Get, but panics if an error occurs.

func (*ScaleClient) Hooks

func (c *ScaleClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ScaleClient) Query

func (c *ScaleClient) Query() *ScaleQuery

Query returns a query builder for Scale.

func (*ScaleClient) QueryInterpretations

func (c *ScaleClient) QueryInterpretations(s *Scale) *InterpretationQuery

QueryInterpretations queries the interpretations edge of a Scale.

func (*ScaleClient) QueryItems

func (c *ScaleClient) QueryItems(s *Scale) *ItemQuery

QueryItems queries the items edge of a Scale.

func (*ScaleClient) QueryNorms

func (c *ScaleClient) QueryNorms(s *Scale) *NormQuery

QueryNorms queries the norms edge of a Scale.

func (*ScaleClient) QueryResults

func (c *ScaleClient) QueryResults(s *Scale) *ResultQuery

QueryResults queries the results edge of a Scale.

func (*ScaleClient) QueryScaleItem

func (c *ScaleClient) QueryScaleItem(s *Scale) *ScaleItemQuery

QueryScaleItem queries the scale_item edge of a Scale.

func (*ScaleClient) QueryTest

func (c *ScaleClient) QueryTest(s *Scale) *TestQuery

QueryTest queries the test edge of a Scale.

func (*ScaleClient) QueryTranslations

func (c *ScaleClient) QueryTranslations(s *Scale) *ScaleTranslationQuery

QueryTranslations queries the translations edge of a Scale.

func (*ScaleClient) Update

func (c *ScaleClient) Update() *ScaleUpdate

Update returns an update builder for Scale.

func (*ScaleClient) UpdateOne

func (c *ScaleClient) UpdateOne(s *Scale) *ScaleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ScaleClient) UpdateOneID

func (c *ScaleClient) UpdateOneID(id uuid.UUID) *ScaleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ScaleClient) Use

func (c *ScaleClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `scale.Hooks(f(g(h())))`.

type ScaleCreate

type ScaleCreate struct {
	// contains filtered or unexported fields
}

ScaleCreate is the builder for creating a Scale entity.

func (*ScaleCreate) AddInterpretationIDs

func (sc *ScaleCreate) AddInterpretationIDs(ids ...uuid.UUID) *ScaleCreate

AddInterpretationIDs adds the "interpretations" edge to the Interpretation entity by IDs.

func (*ScaleCreate) AddInterpretations

func (sc *ScaleCreate) AddInterpretations(i ...*Interpretation) *ScaleCreate

AddInterpretations adds the "interpretations" edges to the Interpretation entity.

func (*ScaleCreate) AddItemIDs

func (sc *ScaleCreate) AddItemIDs(ids ...uuid.UUID) *ScaleCreate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*ScaleCreate) AddItems

func (sc *ScaleCreate) AddItems(i ...*Item) *ScaleCreate

AddItems adds the "items" edges to the Item entity.

func (*ScaleCreate) AddNormIDs

func (sc *ScaleCreate) AddNormIDs(ids ...uuid.UUID) *ScaleCreate

AddNormIDs adds the "norms" edge to the Norm entity by IDs.

func (*ScaleCreate) AddNorms

func (sc *ScaleCreate) AddNorms(n ...*Norm) *ScaleCreate

AddNorms adds the "norms" edges to the Norm entity.

func (*ScaleCreate) AddResultIDs

func (sc *ScaleCreate) AddResultIDs(ids ...uuid.UUID) *ScaleCreate

AddResultIDs adds the "results" edge to the Result entity by IDs.

func (*ScaleCreate) AddResults

func (sc *ScaleCreate) AddResults(r ...*Result) *ScaleCreate

AddResults adds the "results" edges to the Result entity.

func (*ScaleCreate) AddTest

func (sc *ScaleCreate) AddTest(t ...*Test) *ScaleCreate

AddTest adds the "test" edges to the Test entity.

func (*ScaleCreate) AddTestIDs

func (sc *ScaleCreate) AddTestIDs(ids ...uuid.UUID) *ScaleCreate

AddTestIDs adds the "test" edge to the Test entity by IDs.

func (*ScaleCreate) AddTranslationIDs

func (sc *ScaleCreate) AddTranslationIDs(ids ...uuid.UUID) *ScaleCreate

AddTranslationIDs adds the "translations" edge to the ScaleTranslation entity by IDs.

func (*ScaleCreate) AddTranslations

func (sc *ScaleCreate) AddTranslations(s ...*ScaleTranslation) *ScaleCreate

AddTranslations adds the "translations" edges to the ScaleTranslation entity.

func (*ScaleCreate) Exec

func (sc *ScaleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScaleCreate) ExecX

func (sc *ScaleCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleCreate) Mutation

func (sc *ScaleCreate) Mutation() *ScaleMutation

Mutation returns the ScaleMutation object of the builder.

func (*ScaleCreate) Save

func (sc *ScaleCreate) Save(ctx context.Context) (*Scale, error)

Save creates the Scale in the database.

func (*ScaleCreate) SaveX

func (sc *ScaleCreate) SaveX(ctx context.Context) *Scale

SaveX calls Save and panics if Save returns an error.

func (*ScaleCreate) SetCode

func (sc *ScaleCreate) SetCode(s string) *ScaleCreate

SetCode sets the "code" field.

func (*ScaleCreate) SetCreateTime

func (sc *ScaleCreate) SetCreateTime(t time.Time) *ScaleCreate

SetCreateTime sets the "create_time" field.

func (*ScaleCreate) SetGlobal

func (sc *ScaleCreate) SetGlobal(b bool) *ScaleCreate

SetGlobal sets the "global" field.

func (*ScaleCreate) SetID

func (sc *ScaleCreate) SetID(u uuid.UUID) *ScaleCreate

SetID sets the "id" field.

func (*ScaleCreate) SetNillableCreateTime

func (sc *ScaleCreate) SetNillableCreateTime(t *time.Time) *ScaleCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ScaleCreate) SetNillableGlobal

func (sc *ScaleCreate) SetNillableGlobal(b *bool) *ScaleCreate

SetNillableGlobal sets the "global" field if the given value is not nil.

func (*ScaleCreate) SetNillableID

func (sc *ScaleCreate) SetNillableID(u *uuid.UUID) *ScaleCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ScaleCreate) SetNillableType

func (sc *ScaleCreate) SetNillableType(s *scale.Type) *ScaleCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*ScaleCreate) SetNillableUpdateTime

func (sc *ScaleCreate) SetNillableUpdateTime(t *time.Time) *ScaleCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ScaleCreate) SetType

func (sc *ScaleCreate) SetType(s scale.Type) *ScaleCreate

SetType sets the "type" field.

func (*ScaleCreate) SetUpdateTime

func (sc *ScaleCreate) SetUpdateTime(t time.Time) *ScaleCreate

SetUpdateTime sets the "update_time" field.

type ScaleCreateBulk

type ScaleCreateBulk struct {
	// contains filtered or unexported fields
}

ScaleCreateBulk is the builder for creating many Scale entities in bulk.

func (*ScaleCreateBulk) Exec

func (scb *ScaleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ScaleCreateBulk) ExecX

func (scb *ScaleCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleCreateBulk) Save

func (scb *ScaleCreateBulk) Save(ctx context.Context) ([]*Scale, error)

Save creates the Scale entities in the database.

func (*ScaleCreateBulk) SaveX

func (scb *ScaleCreateBulk) SaveX(ctx context.Context) []*Scale

SaveX is like Save, but panics if an error occurs.

type ScaleDelete

type ScaleDelete struct {
	// contains filtered or unexported fields
}

ScaleDelete is the builder for deleting a Scale entity.

func (*ScaleDelete) Exec

func (sd *ScaleDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ScaleDelete) ExecX

func (sd *ScaleDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ScaleDelete) Where

func (sd *ScaleDelete) Where(ps ...predicate.Scale) *ScaleDelete

Where appends a list predicates to the ScaleDelete builder.

type ScaleDeleteOne

type ScaleDeleteOne struct {
	// contains filtered or unexported fields
}

ScaleDeleteOne is the builder for deleting a single Scale entity.

func (*ScaleDeleteOne) Exec

func (sdo *ScaleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ScaleDeleteOne) ExecX

func (sdo *ScaleDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ScaleEdges

type ScaleEdges struct {
	// Items holds the value of the items edge.
	Items []*Item `json:"items,omitempty"`
	// Interpretations holds the value of the interpretations edge.
	Interpretations []*Interpretation `json:"interpretations,omitempty"`
	// Translations holds the value of the translations edge.
	Translations []*ScaleTranslation `json:"translations,omitempty"`
	// Norms holds the value of the norms edge.
	Norms []*Norm `json:"norms,omitempty"`
	// Results holds the value of the results edge.
	Results []*Result `json:"results,omitempty"`
	// Test holds the value of the test edge.
	Test []*Test `json:"test,omitempty"`
	// ScaleItem holds the value of the scale_item edge.
	ScaleItem []*ScaleItem `json:"scale_item,omitempty"`
	// contains filtered or unexported fields
}

ScaleEdges holds the relations/edges for other nodes in the graph.

func (ScaleEdges) InterpretationsOrErr

func (e ScaleEdges) InterpretationsOrErr() ([]*Interpretation, error)

InterpretationsOrErr returns the Interpretations value or an error if the edge was not loaded in eager-loading.

func (ScaleEdges) ItemsOrErr

func (e ScaleEdges) ItemsOrErr() ([]*Item, error)

ItemsOrErr returns the Items value or an error if the edge was not loaded in eager-loading.

func (ScaleEdges) NormsOrErr

func (e ScaleEdges) NormsOrErr() ([]*Norm, error)

NormsOrErr returns the Norms value or an error if the edge was not loaded in eager-loading.

func (ScaleEdges) ResultsOrErr

func (e ScaleEdges) ResultsOrErr() ([]*Result, error)

ResultsOrErr returns the Results value or an error if the edge was not loaded in eager-loading.

func (ScaleEdges) ScaleItemOrErr

func (e ScaleEdges) ScaleItemOrErr() ([]*ScaleItem, error)

ScaleItemOrErr returns the ScaleItem value or an error if the edge was not loaded in eager-loading.

func (ScaleEdges) TestOrErr

func (e ScaleEdges) TestOrErr() ([]*Test, error)

TestOrErr returns the Test value or an error if the edge was not loaded in eager-loading.

func (ScaleEdges) TranslationsOrErr

func (e ScaleEdges) TranslationsOrErr() ([]*ScaleTranslation, error)

TranslationsOrErr returns the Translations value or an error if the edge was not loaded in eager-loading.

type ScaleGroupBy

type ScaleGroupBy struct {
	// contains filtered or unexported fields
}

ScaleGroupBy is the group-by builder for Scale entities.

func (*ScaleGroupBy) Aggregate

func (sgb *ScaleGroupBy) Aggregate(fns ...AggregateFunc) *ScaleGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ScaleGroupBy) Bool

func (s *ScaleGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScaleGroupBy) BoolX

func (s *ScaleGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScaleGroupBy) Bools

func (s *ScaleGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScaleGroupBy) BoolsX

func (s *ScaleGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScaleGroupBy) Float64

func (s *ScaleGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScaleGroupBy) Float64X

func (s *ScaleGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScaleGroupBy) Float64s

func (s *ScaleGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScaleGroupBy) Float64sX

func (s *ScaleGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScaleGroupBy) Int

func (s *ScaleGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScaleGroupBy) IntX

func (s *ScaleGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScaleGroupBy) Ints

func (s *ScaleGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScaleGroupBy) IntsX

func (s *ScaleGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScaleGroupBy) Scan

func (sgb *ScaleGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ScaleGroupBy) ScanX

func (s *ScaleGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ScaleGroupBy) String

func (s *ScaleGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScaleGroupBy) StringX

func (s *ScaleGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScaleGroupBy) Strings

func (s *ScaleGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScaleGroupBy) StringsX

func (s *ScaleGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScaleItem

type ScaleItem struct {

	// Reverse holds the value of the "reverse" field.
	Reverse bool `json:"reverse,omitempty"`
	// ScaleID holds the value of the "scale_id" field.
	ScaleID uuid.UUID `json:"scale_id,omitempty"`
	// ItemID holds the value of the "item_id" field.
	ItemID uuid.UUID `json:"item_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ScaleItemQuery when eager-loading is set.
	Edges ScaleItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

ScaleItem is the model entity for the ScaleItem schema.

func (*ScaleItem) QueryItem

func (si *ScaleItem) QueryItem() *ItemQuery

QueryItem queries the "item" edge of the ScaleItem entity.

func (*ScaleItem) QueryScale

func (si *ScaleItem) QueryScale() *ScaleQuery

QueryScale queries the "scale" edge of the ScaleItem entity.

func (*ScaleItem) String

func (si *ScaleItem) String() string

String implements the fmt.Stringer.

func (*ScaleItem) Unwrap

func (si *ScaleItem) Unwrap() *ScaleItem

Unwrap unwraps the ScaleItem 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 (*ScaleItem) Update

func (si *ScaleItem) Update() *ScaleItemUpdateOne

Update returns a builder for updating this ScaleItem. Note that you need to call ScaleItem.Unwrap() before calling this method if this ScaleItem was returned from a transaction, and the transaction was committed or rolled back.

type ScaleItemClient

type ScaleItemClient struct {
	// contains filtered or unexported fields
}

ScaleItemClient is a client for the ScaleItem schema.

func NewScaleItemClient

func NewScaleItemClient(c config) *ScaleItemClient

NewScaleItemClient returns a client for the ScaleItem from the given config.

func (*ScaleItemClient) Create

func (c *ScaleItemClient) Create() *ScaleItemCreate

Create returns a builder for creating a ScaleItem entity.

func (*ScaleItemClient) CreateBulk

func (c *ScaleItemClient) CreateBulk(builders ...*ScaleItemCreate) *ScaleItemCreateBulk

CreateBulk returns a builder for creating a bulk of ScaleItem entities.

func (*ScaleItemClient) Delete

func (c *ScaleItemClient) Delete() *ScaleItemDelete

Delete returns a delete builder for ScaleItem.

func (*ScaleItemClient) Hooks

func (c *ScaleItemClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ScaleItemClient) Query

func (c *ScaleItemClient) Query() *ScaleItemQuery

Query returns a query builder for ScaleItem.

func (*ScaleItemClient) QueryItem

func (c *ScaleItemClient) QueryItem(si *ScaleItem) *ItemQuery

QueryItem queries the item edge of a ScaleItem.

func (*ScaleItemClient) QueryScale

func (c *ScaleItemClient) QueryScale(si *ScaleItem) *ScaleQuery

QueryScale queries the scale edge of a ScaleItem.

func (*ScaleItemClient) Update

func (c *ScaleItemClient) Update() *ScaleItemUpdate

Update returns an update builder for ScaleItem.

func (*ScaleItemClient) UpdateOne

func (c *ScaleItemClient) UpdateOne(si *ScaleItem) *ScaleItemUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ScaleItemClient) Use

func (c *ScaleItemClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `scaleitem.Hooks(f(g(h())))`.

type ScaleItemCreate

type ScaleItemCreate struct {
	// contains filtered or unexported fields
}

ScaleItemCreate is the builder for creating a ScaleItem entity.

func (*ScaleItemCreate) Exec

func (sic *ScaleItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScaleItemCreate) ExecX

func (sic *ScaleItemCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleItemCreate) Mutation

func (sic *ScaleItemCreate) Mutation() *ScaleItemMutation

Mutation returns the ScaleItemMutation object of the builder.

func (*ScaleItemCreate) Save

func (sic *ScaleItemCreate) Save(ctx context.Context) (*ScaleItem, error)

Save creates the ScaleItem in the database.

func (*ScaleItemCreate) SaveX

func (sic *ScaleItemCreate) SaveX(ctx context.Context) *ScaleItem

SaveX calls Save and panics if Save returns an error.

func (*ScaleItemCreate) SetItem

func (sic *ScaleItemCreate) SetItem(i *Item) *ScaleItemCreate

SetItem sets the "item" edge to the Item entity.

func (*ScaleItemCreate) SetItemID

func (sic *ScaleItemCreate) SetItemID(u uuid.UUID) *ScaleItemCreate

SetItemID sets the "item_id" field.

func (*ScaleItemCreate) SetNillableReverse

func (sic *ScaleItemCreate) SetNillableReverse(b *bool) *ScaleItemCreate

SetNillableReverse sets the "reverse" field if the given value is not nil.

func (*ScaleItemCreate) SetReverse

func (sic *ScaleItemCreate) SetReverse(b bool) *ScaleItemCreate

SetReverse sets the "reverse" field.

func (*ScaleItemCreate) SetScale

func (sic *ScaleItemCreate) SetScale(s *Scale) *ScaleItemCreate

SetScale sets the "scale" edge to the Scale entity.

func (*ScaleItemCreate) SetScaleID

func (sic *ScaleItemCreate) SetScaleID(u uuid.UUID) *ScaleItemCreate

SetScaleID sets the "scale_id" field.

type ScaleItemCreateBulk

type ScaleItemCreateBulk struct {
	// contains filtered or unexported fields
}

ScaleItemCreateBulk is the builder for creating many ScaleItem entities in bulk.

func (*ScaleItemCreateBulk) Exec

func (sicb *ScaleItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ScaleItemCreateBulk) ExecX

func (sicb *ScaleItemCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleItemCreateBulk) Save

func (sicb *ScaleItemCreateBulk) Save(ctx context.Context) ([]*ScaleItem, error)

Save creates the ScaleItem entities in the database.

func (*ScaleItemCreateBulk) SaveX

func (sicb *ScaleItemCreateBulk) SaveX(ctx context.Context) []*ScaleItem

SaveX is like Save, but panics if an error occurs.

type ScaleItemDelete

type ScaleItemDelete struct {
	// contains filtered or unexported fields
}

ScaleItemDelete is the builder for deleting a ScaleItem entity.

func (*ScaleItemDelete) Exec

func (sid *ScaleItemDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ScaleItemDelete) ExecX

func (sid *ScaleItemDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ScaleItemDelete) Where

Where appends a list predicates to the ScaleItemDelete builder.

type ScaleItemDeleteOne

type ScaleItemDeleteOne struct {
	// contains filtered or unexported fields
}

ScaleItemDeleteOne is the builder for deleting a single ScaleItem entity.

func (*ScaleItemDeleteOne) Exec

func (sido *ScaleItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ScaleItemDeleteOne) ExecX

func (sido *ScaleItemDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ScaleItemEdges

type ScaleItemEdges struct {
	// Item holds the value of the item edge.
	Item *Item `json:"item,omitempty"`
	// Scale holds the value of the scale edge.
	Scale *Scale `json:"scale,omitempty"`
	// contains filtered or unexported fields
}

ScaleItemEdges holds the relations/edges for other nodes in the graph.

func (ScaleItemEdges) ItemOrErr

func (e ScaleItemEdges) ItemOrErr() (*Item, error)

ItemOrErr returns the Item value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ScaleItemEdges) ScaleOrErr

func (e ScaleItemEdges) ScaleOrErr() (*Scale, error)

ScaleOrErr returns the Scale value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ScaleItemGroupBy

type ScaleItemGroupBy struct {
	// contains filtered or unexported fields
}

ScaleItemGroupBy is the group-by builder for ScaleItem entities.

func (*ScaleItemGroupBy) Aggregate

func (sigb *ScaleItemGroupBy) Aggregate(fns ...AggregateFunc) *ScaleItemGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ScaleItemGroupBy) Bool

func (s *ScaleItemGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScaleItemGroupBy) BoolX

func (s *ScaleItemGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScaleItemGroupBy) Bools

func (s *ScaleItemGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScaleItemGroupBy) BoolsX

func (s *ScaleItemGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScaleItemGroupBy) Float64

func (s *ScaleItemGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScaleItemGroupBy) Float64X

func (s *ScaleItemGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScaleItemGroupBy) Float64s

func (s *ScaleItemGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScaleItemGroupBy) Float64sX

func (s *ScaleItemGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScaleItemGroupBy) Int

func (s *ScaleItemGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScaleItemGroupBy) IntX

func (s *ScaleItemGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScaleItemGroupBy) Ints

func (s *ScaleItemGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScaleItemGroupBy) IntsX

func (s *ScaleItemGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScaleItemGroupBy) Scan

func (sigb *ScaleItemGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ScaleItemGroupBy) ScanX

func (s *ScaleItemGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ScaleItemGroupBy) String

func (s *ScaleItemGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScaleItemGroupBy) StringX

func (s *ScaleItemGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScaleItemGroupBy) Strings

func (s *ScaleItemGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScaleItemGroupBy) StringsX

func (s *ScaleItemGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScaleItemMutation

type ScaleItemMutation struct {
	// contains filtered or unexported fields
}

ScaleItemMutation represents an operation that mutates the ScaleItem nodes in the graph.

func (*ScaleItemMutation) AddField

func (m *ScaleItemMutation) 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 (*ScaleItemMutation) AddedEdges

func (m *ScaleItemMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ScaleItemMutation) AddedField

func (m *ScaleItemMutation) 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 (*ScaleItemMutation) AddedFields

func (m *ScaleItemMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ScaleItemMutation) AddedIDs

func (m *ScaleItemMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ScaleItemMutation) ClearEdge

func (m *ScaleItemMutation) 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 (*ScaleItemMutation) ClearField

func (m *ScaleItemMutation) 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 (*ScaleItemMutation) ClearItem

func (m *ScaleItemMutation) ClearItem()

ClearItem clears the "item" edge to the Item entity.

func (*ScaleItemMutation) ClearScale

func (m *ScaleItemMutation) ClearScale()

ClearScale clears the "scale" edge to the Scale entity.

func (*ScaleItemMutation) ClearedEdges

func (m *ScaleItemMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ScaleItemMutation) ClearedFields

func (m *ScaleItemMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ScaleItemMutation) Client

func (m ScaleItemMutation) 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 (*ScaleItemMutation) EdgeCleared

func (m *ScaleItemMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ScaleItemMutation) Field

func (m *ScaleItemMutation) 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 (*ScaleItemMutation) FieldCleared

func (m *ScaleItemMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ScaleItemMutation) Fields

func (m *ScaleItemMutation) 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 (*ScaleItemMutation) ItemCleared

func (m *ScaleItemMutation) ItemCleared() bool

ItemCleared reports if the "item" edge to the Item entity was cleared.

func (*ScaleItemMutation) ItemID

func (m *ScaleItemMutation) ItemID() (r uuid.UUID, exists bool)

ItemID returns the value of the "item_id" field in the mutation.

func (*ScaleItemMutation) ItemIDs

func (m *ScaleItemMutation) ItemIDs() (ids []uuid.UUID)

ItemIDs returns the "item" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ItemID instead. It exists only for internal usage by the builders.

func (*ScaleItemMutation) OldField

func (m *ScaleItemMutation) 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 (*ScaleItemMutation) Op

func (m *ScaleItemMutation) Op() Op

Op returns the operation name.

func (*ScaleItemMutation) RemovedEdges

func (m *ScaleItemMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ScaleItemMutation) RemovedIDs

func (m *ScaleItemMutation) 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 (*ScaleItemMutation) ResetEdge

func (m *ScaleItemMutation) 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 (*ScaleItemMutation) ResetField

func (m *ScaleItemMutation) 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 (*ScaleItemMutation) ResetItem

func (m *ScaleItemMutation) ResetItem()

ResetItem resets all changes to the "item" edge.

func (*ScaleItemMutation) ResetItemID

func (m *ScaleItemMutation) ResetItemID()

ResetItemID resets all changes to the "item_id" field.

func (*ScaleItemMutation) ResetReverse

func (m *ScaleItemMutation) ResetReverse()

ResetReverse resets all changes to the "reverse" field.

func (*ScaleItemMutation) ResetScale

func (m *ScaleItemMutation) ResetScale()

ResetScale resets all changes to the "scale" edge.

func (*ScaleItemMutation) ResetScaleID

func (m *ScaleItemMutation) ResetScaleID()

ResetScaleID resets all changes to the "scale_id" field.

func (*ScaleItemMutation) Reverse

func (m *ScaleItemMutation) Reverse() (r bool, exists bool)

Reverse returns the value of the "reverse" field in the mutation.

func (*ScaleItemMutation) ScaleCleared

func (m *ScaleItemMutation) ScaleCleared() bool

ScaleCleared reports if the "scale" edge to the Scale entity was cleared.

func (*ScaleItemMutation) ScaleID

func (m *ScaleItemMutation) ScaleID() (r uuid.UUID, exists bool)

ScaleID returns the value of the "scale_id" field in the mutation.

func (*ScaleItemMutation) ScaleIDs

func (m *ScaleItemMutation) ScaleIDs() (ids []uuid.UUID)

ScaleIDs returns the "scale" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ScaleID instead. It exists only for internal usage by the builders.

func (*ScaleItemMutation) SetField

func (m *ScaleItemMutation) 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 (*ScaleItemMutation) SetItemID

func (m *ScaleItemMutation) SetItemID(u uuid.UUID)

SetItemID sets the "item_id" field.

func (*ScaleItemMutation) SetReverse

func (m *ScaleItemMutation) SetReverse(b bool)

SetReverse sets the "reverse" field.

func (*ScaleItemMutation) SetScaleID

func (m *ScaleItemMutation) SetScaleID(u uuid.UUID)

SetScaleID sets the "scale_id" field.

func (ScaleItemMutation) Tx

func (m ScaleItemMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ScaleItemMutation) Type

func (m *ScaleItemMutation) Type() string

Type returns the node type of this mutation (ScaleItem).

func (*ScaleItemMutation) Where

func (m *ScaleItemMutation) Where(ps ...predicate.ScaleItem)

Where appends a list predicates to the ScaleItemMutation builder.

type ScaleItemQuery

type ScaleItemQuery struct {
	// contains filtered or unexported fields
}

ScaleItemQuery is the builder for querying ScaleItem entities.

func (*ScaleItemQuery) All

func (siq *ScaleItemQuery) All(ctx context.Context) ([]*ScaleItem, error)

All executes the query and returns a list of ScaleItems.

func (*ScaleItemQuery) AllX

func (siq *ScaleItemQuery) AllX(ctx context.Context) []*ScaleItem

AllX is like All, but panics if an error occurs.

func (*ScaleItemQuery) Clone

func (siq *ScaleItemQuery) Clone() *ScaleItemQuery

Clone returns a duplicate of the ScaleItemQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ScaleItemQuery) Count

func (siq *ScaleItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ScaleItemQuery) CountX

func (siq *ScaleItemQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ScaleItemQuery) Exist

func (siq *ScaleItemQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ScaleItemQuery) ExistX

func (siq *ScaleItemQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ScaleItemQuery) First

func (siq *ScaleItemQuery) First(ctx context.Context) (*ScaleItem, error)

First returns the first ScaleItem entity from the query. Returns a *NotFoundError when no ScaleItem was found.

func (*ScaleItemQuery) FirstX

func (siq *ScaleItemQuery) FirstX(ctx context.Context) *ScaleItem

FirstX is like First, but panics if an error occurs.

func (*ScaleItemQuery) GroupBy

func (siq *ScaleItemQuery) GroupBy(field string, fields ...string) *ScaleItemGroupBy

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 {
	Reverse bool `json:"reverse,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ScaleItem.Query().
	GroupBy(scaleitem.FieldReverse).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ScaleItemQuery) Limit

func (siq *ScaleItemQuery) Limit(limit int) *ScaleItemQuery

Limit adds a limit step to the query.

func (*ScaleItemQuery) Offset

func (siq *ScaleItemQuery) Offset(offset int) *ScaleItemQuery

Offset adds an offset step to the query.

func (*ScaleItemQuery) Only

func (siq *ScaleItemQuery) Only(ctx context.Context) (*ScaleItem, error)

Only returns a single ScaleItem entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ScaleItem entity is found. Returns a *NotFoundError when no ScaleItem entities are found.

func (*ScaleItemQuery) OnlyX

func (siq *ScaleItemQuery) OnlyX(ctx context.Context) *ScaleItem

OnlyX is like Only, but panics if an error occurs.

func (*ScaleItemQuery) Order

func (siq *ScaleItemQuery) Order(o ...OrderFunc) *ScaleItemQuery

Order adds an order step to the query.

func (*ScaleItemQuery) QueryItem

func (siq *ScaleItemQuery) QueryItem() *ItemQuery

QueryItem chains the current query on the "item" edge.

func (*ScaleItemQuery) QueryScale

func (siq *ScaleItemQuery) QueryScale() *ScaleQuery

QueryScale chains the current query on the "scale" edge.

func (*ScaleItemQuery) Select

func (siq *ScaleItemQuery) Select(fields ...string) *ScaleItemSelect

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 {
	Reverse bool `json:"reverse,omitempty"`
}

client.ScaleItem.Query().
	Select(scaleitem.FieldReverse).
	Scan(ctx, &v)

func (*ScaleItemQuery) Unique

func (siq *ScaleItemQuery) Unique(unique bool) *ScaleItemQuery

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 (*ScaleItemQuery) Where

func (siq *ScaleItemQuery) Where(ps ...predicate.ScaleItem) *ScaleItemQuery

Where adds a new predicate for the ScaleItemQuery builder.

func (*ScaleItemQuery) WithItem

func (siq *ScaleItemQuery) WithItem(opts ...func(*ItemQuery)) *ScaleItemQuery

WithItem tells the query-builder to eager-load the nodes that are connected to the "item" edge. The optional arguments are used to configure the query builder of the edge.

func (*ScaleItemQuery) WithScale

func (siq *ScaleItemQuery) WithScale(opts ...func(*ScaleQuery)) *ScaleItemQuery

WithScale tells the query-builder to eager-load the nodes that are connected to the "scale" edge. The optional arguments are used to configure the query builder of the edge.

type ScaleItemSelect

type ScaleItemSelect struct {
	*ScaleItemQuery
	// contains filtered or unexported fields
}

ScaleItemSelect is the builder for selecting fields of ScaleItem entities.

func (*ScaleItemSelect) Bool

func (s *ScaleItemSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScaleItemSelect) BoolX

func (s *ScaleItemSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScaleItemSelect) Bools

func (s *ScaleItemSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScaleItemSelect) BoolsX

func (s *ScaleItemSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScaleItemSelect) Float64

func (s *ScaleItemSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScaleItemSelect) Float64X

func (s *ScaleItemSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScaleItemSelect) Float64s

func (s *ScaleItemSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScaleItemSelect) Float64sX

func (s *ScaleItemSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScaleItemSelect) Int

func (s *ScaleItemSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScaleItemSelect) IntX

func (s *ScaleItemSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScaleItemSelect) Ints

func (s *ScaleItemSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScaleItemSelect) IntsX

func (s *ScaleItemSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScaleItemSelect) Scan

func (sis *ScaleItemSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*ScaleItemSelect) ScanX

func (s *ScaleItemSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ScaleItemSelect) String

func (s *ScaleItemSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScaleItemSelect) StringX

func (s *ScaleItemSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScaleItemSelect) Strings

func (s *ScaleItemSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScaleItemSelect) StringsX

func (s *ScaleItemSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScaleItemUpdate

type ScaleItemUpdate struct {
	// contains filtered or unexported fields
}

ScaleItemUpdate is the builder for updating ScaleItem entities.

func (*ScaleItemUpdate) ClearItem

func (siu *ScaleItemUpdate) ClearItem() *ScaleItemUpdate

ClearItem clears the "item" edge to the Item entity.

func (*ScaleItemUpdate) ClearScale

func (siu *ScaleItemUpdate) ClearScale() *ScaleItemUpdate

ClearScale clears the "scale" edge to the Scale entity.

func (*ScaleItemUpdate) Exec

func (siu *ScaleItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScaleItemUpdate) ExecX

func (siu *ScaleItemUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleItemUpdate) Mutation

func (siu *ScaleItemUpdate) Mutation() *ScaleItemMutation

Mutation returns the ScaleItemMutation object of the builder.

func (*ScaleItemUpdate) Save

func (siu *ScaleItemUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ScaleItemUpdate) SaveX

func (siu *ScaleItemUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ScaleItemUpdate) SetItem

func (siu *ScaleItemUpdate) SetItem(i *Item) *ScaleItemUpdate

SetItem sets the "item" edge to the Item entity.

func (*ScaleItemUpdate) SetItemID

func (siu *ScaleItemUpdate) SetItemID(u uuid.UUID) *ScaleItemUpdate

SetItemID sets the "item_id" field.

func (*ScaleItemUpdate) SetNillableReverse

func (siu *ScaleItemUpdate) SetNillableReverse(b *bool) *ScaleItemUpdate

SetNillableReverse sets the "reverse" field if the given value is not nil.

func (*ScaleItemUpdate) SetReverse

func (siu *ScaleItemUpdate) SetReverse(b bool) *ScaleItemUpdate

SetReverse sets the "reverse" field.

func (*ScaleItemUpdate) SetScale

func (siu *ScaleItemUpdate) SetScale(s *Scale) *ScaleItemUpdate

SetScale sets the "scale" edge to the Scale entity.

func (*ScaleItemUpdate) SetScaleID

func (siu *ScaleItemUpdate) SetScaleID(u uuid.UUID) *ScaleItemUpdate

SetScaleID sets the "scale_id" field.

func (*ScaleItemUpdate) Where

Where appends a list predicates to the ScaleItemUpdate builder.

type ScaleItemUpdateOne

type ScaleItemUpdateOne struct {
	// contains filtered or unexported fields
}

ScaleItemUpdateOne is the builder for updating a single ScaleItem entity.

func (*ScaleItemUpdateOne) ClearItem

func (siuo *ScaleItemUpdateOne) ClearItem() *ScaleItemUpdateOne

ClearItem clears the "item" edge to the Item entity.

func (*ScaleItemUpdateOne) ClearScale

func (siuo *ScaleItemUpdateOne) ClearScale() *ScaleItemUpdateOne

ClearScale clears the "scale" edge to the Scale entity.

func (*ScaleItemUpdateOne) Exec

func (siuo *ScaleItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ScaleItemUpdateOne) ExecX

func (siuo *ScaleItemUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleItemUpdateOne) Mutation

func (siuo *ScaleItemUpdateOne) Mutation() *ScaleItemMutation

Mutation returns the ScaleItemMutation object of the builder.

func (*ScaleItemUpdateOne) Save

func (siuo *ScaleItemUpdateOne) Save(ctx context.Context) (*ScaleItem, error)

Save executes the query and returns the updated ScaleItem entity.

func (*ScaleItemUpdateOne) SaveX

func (siuo *ScaleItemUpdateOne) SaveX(ctx context.Context) *ScaleItem

SaveX is like Save, but panics if an error occurs.

func (*ScaleItemUpdateOne) Select

func (siuo *ScaleItemUpdateOne) Select(field string, fields ...string) *ScaleItemUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ScaleItemUpdateOne) SetItem

func (siuo *ScaleItemUpdateOne) SetItem(i *Item) *ScaleItemUpdateOne

SetItem sets the "item" edge to the Item entity.

func (*ScaleItemUpdateOne) SetItemID

func (siuo *ScaleItemUpdateOne) SetItemID(u uuid.UUID) *ScaleItemUpdateOne

SetItemID sets the "item_id" field.

func (*ScaleItemUpdateOne) SetNillableReverse

func (siuo *ScaleItemUpdateOne) SetNillableReverse(b *bool) *ScaleItemUpdateOne

SetNillableReverse sets the "reverse" field if the given value is not nil.

func (*ScaleItemUpdateOne) SetReverse

func (siuo *ScaleItemUpdateOne) SetReverse(b bool) *ScaleItemUpdateOne

SetReverse sets the "reverse" field.

func (*ScaleItemUpdateOne) SetScale

func (siuo *ScaleItemUpdateOne) SetScale(s *Scale) *ScaleItemUpdateOne

SetScale sets the "scale" edge to the Scale entity.

func (*ScaleItemUpdateOne) SetScaleID

func (siuo *ScaleItemUpdateOne) SetScaleID(u uuid.UUID) *ScaleItemUpdateOne

SetScaleID sets the "scale_id" field.

type ScaleItems

type ScaleItems []*ScaleItem

ScaleItems is a parsable slice of ScaleItem.

type ScaleMutation

type ScaleMutation struct {
	// contains filtered or unexported fields
}

ScaleMutation represents an operation that mutates the Scale nodes in the graph.

func (*ScaleMutation) AddField

func (m *ScaleMutation) 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 (*ScaleMutation) AddInterpretationIDs

func (m *ScaleMutation) AddInterpretationIDs(ids ...uuid.UUID)

AddInterpretationIDs adds the "interpretations" edge to the Interpretation entity by ids.

func (*ScaleMutation) AddItemIDs

func (m *ScaleMutation) AddItemIDs(ids ...uuid.UUID)

AddItemIDs adds the "items" edge to the Item entity by ids.

func (*ScaleMutation) AddNormIDs

func (m *ScaleMutation) AddNormIDs(ids ...uuid.UUID)

AddNormIDs adds the "norms" edge to the Norm entity by ids.

func (*ScaleMutation) AddResultIDs

func (m *ScaleMutation) AddResultIDs(ids ...uuid.UUID)

AddResultIDs adds the "results" edge to the Result entity by ids.

func (*ScaleMutation) AddTestIDs

func (m *ScaleMutation) AddTestIDs(ids ...uuid.UUID)

AddTestIDs adds the "test" edge to the Test entity by ids.

func (*ScaleMutation) AddTranslationIDs

func (m *ScaleMutation) AddTranslationIDs(ids ...uuid.UUID)

AddTranslationIDs adds the "translations" edge to the ScaleTranslation entity by ids.

func (*ScaleMutation) AddedEdges

func (m *ScaleMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ScaleMutation) AddedField

func (m *ScaleMutation) 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 (*ScaleMutation) AddedFields

func (m *ScaleMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ScaleMutation) AddedIDs

func (m *ScaleMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ScaleMutation) ClearEdge

func (m *ScaleMutation) 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 (*ScaleMutation) ClearField

func (m *ScaleMutation) 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 (*ScaleMutation) ClearInterpretations

func (m *ScaleMutation) ClearInterpretations()

ClearInterpretations clears the "interpretations" edge to the Interpretation entity.

func (*ScaleMutation) ClearItems

func (m *ScaleMutation) ClearItems()

ClearItems clears the "items" edge to the Item entity.

func (*ScaleMutation) ClearNorms

func (m *ScaleMutation) ClearNorms()

ClearNorms clears the "norms" edge to the Norm entity.

func (*ScaleMutation) ClearResults

func (m *ScaleMutation) ClearResults()

ClearResults clears the "results" edge to the Result entity.

func (*ScaleMutation) ClearTest

func (m *ScaleMutation) ClearTest()

ClearTest clears the "test" edge to the Test entity.

func (*ScaleMutation) ClearTranslations

func (m *ScaleMutation) ClearTranslations()

ClearTranslations clears the "translations" edge to the ScaleTranslation entity.

func (*ScaleMutation) ClearedEdges

func (m *ScaleMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ScaleMutation) ClearedFields

func (m *ScaleMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ScaleMutation) Client

func (m ScaleMutation) 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 (*ScaleMutation) Code

func (m *ScaleMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*ScaleMutation) CreateTime

func (m *ScaleMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ScaleMutation) EdgeCleared

func (m *ScaleMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ScaleMutation) Field

func (m *ScaleMutation) 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 (*ScaleMutation) FieldCleared

func (m *ScaleMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ScaleMutation) Fields

func (m *ScaleMutation) 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 (*ScaleMutation) GetType

func (m *ScaleMutation) GetType() (r scale.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*ScaleMutation) Global

func (m *ScaleMutation) Global() (r bool, exists bool)

Global returns the value of the "global" field in the mutation.

func (*ScaleMutation) ID

func (m *ScaleMutation) ID() (id uuid.UUID, 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 (*ScaleMutation) IDs

func (m *ScaleMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ScaleMutation) InterpretationsCleared

func (m *ScaleMutation) InterpretationsCleared() bool

InterpretationsCleared reports if the "interpretations" edge to the Interpretation entity was cleared.

func (*ScaleMutation) InterpretationsIDs

func (m *ScaleMutation) InterpretationsIDs() (ids []uuid.UUID)

InterpretationsIDs returns the "interpretations" edge IDs in the mutation.

func (*ScaleMutation) ItemsCleared

func (m *ScaleMutation) ItemsCleared() bool

ItemsCleared reports if the "items" edge to the Item entity was cleared.

func (*ScaleMutation) ItemsIDs

func (m *ScaleMutation) ItemsIDs() (ids []uuid.UUID)

ItemsIDs returns the "items" edge IDs in the mutation.

func (*ScaleMutation) NormsCleared

func (m *ScaleMutation) NormsCleared() bool

NormsCleared reports if the "norms" edge to the Norm entity was cleared.

func (*ScaleMutation) NormsIDs

func (m *ScaleMutation) NormsIDs() (ids []uuid.UUID)

NormsIDs returns the "norms" edge IDs in the mutation.

func (*ScaleMutation) OldCode

func (m *ScaleMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Scale entity. If the Scale 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 (*ScaleMutation) OldCreateTime

func (m *ScaleMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Scale entity. If the Scale 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 (*ScaleMutation) OldField

func (m *ScaleMutation) 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 (*ScaleMutation) OldGlobal

func (m *ScaleMutation) OldGlobal(ctx context.Context) (v bool, err error)

OldGlobal returns the old "global" field's value of the Scale entity. If the Scale 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 (*ScaleMutation) OldType

func (m *ScaleMutation) OldType(ctx context.Context) (v scale.Type, err error)

OldType returns the old "type" field's value of the Scale entity. If the Scale 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 (*ScaleMutation) OldUpdateTime

func (m *ScaleMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Scale entity. If the Scale 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 (*ScaleMutation) Op

func (m *ScaleMutation) Op() Op

Op returns the operation name.

func (*ScaleMutation) RemoveInterpretationIDs

func (m *ScaleMutation) RemoveInterpretationIDs(ids ...uuid.UUID)

RemoveInterpretationIDs removes the "interpretations" edge to the Interpretation entity by IDs.

func (*ScaleMutation) RemoveItemIDs

func (m *ScaleMutation) RemoveItemIDs(ids ...uuid.UUID)

RemoveItemIDs removes the "items" edge to the Item entity by IDs.

func (*ScaleMutation) RemoveNormIDs

func (m *ScaleMutation) RemoveNormIDs(ids ...uuid.UUID)

RemoveNormIDs removes the "norms" edge to the Norm entity by IDs.

func (*ScaleMutation) RemoveResultIDs

func (m *ScaleMutation) RemoveResultIDs(ids ...uuid.UUID)

RemoveResultIDs removes the "results" edge to the Result entity by IDs.

func (*ScaleMutation) RemoveTestIDs

func (m *ScaleMutation) RemoveTestIDs(ids ...uuid.UUID)

RemoveTestIDs removes the "test" edge to the Test entity by IDs.

func (*ScaleMutation) RemoveTranslationIDs

func (m *ScaleMutation) RemoveTranslationIDs(ids ...uuid.UUID)

RemoveTranslationIDs removes the "translations" edge to the ScaleTranslation entity by IDs.

func (*ScaleMutation) RemovedEdges

func (m *ScaleMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ScaleMutation) RemovedIDs

func (m *ScaleMutation) 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 (*ScaleMutation) RemovedInterpretationsIDs

func (m *ScaleMutation) RemovedInterpretationsIDs() (ids []uuid.UUID)

RemovedInterpretations returns the removed IDs of the "interpretations" edge to the Interpretation entity.

func (*ScaleMutation) RemovedItemsIDs

func (m *ScaleMutation) RemovedItemsIDs() (ids []uuid.UUID)

RemovedItems returns the removed IDs of the "items" edge to the Item entity.

func (*ScaleMutation) RemovedNormsIDs

func (m *ScaleMutation) RemovedNormsIDs() (ids []uuid.UUID)

RemovedNorms returns the removed IDs of the "norms" edge to the Norm entity.

func (*ScaleMutation) RemovedResultsIDs

func (m *ScaleMutation) RemovedResultsIDs() (ids []uuid.UUID)

RemovedResults returns the removed IDs of the "results" edge to the Result entity.

func (*ScaleMutation) RemovedTestIDs

func (m *ScaleMutation) RemovedTestIDs() (ids []uuid.UUID)

RemovedTest returns the removed IDs of the "test" edge to the Test entity.

func (*ScaleMutation) RemovedTranslationsIDs

func (m *ScaleMutation) RemovedTranslationsIDs() (ids []uuid.UUID)

RemovedTranslations returns the removed IDs of the "translations" edge to the ScaleTranslation entity.

func (*ScaleMutation) ResetCode

func (m *ScaleMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*ScaleMutation) ResetCreateTime

func (m *ScaleMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ScaleMutation) ResetEdge

func (m *ScaleMutation) 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 (*ScaleMutation) ResetField

func (m *ScaleMutation) 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 (*ScaleMutation) ResetGlobal

func (m *ScaleMutation) ResetGlobal()

ResetGlobal resets all changes to the "global" field.

func (*ScaleMutation) ResetInterpretations

func (m *ScaleMutation) ResetInterpretations()

ResetInterpretations resets all changes to the "interpretations" edge.

func (*ScaleMutation) ResetItems

func (m *ScaleMutation) ResetItems()

ResetItems resets all changes to the "items" edge.

func (*ScaleMutation) ResetNorms

func (m *ScaleMutation) ResetNorms()

ResetNorms resets all changes to the "norms" edge.

func (*ScaleMutation) ResetResults

func (m *ScaleMutation) ResetResults()

ResetResults resets all changes to the "results" edge.

func (*ScaleMutation) ResetTest

func (m *ScaleMutation) ResetTest()

ResetTest resets all changes to the "test" edge.

func (*ScaleMutation) ResetTranslations

func (m *ScaleMutation) ResetTranslations()

ResetTranslations resets all changes to the "translations" edge.

func (*ScaleMutation) ResetType

func (m *ScaleMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ScaleMutation) ResetUpdateTime

func (m *ScaleMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ScaleMutation) ResultsCleared

func (m *ScaleMutation) ResultsCleared() bool

ResultsCleared reports if the "results" edge to the Result entity was cleared.

func (*ScaleMutation) ResultsIDs

func (m *ScaleMutation) ResultsIDs() (ids []uuid.UUID)

ResultsIDs returns the "results" edge IDs in the mutation.

func (*ScaleMutation) SetCode

func (m *ScaleMutation) SetCode(s string)

SetCode sets the "code" field.

func (*ScaleMutation) SetCreateTime

func (m *ScaleMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ScaleMutation) SetField

func (m *ScaleMutation) 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 (*ScaleMutation) SetGlobal

func (m *ScaleMutation) SetGlobal(b bool)

SetGlobal sets the "global" field.

func (*ScaleMutation) SetID

func (m *ScaleMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Scale entities.

func (*ScaleMutation) SetType

func (m *ScaleMutation) SetType(s scale.Type)

SetType sets the "type" field.

func (*ScaleMutation) SetUpdateTime

func (m *ScaleMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ScaleMutation) TestCleared

func (m *ScaleMutation) TestCleared() bool

TestCleared reports if the "test" edge to the Test entity was cleared.

func (*ScaleMutation) TestIDs

func (m *ScaleMutation) TestIDs() (ids []uuid.UUID)

TestIDs returns the "test" edge IDs in the mutation.

func (*ScaleMutation) TranslationsCleared

func (m *ScaleMutation) TranslationsCleared() bool

TranslationsCleared reports if the "translations" edge to the ScaleTranslation entity was cleared.

func (*ScaleMutation) TranslationsIDs

func (m *ScaleMutation) TranslationsIDs() (ids []uuid.UUID)

TranslationsIDs returns the "translations" edge IDs in the mutation.

func (ScaleMutation) Tx

func (m ScaleMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ScaleMutation) Type

func (m *ScaleMutation) Type() string

Type returns the node type of this mutation (Scale).

func (*ScaleMutation) UpdateTime

func (m *ScaleMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ScaleMutation) Where

func (m *ScaleMutation) Where(ps ...predicate.Scale)

Where appends a list predicates to the ScaleMutation builder.

type ScaleQuery

type ScaleQuery struct {
	// contains filtered or unexported fields
}

ScaleQuery is the builder for querying Scale entities.

func (*ScaleQuery) All

func (sq *ScaleQuery) All(ctx context.Context) ([]*Scale, error)

All executes the query and returns a list of Scales.

func (*ScaleQuery) AllX

func (sq *ScaleQuery) AllX(ctx context.Context) []*Scale

AllX is like All, but panics if an error occurs.

func (*ScaleQuery) Clone

func (sq *ScaleQuery) Clone() *ScaleQuery

Clone returns a duplicate of the ScaleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ScaleQuery) Count

func (sq *ScaleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ScaleQuery) CountX

func (sq *ScaleQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ScaleQuery) Exist

func (sq *ScaleQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ScaleQuery) ExistX

func (sq *ScaleQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ScaleQuery) First

func (sq *ScaleQuery) First(ctx context.Context) (*Scale, error)

First returns the first Scale entity from the query. Returns a *NotFoundError when no Scale was found.

func (*ScaleQuery) FirstID

func (sq *ScaleQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Scale ID from the query. Returns a *NotFoundError when no Scale ID was found.

func (*ScaleQuery) FirstIDX

func (sq *ScaleQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ScaleQuery) FirstX

func (sq *ScaleQuery) FirstX(ctx context.Context) *Scale

FirstX is like First, but panics if an error occurs.

func (*ScaleQuery) GroupBy

func (sq *ScaleQuery) GroupBy(field string, fields ...string) *ScaleGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Scale.Query().
	GroupBy(scale.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ScaleQuery) IDs

func (sq *ScaleQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Scale IDs.

func (*ScaleQuery) IDsX

func (sq *ScaleQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ScaleQuery) Limit

func (sq *ScaleQuery) Limit(limit int) *ScaleQuery

Limit adds a limit step to the query.

func (*ScaleQuery) Offset

func (sq *ScaleQuery) Offset(offset int) *ScaleQuery

Offset adds an offset step to the query.

func (*ScaleQuery) Only

func (sq *ScaleQuery) Only(ctx context.Context) (*Scale, error)

Only returns a single Scale entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Scale entity is found. Returns a *NotFoundError when no Scale entities are found.

func (*ScaleQuery) OnlyID

func (sq *ScaleQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Scale ID in the query. Returns a *NotSingularError when more than one Scale ID is found. Returns a *NotFoundError when no entities are found.

func (*ScaleQuery) OnlyIDX

func (sq *ScaleQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ScaleQuery) OnlyX

func (sq *ScaleQuery) OnlyX(ctx context.Context) *Scale

OnlyX is like Only, but panics if an error occurs.

func (*ScaleQuery) Order

func (sq *ScaleQuery) Order(o ...OrderFunc) *ScaleQuery

Order adds an order step to the query.

func (*ScaleQuery) QueryInterpretations

func (sq *ScaleQuery) QueryInterpretations() *InterpretationQuery

QueryInterpretations chains the current query on the "interpretations" edge.

func (*ScaleQuery) QueryItems

func (sq *ScaleQuery) QueryItems() *ItemQuery

QueryItems chains the current query on the "items" edge.

func (*ScaleQuery) QueryNorms

func (sq *ScaleQuery) QueryNorms() *NormQuery

QueryNorms chains the current query on the "norms" edge.

func (*ScaleQuery) QueryResults

func (sq *ScaleQuery) QueryResults() *ResultQuery

QueryResults chains the current query on the "results" edge.

func (*ScaleQuery) QueryScaleItem

func (sq *ScaleQuery) QueryScaleItem() *ScaleItemQuery

QueryScaleItem chains the current query on the "scale_item" edge.

func (*ScaleQuery) QueryTest

func (sq *ScaleQuery) QueryTest() *TestQuery

QueryTest chains the current query on the "test" edge.

func (*ScaleQuery) QueryTranslations

func (sq *ScaleQuery) QueryTranslations() *ScaleTranslationQuery

QueryTranslations chains the current query on the "translations" edge.

func (*ScaleQuery) Select

func (sq *ScaleQuery) Select(fields ...string) *ScaleSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Scale.Query().
	Select(scale.FieldCreateTime).
	Scan(ctx, &v)

func (*ScaleQuery) Unique

func (sq *ScaleQuery) Unique(unique bool) *ScaleQuery

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 (*ScaleQuery) Where

func (sq *ScaleQuery) Where(ps ...predicate.Scale) *ScaleQuery

Where adds a new predicate for the ScaleQuery builder.

func (*ScaleQuery) WithInterpretations

func (sq *ScaleQuery) WithInterpretations(opts ...func(*InterpretationQuery)) *ScaleQuery

WithInterpretations tells the query-builder to eager-load the nodes that are connected to the "interpretations" edge. The optional arguments are used to configure the query builder of the edge.

func (*ScaleQuery) WithItems

func (sq *ScaleQuery) WithItems(opts ...func(*ItemQuery)) *ScaleQuery

WithItems tells the query-builder to eager-load the nodes that are connected to the "items" edge. The optional arguments are used to configure the query builder of the edge.

func (*ScaleQuery) WithNorms

func (sq *ScaleQuery) WithNorms(opts ...func(*NormQuery)) *ScaleQuery

WithNorms tells the query-builder to eager-load the nodes that are connected to the "norms" edge. The optional arguments are used to configure the query builder of the edge.

func (*ScaleQuery) WithResults

func (sq *ScaleQuery) WithResults(opts ...func(*ResultQuery)) *ScaleQuery

WithResults tells the query-builder to eager-load the nodes that are connected to the "results" edge. The optional arguments are used to configure the query builder of the edge.

func (*ScaleQuery) WithScaleItem

func (sq *ScaleQuery) WithScaleItem(opts ...func(*ScaleItemQuery)) *ScaleQuery

WithScaleItem tells the query-builder to eager-load the nodes that are connected to the "scale_item" edge. The optional arguments are used to configure the query builder of the edge.

func (*ScaleQuery) WithTest

func (sq *ScaleQuery) WithTest(opts ...func(*TestQuery)) *ScaleQuery

WithTest tells the query-builder to eager-load the nodes that are connected to the "test" edge. The optional arguments are used to configure the query builder of the edge.

func (*ScaleQuery) WithTranslations

func (sq *ScaleQuery) WithTranslations(opts ...func(*ScaleTranslationQuery)) *ScaleQuery

WithTranslations tells the query-builder to eager-load the nodes that are connected to the "translations" edge. The optional arguments are used to configure the query builder of the edge.

type ScaleSelect

type ScaleSelect struct {
	*ScaleQuery
	// contains filtered or unexported fields
}

ScaleSelect is the builder for selecting fields of Scale entities.

func (*ScaleSelect) Bool

func (s *ScaleSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScaleSelect) BoolX

func (s *ScaleSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScaleSelect) Bools

func (s *ScaleSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScaleSelect) BoolsX

func (s *ScaleSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScaleSelect) Float64

func (s *ScaleSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScaleSelect) Float64X

func (s *ScaleSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScaleSelect) Float64s

func (s *ScaleSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScaleSelect) Float64sX

func (s *ScaleSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScaleSelect) Int

func (s *ScaleSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScaleSelect) IntX

func (s *ScaleSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScaleSelect) Ints

func (s *ScaleSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScaleSelect) IntsX

func (s *ScaleSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScaleSelect) Scan

func (ss *ScaleSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*ScaleSelect) ScanX

func (s *ScaleSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ScaleSelect) String

func (s *ScaleSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScaleSelect) StringX

func (s *ScaleSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScaleSelect) Strings

func (s *ScaleSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScaleSelect) StringsX

func (s *ScaleSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScaleTranslation

type ScaleTranslation struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Locale holds the value of the "locale" field.
	Locale scaletranslation.Locale `json:"locale,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Abbreviation holds the value of the "abbreviation" field.
	Abbreviation string `json:"abbreviation,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ScaleTranslationQuery when eager-loading is set.
	Edges ScaleTranslationEdges `json:"edges"`
	// contains filtered or unexported fields
}

ScaleTranslation is the model entity for the ScaleTranslation schema.

func (*ScaleTranslation) QueryScale

func (st *ScaleTranslation) QueryScale() *ScaleQuery

QueryScale queries the "scale" edge of the ScaleTranslation entity.

func (*ScaleTranslation) String

func (st *ScaleTranslation) String() string

String implements the fmt.Stringer.

func (*ScaleTranslation) Unwrap

func (st *ScaleTranslation) Unwrap() *ScaleTranslation

Unwrap unwraps the ScaleTranslation 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 (*ScaleTranslation) Update

Update returns a builder for updating this ScaleTranslation. Note that you need to call ScaleTranslation.Unwrap() before calling this method if this ScaleTranslation was returned from a transaction, and the transaction was committed or rolled back.

type ScaleTranslationClient

type ScaleTranslationClient struct {
	// contains filtered or unexported fields
}

ScaleTranslationClient is a client for the ScaleTranslation schema.

func NewScaleTranslationClient

func NewScaleTranslationClient(c config) *ScaleTranslationClient

NewScaleTranslationClient returns a client for the ScaleTranslation from the given config.

func (*ScaleTranslationClient) Create

Create returns a builder for creating a ScaleTranslation entity.

func (*ScaleTranslationClient) CreateBulk

CreateBulk returns a builder for creating a bulk of ScaleTranslation entities.

func (*ScaleTranslationClient) Delete

Delete returns a delete builder for ScaleTranslation.

func (*ScaleTranslationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ScaleTranslationClient) DeleteOneID

DeleteOne returns a builder for deleting the given entity by its id.

func (*ScaleTranslationClient) Get

Get returns a ScaleTranslation entity by its id.

func (*ScaleTranslationClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ScaleTranslationClient) Hooks

func (c *ScaleTranslationClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ScaleTranslationClient) Query

Query returns a query builder for ScaleTranslation.

func (*ScaleTranslationClient) QueryScale

QueryScale queries the scale edge of a ScaleTranslation.

func (*ScaleTranslationClient) Update

Update returns an update builder for ScaleTranslation.

func (*ScaleTranslationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ScaleTranslationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ScaleTranslationClient) Use

func (c *ScaleTranslationClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `scaletranslation.Hooks(f(g(h())))`.

type ScaleTranslationCreate

type ScaleTranslationCreate struct {
	// contains filtered or unexported fields
}

ScaleTranslationCreate is the builder for creating a ScaleTranslation entity.

func (*ScaleTranslationCreate) Exec

Exec executes the query.

func (*ScaleTranslationCreate) ExecX

func (stc *ScaleTranslationCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleTranslationCreate) Mutation

Mutation returns the ScaleTranslationMutation object of the builder.

func (*ScaleTranslationCreate) Save

Save creates the ScaleTranslation in the database.

func (*ScaleTranslationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ScaleTranslationCreate) SetAbbreviation

func (stc *ScaleTranslationCreate) SetAbbreviation(s string) *ScaleTranslationCreate

SetAbbreviation sets the "abbreviation" field.

func (*ScaleTranslationCreate) SetDescription

func (stc *ScaleTranslationCreate) SetDescription(s string) *ScaleTranslationCreate

SetDescription sets the "description" field.

func (*ScaleTranslationCreate) SetID

SetID sets the "id" field.

func (*ScaleTranslationCreate) SetLocale

SetLocale sets the "locale" field.

func (*ScaleTranslationCreate) SetNillableAbbreviation

func (stc *ScaleTranslationCreate) SetNillableAbbreviation(s *string) *ScaleTranslationCreate

SetNillableAbbreviation sets the "abbreviation" field if the given value is not nil.

func (*ScaleTranslationCreate) SetNillableDescription

func (stc *ScaleTranslationCreate) SetNillableDescription(s *string) *ScaleTranslationCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ScaleTranslationCreate) SetNillableID

func (stc *ScaleTranslationCreate) SetNillableID(u *uuid.UUID) *ScaleTranslationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ScaleTranslationCreate) SetNillableScaleID

func (stc *ScaleTranslationCreate) SetNillableScaleID(id *uuid.UUID) *ScaleTranslationCreate

SetNillableScaleID sets the "scale" edge to the Scale entity by ID if the given value is not nil.

func (*ScaleTranslationCreate) SetScale

SetScale sets the "scale" edge to the Scale entity.

func (*ScaleTranslationCreate) SetScaleID

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*ScaleTranslationCreate) SetTitle

SetTitle sets the "title" field.

type ScaleTranslationCreateBulk

type ScaleTranslationCreateBulk struct {
	// contains filtered or unexported fields
}

ScaleTranslationCreateBulk is the builder for creating many ScaleTranslation entities in bulk.

func (*ScaleTranslationCreateBulk) Exec

Exec executes the query.

func (*ScaleTranslationCreateBulk) ExecX

func (stcb *ScaleTranslationCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleTranslationCreateBulk) Save

Save creates the ScaleTranslation entities in the database.

func (*ScaleTranslationCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type ScaleTranslationDelete

type ScaleTranslationDelete struct {
	// contains filtered or unexported fields
}

ScaleTranslationDelete is the builder for deleting a ScaleTranslation entity.

func (*ScaleTranslationDelete) Exec

func (std *ScaleTranslationDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ScaleTranslationDelete) ExecX

func (std *ScaleTranslationDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ScaleTranslationDelete) Where

Where appends a list predicates to the ScaleTranslationDelete builder.

type ScaleTranslationDeleteOne

type ScaleTranslationDeleteOne struct {
	// contains filtered or unexported fields
}

ScaleTranslationDeleteOne is the builder for deleting a single ScaleTranslation entity.

func (*ScaleTranslationDeleteOne) Exec

Exec executes the deletion query.

func (*ScaleTranslationDeleteOne) ExecX

func (stdo *ScaleTranslationDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ScaleTranslationEdges

type ScaleTranslationEdges struct {
	// Scale holds the value of the scale edge.
	Scale *Scale `json:"scale,omitempty"`
	// contains filtered or unexported fields
}

ScaleTranslationEdges holds the relations/edges for other nodes in the graph.

func (ScaleTranslationEdges) ScaleOrErr

func (e ScaleTranslationEdges) ScaleOrErr() (*Scale, error)

ScaleOrErr returns the Scale value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ScaleTranslationGroupBy

type ScaleTranslationGroupBy struct {
	// contains filtered or unexported fields
}

ScaleTranslationGroupBy is the group-by builder for ScaleTranslation entities.

func (*ScaleTranslationGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*ScaleTranslationGroupBy) Bool

func (s *ScaleTranslationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationGroupBy) BoolX

func (s *ScaleTranslationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScaleTranslationGroupBy) Bools

func (s *ScaleTranslationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationGroupBy) BoolsX

func (s *ScaleTranslationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScaleTranslationGroupBy) Float64

func (s *ScaleTranslationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationGroupBy) Float64X

func (s *ScaleTranslationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScaleTranslationGroupBy) Float64s

func (s *ScaleTranslationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationGroupBy) Float64sX

func (s *ScaleTranslationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScaleTranslationGroupBy) Int

func (s *ScaleTranslationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationGroupBy) IntX

func (s *ScaleTranslationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScaleTranslationGroupBy) Ints

func (s *ScaleTranslationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationGroupBy) IntsX

func (s *ScaleTranslationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScaleTranslationGroupBy) Scan

func (stgb *ScaleTranslationGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ScaleTranslationGroupBy) ScanX

func (s *ScaleTranslationGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ScaleTranslationGroupBy) String

func (s *ScaleTranslationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationGroupBy) StringX

func (s *ScaleTranslationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScaleTranslationGroupBy) Strings

func (s *ScaleTranslationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationGroupBy) StringsX

func (s *ScaleTranslationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScaleTranslationMutation

type ScaleTranslationMutation struct {
	// contains filtered or unexported fields
}

ScaleTranslationMutation represents an operation that mutates the ScaleTranslation nodes in the graph.

func (*ScaleTranslationMutation) Abbreviation

func (m *ScaleTranslationMutation) Abbreviation() (r string, exists bool)

Abbreviation returns the value of the "abbreviation" field in the mutation.

func (*ScaleTranslationMutation) AddField

func (m *ScaleTranslationMutation) 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 (*ScaleTranslationMutation) AddedEdges

func (m *ScaleTranslationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ScaleTranslationMutation) AddedField

func (m *ScaleTranslationMutation) 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 (*ScaleTranslationMutation) AddedFields

func (m *ScaleTranslationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ScaleTranslationMutation) AddedIDs

func (m *ScaleTranslationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ScaleTranslationMutation) ClearDescription

func (m *ScaleTranslationMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ScaleTranslationMutation) ClearEdge

func (m *ScaleTranslationMutation) 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 (*ScaleTranslationMutation) ClearField

func (m *ScaleTranslationMutation) 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 (*ScaleTranslationMutation) ClearScale

func (m *ScaleTranslationMutation) ClearScale()

ClearScale clears the "scale" edge to the Scale entity.

func (*ScaleTranslationMutation) ClearedEdges

func (m *ScaleTranslationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ScaleTranslationMutation) ClearedFields

func (m *ScaleTranslationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ScaleTranslationMutation) Client

func (m ScaleTranslationMutation) 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 (*ScaleTranslationMutation) Description

func (m *ScaleTranslationMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ScaleTranslationMutation) DescriptionCleared

func (m *ScaleTranslationMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*ScaleTranslationMutation) EdgeCleared

func (m *ScaleTranslationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ScaleTranslationMutation) Field

func (m *ScaleTranslationMutation) 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 (*ScaleTranslationMutation) FieldCleared

func (m *ScaleTranslationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ScaleTranslationMutation) Fields

func (m *ScaleTranslationMutation) 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 (*ScaleTranslationMutation) ID

func (m *ScaleTranslationMutation) ID() (id uuid.UUID, 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 (*ScaleTranslationMutation) IDs

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 (*ScaleTranslationMutation) Locale

func (m *ScaleTranslationMutation) Locale() (r scaletranslation.Locale, exists bool)

Locale returns the value of the "locale" field in the mutation.

func (*ScaleTranslationMutation) OldAbbreviation

func (m *ScaleTranslationMutation) OldAbbreviation(ctx context.Context) (v string, err error)

OldAbbreviation returns the old "abbreviation" field's value of the ScaleTranslation entity. If the ScaleTranslation 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 (*ScaleTranslationMutation) OldDescription

func (m *ScaleTranslationMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the ScaleTranslation entity. If the ScaleTranslation 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 (*ScaleTranslationMutation) OldField

func (m *ScaleTranslationMutation) 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 (*ScaleTranslationMutation) OldLocale

OldLocale returns the old "locale" field's value of the ScaleTranslation entity. If the ScaleTranslation 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 (*ScaleTranslationMutation) OldTitle

func (m *ScaleTranslationMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the ScaleTranslation entity. If the ScaleTranslation 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 (*ScaleTranslationMutation) Op

func (m *ScaleTranslationMutation) Op() Op

Op returns the operation name.

func (*ScaleTranslationMutation) RemovedEdges

func (m *ScaleTranslationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ScaleTranslationMutation) RemovedIDs

func (m *ScaleTranslationMutation) 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 (*ScaleTranslationMutation) ResetAbbreviation

func (m *ScaleTranslationMutation) ResetAbbreviation()

ResetAbbreviation resets all changes to the "abbreviation" field.

func (*ScaleTranslationMutation) ResetDescription

func (m *ScaleTranslationMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ScaleTranslationMutation) ResetEdge

func (m *ScaleTranslationMutation) 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 (*ScaleTranslationMutation) ResetField

func (m *ScaleTranslationMutation) 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 (*ScaleTranslationMutation) ResetLocale

func (m *ScaleTranslationMutation) ResetLocale()

ResetLocale resets all changes to the "locale" field.

func (*ScaleTranslationMutation) ResetScale

func (m *ScaleTranslationMutation) ResetScale()

ResetScale resets all changes to the "scale" edge.

func (*ScaleTranslationMutation) ResetTitle

func (m *ScaleTranslationMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*ScaleTranslationMutation) ScaleCleared

func (m *ScaleTranslationMutation) ScaleCleared() bool

ScaleCleared reports if the "scale" edge to the Scale entity was cleared.

func (*ScaleTranslationMutation) ScaleID

func (m *ScaleTranslationMutation) ScaleID() (id uuid.UUID, exists bool)

ScaleID returns the "scale" edge ID in the mutation.

func (*ScaleTranslationMutation) ScaleIDs

func (m *ScaleTranslationMutation) ScaleIDs() (ids []uuid.UUID)

ScaleIDs returns the "scale" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ScaleID instead. It exists only for internal usage by the builders.

func (*ScaleTranslationMutation) SetAbbreviation

func (m *ScaleTranslationMutation) SetAbbreviation(s string)

SetAbbreviation sets the "abbreviation" field.

func (*ScaleTranslationMutation) SetDescription

func (m *ScaleTranslationMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ScaleTranslationMutation) SetField

func (m *ScaleTranslationMutation) 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 (*ScaleTranslationMutation) SetID

func (m *ScaleTranslationMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ScaleTranslation entities.

func (*ScaleTranslationMutation) SetLocale

SetLocale sets the "locale" field.

func (*ScaleTranslationMutation) SetScaleID

func (m *ScaleTranslationMutation) SetScaleID(id uuid.UUID)

SetScaleID sets the "scale" edge to the Scale entity by id.

func (*ScaleTranslationMutation) SetTitle

func (m *ScaleTranslationMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*ScaleTranslationMutation) Title

func (m *ScaleTranslationMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (ScaleTranslationMutation) Tx

func (m ScaleTranslationMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ScaleTranslationMutation) Type

func (m *ScaleTranslationMutation) Type() string

Type returns the node type of this mutation (ScaleTranslation).

func (*ScaleTranslationMutation) Where

Where appends a list predicates to the ScaleTranslationMutation builder.

type ScaleTranslationQuery

type ScaleTranslationQuery struct {
	// contains filtered or unexported fields
}

ScaleTranslationQuery is the builder for querying ScaleTranslation entities.

func (*ScaleTranslationQuery) All

All executes the query and returns a list of ScaleTranslations.

func (*ScaleTranslationQuery) AllX

AllX is like All, but panics if an error occurs.

func (*ScaleTranslationQuery) Clone

Clone returns a duplicate of the ScaleTranslationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ScaleTranslationQuery) Count

func (stq *ScaleTranslationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ScaleTranslationQuery) CountX

func (stq *ScaleTranslationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ScaleTranslationQuery) Exist

func (stq *ScaleTranslationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ScaleTranslationQuery) ExistX

func (stq *ScaleTranslationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ScaleTranslationQuery) First

First returns the first ScaleTranslation entity from the query. Returns a *NotFoundError when no ScaleTranslation was found.

func (*ScaleTranslationQuery) FirstID

func (stq *ScaleTranslationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first ScaleTranslation ID from the query. Returns a *NotFoundError when no ScaleTranslation ID was found.

func (*ScaleTranslationQuery) FirstIDX

func (stq *ScaleTranslationQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ScaleTranslationQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*ScaleTranslationQuery) GroupBy

func (stq *ScaleTranslationQuery) GroupBy(field string, fields ...string) *ScaleTranslationGroupBy

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 {
	Locale scaletranslation.Locale `json:"locale,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ScaleTranslation.Query().
	GroupBy(scaletranslation.FieldLocale).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ScaleTranslationQuery) IDs

func (stq *ScaleTranslationQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of ScaleTranslation IDs.

func (*ScaleTranslationQuery) IDsX

func (stq *ScaleTranslationQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ScaleTranslationQuery) Limit

func (stq *ScaleTranslationQuery) Limit(limit int) *ScaleTranslationQuery

Limit adds a limit step to the query.

func (*ScaleTranslationQuery) Offset

func (stq *ScaleTranslationQuery) Offset(offset int) *ScaleTranslationQuery

Offset adds an offset step to the query.

func (*ScaleTranslationQuery) Only

Only returns a single ScaleTranslation entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ScaleTranslation entity is found. Returns a *NotFoundError when no ScaleTranslation entities are found.

func (*ScaleTranslationQuery) OnlyID

func (stq *ScaleTranslationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only ScaleTranslation ID in the query. Returns a *NotSingularError when more than one ScaleTranslation ID is found. Returns a *NotFoundError when no entities are found.

func (*ScaleTranslationQuery) OnlyIDX

func (stq *ScaleTranslationQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ScaleTranslationQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*ScaleTranslationQuery) Order

Order adds an order step to the query.

func (*ScaleTranslationQuery) QueryScale

func (stq *ScaleTranslationQuery) QueryScale() *ScaleQuery

QueryScale chains the current query on the "scale" edge.

func (*ScaleTranslationQuery) Select

func (stq *ScaleTranslationQuery) Select(fields ...string) *ScaleTranslationSelect

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 {
	Locale scaletranslation.Locale `json:"locale,omitempty"`
}

client.ScaleTranslation.Query().
	Select(scaletranslation.FieldLocale).
	Scan(ctx, &v)

func (*ScaleTranslationQuery) Unique

func (stq *ScaleTranslationQuery) Unique(unique bool) *ScaleTranslationQuery

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 (*ScaleTranslationQuery) Where

Where adds a new predicate for the ScaleTranslationQuery builder.

func (*ScaleTranslationQuery) WithScale

func (stq *ScaleTranslationQuery) WithScale(opts ...func(*ScaleQuery)) *ScaleTranslationQuery

WithScale tells the query-builder to eager-load the nodes that are connected to the "scale" edge. The optional arguments are used to configure the query builder of the edge.

type ScaleTranslationSelect

type ScaleTranslationSelect struct {
	*ScaleTranslationQuery
	// contains filtered or unexported fields
}

ScaleTranslationSelect is the builder for selecting fields of ScaleTranslation entities.

func (*ScaleTranslationSelect) Bool

func (s *ScaleTranslationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationSelect) BoolX

func (s *ScaleTranslationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ScaleTranslationSelect) Bools

func (s *ScaleTranslationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationSelect) BoolsX

func (s *ScaleTranslationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ScaleTranslationSelect) Float64

func (s *ScaleTranslationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationSelect) Float64X

func (s *ScaleTranslationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ScaleTranslationSelect) Float64s

func (s *ScaleTranslationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationSelect) Float64sX

func (s *ScaleTranslationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ScaleTranslationSelect) Int

func (s *ScaleTranslationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationSelect) IntX

func (s *ScaleTranslationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ScaleTranslationSelect) Ints

func (s *ScaleTranslationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationSelect) IntsX

func (s *ScaleTranslationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ScaleTranslationSelect) Scan

func (sts *ScaleTranslationSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*ScaleTranslationSelect) ScanX

func (s *ScaleTranslationSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ScaleTranslationSelect) String

func (s *ScaleTranslationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationSelect) StringX

func (s *ScaleTranslationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ScaleTranslationSelect) Strings

func (s *ScaleTranslationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ScaleTranslationSelect) StringsX

func (s *ScaleTranslationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ScaleTranslationUpdate

type ScaleTranslationUpdate struct {
	// contains filtered or unexported fields
}

ScaleTranslationUpdate is the builder for updating ScaleTranslation entities.

func (*ScaleTranslationUpdate) ClearDescription

func (stu *ScaleTranslationUpdate) ClearDescription() *ScaleTranslationUpdate

ClearDescription clears the value of the "description" field.

func (*ScaleTranslationUpdate) ClearScale

ClearScale clears the "scale" edge to the Scale entity.

func (*ScaleTranslationUpdate) Exec

Exec executes the query.

func (*ScaleTranslationUpdate) ExecX

func (stu *ScaleTranslationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleTranslationUpdate) Mutation

Mutation returns the ScaleTranslationMutation object of the builder.

func (*ScaleTranslationUpdate) Save

func (stu *ScaleTranslationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ScaleTranslationUpdate) SaveX

func (stu *ScaleTranslationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ScaleTranslationUpdate) SetAbbreviation

func (stu *ScaleTranslationUpdate) SetAbbreviation(s string) *ScaleTranslationUpdate

SetAbbreviation sets the "abbreviation" field.

func (*ScaleTranslationUpdate) SetDescription

func (stu *ScaleTranslationUpdate) SetDescription(s string) *ScaleTranslationUpdate

SetDescription sets the "description" field.

func (*ScaleTranslationUpdate) SetNillableAbbreviation

func (stu *ScaleTranslationUpdate) SetNillableAbbreviation(s *string) *ScaleTranslationUpdate

SetNillableAbbreviation sets the "abbreviation" field if the given value is not nil.

func (*ScaleTranslationUpdate) SetNillableDescription

func (stu *ScaleTranslationUpdate) SetNillableDescription(s *string) *ScaleTranslationUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ScaleTranslationUpdate) SetNillableScaleID

func (stu *ScaleTranslationUpdate) SetNillableScaleID(id *uuid.UUID) *ScaleTranslationUpdate

SetNillableScaleID sets the "scale" edge to the Scale entity by ID if the given value is not nil.

func (*ScaleTranslationUpdate) SetScale

SetScale sets the "scale" edge to the Scale entity.

func (*ScaleTranslationUpdate) SetScaleID

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*ScaleTranslationUpdate) SetTitle

SetTitle sets the "title" field.

func (*ScaleTranslationUpdate) Where

Where appends a list predicates to the ScaleTranslationUpdate builder.

type ScaleTranslationUpdateOne

type ScaleTranslationUpdateOne struct {
	// contains filtered or unexported fields
}

ScaleTranslationUpdateOne is the builder for updating a single ScaleTranslation entity.

func (*ScaleTranslationUpdateOne) ClearDescription

func (stuo *ScaleTranslationUpdateOne) ClearDescription() *ScaleTranslationUpdateOne

ClearDescription clears the value of the "description" field.

func (*ScaleTranslationUpdateOne) ClearScale

ClearScale clears the "scale" edge to the Scale entity.

func (*ScaleTranslationUpdateOne) Exec

Exec executes the query on the entity.

func (*ScaleTranslationUpdateOne) ExecX

func (stuo *ScaleTranslationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleTranslationUpdateOne) Mutation

Mutation returns the ScaleTranslationMutation object of the builder.

func (*ScaleTranslationUpdateOne) Save

Save executes the query and returns the updated ScaleTranslation entity.

func (*ScaleTranslationUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ScaleTranslationUpdateOne) Select

func (stuo *ScaleTranslationUpdateOne) Select(field string, fields ...string) *ScaleTranslationUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ScaleTranslationUpdateOne) SetAbbreviation

SetAbbreviation sets the "abbreviation" field.

func (*ScaleTranslationUpdateOne) SetDescription

SetDescription sets the "description" field.

func (*ScaleTranslationUpdateOne) SetNillableAbbreviation

func (stuo *ScaleTranslationUpdateOne) SetNillableAbbreviation(s *string) *ScaleTranslationUpdateOne

SetNillableAbbreviation sets the "abbreviation" field if the given value is not nil.

func (*ScaleTranslationUpdateOne) SetNillableDescription

func (stuo *ScaleTranslationUpdateOne) SetNillableDescription(s *string) *ScaleTranslationUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ScaleTranslationUpdateOne) SetNillableScaleID

func (stuo *ScaleTranslationUpdateOne) SetNillableScaleID(id *uuid.UUID) *ScaleTranslationUpdateOne

SetNillableScaleID sets the "scale" edge to the Scale entity by ID if the given value is not nil.

func (*ScaleTranslationUpdateOne) SetScale

SetScale sets the "scale" edge to the Scale entity.

func (*ScaleTranslationUpdateOne) SetScaleID

SetScaleID sets the "scale" edge to the Scale entity by ID.

func (*ScaleTranslationUpdateOne) SetTitle

SetTitle sets the "title" field.

type ScaleTranslations

type ScaleTranslations []*ScaleTranslation

ScaleTranslations is a parsable slice of ScaleTranslation.

type ScaleUpdate

type ScaleUpdate struct {
	// contains filtered or unexported fields
}

ScaleUpdate is the builder for updating Scale entities.

func (*ScaleUpdate) AddInterpretationIDs

func (su *ScaleUpdate) AddInterpretationIDs(ids ...uuid.UUID) *ScaleUpdate

AddInterpretationIDs adds the "interpretations" edge to the Interpretation entity by IDs.

func (*ScaleUpdate) AddInterpretations

func (su *ScaleUpdate) AddInterpretations(i ...*Interpretation) *ScaleUpdate

AddInterpretations adds the "interpretations" edges to the Interpretation entity.

func (*ScaleUpdate) AddItemIDs

func (su *ScaleUpdate) AddItemIDs(ids ...uuid.UUID) *ScaleUpdate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*ScaleUpdate) AddItems

func (su *ScaleUpdate) AddItems(i ...*Item) *ScaleUpdate

AddItems adds the "items" edges to the Item entity.

func (*ScaleUpdate) AddNormIDs

func (su *ScaleUpdate) AddNormIDs(ids ...uuid.UUID) *ScaleUpdate

AddNormIDs adds the "norms" edge to the Norm entity by IDs.

func (*ScaleUpdate) AddNorms

func (su *ScaleUpdate) AddNorms(n ...*Norm) *ScaleUpdate

AddNorms adds the "norms" edges to the Norm entity.

func (*ScaleUpdate) AddResultIDs

func (su *ScaleUpdate) AddResultIDs(ids ...uuid.UUID) *ScaleUpdate

AddResultIDs adds the "results" edge to the Result entity by IDs.

func (*ScaleUpdate) AddResults

func (su *ScaleUpdate) AddResults(r ...*Result) *ScaleUpdate

AddResults adds the "results" edges to the Result entity.

func (*ScaleUpdate) AddTest

func (su *ScaleUpdate) AddTest(t ...*Test) *ScaleUpdate

AddTest adds the "test" edges to the Test entity.

func (*ScaleUpdate) AddTestIDs

func (su *ScaleUpdate) AddTestIDs(ids ...uuid.UUID) *ScaleUpdate

AddTestIDs adds the "test" edge to the Test entity by IDs.

func (*ScaleUpdate) AddTranslationIDs

func (su *ScaleUpdate) AddTranslationIDs(ids ...uuid.UUID) *ScaleUpdate

AddTranslationIDs adds the "translations" edge to the ScaleTranslation entity by IDs.

func (*ScaleUpdate) AddTranslations

func (su *ScaleUpdate) AddTranslations(s ...*ScaleTranslation) *ScaleUpdate

AddTranslations adds the "translations" edges to the ScaleTranslation entity.

func (*ScaleUpdate) ClearInterpretations

func (su *ScaleUpdate) ClearInterpretations() *ScaleUpdate

ClearInterpretations clears all "interpretations" edges to the Interpretation entity.

func (*ScaleUpdate) ClearItems

func (su *ScaleUpdate) ClearItems() *ScaleUpdate

ClearItems clears all "items" edges to the Item entity.

func (*ScaleUpdate) ClearNorms

func (su *ScaleUpdate) ClearNorms() *ScaleUpdate

ClearNorms clears all "norms" edges to the Norm entity.

func (*ScaleUpdate) ClearResults

func (su *ScaleUpdate) ClearResults() *ScaleUpdate

ClearResults clears all "results" edges to the Result entity.

func (*ScaleUpdate) ClearTest

func (su *ScaleUpdate) ClearTest() *ScaleUpdate

ClearTest clears all "test" edges to the Test entity.

func (*ScaleUpdate) ClearTranslations

func (su *ScaleUpdate) ClearTranslations() *ScaleUpdate

ClearTranslations clears all "translations" edges to the ScaleTranslation entity.

func (*ScaleUpdate) Exec

func (su *ScaleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScaleUpdate) ExecX

func (su *ScaleUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleUpdate) Mutation

func (su *ScaleUpdate) Mutation() *ScaleMutation

Mutation returns the ScaleMutation object of the builder.

func (*ScaleUpdate) RemoveInterpretationIDs

func (su *ScaleUpdate) RemoveInterpretationIDs(ids ...uuid.UUID) *ScaleUpdate

RemoveInterpretationIDs removes the "interpretations" edge to Interpretation entities by IDs.

func (*ScaleUpdate) RemoveInterpretations

func (su *ScaleUpdate) RemoveInterpretations(i ...*Interpretation) *ScaleUpdate

RemoveInterpretations removes "interpretations" edges to Interpretation entities.

func (*ScaleUpdate) RemoveItemIDs

func (su *ScaleUpdate) RemoveItemIDs(ids ...uuid.UUID) *ScaleUpdate

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*ScaleUpdate) RemoveItems

func (su *ScaleUpdate) RemoveItems(i ...*Item) *ScaleUpdate

RemoveItems removes "items" edges to Item entities.

func (*ScaleUpdate) RemoveNormIDs

func (su *ScaleUpdate) RemoveNormIDs(ids ...uuid.UUID) *ScaleUpdate

RemoveNormIDs removes the "norms" edge to Norm entities by IDs.

func (*ScaleUpdate) RemoveNorms

func (su *ScaleUpdate) RemoveNorms(n ...*Norm) *ScaleUpdate

RemoveNorms removes "norms" edges to Norm entities.

func (*ScaleUpdate) RemoveResultIDs

func (su *ScaleUpdate) RemoveResultIDs(ids ...uuid.UUID) *ScaleUpdate

RemoveResultIDs removes the "results" edge to Result entities by IDs.

func (*ScaleUpdate) RemoveResults

func (su *ScaleUpdate) RemoveResults(r ...*Result) *ScaleUpdate

RemoveResults removes "results" edges to Result entities.

func (*ScaleUpdate) RemoveTest

func (su *ScaleUpdate) RemoveTest(t ...*Test) *ScaleUpdate

RemoveTest removes "test" edges to Test entities.

func (*ScaleUpdate) RemoveTestIDs

func (su *ScaleUpdate) RemoveTestIDs(ids ...uuid.UUID) *ScaleUpdate

RemoveTestIDs removes the "test" edge to Test entities by IDs.

func (*ScaleUpdate) RemoveTranslationIDs

func (su *ScaleUpdate) RemoveTranslationIDs(ids ...uuid.UUID) *ScaleUpdate

RemoveTranslationIDs removes the "translations" edge to ScaleTranslation entities by IDs.

func (*ScaleUpdate) RemoveTranslations

func (su *ScaleUpdate) RemoveTranslations(s ...*ScaleTranslation) *ScaleUpdate

RemoveTranslations removes "translations" edges to ScaleTranslation entities.

func (*ScaleUpdate) Save

func (su *ScaleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ScaleUpdate) SaveX

func (su *ScaleUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ScaleUpdate) SetGlobal

func (su *ScaleUpdate) SetGlobal(b bool) *ScaleUpdate

SetGlobal sets the "global" field.

func (*ScaleUpdate) SetNillableGlobal

func (su *ScaleUpdate) SetNillableGlobal(b *bool) *ScaleUpdate

SetNillableGlobal sets the "global" field if the given value is not nil.

func (*ScaleUpdate) SetNillableType

func (su *ScaleUpdate) SetNillableType(s *scale.Type) *ScaleUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*ScaleUpdate) SetType

func (su *ScaleUpdate) SetType(s scale.Type) *ScaleUpdate

SetType sets the "type" field.

func (*ScaleUpdate) SetUpdateTime

func (su *ScaleUpdate) SetUpdateTime(t time.Time) *ScaleUpdate

SetUpdateTime sets the "update_time" field.

func (*ScaleUpdate) Where

func (su *ScaleUpdate) Where(ps ...predicate.Scale) *ScaleUpdate

Where appends a list predicates to the ScaleUpdate builder.

type ScaleUpdateOne

type ScaleUpdateOne struct {
	// contains filtered or unexported fields
}

ScaleUpdateOne is the builder for updating a single Scale entity.

func (*ScaleUpdateOne) AddInterpretationIDs

func (suo *ScaleUpdateOne) AddInterpretationIDs(ids ...uuid.UUID) *ScaleUpdateOne

AddInterpretationIDs adds the "interpretations" edge to the Interpretation entity by IDs.

func (*ScaleUpdateOne) AddInterpretations

func (suo *ScaleUpdateOne) AddInterpretations(i ...*Interpretation) *ScaleUpdateOne

AddInterpretations adds the "interpretations" edges to the Interpretation entity.

func (*ScaleUpdateOne) AddItemIDs

func (suo *ScaleUpdateOne) AddItemIDs(ids ...uuid.UUID) *ScaleUpdateOne

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*ScaleUpdateOne) AddItems

func (suo *ScaleUpdateOne) AddItems(i ...*Item) *ScaleUpdateOne

AddItems adds the "items" edges to the Item entity.

func (*ScaleUpdateOne) AddNormIDs

func (suo *ScaleUpdateOne) AddNormIDs(ids ...uuid.UUID) *ScaleUpdateOne

AddNormIDs adds the "norms" edge to the Norm entity by IDs.

func (*ScaleUpdateOne) AddNorms

func (suo *ScaleUpdateOne) AddNorms(n ...*Norm) *ScaleUpdateOne

AddNorms adds the "norms" edges to the Norm entity.

func (*ScaleUpdateOne) AddResultIDs

func (suo *ScaleUpdateOne) AddResultIDs(ids ...uuid.UUID) *ScaleUpdateOne

AddResultIDs adds the "results" edge to the Result entity by IDs.

func (*ScaleUpdateOne) AddResults

func (suo *ScaleUpdateOne) AddResults(r ...*Result) *ScaleUpdateOne

AddResults adds the "results" edges to the Result entity.

func (*ScaleUpdateOne) AddTest

func (suo *ScaleUpdateOne) AddTest(t ...*Test) *ScaleUpdateOne

AddTest adds the "test" edges to the Test entity.

func (*ScaleUpdateOne) AddTestIDs

func (suo *ScaleUpdateOne) AddTestIDs(ids ...uuid.UUID) *ScaleUpdateOne

AddTestIDs adds the "test" edge to the Test entity by IDs.

func (*ScaleUpdateOne) AddTranslationIDs

func (suo *ScaleUpdateOne) AddTranslationIDs(ids ...uuid.UUID) *ScaleUpdateOne

AddTranslationIDs adds the "translations" edge to the ScaleTranslation entity by IDs.

func (*ScaleUpdateOne) AddTranslations

func (suo *ScaleUpdateOne) AddTranslations(s ...*ScaleTranslation) *ScaleUpdateOne

AddTranslations adds the "translations" edges to the ScaleTranslation entity.

func (*ScaleUpdateOne) ClearInterpretations

func (suo *ScaleUpdateOne) ClearInterpretations() *ScaleUpdateOne

ClearInterpretations clears all "interpretations" edges to the Interpretation entity.

func (*ScaleUpdateOne) ClearItems

func (suo *ScaleUpdateOne) ClearItems() *ScaleUpdateOne

ClearItems clears all "items" edges to the Item entity.

func (*ScaleUpdateOne) ClearNorms

func (suo *ScaleUpdateOne) ClearNorms() *ScaleUpdateOne

ClearNorms clears all "norms" edges to the Norm entity.

func (*ScaleUpdateOne) ClearResults

func (suo *ScaleUpdateOne) ClearResults() *ScaleUpdateOne

ClearResults clears all "results" edges to the Result entity.

func (*ScaleUpdateOne) ClearTest

func (suo *ScaleUpdateOne) ClearTest() *ScaleUpdateOne

ClearTest clears all "test" edges to the Test entity.

func (*ScaleUpdateOne) ClearTranslations

func (suo *ScaleUpdateOne) ClearTranslations() *ScaleUpdateOne

ClearTranslations clears all "translations" edges to the ScaleTranslation entity.

func (*ScaleUpdateOne) Exec

func (suo *ScaleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ScaleUpdateOne) ExecX

func (suo *ScaleUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ScaleUpdateOne) Mutation

func (suo *ScaleUpdateOne) Mutation() *ScaleMutation

Mutation returns the ScaleMutation object of the builder.

func (*ScaleUpdateOne) RemoveInterpretationIDs

func (suo *ScaleUpdateOne) RemoveInterpretationIDs(ids ...uuid.UUID) *ScaleUpdateOne

RemoveInterpretationIDs removes the "interpretations" edge to Interpretation entities by IDs.

func (*ScaleUpdateOne) RemoveInterpretations

func (suo *ScaleUpdateOne) RemoveInterpretations(i ...*Interpretation) *ScaleUpdateOne

RemoveInterpretations removes "interpretations" edges to Interpretation entities.

func (*ScaleUpdateOne) RemoveItemIDs

func (suo *ScaleUpdateOne) RemoveItemIDs(ids ...uuid.UUID) *ScaleUpdateOne

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*ScaleUpdateOne) RemoveItems

func (suo *ScaleUpdateOne) RemoveItems(i ...*Item) *ScaleUpdateOne

RemoveItems removes "items" edges to Item entities.

func (*ScaleUpdateOne) RemoveNormIDs

func (suo *ScaleUpdateOne) RemoveNormIDs(ids ...uuid.UUID) *ScaleUpdateOne

RemoveNormIDs removes the "norms" edge to Norm entities by IDs.

func (*ScaleUpdateOne) RemoveNorms

func (suo *ScaleUpdateOne) RemoveNorms(n ...*Norm) *ScaleUpdateOne

RemoveNorms removes "norms" edges to Norm entities.

func (*ScaleUpdateOne) RemoveResultIDs

func (suo *ScaleUpdateOne) RemoveResultIDs(ids ...uuid.UUID) *ScaleUpdateOne

RemoveResultIDs removes the "results" edge to Result entities by IDs.

func (*ScaleUpdateOne) RemoveResults

func (suo *ScaleUpdateOne) RemoveResults(r ...*Result) *ScaleUpdateOne

RemoveResults removes "results" edges to Result entities.

func (*ScaleUpdateOne) RemoveTest

func (suo *ScaleUpdateOne) RemoveTest(t ...*Test) *ScaleUpdateOne

RemoveTest removes "test" edges to Test entities.

func (*ScaleUpdateOne) RemoveTestIDs

func (suo *ScaleUpdateOne) RemoveTestIDs(ids ...uuid.UUID) *ScaleUpdateOne

RemoveTestIDs removes the "test" edge to Test entities by IDs.

func (*ScaleUpdateOne) RemoveTranslationIDs

func (suo *ScaleUpdateOne) RemoveTranslationIDs(ids ...uuid.UUID) *ScaleUpdateOne

RemoveTranslationIDs removes the "translations" edge to ScaleTranslation entities by IDs.

func (*ScaleUpdateOne) RemoveTranslations

func (suo *ScaleUpdateOne) RemoveTranslations(s ...*ScaleTranslation) *ScaleUpdateOne

RemoveTranslations removes "translations" edges to ScaleTranslation entities.

func (*ScaleUpdateOne) Save

func (suo *ScaleUpdateOne) Save(ctx context.Context) (*Scale, error)

Save executes the query and returns the updated Scale entity.

func (*ScaleUpdateOne) SaveX

func (suo *ScaleUpdateOne) SaveX(ctx context.Context) *Scale

SaveX is like Save, but panics if an error occurs.

func (*ScaleUpdateOne) Select

func (suo *ScaleUpdateOne) Select(field string, fields ...string) *ScaleUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ScaleUpdateOne) SetGlobal

func (suo *ScaleUpdateOne) SetGlobal(b bool) *ScaleUpdateOne

SetGlobal sets the "global" field.

func (*ScaleUpdateOne) SetNillableGlobal

func (suo *ScaleUpdateOne) SetNillableGlobal(b *bool) *ScaleUpdateOne

SetNillableGlobal sets the "global" field if the given value is not nil.

func (*ScaleUpdateOne) SetNillableType

func (suo *ScaleUpdateOne) SetNillableType(s *scale.Type) *ScaleUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*ScaleUpdateOne) SetType

func (suo *ScaleUpdateOne) SetType(s scale.Type) *ScaleUpdateOne

SetType sets the "type" field.

func (*ScaleUpdateOne) SetUpdateTime

func (suo *ScaleUpdateOne) SetUpdateTime(t time.Time) *ScaleUpdateOne

SetUpdateTime sets the "update_time" field.

type Scales

type Scales []*Scale

Scales is a parsable slice of Scale.

type Tag

type Tag struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Code holds the value of the "code" field.
	Code string `json:"code,omitempty"`
	// Type holds the value of the "type" field.
	Type tag.Type `json:"type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TagQuery when eager-loading is set.
	Edges TagEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tag is the model entity for the Tag schema.

func (*Tag) QueryTest

func (t *Tag) QueryTest() *TestQuery

QueryTest queries the "test" edge of the Tag entity.

func (*Tag) QueryTranslations

func (t *Tag) QueryTranslations() *TagTranslationQuery

QueryTranslations queries the "translations" edge of the Tag entity.

func (*Tag) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

Unwrap unwraps the Tag 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 (*Tag) Update

func (t *Tag) Update() *TagUpdateOne

Update returns a builder for updating this Tag. Note that you need to call Tag.Unwrap() before calling this method if this Tag was returned from a transaction, and the transaction was committed or rolled back.

type TagClient

type TagClient struct {
	// contains filtered or unexported fields
}

TagClient is a client for the Tag schema.

func NewTagClient

func NewTagClient(c config) *TagClient

NewTagClient returns a client for the Tag from the given config.

func (*TagClient) Create

func (c *TagClient) Create() *TagCreate

Create returns a builder for creating a Tag entity.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

CreateBulk returns a builder for creating a bulk of Tag entities.

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

func (*TagClient) DeleteOne

func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TagClient) DeleteOneID

func (c *TagClient) DeleteOneID(id uuid.UUID) *TagDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*TagClient) Get

func (c *TagClient) Get(ctx context.Context, id uuid.UUID) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id uuid.UUID) *Tag

GetX is like Get, but panics if an error occurs.

func (*TagClient) Hooks

func (c *TagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TagClient) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryTest

func (c *TagClient) QueryTest(t *Tag) *TestQuery

QueryTest queries the test edge of a Tag.

func (*TagClient) QueryTranslations

func (c *TagClient) QueryTranslations(t *Tag) *TagTranslationQuery

QueryTranslations queries the translations edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for Tag.

func (*TagClient) UpdateOne

func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagClient) UpdateOneID

func (c *TagClient) UpdateOneID(id uuid.UUID) *TagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TagClient) Use

func (c *TagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tag.Hooks(f(g(h())))`.

type TagCreate

type TagCreate struct {
	// contains filtered or unexported fields
}

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) AddTest

func (tc *TagCreate) AddTest(t ...*Test) *TagCreate

AddTest adds the "test" edges to the Test entity.

func (*TagCreate) AddTestIDs

func (tc *TagCreate) AddTestIDs(ids ...uuid.UUID) *TagCreate

AddTestIDs adds the "test" edge to the Test entity by IDs.

func (*TagCreate) AddTranslationIDs

func (tc *TagCreate) AddTranslationIDs(ids ...uuid.UUID) *TagCreate

AddTranslationIDs adds the "translations" edge to the TagTranslation entity by IDs.

func (*TagCreate) AddTranslations

func (tc *TagCreate) AddTranslations(t ...*TagTranslation) *TagCreate

AddTranslations adds the "translations" edges to the TagTranslation entity.

func (*TagCreate) Exec

func (tc *TagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreate) ExecX

func (tc *TagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetCode

func (tc *TagCreate) SetCode(s string) *TagCreate

SetCode sets the "code" field.

func (*TagCreate) SetCreateTime

func (tc *TagCreate) SetCreateTime(t time.Time) *TagCreate

SetCreateTime sets the "create_time" field.

func (*TagCreate) SetID

func (tc *TagCreate) SetID(u uuid.UUID) *TagCreate

SetID sets the "id" field.

func (*TagCreate) SetNillableCreateTime

func (tc *TagCreate) SetNillableCreateTime(t *time.Time) *TagCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TagCreate) SetNillableID

func (tc *TagCreate) SetNillableID(u *uuid.UUID) *TagCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TagCreate) SetNillableType

func (tc *TagCreate) SetNillableType(t *tag.Type) *TagCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*TagCreate) SetNillableUpdateTime

func (tc *TagCreate) SetNillableUpdateTime(t *time.Time) *TagCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*TagCreate) SetType

func (tc *TagCreate) SetType(t tag.Type) *TagCreate

SetType sets the "type" field.

func (*TagCreate) SetUpdateTime

func (tc *TagCreate) SetUpdateTime(t time.Time) *TagCreate

SetUpdateTime sets the "update_time" field.

type TagCreateBulk

type TagCreateBulk struct {
	// contains filtered or unexported fields
}

TagCreateBulk is the builder for creating many Tag entities in bulk.

func (*TagCreateBulk) Exec

func (tcb *TagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreateBulk) ExecX

func (tcb *TagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

SaveX is like Save, but panics if an error occurs.

type TagDelete

type TagDelete struct {
	// contains filtered or unexported fields
}

TagDelete is the builder for deleting a Tag entity.

func (*TagDelete) Exec

func (td *TagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TagDelete) ExecX

func (td *TagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where appends a list predicates to the TagDelete builder.

type TagDeleteOne

type TagDeleteOne struct {
	// contains filtered or unexported fields
}

TagDeleteOne is the builder for deleting a single Tag entity.

func (*TagDeleteOne) Exec

func (tdo *TagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TagDeleteOne) ExecX

func (tdo *TagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TagEdges

type TagEdges struct {
	// Translations holds the value of the translations edge.
	Translations []*TagTranslation `json:"translations,omitempty"`
	// Test holds the value of the test edge.
	Test []*Test `json:"test,omitempty"`
	// contains filtered or unexported fields
}

TagEdges holds the relations/edges for other nodes in the graph.

func (TagEdges) TestOrErr

func (e TagEdges) TestOrErr() ([]*Test, error)

TestOrErr returns the Test value or an error if the edge was not loaded in eager-loading.

func (TagEdges) TranslationsOrErr

func (e TagEdges) TranslationsOrErr() ([]*TagTranslation, error)

TranslationsOrErr returns the Translations value or an error if the edge was not loaded in eager-loading.

type TagGroupBy

type TagGroupBy struct {
	// contains filtered or unexported fields
}

TagGroupBy is the group-by builder for Tag entities.

func (*TagGroupBy) Aggregate

func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TagGroupBy) Bool

func (s *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolX

func (s *TagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagGroupBy) Bools

func (s *TagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolsX

func (s *TagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagGroupBy) Float64

func (s *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64X

func (s *TagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagGroupBy) Float64s

func (s *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64sX

func (s *TagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagGroupBy) Int

func (s *TagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntX

func (s *TagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagGroupBy) Ints

func (s *TagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntsX

func (s *TagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagGroupBy) Scan

func (tgb *TagGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TagGroupBy) ScanX

func (s *TagGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TagGroupBy) String

func (s *TagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringX

func (s *TagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagGroupBy) Strings

func (s *TagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringsX

func (s *TagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagMutation

type TagMutation struct {
	// contains filtered or unexported fields
}

TagMutation represents an operation that mutates the Tag nodes in the graph.

func (*TagMutation) AddField

func (m *TagMutation) 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 (*TagMutation) AddTestIDs

func (m *TagMutation) AddTestIDs(ids ...uuid.UUID)

AddTestIDs adds the "test" edge to the Test entity by ids.

func (*TagMutation) AddTranslationIDs

func (m *TagMutation) AddTranslationIDs(ids ...uuid.UUID)

AddTranslationIDs adds the "translations" edge to the TagTranslation entity by ids.

func (*TagMutation) AddedEdges

func (m *TagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TagMutation) AddedField

func (m *TagMutation) 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 (*TagMutation) AddedFields

func (m *TagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TagMutation) AddedIDs

func (m *TagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TagMutation) ClearEdge

func (m *TagMutation) 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 (*TagMutation) ClearField

func (m *TagMutation) 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 (*TagMutation) ClearTest

func (m *TagMutation) ClearTest()

ClearTest clears the "test" edge to the Test entity.

func (*TagMutation) ClearTranslations

func (m *TagMutation) ClearTranslations()

ClearTranslations clears the "translations" edge to the TagTranslation entity.

func (*TagMutation) ClearedEdges

func (m *TagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TagMutation) ClearedFields

func (m *TagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TagMutation) Client

func (m TagMutation) 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 (*TagMutation) Code

func (m *TagMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*TagMutation) CreateTime

func (m *TagMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*TagMutation) EdgeCleared

func (m *TagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TagMutation) Field

func (m *TagMutation) 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 (*TagMutation) FieldCleared

func (m *TagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TagMutation) Fields

func (m *TagMutation) 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 (*TagMutation) GetType

func (m *TagMutation) GetType() (r tag.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*TagMutation) ID

func (m *TagMutation) ID() (id uuid.UUID, 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 (*TagMutation) IDs

func (m *TagMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*TagMutation) OldCode

func (m *TagMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Tag entity. If the Tag 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 (*TagMutation) OldCreateTime

func (m *TagMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Tag entity. If the Tag 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 (*TagMutation) OldField

func (m *TagMutation) 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 (*TagMutation) OldType

func (m *TagMutation) OldType(ctx context.Context) (v tag.Type, err error)

OldType returns the old "type" field's value of the Tag entity. If the Tag 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 (*TagMutation) OldUpdateTime

func (m *TagMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Tag entity. If the Tag 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 (*TagMutation) Op

func (m *TagMutation) Op() Op

Op returns the operation name.

func (*TagMutation) RemoveTestIDs

func (m *TagMutation) RemoveTestIDs(ids ...uuid.UUID)

RemoveTestIDs removes the "test" edge to the Test entity by IDs.

func (*TagMutation) RemoveTranslationIDs

func (m *TagMutation) RemoveTranslationIDs(ids ...uuid.UUID)

RemoveTranslationIDs removes the "translations" edge to the TagTranslation entity by IDs.

func (*TagMutation) RemovedEdges

func (m *TagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TagMutation) RemovedIDs

func (m *TagMutation) 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 (*TagMutation) RemovedTestIDs

func (m *TagMutation) RemovedTestIDs() (ids []uuid.UUID)

RemovedTest returns the removed IDs of the "test" edge to the Test entity.

func (*TagMutation) RemovedTranslationsIDs

func (m *TagMutation) RemovedTranslationsIDs() (ids []uuid.UUID)

RemovedTranslations returns the removed IDs of the "translations" edge to the TagTranslation entity.

func (*TagMutation) ResetCode

func (m *TagMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*TagMutation) ResetCreateTime

func (m *TagMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*TagMutation) ResetEdge

func (m *TagMutation) 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 (*TagMutation) ResetField

func (m *TagMutation) 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 (*TagMutation) ResetTest

func (m *TagMutation) ResetTest()

ResetTest resets all changes to the "test" edge.

func (*TagMutation) ResetTranslations

func (m *TagMutation) ResetTranslations()

ResetTranslations resets all changes to the "translations" edge.

func (*TagMutation) ResetType

func (m *TagMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*TagMutation) ResetUpdateTime

func (m *TagMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*TagMutation) SetCode

func (m *TagMutation) SetCode(s string)

SetCode sets the "code" field.

func (*TagMutation) SetCreateTime

func (m *TagMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*TagMutation) SetField

func (m *TagMutation) 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 (*TagMutation) SetID

func (m *TagMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Tag entities.

func (*TagMutation) SetType

func (m *TagMutation) SetType(t tag.Type)

SetType sets the "type" field.

func (*TagMutation) SetUpdateTime

func (m *TagMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*TagMutation) TestCleared

func (m *TagMutation) TestCleared() bool

TestCleared reports if the "test" edge to the Test entity was cleared.

func (*TagMutation) TestIDs

func (m *TagMutation) TestIDs() (ids []uuid.UUID)

TestIDs returns the "test" edge IDs in the mutation.

func (*TagMutation) TranslationsCleared

func (m *TagMutation) TranslationsCleared() bool

TranslationsCleared reports if the "translations" edge to the TagTranslation entity was cleared.

func (*TagMutation) TranslationsIDs

func (m *TagMutation) TranslationsIDs() (ids []uuid.UUID)

TranslationsIDs returns the "translations" edge IDs in the mutation.

func (TagMutation) Tx

func (m TagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TagMutation) Type

func (m *TagMutation) Type() string

Type returns the node type of this mutation (Tag).

func (*TagMutation) UpdateTime

func (m *TagMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*TagMutation) Where

func (m *TagMutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the TagMutation builder.

type TagQuery

type TagQuery struct {
	// contains filtered or unexported fields
}

TagQuery is the builder for querying Tag entities.

func (*TagQuery) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

AllX is like All, but panics if an error occurs.

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

Clone returns a duplicate of the TagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TagQuery) Count

func (tq *TagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagQuery) CountX

func (tq *TagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TagQuery) Exist

func (tq *TagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TagQuery) ExistX

func (tq *TagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

First returns the first Tag entity from the query. Returns a *NotFoundError when no Tag was found.

func (*TagQuery) FirstID

func (tq *TagQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Tag ID from the query. Returns a *NotFoundError when no Tag ID was found.

func (*TagQuery) FirstIDX

func (tq *TagQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

FirstX is like First, but panics if an error occurs.

func (*TagQuery) GroupBy

func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Tag.Query().
	GroupBy(tag.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TagQuery) IDs

func (tq *TagQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Tag IDs.

func (*TagQuery) IDsX

func (tq *TagQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TagQuery) Limit

func (tq *TagQuery) Limit(limit int) *TagQuery

Limit adds a limit step to the query.

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset adds an offset step to the query.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

Only returns a single Tag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tag entity is found. Returns a *NotFoundError when no Tag entities are found.

func (*TagQuery) OnlyID

func (tq *TagQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Tag ID in the query. Returns a *NotSingularError when more than one Tag ID is found. Returns a *NotFoundError when no entities are found.

func (*TagQuery) OnlyIDX

func (tq *TagQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

OnlyX is like Only, but panics if an error occurs.

func (*TagQuery) Order

func (tq *TagQuery) Order(o ...OrderFunc) *TagQuery

Order adds an order step to the query.

func (*TagQuery) QueryTest

func (tq *TagQuery) QueryTest() *TestQuery

QueryTest chains the current query on the "test" edge.

func (*TagQuery) QueryTranslations

func (tq *TagQuery) QueryTranslations() *TagTranslationQuery

QueryTranslations chains the current query on the "translations" edge.

func (*TagQuery) Select

func (tq *TagQuery) Select(fields ...string) *TagSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Tag.Query().
	Select(tag.FieldCreateTime).
	Scan(ctx, &v)

func (*TagQuery) Unique

func (tq *TagQuery) Unique(unique bool) *TagQuery

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 (*TagQuery) Where

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the TagQuery builder.

func (*TagQuery) WithTest

func (tq *TagQuery) WithTest(opts ...func(*TestQuery)) *TagQuery

WithTest tells the query-builder to eager-load the nodes that are connected to the "test" edge. The optional arguments are used to configure the query builder of the edge.

func (*TagQuery) WithTranslations

func (tq *TagQuery) WithTranslations(opts ...func(*TagTranslationQuery)) *TagQuery

WithTranslations tells the query-builder to eager-load the nodes that are connected to the "translations" edge. The optional arguments are used to configure the query builder of the edge.

type TagSelect

type TagSelect struct {
	*TagQuery
	// contains filtered or unexported fields
}

TagSelect is the builder for selecting fields of Tag entities.

func (*TagSelect) Bool

func (s *TagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolX

func (s *TagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagSelect) Bools

func (s *TagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolsX

func (s *TagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagSelect) Float64

func (s *TagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64X

func (s *TagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagSelect) Float64s

func (s *TagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64sX

func (s *TagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagSelect) Int

func (s *TagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntX

func (s *TagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagSelect) Ints

func (s *TagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntsX

func (s *TagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagSelect) Scan

func (ts *TagSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TagSelect) ScanX

func (s *TagSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TagSelect) String

func (s *TagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringX

func (s *TagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagSelect) Strings

func (s *TagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringsX

func (s *TagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagTranslation

type TagTranslation struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Locale holds the value of the "locale" field.
	Locale tagtranslation.Locale `json:"locale,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TagTranslationQuery when eager-loading is set.
	Edges TagTranslationEdges `json:"edges"`
	// contains filtered or unexported fields
}

TagTranslation is the model entity for the TagTranslation schema.

func (*TagTranslation) QueryTag

func (tt *TagTranslation) QueryTag() *TagQuery

QueryTag queries the "tag" edge of the TagTranslation entity.

func (*TagTranslation) String

func (tt *TagTranslation) String() string

String implements the fmt.Stringer.

func (*TagTranslation) Unwrap

func (tt *TagTranslation) Unwrap() *TagTranslation

Unwrap unwraps the TagTranslation 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 (*TagTranslation) Update

Update returns a builder for updating this TagTranslation. Note that you need to call TagTranslation.Unwrap() before calling this method if this TagTranslation was returned from a transaction, and the transaction was committed or rolled back.

type TagTranslationClient

type TagTranslationClient struct {
	// contains filtered or unexported fields
}

TagTranslationClient is a client for the TagTranslation schema.

func NewTagTranslationClient

func NewTagTranslationClient(c config) *TagTranslationClient

NewTagTranslationClient returns a client for the TagTranslation from the given config.

func (*TagTranslationClient) Create

Create returns a builder for creating a TagTranslation entity.

func (*TagTranslationClient) CreateBulk

CreateBulk returns a builder for creating a bulk of TagTranslation entities.

func (*TagTranslationClient) Delete

Delete returns a delete builder for TagTranslation.

func (*TagTranslationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TagTranslationClient) DeleteOneID

DeleteOne returns a builder for deleting the given entity by its id.

func (*TagTranslationClient) Get

Get returns a TagTranslation entity by its id.

func (*TagTranslationClient) GetX

GetX is like Get, but panics if an error occurs.

func (*TagTranslationClient) Hooks

func (c *TagTranslationClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TagTranslationClient) Query

Query returns a query builder for TagTranslation.

func (*TagTranslationClient) QueryTag

func (c *TagTranslationClient) QueryTag(tt *TagTranslation) *TagQuery

QueryTag queries the tag edge of a TagTranslation.

func (*TagTranslationClient) Update

Update returns an update builder for TagTranslation.

func (*TagTranslationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagTranslationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*TagTranslationClient) Use

func (c *TagTranslationClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tagtranslation.Hooks(f(g(h())))`.

type TagTranslationCreate

type TagTranslationCreate struct {
	// contains filtered or unexported fields
}

TagTranslationCreate is the builder for creating a TagTranslation entity.

func (*TagTranslationCreate) Exec

func (ttc *TagTranslationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagTranslationCreate) ExecX

func (ttc *TagTranslationCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagTranslationCreate) Mutation

Mutation returns the TagTranslationMutation object of the builder.

func (*TagTranslationCreate) Save

Save creates the TagTranslation in the database.

func (*TagTranslationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*TagTranslationCreate) SetContent

func (ttc *TagTranslationCreate) SetContent(s string) *TagTranslationCreate

SetContent sets the "content" field.

func (*TagTranslationCreate) SetID

SetID sets the "id" field.

func (*TagTranslationCreate) SetLocale

SetLocale sets the "locale" field.

func (*TagTranslationCreate) SetNillableID

func (ttc *TagTranslationCreate) SetNillableID(u *uuid.UUID) *TagTranslationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TagTranslationCreate) SetNillableTagID

func (ttc *TagTranslationCreate) SetNillableTagID(id *uuid.UUID) *TagTranslationCreate

SetNillableTagID sets the "tag" edge to the Tag entity by ID if the given value is not nil.

func (*TagTranslationCreate) SetTag

SetTag sets the "tag" edge to the Tag entity.

func (*TagTranslationCreate) SetTagID

SetTagID sets the "tag" edge to the Tag entity by ID.

type TagTranslationCreateBulk

type TagTranslationCreateBulk struct {
	// contains filtered or unexported fields
}

TagTranslationCreateBulk is the builder for creating many TagTranslation entities in bulk.

func (*TagTranslationCreateBulk) Exec

Exec executes the query.

func (*TagTranslationCreateBulk) ExecX

func (ttcb *TagTranslationCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagTranslationCreateBulk) Save

Save creates the TagTranslation entities in the database.

func (*TagTranslationCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type TagTranslationDelete

type TagTranslationDelete struct {
	// contains filtered or unexported fields
}

TagTranslationDelete is the builder for deleting a TagTranslation entity.

func (*TagTranslationDelete) Exec

func (ttd *TagTranslationDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TagTranslationDelete) ExecX

func (ttd *TagTranslationDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TagTranslationDelete) Where

Where appends a list predicates to the TagTranslationDelete builder.

type TagTranslationDeleteOne

type TagTranslationDeleteOne struct {
	// contains filtered or unexported fields
}

TagTranslationDeleteOne is the builder for deleting a single TagTranslation entity.

func (*TagTranslationDeleteOne) Exec

func (ttdo *TagTranslationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TagTranslationDeleteOne) ExecX

func (ttdo *TagTranslationDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TagTranslationEdges

type TagTranslationEdges struct {
	// Tag holds the value of the tag edge.
	Tag *Tag `json:"tag,omitempty"`
	// contains filtered or unexported fields
}

TagTranslationEdges holds the relations/edges for other nodes in the graph.

func (TagTranslationEdges) TagOrErr

func (e TagTranslationEdges) TagOrErr() (*Tag, error)

TagOrErr returns the Tag value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TagTranslationGroupBy

type TagTranslationGroupBy struct {
	// contains filtered or unexported fields
}

TagTranslationGroupBy is the group-by builder for TagTranslation entities.

func (*TagTranslationGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*TagTranslationGroupBy) Bool

func (s *TagTranslationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagTranslationGroupBy) BoolX

func (s *TagTranslationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagTranslationGroupBy) Bools

func (s *TagTranslationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagTranslationGroupBy) BoolsX

func (s *TagTranslationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagTranslationGroupBy) Float64

func (s *TagTranslationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagTranslationGroupBy) Float64X

func (s *TagTranslationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagTranslationGroupBy) Float64s

func (s *TagTranslationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagTranslationGroupBy) Float64sX

func (s *TagTranslationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagTranslationGroupBy) Int

func (s *TagTranslationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagTranslationGroupBy) IntX

func (s *TagTranslationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagTranslationGroupBy) Ints

func (s *TagTranslationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagTranslationGroupBy) IntsX

func (s *TagTranslationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagTranslationGroupBy) Scan

func (ttgb *TagTranslationGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TagTranslationGroupBy) ScanX

func (s *TagTranslationGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TagTranslationGroupBy) String

func (s *TagTranslationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagTranslationGroupBy) StringX

func (s *TagTranslationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagTranslationGroupBy) Strings

func (s *TagTranslationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagTranslationGroupBy) StringsX

func (s *TagTranslationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagTranslationMutation

type TagTranslationMutation struct {
	// contains filtered or unexported fields
}

TagTranslationMutation represents an operation that mutates the TagTranslation nodes in the graph.

func (*TagTranslationMutation) AddField

func (m *TagTranslationMutation) 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 (*TagTranslationMutation) AddedEdges

func (m *TagTranslationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TagTranslationMutation) AddedField

func (m *TagTranslationMutation) 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 (*TagTranslationMutation) AddedFields

func (m *TagTranslationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TagTranslationMutation) AddedIDs

func (m *TagTranslationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TagTranslationMutation) ClearEdge

func (m *TagTranslationMutation) 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 (*TagTranslationMutation) ClearField

func (m *TagTranslationMutation) 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 (*TagTranslationMutation) ClearTag

func (m *TagTranslationMutation) ClearTag()

ClearTag clears the "tag" edge to the Tag entity.

func (*TagTranslationMutation) ClearedEdges

func (m *TagTranslationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TagTranslationMutation) ClearedFields

func (m *TagTranslationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TagTranslationMutation) Client

func (m TagTranslationMutation) 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 (*TagTranslationMutation) Content

func (m *TagTranslationMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*TagTranslationMutation) EdgeCleared

func (m *TagTranslationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TagTranslationMutation) Field

func (m *TagTranslationMutation) 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 (*TagTranslationMutation) FieldCleared

func (m *TagTranslationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TagTranslationMutation) Fields

func (m *TagTranslationMutation) 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 (*TagTranslationMutation) ID

func (m *TagTranslationMutation) ID() (id uuid.UUID, 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 (*TagTranslationMutation) IDs

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 (*TagTranslationMutation) Locale

func (m *TagTranslationMutation) Locale() (r tagtranslation.Locale, exists bool)

Locale returns the value of the "locale" field in the mutation.

func (*TagTranslationMutation) OldContent

func (m *TagTranslationMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the TagTranslation entity. If the TagTranslation 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 (*TagTranslationMutation) OldField

func (m *TagTranslationMutation) 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 (*TagTranslationMutation) OldLocale

func (m *TagTranslationMutation) OldLocale(ctx context.Context) (v tagtranslation.Locale, err error)

OldLocale returns the old "locale" field's value of the TagTranslation entity. If the TagTranslation 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 (*TagTranslationMutation) Op

func (m *TagTranslationMutation) Op() Op

Op returns the operation name.

func (*TagTranslationMutation) RemovedEdges

func (m *TagTranslationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TagTranslationMutation) RemovedIDs

func (m *TagTranslationMutation) 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 (*TagTranslationMutation) ResetContent

func (m *TagTranslationMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*TagTranslationMutation) ResetEdge

func (m *TagTranslationMutation) 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 (*TagTranslationMutation) ResetField

func (m *TagTranslationMutation) 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 (*TagTranslationMutation) ResetLocale

func (m *TagTranslationMutation) ResetLocale()

ResetLocale resets all changes to the "locale" field.

func (*TagTranslationMutation) ResetTag

func (m *TagTranslationMutation) ResetTag()

ResetTag resets all changes to the "tag" edge.

func (*TagTranslationMutation) SetContent

func (m *TagTranslationMutation) SetContent(s string)

SetContent sets the "content" field.

func (*TagTranslationMutation) SetField

func (m *TagTranslationMutation) 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 (*TagTranslationMutation) SetID

func (m *TagTranslationMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of TagTranslation entities.

func (*TagTranslationMutation) SetLocale

SetLocale sets the "locale" field.

func (*TagTranslationMutation) SetTagID

func (m *TagTranslationMutation) SetTagID(id uuid.UUID)

SetTagID sets the "tag" edge to the Tag entity by id.

func (*TagTranslationMutation) TagCleared

func (m *TagTranslationMutation) TagCleared() bool

TagCleared reports if the "tag" edge to the Tag entity was cleared.

func (*TagTranslationMutation) TagID

func (m *TagTranslationMutation) TagID() (id uuid.UUID, exists bool)

TagID returns the "tag" edge ID in the mutation.

func (*TagTranslationMutation) TagIDs

func (m *TagTranslationMutation) TagIDs() (ids []uuid.UUID)

TagIDs returns the "tag" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TagID instead. It exists only for internal usage by the builders.

func (TagTranslationMutation) Tx

func (m TagTranslationMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TagTranslationMutation) Type

func (m *TagTranslationMutation) Type() string

Type returns the node type of this mutation (TagTranslation).

func (*TagTranslationMutation) Where

Where appends a list predicates to the TagTranslationMutation builder.

type TagTranslationQuery

type TagTranslationQuery struct {
	// contains filtered or unexported fields
}

TagTranslationQuery is the builder for querying TagTranslation entities.

func (*TagTranslationQuery) All

All executes the query and returns a list of TagTranslations.

func (*TagTranslationQuery) AllX

AllX is like All, but panics if an error occurs.

func (*TagTranslationQuery) Clone

Clone returns a duplicate of the TagTranslationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TagTranslationQuery) Count

func (ttq *TagTranslationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagTranslationQuery) CountX

func (ttq *TagTranslationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TagTranslationQuery) Exist

func (ttq *TagTranslationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TagTranslationQuery) ExistX

func (ttq *TagTranslationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TagTranslationQuery) First

First returns the first TagTranslation entity from the query. Returns a *NotFoundError when no TagTranslation was found.

func (*TagTranslationQuery) FirstID

func (ttq *TagTranslationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first TagTranslation ID from the query. Returns a *NotFoundError when no TagTranslation ID was found.

func (*TagTranslationQuery) FirstIDX

func (ttq *TagTranslationQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TagTranslationQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*TagTranslationQuery) GroupBy

func (ttq *TagTranslationQuery) GroupBy(field string, fields ...string) *TagTranslationGroupBy

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 {
	Locale tagtranslation.Locale `json:"locale,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TagTranslation.Query().
	GroupBy(tagtranslation.FieldLocale).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TagTranslationQuery) IDs

func (ttq *TagTranslationQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of TagTranslation IDs.

func (*TagTranslationQuery) IDsX

func (ttq *TagTranslationQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TagTranslationQuery) Limit

func (ttq *TagTranslationQuery) Limit(limit int) *TagTranslationQuery

Limit adds a limit step to the query.

func (*TagTranslationQuery) Offset

func (ttq *TagTranslationQuery) Offset(offset int) *TagTranslationQuery

Offset adds an offset step to the query.

func (*TagTranslationQuery) Only

Only returns a single TagTranslation entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TagTranslation entity is found. Returns a *NotFoundError when no TagTranslation entities are found.

func (*TagTranslationQuery) OnlyID

func (ttq *TagTranslationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only TagTranslation ID in the query. Returns a *NotSingularError when more than one TagTranslation ID is found. Returns a *NotFoundError when no entities are found.

func (*TagTranslationQuery) OnlyIDX

func (ttq *TagTranslationQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TagTranslationQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*TagTranslationQuery) Order

Order adds an order step to the query.

func (*TagTranslationQuery) QueryTag

func (ttq *TagTranslationQuery) QueryTag() *TagQuery

QueryTag chains the current query on the "tag" edge.

func (*TagTranslationQuery) Select

func (ttq *TagTranslationQuery) Select(fields ...string) *TagTranslationSelect

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 {
	Locale tagtranslation.Locale `json:"locale,omitempty"`
}

client.TagTranslation.Query().
	Select(tagtranslation.FieldLocale).
	Scan(ctx, &v)

func (*TagTranslationQuery) Unique

func (ttq *TagTranslationQuery) Unique(unique bool) *TagTranslationQuery

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 (*TagTranslationQuery) Where

Where adds a new predicate for the TagTranslationQuery builder.

func (*TagTranslationQuery) WithTag

func (ttq *TagTranslationQuery) WithTag(opts ...func(*TagQuery)) *TagTranslationQuery

WithTag tells the query-builder to eager-load the nodes that are connected to the "tag" edge. The optional arguments are used to configure the query builder of the edge.

type TagTranslationSelect

type TagTranslationSelect struct {
	*TagTranslationQuery
	// contains filtered or unexported fields
}

TagTranslationSelect is the builder for selecting fields of TagTranslation entities.

func (*TagTranslationSelect) Bool

func (s *TagTranslationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagTranslationSelect) BoolX

func (s *TagTranslationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagTranslationSelect) Bools

func (s *TagTranslationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagTranslationSelect) BoolsX

func (s *TagTranslationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagTranslationSelect) Float64

func (s *TagTranslationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagTranslationSelect) Float64X

func (s *TagTranslationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagTranslationSelect) Float64s

func (s *TagTranslationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagTranslationSelect) Float64sX

func (s *TagTranslationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagTranslationSelect) Int

func (s *TagTranslationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagTranslationSelect) IntX

func (s *TagTranslationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagTranslationSelect) Ints

func (s *TagTranslationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagTranslationSelect) IntsX

func (s *TagTranslationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagTranslationSelect) Scan

func (tts *TagTranslationSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TagTranslationSelect) ScanX

func (s *TagTranslationSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TagTranslationSelect) String

func (s *TagTranslationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagTranslationSelect) StringX

func (s *TagTranslationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagTranslationSelect) Strings

func (s *TagTranslationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagTranslationSelect) StringsX

func (s *TagTranslationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagTranslationUpdate

type TagTranslationUpdate struct {
	// contains filtered or unexported fields
}

TagTranslationUpdate is the builder for updating TagTranslation entities.

func (*TagTranslationUpdate) ClearTag

func (ttu *TagTranslationUpdate) ClearTag() *TagTranslationUpdate

ClearTag clears the "tag" edge to the Tag entity.

func (*TagTranslationUpdate) Exec

func (ttu *TagTranslationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagTranslationUpdate) ExecX

func (ttu *TagTranslationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagTranslationUpdate) Mutation

Mutation returns the TagTranslationMutation object of the builder.

func (*TagTranslationUpdate) Save

func (ttu *TagTranslationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TagTranslationUpdate) SaveX

func (ttu *TagTranslationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TagTranslationUpdate) SetContent

func (ttu *TagTranslationUpdate) SetContent(s string) *TagTranslationUpdate

SetContent sets the "content" field.

func (*TagTranslationUpdate) SetNillableTagID

func (ttu *TagTranslationUpdate) SetNillableTagID(id *uuid.UUID) *TagTranslationUpdate

SetNillableTagID sets the "tag" edge to the Tag entity by ID if the given value is not nil.

func (*TagTranslationUpdate) SetTag

SetTag sets the "tag" edge to the Tag entity.

func (*TagTranslationUpdate) SetTagID

SetTagID sets the "tag" edge to the Tag entity by ID.

func (*TagTranslationUpdate) Where

Where appends a list predicates to the TagTranslationUpdate builder.

type TagTranslationUpdateOne

type TagTranslationUpdateOne struct {
	// contains filtered or unexported fields
}

TagTranslationUpdateOne is the builder for updating a single TagTranslation entity.

func (*TagTranslationUpdateOne) ClearTag

ClearTag clears the "tag" edge to the Tag entity.

func (*TagTranslationUpdateOne) Exec

func (ttuo *TagTranslationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TagTranslationUpdateOne) ExecX

func (ttuo *TagTranslationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagTranslationUpdateOne) Mutation

Mutation returns the TagTranslationMutation object of the builder.

func (*TagTranslationUpdateOne) Save

Save executes the query and returns the updated TagTranslation entity.

func (*TagTranslationUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*TagTranslationUpdateOne) Select

func (ttuo *TagTranslationUpdateOne) Select(field string, fields ...string) *TagTranslationUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TagTranslationUpdateOne) SetContent

SetContent sets the "content" field.

func (*TagTranslationUpdateOne) SetNillableTagID

func (ttuo *TagTranslationUpdateOne) SetNillableTagID(id *uuid.UUID) *TagTranslationUpdateOne

SetNillableTagID sets the "tag" edge to the Tag entity by ID if the given value is not nil.

func (*TagTranslationUpdateOne) SetTag

SetTag sets the "tag" edge to the Tag entity.

func (*TagTranslationUpdateOne) SetTagID

SetTagID sets the "tag" edge to the Tag entity by ID.

type TagTranslations

type TagTranslations []*TagTranslation

TagTranslations is a parsable slice of TagTranslation.

type TagUpdate

type TagUpdate struct {
	// contains filtered or unexported fields
}

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddTest

func (tu *TagUpdate) AddTest(t ...*Test) *TagUpdate

AddTest adds the "test" edges to the Test entity.

func (*TagUpdate) AddTestIDs

func (tu *TagUpdate) AddTestIDs(ids ...uuid.UUID) *TagUpdate

AddTestIDs adds the "test" edge to the Test entity by IDs.

func (*TagUpdate) AddTranslationIDs

func (tu *TagUpdate) AddTranslationIDs(ids ...uuid.UUID) *TagUpdate

AddTranslationIDs adds the "translations" edge to the TagTranslation entity by IDs.

func (*TagUpdate) AddTranslations

func (tu *TagUpdate) AddTranslations(t ...*TagTranslation) *TagUpdate

AddTranslations adds the "translations" edges to the TagTranslation entity.

func (*TagUpdate) ClearTest

func (tu *TagUpdate) ClearTest() *TagUpdate

ClearTest clears all "test" edges to the Test entity.

func (*TagUpdate) ClearTranslations

func (tu *TagUpdate) ClearTranslations() *TagUpdate

ClearTranslations clears all "translations" edges to the TagTranslation entity.

func (*TagUpdate) Exec

func (tu *TagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpdate) ExecX

func (tu *TagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) RemoveTest

func (tu *TagUpdate) RemoveTest(t ...*Test) *TagUpdate

RemoveTest removes "test" edges to Test entities.

func (*TagUpdate) RemoveTestIDs

func (tu *TagUpdate) RemoveTestIDs(ids ...uuid.UUID) *TagUpdate

RemoveTestIDs removes the "test" edge to Test entities by IDs.

func (*TagUpdate) RemoveTranslationIDs

func (tu *TagUpdate) RemoveTranslationIDs(ids ...uuid.UUID) *TagUpdate

RemoveTranslationIDs removes the "translations" edge to TagTranslation entities by IDs.

func (*TagUpdate) RemoveTranslations

func (tu *TagUpdate) RemoveTranslations(t ...*TagTranslation) *TagUpdate

RemoveTranslations removes "translations" edges to TagTranslation entities.

func (*TagUpdate) Save

func (tu *TagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TagUpdate) SaveX

func (tu *TagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TagUpdate) SetNillableType

func (tu *TagUpdate) SetNillableType(t *tag.Type) *TagUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*TagUpdate) SetType

func (tu *TagUpdate) SetType(t tag.Type) *TagUpdate

SetType sets the "type" field.

func (*TagUpdate) SetUpdateTime

func (tu *TagUpdate) SetUpdateTime(t time.Time) *TagUpdate

SetUpdateTime sets the "update_time" field.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where appends a list predicates to the TagUpdate builder.

type TagUpdateOne

type TagUpdateOne struct {
	// contains filtered or unexported fields
}

TagUpdateOne is the builder for updating a single Tag entity.

func (*TagUpdateOne) AddTest

func (tuo *TagUpdateOne) AddTest(t ...*Test) *TagUpdateOne

AddTest adds the "test" edges to the Test entity.

func (*TagUpdateOne) AddTestIDs

func (tuo *TagUpdateOne) AddTestIDs(ids ...uuid.UUID) *TagUpdateOne

AddTestIDs adds the "test" edge to the Test entity by IDs.

func (*TagUpdateOne) AddTranslationIDs

func (tuo *TagUpdateOne) AddTranslationIDs(ids ...uuid.UUID) *TagUpdateOne

AddTranslationIDs adds the "translations" edge to the TagTranslation entity by IDs.

func (*TagUpdateOne) AddTranslations

func (tuo *TagUpdateOne) AddTranslations(t ...*TagTranslation) *TagUpdateOne

AddTranslations adds the "translations" edges to the TagTranslation entity.

func (*TagUpdateOne) ClearTest

func (tuo *TagUpdateOne) ClearTest() *TagUpdateOne

ClearTest clears all "test" edges to the Test entity.

func (*TagUpdateOne) ClearTranslations

func (tuo *TagUpdateOne) ClearTranslations() *TagUpdateOne

ClearTranslations clears all "translations" edges to the TagTranslation entity.

func (*TagUpdateOne) Exec

func (tuo *TagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TagUpdateOne) ExecX

func (tuo *TagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdateOne) Mutation

func (tuo *TagUpdateOne) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdateOne) RemoveTest

func (tuo *TagUpdateOne) RemoveTest(t ...*Test) *TagUpdateOne

RemoveTest removes "test" edges to Test entities.

func (*TagUpdateOne) RemoveTestIDs

func (tuo *TagUpdateOne) RemoveTestIDs(ids ...uuid.UUID) *TagUpdateOne

RemoveTestIDs removes the "test" edge to Test entities by IDs.

func (*TagUpdateOne) RemoveTranslationIDs

func (tuo *TagUpdateOne) RemoveTranslationIDs(ids ...uuid.UUID) *TagUpdateOne

RemoveTranslationIDs removes the "translations" edge to TagTranslation entities by IDs.

func (*TagUpdateOne) RemoveTranslations

func (tuo *TagUpdateOne) RemoveTranslations(t ...*TagTranslation) *TagUpdateOne

RemoveTranslations removes "translations" edges to TagTranslation entities.

func (*TagUpdateOne) Save

func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)

Save executes the query and returns the updated Tag entity.

func (*TagUpdateOne) SaveX

func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag

SaveX is like Save, but panics if an error occurs.

func (*TagUpdateOne) Select

func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TagUpdateOne) SetNillableType

func (tuo *TagUpdateOne) SetNillableType(t *tag.Type) *TagUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*TagUpdateOne) SetType

func (tuo *TagUpdateOne) SetType(t tag.Type) *TagUpdateOne

SetType sets the "type" field.

func (*TagUpdateOne) SetUpdateTime

func (tuo *TagUpdateOne) SetUpdateTime(t time.Time) *TagUpdateOne

SetUpdateTime sets the "update_time" field.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

type Take

type Take struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Seed holds the value of the "seed" field.
	Seed int64 `json:"seed,omitempty"`
	// Progress holds the value of the "progress" field.
	Progress int `json:"progress,omitempty"`
	// Page holds the value of the "page" field.
	Page int `json:"page,omitempty"`
	// StartTime holds the value of the "start_time" field.
	StartTime *time.Time `json:"start_time,omitempty"`
	// EndTime holds the value of the "end_time" field.
	EndTime *time.Time `json:"end_time,omitempty"`
	// Suspicious holds the value of the "suspicious" field.
	Suspicious bool `json:"suspicious,omitempty"`
	// Status holds the value of the "status" field.
	Status take.Status `json:"status,omitempty"`
	// Mark holds the value of the "mark" field.
	Mark *int `json:"mark,omitempty"`
	// InLocale holds the value of the "in_locale" field.
	InLocale take.InLocale `json:"in_locale,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TakeQuery when eager-loading is set.
	Edges TakeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Take is the model entity for the Take schema.

func (*Take) QueryResponses

func (t *Take) QueryResponses() *ResponseQuery

QueryResponses queries the "responses" edge of the Take entity.

func (*Take) QueryResults

func (t *Take) QueryResults() *ResultQuery

QueryResults queries the "results" edge of the Take entity.

func (*Take) QueryTest

func (t *Take) QueryTest() *TestQuery

QueryTest queries the "test" edge of the Take entity.

func (*Take) QueryUser

func (t *Take) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Take entity.

func (*Take) String

func (t *Take) String() string

String implements the fmt.Stringer.

func (*Take) Unwrap

func (t *Take) Unwrap() *Take

Unwrap unwraps the Take 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 (*Take) Update

func (t *Take) Update() *TakeUpdateOne

Update returns a builder for updating this Take. Note that you need to call Take.Unwrap() before calling this method if this Take was returned from a transaction, and the transaction was committed or rolled back.

type TakeClient

type TakeClient struct {
	// contains filtered or unexported fields
}

TakeClient is a client for the Take schema.

func NewTakeClient

func NewTakeClient(c config) *TakeClient

NewTakeClient returns a client for the Take from the given config.

func (*TakeClient) Create

func (c *TakeClient) Create() *TakeCreate

Create returns a builder for creating a Take entity.

func (*TakeClient) CreateBulk

func (c *TakeClient) CreateBulk(builders ...*TakeCreate) *TakeCreateBulk

CreateBulk returns a builder for creating a bulk of Take entities.

func (*TakeClient) Delete

func (c *TakeClient) Delete() *TakeDelete

Delete returns a delete builder for Take.

func (*TakeClient) DeleteOne

func (c *TakeClient) DeleteOne(t *Take) *TakeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TakeClient) DeleteOneID

func (c *TakeClient) DeleteOneID(id uuid.UUID) *TakeDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*TakeClient) Get

func (c *TakeClient) Get(ctx context.Context, id uuid.UUID) (*Take, error)

Get returns a Take entity by its id.

func (*TakeClient) GetX

func (c *TakeClient) GetX(ctx context.Context, id uuid.UUID) *Take

GetX is like Get, but panics if an error occurs.

func (*TakeClient) Hooks

func (c *TakeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TakeClient) Query

func (c *TakeClient) Query() *TakeQuery

Query returns a query builder for Take.

func (*TakeClient) QueryResponses

func (c *TakeClient) QueryResponses(t *Take) *ResponseQuery

QueryResponses queries the responses edge of a Take.

func (*TakeClient) QueryResults

func (c *TakeClient) QueryResults(t *Take) *ResultQuery

QueryResults queries the results edge of a Take.

func (*TakeClient) QueryTest

func (c *TakeClient) QueryTest(t *Take) *TestQuery

QueryTest queries the test edge of a Take.

func (*TakeClient) QueryUser

func (c *TakeClient) QueryUser(t *Take) *UserQuery

QueryUser queries the user edge of a Take.

func (*TakeClient) Update

func (c *TakeClient) Update() *TakeUpdate

Update returns an update builder for Take.

func (*TakeClient) UpdateOne

func (c *TakeClient) UpdateOne(t *Take) *TakeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TakeClient) UpdateOneID

func (c *TakeClient) UpdateOneID(id uuid.UUID) *TakeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TakeClient) Use

func (c *TakeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `take.Hooks(f(g(h())))`.

type TakeCreate

type TakeCreate struct {
	// contains filtered or unexported fields
}

TakeCreate is the builder for creating a Take entity.

func (*TakeCreate) AddResponseIDs

func (tc *TakeCreate) AddResponseIDs(ids ...uuid.UUID) *TakeCreate

AddResponseIDs adds the "responses" edge to the Response entity by IDs.

func (*TakeCreate) AddResponses

func (tc *TakeCreate) AddResponses(r ...*Response) *TakeCreate

AddResponses adds the "responses" edges to the Response entity.

func (*TakeCreate) AddResultIDs

func (tc *TakeCreate) AddResultIDs(ids ...uuid.UUID) *TakeCreate

AddResultIDs adds the "results" edge to the Result entity by IDs.

func (*TakeCreate) AddResults

func (tc *TakeCreate) AddResults(r ...*Result) *TakeCreate

AddResults adds the "results" edges to the Result entity.

func (*TakeCreate) Exec

func (tc *TakeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TakeCreate) ExecX

func (tc *TakeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TakeCreate) Mutation

func (tc *TakeCreate) Mutation() *TakeMutation

Mutation returns the TakeMutation object of the builder.

func (*TakeCreate) Save

func (tc *TakeCreate) Save(ctx context.Context) (*Take, error)

Save creates the Take in the database.

func (*TakeCreate) SaveX

func (tc *TakeCreate) SaveX(ctx context.Context) *Take

SaveX calls Save and panics if Save returns an error.

func (*TakeCreate) SetCreateTime

func (tc *TakeCreate) SetCreateTime(t time.Time) *TakeCreate

SetCreateTime sets the "create_time" field.

func (*TakeCreate) SetEndTime

func (tc *TakeCreate) SetEndTime(t time.Time) *TakeCreate

SetEndTime sets the "end_time" field.

func (*TakeCreate) SetID

func (tc *TakeCreate) SetID(u uuid.UUID) *TakeCreate

SetID sets the "id" field.

func (*TakeCreate) SetInLocale

func (tc *TakeCreate) SetInLocale(tl take.InLocale) *TakeCreate

SetInLocale sets the "in_locale" field.

func (*TakeCreate) SetMark

func (tc *TakeCreate) SetMark(i int) *TakeCreate

SetMark sets the "mark" field.

func (*TakeCreate) SetMeta

func (tc *TakeCreate) SetMeta(m map[string]interface{}) *TakeCreate

SetMeta sets the "meta" field.

func (*TakeCreate) SetNillableCreateTime

func (tc *TakeCreate) SetNillableCreateTime(t *time.Time) *TakeCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TakeCreate) SetNillableEndTime

func (tc *TakeCreate) SetNillableEndTime(t *time.Time) *TakeCreate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*TakeCreate) SetNillableID

func (tc *TakeCreate) SetNillableID(u *uuid.UUID) *TakeCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TakeCreate) SetNillableInLocale

func (tc *TakeCreate) SetNillableInLocale(tl *take.InLocale) *TakeCreate

SetNillableInLocale sets the "in_locale" field if the given value is not nil.

func (*TakeCreate) SetNillableMark

func (tc *TakeCreate) SetNillableMark(i *int) *TakeCreate

SetNillableMark sets the "mark" field if the given value is not nil.

func (*TakeCreate) SetNillablePage

func (tc *TakeCreate) SetNillablePage(i *int) *TakeCreate

SetNillablePage sets the "page" field if the given value is not nil.

func (*TakeCreate) SetNillableProgress

func (tc *TakeCreate) SetNillableProgress(i *int) *TakeCreate

SetNillableProgress sets the "progress" field if the given value is not nil.

func (*TakeCreate) SetNillableStartTime

func (tc *TakeCreate) SetNillableStartTime(t *time.Time) *TakeCreate

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*TakeCreate) SetNillableStatus

func (tc *TakeCreate) SetNillableStatus(t *take.Status) *TakeCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TakeCreate) SetNillableSuspicious

func (tc *TakeCreate) SetNillableSuspicious(b *bool) *TakeCreate

SetNillableSuspicious sets the "suspicious" field if the given value is not nil.

func (*TakeCreate) SetNillableUpdateTime

func (tc *TakeCreate) SetNillableUpdateTime(t *time.Time) *TakeCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*TakeCreate) SetPage

func (tc *TakeCreate) SetPage(i int) *TakeCreate

SetPage sets the "page" field.

func (*TakeCreate) SetProgress

func (tc *TakeCreate) SetProgress(i int) *TakeCreate

SetProgress sets the "progress" field.

func (*TakeCreate) SetSeed

func (tc *TakeCreate) SetSeed(i int64) *TakeCreate

SetSeed sets the "seed" field.

func (*TakeCreate) SetStartTime

func (tc *TakeCreate) SetStartTime(t time.Time) *TakeCreate

SetStartTime sets the "start_time" field.

func (*TakeCreate) SetStatus

func (tc *TakeCreate) SetStatus(t take.Status) *TakeCreate

SetStatus sets the "status" field.

func (*TakeCreate) SetSuspicious

func (tc *TakeCreate) SetSuspicious(b bool) *TakeCreate

SetSuspicious sets the "suspicious" field.

func (*TakeCreate) SetTest

func (tc *TakeCreate) SetTest(t *Test) *TakeCreate

SetTest sets the "test" edge to the Test entity.

func (*TakeCreate) SetTestID

func (tc *TakeCreate) SetTestID(id uuid.UUID) *TakeCreate

SetTestID sets the "test" edge to the Test entity by ID.

func (*TakeCreate) SetUpdateTime

func (tc *TakeCreate) SetUpdateTime(t time.Time) *TakeCreate

SetUpdateTime sets the "update_time" field.

func (*TakeCreate) SetUser

func (tc *TakeCreate) SetUser(u *User) *TakeCreate

SetUser sets the "user" edge to the User entity.

func (*TakeCreate) SetUserID

func (tc *TakeCreate) SetUserID(id uuid.UUID) *TakeCreate

SetUserID sets the "user" edge to the User entity by ID.

type TakeCreateBulk

type TakeCreateBulk struct {
	// contains filtered or unexported fields
}

TakeCreateBulk is the builder for creating many Take entities in bulk.

func (*TakeCreateBulk) Exec

func (tcb *TakeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TakeCreateBulk) ExecX

func (tcb *TakeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TakeCreateBulk) Save

func (tcb *TakeCreateBulk) Save(ctx context.Context) ([]*Take, error)

Save creates the Take entities in the database.

func (*TakeCreateBulk) SaveX

func (tcb *TakeCreateBulk) SaveX(ctx context.Context) []*Take

SaveX is like Save, but panics if an error occurs.

type TakeDelete

type TakeDelete struct {
	// contains filtered or unexported fields
}

TakeDelete is the builder for deleting a Take entity.

func (*TakeDelete) Exec

func (td *TakeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TakeDelete) ExecX

func (td *TakeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TakeDelete) Where

func (td *TakeDelete) Where(ps ...predicate.Take) *TakeDelete

Where appends a list predicates to the TakeDelete builder.

type TakeDeleteOne

type TakeDeleteOne struct {
	// contains filtered or unexported fields
}

TakeDeleteOne is the builder for deleting a single Take entity.

func (*TakeDeleteOne) Exec

func (tdo *TakeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TakeDeleteOne) ExecX

func (tdo *TakeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TakeEdges

type TakeEdges struct {
	// Responses holds the value of the responses edge.
	Responses []*Response `json:"responses,omitempty"`
	// Results holds the value of the results edge.
	Results []*Result `json:"results,omitempty"`
	// Test holds the value of the test edge.
	Test *Test `json:"test,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

TakeEdges holds the relations/edges for other nodes in the graph.

func (TakeEdges) ResponsesOrErr

func (e TakeEdges) ResponsesOrErr() ([]*Response, error)

ResponsesOrErr returns the Responses value or an error if the edge was not loaded in eager-loading.

func (TakeEdges) ResultsOrErr

func (e TakeEdges) ResultsOrErr() ([]*Result, error)

ResultsOrErr returns the Results value or an error if the edge was not loaded in eager-loading.

func (TakeEdges) TestOrErr

func (e TakeEdges) TestOrErr() (*Test, error)

TestOrErr returns the Test value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TakeEdges) UserOrErr

func (e TakeEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TakeGroupBy

type TakeGroupBy struct {
	// contains filtered or unexported fields
}

TakeGroupBy is the group-by builder for Take entities.

func (*TakeGroupBy) Aggregate

func (tgb *TakeGroupBy) Aggregate(fns ...AggregateFunc) *TakeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TakeGroupBy) Bool

func (s *TakeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TakeGroupBy) BoolX

func (s *TakeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TakeGroupBy) Bools

func (s *TakeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TakeGroupBy) BoolsX

func (s *TakeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TakeGroupBy) Float64

func (s *TakeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TakeGroupBy) Float64X

func (s *TakeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TakeGroupBy) Float64s

func (s *TakeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TakeGroupBy) Float64sX

func (s *TakeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TakeGroupBy) Int

func (s *TakeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TakeGroupBy) IntX

func (s *TakeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TakeGroupBy) Ints

func (s *TakeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TakeGroupBy) IntsX

func (s *TakeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TakeGroupBy) Scan

func (tgb *TakeGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TakeGroupBy) ScanX

func (s *TakeGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TakeGroupBy) String

func (s *TakeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TakeGroupBy) StringX

func (s *TakeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TakeGroupBy) Strings

func (s *TakeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TakeGroupBy) StringsX

func (s *TakeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TakeMutation

type TakeMutation struct {
	// contains filtered or unexported fields
}

TakeMutation represents an operation that mutates the Take nodes in the graph.

func (*TakeMutation) AddField

func (m *TakeMutation) 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 (*TakeMutation) AddMark

func (m *TakeMutation) AddMark(i int)

AddMark adds i to the "mark" field.

func (*TakeMutation) AddPage

func (m *TakeMutation) AddPage(i int)

AddPage adds i to the "page" field.

func (*TakeMutation) AddProgress

func (m *TakeMutation) AddProgress(i int)

AddProgress adds i to the "progress" field.

func (*TakeMutation) AddResponseIDs

func (m *TakeMutation) AddResponseIDs(ids ...uuid.UUID)

AddResponseIDs adds the "responses" edge to the Response entity by ids.

func (*TakeMutation) AddResultIDs

func (m *TakeMutation) AddResultIDs(ids ...uuid.UUID)

AddResultIDs adds the "results" edge to the Result entity by ids.

func (*TakeMutation) AddSeed

func (m *TakeMutation) AddSeed(i int64)

AddSeed adds i to the "seed" field.

func (*TakeMutation) AddedEdges

func (m *TakeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TakeMutation) AddedField

func (m *TakeMutation) 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 (*TakeMutation) AddedFields

func (m *TakeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TakeMutation) AddedIDs

func (m *TakeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TakeMutation) AddedMark

func (m *TakeMutation) AddedMark() (r int, exists bool)

AddedMark returns the value that was added to the "mark" field in this mutation.

func (*TakeMutation) AddedPage

func (m *TakeMutation) AddedPage() (r int, exists bool)

AddedPage returns the value that was added to the "page" field in this mutation.

func (*TakeMutation) AddedProgress

func (m *TakeMutation) AddedProgress() (r int, exists bool)

AddedProgress returns the value that was added to the "progress" field in this mutation.

func (*TakeMutation) AddedSeed

func (m *TakeMutation) AddedSeed() (r int64, exists bool)

AddedSeed returns the value that was added to the "seed" field in this mutation.

func (*TakeMutation) ClearEdge

func (m *TakeMutation) 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 (*TakeMutation) ClearEndTime

func (m *TakeMutation) ClearEndTime()

ClearEndTime clears the value of the "end_time" field.

func (*TakeMutation) ClearField

func (m *TakeMutation) 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 (*TakeMutation) ClearMark

func (m *TakeMutation) ClearMark()

ClearMark clears the value of the "mark" field.

func (*TakeMutation) ClearMeta

func (m *TakeMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*TakeMutation) ClearResponses

func (m *TakeMutation) ClearResponses()

ClearResponses clears the "responses" edge to the Response entity.

func (*TakeMutation) ClearResults

func (m *TakeMutation) ClearResults()

ClearResults clears the "results" edge to the Result entity.

func (*TakeMutation) ClearStartTime

func (m *TakeMutation) ClearStartTime()

ClearStartTime clears the value of the "start_time" field.

func (*TakeMutation) ClearTest

func (m *TakeMutation) ClearTest()

ClearTest clears the "test" edge to the Test entity.

func (*TakeMutation) ClearUser

func (m *TakeMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*TakeMutation) ClearedEdges

func (m *TakeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TakeMutation) ClearedFields

func (m *TakeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TakeMutation) Client

func (m TakeMutation) 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 (*TakeMutation) CreateTime

func (m *TakeMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*TakeMutation) EdgeCleared

func (m *TakeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TakeMutation) EndTime

func (m *TakeMutation) EndTime() (r time.Time, exists bool)

EndTime returns the value of the "end_time" field in the mutation.

func (*TakeMutation) EndTimeCleared

func (m *TakeMutation) EndTimeCleared() bool

EndTimeCleared returns if the "end_time" field was cleared in this mutation.

func (*TakeMutation) Field

func (m *TakeMutation) 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 (*TakeMutation) FieldCleared

func (m *TakeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TakeMutation) Fields

func (m *TakeMutation) 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 (*TakeMutation) ID

func (m *TakeMutation) ID() (id uuid.UUID, 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 (*TakeMutation) IDs

func (m *TakeMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*TakeMutation) InLocale

func (m *TakeMutation) InLocale() (r take.InLocale, exists bool)

InLocale returns the value of the "in_locale" field in the mutation.

func (*TakeMutation) Mark

func (m *TakeMutation) Mark() (r int, exists bool)

Mark returns the value of the "mark" field in the mutation.

func (*TakeMutation) MarkCleared

func (m *TakeMutation) MarkCleared() bool

MarkCleared returns if the "mark" field was cleared in this mutation.

func (*TakeMutation) Meta

func (m *TakeMutation) Meta() (r map[string]interface{}, exists bool)

Meta returns the value of the "meta" field in the mutation.

func (*TakeMutation) MetaCleared

func (m *TakeMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*TakeMutation) OldCreateTime

func (m *TakeMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Take entity. If the Take 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 (*TakeMutation) OldEndTime

func (m *TakeMutation) OldEndTime(ctx context.Context) (v *time.Time, err error)

OldEndTime returns the old "end_time" field's value of the Take entity. If the Take 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 (*TakeMutation) OldField

func (m *TakeMutation) 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 (*TakeMutation) OldInLocale

func (m *TakeMutation) OldInLocale(ctx context.Context) (v take.InLocale, err error)

OldInLocale returns the old "in_locale" field's value of the Take entity. If the Take 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 (*TakeMutation) OldMark

func (m *TakeMutation) OldMark(ctx context.Context) (v *int, err error)

OldMark returns the old "mark" field's value of the Take entity. If the Take 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 (*TakeMutation) OldMeta

func (m *TakeMutation) OldMeta(ctx context.Context) (v map[string]interface{}, err error)

OldMeta returns the old "meta" field's value of the Take entity. If the Take 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 (*TakeMutation) OldPage

func (m *TakeMutation) OldPage(ctx context.Context) (v int, err error)

OldPage returns the old "page" field's value of the Take entity. If the Take 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 (*TakeMutation) OldProgress

func (m *TakeMutation) OldProgress(ctx context.Context) (v int, err error)

OldProgress returns the old "progress" field's value of the Take entity. If the Take 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 (*TakeMutation) OldSeed

func (m *TakeMutation) OldSeed(ctx context.Context) (v int64, err error)

OldSeed returns the old "seed" field's value of the Take entity. If the Take 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 (*TakeMutation) OldStartTime

func (m *TakeMutation) OldStartTime(ctx context.Context) (v *time.Time, err error)

OldStartTime returns the old "start_time" field's value of the Take entity. If the Take 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 (*TakeMutation) OldStatus

func (m *TakeMutation) OldStatus(ctx context.Context) (v take.Status, err error)

OldStatus returns the old "status" field's value of the Take entity. If the Take 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 (*TakeMutation) OldSuspicious

func (m *TakeMutation) OldSuspicious(ctx context.Context) (v bool, err error)

OldSuspicious returns the old "suspicious" field's value of the Take entity. If the Take 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 (*TakeMutation) OldUpdateTime

func (m *TakeMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Take entity. If the Take 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 (*TakeMutation) Op

func (m *TakeMutation) Op() Op

Op returns the operation name.

func (*TakeMutation) Page

func (m *TakeMutation) Page() (r int, exists bool)

Page returns the value of the "page" field in the mutation.

func (*TakeMutation) Progress

func (m *TakeMutation) Progress() (r int, exists bool)

Progress returns the value of the "progress" field in the mutation.

func (*TakeMutation) RemoveResponseIDs

func (m *TakeMutation) RemoveResponseIDs(ids ...uuid.UUID)

RemoveResponseIDs removes the "responses" edge to the Response entity by IDs.

func (*TakeMutation) RemoveResultIDs

func (m *TakeMutation) RemoveResultIDs(ids ...uuid.UUID)

RemoveResultIDs removes the "results" edge to the Result entity by IDs.

func (*TakeMutation) RemovedEdges

func (m *TakeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TakeMutation) RemovedIDs

func (m *TakeMutation) 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 (*TakeMutation) RemovedResponsesIDs

func (m *TakeMutation) RemovedResponsesIDs() (ids []uuid.UUID)

RemovedResponses returns the removed IDs of the "responses" edge to the Response entity.

func (*TakeMutation) RemovedResultsIDs

func (m *TakeMutation) RemovedResultsIDs() (ids []uuid.UUID)

RemovedResults returns the removed IDs of the "results" edge to the Result entity.

func (*TakeMutation) ResetCreateTime

func (m *TakeMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*TakeMutation) ResetEdge

func (m *TakeMutation) 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 (*TakeMutation) ResetEndTime

func (m *TakeMutation) ResetEndTime()

ResetEndTime resets all changes to the "end_time" field.

func (*TakeMutation) ResetField

func (m *TakeMutation) 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 (*TakeMutation) ResetInLocale

func (m *TakeMutation) ResetInLocale()

ResetInLocale resets all changes to the "in_locale" field.

func (*TakeMutation) ResetMark

func (m *TakeMutation) ResetMark()

ResetMark resets all changes to the "mark" field.

func (*TakeMutation) ResetMeta

func (m *TakeMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*TakeMutation) ResetPage

func (m *TakeMutation) ResetPage()

ResetPage resets all changes to the "page" field.

func (*TakeMutation) ResetProgress

func (m *TakeMutation) ResetProgress()

ResetProgress resets all changes to the "progress" field.

func (*TakeMutation) ResetResponses

func (m *TakeMutation) ResetResponses()

ResetResponses resets all changes to the "responses" edge.

func (*TakeMutation) ResetResults

func (m *TakeMutation) ResetResults()

ResetResults resets all changes to the "results" edge.

func (*TakeMutation) ResetSeed

func (m *TakeMutation) ResetSeed()

ResetSeed resets all changes to the "seed" field.

func (*TakeMutation) ResetStartTime

func (m *TakeMutation) ResetStartTime()

ResetStartTime resets all changes to the "start_time" field.

func (*TakeMutation) ResetStatus

func (m *TakeMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TakeMutation) ResetSuspicious

func (m *TakeMutation) ResetSuspicious()

ResetSuspicious resets all changes to the "suspicious" field.

func (*TakeMutation) ResetTest

func (m *TakeMutation) ResetTest()

ResetTest resets all changes to the "test" edge.

func (*TakeMutation) ResetUpdateTime

func (m *TakeMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*TakeMutation) ResetUser

func (m *TakeMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*TakeMutation) ResponsesCleared

func (m *TakeMutation) ResponsesCleared() bool

ResponsesCleared reports if the "responses" edge to the Response entity was cleared.

func (*TakeMutation) ResponsesIDs

func (m *TakeMutation) ResponsesIDs() (ids []uuid.UUID)

ResponsesIDs returns the "responses" edge IDs in the mutation.

func (*TakeMutation) ResultsCleared

func (m *TakeMutation) ResultsCleared() bool

ResultsCleared reports if the "results" edge to the Result entity was cleared.

func (*TakeMutation) ResultsIDs

func (m *TakeMutation) ResultsIDs() (ids []uuid.UUID)

ResultsIDs returns the "results" edge IDs in the mutation.

func (*TakeMutation) Seed

func (m *TakeMutation) Seed() (r int64, exists bool)

Seed returns the value of the "seed" field in the mutation.

func (*TakeMutation) SetCreateTime

func (m *TakeMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*TakeMutation) SetEndTime

func (m *TakeMutation) SetEndTime(t time.Time)

SetEndTime sets the "end_time" field.

func (*TakeMutation) SetField

func (m *TakeMutation) 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 (*TakeMutation) SetID

func (m *TakeMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Take entities.

func (*TakeMutation) SetInLocale

func (m *TakeMutation) SetInLocale(tl take.InLocale)

SetInLocale sets the "in_locale" field.

func (*TakeMutation) SetMark

func (m *TakeMutation) SetMark(i int)

SetMark sets the "mark" field.

func (*TakeMutation) SetMeta

func (m *TakeMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*TakeMutation) SetPage

func (m *TakeMutation) SetPage(i int)

SetPage sets the "page" field.

func (*TakeMutation) SetProgress

func (m *TakeMutation) SetProgress(i int)

SetProgress sets the "progress" field.

func (*TakeMutation) SetSeed

func (m *TakeMutation) SetSeed(i int64)

SetSeed sets the "seed" field.

func (*TakeMutation) SetStartTime

func (m *TakeMutation) SetStartTime(t time.Time)

SetStartTime sets the "start_time" field.

func (*TakeMutation) SetStatus

func (m *TakeMutation) SetStatus(t take.Status)

SetStatus sets the "status" field.

func (*TakeMutation) SetSuspicious

func (m *TakeMutation) SetSuspicious(b bool)

SetSuspicious sets the "suspicious" field.

func (*TakeMutation) SetTestID

func (m *TakeMutation) SetTestID(id uuid.UUID)

SetTestID sets the "test" edge to the Test entity by id.

func (*TakeMutation) SetUpdateTime

func (m *TakeMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*TakeMutation) SetUserID

func (m *TakeMutation) SetUserID(id uuid.UUID)

SetUserID sets the "user" edge to the User entity by id.

func (*TakeMutation) StartTime

func (m *TakeMutation) StartTime() (r time.Time, exists bool)

StartTime returns the value of the "start_time" field in the mutation.

func (*TakeMutation) StartTimeCleared

func (m *TakeMutation) StartTimeCleared() bool

StartTimeCleared returns if the "start_time" field was cleared in this mutation.

func (*TakeMutation) Status

func (m *TakeMutation) Status() (r take.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*TakeMutation) Suspicious

func (m *TakeMutation) Suspicious() (r bool, exists bool)

Suspicious returns the value of the "suspicious" field in the mutation.

func (*TakeMutation) TestCleared

func (m *TakeMutation) TestCleared() bool

TestCleared reports if the "test" edge to the Test entity was cleared.

func (*TakeMutation) TestID

func (m *TakeMutation) TestID() (id uuid.UUID, exists bool)

TestID returns the "test" edge ID in the mutation.

func (*TakeMutation) TestIDs

func (m *TakeMutation) TestIDs() (ids []uuid.UUID)

TestIDs returns the "test" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TestID instead. It exists only for internal usage by the builders.

func (TakeMutation) Tx

func (m TakeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TakeMutation) Type

func (m *TakeMutation) Type() string

Type returns the node type of this mutation (Take).

func (*TakeMutation) UpdateTime

func (m *TakeMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*TakeMutation) UserCleared

func (m *TakeMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*TakeMutation) UserID

func (m *TakeMutation) UserID() (id uuid.UUID, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*TakeMutation) UserIDs

func (m *TakeMutation) UserIDs() (ids []uuid.UUID)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*TakeMutation) Where

func (m *TakeMutation) Where(ps ...predicate.Take)

Where appends a list predicates to the TakeMutation builder.

type TakeQuery

type TakeQuery struct {
	// contains filtered or unexported fields
}

TakeQuery is the builder for querying Take entities.

func (*TakeQuery) All

func (tq *TakeQuery) All(ctx context.Context) ([]*Take, error)

All executes the query and returns a list of Takes.

func (*TakeQuery) AllX

func (tq *TakeQuery) AllX(ctx context.Context) []*Take

AllX is like All, but panics if an error occurs.

func (*TakeQuery) Clone

func (tq *TakeQuery) Clone() *TakeQuery

Clone returns a duplicate of the TakeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TakeQuery) Count

func (tq *TakeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TakeQuery) CountX

func (tq *TakeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TakeQuery) Exist

func (tq *TakeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TakeQuery) ExistX

func (tq *TakeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TakeQuery) First

func (tq *TakeQuery) First(ctx context.Context) (*Take, error)

First returns the first Take entity from the query. Returns a *NotFoundError when no Take was found.

func (*TakeQuery) FirstID

func (tq *TakeQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Take ID from the query. Returns a *NotFoundError when no Take ID was found.

func (*TakeQuery) FirstIDX

func (tq *TakeQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TakeQuery) FirstX

func (tq *TakeQuery) FirstX(ctx context.Context) *Take

FirstX is like First, but panics if an error occurs.

func (*TakeQuery) GroupBy

func (tq *TakeQuery) GroupBy(field string, fields ...string) *TakeGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Take.Query().
	GroupBy(take.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TakeQuery) IDs

func (tq *TakeQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Take IDs.

func (*TakeQuery) IDsX

func (tq *TakeQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TakeQuery) Limit

func (tq *TakeQuery) Limit(limit int) *TakeQuery

Limit adds a limit step to the query.

func (*TakeQuery) Offset

func (tq *TakeQuery) Offset(offset int) *TakeQuery

Offset adds an offset step to the query.

func (*TakeQuery) Only

func (tq *TakeQuery) Only(ctx context.Context) (*Take, error)

Only returns a single Take entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Take entity is found. Returns a *NotFoundError when no Take entities are found.

func (*TakeQuery) OnlyID

func (tq *TakeQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Take ID in the query. Returns a *NotSingularError when more than one Take ID is found. Returns a *NotFoundError when no entities are found.

func (*TakeQuery) OnlyIDX

func (tq *TakeQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TakeQuery) OnlyX

func (tq *TakeQuery) OnlyX(ctx context.Context) *Take

OnlyX is like Only, but panics if an error occurs.

func (*TakeQuery) Order

func (tq *TakeQuery) Order(o ...OrderFunc) *TakeQuery

Order adds an order step to the query.

func (*TakeQuery) QueryResponses

func (tq *TakeQuery) QueryResponses() *ResponseQuery

QueryResponses chains the current query on the "responses" edge.

func (*TakeQuery) QueryResults

func (tq *TakeQuery) QueryResults() *ResultQuery

QueryResults chains the current query on the "results" edge.

func (*TakeQuery) QueryTest

func (tq *TakeQuery) QueryTest() *TestQuery

QueryTest chains the current query on the "test" edge.

func (*TakeQuery) QueryUser

func (tq *TakeQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*TakeQuery) Select

func (tq *TakeQuery) Select(fields ...string) *TakeSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Take.Query().
	Select(take.FieldCreateTime).
	Scan(ctx, &v)

func (*TakeQuery) Unique

func (tq *TakeQuery) Unique(unique bool) *TakeQuery

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 (*TakeQuery) Where

func (tq *TakeQuery) Where(ps ...predicate.Take) *TakeQuery

Where adds a new predicate for the TakeQuery builder.

func (*TakeQuery) WithResponses

func (tq *TakeQuery) WithResponses(opts ...func(*ResponseQuery)) *TakeQuery

WithResponses tells the query-builder to eager-load the nodes that are connected to the "responses" edge. The optional arguments are used to configure the query builder of the edge.

func (*TakeQuery) WithResults

func (tq *TakeQuery) WithResults(opts ...func(*ResultQuery)) *TakeQuery

WithResults tells the query-builder to eager-load the nodes that are connected to the "results" edge. The optional arguments are used to configure the query builder of the edge.

func (*TakeQuery) WithTest

func (tq *TakeQuery) WithTest(opts ...func(*TestQuery)) *TakeQuery

WithTest tells the query-builder to eager-load the nodes that are connected to the "test" edge. The optional arguments are used to configure the query builder of the edge.

func (*TakeQuery) WithUser

func (tq *TakeQuery) WithUser(opts ...func(*UserQuery)) *TakeQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type TakeSelect

type TakeSelect struct {
	*TakeQuery
	// contains filtered or unexported fields
}

TakeSelect is the builder for selecting fields of Take entities.

func (*TakeSelect) Bool

func (s *TakeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TakeSelect) BoolX

func (s *TakeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TakeSelect) Bools

func (s *TakeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TakeSelect) BoolsX

func (s *TakeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TakeSelect) Float64

func (s *TakeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TakeSelect) Float64X

func (s *TakeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TakeSelect) Float64s

func (s *TakeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TakeSelect) Float64sX

func (s *TakeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TakeSelect) Int

func (s *TakeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TakeSelect) IntX

func (s *TakeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TakeSelect) Ints

func (s *TakeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TakeSelect) IntsX

func (s *TakeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TakeSelect) Scan

func (ts *TakeSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TakeSelect) ScanX

func (s *TakeSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TakeSelect) String

func (s *TakeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TakeSelect) StringX

func (s *TakeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TakeSelect) Strings

func (s *TakeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TakeSelect) StringsX

func (s *TakeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TakeUpdate

type TakeUpdate struct {
	// contains filtered or unexported fields
}

TakeUpdate is the builder for updating Take entities.

func (*TakeUpdate) AddMark

func (tu *TakeUpdate) AddMark(i int) *TakeUpdate

AddMark adds i to the "mark" field.

func (*TakeUpdate) AddPage

func (tu *TakeUpdate) AddPage(i int) *TakeUpdate

AddPage adds i to the "page" field.

func (*TakeUpdate) AddProgress

func (tu *TakeUpdate) AddProgress(i int) *TakeUpdate

AddProgress adds i to the "progress" field.

func (*TakeUpdate) AddResponseIDs

func (tu *TakeUpdate) AddResponseIDs(ids ...uuid.UUID) *TakeUpdate

AddResponseIDs adds the "responses" edge to the Response entity by IDs.

func (*TakeUpdate) AddResponses

func (tu *TakeUpdate) AddResponses(r ...*Response) *TakeUpdate

AddResponses adds the "responses" edges to the Response entity.

func (*TakeUpdate) AddResultIDs

func (tu *TakeUpdate) AddResultIDs(ids ...uuid.UUID) *TakeUpdate

AddResultIDs adds the "results" edge to the Result entity by IDs.

func (*TakeUpdate) AddResults

func (tu *TakeUpdate) AddResults(r ...*Result) *TakeUpdate

AddResults adds the "results" edges to the Result entity.

func (*TakeUpdate) ClearEndTime

func (tu *TakeUpdate) ClearEndTime() *TakeUpdate

ClearEndTime clears the value of the "end_time" field.

func (*TakeUpdate) ClearMark

func (tu *TakeUpdate) ClearMark() *TakeUpdate

ClearMark clears the value of the "mark" field.

func (*TakeUpdate) ClearMeta

func (tu *TakeUpdate) ClearMeta() *TakeUpdate

ClearMeta clears the value of the "meta" field.

func (*TakeUpdate) ClearResponses

func (tu *TakeUpdate) ClearResponses() *TakeUpdate

ClearResponses clears all "responses" edges to the Response entity.

func (*TakeUpdate) ClearResults

func (tu *TakeUpdate) ClearResults() *TakeUpdate

ClearResults clears all "results" edges to the Result entity.

func (*TakeUpdate) ClearStartTime

func (tu *TakeUpdate) ClearStartTime() *TakeUpdate

ClearStartTime clears the value of the "start_time" field.

func (*TakeUpdate) ClearTest

func (tu *TakeUpdate) ClearTest() *TakeUpdate

ClearTest clears the "test" edge to the Test entity.

func (*TakeUpdate) ClearUser

func (tu *TakeUpdate) ClearUser() *TakeUpdate

ClearUser clears the "user" edge to the User entity.

func (*TakeUpdate) Exec

func (tu *TakeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TakeUpdate) ExecX

func (tu *TakeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TakeUpdate) Mutation

func (tu *TakeUpdate) Mutation() *TakeMutation

Mutation returns the TakeMutation object of the builder.

func (*TakeUpdate) RemoveResponseIDs

func (tu *TakeUpdate) RemoveResponseIDs(ids ...uuid.UUID) *TakeUpdate

RemoveResponseIDs removes the "responses" edge to Response entities by IDs.

func (*TakeUpdate) RemoveResponses

func (tu *TakeUpdate) RemoveResponses(r ...*Response) *TakeUpdate

RemoveResponses removes "responses" edges to Response entities.

func (*TakeUpdate) RemoveResultIDs

func (tu *TakeUpdate) RemoveResultIDs(ids ...uuid.UUID) *TakeUpdate

RemoveResultIDs removes the "results" edge to Result entities by IDs.

func (*TakeUpdate) RemoveResults

func (tu *TakeUpdate) RemoveResults(r ...*Result) *TakeUpdate

RemoveResults removes "results" edges to Result entities.

func (*TakeUpdate) Save

func (tu *TakeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TakeUpdate) SaveX

func (tu *TakeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TakeUpdate) SetEndTime

func (tu *TakeUpdate) SetEndTime(t time.Time) *TakeUpdate

SetEndTime sets the "end_time" field.

func (*TakeUpdate) SetInLocale

func (tu *TakeUpdate) SetInLocale(tl take.InLocale) *TakeUpdate

SetInLocale sets the "in_locale" field.

func (*TakeUpdate) SetMark

func (tu *TakeUpdate) SetMark(i int) *TakeUpdate

SetMark sets the "mark" field.

func (*TakeUpdate) SetMeta

func (tu *TakeUpdate) SetMeta(m map[string]interface{}) *TakeUpdate

SetMeta sets the "meta" field.

func (*TakeUpdate) SetNillableEndTime

func (tu *TakeUpdate) SetNillableEndTime(t *time.Time) *TakeUpdate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*TakeUpdate) SetNillableInLocale

func (tu *TakeUpdate) SetNillableInLocale(tl *take.InLocale) *TakeUpdate

SetNillableInLocale sets the "in_locale" field if the given value is not nil.

func (*TakeUpdate) SetNillableMark

func (tu *TakeUpdate) SetNillableMark(i *int) *TakeUpdate

SetNillableMark sets the "mark" field if the given value is not nil.

func (*TakeUpdate) SetNillablePage

func (tu *TakeUpdate) SetNillablePage(i *int) *TakeUpdate

SetNillablePage sets the "page" field if the given value is not nil.

func (*TakeUpdate) SetNillableProgress

func (tu *TakeUpdate) SetNillableProgress(i *int) *TakeUpdate

SetNillableProgress sets the "progress" field if the given value is not nil.

func (*TakeUpdate) SetNillableStartTime

func (tu *TakeUpdate) SetNillableStartTime(t *time.Time) *TakeUpdate

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*TakeUpdate) SetNillableStatus

func (tu *TakeUpdate) SetNillableStatus(t *take.Status) *TakeUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TakeUpdate) SetNillableSuspicious

func (tu *TakeUpdate) SetNillableSuspicious(b *bool) *TakeUpdate

SetNillableSuspicious sets the "suspicious" field if the given value is not nil.

func (*TakeUpdate) SetPage

func (tu *TakeUpdate) SetPage(i int) *TakeUpdate

SetPage sets the "page" field.

func (*TakeUpdate) SetProgress

func (tu *TakeUpdate) SetProgress(i int) *TakeUpdate

SetProgress sets the "progress" field.

func (*TakeUpdate) SetStartTime

func (tu *TakeUpdate) SetStartTime(t time.Time) *TakeUpdate

SetStartTime sets the "start_time" field.

func (*TakeUpdate) SetStatus

func (tu *TakeUpdate) SetStatus(t take.Status) *TakeUpdate

SetStatus sets the "status" field.

func (*TakeUpdate) SetSuspicious

func (tu *TakeUpdate) SetSuspicious(b bool) *TakeUpdate

SetSuspicious sets the "suspicious" field.

func (*TakeUpdate) SetTest

func (tu *TakeUpdate) SetTest(t *Test) *TakeUpdate

SetTest sets the "test" edge to the Test entity.

func (*TakeUpdate) SetTestID

func (tu *TakeUpdate) SetTestID(id uuid.UUID) *TakeUpdate

SetTestID sets the "test" edge to the Test entity by ID.

func (*TakeUpdate) SetUpdateTime

func (tu *TakeUpdate) SetUpdateTime(t time.Time) *TakeUpdate

SetUpdateTime sets the "update_time" field.

func (*TakeUpdate) SetUser

func (tu *TakeUpdate) SetUser(u *User) *TakeUpdate

SetUser sets the "user" edge to the User entity.

func (*TakeUpdate) SetUserID

func (tu *TakeUpdate) SetUserID(id uuid.UUID) *TakeUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*TakeUpdate) Where

func (tu *TakeUpdate) Where(ps ...predicate.Take) *TakeUpdate

Where appends a list predicates to the TakeUpdate builder.

type TakeUpdateOne

type TakeUpdateOne struct {
	// contains filtered or unexported fields
}

TakeUpdateOne is the builder for updating a single Take entity.

func (*TakeUpdateOne) AddMark

func (tuo *TakeUpdateOne) AddMark(i int) *TakeUpdateOne

AddMark adds i to the "mark" field.

func (*TakeUpdateOne) AddPage

func (tuo *TakeUpdateOne) AddPage(i int) *TakeUpdateOne

AddPage adds i to the "page" field.

func (*TakeUpdateOne) AddProgress

func (tuo *TakeUpdateOne) AddProgress(i int) *TakeUpdateOne

AddProgress adds i to the "progress" field.

func (*TakeUpdateOne) AddResponseIDs

func (tuo *TakeUpdateOne) AddResponseIDs(ids ...uuid.UUID) *TakeUpdateOne

AddResponseIDs adds the "responses" edge to the Response entity by IDs.

func (*TakeUpdateOne) AddResponses

func (tuo *TakeUpdateOne) AddResponses(r ...*Response) *TakeUpdateOne

AddResponses adds the "responses" edges to the Response entity.

func (*TakeUpdateOne) AddResultIDs

func (tuo *TakeUpdateOne) AddResultIDs(ids ...uuid.UUID) *TakeUpdateOne

AddResultIDs adds the "results" edge to the Result entity by IDs.

func (*TakeUpdateOne) AddResults

func (tuo *TakeUpdateOne) AddResults(r ...*Result) *TakeUpdateOne

AddResults adds the "results" edges to the Result entity.

func (*TakeUpdateOne) ClearEndTime

func (tuo *TakeUpdateOne) ClearEndTime() *TakeUpdateOne

ClearEndTime clears the value of the "end_time" field.

func (*TakeUpdateOne) ClearMark

func (tuo *TakeUpdateOne) ClearMark() *TakeUpdateOne

ClearMark clears the value of the "mark" field.

func (*TakeUpdateOne) ClearMeta

func (tuo *TakeUpdateOne) ClearMeta() *TakeUpdateOne

ClearMeta clears the value of the "meta" field.

func (*TakeUpdateOne) ClearResponses

func (tuo *TakeUpdateOne) ClearResponses() *TakeUpdateOne

ClearResponses clears all "responses" edges to the Response entity.

func (*TakeUpdateOne) ClearResults

func (tuo *TakeUpdateOne) ClearResults() *TakeUpdateOne

ClearResults clears all "results" edges to the Result entity.

func (*TakeUpdateOne) ClearStartTime

func (tuo *TakeUpdateOne) ClearStartTime() *TakeUpdateOne

ClearStartTime clears the value of the "start_time" field.

func (*TakeUpdateOne) ClearTest

func (tuo *TakeUpdateOne) ClearTest() *TakeUpdateOne

ClearTest clears the "test" edge to the Test entity.

func (*TakeUpdateOne) ClearUser

func (tuo *TakeUpdateOne) ClearUser() *TakeUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*TakeUpdateOne) Exec

func (tuo *TakeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TakeUpdateOne) ExecX

func (tuo *TakeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TakeUpdateOne) Mutation

func (tuo *TakeUpdateOne) Mutation() *TakeMutation

Mutation returns the TakeMutation object of the builder.

func (*TakeUpdateOne) RemoveResponseIDs

func (tuo *TakeUpdateOne) RemoveResponseIDs(ids ...uuid.UUID) *TakeUpdateOne

RemoveResponseIDs removes the "responses" edge to Response entities by IDs.

func (*TakeUpdateOne) RemoveResponses

func (tuo *TakeUpdateOne) RemoveResponses(r ...*Response) *TakeUpdateOne

RemoveResponses removes "responses" edges to Response entities.

func (*TakeUpdateOne) RemoveResultIDs

func (tuo *TakeUpdateOne) RemoveResultIDs(ids ...uuid.UUID) *TakeUpdateOne

RemoveResultIDs removes the "results" edge to Result entities by IDs.

func (*TakeUpdateOne) RemoveResults

func (tuo *TakeUpdateOne) RemoveResults(r ...*Result) *TakeUpdateOne

RemoveResults removes "results" edges to Result entities.

func (*TakeUpdateOne) Save

func (tuo *TakeUpdateOne) Save(ctx context.Context) (*Take, error)

Save executes the query and returns the updated Take entity.

func (*TakeUpdateOne) SaveX

func (tuo *TakeUpdateOne) SaveX(ctx context.Context) *Take

SaveX is like Save, but panics if an error occurs.

func (*TakeUpdateOne) Select

func (tuo *TakeUpdateOne) Select(field string, fields ...string) *TakeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TakeUpdateOne) SetEndTime

func (tuo *TakeUpdateOne) SetEndTime(t time.Time) *TakeUpdateOne

SetEndTime sets the "end_time" field.

func (*TakeUpdateOne) SetInLocale

func (tuo *TakeUpdateOne) SetInLocale(tl take.InLocale) *TakeUpdateOne

SetInLocale sets the "in_locale" field.

func (*TakeUpdateOne) SetMark

func (tuo *TakeUpdateOne) SetMark(i int) *TakeUpdateOne

SetMark sets the "mark" field.

func (*TakeUpdateOne) SetMeta

func (tuo *TakeUpdateOne) SetMeta(m map[string]interface{}) *TakeUpdateOne

SetMeta sets the "meta" field.

func (*TakeUpdateOne) SetNillableEndTime

func (tuo *TakeUpdateOne) SetNillableEndTime(t *time.Time) *TakeUpdateOne

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*TakeUpdateOne) SetNillableInLocale

func (tuo *TakeUpdateOne) SetNillableInLocale(tl *take.InLocale) *TakeUpdateOne

SetNillableInLocale sets the "in_locale" field if the given value is not nil.

func (*TakeUpdateOne) SetNillableMark

func (tuo *TakeUpdateOne) SetNillableMark(i *int) *TakeUpdateOne

SetNillableMark sets the "mark" field if the given value is not nil.

func (*TakeUpdateOne) SetNillablePage

func (tuo *TakeUpdateOne) SetNillablePage(i *int) *TakeUpdateOne

SetNillablePage sets the "page" field if the given value is not nil.

func (*TakeUpdateOne) SetNillableProgress

func (tuo *TakeUpdateOne) SetNillableProgress(i *int) *TakeUpdateOne

SetNillableProgress sets the "progress" field if the given value is not nil.

func (*TakeUpdateOne) SetNillableStartTime

func (tuo *TakeUpdateOne) SetNillableStartTime(t *time.Time) *TakeUpdateOne

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*TakeUpdateOne) SetNillableStatus

func (tuo *TakeUpdateOne) SetNillableStatus(t *take.Status) *TakeUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TakeUpdateOne) SetNillableSuspicious

func (tuo *TakeUpdateOne) SetNillableSuspicious(b *bool) *TakeUpdateOne

SetNillableSuspicious sets the "suspicious" field if the given value is not nil.

func (*TakeUpdateOne) SetPage

func (tuo *TakeUpdateOne) SetPage(i int) *TakeUpdateOne

SetPage sets the "page" field.

func (*TakeUpdateOne) SetProgress

func (tuo *TakeUpdateOne) SetProgress(i int) *TakeUpdateOne

SetProgress sets the "progress" field.

func (*TakeUpdateOne) SetStartTime

func (tuo *TakeUpdateOne) SetStartTime(t time.Time) *TakeUpdateOne

SetStartTime sets the "start_time" field.

func (*TakeUpdateOne) SetStatus

func (tuo *TakeUpdateOne) SetStatus(t take.Status) *TakeUpdateOne

SetStatus sets the "status" field.

func (*TakeUpdateOne) SetSuspicious

func (tuo *TakeUpdateOne) SetSuspicious(b bool) *TakeUpdateOne

SetSuspicious sets the "suspicious" field.

func (*TakeUpdateOne) SetTest

func (tuo *TakeUpdateOne) SetTest(t *Test) *TakeUpdateOne

SetTest sets the "test" edge to the Test entity.

func (*TakeUpdateOne) SetTestID

func (tuo *TakeUpdateOne) SetTestID(id uuid.UUID) *TakeUpdateOne

SetTestID sets the "test" edge to the Test entity by ID.

func (*TakeUpdateOne) SetUpdateTime

func (tuo *TakeUpdateOne) SetUpdateTime(t time.Time) *TakeUpdateOne

SetUpdateTime sets the "update_time" field.

func (*TakeUpdateOne) SetUser

func (tuo *TakeUpdateOne) SetUser(u *User) *TakeUpdateOne

SetUser sets the "user" edge to the User entity.

func (*TakeUpdateOne) SetUserID

func (tuo *TakeUpdateOne) SetUserID(id uuid.UUID) *TakeUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

type Takes

type Takes []*Take

Takes is a parsable slice of Take.

type Test

type Test struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Code holds the value of the "code" field.
	Code string `json:"code,omitempty"`
	// Published holds the value of the "published" field.
	Published bool `json:"published,omitempty"`
	// AvailableLocales holds the value of the "available_locales" field.
	AvailableLocales []string `json:"available_locales,omitempty"`
	// Mark holds the value of the "mark" field.
	Mark float64 `json:"mark,omitempty"`
	// Duration holds the value of the "duration" field.
	Duration *time.Duration `json:"duration,omitempty"`
	// QuestionCount holds the value of the "question_count" field.
	QuestionCount int `json:"question_count,omitempty"`
	// Image holds the value of the "image" field.
	Image string `json:"image,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TestQuery when eager-loading is set.
	Edges TestEdges `json:"edges"`
	// contains filtered or unexported fields
}

Test is the model entity for the Test schema.

func (*Test) QueryDisplay

func (t *Test) QueryDisplay() *TestDisplayQuery

QueryDisplay queries the "display" edge of the Test entity.

func (*Test) QueryQuestions

func (t *Test) QueryQuestions() *QuestionQuery

QueryQuestions queries the "questions" edge of the Test entity.

func (*Test) QueryScales

func (t *Test) QueryScales() *ScaleQuery

QueryScales queries the "scales" edge of the Test entity.

func (*Test) QueryTags

func (t *Test) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the Test entity.

func (*Test) QueryTakes

func (t *Test) QueryTakes() *TakeQuery

QueryTakes queries the "takes" edge of the Test entity.

func (*Test) QueryTranslations

func (t *Test) QueryTranslations() *TestTranslationQuery

QueryTranslations queries the "translations" edge of the Test entity.

func (*Test) String

func (t *Test) String() string

String implements the fmt.Stringer.

func (*Test) Unwrap

func (t *Test) Unwrap() *Test

Unwrap unwraps the Test 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 (*Test) Update

func (t *Test) Update() *TestUpdateOne

Update returns a builder for updating this Test. Note that you need to call Test.Unwrap() before calling this method if this Test was returned from a transaction, and the transaction was committed or rolled back.

type TestClient

type TestClient struct {
	// contains filtered or unexported fields
}

TestClient is a client for the Test schema.

func NewTestClient

func NewTestClient(c config) *TestClient

NewTestClient returns a client for the Test from the given config.

func (*TestClient) Create

func (c *TestClient) Create() *TestCreate

Create returns a builder for creating a Test entity.

func (*TestClient) CreateBulk

func (c *TestClient) CreateBulk(builders ...*TestCreate) *TestCreateBulk

CreateBulk returns a builder for creating a bulk of Test entities.

func (*TestClient) Delete

func (c *TestClient) Delete() *TestDelete

Delete returns a delete builder for Test.

func (*TestClient) DeleteOne

func (c *TestClient) DeleteOne(t *Test) *TestDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TestClient) DeleteOneID

func (c *TestClient) DeleteOneID(id uuid.UUID) *TestDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*TestClient) Get

func (c *TestClient) Get(ctx context.Context, id uuid.UUID) (*Test, error)

Get returns a Test entity by its id.

func (*TestClient) GetX

func (c *TestClient) GetX(ctx context.Context, id uuid.UUID) *Test

GetX is like Get, but panics if an error occurs.

func (*TestClient) Hooks

func (c *TestClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TestClient) Query

func (c *TestClient) Query() *TestQuery

Query returns a query builder for Test.

func (*TestClient) QueryDisplay

func (c *TestClient) QueryDisplay(t *Test) *TestDisplayQuery

QueryDisplay queries the display edge of a Test.

func (*TestClient) QueryQuestions

func (c *TestClient) QueryQuestions(t *Test) *QuestionQuery

QueryQuestions queries the questions edge of a Test.

func (*TestClient) QueryScales

func (c *TestClient) QueryScales(t *Test) *ScaleQuery

QueryScales queries the scales edge of a Test.

func (*TestClient) QueryTags

func (c *TestClient) QueryTags(t *Test) *TagQuery

QueryTags queries the tags edge of a Test.

func (*TestClient) QueryTakes

func (c *TestClient) QueryTakes(t *Test) *TakeQuery

QueryTakes queries the takes edge of a Test.

func (*TestClient) QueryTranslations

func (c *TestClient) QueryTranslations(t *Test) *TestTranslationQuery

QueryTranslations queries the translations edge of a Test.

func (*TestClient) Update

func (c *TestClient) Update() *TestUpdate

Update returns an update builder for Test.

func (*TestClient) UpdateOne

func (c *TestClient) UpdateOne(t *Test) *TestUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TestClient) UpdateOneID

func (c *TestClient) UpdateOneID(id uuid.UUID) *TestUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TestClient) Use

func (c *TestClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `test.Hooks(f(g(h())))`.

type TestCreate

type TestCreate struct {
	// contains filtered or unexported fields
}

TestCreate is the builder for creating a Test entity.

func (*TestCreate) AddQuestionIDs

func (tc *TestCreate) AddQuestionIDs(ids ...uuid.UUID) *TestCreate

AddQuestionIDs adds the "questions" edge to the Question entity by IDs.

func (*TestCreate) AddQuestions

func (tc *TestCreate) AddQuestions(q ...*Question) *TestCreate

AddQuestions adds the "questions" edges to the Question entity.

func (*TestCreate) AddScaleIDs

func (tc *TestCreate) AddScaleIDs(ids ...uuid.UUID) *TestCreate

AddScaleIDs adds the "scales" edge to the Scale entity by IDs.

func (*TestCreate) AddScales

func (tc *TestCreate) AddScales(s ...*Scale) *TestCreate

AddScales adds the "scales" edges to the Scale entity.

func (*TestCreate) AddTagIDs

func (tc *TestCreate) AddTagIDs(ids ...uuid.UUID) *TestCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*TestCreate) AddTags

func (tc *TestCreate) AddTags(t ...*Tag) *TestCreate

AddTags adds the "tags" edges to the Tag entity.

func (*TestCreate) AddTakeIDs

func (tc *TestCreate) AddTakeIDs(ids ...uuid.UUID) *TestCreate

AddTakeIDs adds the "takes" edge to the Take entity by IDs.

func (*TestCreate) AddTakes

func (tc *TestCreate) AddTakes(t ...*Take) *TestCreate

AddTakes adds the "takes" edges to the Take entity.

func (*TestCreate) AddTranslationIDs

func (tc *TestCreate) AddTranslationIDs(ids ...uuid.UUID) *TestCreate

AddTranslationIDs adds the "translations" edge to the TestTranslation entity by IDs.

func (*TestCreate) AddTranslations

func (tc *TestCreate) AddTranslations(t ...*TestTranslation) *TestCreate

AddTranslations adds the "translations" edges to the TestTranslation entity.

func (*TestCreate) Exec

func (tc *TestCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TestCreate) ExecX

func (tc *TestCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestCreate) Mutation

func (tc *TestCreate) Mutation() *TestMutation

Mutation returns the TestMutation object of the builder.

func (*TestCreate) Save

func (tc *TestCreate) Save(ctx context.Context) (*Test, error)

Save creates the Test in the database.

func (*TestCreate) SaveX

func (tc *TestCreate) SaveX(ctx context.Context) *Test

SaveX calls Save and panics if Save returns an error.

func (*TestCreate) SetAvailableLocales

func (tc *TestCreate) SetAvailableLocales(s []string) *TestCreate

SetAvailableLocales sets the "available_locales" field.

func (*TestCreate) SetCode

func (tc *TestCreate) SetCode(s string) *TestCreate

SetCode sets the "code" field.

func (*TestCreate) SetCreateTime

func (tc *TestCreate) SetCreateTime(t time.Time) *TestCreate

SetCreateTime sets the "create_time" field.

func (*TestCreate) SetDisplay

func (tc *TestCreate) SetDisplay(t *TestDisplay) *TestCreate

SetDisplay sets the "display" edge to the TestDisplay entity.

func (*TestCreate) SetDisplayID

func (tc *TestCreate) SetDisplayID(id uuid.UUID) *TestCreate

SetDisplayID sets the "display" edge to the TestDisplay entity by ID.

func (*TestCreate) SetDuration

func (tc *TestCreate) SetDuration(t time.Duration) *TestCreate

SetDuration sets the "duration" field.

func (*TestCreate) SetID

func (tc *TestCreate) SetID(u uuid.UUID) *TestCreate

SetID sets the "id" field.

func (*TestCreate) SetImage added in v1.1.0

func (tc *TestCreate) SetImage(s string) *TestCreate

SetImage sets the "image" field.

func (*TestCreate) SetMark

func (tc *TestCreate) SetMark(f float64) *TestCreate

SetMark sets the "mark" field.

func (*TestCreate) SetNillableCreateTime

func (tc *TestCreate) SetNillableCreateTime(t *time.Time) *TestCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TestCreate) SetNillableDisplayID

func (tc *TestCreate) SetNillableDisplayID(id *uuid.UUID) *TestCreate

SetNillableDisplayID sets the "display" edge to the TestDisplay entity by ID if the given value is not nil.

func (*TestCreate) SetNillableDuration

func (tc *TestCreate) SetNillableDuration(t *time.Duration) *TestCreate

SetNillableDuration sets the "duration" field if the given value is not nil.

func (*TestCreate) SetNillableID

func (tc *TestCreate) SetNillableID(u *uuid.UUID) *TestCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TestCreate) SetNillableImage added in v1.1.0

func (tc *TestCreate) SetNillableImage(s *string) *TestCreate

SetNillableImage sets the "image" field if the given value is not nil.

func (*TestCreate) SetNillableMark

func (tc *TestCreate) SetNillableMark(f *float64) *TestCreate

SetNillableMark sets the "mark" field if the given value is not nil.

func (*TestCreate) SetNillablePublished

func (tc *TestCreate) SetNillablePublished(b *bool) *TestCreate

SetNillablePublished sets the "published" field if the given value is not nil.

func (*TestCreate) SetNillableQuestionCount

func (tc *TestCreate) SetNillableQuestionCount(i *int) *TestCreate

SetNillableQuestionCount sets the "question_count" field if the given value is not nil.

func (*TestCreate) SetNillableUpdateTime

func (tc *TestCreate) SetNillableUpdateTime(t *time.Time) *TestCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*TestCreate) SetPublished

func (tc *TestCreate) SetPublished(b bool) *TestCreate

SetPublished sets the "published" field.

func (*TestCreate) SetQuestionCount

func (tc *TestCreate) SetQuestionCount(i int) *TestCreate

SetQuestionCount sets the "question_count" field.

func (*TestCreate) SetUpdateTime

func (tc *TestCreate) SetUpdateTime(t time.Time) *TestCreate

SetUpdateTime sets the "update_time" field.

type TestCreateBulk

type TestCreateBulk struct {
	// contains filtered or unexported fields
}

TestCreateBulk is the builder for creating many Test entities in bulk.

func (*TestCreateBulk) Exec

func (tcb *TestCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TestCreateBulk) ExecX

func (tcb *TestCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestCreateBulk) Save

func (tcb *TestCreateBulk) Save(ctx context.Context) ([]*Test, error)

Save creates the Test entities in the database.

func (*TestCreateBulk) SaveX

func (tcb *TestCreateBulk) SaveX(ctx context.Context) []*Test

SaveX is like Save, but panics if an error occurs.

type TestDelete

type TestDelete struct {
	// contains filtered or unexported fields
}

TestDelete is the builder for deleting a Test entity.

func (*TestDelete) Exec

func (td *TestDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TestDelete) ExecX

func (td *TestDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TestDelete) Where

func (td *TestDelete) Where(ps ...predicate.Test) *TestDelete

Where appends a list predicates to the TestDelete builder.

type TestDeleteOne

type TestDeleteOne struct {
	// contains filtered or unexported fields
}

TestDeleteOne is the builder for deleting a single Test entity.

func (*TestDeleteOne) Exec

func (tdo *TestDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TestDeleteOne) ExecX

func (tdo *TestDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TestDisplay

type TestDisplay struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// RandomizeOrder holds the value of the "randomize_order" field.
	RandomizeOrder bool `json:"randomize_order,omitempty"`
	// QuestionsPerPage holds the value of the "questions_per_page" field.
	QuestionsPerPage int `json:"questions_per_page,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TestDisplayQuery when eager-loading is set.
	Edges TestDisplayEdges `json:"edges"`
	// contains filtered or unexported fields
}

TestDisplay is the model entity for the TestDisplay schema.

func (*TestDisplay) QueryTest

func (td *TestDisplay) QueryTest() *TestQuery

QueryTest queries the "test" edge of the TestDisplay entity.

func (*TestDisplay) String

func (td *TestDisplay) String() string

String implements the fmt.Stringer.

func (*TestDisplay) Unwrap

func (td *TestDisplay) Unwrap() *TestDisplay

Unwrap unwraps the TestDisplay 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 (*TestDisplay) Update

func (td *TestDisplay) Update() *TestDisplayUpdateOne

Update returns a builder for updating this TestDisplay. Note that you need to call TestDisplay.Unwrap() before calling this method if this TestDisplay was returned from a transaction, and the transaction was committed or rolled back.

type TestDisplayClient

type TestDisplayClient struct {
	// contains filtered or unexported fields
}

TestDisplayClient is a client for the TestDisplay schema.

func NewTestDisplayClient

func NewTestDisplayClient(c config) *TestDisplayClient

NewTestDisplayClient returns a client for the TestDisplay from the given config.

func (*TestDisplayClient) Create

func (c *TestDisplayClient) Create() *TestDisplayCreate

Create returns a builder for creating a TestDisplay entity.

func (*TestDisplayClient) CreateBulk

func (c *TestDisplayClient) CreateBulk(builders ...*TestDisplayCreate) *TestDisplayCreateBulk

CreateBulk returns a builder for creating a bulk of TestDisplay entities.

func (*TestDisplayClient) Delete

func (c *TestDisplayClient) Delete() *TestDisplayDelete

Delete returns a delete builder for TestDisplay.

func (*TestDisplayClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TestDisplayClient) DeleteOneID

func (c *TestDisplayClient) DeleteOneID(id uuid.UUID) *TestDisplayDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*TestDisplayClient) Get

Get returns a TestDisplay entity by its id.

func (*TestDisplayClient) GetX

GetX is like Get, but panics if an error occurs.

func (*TestDisplayClient) Hooks

func (c *TestDisplayClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TestDisplayClient) Query

func (c *TestDisplayClient) Query() *TestDisplayQuery

Query returns a query builder for TestDisplay.

func (*TestDisplayClient) QueryTest

func (c *TestDisplayClient) QueryTest(td *TestDisplay) *TestQuery

QueryTest queries the test edge of a TestDisplay.

func (*TestDisplayClient) Update

func (c *TestDisplayClient) Update() *TestDisplayUpdate

Update returns an update builder for TestDisplay.

func (*TestDisplayClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TestDisplayClient) UpdateOneID

func (c *TestDisplayClient) UpdateOneID(id uuid.UUID) *TestDisplayUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TestDisplayClient) Use

func (c *TestDisplayClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `testdisplay.Hooks(f(g(h())))`.

type TestDisplayCreate

type TestDisplayCreate struct {
	// contains filtered or unexported fields
}

TestDisplayCreate is the builder for creating a TestDisplay entity.

func (*TestDisplayCreate) Exec

func (tdc *TestDisplayCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TestDisplayCreate) ExecX

func (tdc *TestDisplayCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestDisplayCreate) Mutation

func (tdc *TestDisplayCreate) Mutation() *TestDisplayMutation

Mutation returns the TestDisplayMutation object of the builder.

func (*TestDisplayCreate) Save

func (tdc *TestDisplayCreate) Save(ctx context.Context) (*TestDisplay, error)

Save creates the TestDisplay in the database.

func (*TestDisplayCreate) SaveX

func (tdc *TestDisplayCreate) SaveX(ctx context.Context) *TestDisplay

SaveX calls Save and panics if Save returns an error.

func (*TestDisplayCreate) SetID

SetID sets the "id" field.

func (*TestDisplayCreate) SetNillableID

func (tdc *TestDisplayCreate) SetNillableID(u *uuid.UUID) *TestDisplayCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TestDisplayCreate) SetNillableQuestionsPerPage

func (tdc *TestDisplayCreate) SetNillableQuestionsPerPage(i *int) *TestDisplayCreate

SetNillableQuestionsPerPage sets the "questions_per_page" field if the given value is not nil.

func (*TestDisplayCreate) SetNillableRandomizeOrder

func (tdc *TestDisplayCreate) SetNillableRandomizeOrder(b *bool) *TestDisplayCreate

SetNillableRandomizeOrder sets the "randomize_order" field if the given value is not nil.

func (*TestDisplayCreate) SetQuestionsPerPage

func (tdc *TestDisplayCreate) SetQuestionsPerPage(i int) *TestDisplayCreate

SetQuestionsPerPage sets the "questions_per_page" field.

func (*TestDisplayCreate) SetRandomizeOrder

func (tdc *TestDisplayCreate) SetRandomizeOrder(b bool) *TestDisplayCreate

SetRandomizeOrder sets the "randomize_order" field.

func (*TestDisplayCreate) SetTest

func (tdc *TestDisplayCreate) SetTest(t *Test) *TestDisplayCreate

SetTest sets the "test" edge to the Test entity.

func (*TestDisplayCreate) SetTestID

func (tdc *TestDisplayCreate) SetTestID(id uuid.UUID) *TestDisplayCreate

SetTestID sets the "test" edge to the Test entity by ID.

type TestDisplayCreateBulk

type TestDisplayCreateBulk struct {
	// contains filtered or unexported fields
}

TestDisplayCreateBulk is the builder for creating many TestDisplay entities in bulk.

func (*TestDisplayCreateBulk) Exec

func (tdcb *TestDisplayCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TestDisplayCreateBulk) ExecX

func (tdcb *TestDisplayCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestDisplayCreateBulk) Save

func (tdcb *TestDisplayCreateBulk) Save(ctx context.Context) ([]*TestDisplay, error)

Save creates the TestDisplay entities in the database.

func (*TestDisplayCreateBulk) SaveX

func (tdcb *TestDisplayCreateBulk) SaveX(ctx context.Context) []*TestDisplay

SaveX is like Save, but panics if an error occurs.

type TestDisplayDelete

type TestDisplayDelete struct {
	// contains filtered or unexported fields
}

TestDisplayDelete is the builder for deleting a TestDisplay entity.

func (*TestDisplayDelete) Exec

func (tdd *TestDisplayDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TestDisplayDelete) ExecX

func (tdd *TestDisplayDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TestDisplayDelete) Where

Where appends a list predicates to the TestDisplayDelete builder.

type TestDisplayDeleteOne

type TestDisplayDeleteOne struct {
	// contains filtered or unexported fields
}

TestDisplayDeleteOne is the builder for deleting a single TestDisplay entity.

func (*TestDisplayDeleteOne) Exec

func (tddo *TestDisplayDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TestDisplayDeleteOne) ExecX

func (tddo *TestDisplayDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TestDisplayEdges

type TestDisplayEdges struct {
	// Test holds the value of the test edge.
	Test *Test `json:"test,omitempty"`
	// contains filtered or unexported fields
}

TestDisplayEdges holds the relations/edges for other nodes in the graph.

func (TestDisplayEdges) TestOrErr

func (e TestDisplayEdges) TestOrErr() (*Test, error)

TestOrErr returns the Test value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TestDisplayGroupBy

type TestDisplayGroupBy struct {
	// contains filtered or unexported fields
}

TestDisplayGroupBy is the group-by builder for TestDisplay entities.

func (*TestDisplayGroupBy) Aggregate

func (tdgb *TestDisplayGroupBy) Aggregate(fns ...AggregateFunc) *TestDisplayGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TestDisplayGroupBy) Bool

func (s *TestDisplayGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TestDisplayGroupBy) BoolX

func (s *TestDisplayGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TestDisplayGroupBy) Bools

func (s *TestDisplayGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TestDisplayGroupBy) BoolsX

func (s *TestDisplayGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TestDisplayGroupBy) Float64

func (s *TestDisplayGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TestDisplayGroupBy) Float64X

func (s *TestDisplayGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TestDisplayGroupBy) Float64s

func (s *TestDisplayGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TestDisplayGroupBy) Float64sX

func (s *TestDisplayGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TestDisplayGroupBy) Int

func (s *TestDisplayGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TestDisplayGroupBy) IntX

func (s *TestDisplayGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TestDisplayGroupBy) Ints

func (s *TestDisplayGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TestDisplayGroupBy) IntsX

func (s *TestDisplayGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TestDisplayGroupBy) Scan

func (tdgb *TestDisplayGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TestDisplayGroupBy) ScanX

func (s *TestDisplayGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TestDisplayGroupBy) String

func (s *TestDisplayGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TestDisplayGroupBy) StringX

func (s *TestDisplayGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TestDisplayGroupBy) Strings

func (s *TestDisplayGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TestDisplayGroupBy) StringsX

func (s *TestDisplayGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TestDisplayMutation

type TestDisplayMutation struct {
	// contains filtered or unexported fields
}

TestDisplayMutation represents an operation that mutates the TestDisplay nodes in the graph.

func (*TestDisplayMutation) AddField

func (m *TestDisplayMutation) 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 (*TestDisplayMutation) AddQuestionsPerPage

func (m *TestDisplayMutation) AddQuestionsPerPage(i int)

AddQuestionsPerPage adds i to the "questions_per_page" field.

func (*TestDisplayMutation) AddedEdges

func (m *TestDisplayMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TestDisplayMutation) AddedField

func (m *TestDisplayMutation) 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 (*TestDisplayMutation) AddedFields

func (m *TestDisplayMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TestDisplayMutation) AddedIDs

func (m *TestDisplayMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TestDisplayMutation) AddedQuestionsPerPage

func (m *TestDisplayMutation) AddedQuestionsPerPage() (r int, exists bool)

AddedQuestionsPerPage returns the value that was added to the "questions_per_page" field in this mutation.

func (*TestDisplayMutation) ClearEdge

func (m *TestDisplayMutation) 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 (*TestDisplayMutation) ClearField

func (m *TestDisplayMutation) 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 (*TestDisplayMutation) ClearTest

func (m *TestDisplayMutation) ClearTest()

ClearTest clears the "test" edge to the Test entity.

func (*TestDisplayMutation) ClearedEdges

func (m *TestDisplayMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TestDisplayMutation) ClearedFields

func (m *TestDisplayMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TestDisplayMutation) Client

func (m TestDisplayMutation) 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 (*TestDisplayMutation) EdgeCleared

func (m *TestDisplayMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TestDisplayMutation) Field

func (m *TestDisplayMutation) 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 (*TestDisplayMutation) FieldCleared

func (m *TestDisplayMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TestDisplayMutation) Fields

func (m *TestDisplayMutation) 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 (*TestDisplayMutation) ID

func (m *TestDisplayMutation) ID() (id uuid.UUID, 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 (*TestDisplayMutation) IDs

func (m *TestDisplayMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*TestDisplayMutation) OldField

func (m *TestDisplayMutation) 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 (*TestDisplayMutation) OldQuestionsPerPage

func (m *TestDisplayMutation) OldQuestionsPerPage(ctx context.Context) (v int, err error)

OldQuestionsPerPage returns the old "questions_per_page" field's value of the TestDisplay entity. If the TestDisplay 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 (*TestDisplayMutation) OldRandomizeOrder

func (m *TestDisplayMutation) OldRandomizeOrder(ctx context.Context) (v bool, err error)

OldRandomizeOrder returns the old "randomize_order" field's value of the TestDisplay entity. If the TestDisplay 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 (*TestDisplayMutation) Op

func (m *TestDisplayMutation) Op() Op

Op returns the operation name.

func (*TestDisplayMutation) QuestionsPerPage

func (m *TestDisplayMutation) QuestionsPerPage() (r int, exists bool)

QuestionsPerPage returns the value of the "questions_per_page" field in the mutation.

func (*TestDisplayMutation) RandomizeOrder

func (m *TestDisplayMutation) RandomizeOrder() (r bool, exists bool)

RandomizeOrder returns the value of the "randomize_order" field in the mutation.

func (*TestDisplayMutation) RemovedEdges

func (m *TestDisplayMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TestDisplayMutation) RemovedIDs

func (m *TestDisplayMutation) 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 (*TestDisplayMutation) ResetEdge

func (m *TestDisplayMutation) 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 (*TestDisplayMutation) ResetField

func (m *TestDisplayMutation) 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 (*TestDisplayMutation) ResetQuestionsPerPage

func (m *TestDisplayMutation) ResetQuestionsPerPage()

ResetQuestionsPerPage resets all changes to the "questions_per_page" field.

func (*TestDisplayMutation) ResetRandomizeOrder

func (m *TestDisplayMutation) ResetRandomizeOrder()

ResetRandomizeOrder resets all changes to the "randomize_order" field.

func (*TestDisplayMutation) ResetTest

func (m *TestDisplayMutation) ResetTest()

ResetTest resets all changes to the "test" edge.

func (*TestDisplayMutation) SetField

func (m *TestDisplayMutation) 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 (*TestDisplayMutation) SetID

func (m *TestDisplayMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of TestDisplay entities.

func (*TestDisplayMutation) SetQuestionsPerPage

func (m *TestDisplayMutation) SetQuestionsPerPage(i int)

SetQuestionsPerPage sets the "questions_per_page" field.

func (*TestDisplayMutation) SetRandomizeOrder

func (m *TestDisplayMutation) SetRandomizeOrder(b bool)

SetRandomizeOrder sets the "randomize_order" field.

func (*TestDisplayMutation) SetTestID

func (m *TestDisplayMutation) SetTestID(id uuid.UUID)

SetTestID sets the "test" edge to the Test entity by id.

func (*TestDisplayMutation) TestCleared

func (m *TestDisplayMutation) TestCleared() bool

TestCleared reports if the "test" edge to the Test entity was cleared.

func (*TestDisplayMutation) TestID

func (m *TestDisplayMutation) TestID() (id uuid.UUID, exists bool)

TestID returns the "test" edge ID in the mutation.

func (*TestDisplayMutation) TestIDs

func (m *TestDisplayMutation) TestIDs() (ids []uuid.UUID)

TestIDs returns the "test" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TestID instead. It exists only for internal usage by the builders.

func (TestDisplayMutation) Tx

func (m TestDisplayMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TestDisplayMutation) Type

func (m *TestDisplayMutation) Type() string

Type returns the node type of this mutation (TestDisplay).

func (*TestDisplayMutation) Where

func (m *TestDisplayMutation) Where(ps ...predicate.TestDisplay)

Where appends a list predicates to the TestDisplayMutation builder.

type TestDisplayQuery

type TestDisplayQuery struct {
	// contains filtered or unexported fields
}

TestDisplayQuery is the builder for querying TestDisplay entities.

func (*TestDisplayQuery) All

func (tdq *TestDisplayQuery) All(ctx context.Context) ([]*TestDisplay, error)

All executes the query and returns a list of TestDisplays.

func (*TestDisplayQuery) AllX

func (tdq *TestDisplayQuery) AllX(ctx context.Context) []*TestDisplay

AllX is like All, but panics if an error occurs.

func (*TestDisplayQuery) Clone

func (tdq *TestDisplayQuery) Clone() *TestDisplayQuery

Clone returns a duplicate of the TestDisplayQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TestDisplayQuery) Count

func (tdq *TestDisplayQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TestDisplayQuery) CountX

func (tdq *TestDisplayQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TestDisplayQuery) Exist

func (tdq *TestDisplayQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TestDisplayQuery) ExistX

func (tdq *TestDisplayQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TestDisplayQuery) First

func (tdq *TestDisplayQuery) First(ctx context.Context) (*TestDisplay, error)

First returns the first TestDisplay entity from the query. Returns a *NotFoundError when no TestDisplay was found.

func (*TestDisplayQuery) FirstID

func (tdq *TestDisplayQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first TestDisplay ID from the query. Returns a *NotFoundError when no TestDisplay ID was found.

func (*TestDisplayQuery) FirstIDX

func (tdq *TestDisplayQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TestDisplayQuery) FirstX

func (tdq *TestDisplayQuery) FirstX(ctx context.Context) *TestDisplay

FirstX is like First, but panics if an error occurs.

func (*TestDisplayQuery) GroupBy

func (tdq *TestDisplayQuery) GroupBy(field string, fields ...string) *TestDisplayGroupBy

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 {
	RandomizeOrder bool `json:"randomize_order,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TestDisplay.Query().
	GroupBy(testdisplay.FieldRandomizeOrder).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TestDisplayQuery) IDs

func (tdq *TestDisplayQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of TestDisplay IDs.

func (*TestDisplayQuery) IDsX

func (tdq *TestDisplayQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TestDisplayQuery) Limit

func (tdq *TestDisplayQuery) Limit(limit int) *TestDisplayQuery

Limit adds a limit step to the query.

func (*TestDisplayQuery) Offset

func (tdq *TestDisplayQuery) Offset(offset int) *TestDisplayQuery

Offset adds an offset step to the query.

func (*TestDisplayQuery) Only

func (tdq *TestDisplayQuery) Only(ctx context.Context) (*TestDisplay, error)

Only returns a single TestDisplay entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TestDisplay entity is found. Returns a *NotFoundError when no TestDisplay entities are found.

func (*TestDisplayQuery) OnlyID

func (tdq *TestDisplayQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only TestDisplay ID in the query. Returns a *NotSingularError when more than one TestDisplay ID is found. Returns a *NotFoundError when no entities are found.

func (*TestDisplayQuery) OnlyIDX

func (tdq *TestDisplayQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TestDisplayQuery) OnlyX

func (tdq *TestDisplayQuery) OnlyX(ctx context.Context) *TestDisplay

OnlyX is like Only, but panics if an error occurs.

func (*TestDisplayQuery) Order

func (tdq *TestDisplayQuery) Order(o ...OrderFunc) *TestDisplayQuery

Order adds an order step to the query.

func (*TestDisplayQuery) QueryTest

func (tdq *TestDisplayQuery) QueryTest() *TestQuery

QueryTest chains the current query on the "test" edge.

func (*TestDisplayQuery) Select

func (tdq *TestDisplayQuery) Select(fields ...string) *TestDisplaySelect

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 {
	RandomizeOrder bool `json:"randomize_order,omitempty"`
}

client.TestDisplay.Query().
	Select(testdisplay.FieldRandomizeOrder).
	Scan(ctx, &v)

func (*TestDisplayQuery) Unique

func (tdq *TestDisplayQuery) Unique(unique bool) *TestDisplayQuery

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 (*TestDisplayQuery) Where

Where adds a new predicate for the TestDisplayQuery builder.

func (*TestDisplayQuery) WithTest

func (tdq *TestDisplayQuery) WithTest(opts ...func(*TestQuery)) *TestDisplayQuery

WithTest tells the query-builder to eager-load the nodes that are connected to the "test" edge. The optional arguments are used to configure the query builder of the edge.

type TestDisplaySelect

type TestDisplaySelect struct {
	*TestDisplayQuery
	// contains filtered or unexported fields
}

TestDisplaySelect is the builder for selecting fields of TestDisplay entities.

func (*TestDisplaySelect) Bool

func (s *TestDisplaySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TestDisplaySelect) BoolX

func (s *TestDisplaySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TestDisplaySelect) Bools

func (s *TestDisplaySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TestDisplaySelect) BoolsX

func (s *TestDisplaySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TestDisplaySelect) Float64

func (s *TestDisplaySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TestDisplaySelect) Float64X

func (s *TestDisplaySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TestDisplaySelect) Float64s

func (s *TestDisplaySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TestDisplaySelect) Float64sX

func (s *TestDisplaySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TestDisplaySelect) Int

func (s *TestDisplaySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TestDisplaySelect) IntX

func (s *TestDisplaySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TestDisplaySelect) Ints

func (s *TestDisplaySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TestDisplaySelect) IntsX

func (s *TestDisplaySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TestDisplaySelect) Scan

func (tds *TestDisplaySelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TestDisplaySelect) ScanX

func (s *TestDisplaySelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TestDisplaySelect) String

func (s *TestDisplaySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TestDisplaySelect) StringX

func (s *TestDisplaySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TestDisplaySelect) Strings

func (s *TestDisplaySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TestDisplaySelect) StringsX

func (s *TestDisplaySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TestDisplayUpdate

type TestDisplayUpdate struct {
	// contains filtered or unexported fields
}

TestDisplayUpdate is the builder for updating TestDisplay entities.

func (*TestDisplayUpdate) AddQuestionsPerPage

func (tdu *TestDisplayUpdate) AddQuestionsPerPage(i int) *TestDisplayUpdate

AddQuestionsPerPage adds i to the "questions_per_page" field.

func (*TestDisplayUpdate) ClearTest

func (tdu *TestDisplayUpdate) ClearTest() *TestDisplayUpdate

ClearTest clears the "test" edge to the Test entity.

func (*TestDisplayUpdate) Exec

func (tdu *TestDisplayUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TestDisplayUpdate) ExecX

func (tdu *TestDisplayUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestDisplayUpdate) Mutation

func (tdu *TestDisplayUpdate) Mutation() *TestDisplayMutation

Mutation returns the TestDisplayMutation object of the builder.

func (*TestDisplayUpdate) Save

func (tdu *TestDisplayUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TestDisplayUpdate) SaveX

func (tdu *TestDisplayUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TestDisplayUpdate) SetNillableQuestionsPerPage

func (tdu *TestDisplayUpdate) SetNillableQuestionsPerPage(i *int) *TestDisplayUpdate

SetNillableQuestionsPerPage sets the "questions_per_page" field if the given value is not nil.

func (*TestDisplayUpdate) SetNillableRandomizeOrder

func (tdu *TestDisplayUpdate) SetNillableRandomizeOrder(b *bool) *TestDisplayUpdate

SetNillableRandomizeOrder sets the "randomize_order" field if the given value is not nil.

func (*TestDisplayUpdate) SetQuestionsPerPage

func (tdu *TestDisplayUpdate) SetQuestionsPerPage(i int) *TestDisplayUpdate

SetQuestionsPerPage sets the "questions_per_page" field.

func (*TestDisplayUpdate) SetRandomizeOrder

func (tdu *TestDisplayUpdate) SetRandomizeOrder(b bool) *TestDisplayUpdate

SetRandomizeOrder sets the "randomize_order" field.

func (*TestDisplayUpdate) SetTest

func (tdu *TestDisplayUpdate) SetTest(t *Test) *TestDisplayUpdate

SetTest sets the "test" edge to the Test entity.

func (*TestDisplayUpdate) SetTestID

func (tdu *TestDisplayUpdate) SetTestID(id uuid.UUID) *TestDisplayUpdate

SetTestID sets the "test" edge to the Test entity by ID.

func (*TestDisplayUpdate) Where

Where appends a list predicates to the TestDisplayUpdate builder.

type TestDisplayUpdateOne

type TestDisplayUpdateOne struct {
	// contains filtered or unexported fields
}

TestDisplayUpdateOne is the builder for updating a single TestDisplay entity.

func (*TestDisplayUpdateOne) AddQuestionsPerPage

func (tduo *TestDisplayUpdateOne) AddQuestionsPerPage(i int) *TestDisplayUpdateOne

AddQuestionsPerPage adds i to the "questions_per_page" field.

func (*TestDisplayUpdateOne) ClearTest

func (tduo *TestDisplayUpdateOne) ClearTest() *TestDisplayUpdateOne

ClearTest clears the "test" edge to the Test entity.

func (*TestDisplayUpdateOne) Exec

func (tduo *TestDisplayUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TestDisplayUpdateOne) ExecX

func (tduo *TestDisplayUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestDisplayUpdateOne) Mutation

func (tduo *TestDisplayUpdateOne) Mutation() *TestDisplayMutation

Mutation returns the TestDisplayMutation object of the builder.

func (*TestDisplayUpdateOne) Save

Save executes the query and returns the updated TestDisplay entity.

func (*TestDisplayUpdateOne) SaveX

func (tduo *TestDisplayUpdateOne) SaveX(ctx context.Context) *TestDisplay

SaveX is like Save, but panics if an error occurs.

func (*TestDisplayUpdateOne) Select

func (tduo *TestDisplayUpdateOne) Select(field string, fields ...string) *TestDisplayUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TestDisplayUpdateOne) SetNillableQuestionsPerPage

func (tduo *TestDisplayUpdateOne) SetNillableQuestionsPerPage(i *int) *TestDisplayUpdateOne

SetNillableQuestionsPerPage sets the "questions_per_page" field if the given value is not nil.

func (*TestDisplayUpdateOne) SetNillableRandomizeOrder

func (tduo *TestDisplayUpdateOne) SetNillableRandomizeOrder(b *bool) *TestDisplayUpdateOne

SetNillableRandomizeOrder sets the "randomize_order" field if the given value is not nil.

func (*TestDisplayUpdateOne) SetQuestionsPerPage

func (tduo *TestDisplayUpdateOne) SetQuestionsPerPage(i int) *TestDisplayUpdateOne

SetQuestionsPerPage sets the "questions_per_page" field.

func (*TestDisplayUpdateOne) SetRandomizeOrder

func (tduo *TestDisplayUpdateOne) SetRandomizeOrder(b bool) *TestDisplayUpdateOne

SetRandomizeOrder sets the "randomize_order" field.

func (*TestDisplayUpdateOne) SetTest

func (tduo *TestDisplayUpdateOne) SetTest(t *Test) *TestDisplayUpdateOne

SetTest sets the "test" edge to the Test entity.

func (*TestDisplayUpdateOne) SetTestID

func (tduo *TestDisplayUpdateOne) SetTestID(id uuid.UUID) *TestDisplayUpdateOne

SetTestID sets the "test" edge to the Test entity by ID.

type TestDisplays

type TestDisplays []*TestDisplay

TestDisplays is a parsable slice of TestDisplay.

type TestEdges

type TestEdges struct {
	// Takes holds the value of the takes edge.
	Takes []*Take `json:"takes,omitempty"`
	// Questions holds the value of the questions edge.
	Questions []*Question `json:"questions,omitempty"`
	// Translations holds the value of the translations edge.
	Translations []*TestTranslation `json:"translations,omitempty"`
	// Scales holds the value of the scales edge.
	Scales []*Scale `json:"scales,omitempty"`
	// Display holds the value of the display edge.
	Display *TestDisplay `json:"display,omitempty"`
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

TestEdges holds the relations/edges for other nodes in the graph.

func (TestEdges) DisplayOrErr

func (e TestEdges) DisplayOrErr() (*TestDisplay, error)

DisplayOrErr returns the Display value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TestEdges) QuestionsOrErr

func (e TestEdges) QuestionsOrErr() ([]*Question, error)

QuestionsOrErr returns the Questions value or an error if the edge was not loaded in eager-loading.

func (TestEdges) ScalesOrErr

func (e TestEdges) ScalesOrErr() ([]*Scale, error)

ScalesOrErr returns the Scales value or an error if the edge was not loaded in eager-loading.

func (TestEdges) TagsOrErr

func (e TestEdges) TagsOrErr() ([]*Tag, error)

TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading.

func (TestEdges) TakesOrErr

func (e TestEdges) TakesOrErr() ([]*Take, error)

TakesOrErr returns the Takes value or an error if the edge was not loaded in eager-loading.

func (TestEdges) TranslationsOrErr

func (e TestEdges) TranslationsOrErr() ([]*TestTranslation, error)

TranslationsOrErr returns the Translations value or an error if the edge was not loaded in eager-loading.

type TestGroupBy

type TestGroupBy struct {
	// contains filtered or unexported fields
}

TestGroupBy is the group-by builder for Test entities.

func (*TestGroupBy) Aggregate

func (tgb *TestGroupBy) Aggregate(fns ...AggregateFunc) *TestGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TestGroupBy) Bool

func (s *TestGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TestGroupBy) BoolX

func (s *TestGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TestGroupBy) Bools

func (s *TestGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TestGroupBy) BoolsX

func (s *TestGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TestGroupBy) Float64

func (s *TestGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TestGroupBy) Float64X

func (s *TestGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TestGroupBy) Float64s

func (s *TestGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TestGroupBy) Float64sX

func (s *TestGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TestGroupBy) Int

func (s *TestGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TestGroupBy) IntX

func (s *TestGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TestGroupBy) Ints

func (s *TestGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TestGroupBy) IntsX

func (s *TestGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TestGroupBy) Scan

func (tgb *TestGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TestGroupBy) ScanX

func (s *TestGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TestGroupBy) String

func (s *TestGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TestGroupBy) StringX

func (s *TestGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TestGroupBy) Strings

func (s *TestGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TestGroupBy) StringsX

func (s *TestGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TestMutation

type TestMutation struct {
	// contains filtered or unexported fields
}

TestMutation represents an operation that mutates the Test nodes in the graph.

func (*TestMutation) AddDuration

func (m *TestMutation) AddDuration(t time.Duration)

AddDuration adds t to the "duration" field.

func (*TestMutation) AddField

func (m *TestMutation) 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 (*TestMutation) AddMark

func (m *TestMutation) AddMark(f float64)

AddMark adds f to the "mark" field.

func (*TestMutation) AddQuestionCount

func (m *TestMutation) AddQuestionCount(i int)

AddQuestionCount adds i to the "question_count" field.

func (*TestMutation) AddQuestionIDs

func (m *TestMutation) AddQuestionIDs(ids ...uuid.UUID)

AddQuestionIDs adds the "questions" edge to the Question entity by ids.

func (*TestMutation) AddScaleIDs

func (m *TestMutation) AddScaleIDs(ids ...uuid.UUID)

AddScaleIDs adds the "scales" edge to the Scale entity by ids.

func (*TestMutation) AddTagIDs

func (m *TestMutation) AddTagIDs(ids ...uuid.UUID)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*TestMutation) AddTakeIDs

func (m *TestMutation) AddTakeIDs(ids ...uuid.UUID)

AddTakeIDs adds the "takes" edge to the Take entity by ids.

func (*TestMutation) AddTranslationIDs

func (m *TestMutation) AddTranslationIDs(ids ...uuid.UUID)

AddTranslationIDs adds the "translations" edge to the TestTranslation entity by ids.

func (*TestMutation) AddedDuration

func (m *TestMutation) AddedDuration() (r time.Duration, exists bool)

AddedDuration returns the value that was added to the "duration" field in this mutation.

func (*TestMutation) AddedEdges

func (m *TestMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TestMutation) AddedField

func (m *TestMutation) 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 (*TestMutation) AddedFields

func (m *TestMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TestMutation) AddedIDs

func (m *TestMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TestMutation) AddedMark

func (m *TestMutation) AddedMark() (r float64, exists bool)

AddedMark returns the value that was added to the "mark" field in this mutation.

func (*TestMutation) AddedQuestionCount

func (m *TestMutation) AddedQuestionCount() (r int, exists bool)

AddedQuestionCount returns the value that was added to the "question_count" field in this mutation.

func (*TestMutation) AvailableLocales

func (m *TestMutation) AvailableLocales() (r []string, exists bool)

AvailableLocales returns the value of the "available_locales" field in the mutation.

func (*TestMutation) AvailableLocalesCleared

func (m *TestMutation) AvailableLocalesCleared() bool

AvailableLocalesCleared returns if the "available_locales" field was cleared in this mutation.

func (*TestMutation) ClearAvailableLocales

func (m *TestMutation) ClearAvailableLocales()

ClearAvailableLocales clears the value of the "available_locales" field.

func (*TestMutation) ClearDisplay

func (m *TestMutation) ClearDisplay()

ClearDisplay clears the "display" edge to the TestDisplay entity.

func (*TestMutation) ClearDuration

func (m *TestMutation) ClearDuration()

ClearDuration clears the value of the "duration" field.

func (*TestMutation) ClearEdge

func (m *TestMutation) 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 (*TestMutation) ClearField

func (m *TestMutation) 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 (*TestMutation) ClearImage added in v1.1.0

func (m *TestMutation) ClearImage()

ClearImage clears the value of the "image" field.

func (*TestMutation) ClearQuestions

func (m *TestMutation) ClearQuestions()

ClearQuestions clears the "questions" edge to the Question entity.

func (*TestMutation) ClearScales

func (m *TestMutation) ClearScales()

ClearScales clears the "scales" edge to the Scale entity.

func (*TestMutation) ClearTags

func (m *TestMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*TestMutation) ClearTakes

func (m *TestMutation) ClearTakes()

ClearTakes clears the "takes" edge to the Take entity.

func (*TestMutation) ClearTranslations

func (m *TestMutation) ClearTranslations()

ClearTranslations clears the "translations" edge to the TestTranslation entity.

func (*TestMutation) ClearedEdges

func (m *TestMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TestMutation) ClearedFields

func (m *TestMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TestMutation) Client

func (m TestMutation) 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 (*TestMutation) Code

func (m *TestMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*TestMutation) CreateTime

func (m *TestMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*TestMutation) DisplayCleared

func (m *TestMutation) DisplayCleared() bool

DisplayCleared reports if the "display" edge to the TestDisplay entity was cleared.

func (*TestMutation) DisplayID

func (m *TestMutation) DisplayID() (id uuid.UUID, exists bool)

DisplayID returns the "display" edge ID in the mutation.

func (*TestMutation) DisplayIDs

func (m *TestMutation) DisplayIDs() (ids []uuid.UUID)

DisplayIDs returns the "display" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DisplayID instead. It exists only for internal usage by the builders.

func (*TestMutation) Duration

func (m *TestMutation) Duration() (r time.Duration, exists bool)

Duration returns the value of the "duration" field in the mutation.

func (*TestMutation) DurationCleared

func (m *TestMutation) DurationCleared() bool

DurationCleared returns if the "duration" field was cleared in this mutation.

func (*TestMutation) EdgeCleared

func (m *TestMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TestMutation) Field

func (m *TestMutation) 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 (*TestMutation) FieldCleared

func (m *TestMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TestMutation) Fields

func (m *TestMutation) 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 (*TestMutation) ID

func (m *TestMutation) ID() (id uuid.UUID, 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 (*TestMutation) IDs

func (m *TestMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*TestMutation) Image added in v1.1.0

func (m *TestMutation) Image() (r string, exists bool)

Image returns the value of the "image" field in the mutation.

func (*TestMutation) ImageCleared added in v1.1.0

func (m *TestMutation) ImageCleared() bool

ImageCleared returns if the "image" field was cleared in this mutation.

func (*TestMutation) Mark

func (m *TestMutation) Mark() (r float64, exists bool)

Mark returns the value of the "mark" field in the mutation.

func (*TestMutation) OldAvailableLocales

func (m *TestMutation) OldAvailableLocales(ctx context.Context) (v []string, err error)

OldAvailableLocales returns the old "available_locales" field's value of the Test entity. If the Test 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 (*TestMutation) OldCode

func (m *TestMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Test entity. If the Test 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 (*TestMutation) OldCreateTime

func (m *TestMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Test entity. If the Test 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 (*TestMutation) OldDuration

func (m *TestMutation) OldDuration(ctx context.Context) (v *time.Duration, err error)

OldDuration returns the old "duration" field's value of the Test entity. If the Test 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 (*TestMutation) OldField

func (m *TestMutation) 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 (*TestMutation) OldImage added in v1.1.0

func (m *TestMutation) OldImage(ctx context.Context) (v string, err error)

OldImage returns the old "image" field's value of the Test entity. If the Test 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 (*TestMutation) OldMark

func (m *TestMutation) OldMark(ctx context.Context) (v float64, err error)

OldMark returns the old "mark" field's value of the Test entity. If the Test 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 (*TestMutation) OldPublished

func (m *TestMutation) OldPublished(ctx context.Context) (v bool, err error)

OldPublished returns the old "published" field's value of the Test entity. If the Test 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 (*TestMutation) OldQuestionCount

func (m *TestMutation) OldQuestionCount(ctx context.Context) (v int, err error)

OldQuestionCount returns the old "question_count" field's value of the Test entity. If the Test 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 (*TestMutation) OldUpdateTime

func (m *TestMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Test entity. If the Test 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 (*TestMutation) Op

func (m *TestMutation) Op() Op

Op returns the operation name.

func (*TestMutation) Published

func (m *TestMutation) Published() (r bool, exists bool)

Published returns the value of the "published" field in the mutation.

func (*TestMutation) QuestionCount

func (m *TestMutation) QuestionCount() (r int, exists bool)

QuestionCount returns the value of the "question_count" field in the mutation.

func (*TestMutation) QuestionsCleared

func (m *TestMutation) QuestionsCleared() bool

QuestionsCleared reports if the "questions" edge to the Question entity was cleared.

func (*TestMutation) QuestionsIDs

func (m *TestMutation) QuestionsIDs() (ids []uuid.UUID)

QuestionsIDs returns the "questions" edge IDs in the mutation.

func (*TestMutation) RemoveQuestionIDs

func (m *TestMutation) RemoveQuestionIDs(ids ...uuid.UUID)

RemoveQuestionIDs removes the "questions" edge to the Question entity by IDs.

func (*TestMutation) RemoveScaleIDs

func (m *TestMutation) RemoveScaleIDs(ids ...uuid.UUID)

RemoveScaleIDs removes the "scales" edge to the Scale entity by IDs.

func (*TestMutation) RemoveTagIDs

func (m *TestMutation) RemoveTagIDs(ids ...uuid.UUID)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*TestMutation) RemoveTakeIDs

func (m *TestMutation) RemoveTakeIDs(ids ...uuid.UUID)

RemoveTakeIDs removes the "takes" edge to the Take entity by IDs.

func (*TestMutation) RemoveTranslationIDs

func (m *TestMutation) RemoveTranslationIDs(ids ...uuid.UUID)

RemoveTranslationIDs removes the "translations" edge to the TestTranslation entity by IDs.

func (*TestMutation) RemovedEdges

func (m *TestMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TestMutation) RemovedIDs

func (m *TestMutation) 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 (*TestMutation) RemovedQuestionsIDs

func (m *TestMutation) RemovedQuestionsIDs() (ids []uuid.UUID)

RemovedQuestions returns the removed IDs of the "questions" edge to the Question entity.

func (*TestMutation) RemovedScalesIDs

func (m *TestMutation) RemovedScalesIDs() (ids []uuid.UUID)

RemovedScales returns the removed IDs of the "scales" edge to the Scale entity.

func (*TestMutation) RemovedTagsIDs

func (m *TestMutation) RemovedTagsIDs() (ids []uuid.UUID)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*TestMutation) RemovedTakesIDs

func (m *TestMutation) RemovedTakesIDs() (ids []uuid.UUID)

RemovedTakes returns the removed IDs of the "takes" edge to the Take entity.

func (*TestMutation) RemovedTranslationsIDs

func (m *TestMutation) RemovedTranslationsIDs() (ids []uuid.UUID)

RemovedTranslations returns the removed IDs of the "translations" edge to the TestTranslation entity.

func (*TestMutation) ResetAvailableLocales

func (m *TestMutation) ResetAvailableLocales()

ResetAvailableLocales resets all changes to the "available_locales" field.

func (*TestMutation) ResetCode

func (m *TestMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*TestMutation) ResetCreateTime

func (m *TestMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*TestMutation) ResetDisplay

func (m *TestMutation) ResetDisplay()

ResetDisplay resets all changes to the "display" edge.

func (*TestMutation) ResetDuration

func (m *TestMutation) ResetDuration()

ResetDuration resets all changes to the "duration" field.

func (*TestMutation) ResetEdge

func (m *TestMutation) 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 (*TestMutation) ResetField

func (m *TestMutation) 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 (*TestMutation) ResetImage added in v1.1.0

func (m *TestMutation) ResetImage()

ResetImage resets all changes to the "image" field.

func (*TestMutation) ResetMark

func (m *TestMutation) ResetMark()

ResetMark resets all changes to the "mark" field.

func (*TestMutation) ResetPublished

func (m *TestMutation) ResetPublished()

ResetPublished resets all changes to the "published" field.

func (*TestMutation) ResetQuestionCount

func (m *TestMutation) ResetQuestionCount()

ResetQuestionCount resets all changes to the "question_count" field.

func (*TestMutation) ResetQuestions

func (m *TestMutation) ResetQuestions()

ResetQuestions resets all changes to the "questions" edge.

func (*TestMutation) ResetScales

func (m *TestMutation) ResetScales()

ResetScales resets all changes to the "scales" edge.

func (*TestMutation) ResetTags

func (m *TestMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*TestMutation) ResetTakes

func (m *TestMutation) ResetTakes()

ResetTakes resets all changes to the "takes" edge.

func (*TestMutation) ResetTranslations

func (m *TestMutation) ResetTranslations()

ResetTranslations resets all changes to the "translations" edge.

func (*TestMutation) ResetUpdateTime

func (m *TestMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*TestMutation) ScalesCleared

func (m *TestMutation) ScalesCleared() bool

ScalesCleared reports if the "scales" edge to the Scale entity was cleared.

func (*TestMutation) ScalesIDs

func (m *TestMutation) ScalesIDs() (ids []uuid.UUID)

ScalesIDs returns the "scales" edge IDs in the mutation.

func (*TestMutation) SetAvailableLocales

func (m *TestMutation) SetAvailableLocales(s []string)

SetAvailableLocales sets the "available_locales" field.

func (*TestMutation) SetCode

func (m *TestMutation) SetCode(s string)

SetCode sets the "code" field.

func (*TestMutation) SetCreateTime

func (m *TestMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*TestMutation) SetDisplayID

func (m *TestMutation) SetDisplayID(id uuid.UUID)

SetDisplayID sets the "display" edge to the TestDisplay entity by id.

func (*TestMutation) SetDuration

func (m *TestMutation) SetDuration(t time.Duration)

SetDuration sets the "duration" field.

func (*TestMutation) SetField

func (m *TestMutation) 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 (*TestMutation) SetID

func (m *TestMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Test entities.

func (*TestMutation) SetImage added in v1.1.0

func (m *TestMutation) SetImage(s string)

SetImage sets the "image" field.

func (*TestMutation) SetMark

func (m *TestMutation) SetMark(f float64)

SetMark sets the "mark" field.

func (*TestMutation) SetPublished

func (m *TestMutation) SetPublished(b bool)

SetPublished sets the "published" field.

func (*TestMutation) SetQuestionCount

func (m *TestMutation) SetQuestionCount(i int)

SetQuestionCount sets the "question_count" field.

func (*TestMutation) SetUpdateTime

func (m *TestMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*TestMutation) TagsCleared

func (m *TestMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*TestMutation) TagsIDs

func (m *TestMutation) TagsIDs() (ids []uuid.UUID)

TagsIDs returns the "tags" edge IDs in the mutation.

func (*TestMutation) TakesCleared

func (m *TestMutation) TakesCleared() bool

TakesCleared reports if the "takes" edge to the Take entity was cleared.

func (*TestMutation) TakesIDs

func (m *TestMutation) TakesIDs() (ids []uuid.UUID)

TakesIDs returns the "takes" edge IDs in the mutation.

func (*TestMutation) TranslationsCleared

func (m *TestMutation) TranslationsCleared() bool

TranslationsCleared reports if the "translations" edge to the TestTranslation entity was cleared.

func (*TestMutation) TranslationsIDs

func (m *TestMutation) TranslationsIDs() (ids []uuid.UUID)

TranslationsIDs returns the "translations" edge IDs in the mutation.

func (TestMutation) Tx

func (m TestMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TestMutation) Type

func (m *TestMutation) Type() string

Type returns the node type of this mutation (Test).

func (*TestMutation) UpdateTime

func (m *TestMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*TestMutation) Where

func (m *TestMutation) Where(ps ...predicate.Test)

Where appends a list predicates to the TestMutation builder.

type TestQuery

type TestQuery struct {
	// contains filtered or unexported fields
}

TestQuery is the builder for querying Test entities.

func (*TestQuery) All

func (tq *TestQuery) All(ctx context.Context) ([]*Test, error)

All executes the query and returns a list of Tests.

func (*TestQuery) AllX

func (tq *TestQuery) AllX(ctx context.Context) []*Test

AllX is like All, but panics if an error occurs.

func (*TestQuery) Clone

func (tq *TestQuery) Clone() *TestQuery

Clone returns a duplicate of the TestQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TestQuery) Count

func (tq *TestQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TestQuery) CountX

func (tq *TestQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TestQuery) Exist

func (tq *TestQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TestQuery) ExistX

func (tq *TestQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TestQuery) First

func (tq *TestQuery) First(ctx context.Context) (*Test, error)

First returns the first Test entity from the query. Returns a *NotFoundError when no Test was found.

func (*TestQuery) FirstID

func (tq *TestQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Test ID from the query. Returns a *NotFoundError when no Test ID was found.

func (*TestQuery) FirstIDX

func (tq *TestQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TestQuery) FirstX

func (tq *TestQuery) FirstX(ctx context.Context) *Test

FirstX is like First, but panics if an error occurs.

func (*TestQuery) GroupBy

func (tq *TestQuery) GroupBy(field string, fields ...string) *TestGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Test.Query().
	GroupBy(test.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TestQuery) IDs

func (tq *TestQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Test IDs.

func (*TestQuery) IDsX

func (tq *TestQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TestQuery) Limit

func (tq *TestQuery) Limit(limit int) *TestQuery

Limit adds a limit step to the query.

func (*TestQuery) Offset

func (tq *TestQuery) Offset(offset int) *TestQuery

Offset adds an offset step to the query.

func (*TestQuery) Only

func (tq *TestQuery) Only(ctx context.Context) (*Test, error)

Only returns a single Test entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Test entity is found. Returns a *NotFoundError when no Test entities are found.

func (*TestQuery) OnlyID

func (tq *TestQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Test ID in the query. Returns a *NotSingularError when more than one Test ID is found. Returns a *NotFoundError when no entities are found.

func (*TestQuery) OnlyIDX

func (tq *TestQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TestQuery) OnlyX

func (tq *TestQuery) OnlyX(ctx context.Context) *Test

OnlyX is like Only, but panics if an error occurs.

func (*TestQuery) Order

func (tq *TestQuery) Order(o ...OrderFunc) *TestQuery

Order adds an order step to the query.

func (*TestQuery) QueryDisplay

func (tq *TestQuery) QueryDisplay() *TestDisplayQuery

QueryDisplay chains the current query on the "display" edge.

func (*TestQuery) QueryQuestions

func (tq *TestQuery) QueryQuestions() *QuestionQuery

QueryQuestions chains the current query on the "questions" edge.

func (*TestQuery) QueryScales

func (tq *TestQuery) QueryScales() *ScaleQuery

QueryScales chains the current query on the "scales" edge.

func (*TestQuery) QueryTags

func (tq *TestQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*TestQuery) QueryTakes

func (tq *TestQuery) QueryTakes() *TakeQuery

QueryTakes chains the current query on the "takes" edge.

func (*TestQuery) QueryTranslations

func (tq *TestQuery) QueryTranslations() *TestTranslationQuery

QueryTranslations chains the current query on the "translations" edge.

func (*TestQuery) Select

func (tq *TestQuery) Select(fields ...string) *TestSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Test.Query().
	Select(test.FieldCreateTime).
	Scan(ctx, &v)

func (*TestQuery) Unique

func (tq *TestQuery) Unique(unique bool) *TestQuery

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 (*TestQuery) Where

func (tq *TestQuery) Where(ps ...predicate.Test) *TestQuery

Where adds a new predicate for the TestQuery builder.

func (*TestQuery) WithDisplay

func (tq *TestQuery) WithDisplay(opts ...func(*TestDisplayQuery)) *TestQuery

WithDisplay tells the query-builder to eager-load the nodes that are connected to the "display" edge. The optional arguments are used to configure the query builder of the edge.

func (*TestQuery) WithQuestions

func (tq *TestQuery) WithQuestions(opts ...func(*QuestionQuery)) *TestQuery

WithQuestions tells the query-builder to eager-load the nodes that are connected to the "questions" edge. The optional arguments are used to configure the query builder of the edge.

func (*TestQuery) WithScales

func (tq *TestQuery) WithScales(opts ...func(*ScaleQuery)) *TestQuery

WithScales tells the query-builder to eager-load the nodes that are connected to the "scales" edge. The optional arguments are used to configure the query builder of the edge.

func (*TestQuery) WithTags

func (tq *TestQuery) WithTags(opts ...func(*TagQuery)) *TestQuery

WithTags tells the query-builder to eager-load the nodes that are connected to the "tags" edge. The optional arguments are used to configure the query builder of the edge.

func (*TestQuery) WithTakes

func (tq *TestQuery) WithTakes(opts ...func(*TakeQuery)) *TestQuery

WithTakes tells the query-builder to eager-load the nodes that are connected to the "takes" edge. The optional arguments are used to configure the query builder of the edge.

func (*TestQuery) WithTranslations

func (tq *TestQuery) WithTranslations(opts ...func(*TestTranslationQuery)) *TestQuery

WithTranslations tells the query-builder to eager-load the nodes that are connected to the "translations" edge. The optional arguments are used to configure the query builder of the edge.

type TestSelect

type TestSelect struct {
	*TestQuery
	// contains filtered or unexported fields
}

TestSelect is the builder for selecting fields of Test entities.

func (*TestSelect) Bool

func (s *TestSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TestSelect) BoolX

func (s *TestSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TestSelect) Bools

func (s *TestSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TestSelect) BoolsX

func (s *TestSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TestSelect) Float64

func (s *TestSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TestSelect) Float64X

func (s *TestSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TestSelect) Float64s

func (s *TestSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TestSelect) Float64sX

func (s *TestSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TestSelect) Int

func (s *TestSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TestSelect) IntX

func (s *TestSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TestSelect) Ints

func (s *TestSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TestSelect) IntsX

func (s *TestSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TestSelect) Scan

func (ts *TestSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TestSelect) ScanX

func (s *TestSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TestSelect) String

func (s *TestSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TestSelect) StringX

func (s *TestSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TestSelect) Strings

func (s *TestSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TestSelect) StringsX

func (s *TestSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TestTranslation

type TestTranslation struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Locale holds the value of the "locale" field.
	Locale testtranslation.Locale `json:"locale,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Details holds the value of the "details" field.
	Details string `json:"details,omitempty"`
	// Instruction holds the value of the "instruction" field.
	Instruction string `json:"instruction,omitempty"`
	// ResultPreambule holds the value of the "result_preambule" field.
	ResultPreambule string `json:"result_preambule,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TestTranslationQuery when eager-loading is set.
	Edges TestTranslationEdges `json:"edges"`
	// contains filtered or unexported fields
}

TestTranslation is the model entity for the TestTranslation schema.

func (*TestTranslation) QueryTest

func (tt *TestTranslation) QueryTest() *TestQuery

QueryTest queries the "test" edge of the TestTranslation entity.

func (*TestTranslation) String

func (tt *TestTranslation) String() string

String implements the fmt.Stringer.

func (*TestTranslation) Unwrap

func (tt *TestTranslation) Unwrap() *TestTranslation

Unwrap unwraps the TestTranslation 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 (*TestTranslation) Update

Update returns a builder for updating this TestTranslation. Note that you need to call TestTranslation.Unwrap() before calling this method if this TestTranslation was returned from a transaction, and the transaction was committed or rolled back.

type TestTranslationClient

type TestTranslationClient struct {
	// contains filtered or unexported fields
}

TestTranslationClient is a client for the TestTranslation schema.

func NewTestTranslationClient

func NewTestTranslationClient(c config) *TestTranslationClient

NewTestTranslationClient returns a client for the TestTranslation from the given config.

func (*TestTranslationClient) Create

Create returns a builder for creating a TestTranslation entity.

func (*TestTranslationClient) CreateBulk

CreateBulk returns a builder for creating a bulk of TestTranslation entities.

func (*TestTranslationClient) Delete

Delete returns a delete builder for TestTranslation.

func (*TestTranslationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TestTranslationClient) DeleteOneID

DeleteOne returns a builder for deleting the given entity by its id.

func (*TestTranslationClient) Get

Get returns a TestTranslation entity by its id.

func (*TestTranslationClient) GetX

GetX is like Get, but panics if an error occurs.

func (*TestTranslationClient) Hooks

func (c *TestTranslationClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TestTranslationClient) Query

Query returns a query builder for TestTranslation.

func (*TestTranslationClient) QueryTest

func (c *TestTranslationClient) QueryTest(tt *TestTranslation) *TestQuery

QueryTest queries the test edge of a TestTranslation.

func (*TestTranslationClient) Update

Update returns an update builder for TestTranslation.

func (*TestTranslationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TestTranslationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*TestTranslationClient) Use

func (c *TestTranslationClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `testtranslation.Hooks(f(g(h())))`.

type TestTranslationCreate

type TestTranslationCreate struct {
	// contains filtered or unexported fields
}

TestTranslationCreate is the builder for creating a TestTranslation entity.

func (*TestTranslationCreate) Exec

func (ttc *TestTranslationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TestTranslationCreate) ExecX

func (ttc *TestTranslationCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestTranslationCreate) Mutation

Mutation returns the TestTranslationMutation object of the builder.

func (*TestTranslationCreate) Save

Save creates the TestTranslation in the database.

func (*TestTranslationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*TestTranslationCreate) SetDescription

func (ttc *TestTranslationCreate) SetDescription(s string) *TestTranslationCreate

SetDescription sets the "description" field.

func (*TestTranslationCreate) SetDetails

SetDetails sets the "details" field.

func (*TestTranslationCreate) SetID

SetID sets the "id" field.

func (*TestTranslationCreate) SetInstruction

func (ttc *TestTranslationCreate) SetInstruction(s string) *TestTranslationCreate

SetInstruction sets the "instruction" field.

func (*TestTranslationCreate) SetLocale

SetLocale sets the "locale" field.

func (*TestTranslationCreate) SetNillableDescription

func (ttc *TestTranslationCreate) SetNillableDescription(s *string) *TestTranslationCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TestTranslationCreate) SetNillableDetails

func (ttc *TestTranslationCreate) SetNillableDetails(s *string) *TestTranslationCreate

SetNillableDetails sets the "details" field if the given value is not nil.

func (*TestTranslationCreate) SetNillableID

func (ttc *TestTranslationCreate) SetNillableID(u *uuid.UUID) *TestTranslationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TestTranslationCreate) SetNillableInstruction

func (ttc *TestTranslationCreate) SetNillableInstruction(s *string) *TestTranslationCreate

SetNillableInstruction sets the "instruction" field if the given value is not nil.

func (*TestTranslationCreate) SetNillableResultPreambule

func (ttc *TestTranslationCreate) SetNillableResultPreambule(s *string) *TestTranslationCreate

SetNillableResultPreambule sets the "result_preambule" field if the given value is not nil.

func (*TestTranslationCreate) SetNillableTestID

func (ttc *TestTranslationCreate) SetNillableTestID(id *uuid.UUID) *TestTranslationCreate

SetNillableTestID sets the "test" edge to the Test entity by ID if the given value is not nil.

func (*TestTranslationCreate) SetResultPreambule

func (ttc *TestTranslationCreate) SetResultPreambule(s string) *TestTranslationCreate

SetResultPreambule sets the "result_preambule" field.

func (*TestTranslationCreate) SetTest

SetTest sets the "test" edge to the Test entity.

func (*TestTranslationCreate) SetTestID

SetTestID sets the "test" edge to the Test entity by ID.

func (*TestTranslationCreate) SetTitle

SetTitle sets the "title" field.

type TestTranslationCreateBulk

type TestTranslationCreateBulk struct {
	// contains filtered or unexported fields
}

TestTranslationCreateBulk is the builder for creating many TestTranslation entities in bulk.

func (*TestTranslationCreateBulk) Exec

Exec executes the query.

func (*TestTranslationCreateBulk) ExecX

func (ttcb *TestTranslationCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestTranslationCreateBulk) Save

Save creates the TestTranslation entities in the database.

func (*TestTranslationCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type TestTranslationDelete

type TestTranslationDelete struct {
	// contains filtered or unexported fields
}

TestTranslationDelete is the builder for deleting a TestTranslation entity.

func (*TestTranslationDelete) Exec

func (ttd *TestTranslationDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TestTranslationDelete) ExecX

func (ttd *TestTranslationDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TestTranslationDelete) Where

Where appends a list predicates to the TestTranslationDelete builder.

type TestTranslationDeleteOne

type TestTranslationDeleteOne struct {
	// contains filtered or unexported fields
}

TestTranslationDeleteOne is the builder for deleting a single TestTranslation entity.

func (*TestTranslationDeleteOne) Exec

Exec executes the deletion query.

func (*TestTranslationDeleteOne) ExecX

func (ttdo *TestTranslationDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TestTranslationEdges

type TestTranslationEdges struct {
	// Test holds the value of the test edge.
	Test *Test `json:"test,omitempty"`
	// contains filtered or unexported fields
}

TestTranslationEdges holds the relations/edges for other nodes in the graph.

func (TestTranslationEdges) TestOrErr

func (e TestTranslationEdges) TestOrErr() (*Test, error)

TestOrErr returns the Test value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TestTranslationGroupBy

type TestTranslationGroupBy struct {
	// contains filtered or unexported fields
}

TestTranslationGroupBy is the group-by builder for TestTranslation entities.

func (*TestTranslationGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*TestTranslationGroupBy) Bool

func (s *TestTranslationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TestTranslationGroupBy) BoolX

func (s *TestTranslationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TestTranslationGroupBy) Bools

func (s *TestTranslationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TestTranslationGroupBy) BoolsX

func (s *TestTranslationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TestTranslationGroupBy) Float64

func (s *TestTranslationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TestTranslationGroupBy) Float64X

func (s *TestTranslationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TestTranslationGroupBy) Float64s

func (s *TestTranslationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TestTranslationGroupBy) Float64sX

func (s *TestTranslationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TestTranslationGroupBy) Int

func (s *TestTranslationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TestTranslationGroupBy) IntX

func (s *TestTranslationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TestTranslationGroupBy) Ints

func (s *TestTranslationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TestTranslationGroupBy) IntsX

func (s *TestTranslationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TestTranslationGroupBy) Scan

func (ttgb *TestTranslationGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TestTranslationGroupBy) ScanX

func (s *TestTranslationGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TestTranslationGroupBy) String

func (s *TestTranslationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TestTranslationGroupBy) StringX

func (s *TestTranslationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TestTranslationGroupBy) Strings

func (s *TestTranslationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TestTranslationGroupBy) StringsX

func (s *TestTranslationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TestTranslationMutation

type TestTranslationMutation struct {
	// contains filtered or unexported fields
}

TestTranslationMutation represents an operation that mutates the TestTranslation nodes in the graph.

func (*TestTranslationMutation) AddField

func (m *TestTranslationMutation) 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 (*TestTranslationMutation) AddedEdges

func (m *TestTranslationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TestTranslationMutation) AddedField

func (m *TestTranslationMutation) 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 (*TestTranslationMutation) AddedFields

func (m *TestTranslationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TestTranslationMutation) AddedIDs

func (m *TestTranslationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TestTranslationMutation) ClearDescription

func (m *TestTranslationMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*TestTranslationMutation) ClearDetails

func (m *TestTranslationMutation) ClearDetails()

ClearDetails clears the value of the "details" field.

func (*TestTranslationMutation) ClearEdge

func (m *TestTranslationMutation) 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 (*TestTranslationMutation) ClearField

func (m *TestTranslationMutation) 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 (*TestTranslationMutation) ClearInstruction

func (m *TestTranslationMutation) ClearInstruction()

ClearInstruction clears the value of the "instruction" field.

func (*TestTranslationMutation) ClearResultPreambule

func (m *TestTranslationMutation) ClearResultPreambule()

ClearResultPreambule clears the value of the "result_preambule" field.

func (*TestTranslationMutation) ClearTest

func (m *TestTranslationMutation) ClearTest()

ClearTest clears the "test" edge to the Test entity.

func (*TestTranslationMutation) ClearedEdges

func (m *TestTranslationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TestTranslationMutation) ClearedFields

func (m *TestTranslationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TestTranslationMutation) Client

func (m TestTranslationMutation) 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 (*TestTranslationMutation) Description

func (m *TestTranslationMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*TestTranslationMutation) DescriptionCleared

func (m *TestTranslationMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*TestTranslationMutation) Details

func (m *TestTranslationMutation) Details() (r string, exists bool)

Details returns the value of the "details" field in the mutation.

func (*TestTranslationMutation) DetailsCleared

func (m *TestTranslationMutation) DetailsCleared() bool

DetailsCleared returns if the "details" field was cleared in this mutation.

func (*TestTranslationMutation) EdgeCleared

func (m *TestTranslationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TestTranslationMutation) Field

func (m *TestTranslationMutation) 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 (*TestTranslationMutation) FieldCleared

func (m *TestTranslationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TestTranslationMutation) Fields

func (m *TestTranslationMutation) 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 (*TestTranslationMutation) ID

func (m *TestTranslationMutation) ID() (id uuid.UUID, 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 (*TestTranslationMutation) IDs

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 (*TestTranslationMutation) Instruction

func (m *TestTranslationMutation) Instruction() (r string, exists bool)

Instruction returns the value of the "instruction" field in the mutation.

func (*TestTranslationMutation) InstructionCleared

func (m *TestTranslationMutation) InstructionCleared() bool

InstructionCleared returns if the "instruction" field was cleared in this mutation.

func (*TestTranslationMutation) Locale

func (m *TestTranslationMutation) Locale() (r testtranslation.Locale, exists bool)

Locale returns the value of the "locale" field in the mutation.

func (*TestTranslationMutation) OldDescription

func (m *TestTranslationMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the TestTranslation entity. If the TestTranslation 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 (*TestTranslationMutation) OldDetails

func (m *TestTranslationMutation) OldDetails(ctx context.Context) (v string, err error)

OldDetails returns the old "details" field's value of the TestTranslation entity. If the TestTranslation 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 (*TestTranslationMutation) OldField

func (m *TestTranslationMutation) 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 (*TestTranslationMutation) OldInstruction

func (m *TestTranslationMutation) OldInstruction(ctx context.Context) (v string, err error)

OldInstruction returns the old "instruction" field's value of the TestTranslation entity. If the TestTranslation 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 (*TestTranslationMutation) OldLocale

OldLocale returns the old "locale" field's value of the TestTranslation entity. If the TestTranslation 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 (*TestTranslationMutation) OldResultPreambule

func (m *TestTranslationMutation) OldResultPreambule(ctx context.Context) (v string, err error)

OldResultPreambule returns the old "result_preambule" field's value of the TestTranslation entity. If the TestTranslation 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 (*TestTranslationMutation) OldTitle

func (m *TestTranslationMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the TestTranslation entity. If the TestTranslation 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 (*TestTranslationMutation) Op

func (m *TestTranslationMutation) Op() Op

Op returns the operation name.

func (*TestTranslationMutation) RemovedEdges

func (m *TestTranslationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TestTranslationMutation) RemovedIDs

func (m *TestTranslationMutation) 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 (*TestTranslationMutation) ResetDescription

func (m *TestTranslationMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*TestTranslationMutation) ResetDetails

func (m *TestTranslationMutation) ResetDetails()

ResetDetails resets all changes to the "details" field.

func (*TestTranslationMutation) ResetEdge

func (m *TestTranslationMutation) 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 (*TestTranslationMutation) ResetField

func (m *TestTranslationMutation) 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 (*TestTranslationMutation) ResetInstruction

func (m *TestTranslationMutation) ResetInstruction()

ResetInstruction resets all changes to the "instruction" field.

func (*TestTranslationMutation) ResetLocale

func (m *TestTranslationMutation) ResetLocale()

ResetLocale resets all changes to the "locale" field.

func (*TestTranslationMutation) ResetResultPreambule

func (m *TestTranslationMutation) ResetResultPreambule()

ResetResultPreambule resets all changes to the "result_preambule" field.

func (*TestTranslationMutation) ResetTest

func (m *TestTranslationMutation) ResetTest()

ResetTest resets all changes to the "test" edge.

func (*TestTranslationMutation) ResetTitle

func (m *TestTranslationMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*TestTranslationMutation) ResultPreambule

func (m *TestTranslationMutation) ResultPreambule() (r string, exists bool)

ResultPreambule returns the value of the "result_preambule" field in the mutation.

func (*TestTranslationMutation) ResultPreambuleCleared

func (m *TestTranslationMutation) ResultPreambuleCleared() bool

ResultPreambuleCleared returns if the "result_preambule" field was cleared in this mutation.

func (*TestTranslationMutation) SetDescription

func (m *TestTranslationMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*TestTranslationMutation) SetDetails

func (m *TestTranslationMutation) SetDetails(s string)

SetDetails sets the "details" field.

func (*TestTranslationMutation) SetField

func (m *TestTranslationMutation) 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 (*TestTranslationMutation) SetID

func (m *TestTranslationMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of TestTranslation entities.

func (*TestTranslationMutation) SetInstruction

func (m *TestTranslationMutation) SetInstruction(s string)

SetInstruction sets the "instruction" field.

func (*TestTranslationMutation) SetLocale

SetLocale sets the "locale" field.

func (*TestTranslationMutation) SetResultPreambule

func (m *TestTranslationMutation) SetResultPreambule(s string)

SetResultPreambule sets the "result_preambule" field.

func (*TestTranslationMutation) SetTestID

func (m *TestTranslationMutation) SetTestID(id uuid.UUID)

SetTestID sets the "test" edge to the Test entity by id.

func (*TestTranslationMutation) SetTitle

func (m *TestTranslationMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*TestTranslationMutation) TestCleared

func (m *TestTranslationMutation) TestCleared() bool

TestCleared reports if the "test" edge to the Test entity was cleared.

func (*TestTranslationMutation) TestID

func (m *TestTranslationMutation) TestID() (id uuid.UUID, exists bool)

TestID returns the "test" edge ID in the mutation.

func (*TestTranslationMutation) TestIDs

func (m *TestTranslationMutation) TestIDs() (ids []uuid.UUID)

TestIDs returns the "test" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TestID instead. It exists only for internal usage by the builders.

func (*TestTranslationMutation) Title

func (m *TestTranslationMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (TestTranslationMutation) Tx

func (m TestTranslationMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TestTranslationMutation) Type

func (m *TestTranslationMutation) Type() string

Type returns the node type of this mutation (TestTranslation).

func (*TestTranslationMutation) Where

Where appends a list predicates to the TestTranslationMutation builder.

type TestTranslationQuery

type TestTranslationQuery struct {
	// contains filtered or unexported fields
}

TestTranslationQuery is the builder for querying TestTranslation entities.

func (*TestTranslationQuery) All

All executes the query and returns a list of TestTranslations.

func (*TestTranslationQuery) AllX

AllX is like All, but panics if an error occurs.

func (*TestTranslationQuery) Clone

Clone returns a duplicate of the TestTranslationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TestTranslationQuery) Count

func (ttq *TestTranslationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TestTranslationQuery) CountX

func (ttq *TestTranslationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TestTranslationQuery) Exist

func (ttq *TestTranslationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TestTranslationQuery) ExistX

func (ttq *TestTranslationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TestTranslationQuery) First

First returns the first TestTranslation entity from the query. Returns a *NotFoundError when no TestTranslation was found.

func (*TestTranslationQuery) FirstID

func (ttq *TestTranslationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first TestTranslation ID from the query. Returns a *NotFoundError when no TestTranslation ID was found.

func (*TestTranslationQuery) FirstIDX

func (ttq *TestTranslationQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TestTranslationQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*TestTranslationQuery) GroupBy

func (ttq *TestTranslationQuery) GroupBy(field string, fields ...string) *TestTranslationGroupBy

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 {
	Locale testtranslation.Locale `json:"locale,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TestTranslation.Query().
	GroupBy(testtranslation.FieldLocale).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TestTranslationQuery) IDs

func (ttq *TestTranslationQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of TestTranslation IDs.

func (*TestTranslationQuery) IDsX

func (ttq *TestTranslationQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TestTranslationQuery) Limit

func (ttq *TestTranslationQuery) Limit(limit int) *TestTranslationQuery

Limit adds a limit step to the query.

func (*TestTranslationQuery) Offset

func (ttq *TestTranslationQuery) Offset(offset int) *TestTranslationQuery

Offset adds an offset step to the query.

func (*TestTranslationQuery) Only

Only returns a single TestTranslation entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TestTranslation entity is found. Returns a *NotFoundError when no TestTranslation entities are found.

func (*TestTranslationQuery) OnlyID

func (ttq *TestTranslationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only TestTranslation ID in the query. Returns a *NotSingularError when more than one TestTranslation ID is found. Returns a *NotFoundError when no entities are found.

func (*TestTranslationQuery) OnlyIDX

func (ttq *TestTranslationQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TestTranslationQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*TestTranslationQuery) Order

Order adds an order step to the query.

func (*TestTranslationQuery) QueryTest

func (ttq *TestTranslationQuery) QueryTest() *TestQuery

QueryTest chains the current query on the "test" edge.

func (*TestTranslationQuery) Select

func (ttq *TestTranslationQuery) Select(fields ...string) *TestTranslationSelect

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 {
	Locale testtranslation.Locale `json:"locale,omitempty"`
}

client.TestTranslation.Query().
	Select(testtranslation.FieldLocale).
	Scan(ctx, &v)

func (*TestTranslationQuery) Unique

func (ttq *TestTranslationQuery) Unique(unique bool) *TestTranslationQuery

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 (*TestTranslationQuery) Where

Where adds a new predicate for the TestTranslationQuery builder.

func (*TestTranslationQuery) WithTest

func (ttq *TestTranslationQuery) WithTest(opts ...func(*TestQuery)) *TestTranslationQuery

WithTest tells the query-builder to eager-load the nodes that are connected to the "test" edge. The optional arguments are used to configure the query builder of the edge.

type TestTranslationSelect

type TestTranslationSelect struct {
	*TestTranslationQuery
	// contains filtered or unexported fields
}

TestTranslationSelect is the builder for selecting fields of TestTranslation entities.

func (*TestTranslationSelect) Bool

func (s *TestTranslationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TestTranslationSelect) BoolX

func (s *TestTranslationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TestTranslationSelect) Bools

func (s *TestTranslationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TestTranslationSelect) BoolsX

func (s *TestTranslationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TestTranslationSelect) Float64

func (s *TestTranslationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TestTranslationSelect) Float64X

func (s *TestTranslationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TestTranslationSelect) Float64s

func (s *TestTranslationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TestTranslationSelect) Float64sX

func (s *TestTranslationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TestTranslationSelect) Int

func (s *TestTranslationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TestTranslationSelect) IntX

func (s *TestTranslationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TestTranslationSelect) Ints

func (s *TestTranslationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TestTranslationSelect) IntsX

func (s *TestTranslationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TestTranslationSelect) Scan

func (tts *TestTranslationSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TestTranslationSelect) ScanX

func (s *TestTranslationSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TestTranslationSelect) String

func (s *TestTranslationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TestTranslationSelect) StringX

func (s *TestTranslationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TestTranslationSelect) Strings

func (s *TestTranslationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TestTranslationSelect) StringsX

func (s *TestTranslationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TestTranslationUpdate

type TestTranslationUpdate struct {
	// contains filtered or unexported fields
}

TestTranslationUpdate is the builder for updating TestTranslation entities.

func (*TestTranslationUpdate) ClearDescription

func (ttu *TestTranslationUpdate) ClearDescription() *TestTranslationUpdate

ClearDescription clears the value of the "description" field.

func (*TestTranslationUpdate) ClearDetails

func (ttu *TestTranslationUpdate) ClearDetails() *TestTranslationUpdate

ClearDetails clears the value of the "details" field.

func (*TestTranslationUpdate) ClearInstruction

func (ttu *TestTranslationUpdate) ClearInstruction() *TestTranslationUpdate

ClearInstruction clears the value of the "instruction" field.

func (*TestTranslationUpdate) ClearResultPreambule

func (ttu *TestTranslationUpdate) ClearResultPreambule() *TestTranslationUpdate

ClearResultPreambule clears the value of the "result_preambule" field.

func (*TestTranslationUpdate) ClearTest

func (ttu *TestTranslationUpdate) ClearTest() *TestTranslationUpdate

ClearTest clears the "test" edge to the Test entity.

func (*TestTranslationUpdate) Exec

func (ttu *TestTranslationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TestTranslationUpdate) ExecX

func (ttu *TestTranslationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestTranslationUpdate) Mutation

Mutation returns the TestTranslationMutation object of the builder.

func (*TestTranslationUpdate) Save

func (ttu *TestTranslationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TestTranslationUpdate) SaveX

func (ttu *TestTranslationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TestTranslationUpdate) SetDescription

func (ttu *TestTranslationUpdate) SetDescription(s string) *TestTranslationUpdate

SetDescription sets the "description" field.

func (*TestTranslationUpdate) SetDetails

SetDetails sets the "details" field.

func (*TestTranslationUpdate) SetInstruction

func (ttu *TestTranslationUpdate) SetInstruction(s string) *TestTranslationUpdate

SetInstruction sets the "instruction" field.

func (*TestTranslationUpdate) SetNillableDescription

func (ttu *TestTranslationUpdate) SetNillableDescription(s *string) *TestTranslationUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TestTranslationUpdate) SetNillableDetails

func (ttu *TestTranslationUpdate) SetNillableDetails(s *string) *TestTranslationUpdate

SetNillableDetails sets the "details" field if the given value is not nil.

func (*TestTranslationUpdate) SetNillableInstruction

func (ttu *TestTranslationUpdate) SetNillableInstruction(s *string) *TestTranslationUpdate

SetNillableInstruction sets the "instruction" field if the given value is not nil.

func (*TestTranslationUpdate) SetNillableResultPreambule

func (ttu *TestTranslationUpdate) SetNillableResultPreambule(s *string) *TestTranslationUpdate

SetNillableResultPreambule sets the "result_preambule" field if the given value is not nil.

func (*TestTranslationUpdate) SetNillableTestID

func (ttu *TestTranslationUpdate) SetNillableTestID(id *uuid.UUID) *TestTranslationUpdate

SetNillableTestID sets the "test" edge to the Test entity by ID if the given value is not nil.

func (*TestTranslationUpdate) SetResultPreambule

func (ttu *TestTranslationUpdate) SetResultPreambule(s string) *TestTranslationUpdate

SetResultPreambule sets the "result_preambule" field.

func (*TestTranslationUpdate) SetTest

SetTest sets the "test" edge to the Test entity.

func (*TestTranslationUpdate) SetTestID

SetTestID sets the "test" edge to the Test entity by ID.

func (*TestTranslationUpdate) SetTitle

SetTitle sets the "title" field.

func (*TestTranslationUpdate) Where

Where appends a list predicates to the TestTranslationUpdate builder.

type TestTranslationUpdateOne

type TestTranslationUpdateOne struct {
	// contains filtered or unexported fields
}

TestTranslationUpdateOne is the builder for updating a single TestTranslation entity.

func (*TestTranslationUpdateOne) ClearDescription

func (ttuo *TestTranslationUpdateOne) ClearDescription() *TestTranslationUpdateOne

ClearDescription clears the value of the "description" field.

func (*TestTranslationUpdateOne) ClearDetails

func (ttuo *TestTranslationUpdateOne) ClearDetails() *TestTranslationUpdateOne

ClearDetails clears the value of the "details" field.

func (*TestTranslationUpdateOne) ClearInstruction

func (ttuo *TestTranslationUpdateOne) ClearInstruction() *TestTranslationUpdateOne

ClearInstruction clears the value of the "instruction" field.

func (*TestTranslationUpdateOne) ClearResultPreambule

func (ttuo *TestTranslationUpdateOne) ClearResultPreambule() *TestTranslationUpdateOne

ClearResultPreambule clears the value of the "result_preambule" field.

func (*TestTranslationUpdateOne) ClearTest

ClearTest clears the "test" edge to the Test entity.

func (*TestTranslationUpdateOne) Exec

Exec executes the query on the entity.

func (*TestTranslationUpdateOne) ExecX

func (ttuo *TestTranslationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestTranslationUpdateOne) Mutation

Mutation returns the TestTranslationMutation object of the builder.

func (*TestTranslationUpdateOne) Save

Save executes the query and returns the updated TestTranslation entity.

func (*TestTranslationUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*TestTranslationUpdateOne) Select

func (ttuo *TestTranslationUpdateOne) Select(field string, fields ...string) *TestTranslationUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TestTranslationUpdateOne) SetDescription

func (ttuo *TestTranslationUpdateOne) SetDescription(s string) *TestTranslationUpdateOne

SetDescription sets the "description" field.

func (*TestTranslationUpdateOne) SetDetails

SetDetails sets the "details" field.

func (*TestTranslationUpdateOne) SetInstruction

func (ttuo *TestTranslationUpdateOne) SetInstruction(s string) *TestTranslationUpdateOne

SetInstruction sets the "instruction" field.

func (*TestTranslationUpdateOne) SetNillableDescription

func (ttuo *TestTranslationUpdateOne) SetNillableDescription(s *string) *TestTranslationUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TestTranslationUpdateOne) SetNillableDetails

func (ttuo *TestTranslationUpdateOne) SetNillableDetails(s *string) *TestTranslationUpdateOne

SetNillableDetails sets the "details" field if the given value is not nil.

func (*TestTranslationUpdateOne) SetNillableInstruction

func (ttuo *TestTranslationUpdateOne) SetNillableInstruction(s *string) *TestTranslationUpdateOne

SetNillableInstruction sets the "instruction" field if the given value is not nil.

func (*TestTranslationUpdateOne) SetNillableResultPreambule

func (ttuo *TestTranslationUpdateOne) SetNillableResultPreambule(s *string) *TestTranslationUpdateOne

SetNillableResultPreambule sets the "result_preambule" field if the given value is not nil.

func (*TestTranslationUpdateOne) SetNillableTestID

func (ttuo *TestTranslationUpdateOne) SetNillableTestID(id *uuid.UUID) *TestTranslationUpdateOne

SetNillableTestID sets the "test" edge to the Test entity by ID if the given value is not nil.

func (*TestTranslationUpdateOne) SetResultPreambule

func (ttuo *TestTranslationUpdateOne) SetResultPreambule(s string) *TestTranslationUpdateOne

SetResultPreambule sets the "result_preambule" field.

func (*TestTranslationUpdateOne) SetTest

SetTest sets the "test" edge to the Test entity.

func (*TestTranslationUpdateOne) SetTestID

SetTestID sets the "test" edge to the Test entity by ID.

func (*TestTranslationUpdateOne) SetTitle

SetTitle sets the "title" field.

type TestTranslations

type TestTranslations []*TestTranslation

TestTranslations is a parsable slice of TestTranslation.

type TestUpdate

type TestUpdate struct {
	// contains filtered or unexported fields
}

TestUpdate is the builder for updating Test entities.

func (*TestUpdate) AddDuration

func (tu *TestUpdate) AddDuration(t time.Duration) *TestUpdate

AddDuration adds t to the "duration" field.

func (*TestUpdate) AddMark

func (tu *TestUpdate) AddMark(f float64) *TestUpdate

AddMark adds f to the "mark" field.

func (*TestUpdate) AddQuestionCount

func (tu *TestUpdate) AddQuestionCount(i int) *TestUpdate

AddQuestionCount adds i to the "question_count" field.

func (*TestUpdate) AddQuestionIDs

func (tu *TestUpdate) AddQuestionIDs(ids ...uuid.UUID) *TestUpdate

AddQuestionIDs adds the "questions" edge to the Question entity by IDs.

func (*TestUpdate) AddQuestions

func (tu *TestUpdate) AddQuestions(q ...*Question) *TestUpdate

AddQuestions adds the "questions" edges to the Question entity.

func (*TestUpdate) AddScaleIDs

func (tu *TestUpdate) AddScaleIDs(ids ...uuid.UUID) *TestUpdate

AddScaleIDs adds the "scales" edge to the Scale entity by IDs.

func (*TestUpdate) AddScales

func (tu *TestUpdate) AddScales(s ...*Scale) *TestUpdate

AddScales adds the "scales" edges to the Scale entity.

func (*TestUpdate) AddTagIDs

func (tu *TestUpdate) AddTagIDs(ids ...uuid.UUID) *TestUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*TestUpdate) AddTags

func (tu *TestUpdate) AddTags(t ...*Tag) *TestUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*TestUpdate) AddTakeIDs

func (tu *TestUpdate) AddTakeIDs(ids ...uuid.UUID) *TestUpdate

AddTakeIDs adds the "takes" edge to the Take entity by IDs.

func (*TestUpdate) AddTakes

func (tu *TestUpdate) AddTakes(t ...*Take) *TestUpdate

AddTakes adds the "takes" edges to the Take entity.

func (*TestUpdate) AddTranslationIDs

func (tu *TestUpdate) AddTranslationIDs(ids ...uuid.UUID) *TestUpdate

AddTranslationIDs adds the "translations" edge to the TestTranslation entity by IDs.

func (*TestUpdate) AddTranslations

func (tu *TestUpdate) AddTranslations(t ...*TestTranslation) *TestUpdate

AddTranslations adds the "translations" edges to the TestTranslation entity.

func (*TestUpdate) ClearAvailableLocales

func (tu *TestUpdate) ClearAvailableLocales() *TestUpdate

ClearAvailableLocales clears the value of the "available_locales" field.

func (*TestUpdate) ClearDisplay

func (tu *TestUpdate) ClearDisplay() *TestUpdate

ClearDisplay clears the "display" edge to the TestDisplay entity.

func (*TestUpdate) ClearDuration

func (tu *TestUpdate) ClearDuration() *TestUpdate

ClearDuration clears the value of the "duration" field.

func (*TestUpdate) ClearImage added in v1.1.0

func (tu *TestUpdate) ClearImage() *TestUpdate

ClearImage clears the value of the "image" field.

func (*TestUpdate) ClearQuestions

func (tu *TestUpdate) ClearQuestions() *TestUpdate

ClearQuestions clears all "questions" edges to the Question entity.

func (*TestUpdate) ClearScales

func (tu *TestUpdate) ClearScales() *TestUpdate

ClearScales clears all "scales" edges to the Scale entity.

func (*TestUpdate) ClearTags

func (tu *TestUpdate) ClearTags() *TestUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*TestUpdate) ClearTakes

func (tu *TestUpdate) ClearTakes() *TestUpdate

ClearTakes clears all "takes" edges to the Take entity.

func (*TestUpdate) ClearTranslations

func (tu *TestUpdate) ClearTranslations() *TestUpdate

ClearTranslations clears all "translations" edges to the TestTranslation entity.

func (*TestUpdate) Exec

func (tu *TestUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TestUpdate) ExecX

func (tu *TestUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestUpdate) Mutation

func (tu *TestUpdate) Mutation() *TestMutation

Mutation returns the TestMutation object of the builder.

func (*TestUpdate) RemoveQuestionIDs

func (tu *TestUpdate) RemoveQuestionIDs(ids ...uuid.UUID) *TestUpdate

RemoveQuestionIDs removes the "questions" edge to Question entities by IDs.

func (*TestUpdate) RemoveQuestions

func (tu *TestUpdate) RemoveQuestions(q ...*Question) *TestUpdate

RemoveQuestions removes "questions" edges to Question entities.

func (*TestUpdate) RemoveScaleIDs

func (tu *TestUpdate) RemoveScaleIDs(ids ...uuid.UUID) *TestUpdate

RemoveScaleIDs removes the "scales" edge to Scale entities by IDs.

func (*TestUpdate) RemoveScales

func (tu *TestUpdate) RemoveScales(s ...*Scale) *TestUpdate

RemoveScales removes "scales" edges to Scale entities.

func (*TestUpdate) RemoveTagIDs

func (tu *TestUpdate) RemoveTagIDs(ids ...uuid.UUID) *TestUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*TestUpdate) RemoveTags

func (tu *TestUpdate) RemoveTags(t ...*Tag) *TestUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*TestUpdate) RemoveTakeIDs

func (tu *TestUpdate) RemoveTakeIDs(ids ...uuid.UUID) *TestUpdate

RemoveTakeIDs removes the "takes" edge to Take entities by IDs.

func (*TestUpdate) RemoveTakes

func (tu *TestUpdate) RemoveTakes(t ...*Take) *TestUpdate

RemoveTakes removes "takes" edges to Take entities.

func (*TestUpdate) RemoveTranslationIDs

func (tu *TestUpdate) RemoveTranslationIDs(ids ...uuid.UUID) *TestUpdate

RemoveTranslationIDs removes the "translations" edge to TestTranslation entities by IDs.

func (*TestUpdate) RemoveTranslations

func (tu *TestUpdate) RemoveTranslations(t ...*TestTranslation) *TestUpdate

RemoveTranslations removes "translations" edges to TestTranslation entities.

func (*TestUpdate) Save

func (tu *TestUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TestUpdate) SaveX

func (tu *TestUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TestUpdate) SetAvailableLocales

func (tu *TestUpdate) SetAvailableLocales(s []string) *TestUpdate

SetAvailableLocales sets the "available_locales" field.

func (*TestUpdate) SetDisplay

func (tu *TestUpdate) SetDisplay(t *TestDisplay) *TestUpdate

SetDisplay sets the "display" edge to the TestDisplay entity.

func (*TestUpdate) SetDisplayID

func (tu *TestUpdate) SetDisplayID(id uuid.UUID) *TestUpdate

SetDisplayID sets the "display" edge to the TestDisplay entity by ID.

func (*TestUpdate) SetDuration

func (tu *TestUpdate) SetDuration(t time.Duration) *TestUpdate

SetDuration sets the "duration" field.

func (*TestUpdate) SetImage added in v1.1.0

func (tu *TestUpdate) SetImage(s string) *TestUpdate

SetImage sets the "image" field.

func (*TestUpdate) SetMark

func (tu *TestUpdate) SetMark(f float64) *TestUpdate

SetMark sets the "mark" field.

func (*TestUpdate) SetNillableDisplayID

func (tu *TestUpdate) SetNillableDisplayID(id *uuid.UUID) *TestUpdate

SetNillableDisplayID sets the "display" edge to the TestDisplay entity by ID if the given value is not nil.

func (*TestUpdate) SetNillableDuration

func (tu *TestUpdate) SetNillableDuration(t *time.Duration) *TestUpdate

SetNillableDuration sets the "duration" field if the given value is not nil.

func (*TestUpdate) SetNillableImage added in v1.1.0

func (tu *TestUpdate) SetNillableImage(s *string) *TestUpdate

SetNillableImage sets the "image" field if the given value is not nil.

func (*TestUpdate) SetNillableMark

func (tu *TestUpdate) SetNillableMark(f *float64) *TestUpdate

SetNillableMark sets the "mark" field if the given value is not nil.

func (*TestUpdate) SetNillablePublished

func (tu *TestUpdate) SetNillablePublished(b *bool) *TestUpdate

SetNillablePublished sets the "published" field if the given value is not nil.

func (*TestUpdate) SetNillableQuestionCount

func (tu *TestUpdate) SetNillableQuestionCount(i *int) *TestUpdate

SetNillableQuestionCount sets the "question_count" field if the given value is not nil.

func (*TestUpdate) SetPublished

func (tu *TestUpdate) SetPublished(b bool) *TestUpdate

SetPublished sets the "published" field.

func (*TestUpdate) SetQuestionCount

func (tu *TestUpdate) SetQuestionCount(i int) *TestUpdate

SetQuestionCount sets the "question_count" field.

func (*TestUpdate) SetUpdateTime

func (tu *TestUpdate) SetUpdateTime(t time.Time) *TestUpdate

SetUpdateTime sets the "update_time" field.

func (*TestUpdate) Where

func (tu *TestUpdate) Where(ps ...predicate.Test) *TestUpdate

Where appends a list predicates to the TestUpdate builder.

type TestUpdateOne

type TestUpdateOne struct {
	// contains filtered or unexported fields
}

TestUpdateOne is the builder for updating a single Test entity.

func (*TestUpdateOne) AddDuration

func (tuo *TestUpdateOne) AddDuration(t time.Duration) *TestUpdateOne

AddDuration adds t to the "duration" field.

func (*TestUpdateOne) AddMark

func (tuo *TestUpdateOne) AddMark(f float64) *TestUpdateOne

AddMark adds f to the "mark" field.

func (*TestUpdateOne) AddQuestionCount

func (tuo *TestUpdateOne) AddQuestionCount(i int) *TestUpdateOne

AddQuestionCount adds i to the "question_count" field.

func (*TestUpdateOne) AddQuestionIDs

func (tuo *TestUpdateOne) AddQuestionIDs(ids ...uuid.UUID) *TestUpdateOne

AddQuestionIDs adds the "questions" edge to the Question entity by IDs.

func (*TestUpdateOne) AddQuestions

func (tuo *TestUpdateOne) AddQuestions(q ...*Question) *TestUpdateOne

AddQuestions adds the "questions" edges to the Question entity.

func (*TestUpdateOne) AddScaleIDs

func (tuo *TestUpdateOne) AddScaleIDs(ids ...uuid.UUID) *TestUpdateOne

AddScaleIDs adds the "scales" edge to the Scale entity by IDs.

func (*TestUpdateOne) AddScales

func (tuo *TestUpdateOne) AddScales(s ...*Scale) *TestUpdateOne

AddScales adds the "scales" edges to the Scale entity.

func (*TestUpdateOne) AddTagIDs

func (tuo *TestUpdateOne) AddTagIDs(ids ...uuid.UUID) *TestUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*TestUpdateOne) AddTags

func (tuo *TestUpdateOne) AddTags(t ...*Tag) *TestUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*TestUpdateOne) AddTakeIDs

func (tuo *TestUpdateOne) AddTakeIDs(ids ...uuid.UUID) *TestUpdateOne

AddTakeIDs adds the "takes" edge to the Take entity by IDs.

func (*TestUpdateOne) AddTakes

func (tuo *TestUpdateOne) AddTakes(t ...*Take) *TestUpdateOne

AddTakes adds the "takes" edges to the Take entity.

func (*TestUpdateOne) AddTranslationIDs

func (tuo *TestUpdateOne) AddTranslationIDs(ids ...uuid.UUID) *TestUpdateOne

AddTranslationIDs adds the "translations" edge to the TestTranslation entity by IDs.

func (*TestUpdateOne) AddTranslations

func (tuo *TestUpdateOne) AddTranslations(t ...*TestTranslation) *TestUpdateOne

AddTranslations adds the "translations" edges to the TestTranslation entity.

func (*TestUpdateOne) ClearAvailableLocales

func (tuo *TestUpdateOne) ClearAvailableLocales() *TestUpdateOne

ClearAvailableLocales clears the value of the "available_locales" field.

func (*TestUpdateOne) ClearDisplay

func (tuo *TestUpdateOne) ClearDisplay() *TestUpdateOne

ClearDisplay clears the "display" edge to the TestDisplay entity.

func (*TestUpdateOne) ClearDuration

func (tuo *TestUpdateOne) ClearDuration() *TestUpdateOne

ClearDuration clears the value of the "duration" field.

func (*TestUpdateOne) ClearImage added in v1.1.0

func (tuo *TestUpdateOne) ClearImage() *TestUpdateOne

ClearImage clears the value of the "image" field.

func (*TestUpdateOne) ClearQuestions

func (tuo *TestUpdateOne) ClearQuestions() *TestUpdateOne

ClearQuestions clears all "questions" edges to the Question entity.

func (*TestUpdateOne) ClearScales

func (tuo *TestUpdateOne) ClearScales() *TestUpdateOne

ClearScales clears all "scales" edges to the Scale entity.

func (*TestUpdateOne) ClearTags

func (tuo *TestUpdateOne) ClearTags() *TestUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*TestUpdateOne) ClearTakes

func (tuo *TestUpdateOne) ClearTakes() *TestUpdateOne

ClearTakes clears all "takes" edges to the Take entity.

func (*TestUpdateOne) ClearTranslations

func (tuo *TestUpdateOne) ClearTranslations() *TestUpdateOne

ClearTranslations clears all "translations" edges to the TestTranslation entity.

func (*TestUpdateOne) Exec

func (tuo *TestUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TestUpdateOne) ExecX

func (tuo *TestUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TestUpdateOne) Mutation

func (tuo *TestUpdateOne) Mutation() *TestMutation

Mutation returns the TestMutation object of the builder.

func (*TestUpdateOne) RemoveQuestionIDs

func (tuo *TestUpdateOne) RemoveQuestionIDs(ids ...uuid.UUID) *TestUpdateOne

RemoveQuestionIDs removes the "questions" edge to Question entities by IDs.

func (*TestUpdateOne) RemoveQuestions

func (tuo *TestUpdateOne) RemoveQuestions(q ...*Question) *TestUpdateOne

RemoveQuestions removes "questions" edges to Question entities.

func (*TestUpdateOne) RemoveScaleIDs

func (tuo *TestUpdateOne) RemoveScaleIDs(ids ...uuid.UUID) *TestUpdateOne

RemoveScaleIDs removes the "scales" edge to Scale entities by IDs.

func (*TestUpdateOne) RemoveScales

func (tuo *TestUpdateOne) RemoveScales(s ...*Scale) *TestUpdateOne

RemoveScales removes "scales" edges to Scale entities.

func (*TestUpdateOne) RemoveTagIDs

func (tuo *TestUpdateOne) RemoveTagIDs(ids ...uuid.UUID) *TestUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*TestUpdateOne) RemoveTags

func (tuo *TestUpdateOne) RemoveTags(t ...*Tag) *TestUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*TestUpdateOne) RemoveTakeIDs

func (tuo *TestUpdateOne) RemoveTakeIDs(ids ...uuid.UUID) *TestUpdateOne

RemoveTakeIDs removes the "takes" edge to Take entities by IDs.

func (*TestUpdateOne) RemoveTakes

func (tuo *TestUpdateOne) RemoveTakes(t ...*Take) *TestUpdateOne

RemoveTakes removes "takes" edges to Take entities.

func (*TestUpdateOne) RemoveTranslationIDs

func (tuo *TestUpdateOne) RemoveTranslationIDs(ids ...uuid.UUID) *TestUpdateOne

RemoveTranslationIDs removes the "translations" edge to TestTranslation entities by IDs.

func (*TestUpdateOne) RemoveTranslations

func (tuo *TestUpdateOne) RemoveTranslations(t ...*TestTranslation) *TestUpdateOne

RemoveTranslations removes "translations" edges to TestTranslation entities.

func (*TestUpdateOne) Save

func (tuo *TestUpdateOne) Save(ctx context.Context) (*Test, error)

Save executes the query and returns the updated Test entity.

func (*TestUpdateOne) SaveX

func (tuo *TestUpdateOne) SaveX(ctx context.Context) *Test

SaveX is like Save, but panics if an error occurs.

func (*TestUpdateOne) Select

func (tuo *TestUpdateOne) Select(field string, fields ...string) *TestUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TestUpdateOne) SetAvailableLocales

func (tuo *TestUpdateOne) SetAvailableLocales(s []string) *TestUpdateOne

SetAvailableLocales sets the "available_locales" field.

func (*TestUpdateOne) SetDisplay

func (tuo *TestUpdateOne) SetDisplay(t *TestDisplay) *TestUpdateOne

SetDisplay sets the "display" edge to the TestDisplay entity.

func (*TestUpdateOne) SetDisplayID

func (tuo *TestUpdateOne) SetDisplayID(id uuid.UUID) *TestUpdateOne

SetDisplayID sets the "display" edge to the TestDisplay entity by ID.

func (*TestUpdateOne) SetDuration

func (tuo *TestUpdateOne) SetDuration(t time.Duration) *TestUpdateOne

SetDuration sets the "duration" field.

func (*TestUpdateOne) SetImage added in v1.1.0

func (tuo *TestUpdateOne) SetImage(s string) *TestUpdateOne

SetImage sets the "image" field.

func (*TestUpdateOne) SetMark

func (tuo *TestUpdateOne) SetMark(f float64) *TestUpdateOne

SetMark sets the "mark" field.

func (*TestUpdateOne) SetNillableDisplayID

func (tuo *TestUpdateOne) SetNillableDisplayID(id *uuid.UUID) *TestUpdateOne

SetNillableDisplayID sets the "display" edge to the TestDisplay entity by ID if the given value is not nil.

func (*TestUpdateOne) SetNillableDuration

func (tuo *TestUpdateOne) SetNillableDuration(t *time.Duration) *TestUpdateOne

SetNillableDuration sets the "duration" field if the given value is not nil.

func (*TestUpdateOne) SetNillableImage added in v1.1.0

func (tuo *TestUpdateOne) SetNillableImage(s *string) *TestUpdateOne

SetNillableImage sets the "image" field if the given value is not nil.

func (*TestUpdateOne) SetNillableMark

func (tuo *TestUpdateOne) SetNillableMark(f *float64) *TestUpdateOne

SetNillableMark sets the "mark" field if the given value is not nil.

func (*TestUpdateOne) SetNillablePublished

func (tuo *TestUpdateOne) SetNillablePublished(b *bool) *TestUpdateOne

SetNillablePublished sets the "published" field if the given value is not nil.

func (*TestUpdateOne) SetNillableQuestionCount

func (tuo *TestUpdateOne) SetNillableQuestionCount(i *int) *TestUpdateOne

SetNillableQuestionCount sets the "question_count" field if the given value is not nil.

func (*TestUpdateOne) SetPublished

func (tuo *TestUpdateOne) SetPublished(b bool) *TestUpdateOne

SetPublished sets the "published" field.

func (*TestUpdateOne) SetQuestionCount

func (tuo *TestUpdateOne) SetQuestionCount(i int) *TestUpdateOne

SetQuestionCount sets the "question_count" field.

func (*TestUpdateOne) SetUpdateTime

func (tuo *TestUpdateOne) SetUpdateTime(t time.Time) *TestUpdateOne

SetUpdateTime sets the "update_time" field.

type Tests

type Tests []*Test

Tests is a parsable slice of Test.

type Tx

type Tx struct {

	// Interpretation is the client for interacting with the Interpretation builders.
	Interpretation *InterpretationClient
	// InterpretationTranslation is the client for interacting with the InterpretationTranslation builders.
	InterpretationTranslation *InterpretationTranslationClient
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// ItemTranslation is the client for interacting with the ItemTranslation builders.
	ItemTranslation *ItemTranslationClient
	// Norm is the client for interacting with the Norm builders.
	Norm *NormClient
	// Question is the client for interacting with the Question builders.
	Question *QuestionClient
	// QuestionTranslation is the client for interacting with the QuestionTranslation builders.
	QuestionTranslation *QuestionTranslationClient
	// Response is the client for interacting with the Response builders.
	Response *ResponseClient
	// Result is the client for interacting with the Result builders.
	Result *ResultClient
	// Sample is the client for interacting with the Sample builders.
	Sample *SampleClient
	// Scale is the client for interacting with the Scale builders.
	Scale *ScaleClient
	// ScaleItem is the client for interacting with the ScaleItem builders.
	ScaleItem *ScaleItemClient
	// ScaleTranslation is the client for interacting with the ScaleTranslation builders.
	ScaleTranslation *ScaleTranslationClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// TagTranslation is the client for interacting with the TagTranslation builders.
	TagTranslation *TagTranslationClient
	// Take is the client for interacting with the Take builders.
	Take *TakeClient
	// Test is the client for interacting with the Test builders.
	Test *TestClient
	// TestDisplay is the client for interacting with the TestDisplay builders.
	TestDisplay *TestDisplayClient
	// TestTranslation is the client for interacting with the TestTranslation builders.
	TestTranslation *TestTranslationClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserSession is the client for interacting with the UserSession builders.
	UserSession *UserSessionClient
	// 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 User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Locale holds the value of the "locale" field.
	Locale user.Locale `json:"locale,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Email holds the value of the "email" field.
	Email *string `json:"email,omitempty"`
	// Picture holds the value of the "picture" field.
	Picture string `json:"picture,omitempty"`
	// PasswordHash holds the value of the "password_hash" field.
	PasswordHash string `json:"password_hash,omitempty"`
	// Admin holds the value of the "admin" field.
	Admin bool `json:"admin,omitempty"`
	// Anonymous holds the value of the "anonymous" field.
	Anonymous bool `json:"anonymous,omitempty"`
	// UseDarkTheme holds the value of the "use_dark_theme" field.
	UseDarkTheme bool `json:"use_dark_theme,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryAliases

func (u *User) QueryAliases() *UserQuery

QueryAliases queries the "aliases" edge of the User entity.

func (*User) QueryParent

func (u *User) QueryParent() *UserQuery

QueryParent queries the "parent" edge of the User entity.

func (*User) QuerySessions

func (u *User) QuerySessions() *UserSessionQuery

QuerySessions queries the "sessions" edge of the User entity.

func (*User) QueryTakes

func (u *User) QueryTakes() *TakeQuery

QueryTakes queries the "takes" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User 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 (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryAliases

func (c *UserClient) QueryAliases(u *User) *UserQuery

QueryAliases queries the aliases edge of a User.

func (*UserClient) QueryParent

func (c *UserClient) QueryParent(u *User) *UserQuery

QueryParent queries the parent edge of a User.

func (*UserClient) QuerySessions

func (c *UserClient) QuerySessions(u *User) *UserSessionQuery

QuerySessions queries the sessions edge of a User.

func (*UserClient) QueryTakes

func (c *UserClient) QueryTakes(u *User) *TakeQuery

QueryTakes queries the takes edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddAliasIDs

func (uc *UserCreate) AddAliasIDs(ids ...uuid.UUID) *UserCreate

AddAliasIDs adds the "aliases" edge to the User entity by IDs.

func (*UserCreate) AddAliases

func (uc *UserCreate) AddAliases(u ...*User) *UserCreate

AddAliases adds the "aliases" edges to the User entity.

func (*UserCreate) AddSessionIDs

func (uc *UserCreate) AddSessionIDs(ids ...int) *UserCreate

AddSessionIDs adds the "sessions" edge to the UserSession entity by IDs.

func (*UserCreate) AddSessions

func (uc *UserCreate) AddSessions(u ...*UserSession) *UserCreate

AddSessions adds the "sessions" edges to the UserSession entity.

func (*UserCreate) AddTakeIDs

func (uc *UserCreate) AddTakeIDs(ids ...uuid.UUID) *UserCreate

AddTakeIDs adds the "takes" edge to the Take entity by IDs.

func (*UserCreate) AddTakes

func (uc *UserCreate) AddTakes(t ...*Take) *UserCreate

AddTakes adds the "takes" edges to the Take entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAdmin

func (uc *UserCreate) SetAdmin(b bool) *UserCreate

SetAdmin sets the "admin" field.

func (*UserCreate) SetAnonymous

func (uc *UserCreate) SetAnonymous(b bool) *UserCreate

SetAnonymous sets the "anonymous" field.

func (*UserCreate) SetCreateTime

func (uc *UserCreate) SetCreateTime(t time.Time) *UserCreate

SetCreateTime sets the "create_time" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetLocale

func (uc *UserCreate) SetLocale(u user.Locale) *UserCreate

SetLocale sets the "locale" field.

func (*UserCreate) SetMeta

func (uc *UserCreate) SetMeta(m map[string]interface{}) *UserCreate

SetMeta sets the "meta" field.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNillableAdmin

func (uc *UserCreate) SetNillableAdmin(b *bool) *UserCreate

SetNillableAdmin sets the "admin" field if the given value is not nil.

func (*UserCreate) SetNillableAnonymous

func (uc *UserCreate) SetNillableAnonymous(b *bool) *UserCreate

SetNillableAnonymous sets the "anonymous" field if the given value is not nil.

func (*UserCreate) SetNillableCreateTime

func (uc *UserCreate) SetNillableCreateTime(t *time.Time) *UserCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserCreate) SetNillableEmail

func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableParentID

func (uc *UserCreate) SetNillableParentID(id *uuid.UUID) *UserCreate

SetNillableParentID sets the "parent" edge to the User entity by ID if the given value is not nil.

func (*UserCreate) SetNillablePicture

func (uc *UserCreate) SetNillablePicture(s *string) *UserCreate

SetNillablePicture sets the "picture" field if the given value is not nil.

func (*UserCreate) SetNillableUpdateTime

func (uc *UserCreate) SetNillableUpdateTime(t *time.Time) *UserCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*UserCreate) SetNillableUseDarkTheme

func (uc *UserCreate) SetNillableUseDarkTheme(b *bool) *UserCreate

SetNillableUseDarkTheme sets the "use_dark_theme" field if the given value is not nil.

func (*UserCreate) SetParent

func (uc *UserCreate) SetParent(u *User) *UserCreate

SetParent sets the "parent" edge to the User entity.

func (*UserCreate) SetParentID

func (uc *UserCreate) SetParentID(id uuid.UUID) *UserCreate

SetParentID sets the "parent" edge to the User entity by ID.

func (*UserCreate) SetPasswordHash

func (uc *UserCreate) SetPasswordHash(s string) *UserCreate

SetPasswordHash sets the "password_hash" field.

func (*UserCreate) SetPicture

func (uc *UserCreate) SetPicture(s string) *UserCreate

SetPicture sets the "picture" field.

func (*UserCreate) SetUpdateTime

func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate

SetUpdateTime sets the "update_time" field.

func (*UserCreate) SetUseDarkTheme

func (uc *UserCreate) SetUseDarkTheme(b bool) *UserCreate

SetUseDarkTheme sets the "use_dark_theme" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type UserEdges

type UserEdges struct {
	// Sessions holds the value of the sessions edge.
	Sessions []*UserSession `json:"sessions,omitempty"`
	// Takes holds the value of the takes edge.
	Takes []*Take `json:"takes,omitempty"`
	// Parent holds the value of the parent edge.
	Parent *User `json:"parent,omitempty"`
	// Aliases holds the value of the aliases edge.
	Aliases []*User `json:"aliases,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) AliasesOrErr

func (e UserEdges) AliasesOrErr() ([]*User, error)

AliasesOrErr returns the Aliases value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ParentOrErr

func (e UserEdges) ParentOrErr() (*User, error)

ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) SessionsOrErr

func (e UserEdges) SessionsOrErr() ([]*UserSession, error)

SessionsOrErr returns the Sessions value or an error if the edge was not loaded in eager-loading.

func (UserEdges) TakesOrErr

func (e UserEdges) TakesOrErr() ([]*Take, error)

TakesOrErr returns the Takes value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddAliasIDs

func (m *UserMutation) AddAliasIDs(ids ...uuid.UUID)

AddAliasIDs adds the "aliases" edge to the User entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) 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 (*UserMutation) AddSessionIDs

func (m *UserMutation) AddSessionIDs(ids ...int)

AddSessionIDs adds the "sessions" edge to the UserSession entity by ids.

func (*UserMutation) AddTakeIDs

func (m *UserMutation) AddTakeIDs(ids ...uuid.UUID)

AddTakeIDs adds the "takes" edge to the Take entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) 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 (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) Admin

func (m *UserMutation) Admin() (r bool, exists bool)

Admin returns the value of the "admin" field in the mutation.

func (*UserMutation) AliasesCleared

func (m *UserMutation) AliasesCleared() bool

AliasesCleared reports if the "aliases" edge to the User entity was cleared.

func (*UserMutation) AliasesIDs

func (m *UserMutation) AliasesIDs() (ids []uuid.UUID)

AliasesIDs returns the "aliases" edge IDs in the mutation.

func (*UserMutation) Anonymous

func (m *UserMutation) Anonymous() (r bool, exists bool)

Anonymous returns the value of the "anonymous" field in the mutation.

func (*UserMutation) ClearAliases

func (m *UserMutation) ClearAliases()

ClearAliases clears the "aliases" edge to the User entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) 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 (*UserMutation) ClearEmail

func (m *UserMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*UserMutation) ClearField

func (m *UserMutation) 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 (*UserMutation) ClearMeta

func (m *UserMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*UserMutation) ClearParent

func (m *UserMutation) ClearParent()

ClearParent clears the "parent" edge to the User entity.

func (*UserMutation) ClearPicture

func (m *UserMutation) ClearPicture()

ClearPicture clears the value of the "picture" field.

func (*UserMutation) ClearSessions

func (m *UserMutation) ClearSessions()

ClearSessions clears the "sessions" edge to the UserSession entity.

func (*UserMutation) ClearTakes

func (m *UserMutation) ClearTakes()

ClearTakes clears the "takes" edge to the Take entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) 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 (*UserMutation) CreateTime

func (m *UserMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) EmailCleared

func (m *UserMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*UserMutation) Field

func (m *UserMutation) 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 (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) 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 (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, 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 (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*UserMutation) Locale

func (m *UserMutation) Locale() (r user.Locale, exists bool)

Locale returns the value of the "locale" field in the mutation.

func (*UserMutation) Meta

func (m *UserMutation) Meta() (r map[string]interface{}, exists bool)

Meta returns the value of the "meta" field in the mutation.

func (*UserMutation) MetaCleared

func (m *UserMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) OldAdmin

func (m *UserMutation) OldAdmin(ctx context.Context) (v bool, err error)

OldAdmin returns the old "admin" field's value of the User entity. If the User 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 (*UserMutation) OldAnonymous

func (m *UserMutation) OldAnonymous(ctx context.Context) (v bool, err error)

OldAnonymous returns the old "anonymous" field's value of the User entity. If the User 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 (*UserMutation) OldCreateTime

func (m *UserMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the User entity. If the User 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 (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v *string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User 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 (*UserMutation) OldField

func (m *UserMutation) 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 (*UserMutation) OldLocale

func (m *UserMutation) OldLocale(ctx context.Context) (v user.Locale, err error)

OldLocale returns the old "locale" field's value of the User entity. If the User 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 (*UserMutation) OldMeta

func (m *UserMutation) OldMeta(ctx context.Context) (v map[string]interface{}, err error)

OldMeta returns the old "meta" field's value of the User entity. If the User 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 (*UserMutation) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the User entity. If the User 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 (*UserMutation) OldPasswordHash

func (m *UserMutation) OldPasswordHash(ctx context.Context) (v string, err error)

OldPasswordHash returns the old "password_hash" field's value of the User entity. If the User 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 (*UserMutation) OldPicture

func (m *UserMutation) OldPicture(ctx context.Context) (v string, err error)

OldPicture returns the old "picture" field's value of the User entity. If the User 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 (*UserMutation) OldUpdateTime

func (m *UserMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the User entity. If the User 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 (*UserMutation) OldUseDarkTheme

func (m *UserMutation) OldUseDarkTheme(ctx context.Context) (v bool, err error)

OldUseDarkTheme returns the old "use_dark_theme" field's value of the User entity. If the User 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 (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) ParentCleared

func (m *UserMutation) ParentCleared() bool

ParentCleared reports if the "parent" edge to the User entity was cleared.

func (*UserMutation) ParentID

func (m *UserMutation) ParentID() (id uuid.UUID, exists bool)

ParentID returns the "parent" edge ID in the mutation.

func (*UserMutation) ParentIDs

func (m *UserMutation) ParentIDs() (ids []uuid.UUID)

ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.

func (*UserMutation) PasswordHash

func (m *UserMutation) PasswordHash() (r string, exists bool)

PasswordHash returns the value of the "password_hash" field in the mutation.

func (*UserMutation) Picture

func (m *UserMutation) Picture() (r string, exists bool)

Picture returns the value of the "picture" field in the mutation.

func (*UserMutation) PictureCleared

func (m *UserMutation) PictureCleared() bool

PictureCleared returns if the "picture" field was cleared in this mutation.

func (*UserMutation) RemoveAliasIDs

func (m *UserMutation) RemoveAliasIDs(ids ...uuid.UUID)

RemoveAliasIDs removes the "aliases" edge to the User entity by IDs.

func (*UserMutation) RemoveSessionIDs

func (m *UserMutation) RemoveSessionIDs(ids ...int)

RemoveSessionIDs removes the "sessions" edge to the UserSession entity by IDs.

func (*UserMutation) RemoveTakeIDs

func (m *UserMutation) RemoveTakeIDs(ids ...uuid.UUID)

RemoveTakeIDs removes the "takes" edge to the Take entity by IDs.

func (*UserMutation) RemovedAliasesIDs

func (m *UserMutation) RemovedAliasesIDs() (ids []uuid.UUID)

RemovedAliases returns the removed IDs of the "aliases" edge to the User entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) 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 (*UserMutation) RemovedSessionsIDs

func (m *UserMutation) RemovedSessionsIDs() (ids []int)

RemovedSessions returns the removed IDs of the "sessions" edge to the UserSession entity.

func (*UserMutation) RemovedTakesIDs

func (m *UserMutation) RemovedTakesIDs() (ids []uuid.UUID)

RemovedTakes returns the removed IDs of the "takes" edge to the Take entity.

func (*UserMutation) ResetAdmin

func (m *UserMutation) ResetAdmin()

ResetAdmin resets all changes to the "admin" field.

func (*UserMutation) ResetAliases

func (m *UserMutation) ResetAliases()

ResetAliases resets all changes to the "aliases" edge.

func (*UserMutation) ResetAnonymous

func (m *UserMutation) ResetAnonymous()

ResetAnonymous resets all changes to the "anonymous" field.

func (*UserMutation) ResetCreateTime

func (m *UserMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) 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 (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) 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 (*UserMutation) ResetLocale

func (m *UserMutation) ResetLocale()

ResetLocale resets all changes to the "locale" field.

func (*UserMutation) ResetMeta

func (m *UserMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetParent

func (m *UserMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (*UserMutation) ResetPasswordHash

func (m *UserMutation) ResetPasswordHash()

ResetPasswordHash resets all changes to the "password_hash" field.

func (*UserMutation) ResetPicture

func (m *UserMutation) ResetPicture()

ResetPicture resets all changes to the "picture" field.

func (*UserMutation) ResetSessions

func (m *UserMutation) ResetSessions()

ResetSessions resets all changes to the "sessions" edge.

func (*UserMutation) ResetTakes

func (m *UserMutation) ResetTakes()

ResetTakes resets all changes to the "takes" edge.

func (*UserMutation) ResetUpdateTime

func (m *UserMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*UserMutation) ResetUseDarkTheme

func (m *UserMutation) ResetUseDarkTheme()

ResetUseDarkTheme resets all changes to the "use_dark_theme" field.

func (*UserMutation) SessionsCleared

func (m *UserMutation) SessionsCleared() bool

SessionsCleared reports if the "sessions" edge to the UserSession entity was cleared.

func (*UserMutation) SessionsIDs

func (m *UserMutation) SessionsIDs() (ids []int)

SessionsIDs returns the "sessions" edge IDs in the mutation.

func (*UserMutation) SetAdmin

func (m *UserMutation) SetAdmin(b bool)

SetAdmin sets the "admin" field.

func (*UserMutation) SetAnonymous

func (m *UserMutation) SetAnonymous(b bool)

SetAnonymous sets the "anonymous" field.

func (*UserMutation) SetCreateTime

func (m *UserMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) 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 (*UserMutation) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetLocale

func (m *UserMutation) SetLocale(u user.Locale)

SetLocale sets the "locale" field.

func (*UserMutation) SetMeta

func (m *UserMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetParentID

func (m *UserMutation) SetParentID(id uuid.UUID)

SetParentID sets the "parent" edge to the User entity by id.

func (*UserMutation) SetPasswordHash

func (m *UserMutation) SetPasswordHash(s string)

SetPasswordHash sets the "password_hash" field.

func (*UserMutation) SetPicture

func (m *UserMutation) SetPicture(s string)

SetPicture sets the "picture" field.

func (*UserMutation) SetUpdateTime

func (m *UserMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*UserMutation) SetUseDarkTheme

func (m *UserMutation) SetUseDarkTheme(b bool)

SetUseDarkTheme sets the "use_dark_theme" field.

func (*UserMutation) TakesCleared

func (m *UserMutation) TakesCleared() bool

TakesCleared reports if the "takes" edge to the Take entity was cleared.

func (*UserMutation) TakesIDs

func (m *UserMutation) TakesIDs() (ids []uuid.UUID)

TakesIDs returns the "takes" edge IDs in the mutation.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UpdateTime

func (m *UserMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*UserMutation) UseDarkTheme

func (m *UserMutation) UseDarkTheme() (r bool, exists bool)

UseDarkTheme returns the value of the "use_dark_theme" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) QueryAliases

func (uq *UserQuery) QueryAliases() *UserQuery

QueryAliases chains the current query on the "aliases" edge.

func (*UserQuery) QueryParent

func (uq *UserQuery) QueryParent() *UserQuery

QueryParent chains the current query on the "parent" edge.

func (*UserQuery) QuerySessions

func (uq *UserQuery) QuerySessions() *UserSessionQuery

QuerySessions chains the current query on the "sessions" edge.

func (*UserQuery) QueryTakes

func (uq *UserQuery) QueryTakes() *TakeQuery

QueryTakes chains the current query on the "takes" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.User.Query().
	Select(user.FieldCreateTime).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

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 (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithAliases

func (uq *UserQuery) WithAliases(opts ...func(*UserQuery)) *UserQuery

WithAliases tells the query-builder to eager-load the nodes that are connected to the "aliases" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithParent

func (uq *UserQuery) WithParent(opts ...func(*UserQuery)) *UserQuery

WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithSessions

func (uq *UserQuery) WithSessions(opts ...func(*UserSessionQuery)) *UserQuery

WithSessions tells the query-builder to eager-load the nodes that are connected to the "sessions" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithTakes

func (uq *UserQuery) WithTakes(opts ...func(*TakeQuery)) *UserQuery

WithTakes tells the query-builder to eager-load the nodes that are connected to the "takes" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserSession

type UserSession struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Sid holds the value of the "sid" field.
	Sid string `json:"sid,omitempty"`
	// IP holds the value of the "ip" field.
	IP string `json:"ip,omitempty"`
	// UserAgent holds the value of the "user_agent" field.
	UserAgent string `json:"user_agent,omitempty"`
	// LastActivity holds the value of the "last_activity" field.
	LastActivity time.Time `json:"last_activity,omitempty"`
	// Active holds the value of the "active" field.
	Active bool `json:"active,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta map[string]interface{} `json:"meta,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserSessionQuery when eager-loading is set.
	Edges UserSessionEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserSession is the model entity for the UserSession schema.

func (*UserSession) QueryUser

func (us *UserSession) QueryUser() *UserQuery

QueryUser queries the "user" edge of the UserSession entity.

func (*UserSession) String

func (us *UserSession) String() string

String implements the fmt.Stringer.

func (*UserSession) Unwrap

func (us *UserSession) Unwrap() *UserSession

Unwrap unwraps the UserSession 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 (*UserSession) Update

func (us *UserSession) Update() *UserSessionUpdateOne

Update returns a builder for updating this UserSession. Note that you need to call UserSession.Unwrap() before calling this method if this UserSession was returned from a transaction, and the transaction was committed or rolled back.

type UserSessionClient

type UserSessionClient struct {
	// contains filtered or unexported fields
}

UserSessionClient is a client for the UserSession schema.

func NewUserSessionClient

func NewUserSessionClient(c config) *UserSessionClient

NewUserSessionClient returns a client for the UserSession from the given config.

func (*UserSessionClient) Create

func (c *UserSessionClient) Create() *UserSessionCreate

Create returns a builder for creating a UserSession entity.

func (*UserSessionClient) CreateBulk

func (c *UserSessionClient) CreateBulk(builders ...*UserSessionCreate) *UserSessionCreateBulk

CreateBulk returns a builder for creating a bulk of UserSession entities.

func (*UserSessionClient) Delete

func (c *UserSessionClient) Delete() *UserSessionDelete

Delete returns a delete builder for UserSession.

func (*UserSessionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserSessionClient) DeleteOneID

func (c *UserSessionClient) DeleteOneID(id int) *UserSessionDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*UserSessionClient) Get

func (c *UserSessionClient) Get(ctx context.Context, id int) (*UserSession, error)

Get returns a UserSession entity by its id.

func (*UserSessionClient) GetX

func (c *UserSessionClient) GetX(ctx context.Context, id int) *UserSession

GetX is like Get, but panics if an error occurs.

func (*UserSessionClient) Hooks

func (c *UserSessionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserSessionClient) Query

func (c *UserSessionClient) Query() *UserSessionQuery

Query returns a query builder for UserSession.

func (*UserSessionClient) QueryUser

func (c *UserSessionClient) QueryUser(us *UserSession) *UserQuery

QueryUser queries the user edge of a UserSession.

func (*UserSessionClient) Update

func (c *UserSessionClient) Update() *UserSessionUpdate

Update returns an update builder for UserSession.

func (*UserSessionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserSessionClient) UpdateOneID

func (c *UserSessionClient) UpdateOneID(id int) *UserSessionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserSessionClient) Use

func (c *UserSessionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `usersession.Hooks(f(g(h())))`.

type UserSessionCreate

type UserSessionCreate struct {
	// contains filtered or unexported fields
}

UserSessionCreate is the builder for creating a UserSession entity.

func (*UserSessionCreate) Exec

func (usc *UserSessionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserSessionCreate) ExecX

func (usc *UserSessionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserSessionCreate) Mutation

func (usc *UserSessionCreate) Mutation() *UserSessionMutation

Mutation returns the UserSessionMutation object of the builder.

func (*UserSessionCreate) Save

func (usc *UserSessionCreate) Save(ctx context.Context) (*UserSession, error)

Save creates the UserSession in the database.

func (*UserSessionCreate) SaveX

func (usc *UserSessionCreate) SaveX(ctx context.Context) *UserSession

SaveX calls Save and panics if Save returns an error.

func (*UserSessionCreate) SetActive

func (usc *UserSessionCreate) SetActive(b bool) *UserSessionCreate

SetActive sets the "active" field.

func (*UserSessionCreate) SetCreateTime

func (usc *UserSessionCreate) SetCreateTime(t time.Time) *UserSessionCreate

SetCreateTime sets the "create_time" field.

func (*UserSessionCreate) SetIP

SetIP sets the "ip" field.

func (*UserSessionCreate) SetLastActivity

func (usc *UserSessionCreate) SetLastActivity(t time.Time) *UserSessionCreate

SetLastActivity sets the "last_activity" field.

func (*UserSessionCreate) SetMeta

func (usc *UserSessionCreate) SetMeta(m map[string]interface{}) *UserSessionCreate

SetMeta sets the "meta" field.

func (*UserSessionCreate) SetNillableActive

func (usc *UserSessionCreate) SetNillableActive(b *bool) *UserSessionCreate

SetNillableActive sets the "active" field if the given value is not nil.

func (*UserSessionCreate) SetNillableCreateTime

func (usc *UserSessionCreate) SetNillableCreateTime(t *time.Time) *UserSessionCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserSessionCreate) SetNillableLastActivity

func (usc *UserSessionCreate) SetNillableLastActivity(t *time.Time) *UserSessionCreate

SetNillableLastActivity sets the "last_activity" field if the given value is not nil.

func (*UserSessionCreate) SetNillableUpdateTime

func (usc *UserSessionCreate) SetNillableUpdateTime(t *time.Time) *UserSessionCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*UserSessionCreate) SetSid

func (usc *UserSessionCreate) SetSid(s string) *UserSessionCreate

SetSid sets the "sid" field.

func (*UserSessionCreate) SetUpdateTime

func (usc *UserSessionCreate) SetUpdateTime(t time.Time) *UserSessionCreate

SetUpdateTime sets the "update_time" field.

func (*UserSessionCreate) SetUser

func (usc *UserSessionCreate) SetUser(u *User) *UserSessionCreate

SetUser sets the "user" edge to the User entity.

func (*UserSessionCreate) SetUserAgent

func (usc *UserSessionCreate) SetUserAgent(s string) *UserSessionCreate

SetUserAgent sets the "user_agent" field.

func (*UserSessionCreate) SetUserID

func (usc *UserSessionCreate) SetUserID(id uuid.UUID) *UserSessionCreate

SetUserID sets the "user" edge to the User entity by ID.

type UserSessionCreateBulk

type UserSessionCreateBulk struct {
	// contains filtered or unexported fields
}

UserSessionCreateBulk is the builder for creating many UserSession entities in bulk.

func (*UserSessionCreateBulk) Exec

func (uscb *UserSessionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserSessionCreateBulk) ExecX

func (uscb *UserSessionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserSessionCreateBulk) Save

func (uscb *UserSessionCreateBulk) Save(ctx context.Context) ([]*UserSession, error)

Save creates the UserSession entities in the database.

func (*UserSessionCreateBulk) SaveX

func (uscb *UserSessionCreateBulk) SaveX(ctx context.Context) []*UserSession

SaveX is like Save, but panics if an error occurs.

type UserSessionDelete

type UserSessionDelete struct {
	// contains filtered or unexported fields
}

UserSessionDelete is the builder for deleting a UserSession entity.

func (*UserSessionDelete) Exec

func (usd *UserSessionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserSessionDelete) ExecX

func (usd *UserSessionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserSessionDelete) Where

Where appends a list predicates to the UserSessionDelete builder.

type UserSessionDeleteOne

type UserSessionDeleteOne struct {
	// contains filtered or unexported fields
}

UserSessionDeleteOne is the builder for deleting a single UserSession entity.

func (*UserSessionDeleteOne) Exec

func (usdo *UserSessionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserSessionDeleteOne) ExecX

func (usdo *UserSessionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type UserSessionEdges

type UserSessionEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

UserSessionEdges holds the relations/edges for other nodes in the graph.

func (UserSessionEdges) UserOrErr

func (e UserSessionEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserSessionGroupBy

type UserSessionGroupBy struct {
	// contains filtered or unexported fields
}

UserSessionGroupBy is the group-by builder for UserSession entities.

func (*UserSessionGroupBy) Aggregate

func (usgb *UserSessionGroupBy) Aggregate(fns ...AggregateFunc) *UserSessionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserSessionGroupBy) Bool

func (s *UserSessionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSessionGroupBy) BoolX

func (s *UserSessionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSessionGroupBy) Bools

func (s *UserSessionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSessionGroupBy) BoolsX

func (s *UserSessionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSessionGroupBy) Float64

func (s *UserSessionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSessionGroupBy) Float64X

func (s *UserSessionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSessionGroupBy) Float64s

func (s *UserSessionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSessionGroupBy) Float64sX

func (s *UserSessionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSessionGroupBy) Int

func (s *UserSessionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSessionGroupBy) IntX

func (s *UserSessionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSessionGroupBy) Ints

func (s *UserSessionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSessionGroupBy) IntsX

func (s *UserSessionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSessionGroupBy) Scan

func (usgb *UserSessionGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserSessionGroupBy) ScanX

func (s *UserSessionGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UserSessionGroupBy) String

func (s *UserSessionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSessionGroupBy) StringX

func (s *UserSessionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSessionGroupBy) Strings

func (s *UserSessionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSessionGroupBy) StringsX

func (s *UserSessionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserSessionMutation

type UserSessionMutation struct {
	// contains filtered or unexported fields
}

UserSessionMutation represents an operation that mutates the UserSession nodes in the graph.

func (*UserSessionMutation) Active

func (m *UserSessionMutation) Active() (r bool, exists bool)

Active returns the value of the "active" field in the mutation.

func (*UserSessionMutation) AddField

func (m *UserSessionMutation) 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 (*UserSessionMutation) AddedEdges

func (m *UserSessionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserSessionMutation) AddedField

func (m *UserSessionMutation) 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 (*UserSessionMutation) AddedFields

func (m *UserSessionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserSessionMutation) AddedIDs

func (m *UserSessionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserSessionMutation) ClearEdge

func (m *UserSessionMutation) 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 (*UserSessionMutation) ClearField

func (m *UserSessionMutation) 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 (*UserSessionMutation) ClearMeta

func (m *UserSessionMutation) ClearMeta()

ClearMeta clears the value of the "meta" field.

func (*UserSessionMutation) ClearUser

func (m *UserSessionMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*UserSessionMutation) ClearedEdges

func (m *UserSessionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserSessionMutation) ClearedFields

func (m *UserSessionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserSessionMutation) Client

func (m UserSessionMutation) 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 (*UserSessionMutation) CreateTime

func (m *UserSessionMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*UserSessionMutation) EdgeCleared

func (m *UserSessionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserSessionMutation) Field

func (m *UserSessionMutation) 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 (*UserSessionMutation) FieldCleared

func (m *UserSessionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserSessionMutation) Fields

func (m *UserSessionMutation) 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 (*UserSessionMutation) ID

func (m *UserSessionMutation) 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 (*UserSessionMutation) IDs

func (m *UserSessionMutation) 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 (*UserSessionMutation) IP

func (m *UserSessionMutation) IP() (r string, exists bool)

IP returns the value of the "ip" field in the mutation.

func (*UserSessionMutation) LastActivity

func (m *UserSessionMutation) LastActivity() (r time.Time, exists bool)

LastActivity returns the value of the "last_activity" field in the mutation.

func (*UserSessionMutation) Meta

func (m *UserSessionMutation) Meta() (r map[string]interface{}, exists bool)

Meta returns the value of the "meta" field in the mutation.

func (*UserSessionMutation) MetaCleared

func (m *UserSessionMutation) MetaCleared() bool

MetaCleared returns if the "meta" field was cleared in this mutation.

func (*UserSessionMutation) OldActive

func (m *UserSessionMutation) OldActive(ctx context.Context) (v bool, err error)

OldActive returns the old "active" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) OldCreateTime

func (m *UserSessionMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) OldField

func (m *UserSessionMutation) 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 (*UserSessionMutation) OldIP

func (m *UserSessionMutation) OldIP(ctx context.Context) (v string, err error)

OldIP returns the old "ip" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) OldLastActivity

func (m *UserSessionMutation) OldLastActivity(ctx context.Context) (v time.Time, err error)

OldLastActivity returns the old "last_activity" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) OldMeta

func (m *UserSessionMutation) OldMeta(ctx context.Context) (v map[string]interface{}, err error)

OldMeta returns the old "meta" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) OldSid

func (m *UserSessionMutation) OldSid(ctx context.Context) (v string, err error)

OldSid returns the old "sid" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) OldUpdateTime

func (m *UserSessionMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) OldUserAgent

func (m *UserSessionMutation) OldUserAgent(ctx context.Context) (v string, err error)

OldUserAgent returns the old "user_agent" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) Op

func (m *UserSessionMutation) Op() Op

Op returns the operation name.

func (*UserSessionMutation) RemovedEdges

func (m *UserSessionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserSessionMutation) RemovedIDs

func (m *UserSessionMutation) 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 (*UserSessionMutation) ResetActive

func (m *UserSessionMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*UserSessionMutation) ResetCreateTime

func (m *UserSessionMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*UserSessionMutation) ResetEdge

func (m *UserSessionMutation) 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 (*UserSessionMutation) ResetField

func (m *UserSessionMutation) 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 (*UserSessionMutation) ResetIP

func (m *UserSessionMutation) ResetIP()

ResetIP resets all changes to the "ip" field.

func (*UserSessionMutation) ResetLastActivity

func (m *UserSessionMutation) ResetLastActivity()

ResetLastActivity resets all changes to the "last_activity" field.

func (*UserSessionMutation) ResetMeta

func (m *UserSessionMutation) ResetMeta()

ResetMeta resets all changes to the "meta" field.

func (*UserSessionMutation) ResetSid

func (m *UserSessionMutation) ResetSid()

ResetSid resets all changes to the "sid" field.

func (*UserSessionMutation) ResetUpdateTime

func (m *UserSessionMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*UserSessionMutation) ResetUser

func (m *UserSessionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*UserSessionMutation) ResetUserAgent

func (m *UserSessionMutation) ResetUserAgent()

ResetUserAgent resets all changes to the "user_agent" field.

func (*UserSessionMutation) SetActive

func (m *UserSessionMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*UserSessionMutation) SetCreateTime

func (m *UserSessionMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*UserSessionMutation) SetField

func (m *UserSessionMutation) 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 (*UserSessionMutation) SetIP

func (m *UserSessionMutation) SetIP(s string)

SetIP sets the "ip" field.

func (*UserSessionMutation) SetLastActivity

func (m *UserSessionMutation) SetLastActivity(t time.Time)

SetLastActivity sets the "last_activity" field.

func (*UserSessionMutation) SetMeta

func (m *UserSessionMutation) SetMeta(value map[string]interface{})

SetMeta sets the "meta" field.

func (*UserSessionMutation) SetSid

func (m *UserSessionMutation) SetSid(s string)

SetSid sets the "sid" field.

func (*UserSessionMutation) SetUpdateTime

func (m *UserSessionMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*UserSessionMutation) SetUserAgent

func (m *UserSessionMutation) SetUserAgent(s string)

SetUserAgent sets the "user_agent" field.

func (*UserSessionMutation) SetUserID

func (m *UserSessionMutation) SetUserID(id uuid.UUID)

SetUserID sets the "user" edge to the User entity by id.

func (*UserSessionMutation) Sid

func (m *UserSessionMutation) Sid() (r string, exists bool)

Sid returns the value of the "sid" field in the mutation.

func (UserSessionMutation) Tx

func (m UserSessionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserSessionMutation) Type

func (m *UserSessionMutation) Type() string

Type returns the node type of this mutation (UserSession).

func (*UserSessionMutation) UpdateTime

func (m *UserSessionMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*UserSessionMutation) UserAgent

func (m *UserSessionMutation) UserAgent() (r string, exists bool)

UserAgent returns the value of the "user_agent" field in the mutation.

func (*UserSessionMutation) UserCleared

func (m *UserSessionMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*UserSessionMutation) UserID

func (m *UserSessionMutation) UserID() (id uuid.UUID, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*UserSessionMutation) UserIDs

func (m *UserSessionMutation) UserIDs() (ids []uuid.UUID)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*UserSessionMutation) Where

func (m *UserSessionMutation) Where(ps ...predicate.UserSession)

Where appends a list predicates to the UserSessionMutation builder.

type UserSessionQuery

type UserSessionQuery struct {
	// contains filtered or unexported fields
}

UserSessionQuery is the builder for querying UserSession entities.

func (*UserSessionQuery) All

func (usq *UserSessionQuery) All(ctx context.Context) ([]*UserSession, error)

All executes the query and returns a list of UserSessions.

func (*UserSessionQuery) AllX

func (usq *UserSessionQuery) AllX(ctx context.Context) []*UserSession

AllX is like All, but panics if an error occurs.

func (*UserSessionQuery) Clone

func (usq *UserSessionQuery) Clone() *UserSessionQuery

Clone returns a duplicate of the UserSessionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserSessionQuery) Count

func (usq *UserSessionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserSessionQuery) CountX

func (usq *UserSessionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserSessionQuery) Exist

func (usq *UserSessionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserSessionQuery) ExistX

func (usq *UserSessionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserSessionQuery) First

func (usq *UserSessionQuery) First(ctx context.Context) (*UserSession, error)

First returns the first UserSession entity from the query. Returns a *NotFoundError when no UserSession was found.

func (*UserSessionQuery) FirstID

func (usq *UserSessionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first UserSession ID from the query. Returns a *NotFoundError when no UserSession ID was found.

func (*UserSessionQuery) FirstIDX

func (usq *UserSessionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserSessionQuery) FirstX

func (usq *UserSessionQuery) FirstX(ctx context.Context) *UserSession

FirstX is like First, but panics if an error occurs.

func (*UserSessionQuery) GroupBy

func (usq *UserSessionQuery) GroupBy(field string, fields ...string) *UserSessionGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserSession.Query().
	GroupBy(usersession.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserSessionQuery) IDs

func (usq *UserSessionQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of UserSession IDs.

func (*UserSessionQuery) IDsX

func (usq *UserSessionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserSessionQuery) Limit

func (usq *UserSessionQuery) Limit(limit int) *UserSessionQuery

Limit adds a limit step to the query.

func (*UserSessionQuery) Offset

func (usq *UserSessionQuery) Offset(offset int) *UserSessionQuery

Offset adds an offset step to the query.

func (*UserSessionQuery) Only

func (usq *UserSessionQuery) Only(ctx context.Context) (*UserSession, error)

Only returns a single UserSession entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserSession entity is found. Returns a *NotFoundError when no UserSession entities are found.

func (*UserSessionQuery) OnlyID

func (usq *UserSessionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only UserSession ID in the query. Returns a *NotSingularError when more than one UserSession ID is found. Returns a *NotFoundError when no entities are found.

func (*UserSessionQuery) OnlyIDX

func (usq *UserSessionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserSessionQuery) OnlyX

func (usq *UserSessionQuery) OnlyX(ctx context.Context) *UserSession

OnlyX is like Only, but panics if an error occurs.

func (*UserSessionQuery) Order

func (usq *UserSessionQuery) Order(o ...OrderFunc) *UserSessionQuery

Order adds an order step to the query.

func (*UserSessionQuery) QueryUser

func (usq *UserSessionQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*UserSessionQuery) Select

func (usq *UserSessionQuery) Select(fields ...string) *UserSessionSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.UserSession.Query().
	Select(usersession.FieldCreateTime).
	Scan(ctx, &v)

func (*UserSessionQuery) Unique

func (usq *UserSessionQuery) Unique(unique bool) *UserSessionQuery

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 (*UserSessionQuery) Where

Where adds a new predicate for the UserSessionQuery builder.

func (*UserSessionQuery) WithUser

func (usq *UserSessionQuery) WithUser(opts ...func(*UserQuery)) *UserSessionQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type UserSessionSelect

type UserSessionSelect struct {
	*UserSessionQuery
	// contains filtered or unexported fields
}

UserSessionSelect is the builder for selecting fields of UserSession entities.

func (*UserSessionSelect) Bool

func (s *UserSessionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSessionSelect) BoolX

func (s *UserSessionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSessionSelect) Bools

func (s *UserSessionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSessionSelect) BoolsX

func (s *UserSessionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSessionSelect) Float64

func (s *UserSessionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSessionSelect) Float64X

func (s *UserSessionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSessionSelect) Float64s

func (s *UserSessionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSessionSelect) Float64sX

func (s *UserSessionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSessionSelect) Int

func (s *UserSessionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSessionSelect) IntX

func (s *UserSessionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSessionSelect) Ints

func (s *UserSessionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSessionSelect) IntsX

func (s *UserSessionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSessionSelect) Scan

func (uss *UserSessionSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*UserSessionSelect) ScanX

func (s *UserSessionSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UserSessionSelect) String

func (s *UserSessionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSessionSelect) StringX

func (s *UserSessionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSessionSelect) Strings

func (s *UserSessionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSessionSelect) StringsX

func (s *UserSessionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserSessionUpdate

type UserSessionUpdate struct {
	// contains filtered or unexported fields
}

UserSessionUpdate is the builder for updating UserSession entities.

func (*UserSessionUpdate) ClearMeta

func (usu *UserSessionUpdate) ClearMeta() *UserSessionUpdate

ClearMeta clears the value of the "meta" field.

func (*UserSessionUpdate) ClearUser

func (usu *UserSessionUpdate) ClearUser() *UserSessionUpdate

ClearUser clears the "user" edge to the User entity.

func (*UserSessionUpdate) Exec

func (usu *UserSessionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserSessionUpdate) ExecX

func (usu *UserSessionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserSessionUpdate) Mutation

func (usu *UserSessionUpdate) Mutation() *UserSessionMutation

Mutation returns the UserSessionMutation object of the builder.

func (*UserSessionUpdate) Save

func (usu *UserSessionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserSessionUpdate) SaveX

func (usu *UserSessionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserSessionUpdate) SetActive

func (usu *UserSessionUpdate) SetActive(b bool) *UserSessionUpdate

SetActive sets the "active" field.

func (*UserSessionUpdate) SetIP

SetIP sets the "ip" field.

func (*UserSessionUpdate) SetLastActivity

func (usu *UserSessionUpdate) SetLastActivity(t time.Time) *UserSessionUpdate

SetLastActivity sets the "last_activity" field.

func (*UserSessionUpdate) SetMeta

func (usu *UserSessionUpdate) SetMeta(m map[string]interface{}) *UserSessionUpdate

SetMeta sets the "meta" field.

func (*UserSessionUpdate) SetNillableActive

func (usu *UserSessionUpdate) SetNillableActive(b *bool) *UserSessionUpdate

SetNillableActive sets the "active" field if the given value is not nil.

func (*UserSessionUpdate) SetNillableLastActivity

func (usu *UserSessionUpdate) SetNillableLastActivity(t *time.Time) *UserSessionUpdate

SetNillableLastActivity sets the "last_activity" field if the given value is not nil.

func (*UserSessionUpdate) SetUpdateTime

func (usu *UserSessionUpdate) SetUpdateTime(t time.Time) *UserSessionUpdate

SetUpdateTime sets the "update_time" field.

func (*UserSessionUpdate) SetUser

func (usu *UserSessionUpdate) SetUser(u *User) *UserSessionUpdate

SetUser sets the "user" edge to the User entity.

func (*UserSessionUpdate) SetUserAgent

func (usu *UserSessionUpdate) SetUserAgent(s string) *UserSessionUpdate

SetUserAgent sets the "user_agent" field.

func (*UserSessionUpdate) SetUserID

func (usu *UserSessionUpdate) SetUserID(id uuid.UUID) *UserSessionUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*UserSessionUpdate) Where

Where appends a list predicates to the UserSessionUpdate builder.

type UserSessionUpdateOne

type UserSessionUpdateOne struct {
	// contains filtered or unexported fields
}

UserSessionUpdateOne is the builder for updating a single UserSession entity.

func (*UserSessionUpdateOne) ClearMeta

func (usuo *UserSessionUpdateOne) ClearMeta() *UserSessionUpdateOne

ClearMeta clears the value of the "meta" field.

func (*UserSessionUpdateOne) ClearUser

func (usuo *UserSessionUpdateOne) ClearUser() *UserSessionUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*UserSessionUpdateOne) Exec

func (usuo *UserSessionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserSessionUpdateOne) ExecX

func (usuo *UserSessionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserSessionUpdateOne) Mutation

func (usuo *UserSessionUpdateOne) Mutation() *UserSessionMutation

Mutation returns the UserSessionMutation object of the builder.

func (*UserSessionUpdateOne) Save

Save executes the query and returns the updated UserSession entity.

func (*UserSessionUpdateOne) SaveX

func (usuo *UserSessionUpdateOne) SaveX(ctx context.Context) *UserSession

SaveX is like Save, but panics if an error occurs.

func (*UserSessionUpdateOne) Select

func (usuo *UserSessionUpdateOne) Select(field string, fields ...string) *UserSessionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserSessionUpdateOne) SetActive

func (usuo *UserSessionUpdateOne) SetActive(b bool) *UserSessionUpdateOne

SetActive sets the "active" field.

func (*UserSessionUpdateOne) SetIP

SetIP sets the "ip" field.

func (*UserSessionUpdateOne) SetLastActivity

func (usuo *UserSessionUpdateOne) SetLastActivity(t time.Time) *UserSessionUpdateOne

SetLastActivity sets the "last_activity" field.

func (*UserSessionUpdateOne) SetMeta

func (usuo *UserSessionUpdateOne) SetMeta(m map[string]interface{}) *UserSessionUpdateOne

SetMeta sets the "meta" field.

func (*UserSessionUpdateOne) SetNillableActive

func (usuo *UserSessionUpdateOne) SetNillableActive(b *bool) *UserSessionUpdateOne

SetNillableActive sets the "active" field if the given value is not nil.

func (*UserSessionUpdateOne) SetNillableLastActivity

func (usuo *UserSessionUpdateOne) SetNillableLastActivity(t *time.Time) *UserSessionUpdateOne

SetNillableLastActivity sets the "last_activity" field if the given value is not nil.

func (*UserSessionUpdateOne) SetUpdateTime

func (usuo *UserSessionUpdateOne) SetUpdateTime(t time.Time) *UserSessionUpdateOne

SetUpdateTime sets the "update_time" field.

func (*UserSessionUpdateOne) SetUser

func (usuo *UserSessionUpdateOne) SetUser(u *User) *UserSessionUpdateOne

SetUser sets the "user" edge to the User entity.

func (*UserSessionUpdateOne) SetUserAgent

func (usuo *UserSessionUpdateOne) SetUserAgent(s string) *UserSessionUpdateOne

SetUserAgent sets the "user_agent" field.

func (*UserSessionUpdateOne) SetUserID

func (usuo *UserSessionUpdateOne) SetUserID(id uuid.UUID) *UserSessionUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

type UserSessions

type UserSessions []*UserSession

UserSessions is a parsable slice of UserSession.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddAliasIDs

func (uu *UserUpdate) AddAliasIDs(ids ...uuid.UUID) *UserUpdate

AddAliasIDs adds the "aliases" edge to the User entity by IDs.

func (*UserUpdate) AddAliases

func (uu *UserUpdate) AddAliases(u ...*User) *UserUpdate

AddAliases adds the "aliases" edges to the User entity.

func (*UserUpdate) AddSessionIDs

func (uu *UserUpdate) AddSessionIDs(ids ...int) *UserUpdate

AddSessionIDs adds the "sessions" edge to the UserSession entity by IDs.

func (*UserUpdate) AddSessions

func (uu *UserUpdate) AddSessions(u ...*UserSession) *UserUpdate

AddSessions adds the "sessions" edges to the UserSession entity.

func (*UserUpdate) AddTakeIDs

func (uu *UserUpdate) AddTakeIDs(ids ...uuid.UUID) *UserUpdate

AddTakeIDs adds the "takes" edge to the Take entity by IDs.

func (*UserUpdate) AddTakes

func (uu *UserUpdate) AddTakes(t ...*Take) *UserUpdate

AddTakes adds the "takes" edges to the Take entity.

func (*UserUpdate) ClearAliases

func (uu *UserUpdate) ClearAliases() *UserUpdate

ClearAliases clears all "aliases" edges to the User entity.

func (*UserUpdate) ClearEmail

func (uu *UserUpdate) ClearEmail() *UserUpdate

ClearEmail clears the value of the "email" field.

func (*UserUpdate) ClearMeta

func (uu *UserUpdate) ClearMeta() *UserUpdate

ClearMeta clears the value of the "meta" field.

func (*UserUpdate) ClearParent

func (uu *UserUpdate) ClearParent() *UserUpdate

ClearParent clears the "parent" edge to the User entity.

func (*UserUpdate) ClearPicture

func (uu *UserUpdate) ClearPicture() *UserUpdate

ClearPicture clears the value of the "picture" field.

func (*UserUpdate) ClearSessions

func (uu *UserUpdate) ClearSessions() *UserUpdate

ClearSessions clears all "sessions" edges to the UserSession entity.

func (*UserUpdate) ClearTakes

func (uu *UserUpdate) ClearTakes() *UserUpdate

ClearTakes clears all "takes" edges to the Take entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveAliasIDs

func (uu *UserUpdate) RemoveAliasIDs(ids ...uuid.UUID) *UserUpdate

RemoveAliasIDs removes the "aliases" edge to User entities by IDs.

func (*UserUpdate) RemoveAliases

func (uu *UserUpdate) RemoveAliases(u ...*User) *UserUpdate

RemoveAliases removes "aliases" edges to User entities.

func (*UserUpdate) RemoveSessionIDs

func (uu *UserUpdate) RemoveSessionIDs(ids ...int) *UserUpdate

RemoveSessionIDs removes the "sessions" edge to UserSession entities by IDs.

func (*UserUpdate) RemoveSessions

func (uu *UserUpdate) RemoveSessions(u ...*UserSession) *UserUpdate

RemoveSessions removes "sessions" edges to UserSession entities.

func (*UserUpdate) RemoveTakeIDs

func (uu *UserUpdate) RemoveTakeIDs(ids ...uuid.UUID) *UserUpdate

RemoveTakeIDs removes the "takes" edge to Take entities by IDs.

func (*UserUpdate) RemoveTakes

func (uu *UserUpdate) RemoveTakes(t ...*Take) *UserUpdate

RemoveTakes removes "takes" edges to Take entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetAdmin

func (uu *UserUpdate) SetAdmin(b bool) *UserUpdate

SetAdmin sets the "admin" field.

func (*UserUpdate) SetAnonymous

func (uu *UserUpdate) SetAnonymous(b bool) *UserUpdate

SetAnonymous sets the "anonymous" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetMeta

func (uu *UserUpdate) SetMeta(m map[string]interface{}) *UserUpdate

SetMeta sets the "meta" field.

func (*UserUpdate) SetName

func (uu *UserUpdate) SetName(s string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNillableAdmin

func (uu *UserUpdate) SetNillableAdmin(b *bool) *UserUpdate

SetNillableAdmin sets the "admin" field if the given value is not nil.

func (*UserUpdate) SetNillableAnonymous

func (uu *UserUpdate) SetNillableAnonymous(b *bool) *UserUpdate

SetNillableAnonymous sets the "anonymous" field if the given value is not nil.

func (*UserUpdate) SetNillableEmail

func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillableParentID

func (uu *UserUpdate) SetNillableParentID(id *uuid.UUID) *UserUpdate

SetNillableParentID sets the "parent" edge to the User entity by ID if the given value is not nil.

func (*UserUpdate) SetNillablePicture

func (uu *UserUpdate) SetNillablePicture(s *string) *UserUpdate

SetNillablePicture sets the "picture" field if the given value is not nil.

func (*UserUpdate) SetNillableUseDarkTheme

func (uu *UserUpdate) SetNillableUseDarkTheme(b *bool) *UserUpdate

SetNillableUseDarkTheme sets the "use_dark_theme" field if the given value is not nil.

func (*UserUpdate) SetParent

func (uu *UserUpdate) SetParent(u *User) *UserUpdate

SetParent sets the "parent" edge to the User entity.

func (*UserUpdate) SetParentID

func (uu *UserUpdate) SetParentID(id uuid.UUID) *UserUpdate

SetParentID sets the "parent" edge to the User entity by ID.

func (*UserUpdate) SetPasswordHash

func (uu *UserUpdate) SetPasswordHash(s string) *UserUpdate

SetPasswordHash sets the "password_hash" field.

func (*UserUpdate) SetPicture

func (uu *UserUpdate) SetPicture(s string) *UserUpdate

SetPicture sets the "picture" field.

func (*UserUpdate) SetUpdateTime

func (uu *UserUpdate) SetUpdateTime(t time.Time) *UserUpdate

SetUpdateTime sets the "update_time" field.

func (*UserUpdate) SetUseDarkTheme

func (uu *UserUpdate) SetUseDarkTheme(b bool) *UserUpdate

SetUseDarkTheme sets the "use_dark_theme" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddAliasIDs

func (uuo *UserUpdateOne) AddAliasIDs(ids ...uuid.UUID) *UserUpdateOne

AddAliasIDs adds the "aliases" edge to the User entity by IDs.

func (*UserUpdateOne) AddAliases

func (uuo *UserUpdateOne) AddAliases(u ...*User) *UserUpdateOne

AddAliases adds the "aliases" edges to the User entity.

func (*UserUpdateOne) AddSessionIDs

func (uuo *UserUpdateOne) AddSessionIDs(ids ...int) *UserUpdateOne

AddSessionIDs adds the "sessions" edge to the UserSession entity by IDs.

func (*UserUpdateOne) AddSessions

func (uuo *UserUpdateOne) AddSessions(u ...*UserSession) *UserUpdateOne

AddSessions adds the "sessions" edges to the UserSession entity.

func (*UserUpdateOne) AddTakeIDs

func (uuo *UserUpdateOne) AddTakeIDs(ids ...uuid.UUID) *UserUpdateOne

AddTakeIDs adds the "takes" edge to the Take entity by IDs.

func (*UserUpdateOne) AddTakes

func (uuo *UserUpdateOne) AddTakes(t ...*Take) *UserUpdateOne

AddTakes adds the "takes" edges to the Take entity.

func (*UserUpdateOne) ClearAliases

func (uuo *UserUpdateOne) ClearAliases() *UserUpdateOne

ClearAliases clears all "aliases" edges to the User entity.

func (*UserUpdateOne) ClearEmail

func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne

ClearEmail clears the value of the "email" field.

func (*UserUpdateOne) ClearMeta

func (uuo *UserUpdateOne) ClearMeta() *UserUpdateOne

ClearMeta clears the value of the "meta" field.

func (*UserUpdateOne) ClearParent

func (uuo *UserUpdateOne) ClearParent() *UserUpdateOne

ClearParent clears the "parent" edge to the User entity.

func (*UserUpdateOne) ClearPicture

func (uuo *UserUpdateOne) ClearPicture() *UserUpdateOne

ClearPicture clears the value of the "picture" field.

func (*UserUpdateOne) ClearSessions

func (uuo *UserUpdateOne) ClearSessions() *UserUpdateOne

ClearSessions clears all "sessions" edges to the UserSession entity.

func (*UserUpdateOne) ClearTakes

func (uuo *UserUpdateOne) ClearTakes() *UserUpdateOne

ClearTakes clears all "takes" edges to the Take entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveAliasIDs

func (uuo *UserUpdateOne) RemoveAliasIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveAliasIDs removes the "aliases" edge to User entities by IDs.

func (*UserUpdateOne) RemoveAliases

func (uuo *UserUpdateOne) RemoveAliases(u ...*User) *UserUpdateOne

RemoveAliases removes "aliases" edges to User entities.

func (*UserUpdateOne) RemoveSessionIDs

func (uuo *UserUpdateOne) RemoveSessionIDs(ids ...int) *UserUpdateOne

RemoveSessionIDs removes the "sessions" edge to UserSession entities by IDs.

func (*UserUpdateOne) RemoveSessions

func (uuo *UserUpdateOne) RemoveSessions(u ...*UserSession) *UserUpdateOne

RemoveSessions removes "sessions" edges to UserSession entities.

func (*UserUpdateOne) RemoveTakeIDs

func (uuo *UserUpdateOne) RemoveTakeIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveTakeIDs removes the "takes" edge to Take entities by IDs.

func (*UserUpdateOne) RemoveTakes

func (uuo *UserUpdateOne) RemoveTakes(t ...*Take) *UserUpdateOne

RemoveTakes removes "takes" edges to Take entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetAdmin

func (uuo *UserUpdateOne) SetAdmin(b bool) *UserUpdateOne

SetAdmin sets the "admin" field.

func (*UserUpdateOne) SetAnonymous

func (uuo *UserUpdateOne) SetAnonymous(b bool) *UserUpdateOne

SetAnonymous sets the "anonymous" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetMeta

func (uuo *UserUpdateOne) SetMeta(m map[string]interface{}) *UserUpdateOne

SetMeta sets the "meta" field.

func (*UserUpdateOne) SetName

func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNillableAdmin

func (uuo *UserUpdateOne) SetNillableAdmin(b *bool) *UserUpdateOne

SetNillableAdmin sets the "admin" field if the given value is not nil.

func (*UserUpdateOne) SetNillableAnonymous

func (uuo *UserUpdateOne) SetNillableAnonymous(b *bool) *UserUpdateOne

SetNillableAnonymous sets the "anonymous" field if the given value is not nil.

func (*UserUpdateOne) SetNillableEmail

func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillableParentID

func (uuo *UserUpdateOne) SetNillableParentID(id *uuid.UUID) *UserUpdateOne

SetNillableParentID sets the "parent" edge to the User entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillablePicture

func (uuo *UserUpdateOne) SetNillablePicture(s *string) *UserUpdateOne

SetNillablePicture sets the "picture" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUseDarkTheme

func (uuo *UserUpdateOne) SetNillableUseDarkTheme(b *bool) *UserUpdateOne

SetNillableUseDarkTheme sets the "use_dark_theme" field if the given value is not nil.

func (*UserUpdateOne) SetParent

func (uuo *UserUpdateOne) SetParent(u *User) *UserUpdateOne

SetParent sets the "parent" edge to the User entity.

func (*UserUpdateOne) SetParentID

func (uuo *UserUpdateOne) SetParentID(id uuid.UUID) *UserUpdateOne

SetParentID sets the "parent" edge to the User entity by ID.

func (*UserUpdateOne) SetPasswordHash

func (uuo *UserUpdateOne) SetPasswordHash(s string) *UserUpdateOne

SetPasswordHash sets the "password_hash" field.

func (*UserUpdateOne) SetPicture

func (uuo *UserUpdateOne) SetPicture(s string) *UserUpdateOne

SetPicture sets the "picture" field.

func (*UserUpdateOne) SetUpdateTime

func (uuo *UserUpdateOne) SetUpdateTime(t time.Time) *UserUpdateOne

SetUpdateTime sets the "update_time" field.

func (*UserUpdateOne) SetUseDarkTheme

func (uuo *UserUpdateOne) SetUseDarkTheme(b bool) *UserUpdateOne

SetUseDarkTheme sets the "use_dark_theme" field.

type Users

type Users []*User

Users is a parsable slice of User.

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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL