ent

package
v0.0.0-...-6d1ceae Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: AGPL-3.0 Imports: 30 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.
	TypeEquipment   = "Equipment"
	TypeIdea        = "Idea"
	TypeIngredient  = "Ingredient"
	TypeInstruction = "Instruction"
	TypeNutrition   = "Nutrition"
	TypeProduct     = "Product"
	TypeRecipe      = "Recipe"
	TypeSource      = "Source"
	TypeTag         = "Tag"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Equipment is the client for interacting with the Equipment builders.
	Equipment *EquipmentClient
	// Idea is the client for interacting with the Idea builders.
	Idea *IdeaClient
	// Ingredient is the client for interacting with the Ingredient builders.
	Ingredient *IngredientClient
	// Instruction is the client for interacting with the Instruction builders.
	Instruction *InstructionClient
	// Nutrition is the client for interacting with the Nutrition builders.
	Nutrition *NutritionClient
	// Product is the client for interacting with the Product builders.
	Product *ProductClient
	// Recipe is the client for interacting with the Recipe builders.
	Recipe *RecipeClient
	// Source is the client for interacting with the Source builders.
	Source *SourceClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// 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().
	Equipment.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Equipment

type Equipment struct {

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

Equipment is the model entity for the Equipment schema.

func (*Equipment) QueryRecipes

func (e *Equipment) QueryRecipes() *RecipeQuery

QueryRecipes queries the "recipes" edge of the Equipment entity.

func (*Equipment) String

func (e *Equipment) String() string

String implements the fmt.Stringer.

func (*Equipment) Unwrap

func (e *Equipment) Unwrap() *Equipment

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

func (e *Equipment) Update() *EquipmentUpdateOne

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

func (*Equipment) Value

func (e *Equipment) Value(name string) (ent.Value, error)

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

type EquipmentClient

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

EquipmentClient is a client for the Equipment schema.

func NewEquipmentClient

func NewEquipmentClient(c config) *EquipmentClient

NewEquipmentClient returns a client for the Equipment from the given config.

func (*EquipmentClient) Create

func (c *EquipmentClient) Create() *EquipmentCreate

Create returns a builder for creating a Equipment entity.

func (*EquipmentClient) CreateBulk

func (c *EquipmentClient) CreateBulk(builders ...*EquipmentCreate) *EquipmentCreateBulk

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

func (*EquipmentClient) Delete

func (c *EquipmentClient) Delete() *EquipmentDelete

Delete returns a delete builder for Equipment.

func (*EquipmentClient) DeleteOne

func (c *EquipmentClient) DeleteOne(e *Equipment) *EquipmentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EquipmentClient) DeleteOneID

func (c *EquipmentClient) DeleteOneID(id uuid.UUID) *EquipmentDeleteOne

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

func (*EquipmentClient) Get

func (c *EquipmentClient) Get(ctx context.Context, id uuid.UUID) (*Equipment, error)

Get returns a Equipment entity by its id.

func (*EquipmentClient) GetX

func (c *EquipmentClient) GetX(ctx context.Context, id uuid.UUID) *Equipment

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

func (*EquipmentClient) Hooks

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

Hooks returns the client hooks.

func (*EquipmentClient) Intercept

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

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

func (*EquipmentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*EquipmentClient) MapCreateBulk

func (c *EquipmentClient) MapCreateBulk(slice any, setFunc func(*EquipmentCreate, int)) *EquipmentCreateBulk

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

func (*EquipmentClient) Query

func (c *EquipmentClient) Query() *EquipmentQuery

Query returns a query builder for Equipment.

func (*EquipmentClient) QueryRecipes

func (c *EquipmentClient) QueryRecipes(e *Equipment) *RecipeQuery

QueryRecipes queries the recipes edge of a Equipment.

func (*EquipmentClient) Update

func (c *EquipmentClient) Update() *EquipmentUpdate

Update returns an update builder for Equipment.

func (*EquipmentClient) UpdateOne

func (c *EquipmentClient) UpdateOne(e *Equipment) *EquipmentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EquipmentClient) UpdateOneID

func (c *EquipmentClient) UpdateOneID(id uuid.UUID) *EquipmentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EquipmentClient) Use

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

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

type EquipmentCreate

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

EquipmentCreate is the builder for creating a Equipment entity.

func (*EquipmentCreate) AddRecipeIDs

func (ec *EquipmentCreate) AddRecipeIDs(ids ...uuid.UUID) *EquipmentCreate

AddRecipeIDs adds the "recipes" edge to the Recipe entity by IDs.

func (*EquipmentCreate) AddRecipes

func (ec *EquipmentCreate) AddRecipes(r ...*Recipe) *EquipmentCreate

AddRecipes adds the "recipes" edges to the Recipe entity.

func (*EquipmentCreate) Exec

func (ec *EquipmentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EquipmentCreate) ExecX

func (ec *EquipmentCreate) ExecX(ctx context.Context)

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

func (*EquipmentCreate) Mutation

func (ec *EquipmentCreate) Mutation() *EquipmentMutation

Mutation returns the EquipmentMutation object of the builder.

func (*EquipmentCreate) Save

func (ec *EquipmentCreate) Save(ctx context.Context) (*Equipment, error)

Save creates the Equipment in the database.

func (*EquipmentCreate) SaveX

func (ec *EquipmentCreate) SaveX(ctx context.Context) *Equipment

SaveX calls Save and panics if Save returns an error.

func (*EquipmentCreate) SetID

func (ec *EquipmentCreate) SetID(u uuid.UUID) *EquipmentCreate

SetID sets the "id" field.

func (*EquipmentCreate) SetName

func (ec *EquipmentCreate) SetName(s string) *EquipmentCreate

SetName sets the "name" field.

func (*EquipmentCreate) SetNillableID

func (ec *EquipmentCreate) SetNillableID(u *uuid.UUID) *EquipmentCreate

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

func (*EquipmentCreate) SetSlug

func (ec *EquipmentCreate) SetSlug(s string) *EquipmentCreate

SetSlug sets the "slug" field.

type EquipmentCreateBulk

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

EquipmentCreateBulk is the builder for creating many Equipment entities in bulk.

func (*EquipmentCreateBulk) Exec

func (ecb *EquipmentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EquipmentCreateBulk) ExecX

func (ecb *EquipmentCreateBulk) ExecX(ctx context.Context)

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

func (*EquipmentCreateBulk) Save

func (ecb *EquipmentCreateBulk) Save(ctx context.Context) ([]*Equipment, error)

Save creates the Equipment entities in the database.

func (*EquipmentCreateBulk) SaveX

func (ecb *EquipmentCreateBulk) SaveX(ctx context.Context) []*Equipment

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

type EquipmentDelete

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

EquipmentDelete is the builder for deleting a Equipment entity.

func (*EquipmentDelete) Exec

func (ed *EquipmentDelete) Exec(ctx context.Context) (int, error)

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

func (*EquipmentDelete) ExecX

func (ed *EquipmentDelete) ExecX(ctx context.Context) int

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

func (*EquipmentDelete) Where

Where appends a list predicates to the EquipmentDelete builder.

type EquipmentDeleteOne

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

EquipmentDeleteOne is the builder for deleting a single Equipment entity.

func (*EquipmentDeleteOne) Exec

func (edo *EquipmentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EquipmentDeleteOne) ExecX

func (edo *EquipmentDeleteOne) ExecX(ctx context.Context)

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

func (*EquipmentDeleteOne) Where

Where appends a list predicates to the EquipmentDelete builder.

type EquipmentEdges

type EquipmentEdges struct {
	// Recipes holds the value of the recipes edge.
	Recipes []*Recipe `json:"recipes,omitempty"`
	// contains filtered or unexported fields
}

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

func (EquipmentEdges) RecipesOrErr

func (e EquipmentEdges) RecipesOrErr() ([]*Recipe, error)

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

type EquipmentGroupBy

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

EquipmentGroupBy is the group-by builder for Equipment entities.

func (*EquipmentGroupBy) Aggregate

func (egb *EquipmentGroupBy) Aggregate(fns ...AggregateFunc) *EquipmentGroupBy

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

func (*EquipmentGroupBy) Bool

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

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

func (*EquipmentGroupBy) BoolX

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

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

func (*EquipmentGroupBy) Bools

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

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

func (*EquipmentGroupBy) BoolsX

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

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

func (*EquipmentGroupBy) Float64

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

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

func (*EquipmentGroupBy) Float64X

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

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

func (*EquipmentGroupBy) Float64s

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

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

func (*EquipmentGroupBy) Float64sX

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

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

func (*EquipmentGroupBy) Int

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

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

func (*EquipmentGroupBy) IntX

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

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

func (*EquipmentGroupBy) Ints

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

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

func (*EquipmentGroupBy) IntsX

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

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

func (*EquipmentGroupBy) Scan

func (egb *EquipmentGroupBy) Scan(ctx context.Context, v any) error

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

func (*EquipmentGroupBy) ScanX

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

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

func (*EquipmentGroupBy) String

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

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

func (*EquipmentGroupBy) StringX

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

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

func (*EquipmentGroupBy) Strings

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

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

func (*EquipmentGroupBy) StringsX

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

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

type EquipmentMutation

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

EquipmentMutation represents an operation that mutates the Equipment nodes in the graph.

func (*EquipmentMutation) AddField

func (m *EquipmentMutation) 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 (*EquipmentMutation) AddRecipeIDs

func (m *EquipmentMutation) AddRecipeIDs(ids ...uuid.UUID)

AddRecipeIDs adds the "recipes" edge to the Recipe entity by ids.

func (*EquipmentMutation) AddedEdges

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

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

func (*EquipmentMutation) AddedField

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

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

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

func (*EquipmentMutation) AddedIDs

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

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

func (*EquipmentMutation) ClearEdge

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

func (m *EquipmentMutation) 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 (*EquipmentMutation) ClearRecipes

func (m *EquipmentMutation) ClearRecipes()

ClearRecipes clears the "recipes" edge to the Recipe entity.

func (*EquipmentMutation) ClearedEdges

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

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

func (*EquipmentMutation) ClearedFields

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

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

func (EquipmentMutation) Client

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

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

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

func (*EquipmentMutation) Field

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

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

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

func (*EquipmentMutation) Fields

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

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

func (m *EquipmentMutation) 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 (*EquipmentMutation) Name

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

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

func (*EquipmentMutation) OldField

func (m *EquipmentMutation) 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 (*EquipmentMutation) OldName

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

OldName returns the old "name" field's value of the Equipment entity. If the Equipment 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 (*EquipmentMutation) OldSlug

func (m *EquipmentMutation) OldSlug(ctx context.Context) (v string, err error)

OldSlug returns the old "slug" field's value of the Equipment entity. If the Equipment 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 (*EquipmentMutation) Op

func (m *EquipmentMutation) Op() Op

Op returns the operation name.

func (*EquipmentMutation) RecipesCleared

func (m *EquipmentMutation) RecipesCleared() bool

RecipesCleared reports if the "recipes" edge to the Recipe entity was cleared.

func (*EquipmentMutation) RecipesIDs

func (m *EquipmentMutation) RecipesIDs() (ids []uuid.UUID)

RecipesIDs returns the "recipes" edge IDs in the mutation.

func (*EquipmentMutation) RemoveRecipeIDs

func (m *EquipmentMutation) RemoveRecipeIDs(ids ...uuid.UUID)

RemoveRecipeIDs removes the "recipes" edge to the Recipe entity by IDs.

func (*EquipmentMutation) RemovedEdges

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

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

func (*EquipmentMutation) RemovedIDs

func (m *EquipmentMutation) 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 (*EquipmentMutation) RemovedRecipesIDs

func (m *EquipmentMutation) RemovedRecipesIDs() (ids []uuid.UUID)

RemovedRecipes returns the removed IDs of the "recipes" edge to the Recipe entity.

func (*EquipmentMutation) ResetEdge

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

func (m *EquipmentMutation) 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 (*EquipmentMutation) ResetName

func (m *EquipmentMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*EquipmentMutation) ResetRecipes

func (m *EquipmentMutation) ResetRecipes()

ResetRecipes resets all changes to the "recipes" edge.

func (*EquipmentMutation) ResetSlug

func (m *EquipmentMutation) ResetSlug()

ResetSlug resets all changes to the "slug" field.

func (*EquipmentMutation) SetField

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

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

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

func (*EquipmentMutation) SetName

func (m *EquipmentMutation) SetName(s string)

SetName sets the "name" field.

func (*EquipmentMutation) SetOp

func (m *EquipmentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EquipmentMutation) SetSlug

func (m *EquipmentMutation) SetSlug(s string)

SetSlug sets the "slug" field.

func (*EquipmentMutation) Slug

func (m *EquipmentMutation) Slug() (r string, exists bool)

Slug returns the value of the "slug" field in the mutation.

func (EquipmentMutation) Tx

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

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

func (*EquipmentMutation) Type

func (m *EquipmentMutation) Type() string

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

func (*EquipmentMutation) Where

func (m *EquipmentMutation) Where(ps ...predicate.Equipment)

Where appends a list predicates to the EquipmentMutation builder.

func (*EquipmentMutation) WhereP

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

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

type EquipmentQuery

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

EquipmentQuery is the builder for querying Equipment entities.

func (*EquipmentQuery) Aggregate

func (eq *EquipmentQuery) Aggregate(fns ...AggregateFunc) *EquipmentSelect

Aggregate returns a EquipmentSelect configured with the given aggregations.

func (*EquipmentQuery) All

func (eq *EquipmentQuery) All(ctx context.Context) ([]*Equipment, error)

All executes the query and returns a list of EquipmentSlice.

func (*EquipmentQuery) AllX

func (eq *EquipmentQuery) AllX(ctx context.Context) []*Equipment

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

func (*EquipmentQuery) Clone

func (eq *EquipmentQuery) Clone() *EquipmentQuery

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

func (*EquipmentQuery) Count

func (eq *EquipmentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EquipmentQuery) CountX

func (eq *EquipmentQuery) CountX(ctx context.Context) int

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

func (*EquipmentQuery) Exist

func (eq *EquipmentQuery) Exist(ctx context.Context) (bool, error)

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

func (*EquipmentQuery) ExistX

func (eq *EquipmentQuery) ExistX(ctx context.Context) bool

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

func (*EquipmentQuery) First

func (eq *EquipmentQuery) First(ctx context.Context) (*Equipment, error)

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

func (*EquipmentQuery) FirstID

func (eq *EquipmentQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*EquipmentQuery) FirstIDX

func (eq *EquipmentQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*EquipmentQuery) FirstX

func (eq *EquipmentQuery) FirstX(ctx context.Context) *Equipment

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

func (*EquipmentQuery) GroupBy

func (eq *EquipmentQuery) GroupBy(field string, fields ...string) *EquipmentGroupBy

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

Example:

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

client.Equipment.Query().
	GroupBy(equipment.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EquipmentQuery) IDs

func (eq *EquipmentQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*EquipmentQuery) IDsX

func (eq *EquipmentQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*EquipmentQuery) Limit

func (eq *EquipmentQuery) Limit(limit int) *EquipmentQuery

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

func (*EquipmentQuery) Offset

func (eq *EquipmentQuery) Offset(offset int) *EquipmentQuery

Offset to start from.

func (*EquipmentQuery) Only

func (eq *EquipmentQuery) Only(ctx context.Context) (*Equipment, error)

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

func (*EquipmentQuery) OnlyID

func (eq *EquipmentQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*EquipmentQuery) OnlyIDX

func (eq *EquipmentQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*EquipmentQuery) OnlyX

func (eq *EquipmentQuery) OnlyX(ctx context.Context) *Equipment

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

func (*EquipmentQuery) Order

Order specifies how the records should be ordered.

func (*EquipmentQuery) QueryRecipes

func (eq *EquipmentQuery) QueryRecipes() *RecipeQuery

QueryRecipes chains the current query on the "recipes" edge.

func (*EquipmentQuery) Select

func (eq *EquipmentQuery) Select(fields ...string) *EquipmentSelect

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

Example:

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

client.Equipment.Query().
	Select(equipment.FieldName).
	Scan(ctx, &v)

func (*EquipmentQuery) Unique

func (eq *EquipmentQuery) Unique(unique bool) *EquipmentQuery

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

Where adds a new predicate for the EquipmentQuery builder.

func (*EquipmentQuery) WithRecipes

func (eq *EquipmentQuery) WithRecipes(opts ...func(*RecipeQuery)) *EquipmentQuery

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

type EquipmentSelect

type EquipmentSelect struct {
	*EquipmentQuery
	// contains filtered or unexported fields
}

EquipmentSelect is the builder for selecting fields of Equipment entities.

func (*EquipmentSelect) Aggregate

func (es *EquipmentSelect) Aggregate(fns ...AggregateFunc) *EquipmentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*EquipmentSelect) Bool

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

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

func (*EquipmentSelect) BoolX

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

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

func (*EquipmentSelect) Bools

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

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

func (*EquipmentSelect) BoolsX

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

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

func (*EquipmentSelect) Float64

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

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

func (*EquipmentSelect) Float64X

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

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

func (*EquipmentSelect) Float64s

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

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

func (*EquipmentSelect) Float64sX

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

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

func (*EquipmentSelect) Int

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

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

func (*EquipmentSelect) IntX

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

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

func (*EquipmentSelect) Ints

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

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

func (*EquipmentSelect) IntsX

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

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

func (*EquipmentSelect) Scan

func (es *EquipmentSelect) Scan(ctx context.Context, v any) error

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

func (*EquipmentSelect) ScanX

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

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

func (*EquipmentSelect) String

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

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

func (*EquipmentSelect) StringX

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

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

func (*EquipmentSelect) Strings

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

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

func (*EquipmentSelect) StringsX

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

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

type EquipmentSlice

type EquipmentSlice []*Equipment

EquipmentSlice is a parsable slice of Equipment.

type EquipmentUpdate

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

EquipmentUpdate is the builder for updating Equipment entities.

func (*EquipmentUpdate) AddRecipeIDs

func (eu *EquipmentUpdate) AddRecipeIDs(ids ...uuid.UUID) *EquipmentUpdate

AddRecipeIDs adds the "recipes" edge to the Recipe entity by IDs.

func (*EquipmentUpdate) AddRecipes

func (eu *EquipmentUpdate) AddRecipes(r ...*Recipe) *EquipmentUpdate

AddRecipes adds the "recipes" edges to the Recipe entity.

func (*EquipmentUpdate) ClearRecipes

func (eu *EquipmentUpdate) ClearRecipes() *EquipmentUpdate

ClearRecipes clears all "recipes" edges to the Recipe entity.

func (*EquipmentUpdate) Exec

func (eu *EquipmentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EquipmentUpdate) ExecX

func (eu *EquipmentUpdate) ExecX(ctx context.Context)

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

func (*EquipmentUpdate) Mutation

func (eu *EquipmentUpdate) Mutation() *EquipmentMutation

Mutation returns the EquipmentMutation object of the builder.

func (*EquipmentUpdate) RemoveRecipeIDs

func (eu *EquipmentUpdate) RemoveRecipeIDs(ids ...uuid.UUID) *EquipmentUpdate

RemoveRecipeIDs removes the "recipes" edge to Recipe entities by IDs.

func (*EquipmentUpdate) RemoveRecipes

func (eu *EquipmentUpdate) RemoveRecipes(r ...*Recipe) *EquipmentUpdate

RemoveRecipes removes "recipes" edges to Recipe entities.

func (*EquipmentUpdate) Save

func (eu *EquipmentUpdate) Save(ctx context.Context) (int, error)

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

func (*EquipmentUpdate) SaveX

func (eu *EquipmentUpdate) SaveX(ctx context.Context) int

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

func (*EquipmentUpdate) SetName

func (eu *EquipmentUpdate) SetName(s string) *EquipmentUpdate

SetName sets the "name" field.

func (*EquipmentUpdate) SetNillableName

func (eu *EquipmentUpdate) SetNillableName(s *string) *EquipmentUpdate

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

func (*EquipmentUpdate) SetNillableSlug

func (eu *EquipmentUpdate) SetNillableSlug(s *string) *EquipmentUpdate

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*EquipmentUpdate) SetSlug

func (eu *EquipmentUpdate) SetSlug(s string) *EquipmentUpdate

SetSlug sets the "slug" field.

func (*EquipmentUpdate) Where

Where appends a list predicates to the EquipmentUpdate builder.

type EquipmentUpdateOne

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

EquipmentUpdateOne is the builder for updating a single Equipment entity.

func (*EquipmentUpdateOne) AddRecipeIDs

func (euo *EquipmentUpdateOne) AddRecipeIDs(ids ...uuid.UUID) *EquipmentUpdateOne

AddRecipeIDs adds the "recipes" edge to the Recipe entity by IDs.

func (*EquipmentUpdateOne) AddRecipes

func (euo *EquipmentUpdateOne) AddRecipes(r ...*Recipe) *EquipmentUpdateOne

AddRecipes adds the "recipes" edges to the Recipe entity.

func (*EquipmentUpdateOne) ClearRecipes

func (euo *EquipmentUpdateOne) ClearRecipes() *EquipmentUpdateOne

ClearRecipes clears all "recipes" edges to the Recipe entity.

func (*EquipmentUpdateOne) Exec

func (euo *EquipmentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EquipmentUpdateOne) ExecX

func (euo *EquipmentUpdateOne) ExecX(ctx context.Context)

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

func (*EquipmentUpdateOne) Mutation

func (euo *EquipmentUpdateOne) Mutation() *EquipmentMutation

Mutation returns the EquipmentMutation object of the builder.

func (*EquipmentUpdateOne) RemoveRecipeIDs

func (euo *EquipmentUpdateOne) RemoveRecipeIDs(ids ...uuid.UUID) *EquipmentUpdateOne

RemoveRecipeIDs removes the "recipes" edge to Recipe entities by IDs.

func (*EquipmentUpdateOne) RemoveRecipes

func (euo *EquipmentUpdateOne) RemoveRecipes(r ...*Recipe) *EquipmentUpdateOne

RemoveRecipes removes "recipes" edges to Recipe entities.

func (*EquipmentUpdateOne) Save

func (euo *EquipmentUpdateOne) Save(ctx context.Context) (*Equipment, error)

Save executes the query and returns the updated Equipment entity.

func (*EquipmentUpdateOne) SaveX

func (euo *EquipmentUpdateOne) SaveX(ctx context.Context) *Equipment

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

func (*EquipmentUpdateOne) Select

func (euo *EquipmentUpdateOne) Select(field string, fields ...string) *EquipmentUpdateOne

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

func (*EquipmentUpdateOne) SetName

func (euo *EquipmentUpdateOne) SetName(s string) *EquipmentUpdateOne

SetName sets the "name" field.

func (*EquipmentUpdateOne) SetNillableName

func (euo *EquipmentUpdateOne) SetNillableName(s *string) *EquipmentUpdateOne

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

func (*EquipmentUpdateOne) SetNillableSlug

func (euo *EquipmentUpdateOne) SetNillableSlug(s *string) *EquipmentUpdateOne

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*EquipmentUpdateOne) SetSlug

func (euo *EquipmentUpdateOne) SetSlug(s string) *EquipmentUpdateOne

SetSlug sets the "slug" field.

func (*EquipmentUpdateOne) Where

Where appends a list predicates to the EquipmentUpdate builder.

type Hook

type Hook = ent.Hook

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

type Idea

type Idea struct {

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

Idea is the model entity for the Idea schema.

func (*Idea) QueryRecipe

func (i *Idea) QueryRecipe() *RecipeQuery

QueryRecipe queries the "recipe" edge of the Idea entity.

func (*Idea) String

func (i *Idea) String() string

String implements the fmt.Stringer.

func (*Idea) Unwrap

func (i *Idea) Unwrap() *Idea

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

func (i *Idea) Update() *IdeaUpdateOne

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

func (*Idea) Value

func (i *Idea) Value(name string) (ent.Value, error)

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

type IdeaClient

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

IdeaClient is a client for the Idea schema.

func NewIdeaClient

func NewIdeaClient(c config) *IdeaClient

NewIdeaClient returns a client for the Idea from the given config.

func (*IdeaClient) Create

func (c *IdeaClient) Create() *IdeaCreate

Create returns a builder for creating a Idea entity.

func (*IdeaClient) CreateBulk

func (c *IdeaClient) CreateBulk(builders ...*IdeaCreate) *IdeaCreateBulk

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

func (*IdeaClient) Delete

func (c *IdeaClient) Delete() *IdeaDelete

Delete returns a delete builder for Idea.

func (*IdeaClient) DeleteOne

func (c *IdeaClient) DeleteOne(i *Idea) *IdeaDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IdeaClient) DeleteOneID

func (c *IdeaClient) DeleteOneID(id uuid.UUID) *IdeaDeleteOne

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

func (*IdeaClient) Get

func (c *IdeaClient) Get(ctx context.Context, id uuid.UUID) (*Idea, error)

Get returns a Idea entity by its id.

func (*IdeaClient) GetX

func (c *IdeaClient) GetX(ctx context.Context, id uuid.UUID) *Idea

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

func (*IdeaClient) Hooks

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

Hooks returns the client hooks.

func (*IdeaClient) Intercept

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

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

func (*IdeaClient) Interceptors

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

Interceptors returns the client interceptors.

func (*IdeaClient) MapCreateBulk

func (c *IdeaClient) MapCreateBulk(slice any, setFunc func(*IdeaCreate, int)) *IdeaCreateBulk

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

func (*IdeaClient) Query

func (c *IdeaClient) Query() *IdeaQuery

Query returns a query builder for Idea.

func (*IdeaClient) QueryRecipe

func (c *IdeaClient) QueryRecipe(i *Idea) *RecipeQuery

QueryRecipe queries the recipe edge of a Idea.

func (*IdeaClient) Update

func (c *IdeaClient) Update() *IdeaUpdate

Update returns an update builder for Idea.

func (*IdeaClient) UpdateOne

func (c *IdeaClient) UpdateOne(i *Idea) *IdeaUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IdeaClient) UpdateOneID

func (c *IdeaClient) UpdateOneID(id uuid.UUID) *IdeaUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IdeaClient) Use

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

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

type IdeaCreate

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

IdeaCreate is the builder for creating a Idea entity.

func (*IdeaCreate) Exec

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

Exec executes the query.

func (*IdeaCreate) ExecX

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

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

func (*IdeaCreate) Mutation

func (ic *IdeaCreate) Mutation() *IdeaMutation

Mutation returns the IdeaMutation object of the builder.

func (*IdeaCreate) Save

func (ic *IdeaCreate) Save(ctx context.Context) (*Idea, error)

Save creates the Idea in the database.

func (*IdeaCreate) SaveX

func (ic *IdeaCreate) SaveX(ctx context.Context) *Idea

SaveX calls Save and panics if Save returns an error.

func (*IdeaCreate) SetID

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

SetID sets the "id" field.

func (*IdeaCreate) SetNillableID

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

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

func (*IdeaCreate) SetNillableRecipeID

func (ic *IdeaCreate) SetNillableRecipeID(id *uuid.UUID) *IdeaCreate

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*IdeaCreate) SetRecipe

func (ic *IdeaCreate) SetRecipe(r *Recipe) *IdeaCreate

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*IdeaCreate) SetRecipeID

func (ic *IdeaCreate) SetRecipeID(id uuid.UUID) *IdeaCreate

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

func (*IdeaCreate) SetText

func (ic *IdeaCreate) SetText(s string) *IdeaCreate

SetText sets the "text" field.

type IdeaCreateBulk

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

IdeaCreateBulk is the builder for creating many Idea entities in bulk.

func (*IdeaCreateBulk) Exec

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

Exec executes the query.

func (*IdeaCreateBulk) ExecX

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

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

func (*IdeaCreateBulk) Save

func (icb *IdeaCreateBulk) Save(ctx context.Context) ([]*Idea, error)

Save creates the Idea entities in the database.

func (*IdeaCreateBulk) SaveX

func (icb *IdeaCreateBulk) SaveX(ctx context.Context) []*Idea

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

type IdeaDelete

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

IdeaDelete is the builder for deleting a Idea entity.

func (*IdeaDelete) Exec

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

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

func (*IdeaDelete) ExecX

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

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

func (*IdeaDelete) Where

func (id *IdeaDelete) Where(ps ...predicate.Idea) *IdeaDelete

Where appends a list predicates to the IdeaDelete builder.

type IdeaDeleteOne

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

IdeaDeleteOne is the builder for deleting a single Idea entity.

func (*IdeaDeleteOne) Exec

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

Exec executes the deletion query.

func (*IdeaDeleteOne) ExecX

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

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

func (*IdeaDeleteOne) Where

func (ido *IdeaDeleteOne) Where(ps ...predicate.Idea) *IdeaDeleteOne

Where appends a list predicates to the IdeaDelete builder.

type IdeaEdges

type IdeaEdges struct {
	// Recipe holds the value of the recipe edge.
	Recipe *Recipe `json:"recipe,omitempty"`
	// contains filtered or unexported fields
}

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

func (IdeaEdges) RecipeOrErr

func (e IdeaEdges) RecipeOrErr() (*Recipe, error)

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

type IdeaGroupBy

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

IdeaGroupBy is the group-by builder for Idea entities.

func (*IdeaGroupBy) Aggregate

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

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

func (*IdeaGroupBy) Bool

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

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

func (*IdeaGroupBy) BoolX

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

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

func (*IdeaGroupBy) Bools

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

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

func (*IdeaGroupBy) BoolsX

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

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

func (*IdeaGroupBy) Float64

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

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

func (*IdeaGroupBy) Float64X

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

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

func (*IdeaGroupBy) Float64s

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

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

func (*IdeaGroupBy) Float64sX

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

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

func (*IdeaGroupBy) Int

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

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

func (*IdeaGroupBy) IntX

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

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

func (*IdeaGroupBy) Ints

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

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

func (*IdeaGroupBy) IntsX

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

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

func (*IdeaGroupBy) Scan

func (igb *IdeaGroupBy) Scan(ctx context.Context, v any) error

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

func (*IdeaGroupBy) ScanX

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

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

func (*IdeaGroupBy) String

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

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

func (*IdeaGroupBy) StringX

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

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

func (*IdeaGroupBy) Strings

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

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

func (*IdeaGroupBy) StringsX

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

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

type IdeaMutation

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

IdeaMutation represents an operation that mutates the Idea nodes in the graph.

func (*IdeaMutation) AddField

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

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

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

func (*IdeaMutation) AddedField

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

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

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

func (*IdeaMutation) AddedIDs

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

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

func (*IdeaMutation) ClearEdge

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

func (m *IdeaMutation) 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 (*IdeaMutation) ClearRecipe

func (m *IdeaMutation) ClearRecipe()

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*IdeaMutation) ClearedEdges

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

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

func (*IdeaMutation) ClearedFields

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

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

func (IdeaMutation) Client

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

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

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

func (*IdeaMutation) Field

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

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

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

func (*IdeaMutation) Fields

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

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

func (m *IdeaMutation) 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 (*IdeaMutation) OldField

func (m *IdeaMutation) 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 (*IdeaMutation) OldText

func (m *IdeaMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Idea entity. If the Idea 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 (*IdeaMutation) Op

func (m *IdeaMutation) Op() Op

Op returns the operation name.

func (*IdeaMutation) RecipeCleared

func (m *IdeaMutation) RecipeCleared() bool

RecipeCleared reports if the "recipe" edge to the Recipe entity was cleared.

func (*IdeaMutation) RecipeID

func (m *IdeaMutation) RecipeID() (id uuid.UUID, exists bool)

RecipeID returns the "recipe" edge ID in the mutation.

func (*IdeaMutation) RecipeIDs

func (m *IdeaMutation) RecipeIDs() (ids []uuid.UUID)

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

func (*IdeaMutation) RemovedEdges

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

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

func (*IdeaMutation) RemovedIDs

func (m *IdeaMutation) 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 (*IdeaMutation) ResetEdge

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

func (m *IdeaMutation) 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 (*IdeaMutation) ResetRecipe

func (m *IdeaMutation) ResetRecipe()

ResetRecipe resets all changes to the "recipe" edge.

func (*IdeaMutation) ResetText

func (m *IdeaMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*IdeaMutation) SetField

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

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

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

func (*IdeaMutation) SetOp

func (m *IdeaMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IdeaMutation) SetRecipeID

func (m *IdeaMutation) SetRecipeID(id uuid.UUID)

SetRecipeID sets the "recipe" edge to the Recipe entity by id.

func (*IdeaMutation) SetText

func (m *IdeaMutation) SetText(s string)

SetText sets the "text" field.

func (*IdeaMutation) Text

func (m *IdeaMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (IdeaMutation) Tx

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

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

func (*IdeaMutation) Type

func (m *IdeaMutation) Type() string

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

func (*IdeaMutation) Where

func (m *IdeaMutation) Where(ps ...predicate.Idea)

Where appends a list predicates to the IdeaMutation builder.

func (*IdeaMutation) WhereP

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

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

type IdeaQuery

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

IdeaQuery is the builder for querying Idea entities.

func (*IdeaQuery) Aggregate

func (iq *IdeaQuery) Aggregate(fns ...AggregateFunc) *IdeaSelect

Aggregate returns a IdeaSelect configured with the given aggregations.

func (*IdeaQuery) All

func (iq *IdeaQuery) All(ctx context.Context) ([]*Idea, error)

All executes the query and returns a list of Ideas.

func (*IdeaQuery) AllX

func (iq *IdeaQuery) AllX(ctx context.Context) []*Idea

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

func (*IdeaQuery) Clone

func (iq *IdeaQuery) Clone() *IdeaQuery

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

func (*IdeaQuery) Count

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

Count returns the count of the given query.

func (*IdeaQuery) CountX

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

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

func (*IdeaQuery) Exist

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

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

func (*IdeaQuery) ExistX

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

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

func (*IdeaQuery) First

func (iq *IdeaQuery) First(ctx context.Context) (*Idea, error)

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

func (*IdeaQuery) FirstID

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

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

func (*IdeaQuery) FirstIDX

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

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

func (*IdeaQuery) FirstX

func (iq *IdeaQuery) FirstX(ctx context.Context) *Idea

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

func (*IdeaQuery) GroupBy

func (iq *IdeaQuery) GroupBy(field string, fields ...string) *IdeaGroupBy

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

client.Idea.Query().
	GroupBy(idea.FieldText).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IdeaQuery) IDs

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

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

func (*IdeaQuery) IDsX

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

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

func (*IdeaQuery) Limit

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

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

func (*IdeaQuery) Offset

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

Offset to start from.

func (*IdeaQuery) Only

func (iq *IdeaQuery) Only(ctx context.Context) (*Idea, error)

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

func (*IdeaQuery) OnlyID

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

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

func (*IdeaQuery) OnlyIDX

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

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

func (*IdeaQuery) OnlyX

func (iq *IdeaQuery) OnlyX(ctx context.Context) *Idea

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

func (*IdeaQuery) Order

func (iq *IdeaQuery) Order(o ...idea.OrderOption) *IdeaQuery

Order specifies how the records should be ordered.

func (*IdeaQuery) QueryRecipe

func (iq *IdeaQuery) QueryRecipe() *RecipeQuery

QueryRecipe chains the current query on the "recipe" edge.

func (*IdeaQuery) Select

func (iq *IdeaQuery) Select(fields ...string) *IdeaSelect

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

client.Idea.Query().
	Select(idea.FieldText).
	Scan(ctx, &v)

func (*IdeaQuery) Unique

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

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

func (iq *IdeaQuery) Where(ps ...predicate.Idea) *IdeaQuery

Where adds a new predicate for the IdeaQuery builder.

func (*IdeaQuery) WithRecipe

func (iq *IdeaQuery) WithRecipe(opts ...func(*RecipeQuery)) *IdeaQuery

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

type IdeaSelect

type IdeaSelect struct {
	*IdeaQuery
	// contains filtered or unexported fields
}

IdeaSelect is the builder for selecting fields of Idea entities.

func (*IdeaSelect) Aggregate

func (is *IdeaSelect) Aggregate(fns ...AggregateFunc) *IdeaSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IdeaSelect) Bool

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

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

func (*IdeaSelect) BoolX

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

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

func (*IdeaSelect) Bools

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

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

func (*IdeaSelect) BoolsX

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

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

func (*IdeaSelect) Float64

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

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

func (*IdeaSelect) Float64X

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

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

func (*IdeaSelect) Float64s

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

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

func (*IdeaSelect) Float64sX

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

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

func (*IdeaSelect) Int

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

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

func (*IdeaSelect) IntX

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

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

func (*IdeaSelect) Ints

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

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

func (*IdeaSelect) IntsX

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

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

func (*IdeaSelect) Scan

func (is *IdeaSelect) Scan(ctx context.Context, v any) error

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

func (*IdeaSelect) ScanX

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

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

func (*IdeaSelect) String

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

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

func (*IdeaSelect) StringX

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

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

func (*IdeaSelect) Strings

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

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

func (*IdeaSelect) StringsX

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

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

type IdeaUpdate

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

IdeaUpdate is the builder for updating Idea entities.

func (*IdeaUpdate) ClearRecipe

func (iu *IdeaUpdate) ClearRecipe() *IdeaUpdate

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*IdeaUpdate) Exec

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

Exec executes the query.

func (*IdeaUpdate) ExecX

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

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

func (*IdeaUpdate) Mutation

func (iu *IdeaUpdate) Mutation() *IdeaMutation

Mutation returns the IdeaMutation object of the builder.

func (*IdeaUpdate) Save

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

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

func (*IdeaUpdate) SaveX

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

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

func (*IdeaUpdate) SetNillableRecipeID

func (iu *IdeaUpdate) SetNillableRecipeID(id *uuid.UUID) *IdeaUpdate

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*IdeaUpdate) SetNillableText

func (iu *IdeaUpdate) SetNillableText(s *string) *IdeaUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*IdeaUpdate) SetRecipe

func (iu *IdeaUpdate) SetRecipe(r *Recipe) *IdeaUpdate

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*IdeaUpdate) SetRecipeID

func (iu *IdeaUpdate) SetRecipeID(id uuid.UUID) *IdeaUpdate

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

func (*IdeaUpdate) SetText

func (iu *IdeaUpdate) SetText(s string) *IdeaUpdate

SetText sets the "text" field.

func (*IdeaUpdate) Where

func (iu *IdeaUpdate) Where(ps ...predicate.Idea) *IdeaUpdate

Where appends a list predicates to the IdeaUpdate builder.

type IdeaUpdateOne

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

IdeaUpdateOne is the builder for updating a single Idea entity.

func (*IdeaUpdateOne) ClearRecipe

func (iuo *IdeaUpdateOne) ClearRecipe() *IdeaUpdateOne

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*IdeaUpdateOne) Exec

func (iuo *IdeaUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IdeaUpdateOne) ExecX

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

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

func (*IdeaUpdateOne) Mutation

func (iuo *IdeaUpdateOne) Mutation() *IdeaMutation

Mutation returns the IdeaMutation object of the builder.

func (*IdeaUpdateOne) Save

func (iuo *IdeaUpdateOne) Save(ctx context.Context) (*Idea, error)

Save executes the query and returns the updated Idea entity.

func (*IdeaUpdateOne) SaveX

func (iuo *IdeaUpdateOne) SaveX(ctx context.Context) *Idea

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

func (*IdeaUpdateOne) Select

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

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

func (*IdeaUpdateOne) SetNillableRecipeID

func (iuo *IdeaUpdateOne) SetNillableRecipeID(id *uuid.UUID) *IdeaUpdateOne

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*IdeaUpdateOne) SetNillableText

func (iuo *IdeaUpdateOne) SetNillableText(s *string) *IdeaUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*IdeaUpdateOne) SetRecipe

func (iuo *IdeaUpdateOne) SetRecipe(r *Recipe) *IdeaUpdateOne

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*IdeaUpdateOne) SetRecipeID

func (iuo *IdeaUpdateOne) SetRecipeID(id uuid.UUID) *IdeaUpdateOne

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

func (*IdeaUpdateOne) SetText

func (iuo *IdeaUpdateOne) SetText(s string) *IdeaUpdateOne

SetText sets the "text" field.

func (*IdeaUpdateOne) Where

func (iuo *IdeaUpdateOne) Where(ps ...predicate.Idea) *IdeaUpdateOne

Where appends a list predicates to the IdeaUpdate builder.

type Ideas

type Ideas []*Idea

Ideas is a parsable slice of Idea.

type Ingredient

type Ingredient 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"`
	// Quantity holds the value of the "quantity" field.
	Quantity string `json:"quantity,omitempty"`
	// Unit holds the value of the "unit" field.
	Unit string `json:"unit,omitempty"`
	// RecipeID holds the value of the "recipe_id" field.
	RecipeID uuid.UUID `json:"recipe_id,omitempty"`
	// ProductID holds the value of the "product_id" field.
	ProductID uuid.UUID `json:"product_id,omitempty"`
	// Optional holds the value of the "optional" field.
	Optional bool `json:"optional,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the IngredientQuery when eager-loading is set.
	Edges IngredientEdges `json:"edges"`
	// contains filtered or unexported fields
}

Ingredient is the model entity for the Ingredient schema.

func (*Ingredient) QueryProduct

func (i *Ingredient) QueryProduct() *ProductQuery

QueryProduct queries the "product" edge of the Ingredient entity.

func (*Ingredient) QueryRecipe

func (i *Ingredient) QueryRecipe() *RecipeQuery

QueryRecipe queries the "recipe" edge of the Ingredient entity.

func (*Ingredient) String

func (i *Ingredient) String() string

String implements the fmt.Stringer.

func (*Ingredient) Unwrap

func (i *Ingredient) Unwrap() *Ingredient

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

func (i *Ingredient) Update() *IngredientUpdateOne

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

func (*Ingredient) Value

func (i *Ingredient) Value(name string) (ent.Value, error)

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

type IngredientClient

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

IngredientClient is a client for the Ingredient schema.

func NewIngredientClient

func NewIngredientClient(c config) *IngredientClient

NewIngredientClient returns a client for the Ingredient from the given config.

func (*IngredientClient) Create

func (c *IngredientClient) Create() *IngredientCreate

Create returns a builder for creating a Ingredient entity.

func (*IngredientClient) CreateBulk

func (c *IngredientClient) CreateBulk(builders ...*IngredientCreate) *IngredientCreateBulk

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

func (*IngredientClient) Delete

func (c *IngredientClient) Delete() *IngredientDelete

Delete returns a delete builder for Ingredient.

func (*IngredientClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IngredientClient) DeleteOneID

func (c *IngredientClient) DeleteOneID(id uuid.UUID) *IngredientDeleteOne

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

func (*IngredientClient) Get

Get returns a Ingredient entity by its id.

func (*IngredientClient) GetX

func (c *IngredientClient) GetX(ctx context.Context, id uuid.UUID) *Ingredient

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

func (*IngredientClient) Hooks

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

Hooks returns the client hooks.

func (*IngredientClient) Intercept

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

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

func (*IngredientClient) Interceptors

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

Interceptors returns the client interceptors.

func (*IngredientClient) MapCreateBulk

func (c *IngredientClient) MapCreateBulk(slice any, setFunc func(*IngredientCreate, int)) *IngredientCreateBulk

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

func (*IngredientClient) Query

func (c *IngredientClient) Query() *IngredientQuery

Query returns a query builder for Ingredient.

func (*IngredientClient) QueryProduct

func (c *IngredientClient) QueryProduct(i *Ingredient) *ProductQuery

QueryProduct queries the product edge of a Ingredient.

func (*IngredientClient) QueryRecipe

func (c *IngredientClient) QueryRecipe(i *Ingredient) *RecipeQuery

QueryRecipe queries the recipe edge of a Ingredient.

func (*IngredientClient) Update

func (c *IngredientClient) Update() *IngredientUpdate

Update returns an update builder for Ingredient.

func (*IngredientClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*IngredientClient) UpdateOneID

func (c *IngredientClient) UpdateOneID(id uuid.UUID) *IngredientUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IngredientClient) Use

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

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

type IngredientCreate

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

IngredientCreate is the builder for creating a Ingredient entity.

func (*IngredientCreate) Exec

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

Exec executes the query.

func (*IngredientCreate) ExecX

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

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

func (*IngredientCreate) Mutation

func (ic *IngredientCreate) Mutation() *IngredientMutation

Mutation returns the IngredientMutation object of the builder.

func (*IngredientCreate) Save

func (ic *IngredientCreate) Save(ctx context.Context) (*Ingredient, error)

Save creates the Ingredient in the database.

func (*IngredientCreate) SaveX

func (ic *IngredientCreate) SaveX(ctx context.Context) *Ingredient

SaveX calls Save and panics if Save returns an error.

func (*IngredientCreate) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*IngredientCreate) SetID

SetID sets the "id" field.

func (*IngredientCreate) SetNillableCreateTime

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

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

func (*IngredientCreate) SetNillableID

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

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

func (*IngredientCreate) SetNillableOptional

func (ic *IngredientCreate) SetNillableOptional(b *bool) *IngredientCreate

SetNillableOptional sets the "optional" field if the given value is not nil.

func (*IngredientCreate) SetNillableQuantity

func (ic *IngredientCreate) SetNillableQuantity(s *string) *IngredientCreate

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*IngredientCreate) SetNillableUnit

func (ic *IngredientCreate) SetNillableUnit(s *string) *IngredientCreate

SetNillableUnit sets the "unit" field if the given value is not nil.

func (*IngredientCreate) SetNillableUpdateTime

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

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

func (*IngredientCreate) SetOptional

func (ic *IngredientCreate) SetOptional(b bool) *IngredientCreate

SetOptional sets the "optional" field.

func (*IngredientCreate) SetProduct

func (ic *IngredientCreate) SetProduct(p *Product) *IngredientCreate

SetProduct sets the "product" edge to the Product entity.

func (*IngredientCreate) SetProductID

func (ic *IngredientCreate) SetProductID(u uuid.UUID) *IngredientCreate

SetProductID sets the "product_id" field.

func (*IngredientCreate) SetQuantity

func (ic *IngredientCreate) SetQuantity(s string) *IngredientCreate

SetQuantity sets the "quantity" field.

func (*IngredientCreate) SetRecipe

func (ic *IngredientCreate) SetRecipe(r *Recipe) *IngredientCreate

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*IngredientCreate) SetRecipeID

func (ic *IngredientCreate) SetRecipeID(u uuid.UUID) *IngredientCreate

SetRecipeID sets the "recipe_id" field.

func (*IngredientCreate) SetUnit

func (ic *IngredientCreate) SetUnit(s string) *IngredientCreate

SetUnit sets the "unit" field.

func (*IngredientCreate) SetUpdateTime

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

SetUpdateTime sets the "update_time" field.

type IngredientCreateBulk

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

IngredientCreateBulk is the builder for creating many Ingredient entities in bulk.

func (*IngredientCreateBulk) Exec

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

Exec executes the query.

func (*IngredientCreateBulk) ExecX

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

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

func (*IngredientCreateBulk) Save

func (icb *IngredientCreateBulk) Save(ctx context.Context) ([]*Ingredient, error)

Save creates the Ingredient entities in the database.

func (*IngredientCreateBulk) SaveX

func (icb *IngredientCreateBulk) SaveX(ctx context.Context) []*Ingredient

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

type IngredientDelete

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

IngredientDelete is the builder for deleting a Ingredient entity.

func (*IngredientDelete) Exec

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

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

func (*IngredientDelete) ExecX

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

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

func (*IngredientDelete) Where

Where appends a list predicates to the IngredientDelete builder.

type IngredientDeleteOne

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

IngredientDeleteOne is the builder for deleting a single Ingredient entity.

func (*IngredientDeleteOne) Exec

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

Exec executes the deletion query.

func (*IngredientDeleteOne) ExecX

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

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

func (*IngredientDeleteOne) Where

Where appends a list predicates to the IngredientDelete builder.

type IngredientEdges

type IngredientEdges struct {
	// Recipe holds the value of the recipe edge.
	Recipe *Recipe `json:"recipe,omitempty"`
	// Product holds the value of the product edge.
	Product *Product `json:"product,omitempty"`
	// contains filtered or unexported fields
}

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

func (IngredientEdges) ProductOrErr

func (e IngredientEdges) ProductOrErr() (*Product, error)

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

func (IngredientEdges) RecipeOrErr

func (e IngredientEdges) RecipeOrErr() (*Recipe, error)

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

type IngredientGroupBy

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

IngredientGroupBy is the group-by builder for Ingredient entities.

func (*IngredientGroupBy) Aggregate

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

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

func (*IngredientGroupBy) Bool

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

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

func (*IngredientGroupBy) BoolX

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

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

func (*IngredientGroupBy) Bools

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

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

func (*IngredientGroupBy) BoolsX

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

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

func (*IngredientGroupBy) Float64

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

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

func (*IngredientGroupBy) Float64X

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

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

func (*IngredientGroupBy) Float64s

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

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

func (*IngredientGroupBy) Float64sX

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

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

func (*IngredientGroupBy) Int

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

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

func (*IngredientGroupBy) IntX

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

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

func (*IngredientGroupBy) Ints

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

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

func (*IngredientGroupBy) IntsX

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

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

func (*IngredientGroupBy) Scan

func (igb *IngredientGroupBy) Scan(ctx context.Context, v any) error

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

func (*IngredientGroupBy) ScanX

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

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

func (*IngredientGroupBy) String

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

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

func (*IngredientGroupBy) StringX

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

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

func (*IngredientGroupBy) Strings

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

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

func (*IngredientGroupBy) StringsX

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

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

type IngredientMutation

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

IngredientMutation represents an operation that mutates the Ingredient nodes in the graph.

func (*IngredientMutation) AddField

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

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

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

func (*IngredientMutation) AddedField

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

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

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

func (*IngredientMutation) AddedIDs

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

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

func (*IngredientMutation) ClearEdge

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

func (m *IngredientMutation) 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 (*IngredientMutation) ClearProduct

func (m *IngredientMutation) ClearProduct()

ClearProduct clears the "product" edge to the Product entity.

func (*IngredientMutation) ClearQuantity

func (m *IngredientMutation) ClearQuantity()

ClearQuantity clears the value of the "quantity" field.

func (*IngredientMutation) ClearRecipe

func (m *IngredientMutation) ClearRecipe()

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*IngredientMutation) ClearUnit

func (m *IngredientMutation) ClearUnit()

ClearUnit clears the value of the "unit" field.

func (*IngredientMutation) ClearedEdges

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

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

func (*IngredientMutation) ClearedFields

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

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

func (IngredientMutation) Client

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

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

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

func (*IngredientMutation) EdgeCleared

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

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

func (*IngredientMutation) Field

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

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

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

func (*IngredientMutation) Fields

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

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

func (m *IngredientMutation) 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 (*IngredientMutation) OldCreateTime

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

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

func (m *IngredientMutation) 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 (*IngredientMutation) OldOptional

func (m *IngredientMutation) OldOptional(ctx context.Context) (v bool, err error)

OldOptional returns the old "optional" field's value of the Ingredient entity. If the Ingredient 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 (*IngredientMutation) OldProductID

func (m *IngredientMutation) OldProductID(ctx context.Context) (v uuid.UUID, err error)

OldProductID returns the old "product_id" field's value of the Ingredient entity. If the Ingredient 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 (*IngredientMutation) OldQuantity

func (m *IngredientMutation) OldQuantity(ctx context.Context) (v string, err error)

OldQuantity returns the old "quantity" field's value of the Ingredient entity. If the Ingredient 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 (*IngredientMutation) OldRecipeID

func (m *IngredientMutation) OldRecipeID(ctx context.Context) (v uuid.UUID, err error)

OldRecipeID returns the old "recipe_id" field's value of the Ingredient entity. If the Ingredient 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 (*IngredientMutation) OldUnit

func (m *IngredientMutation) OldUnit(ctx context.Context) (v string, err error)

OldUnit returns the old "unit" field's value of the Ingredient entity. If the Ingredient 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 (*IngredientMutation) OldUpdateTime

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

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

func (m *IngredientMutation) Op() Op

Op returns the operation name.

func (*IngredientMutation) Optional

func (m *IngredientMutation) Optional() (r bool, exists bool)

Optional returns the value of the "optional" field in the mutation.

func (*IngredientMutation) ProductCleared

func (m *IngredientMutation) ProductCleared() bool

ProductCleared reports if the "product" edge to the Product entity was cleared.

func (*IngredientMutation) ProductID

func (m *IngredientMutation) ProductID() (r uuid.UUID, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*IngredientMutation) ProductIDs

func (m *IngredientMutation) ProductIDs() (ids []uuid.UUID)

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

func (*IngredientMutation) Quantity

func (m *IngredientMutation) Quantity() (r string, exists bool)

Quantity returns the value of the "quantity" field in the mutation.

func (*IngredientMutation) QuantityCleared

func (m *IngredientMutation) QuantityCleared() bool

QuantityCleared returns if the "quantity" field was cleared in this mutation.

func (*IngredientMutation) RecipeCleared

func (m *IngredientMutation) RecipeCleared() bool

RecipeCleared reports if the "recipe" edge to the Recipe entity was cleared.

func (*IngredientMutation) RecipeID

func (m *IngredientMutation) RecipeID() (r uuid.UUID, exists bool)

RecipeID returns the value of the "recipe_id" field in the mutation.

func (*IngredientMutation) RecipeIDs

func (m *IngredientMutation) RecipeIDs() (ids []uuid.UUID)

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

func (*IngredientMutation) RemovedEdges

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

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

func (*IngredientMutation) RemovedIDs

func (m *IngredientMutation) 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 (*IngredientMutation) ResetCreateTime

func (m *IngredientMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*IngredientMutation) ResetEdge

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

func (m *IngredientMutation) 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 (*IngredientMutation) ResetOptional

func (m *IngredientMutation) ResetOptional()

ResetOptional resets all changes to the "optional" field.

func (*IngredientMutation) ResetProduct

func (m *IngredientMutation) ResetProduct()

ResetProduct resets all changes to the "product" edge.

func (*IngredientMutation) ResetProductID

func (m *IngredientMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*IngredientMutation) ResetQuantity

func (m *IngredientMutation) ResetQuantity()

ResetQuantity resets all changes to the "quantity" field.

func (*IngredientMutation) ResetRecipe

func (m *IngredientMutation) ResetRecipe()

ResetRecipe resets all changes to the "recipe" edge.

func (*IngredientMutation) ResetRecipeID

func (m *IngredientMutation) ResetRecipeID()

ResetRecipeID resets all changes to the "recipe_id" field.

func (*IngredientMutation) ResetUnit

func (m *IngredientMutation) ResetUnit()

ResetUnit resets all changes to the "unit" field.

func (*IngredientMutation) ResetUpdateTime

func (m *IngredientMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*IngredientMutation) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*IngredientMutation) SetField

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

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

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

func (*IngredientMutation) SetOp

func (m *IngredientMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IngredientMutation) SetOptional

func (m *IngredientMutation) SetOptional(b bool)

SetOptional sets the "optional" field.

func (*IngredientMutation) SetProductID

func (m *IngredientMutation) SetProductID(u uuid.UUID)

SetProductID sets the "product_id" field.

func (*IngredientMutation) SetQuantity

func (m *IngredientMutation) SetQuantity(s string)

SetQuantity sets the "quantity" field.

func (*IngredientMutation) SetRecipeID

func (m *IngredientMutation) SetRecipeID(u uuid.UUID)

SetRecipeID sets the "recipe_id" field.

func (*IngredientMutation) SetUnit

func (m *IngredientMutation) SetUnit(s string)

SetUnit sets the "unit" field.

func (*IngredientMutation) SetUpdateTime

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

SetUpdateTime sets the "update_time" field.

func (IngredientMutation) Tx

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

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

func (*IngredientMutation) Type

func (m *IngredientMutation) Type() string

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

func (*IngredientMutation) Unit

func (m *IngredientMutation) Unit() (r string, exists bool)

Unit returns the value of the "unit" field in the mutation.

func (*IngredientMutation) UnitCleared

func (m *IngredientMutation) UnitCleared() bool

UnitCleared returns if the "unit" field was cleared in this mutation.

func (*IngredientMutation) UpdateTime

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

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

func (*IngredientMutation) Where

func (m *IngredientMutation) Where(ps ...predicate.Ingredient)

Where appends a list predicates to the IngredientMutation builder.

func (*IngredientMutation) WhereP

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

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

type IngredientQuery

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

IngredientQuery is the builder for querying Ingredient entities.

func (*IngredientQuery) Aggregate

func (iq *IngredientQuery) Aggregate(fns ...AggregateFunc) *IngredientSelect

Aggregate returns a IngredientSelect configured with the given aggregations.

func (*IngredientQuery) All

func (iq *IngredientQuery) All(ctx context.Context) ([]*Ingredient, error)

All executes the query and returns a list of Ingredients.

func (*IngredientQuery) AllX

func (iq *IngredientQuery) AllX(ctx context.Context) []*Ingredient

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

func (*IngredientQuery) Clone

func (iq *IngredientQuery) Clone() *IngredientQuery

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

func (*IngredientQuery) Count

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

Count returns the count of the given query.

func (*IngredientQuery) CountX

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

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

func (*IngredientQuery) Exist

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

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

func (*IngredientQuery) ExistX

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

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

func (*IngredientQuery) First

func (iq *IngredientQuery) First(ctx context.Context) (*Ingredient, error)

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

func (*IngredientQuery) FirstID

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

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

func (*IngredientQuery) FirstIDX

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

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

func (*IngredientQuery) FirstX

func (iq *IngredientQuery) FirstX(ctx context.Context) *Ingredient

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

func (*IngredientQuery) GroupBy

func (iq *IngredientQuery) GroupBy(field string, fields ...string) *IngredientGroupBy

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.Ingredient.Query().
	GroupBy(ingredient.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IngredientQuery) IDs

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

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

func (*IngredientQuery) IDsX

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

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

func (*IngredientQuery) Limit

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

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

func (*IngredientQuery) Offset

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

Offset to start from.

func (*IngredientQuery) Only

func (iq *IngredientQuery) Only(ctx context.Context) (*Ingredient, error)

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

func (*IngredientQuery) OnlyID

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

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

func (*IngredientQuery) OnlyIDX

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

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

func (*IngredientQuery) OnlyX

func (iq *IngredientQuery) OnlyX(ctx context.Context) *Ingredient

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

func (*IngredientQuery) Order

Order specifies how the records should be ordered.

func (*IngredientQuery) QueryProduct

func (iq *IngredientQuery) QueryProduct() *ProductQuery

QueryProduct chains the current query on the "product" edge.

func (*IngredientQuery) QueryRecipe

func (iq *IngredientQuery) QueryRecipe() *RecipeQuery

QueryRecipe chains the current query on the "recipe" edge.

func (*IngredientQuery) Select

func (iq *IngredientQuery) Select(fields ...string) *IngredientSelect

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.Ingredient.Query().
	Select(ingredient.FieldCreateTime).
	Scan(ctx, &v)

func (*IngredientQuery) Unique

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

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

Where adds a new predicate for the IngredientQuery builder.

func (*IngredientQuery) WithProduct

func (iq *IngredientQuery) WithProduct(opts ...func(*ProductQuery)) *IngredientQuery

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

func (*IngredientQuery) WithRecipe

func (iq *IngredientQuery) WithRecipe(opts ...func(*RecipeQuery)) *IngredientQuery

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

type IngredientSelect

type IngredientSelect struct {
	*IngredientQuery
	// contains filtered or unexported fields
}

IngredientSelect is the builder for selecting fields of Ingredient entities.

func (*IngredientSelect) Aggregate

func (is *IngredientSelect) Aggregate(fns ...AggregateFunc) *IngredientSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IngredientSelect) Bool

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

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

func (*IngredientSelect) BoolX

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

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

func (*IngredientSelect) Bools

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

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

func (*IngredientSelect) BoolsX

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

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

func (*IngredientSelect) Float64

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

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

func (*IngredientSelect) Float64X

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

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

func (*IngredientSelect) Float64s

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

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

func (*IngredientSelect) Float64sX

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

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

func (*IngredientSelect) Int

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

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

func (*IngredientSelect) IntX

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

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

func (*IngredientSelect) Ints

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

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

func (*IngredientSelect) IntsX

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

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

func (*IngredientSelect) Scan

func (is *IngredientSelect) Scan(ctx context.Context, v any) error

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

func (*IngredientSelect) ScanX

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

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

func (*IngredientSelect) String

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

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

func (*IngredientSelect) StringX

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

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

func (*IngredientSelect) Strings

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

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

func (*IngredientSelect) StringsX

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

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

type IngredientUpdate

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

IngredientUpdate is the builder for updating Ingredient entities.

func (*IngredientUpdate) ClearProduct

func (iu *IngredientUpdate) ClearProduct() *IngredientUpdate

ClearProduct clears the "product" edge to the Product entity.

func (*IngredientUpdate) ClearQuantity

func (iu *IngredientUpdate) ClearQuantity() *IngredientUpdate

ClearQuantity clears the value of the "quantity" field.

func (*IngredientUpdate) ClearRecipe

func (iu *IngredientUpdate) ClearRecipe() *IngredientUpdate

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*IngredientUpdate) ClearUnit

func (iu *IngredientUpdate) ClearUnit() *IngredientUpdate

ClearUnit clears the value of the "unit" field.

func (*IngredientUpdate) Exec

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

Exec executes the query.

func (*IngredientUpdate) ExecX

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

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

func (*IngredientUpdate) Mutation

func (iu *IngredientUpdate) Mutation() *IngredientMutation

Mutation returns the IngredientMutation object of the builder.

func (*IngredientUpdate) Save

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

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

func (*IngredientUpdate) SaveX

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

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

func (*IngredientUpdate) SetNillableOptional

func (iu *IngredientUpdate) SetNillableOptional(b *bool) *IngredientUpdate

SetNillableOptional sets the "optional" field if the given value is not nil.

func (*IngredientUpdate) SetNillableProductID

func (iu *IngredientUpdate) SetNillableProductID(u *uuid.UUID) *IngredientUpdate

SetNillableProductID sets the "product_id" field if the given value is not nil.

func (*IngredientUpdate) SetNillableQuantity

func (iu *IngredientUpdate) SetNillableQuantity(s *string) *IngredientUpdate

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*IngredientUpdate) SetNillableRecipeID

func (iu *IngredientUpdate) SetNillableRecipeID(u *uuid.UUID) *IngredientUpdate

SetNillableRecipeID sets the "recipe_id" field if the given value is not nil.

func (*IngredientUpdate) SetNillableUnit

func (iu *IngredientUpdate) SetNillableUnit(s *string) *IngredientUpdate

SetNillableUnit sets the "unit" field if the given value is not nil.

func (*IngredientUpdate) SetOptional

func (iu *IngredientUpdate) SetOptional(b bool) *IngredientUpdate

SetOptional sets the "optional" field.

func (*IngredientUpdate) SetProduct

func (iu *IngredientUpdate) SetProduct(p *Product) *IngredientUpdate

SetProduct sets the "product" edge to the Product entity.

func (*IngredientUpdate) SetProductID

func (iu *IngredientUpdate) SetProductID(u uuid.UUID) *IngredientUpdate

SetProductID sets the "product_id" field.

func (*IngredientUpdate) SetQuantity

func (iu *IngredientUpdate) SetQuantity(s string) *IngredientUpdate

SetQuantity sets the "quantity" field.

func (*IngredientUpdate) SetRecipe

func (iu *IngredientUpdate) SetRecipe(r *Recipe) *IngredientUpdate

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*IngredientUpdate) SetRecipeID

func (iu *IngredientUpdate) SetRecipeID(u uuid.UUID) *IngredientUpdate

SetRecipeID sets the "recipe_id" field.

func (*IngredientUpdate) SetUnit

func (iu *IngredientUpdate) SetUnit(s string) *IngredientUpdate

SetUnit sets the "unit" field.

func (*IngredientUpdate) SetUpdateTime

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

SetUpdateTime sets the "update_time" field.

func (*IngredientUpdate) Where

Where appends a list predicates to the IngredientUpdate builder.

type IngredientUpdateOne

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

IngredientUpdateOne is the builder for updating a single Ingredient entity.

func (*IngredientUpdateOne) ClearProduct

func (iuo *IngredientUpdateOne) ClearProduct() *IngredientUpdateOne

ClearProduct clears the "product" edge to the Product entity.

func (*IngredientUpdateOne) ClearQuantity

func (iuo *IngredientUpdateOne) ClearQuantity() *IngredientUpdateOne

ClearQuantity clears the value of the "quantity" field.

func (*IngredientUpdateOne) ClearRecipe

func (iuo *IngredientUpdateOne) ClearRecipe() *IngredientUpdateOne

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*IngredientUpdateOne) ClearUnit

func (iuo *IngredientUpdateOne) ClearUnit() *IngredientUpdateOne

ClearUnit clears the value of the "unit" field.

func (*IngredientUpdateOne) Exec

func (iuo *IngredientUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IngredientUpdateOne) ExecX

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

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

func (*IngredientUpdateOne) Mutation

func (iuo *IngredientUpdateOne) Mutation() *IngredientMutation

Mutation returns the IngredientMutation object of the builder.

func (*IngredientUpdateOne) Save

func (iuo *IngredientUpdateOne) Save(ctx context.Context) (*Ingredient, error)

Save executes the query and returns the updated Ingredient entity.

func (*IngredientUpdateOne) SaveX

func (iuo *IngredientUpdateOne) SaveX(ctx context.Context) *Ingredient

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

func (*IngredientUpdateOne) Select

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

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

func (*IngredientUpdateOne) SetNillableOptional

func (iuo *IngredientUpdateOne) SetNillableOptional(b *bool) *IngredientUpdateOne

SetNillableOptional sets the "optional" field if the given value is not nil.

func (*IngredientUpdateOne) SetNillableProductID

func (iuo *IngredientUpdateOne) SetNillableProductID(u *uuid.UUID) *IngredientUpdateOne

SetNillableProductID sets the "product_id" field if the given value is not nil.

func (*IngredientUpdateOne) SetNillableQuantity

func (iuo *IngredientUpdateOne) SetNillableQuantity(s *string) *IngredientUpdateOne

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*IngredientUpdateOne) SetNillableRecipeID

func (iuo *IngredientUpdateOne) SetNillableRecipeID(u *uuid.UUID) *IngredientUpdateOne

SetNillableRecipeID sets the "recipe_id" field if the given value is not nil.

func (*IngredientUpdateOne) SetNillableUnit

func (iuo *IngredientUpdateOne) SetNillableUnit(s *string) *IngredientUpdateOne

SetNillableUnit sets the "unit" field if the given value is not nil.

func (*IngredientUpdateOne) SetOptional

func (iuo *IngredientUpdateOne) SetOptional(b bool) *IngredientUpdateOne

SetOptional sets the "optional" field.

func (*IngredientUpdateOne) SetProduct

func (iuo *IngredientUpdateOne) SetProduct(p *Product) *IngredientUpdateOne

SetProduct sets the "product" edge to the Product entity.

func (*IngredientUpdateOne) SetProductID

func (iuo *IngredientUpdateOne) SetProductID(u uuid.UUID) *IngredientUpdateOne

SetProductID sets the "product_id" field.

func (*IngredientUpdateOne) SetQuantity

func (iuo *IngredientUpdateOne) SetQuantity(s string) *IngredientUpdateOne

SetQuantity sets the "quantity" field.

func (*IngredientUpdateOne) SetRecipe

func (iuo *IngredientUpdateOne) SetRecipe(r *Recipe) *IngredientUpdateOne

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*IngredientUpdateOne) SetRecipeID

func (iuo *IngredientUpdateOne) SetRecipeID(u uuid.UUID) *IngredientUpdateOne

SetRecipeID sets the "recipe_id" field.

func (*IngredientUpdateOne) SetUnit

SetUnit sets the "unit" field.

func (*IngredientUpdateOne) SetUpdateTime

func (iuo *IngredientUpdateOne) SetUpdateTime(t time.Time) *IngredientUpdateOne

SetUpdateTime sets the "update_time" field.

func (*IngredientUpdateOne) Where

Where appends a list predicates to the IngredientUpdate builder.

type Ingredients

type Ingredients []*Ingredient

Ingredients is a parsable slice of Ingredient.

type Instruction

type Instruction struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// Order holds the value of the "order" field.
	Order int `json:"order,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InstructionQuery when eager-loading is set.
	Edges InstructionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Instruction is the model entity for the Instruction schema.

func (*Instruction) QueryRecipe

func (i *Instruction) QueryRecipe() *RecipeQuery

QueryRecipe queries the "recipe" edge of the Instruction entity.

func (*Instruction) String

func (i *Instruction) String() string

String implements the fmt.Stringer.

func (*Instruction) Unwrap

func (i *Instruction) Unwrap() *Instruction

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

func (i *Instruction) Update() *InstructionUpdateOne

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

func (*Instruction) Value

func (i *Instruction) Value(name string) (ent.Value, error)

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

type InstructionClient

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

InstructionClient is a client for the Instruction schema.

func NewInstructionClient

func NewInstructionClient(c config) *InstructionClient

NewInstructionClient returns a client for the Instruction from the given config.

func (*InstructionClient) Create

func (c *InstructionClient) Create() *InstructionCreate

Create returns a builder for creating a Instruction entity.

func (*InstructionClient) CreateBulk

func (c *InstructionClient) CreateBulk(builders ...*InstructionCreate) *InstructionCreateBulk

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

func (*InstructionClient) Delete

func (c *InstructionClient) Delete() *InstructionDelete

Delete returns a delete builder for Instruction.

func (*InstructionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InstructionClient) DeleteOneID

func (c *InstructionClient) DeleteOneID(id uuid.UUID) *InstructionDeleteOne

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

func (*InstructionClient) Get

Get returns a Instruction entity by its id.

func (*InstructionClient) GetX

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

func (*InstructionClient) Hooks

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

Hooks returns the client hooks.

func (*InstructionClient) Intercept

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

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

func (*InstructionClient) Interceptors

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

Interceptors returns the client interceptors.

func (*InstructionClient) MapCreateBulk

func (c *InstructionClient) MapCreateBulk(slice any, setFunc func(*InstructionCreate, int)) *InstructionCreateBulk

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

func (*InstructionClient) Query

func (c *InstructionClient) Query() *InstructionQuery

Query returns a query builder for Instruction.

func (*InstructionClient) QueryRecipe

func (c *InstructionClient) QueryRecipe(i *Instruction) *RecipeQuery

QueryRecipe queries the recipe edge of a Instruction.

func (*InstructionClient) Update

func (c *InstructionClient) Update() *InstructionUpdate

Update returns an update builder for Instruction.

func (*InstructionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*InstructionClient) UpdateOneID

func (c *InstructionClient) UpdateOneID(id uuid.UUID) *InstructionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*InstructionClient) Use

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

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

type InstructionCreate

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

InstructionCreate is the builder for creating a Instruction entity.

func (*InstructionCreate) Exec

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

Exec executes the query.

func (*InstructionCreate) ExecX

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

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

func (*InstructionCreate) Mutation

func (ic *InstructionCreate) Mutation() *InstructionMutation

Mutation returns the InstructionMutation object of the builder.

func (*InstructionCreate) Save

Save creates the Instruction in the database.

func (*InstructionCreate) SaveX

func (ic *InstructionCreate) SaveX(ctx context.Context) *Instruction

SaveX calls Save and panics if Save returns an error.

func (*InstructionCreate) SetID

SetID sets the "id" field.

func (*InstructionCreate) SetNillableID

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

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

func (*InstructionCreate) SetNillableRecipeID

func (ic *InstructionCreate) SetNillableRecipeID(id *uuid.UUID) *InstructionCreate

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*InstructionCreate) SetOrder

func (ic *InstructionCreate) SetOrder(i int) *InstructionCreate

SetOrder sets the "order" field.

func (*InstructionCreate) SetRecipe

func (ic *InstructionCreate) SetRecipe(r *Recipe) *InstructionCreate

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*InstructionCreate) SetRecipeID

func (ic *InstructionCreate) SetRecipeID(id uuid.UUID) *InstructionCreate

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

func (*InstructionCreate) SetText

func (ic *InstructionCreate) SetText(s string) *InstructionCreate

SetText sets the "text" field.

type InstructionCreateBulk

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

InstructionCreateBulk is the builder for creating many Instruction entities in bulk.

func (*InstructionCreateBulk) Exec

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

Exec executes the query.

func (*InstructionCreateBulk) ExecX

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

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

func (*InstructionCreateBulk) Save

func (icb *InstructionCreateBulk) Save(ctx context.Context) ([]*Instruction, error)

Save creates the Instruction entities in the database.

func (*InstructionCreateBulk) SaveX

func (icb *InstructionCreateBulk) SaveX(ctx context.Context) []*Instruction

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

type InstructionDelete

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

InstructionDelete is the builder for deleting a Instruction entity.

func (*InstructionDelete) Exec

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

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

func (*InstructionDelete) ExecX

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

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

func (*InstructionDelete) Where

Where appends a list predicates to the InstructionDelete builder.

type InstructionDeleteOne

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

InstructionDeleteOne is the builder for deleting a single Instruction entity.

func (*InstructionDeleteOne) Exec

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

Exec executes the deletion query.

func (*InstructionDeleteOne) ExecX

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

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

func (*InstructionDeleteOne) Where

Where appends a list predicates to the InstructionDelete builder.

type InstructionEdges

type InstructionEdges struct {
	// Recipe holds the value of the recipe edge.
	Recipe *Recipe `json:"recipe,omitempty"`
	// contains filtered or unexported fields
}

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

func (InstructionEdges) RecipeOrErr

func (e InstructionEdges) RecipeOrErr() (*Recipe, error)

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

type InstructionGroupBy

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

InstructionGroupBy is the group-by builder for Instruction entities.

func (*InstructionGroupBy) Aggregate

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

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

func (*InstructionGroupBy) Bool

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

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

func (*InstructionGroupBy) BoolX

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

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

func (*InstructionGroupBy) Bools

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

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

func (*InstructionGroupBy) BoolsX

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

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

func (*InstructionGroupBy) Float64

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

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

func (*InstructionGroupBy) Float64X

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

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

func (*InstructionGroupBy) Float64s

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

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

func (*InstructionGroupBy) Float64sX

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

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

func (*InstructionGroupBy) Int

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

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

func (*InstructionGroupBy) IntX

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

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

func (*InstructionGroupBy) Ints

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

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

func (*InstructionGroupBy) IntsX

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

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

func (*InstructionGroupBy) Scan

func (igb *InstructionGroupBy) Scan(ctx context.Context, v any) error

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

func (*InstructionGroupBy) ScanX

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

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

func (*InstructionGroupBy) String

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

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

func (*InstructionGroupBy) StringX

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

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

func (*InstructionGroupBy) Strings

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

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

func (*InstructionGroupBy) StringsX

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

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

type InstructionMutation

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

InstructionMutation represents an operation that mutates the Instruction nodes in the graph.

func (*InstructionMutation) AddField

func (m *InstructionMutation) 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 (*InstructionMutation) AddOrder

func (m *InstructionMutation) AddOrder(i int)

AddOrder adds i to the "order" field.

func (*InstructionMutation) AddedEdges

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

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

func (*InstructionMutation) AddedField

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

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

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

func (*InstructionMutation) AddedIDs

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

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

func (*InstructionMutation) AddedOrder

func (m *InstructionMutation) AddedOrder() (r int, exists bool)

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

func (*InstructionMutation) ClearEdge

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

func (m *InstructionMutation) 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 (*InstructionMutation) ClearRecipe

func (m *InstructionMutation) ClearRecipe()

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*InstructionMutation) ClearedEdges

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

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

func (*InstructionMutation) ClearedFields

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

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

func (InstructionMutation) Client

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

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

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

func (*InstructionMutation) Field

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

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

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

func (*InstructionMutation) Fields

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

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

func (m *InstructionMutation) 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 (*InstructionMutation) OldField

func (m *InstructionMutation) 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 (*InstructionMutation) OldOrder

func (m *InstructionMutation) OldOrder(ctx context.Context) (v int, err error)

OldOrder returns the old "order" field's value of the Instruction entity. If the Instruction 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 (*InstructionMutation) OldText

func (m *InstructionMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Instruction entity. If the Instruction 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 (*InstructionMutation) Op

func (m *InstructionMutation) Op() Op

Op returns the operation name.

func (*InstructionMutation) Order

func (m *InstructionMutation) Order() (r int, exists bool)

Order returns the value of the "order" field in the mutation.

func (*InstructionMutation) RecipeCleared

func (m *InstructionMutation) RecipeCleared() bool

RecipeCleared reports if the "recipe" edge to the Recipe entity was cleared.

func (*InstructionMutation) RecipeID

func (m *InstructionMutation) RecipeID() (id uuid.UUID, exists bool)

RecipeID returns the "recipe" edge ID in the mutation.

func (*InstructionMutation) RecipeIDs

func (m *InstructionMutation) RecipeIDs() (ids []uuid.UUID)

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

func (*InstructionMutation) RemovedEdges

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

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

func (*InstructionMutation) RemovedIDs

func (m *InstructionMutation) 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 (*InstructionMutation) ResetEdge

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

func (m *InstructionMutation) 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 (*InstructionMutation) ResetOrder

func (m *InstructionMutation) ResetOrder()

ResetOrder resets all changes to the "order" field.

func (*InstructionMutation) ResetRecipe

func (m *InstructionMutation) ResetRecipe()

ResetRecipe resets all changes to the "recipe" edge.

func (*InstructionMutation) ResetText

func (m *InstructionMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*InstructionMutation) SetField

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

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

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

func (*InstructionMutation) SetOp

func (m *InstructionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InstructionMutation) SetOrder

func (m *InstructionMutation) SetOrder(i int)

SetOrder sets the "order" field.

func (*InstructionMutation) SetRecipeID

func (m *InstructionMutation) SetRecipeID(id uuid.UUID)

SetRecipeID sets the "recipe" edge to the Recipe entity by id.

func (*InstructionMutation) SetText

func (m *InstructionMutation) SetText(s string)

SetText sets the "text" field.

func (*InstructionMutation) Text

func (m *InstructionMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (InstructionMutation) Tx

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

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

func (*InstructionMutation) Type

func (m *InstructionMutation) Type() string

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

func (*InstructionMutation) Where

func (m *InstructionMutation) Where(ps ...predicate.Instruction)

Where appends a list predicates to the InstructionMutation builder.

func (*InstructionMutation) WhereP

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

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

type InstructionQuery

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

InstructionQuery is the builder for querying Instruction entities.

func (*InstructionQuery) Aggregate

func (iq *InstructionQuery) Aggregate(fns ...AggregateFunc) *InstructionSelect

Aggregate returns a InstructionSelect configured with the given aggregations.

func (*InstructionQuery) All

func (iq *InstructionQuery) All(ctx context.Context) ([]*Instruction, error)

All executes the query and returns a list of Instructions.

func (*InstructionQuery) AllX

func (iq *InstructionQuery) AllX(ctx context.Context) []*Instruction

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

func (*InstructionQuery) Clone

func (iq *InstructionQuery) Clone() *InstructionQuery

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

func (*InstructionQuery) Count

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

Count returns the count of the given query.

func (*InstructionQuery) CountX

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

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

func (*InstructionQuery) Exist

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

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

func (*InstructionQuery) ExistX

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

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

func (*InstructionQuery) First

func (iq *InstructionQuery) First(ctx context.Context) (*Instruction, error)

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

func (*InstructionQuery) FirstID

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

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

func (*InstructionQuery) FirstIDX

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

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

func (*InstructionQuery) FirstX

func (iq *InstructionQuery) FirstX(ctx context.Context) *Instruction

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

func (*InstructionQuery) GroupBy

func (iq *InstructionQuery) GroupBy(field string, fields ...string) *InstructionGroupBy

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

client.Instruction.Query().
	GroupBy(instruction.FieldText).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InstructionQuery) IDs

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

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

func (*InstructionQuery) IDsX

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

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

func (*InstructionQuery) Limit

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

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

func (*InstructionQuery) Offset

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

Offset to start from.

func (*InstructionQuery) Only

func (iq *InstructionQuery) Only(ctx context.Context) (*Instruction, error)

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

func (*InstructionQuery) OnlyID

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

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

func (*InstructionQuery) OnlyIDX

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

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

func (*InstructionQuery) OnlyX

func (iq *InstructionQuery) OnlyX(ctx context.Context) *Instruction

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

func (*InstructionQuery) Order

Order specifies how the records should be ordered.

func (*InstructionQuery) QueryRecipe

func (iq *InstructionQuery) QueryRecipe() *RecipeQuery

QueryRecipe chains the current query on the "recipe" edge.

func (*InstructionQuery) Select

func (iq *InstructionQuery) Select(fields ...string) *InstructionSelect

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

client.Instruction.Query().
	Select(instruction.FieldText).
	Scan(ctx, &v)

func (*InstructionQuery) Unique

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

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

Where adds a new predicate for the InstructionQuery builder.

func (*InstructionQuery) WithRecipe

func (iq *InstructionQuery) WithRecipe(opts ...func(*RecipeQuery)) *InstructionQuery

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

type InstructionSelect

type InstructionSelect struct {
	*InstructionQuery
	// contains filtered or unexported fields
}

InstructionSelect is the builder for selecting fields of Instruction entities.

func (*InstructionSelect) Aggregate

func (is *InstructionSelect) Aggregate(fns ...AggregateFunc) *InstructionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*InstructionSelect) Bool

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

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

func (*InstructionSelect) BoolX

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

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

func (*InstructionSelect) Bools

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

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

func (*InstructionSelect) BoolsX

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

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

func (*InstructionSelect) Float64

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

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

func (*InstructionSelect) Float64X

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

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

func (*InstructionSelect) Float64s

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

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

func (*InstructionSelect) Float64sX

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

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

func (*InstructionSelect) Int

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

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

func (*InstructionSelect) IntX

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

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

func (*InstructionSelect) Ints

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

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

func (*InstructionSelect) IntsX

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

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

func (*InstructionSelect) Scan

func (is *InstructionSelect) Scan(ctx context.Context, v any) error

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

func (*InstructionSelect) ScanX

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

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

func (*InstructionSelect) String

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

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

func (*InstructionSelect) StringX

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

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

func (*InstructionSelect) Strings

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

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

func (*InstructionSelect) StringsX

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

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

type InstructionUpdate

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

InstructionUpdate is the builder for updating Instruction entities.

func (*InstructionUpdate) AddOrder

func (iu *InstructionUpdate) AddOrder(i int) *InstructionUpdate

AddOrder adds i to the "order" field.

func (*InstructionUpdate) ClearRecipe

func (iu *InstructionUpdate) ClearRecipe() *InstructionUpdate

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*InstructionUpdate) Exec

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

Exec executes the query.

func (*InstructionUpdate) ExecX

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

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

func (*InstructionUpdate) Mutation

func (iu *InstructionUpdate) Mutation() *InstructionMutation

Mutation returns the InstructionMutation object of the builder.

func (*InstructionUpdate) Save

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

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

func (*InstructionUpdate) SaveX

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

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

func (*InstructionUpdate) SetNillableOrder

func (iu *InstructionUpdate) SetNillableOrder(i *int) *InstructionUpdate

SetNillableOrder sets the "order" field if the given value is not nil.

func (*InstructionUpdate) SetNillableRecipeID

func (iu *InstructionUpdate) SetNillableRecipeID(id *uuid.UUID) *InstructionUpdate

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*InstructionUpdate) SetNillableText

func (iu *InstructionUpdate) SetNillableText(s *string) *InstructionUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*InstructionUpdate) SetOrder

func (iu *InstructionUpdate) SetOrder(i int) *InstructionUpdate

SetOrder sets the "order" field.

func (*InstructionUpdate) SetRecipe

func (iu *InstructionUpdate) SetRecipe(r *Recipe) *InstructionUpdate

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*InstructionUpdate) SetRecipeID

func (iu *InstructionUpdate) SetRecipeID(id uuid.UUID) *InstructionUpdate

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

func (*InstructionUpdate) SetText

func (iu *InstructionUpdate) SetText(s string) *InstructionUpdate

SetText sets the "text" field.

func (*InstructionUpdate) Where

Where appends a list predicates to the InstructionUpdate builder.

type InstructionUpdateOne

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

InstructionUpdateOne is the builder for updating a single Instruction entity.

func (*InstructionUpdateOne) AddOrder

func (iuo *InstructionUpdateOne) AddOrder(i int) *InstructionUpdateOne

AddOrder adds i to the "order" field.

func (*InstructionUpdateOne) ClearRecipe

func (iuo *InstructionUpdateOne) ClearRecipe() *InstructionUpdateOne

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*InstructionUpdateOne) Exec

func (iuo *InstructionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*InstructionUpdateOne) ExecX

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

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

func (*InstructionUpdateOne) Mutation

func (iuo *InstructionUpdateOne) Mutation() *InstructionMutation

Mutation returns the InstructionMutation object of the builder.

func (*InstructionUpdateOne) Save

Save executes the query and returns the updated Instruction entity.

func (*InstructionUpdateOne) SaveX

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

func (*InstructionUpdateOne) Select

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

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

func (*InstructionUpdateOne) SetNillableOrder

func (iuo *InstructionUpdateOne) SetNillableOrder(i *int) *InstructionUpdateOne

SetNillableOrder sets the "order" field if the given value is not nil.

func (*InstructionUpdateOne) SetNillableRecipeID

func (iuo *InstructionUpdateOne) SetNillableRecipeID(id *uuid.UUID) *InstructionUpdateOne

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*InstructionUpdateOne) SetNillableText

func (iuo *InstructionUpdateOne) SetNillableText(s *string) *InstructionUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*InstructionUpdateOne) SetOrder

func (iuo *InstructionUpdateOne) SetOrder(i int) *InstructionUpdateOne

SetOrder sets the "order" field.

func (*InstructionUpdateOne) SetRecipe

func (iuo *InstructionUpdateOne) SetRecipe(r *Recipe) *InstructionUpdateOne

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*InstructionUpdateOne) SetRecipeID

func (iuo *InstructionUpdateOne) SetRecipeID(id uuid.UUID) *InstructionUpdateOne

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

func (*InstructionUpdateOne) SetText

SetText sets the "text" field.

func (*InstructionUpdateOne) Where

Where appends a list predicates to the InstructionUpdate builder.

type Instructions

type Instructions []*Instruction

Instructions is a parsable slice of Instruction.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Nutrition

type Nutrition struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Calories holds the value of the "calories" field.
	Calories int `json:"calories,omitempty"`
	// Fat holds the value of the "fat" field.
	Fat int `json:"fat,omitempty"`
	// Carbs holds the value of the "carbs" field.
	Carbs int `json:"carbs,omitempty"`
	// Protein holds the value of the "protein" field.
	Protein int `json:"protein,omitempty"`
	// Precision holds the value of the "precision" field.
	Precision string `json:"precision,omitempty"`
	// Benefits holds the value of the "benefits" field.
	Benefits []string `json:"benefits,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NutritionQuery when eager-loading is set.
	Edges NutritionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Nutrition is the model entity for the Nutrition schema.

func (*Nutrition) QueryRecipe

func (n *Nutrition) QueryRecipe() *RecipeQuery

QueryRecipe queries the "recipe" edge of the Nutrition entity.

func (*Nutrition) String

func (n *Nutrition) String() string

String implements the fmt.Stringer.

func (*Nutrition) Unwrap

func (n *Nutrition) Unwrap() *Nutrition

Unwrap unwraps the Nutrition 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 (*Nutrition) Update

func (n *Nutrition) Update() *NutritionUpdateOne

Update returns a builder for updating this Nutrition. Note that you need to call Nutrition.Unwrap() before calling this method if this Nutrition was returned from a transaction, and the transaction was committed or rolled back.

func (*Nutrition) Value

func (n *Nutrition) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Nutrition. This includes values selected through modifiers, order, etc.

type NutritionClient

type NutritionClient struct {
	// contains filtered or unexported fields
}

NutritionClient is a client for the Nutrition schema.

func NewNutritionClient

func NewNutritionClient(c config) *NutritionClient

NewNutritionClient returns a client for the Nutrition from the given config.

func (*NutritionClient) Create

func (c *NutritionClient) Create() *NutritionCreate

Create returns a builder for creating a Nutrition entity.

func (*NutritionClient) CreateBulk

func (c *NutritionClient) CreateBulk(builders ...*NutritionCreate) *NutritionCreateBulk

CreateBulk returns a builder for creating a bulk of Nutrition entities.

func (*NutritionClient) Delete

func (c *NutritionClient) Delete() *NutritionDelete

Delete returns a delete builder for Nutrition.

func (*NutritionClient) DeleteOne

func (c *NutritionClient) DeleteOne(n *Nutrition) *NutritionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NutritionClient) DeleteOneID

func (c *NutritionClient) DeleteOneID(id int) *NutritionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*NutritionClient) Get

func (c *NutritionClient) Get(ctx context.Context, id int) (*Nutrition, error)

Get returns a Nutrition entity by its id.

func (*NutritionClient) GetX

func (c *NutritionClient) GetX(ctx context.Context, id int) *Nutrition

GetX is like Get, but panics if an error occurs.

func (*NutritionClient) Hooks

func (c *NutritionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NutritionClient) Intercept

func (c *NutritionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `nutrition.Intercept(f(g(h())))`.

func (*NutritionClient) Interceptors

func (c *NutritionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*NutritionClient) MapCreateBulk

func (c *NutritionClient) MapCreateBulk(slice any, setFunc func(*NutritionCreate, int)) *NutritionCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*NutritionClient) Query

func (c *NutritionClient) Query() *NutritionQuery

Query returns a query builder for Nutrition.

func (*NutritionClient) QueryRecipe

func (c *NutritionClient) QueryRecipe(n *Nutrition) *RecipeQuery

QueryRecipe queries the recipe edge of a Nutrition.

func (*NutritionClient) Update

func (c *NutritionClient) Update() *NutritionUpdate

Update returns an update builder for Nutrition.

func (*NutritionClient) UpdateOne

func (c *NutritionClient) UpdateOne(n *Nutrition) *NutritionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NutritionClient) UpdateOneID

func (c *NutritionClient) UpdateOneID(id int) *NutritionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NutritionClient) Use

func (c *NutritionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `nutrition.Hooks(f(g(h())))`.

type NutritionCreate

type NutritionCreate struct {
	// contains filtered or unexported fields
}

NutritionCreate is the builder for creating a Nutrition entity.

func (*NutritionCreate) Exec

func (nc *NutritionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NutritionCreate) ExecX

func (nc *NutritionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NutritionCreate) Mutation

func (nc *NutritionCreate) Mutation() *NutritionMutation

Mutation returns the NutritionMutation object of the builder.

func (*NutritionCreate) Save

func (nc *NutritionCreate) Save(ctx context.Context) (*Nutrition, error)

Save creates the Nutrition in the database.

func (*NutritionCreate) SaveX

func (nc *NutritionCreate) SaveX(ctx context.Context) *Nutrition

SaveX calls Save and panics if Save returns an error.

func (*NutritionCreate) SetBenefits

func (nc *NutritionCreate) SetBenefits(s []string) *NutritionCreate

SetBenefits sets the "benefits" field.

func (*NutritionCreate) SetCalories

func (nc *NutritionCreate) SetCalories(i int) *NutritionCreate

SetCalories sets the "calories" field.

func (*NutritionCreate) SetCarbs

func (nc *NutritionCreate) SetCarbs(i int) *NutritionCreate

SetCarbs sets the "carbs" field.

func (*NutritionCreate) SetFat

func (nc *NutritionCreate) SetFat(i int) *NutritionCreate

SetFat sets the "fat" field.

func (*NutritionCreate) SetNillableCalories

func (nc *NutritionCreate) SetNillableCalories(i *int) *NutritionCreate

SetNillableCalories sets the "calories" field if the given value is not nil.

func (*NutritionCreate) SetNillableCarbs

func (nc *NutritionCreate) SetNillableCarbs(i *int) *NutritionCreate

SetNillableCarbs sets the "carbs" field if the given value is not nil.

func (*NutritionCreate) SetNillableFat

func (nc *NutritionCreate) SetNillableFat(i *int) *NutritionCreate

SetNillableFat sets the "fat" field if the given value is not nil.

func (*NutritionCreate) SetNillablePrecision

func (nc *NutritionCreate) SetNillablePrecision(s *string) *NutritionCreate

SetNillablePrecision sets the "precision" field if the given value is not nil.

func (*NutritionCreate) SetNillableProtein

func (nc *NutritionCreate) SetNillableProtein(i *int) *NutritionCreate

SetNillableProtein sets the "protein" field if the given value is not nil.

func (*NutritionCreate) SetNillableRecipeID

func (nc *NutritionCreate) SetNillableRecipeID(id *uuid.UUID) *NutritionCreate

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*NutritionCreate) SetPrecision

func (nc *NutritionCreate) SetPrecision(s string) *NutritionCreate

SetPrecision sets the "precision" field.

func (*NutritionCreate) SetProtein

func (nc *NutritionCreate) SetProtein(i int) *NutritionCreate

SetProtein sets the "protein" field.

func (*NutritionCreate) SetRecipe

func (nc *NutritionCreate) SetRecipe(r *Recipe) *NutritionCreate

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*NutritionCreate) SetRecipeID

func (nc *NutritionCreate) SetRecipeID(id uuid.UUID) *NutritionCreate

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

type NutritionCreateBulk

type NutritionCreateBulk struct {
	// contains filtered or unexported fields
}

NutritionCreateBulk is the builder for creating many Nutrition entities in bulk.

func (*NutritionCreateBulk) Exec

func (ncb *NutritionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NutritionCreateBulk) ExecX

func (ncb *NutritionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NutritionCreateBulk) Save

func (ncb *NutritionCreateBulk) Save(ctx context.Context) ([]*Nutrition, error)

Save creates the Nutrition entities in the database.

func (*NutritionCreateBulk) SaveX

func (ncb *NutritionCreateBulk) SaveX(ctx context.Context) []*Nutrition

SaveX is like Save, but panics if an error occurs.

type NutritionDelete

type NutritionDelete struct {
	// contains filtered or unexported fields
}

NutritionDelete is the builder for deleting a Nutrition entity.

func (*NutritionDelete) Exec

func (nd *NutritionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NutritionDelete) ExecX

func (nd *NutritionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NutritionDelete) Where

Where appends a list predicates to the NutritionDelete builder.

type NutritionDeleteOne

type NutritionDeleteOne struct {
	// contains filtered or unexported fields
}

NutritionDeleteOne is the builder for deleting a single Nutrition entity.

func (*NutritionDeleteOne) Exec

func (ndo *NutritionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NutritionDeleteOne) ExecX

func (ndo *NutritionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NutritionDeleteOne) Where

Where appends a list predicates to the NutritionDelete builder.

type NutritionEdges

type NutritionEdges struct {
	// Recipe holds the value of the recipe edge.
	Recipe *Recipe `json:"recipe,omitempty"`
	// contains filtered or unexported fields
}

NutritionEdges holds the relations/edges for other nodes in the graph.

func (NutritionEdges) RecipeOrErr

func (e NutritionEdges) RecipeOrErr() (*Recipe, error)

RecipeOrErr returns the Recipe value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type NutritionGroupBy

type NutritionGroupBy struct {
	// contains filtered or unexported fields
}

NutritionGroupBy is the group-by builder for Nutrition entities.

func (*NutritionGroupBy) Aggregate

func (ngb *NutritionGroupBy) Aggregate(fns ...AggregateFunc) *NutritionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*NutritionGroupBy) Bool

func (s *NutritionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NutritionGroupBy) BoolX

func (s *NutritionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NutritionGroupBy) Bools

func (s *NutritionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NutritionGroupBy) BoolsX

func (s *NutritionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NutritionGroupBy) Float64

func (s *NutritionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NutritionGroupBy) Float64X

func (s *NutritionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NutritionGroupBy) Float64s

func (s *NutritionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NutritionGroupBy) Float64sX

func (s *NutritionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NutritionGroupBy) Int

func (s *NutritionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NutritionGroupBy) IntX

func (s *NutritionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NutritionGroupBy) Ints

func (s *NutritionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NutritionGroupBy) IntsX

func (s *NutritionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NutritionGroupBy) Scan

func (ngb *NutritionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NutritionGroupBy) ScanX

func (s *NutritionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NutritionGroupBy) String

func (s *NutritionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NutritionGroupBy) StringX

func (s *NutritionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NutritionGroupBy) Strings

func (s *NutritionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NutritionGroupBy) StringsX

func (s *NutritionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NutritionMutation

type NutritionMutation struct {
	// contains filtered or unexported fields
}

NutritionMutation represents an operation that mutates the Nutrition nodes in the graph.

func (*NutritionMutation) AddCalories

func (m *NutritionMutation) AddCalories(i int)

AddCalories adds i to the "calories" field.

func (*NutritionMutation) AddCarbs

func (m *NutritionMutation) AddCarbs(i int)

AddCarbs adds i to the "carbs" field.

func (*NutritionMutation) AddFat

func (m *NutritionMutation) AddFat(i int)

AddFat adds i to the "fat" field.

func (*NutritionMutation) AddField

func (m *NutritionMutation) 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 (*NutritionMutation) AddProtein

func (m *NutritionMutation) AddProtein(i int)

AddProtein adds i to the "protein" field.

func (*NutritionMutation) AddedCalories

func (m *NutritionMutation) AddedCalories() (r int, exists bool)

AddedCalories returns the value that was added to the "calories" field in this mutation.

func (*NutritionMutation) AddedCarbs

func (m *NutritionMutation) AddedCarbs() (r int, exists bool)

AddedCarbs returns the value that was added to the "carbs" field in this mutation.

func (*NutritionMutation) AddedEdges

func (m *NutritionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NutritionMutation) AddedFat

func (m *NutritionMutation) AddedFat() (r int, exists bool)

AddedFat returns the value that was added to the "fat" field in this mutation.

func (*NutritionMutation) AddedField

func (m *NutritionMutation) 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 (*NutritionMutation) AddedFields

func (m *NutritionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NutritionMutation) AddedIDs

func (m *NutritionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NutritionMutation) AddedProtein

func (m *NutritionMutation) AddedProtein() (r int, exists bool)

AddedProtein returns the value that was added to the "protein" field in this mutation.

func (*NutritionMutation) AppendBenefits

func (m *NutritionMutation) AppendBenefits(s []string)

AppendBenefits adds s to the "benefits" field.

func (*NutritionMutation) AppendedBenefits

func (m *NutritionMutation) AppendedBenefits() ([]string, bool)

AppendedBenefits returns the list of values that were appended to the "benefits" field in this mutation.

func (*NutritionMutation) Benefits

func (m *NutritionMutation) Benefits() (r []string, exists bool)

Benefits returns the value of the "benefits" field in the mutation.

func (*NutritionMutation) BenefitsCleared

func (m *NutritionMutation) BenefitsCleared() bool

BenefitsCleared returns if the "benefits" field was cleared in this mutation.

func (*NutritionMutation) Calories

func (m *NutritionMutation) Calories() (r int, exists bool)

Calories returns the value of the "calories" field in the mutation.

func (*NutritionMutation) CaloriesCleared

func (m *NutritionMutation) CaloriesCleared() bool

CaloriesCleared returns if the "calories" field was cleared in this mutation.

func (*NutritionMutation) Carbs

func (m *NutritionMutation) Carbs() (r int, exists bool)

Carbs returns the value of the "carbs" field in the mutation.

func (*NutritionMutation) CarbsCleared

func (m *NutritionMutation) CarbsCleared() bool

CarbsCleared returns if the "carbs" field was cleared in this mutation.

func (*NutritionMutation) ClearBenefits

func (m *NutritionMutation) ClearBenefits()

ClearBenefits clears the value of the "benefits" field.

func (*NutritionMutation) ClearCalories

func (m *NutritionMutation) ClearCalories()

ClearCalories clears the value of the "calories" field.

func (*NutritionMutation) ClearCarbs

func (m *NutritionMutation) ClearCarbs()

ClearCarbs clears the value of the "carbs" field.

func (*NutritionMutation) ClearEdge

func (m *NutritionMutation) 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 (*NutritionMutation) ClearFat

func (m *NutritionMutation) ClearFat()

ClearFat clears the value of the "fat" field.

func (*NutritionMutation) ClearField

func (m *NutritionMutation) 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 (*NutritionMutation) ClearPrecision

func (m *NutritionMutation) ClearPrecision()

ClearPrecision clears the value of the "precision" field.

func (*NutritionMutation) ClearProtein

func (m *NutritionMutation) ClearProtein()

ClearProtein clears the value of the "protein" field.

func (*NutritionMutation) ClearRecipe

func (m *NutritionMutation) ClearRecipe()

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*NutritionMutation) ClearedEdges

func (m *NutritionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NutritionMutation) ClearedFields

func (m *NutritionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NutritionMutation) Client

func (m NutritionMutation) 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 (*NutritionMutation) EdgeCleared

func (m *NutritionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NutritionMutation) Fat

func (m *NutritionMutation) Fat() (r int, exists bool)

Fat returns the value of the "fat" field in the mutation.

func (*NutritionMutation) FatCleared

func (m *NutritionMutation) FatCleared() bool

FatCleared returns if the "fat" field was cleared in this mutation.

func (*NutritionMutation) Field

func (m *NutritionMutation) 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 (*NutritionMutation) FieldCleared

func (m *NutritionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NutritionMutation) Fields

func (m *NutritionMutation) 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 (*NutritionMutation) ID

func (m *NutritionMutation) 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 (*NutritionMutation) IDs

func (m *NutritionMutation) 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 (*NutritionMutation) OldBenefits

func (m *NutritionMutation) OldBenefits(ctx context.Context) (v []string, err error)

OldBenefits returns the old "benefits" field's value of the Nutrition entity. If the Nutrition 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 (*NutritionMutation) OldCalories

func (m *NutritionMutation) OldCalories(ctx context.Context) (v int, err error)

OldCalories returns the old "calories" field's value of the Nutrition entity. If the Nutrition 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 (*NutritionMutation) OldCarbs

func (m *NutritionMutation) OldCarbs(ctx context.Context) (v int, err error)

OldCarbs returns the old "carbs" field's value of the Nutrition entity. If the Nutrition 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 (*NutritionMutation) OldFat

func (m *NutritionMutation) OldFat(ctx context.Context) (v int, err error)

OldFat returns the old "fat" field's value of the Nutrition entity. If the Nutrition 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 (*NutritionMutation) OldField

func (m *NutritionMutation) 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 (*NutritionMutation) OldPrecision

func (m *NutritionMutation) OldPrecision(ctx context.Context) (v string, err error)

OldPrecision returns the old "precision" field's value of the Nutrition entity. If the Nutrition 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 (*NutritionMutation) OldProtein

func (m *NutritionMutation) OldProtein(ctx context.Context) (v int, err error)

OldProtein returns the old "protein" field's value of the Nutrition entity. If the Nutrition 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 (*NutritionMutation) Op

func (m *NutritionMutation) Op() Op

Op returns the operation name.

func (*NutritionMutation) Precision

func (m *NutritionMutation) Precision() (r string, exists bool)

Precision returns the value of the "precision" field in the mutation.

func (*NutritionMutation) PrecisionCleared

func (m *NutritionMutation) PrecisionCleared() bool

PrecisionCleared returns if the "precision" field was cleared in this mutation.

func (*NutritionMutation) Protein

func (m *NutritionMutation) Protein() (r int, exists bool)

Protein returns the value of the "protein" field in the mutation.

func (*NutritionMutation) ProteinCleared

func (m *NutritionMutation) ProteinCleared() bool

ProteinCleared returns if the "protein" field was cleared in this mutation.

func (*NutritionMutation) RecipeCleared

func (m *NutritionMutation) RecipeCleared() bool

RecipeCleared reports if the "recipe" edge to the Recipe entity was cleared.

func (*NutritionMutation) RecipeID

func (m *NutritionMutation) RecipeID() (id uuid.UUID, exists bool)

RecipeID returns the "recipe" edge ID in the mutation.

func (*NutritionMutation) RecipeIDs

func (m *NutritionMutation) RecipeIDs() (ids []uuid.UUID)

RecipeIDs returns the "recipe" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RecipeID instead. It exists only for internal usage by the builders.

func (*NutritionMutation) RemovedEdges

func (m *NutritionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NutritionMutation) RemovedIDs

func (m *NutritionMutation) 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 (*NutritionMutation) ResetBenefits

func (m *NutritionMutation) ResetBenefits()

ResetBenefits resets all changes to the "benefits" field.

func (*NutritionMutation) ResetCalories

func (m *NutritionMutation) ResetCalories()

ResetCalories resets all changes to the "calories" field.

func (*NutritionMutation) ResetCarbs

func (m *NutritionMutation) ResetCarbs()

ResetCarbs resets all changes to the "carbs" field.

func (*NutritionMutation) ResetEdge

func (m *NutritionMutation) 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 (*NutritionMutation) ResetFat

func (m *NutritionMutation) ResetFat()

ResetFat resets all changes to the "fat" field.

func (*NutritionMutation) ResetField

func (m *NutritionMutation) 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 (*NutritionMutation) ResetPrecision

func (m *NutritionMutation) ResetPrecision()

ResetPrecision resets all changes to the "precision" field.

func (*NutritionMutation) ResetProtein

func (m *NutritionMutation) ResetProtein()

ResetProtein resets all changes to the "protein" field.

func (*NutritionMutation) ResetRecipe

func (m *NutritionMutation) ResetRecipe()

ResetRecipe resets all changes to the "recipe" edge.

func (*NutritionMutation) SetBenefits

func (m *NutritionMutation) SetBenefits(s []string)

SetBenefits sets the "benefits" field.

func (*NutritionMutation) SetCalories

func (m *NutritionMutation) SetCalories(i int)

SetCalories sets the "calories" field.

func (*NutritionMutation) SetCarbs

func (m *NutritionMutation) SetCarbs(i int)

SetCarbs sets the "carbs" field.

func (*NutritionMutation) SetFat

func (m *NutritionMutation) SetFat(i int)

SetFat sets the "fat" field.

func (*NutritionMutation) SetField

func (m *NutritionMutation) 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 (*NutritionMutation) SetOp

func (m *NutritionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NutritionMutation) SetPrecision

func (m *NutritionMutation) SetPrecision(s string)

SetPrecision sets the "precision" field.

func (*NutritionMutation) SetProtein

func (m *NutritionMutation) SetProtein(i int)

SetProtein sets the "protein" field.

func (*NutritionMutation) SetRecipeID

func (m *NutritionMutation) SetRecipeID(id uuid.UUID)

SetRecipeID sets the "recipe" edge to the Recipe entity by id.

func (NutritionMutation) Tx

func (m NutritionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NutritionMutation) Type

func (m *NutritionMutation) Type() string

Type returns the node type of this mutation (Nutrition).

func (*NutritionMutation) Where

func (m *NutritionMutation) Where(ps ...predicate.Nutrition)

Where appends a list predicates to the NutritionMutation builder.

func (*NutritionMutation) WhereP

func (m *NutritionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NutritionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NutritionQuery

type NutritionQuery struct {
	// contains filtered or unexported fields
}

NutritionQuery is the builder for querying Nutrition entities.

func (*NutritionQuery) Aggregate

func (nq *NutritionQuery) Aggregate(fns ...AggregateFunc) *NutritionSelect

Aggregate returns a NutritionSelect configured with the given aggregations.

func (*NutritionQuery) All

func (nq *NutritionQuery) All(ctx context.Context) ([]*Nutrition, error)

All executes the query and returns a list of Nutritions.

func (*NutritionQuery) AllX

func (nq *NutritionQuery) AllX(ctx context.Context) []*Nutrition

AllX is like All, but panics if an error occurs.

func (*NutritionQuery) Clone

func (nq *NutritionQuery) Clone() *NutritionQuery

Clone returns a duplicate of the NutritionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NutritionQuery) Count

func (nq *NutritionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NutritionQuery) CountX

func (nq *NutritionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NutritionQuery) Exist

func (nq *NutritionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NutritionQuery) ExistX

func (nq *NutritionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NutritionQuery) First

func (nq *NutritionQuery) First(ctx context.Context) (*Nutrition, error)

First returns the first Nutrition entity from the query. Returns a *NotFoundError when no Nutrition was found.

func (*NutritionQuery) FirstID

func (nq *NutritionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Nutrition ID from the query. Returns a *NotFoundError when no Nutrition ID was found.

func (*NutritionQuery) FirstIDX

func (nq *NutritionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*NutritionQuery) FirstX

func (nq *NutritionQuery) FirstX(ctx context.Context) *Nutrition

FirstX is like First, but panics if an error occurs.

func (*NutritionQuery) GroupBy

func (nq *NutritionQuery) GroupBy(field string, fields ...string) *NutritionGroupBy

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 {
	Calories int `json:"calories,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Nutrition.Query().
	GroupBy(nutrition.FieldCalories).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NutritionQuery) IDs

func (nq *NutritionQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Nutrition IDs.

func (*NutritionQuery) IDsX

func (nq *NutritionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*NutritionQuery) Limit

func (nq *NutritionQuery) Limit(limit int) *NutritionQuery

Limit the number of records to be returned by this query.

func (*NutritionQuery) Offset

func (nq *NutritionQuery) Offset(offset int) *NutritionQuery

Offset to start from.

func (*NutritionQuery) Only

func (nq *NutritionQuery) Only(ctx context.Context) (*Nutrition, error)

Only returns a single Nutrition entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Nutrition entity is found. Returns a *NotFoundError when no Nutrition entities are found.

func (*NutritionQuery) OnlyID

func (nq *NutritionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Nutrition ID in the query. Returns a *NotSingularError when more than one Nutrition ID is found. Returns a *NotFoundError when no entities are found.

func (*NutritionQuery) OnlyIDX

func (nq *NutritionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NutritionQuery) OnlyX

func (nq *NutritionQuery) OnlyX(ctx context.Context) *Nutrition

OnlyX is like Only, but panics if an error occurs.

func (*NutritionQuery) Order

Order specifies how the records should be ordered.

func (*NutritionQuery) QueryRecipe

func (nq *NutritionQuery) QueryRecipe() *RecipeQuery

QueryRecipe chains the current query on the "recipe" edge.

func (*NutritionQuery) Select

func (nq *NutritionQuery) Select(fields ...string) *NutritionSelect

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 {
	Calories int `json:"calories,omitempty"`
}

client.Nutrition.Query().
	Select(nutrition.FieldCalories).
	Scan(ctx, &v)

func (*NutritionQuery) Unique

func (nq *NutritionQuery) Unique(unique bool) *NutritionQuery

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 (*NutritionQuery) Where

Where adds a new predicate for the NutritionQuery builder.

func (*NutritionQuery) WithRecipe

func (nq *NutritionQuery) WithRecipe(opts ...func(*RecipeQuery)) *NutritionQuery

WithRecipe tells the query-builder to eager-load the nodes that are connected to the "recipe" edge. The optional arguments are used to configure the query builder of the edge.

type NutritionSelect

type NutritionSelect struct {
	*NutritionQuery
	// contains filtered or unexported fields
}

NutritionSelect is the builder for selecting fields of Nutrition entities.

func (*NutritionSelect) Aggregate

func (ns *NutritionSelect) Aggregate(fns ...AggregateFunc) *NutritionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NutritionSelect) Bool

func (s *NutritionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NutritionSelect) BoolX

func (s *NutritionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NutritionSelect) Bools

func (s *NutritionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NutritionSelect) BoolsX

func (s *NutritionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NutritionSelect) Float64

func (s *NutritionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NutritionSelect) Float64X

func (s *NutritionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NutritionSelect) Float64s

func (s *NutritionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NutritionSelect) Float64sX

func (s *NutritionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NutritionSelect) Int

func (s *NutritionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NutritionSelect) IntX

func (s *NutritionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NutritionSelect) Ints

func (s *NutritionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NutritionSelect) IntsX

func (s *NutritionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NutritionSelect) Scan

func (ns *NutritionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NutritionSelect) ScanX

func (s *NutritionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NutritionSelect) String

func (s *NutritionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NutritionSelect) StringX

func (s *NutritionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NutritionSelect) Strings

func (s *NutritionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NutritionSelect) StringsX

func (s *NutritionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NutritionUpdate

type NutritionUpdate struct {
	// contains filtered or unexported fields
}

NutritionUpdate is the builder for updating Nutrition entities.

func (*NutritionUpdate) AddCalories

func (nu *NutritionUpdate) AddCalories(i int) *NutritionUpdate

AddCalories adds i to the "calories" field.

func (*NutritionUpdate) AddCarbs

func (nu *NutritionUpdate) AddCarbs(i int) *NutritionUpdate

AddCarbs adds i to the "carbs" field.

func (*NutritionUpdate) AddFat

func (nu *NutritionUpdate) AddFat(i int) *NutritionUpdate

AddFat adds i to the "fat" field.

func (*NutritionUpdate) AddProtein

func (nu *NutritionUpdate) AddProtein(i int) *NutritionUpdate

AddProtein adds i to the "protein" field.

func (*NutritionUpdate) AppendBenefits

func (nu *NutritionUpdate) AppendBenefits(s []string) *NutritionUpdate

AppendBenefits appends s to the "benefits" field.

func (*NutritionUpdate) ClearBenefits

func (nu *NutritionUpdate) ClearBenefits() *NutritionUpdate

ClearBenefits clears the value of the "benefits" field.

func (*NutritionUpdate) ClearCalories

func (nu *NutritionUpdate) ClearCalories() *NutritionUpdate

ClearCalories clears the value of the "calories" field.

func (*NutritionUpdate) ClearCarbs

func (nu *NutritionUpdate) ClearCarbs() *NutritionUpdate

ClearCarbs clears the value of the "carbs" field.

func (*NutritionUpdate) ClearFat

func (nu *NutritionUpdate) ClearFat() *NutritionUpdate

ClearFat clears the value of the "fat" field.

func (*NutritionUpdate) ClearPrecision

func (nu *NutritionUpdate) ClearPrecision() *NutritionUpdate

ClearPrecision clears the value of the "precision" field.

func (*NutritionUpdate) ClearProtein

func (nu *NutritionUpdate) ClearProtein() *NutritionUpdate

ClearProtein clears the value of the "protein" field.

func (*NutritionUpdate) ClearRecipe

func (nu *NutritionUpdate) ClearRecipe() *NutritionUpdate

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*NutritionUpdate) Exec

func (nu *NutritionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NutritionUpdate) ExecX

func (nu *NutritionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NutritionUpdate) Mutation

func (nu *NutritionUpdate) Mutation() *NutritionMutation

Mutation returns the NutritionMutation object of the builder.

func (*NutritionUpdate) Save

func (nu *NutritionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NutritionUpdate) SaveX

func (nu *NutritionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NutritionUpdate) SetBenefits

func (nu *NutritionUpdate) SetBenefits(s []string) *NutritionUpdate

SetBenefits sets the "benefits" field.

func (*NutritionUpdate) SetCalories

func (nu *NutritionUpdate) SetCalories(i int) *NutritionUpdate

SetCalories sets the "calories" field.

func (*NutritionUpdate) SetCarbs

func (nu *NutritionUpdate) SetCarbs(i int) *NutritionUpdate

SetCarbs sets the "carbs" field.

func (*NutritionUpdate) SetFat

func (nu *NutritionUpdate) SetFat(i int) *NutritionUpdate

SetFat sets the "fat" field.

func (*NutritionUpdate) SetNillableCalories

func (nu *NutritionUpdate) SetNillableCalories(i *int) *NutritionUpdate

SetNillableCalories sets the "calories" field if the given value is not nil.

func (*NutritionUpdate) SetNillableCarbs

func (nu *NutritionUpdate) SetNillableCarbs(i *int) *NutritionUpdate

SetNillableCarbs sets the "carbs" field if the given value is not nil.

func (*NutritionUpdate) SetNillableFat

func (nu *NutritionUpdate) SetNillableFat(i *int) *NutritionUpdate

SetNillableFat sets the "fat" field if the given value is not nil.

func (*NutritionUpdate) SetNillablePrecision

func (nu *NutritionUpdate) SetNillablePrecision(s *string) *NutritionUpdate

SetNillablePrecision sets the "precision" field if the given value is not nil.

func (*NutritionUpdate) SetNillableProtein

func (nu *NutritionUpdate) SetNillableProtein(i *int) *NutritionUpdate

SetNillableProtein sets the "protein" field if the given value is not nil.

func (*NutritionUpdate) SetNillableRecipeID

func (nu *NutritionUpdate) SetNillableRecipeID(id *uuid.UUID) *NutritionUpdate

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*NutritionUpdate) SetPrecision

func (nu *NutritionUpdate) SetPrecision(s string) *NutritionUpdate

SetPrecision sets the "precision" field.

func (*NutritionUpdate) SetProtein

func (nu *NutritionUpdate) SetProtein(i int) *NutritionUpdate

SetProtein sets the "protein" field.

func (*NutritionUpdate) SetRecipe

func (nu *NutritionUpdate) SetRecipe(r *Recipe) *NutritionUpdate

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*NutritionUpdate) SetRecipeID

func (nu *NutritionUpdate) SetRecipeID(id uuid.UUID) *NutritionUpdate

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

func (*NutritionUpdate) Where

Where appends a list predicates to the NutritionUpdate builder.

type NutritionUpdateOne

type NutritionUpdateOne struct {
	// contains filtered or unexported fields
}

NutritionUpdateOne is the builder for updating a single Nutrition entity.

func (*NutritionUpdateOne) AddCalories

func (nuo *NutritionUpdateOne) AddCalories(i int) *NutritionUpdateOne

AddCalories adds i to the "calories" field.

func (*NutritionUpdateOne) AddCarbs

func (nuo *NutritionUpdateOne) AddCarbs(i int) *NutritionUpdateOne

AddCarbs adds i to the "carbs" field.

func (*NutritionUpdateOne) AddFat

func (nuo *NutritionUpdateOne) AddFat(i int) *NutritionUpdateOne

AddFat adds i to the "fat" field.

func (*NutritionUpdateOne) AddProtein

func (nuo *NutritionUpdateOne) AddProtein(i int) *NutritionUpdateOne

AddProtein adds i to the "protein" field.

func (*NutritionUpdateOne) AppendBenefits

func (nuo *NutritionUpdateOne) AppendBenefits(s []string) *NutritionUpdateOne

AppendBenefits appends s to the "benefits" field.

func (*NutritionUpdateOne) ClearBenefits

func (nuo *NutritionUpdateOne) ClearBenefits() *NutritionUpdateOne

ClearBenefits clears the value of the "benefits" field.

func (*NutritionUpdateOne) ClearCalories

func (nuo *NutritionUpdateOne) ClearCalories() *NutritionUpdateOne

ClearCalories clears the value of the "calories" field.

func (*NutritionUpdateOne) ClearCarbs

func (nuo *NutritionUpdateOne) ClearCarbs() *NutritionUpdateOne

ClearCarbs clears the value of the "carbs" field.

func (*NutritionUpdateOne) ClearFat

func (nuo *NutritionUpdateOne) ClearFat() *NutritionUpdateOne

ClearFat clears the value of the "fat" field.

func (*NutritionUpdateOne) ClearPrecision

func (nuo *NutritionUpdateOne) ClearPrecision() *NutritionUpdateOne

ClearPrecision clears the value of the "precision" field.

func (*NutritionUpdateOne) ClearProtein

func (nuo *NutritionUpdateOne) ClearProtein() *NutritionUpdateOne

ClearProtein clears the value of the "protein" field.

func (*NutritionUpdateOne) ClearRecipe

func (nuo *NutritionUpdateOne) ClearRecipe() *NutritionUpdateOne

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*NutritionUpdateOne) Exec

func (nuo *NutritionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NutritionUpdateOne) ExecX

func (nuo *NutritionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NutritionUpdateOne) Mutation

func (nuo *NutritionUpdateOne) Mutation() *NutritionMutation

Mutation returns the NutritionMutation object of the builder.

func (*NutritionUpdateOne) Save

func (nuo *NutritionUpdateOne) Save(ctx context.Context) (*Nutrition, error)

Save executes the query and returns the updated Nutrition entity.

func (*NutritionUpdateOne) SaveX

func (nuo *NutritionUpdateOne) SaveX(ctx context.Context) *Nutrition

SaveX is like Save, but panics if an error occurs.

func (*NutritionUpdateOne) Select

func (nuo *NutritionUpdateOne) Select(field string, fields ...string) *NutritionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NutritionUpdateOne) SetBenefits

func (nuo *NutritionUpdateOne) SetBenefits(s []string) *NutritionUpdateOne

SetBenefits sets the "benefits" field.

func (*NutritionUpdateOne) SetCalories

func (nuo *NutritionUpdateOne) SetCalories(i int) *NutritionUpdateOne

SetCalories sets the "calories" field.

func (*NutritionUpdateOne) SetCarbs

func (nuo *NutritionUpdateOne) SetCarbs(i int) *NutritionUpdateOne

SetCarbs sets the "carbs" field.

func (*NutritionUpdateOne) SetFat

func (nuo *NutritionUpdateOne) SetFat(i int) *NutritionUpdateOne

SetFat sets the "fat" field.

func (*NutritionUpdateOne) SetNillableCalories

func (nuo *NutritionUpdateOne) SetNillableCalories(i *int) *NutritionUpdateOne

SetNillableCalories sets the "calories" field if the given value is not nil.

func (*NutritionUpdateOne) SetNillableCarbs

func (nuo *NutritionUpdateOne) SetNillableCarbs(i *int) *NutritionUpdateOne

SetNillableCarbs sets the "carbs" field if the given value is not nil.

func (*NutritionUpdateOne) SetNillableFat

func (nuo *NutritionUpdateOne) SetNillableFat(i *int) *NutritionUpdateOne

SetNillableFat sets the "fat" field if the given value is not nil.

func (*NutritionUpdateOne) SetNillablePrecision

func (nuo *NutritionUpdateOne) SetNillablePrecision(s *string) *NutritionUpdateOne

SetNillablePrecision sets the "precision" field if the given value is not nil.

func (*NutritionUpdateOne) SetNillableProtein

func (nuo *NutritionUpdateOne) SetNillableProtein(i *int) *NutritionUpdateOne

SetNillableProtein sets the "protein" field if the given value is not nil.

func (*NutritionUpdateOne) SetNillableRecipeID

func (nuo *NutritionUpdateOne) SetNillableRecipeID(id *uuid.UUID) *NutritionUpdateOne

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*NutritionUpdateOne) SetPrecision

func (nuo *NutritionUpdateOne) SetPrecision(s string) *NutritionUpdateOne

SetPrecision sets the "precision" field.

func (*NutritionUpdateOne) SetProtein

func (nuo *NutritionUpdateOne) SetProtein(i int) *NutritionUpdateOne

SetProtein sets the "protein" field.

func (*NutritionUpdateOne) SetRecipe

func (nuo *NutritionUpdateOne) SetRecipe(r *Recipe) *NutritionUpdateOne

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*NutritionUpdateOne) SetRecipeID

func (nuo *NutritionUpdateOne) SetRecipeID(id uuid.UUID) *NutritionUpdateOne

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

func (*NutritionUpdateOne) Where

Where appends a list predicates to the NutritionUpdate builder.

type Nutritions

type Nutritions []*Nutrition

Nutritions is a parsable slice of Nutrition.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Product

type Product 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 product.Locale `json:"locale,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Slug holds the value of the "slug" field.
	Slug string `json:"slug,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProductQuery when eager-loading is set.
	Edges ProductEdges `json:"edges"`
	// contains filtered or unexported fields
}

Product is the model entity for the Product schema.

func (*Product) QueryIngredients

func (pr *Product) QueryIngredients() *IngredientQuery

QueryIngredients queries the "ingredients" edge of the Product entity.

func (*Product) QueryRequiredInRecipes

func (pr *Product) QueryRequiredInRecipes() *RecipeQuery

QueryRequiredInRecipes queries the "required_in_recipes" edge of the Product entity.

func (*Product) String

func (pr *Product) String() string

String implements the fmt.Stringer.

func (*Product) Unwrap

func (pr *Product) Unwrap() *Product

Unwrap unwraps the Product 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 (*Product) Update

func (pr *Product) Update() *ProductUpdateOne

Update returns a builder for updating this Product. Note that you need to call Product.Unwrap() before calling this method if this Product was returned from a transaction, and the transaction was committed or rolled back.

func (*Product) Value

func (pr *Product) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Product. This includes values selected through modifiers, order, etc.

type ProductClient

type ProductClient struct {
	// contains filtered or unexported fields
}

ProductClient is a client for the Product schema.

func NewProductClient

func NewProductClient(c config) *ProductClient

NewProductClient returns a client for the Product from the given config.

func (*ProductClient) Create

func (c *ProductClient) Create() *ProductCreate

Create returns a builder for creating a Product entity.

func (*ProductClient) CreateBulk

func (c *ProductClient) CreateBulk(builders ...*ProductCreate) *ProductCreateBulk

CreateBulk returns a builder for creating a bulk of Product entities.

func (*ProductClient) Delete

func (c *ProductClient) Delete() *ProductDelete

Delete returns a delete builder for Product.

func (*ProductClient) DeleteOne

func (c *ProductClient) DeleteOne(pr *Product) *ProductDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProductClient) DeleteOneID

func (c *ProductClient) DeleteOneID(id uuid.UUID) *ProductDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProductClient) Get

func (c *ProductClient) Get(ctx context.Context, id uuid.UUID) (*Product, error)

Get returns a Product entity by its id.

func (*ProductClient) GetX

func (c *ProductClient) GetX(ctx context.Context, id uuid.UUID) *Product

GetX is like Get, but panics if an error occurs.

func (*ProductClient) Hooks

func (c *ProductClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductClient) Intercept

func (c *ProductClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `product.Intercept(f(g(h())))`.

func (*ProductClient) Interceptors

func (c *ProductClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductClient) MapCreateBulk

func (c *ProductClient) MapCreateBulk(slice any, setFunc func(*ProductCreate, int)) *ProductCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ProductClient) Query

func (c *ProductClient) Query() *ProductQuery

Query returns a query builder for Product.

func (*ProductClient) QueryIngredients

func (c *ProductClient) QueryIngredients(pr *Product) *IngredientQuery

QueryIngredients queries the ingredients edge of a Product.

func (*ProductClient) QueryRequiredInRecipes

func (c *ProductClient) QueryRequiredInRecipes(pr *Product) *RecipeQuery

QueryRequiredInRecipes queries the required_in_recipes edge of a Product.

func (*ProductClient) Update

func (c *ProductClient) Update() *ProductUpdate

Update returns an update builder for Product.

func (*ProductClient) UpdateOne

func (c *ProductClient) UpdateOne(pr *Product) *ProductUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductClient) UpdateOneID

func (c *ProductClient) UpdateOneID(id uuid.UUID) *ProductUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProductClient) Use

func (c *ProductClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `product.Hooks(f(g(h())))`.

type ProductCreate

type ProductCreate struct {
	// contains filtered or unexported fields
}

ProductCreate is the builder for creating a Product entity.

func (*ProductCreate) AddIngredientIDs

func (pc *ProductCreate) AddIngredientIDs(ids ...uuid.UUID) *ProductCreate

AddIngredientIDs adds the "ingredients" edge to the Ingredient entity by IDs.

func (*ProductCreate) AddIngredients

func (pc *ProductCreate) AddIngredients(i ...*Ingredient) *ProductCreate

AddIngredients adds the "ingredients" edges to the Ingredient entity.

func (*ProductCreate) AddRequiredInRecipeIDs

func (pc *ProductCreate) AddRequiredInRecipeIDs(ids ...uuid.UUID) *ProductCreate

AddRequiredInRecipeIDs adds the "required_in_recipes" edge to the Recipe entity by IDs.

func (*ProductCreate) AddRequiredInRecipes

func (pc *ProductCreate) AddRequiredInRecipes(r ...*Recipe) *ProductCreate

AddRequiredInRecipes adds the "required_in_recipes" edges to the Recipe entity.

func (*ProductCreate) Exec

func (pc *ProductCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductCreate) ExecX

func (pc *ProductCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductCreate) Mutation

func (pc *ProductCreate) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductCreate) Save

func (pc *ProductCreate) Save(ctx context.Context) (*Product, error)

Save creates the Product in the database.

func (*ProductCreate) SaveX

func (pc *ProductCreate) SaveX(ctx context.Context) *Product

SaveX calls Save and panics if Save returns an error.

func (*ProductCreate) SetCreateTime

func (pc *ProductCreate) SetCreateTime(t time.Time) *ProductCreate

SetCreateTime sets the "create_time" field.

func (*ProductCreate) SetID

func (pc *ProductCreate) SetID(u uuid.UUID) *ProductCreate

SetID sets the "id" field.

func (*ProductCreate) SetLocale

func (pc *ProductCreate) SetLocale(pr product.Locale) *ProductCreate

SetLocale sets the "locale" field.

func (*ProductCreate) SetName

func (pc *ProductCreate) SetName(s string) *ProductCreate

SetName sets the "name" field.

func (*ProductCreate) SetNillableCreateTime

func (pc *ProductCreate) SetNillableCreateTime(t *time.Time) *ProductCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ProductCreate) SetNillableID

func (pc *ProductCreate) SetNillableID(u *uuid.UUID) *ProductCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ProductCreate) SetNillableLocale

func (pc *ProductCreate) SetNillableLocale(pr *product.Locale) *ProductCreate

SetNillableLocale sets the "locale" field if the given value is not nil.

func (*ProductCreate) SetNillableUpdateTime

func (pc *ProductCreate) SetNillableUpdateTime(t *time.Time) *ProductCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ProductCreate) SetSlug

func (pc *ProductCreate) SetSlug(s string) *ProductCreate

SetSlug sets the "slug" field.

func (*ProductCreate) SetUpdateTime

func (pc *ProductCreate) SetUpdateTime(t time.Time) *ProductCreate

SetUpdateTime sets the "update_time" field.

type ProductCreateBulk

type ProductCreateBulk struct {
	// contains filtered or unexported fields
}

ProductCreateBulk is the builder for creating many Product entities in bulk.

func (*ProductCreateBulk) Exec

func (pcb *ProductCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductCreateBulk) ExecX

func (pcb *ProductCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductCreateBulk) Save

func (pcb *ProductCreateBulk) Save(ctx context.Context) ([]*Product, error)

Save creates the Product entities in the database.

func (*ProductCreateBulk) SaveX

func (pcb *ProductCreateBulk) SaveX(ctx context.Context) []*Product

SaveX is like Save, but panics if an error occurs.

type ProductDelete

type ProductDelete struct {
	// contains filtered or unexported fields
}

ProductDelete is the builder for deleting a Product entity.

func (*ProductDelete) Exec

func (pd *ProductDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductDelete) ExecX

func (pd *ProductDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductDelete) Where

func (pd *ProductDelete) Where(ps ...predicate.Product) *ProductDelete

Where appends a list predicates to the ProductDelete builder.

type ProductDeleteOne

type ProductDeleteOne struct {
	// contains filtered or unexported fields
}

ProductDeleteOne is the builder for deleting a single Product entity.

func (*ProductDeleteOne) Exec

func (pdo *ProductDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductDeleteOne) ExecX

func (pdo *ProductDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductDeleteOne) Where

Where appends a list predicates to the ProductDelete builder.

type ProductEdges

type ProductEdges struct {
	// RequiredInRecipes holds the value of the required_in_recipes edge.
	RequiredInRecipes []*Recipe `json:"required_in_recipes,omitempty"`
	// Ingredients holds the value of the ingredients edge.
	Ingredients []*Ingredient `json:"ingredients,omitempty"`
	// contains filtered or unexported fields
}

ProductEdges holds the relations/edges for other nodes in the graph.

func (ProductEdges) IngredientsOrErr

func (e ProductEdges) IngredientsOrErr() ([]*Ingredient, error)

IngredientsOrErr returns the Ingredients value or an error if the edge was not loaded in eager-loading.

func (ProductEdges) RequiredInRecipesOrErr

func (e ProductEdges) RequiredInRecipesOrErr() ([]*Recipe, error)

RequiredInRecipesOrErr returns the RequiredInRecipes value or an error if the edge was not loaded in eager-loading.

type ProductGroupBy

type ProductGroupBy struct {
	// contains filtered or unexported fields
}

ProductGroupBy is the group-by builder for Product entities.

func (*ProductGroupBy) Aggregate

func (pgb *ProductGroupBy) Aggregate(fns ...AggregateFunc) *ProductGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductGroupBy) Bool

func (s *ProductGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) BoolX

func (s *ProductGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductGroupBy) Bools

func (s *ProductGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) BoolsX

func (s *ProductGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductGroupBy) Float64

func (s *ProductGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) Float64X

func (s *ProductGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductGroupBy) Float64s

func (s *ProductGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) Float64sX

func (s *ProductGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductGroupBy) Int

func (s *ProductGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) IntX

func (s *ProductGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductGroupBy) Ints

func (s *ProductGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) IntsX

func (s *ProductGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductGroupBy) Scan

func (pgb *ProductGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductGroupBy) ScanX

func (s *ProductGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductGroupBy) String

func (s *ProductGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) StringX

func (s *ProductGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductGroupBy) Strings

func (s *ProductGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) StringsX

func (s *ProductGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductMutation

type ProductMutation struct {
	// contains filtered or unexported fields
}

ProductMutation represents an operation that mutates the Product nodes in the graph.

func (*ProductMutation) AddField

func (m *ProductMutation) 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 (*ProductMutation) AddIngredientIDs

func (m *ProductMutation) AddIngredientIDs(ids ...uuid.UUID)

AddIngredientIDs adds the "ingredients" edge to the Ingredient entity by ids.

func (*ProductMutation) AddRequiredInRecipeIDs

func (m *ProductMutation) AddRequiredInRecipeIDs(ids ...uuid.UUID)

AddRequiredInRecipeIDs adds the "required_in_recipes" edge to the Recipe entity by ids.

func (*ProductMutation) AddedEdges

func (m *ProductMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductMutation) AddedField

func (m *ProductMutation) 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 (*ProductMutation) AddedFields

func (m *ProductMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductMutation) AddedIDs

func (m *ProductMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductMutation) ClearEdge

func (m *ProductMutation) 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 (*ProductMutation) ClearField

func (m *ProductMutation) 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 (*ProductMutation) ClearIngredients

func (m *ProductMutation) ClearIngredients()

ClearIngredients clears the "ingredients" edge to the Ingredient entity.

func (*ProductMutation) ClearRequiredInRecipes

func (m *ProductMutation) ClearRequiredInRecipes()

ClearRequiredInRecipes clears the "required_in_recipes" edge to the Recipe entity.

func (*ProductMutation) ClearedEdges

func (m *ProductMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductMutation) ClearedFields

func (m *ProductMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductMutation) Client

func (m ProductMutation) 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 (*ProductMutation) CreateTime

func (m *ProductMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ProductMutation) EdgeCleared

func (m *ProductMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductMutation) Field

func (m *ProductMutation) 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 (*ProductMutation) FieldCleared

func (m *ProductMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductMutation) Fields

func (m *ProductMutation) 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 (*ProductMutation) ID

func (m *ProductMutation) 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 (*ProductMutation) IDs

func (m *ProductMutation) 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 (*ProductMutation) IngredientsCleared

func (m *ProductMutation) IngredientsCleared() bool

IngredientsCleared reports if the "ingredients" edge to the Ingredient entity was cleared.

func (*ProductMutation) IngredientsIDs

func (m *ProductMutation) IngredientsIDs() (ids []uuid.UUID)

IngredientsIDs returns the "ingredients" edge IDs in the mutation.

func (*ProductMutation) Locale

func (m *ProductMutation) Locale() (r product.Locale, exists bool)

Locale returns the value of the "locale" field in the mutation.

func (*ProductMutation) Name

func (m *ProductMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ProductMutation) OldCreateTime

func (m *ProductMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Product entity. If the Product 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 (*ProductMutation) OldField

func (m *ProductMutation) 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 (*ProductMutation) OldLocale

func (m *ProductMutation) OldLocale(ctx context.Context) (v product.Locale, err error)

OldLocale returns the old "locale" field's value of the Product entity. If the Product 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 (*ProductMutation) OldName

func (m *ProductMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Product entity. If the Product 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 (*ProductMutation) OldSlug

func (m *ProductMutation) OldSlug(ctx context.Context) (v string, err error)

OldSlug returns the old "slug" field's value of the Product entity. If the Product 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 (*ProductMutation) OldUpdateTime

func (m *ProductMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Product entity. If the Product 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 (*ProductMutation) Op

func (m *ProductMutation) Op() Op

Op returns the operation name.

func (*ProductMutation) RemoveIngredientIDs

func (m *ProductMutation) RemoveIngredientIDs(ids ...uuid.UUID)

RemoveIngredientIDs removes the "ingredients" edge to the Ingredient entity by IDs.

func (*ProductMutation) RemoveRequiredInRecipeIDs

func (m *ProductMutation) RemoveRequiredInRecipeIDs(ids ...uuid.UUID)

RemoveRequiredInRecipeIDs removes the "required_in_recipes" edge to the Recipe entity by IDs.

func (*ProductMutation) RemovedEdges

func (m *ProductMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductMutation) RemovedIDs

func (m *ProductMutation) 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 (*ProductMutation) RemovedIngredientsIDs

func (m *ProductMutation) RemovedIngredientsIDs() (ids []uuid.UUID)

RemovedIngredients returns the removed IDs of the "ingredients" edge to the Ingredient entity.

func (*ProductMutation) RemovedRequiredInRecipesIDs

func (m *ProductMutation) RemovedRequiredInRecipesIDs() (ids []uuid.UUID)

RemovedRequiredInRecipes returns the removed IDs of the "required_in_recipes" edge to the Recipe entity.

func (*ProductMutation) RequiredInRecipesCleared

func (m *ProductMutation) RequiredInRecipesCleared() bool

RequiredInRecipesCleared reports if the "required_in_recipes" edge to the Recipe entity was cleared.

func (*ProductMutation) RequiredInRecipesIDs

func (m *ProductMutation) RequiredInRecipesIDs() (ids []uuid.UUID)

RequiredInRecipesIDs returns the "required_in_recipes" edge IDs in the mutation.

func (*ProductMutation) ResetCreateTime

func (m *ProductMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ProductMutation) ResetEdge

func (m *ProductMutation) 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 (*ProductMutation) ResetField

func (m *ProductMutation) 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 (*ProductMutation) ResetIngredients

func (m *ProductMutation) ResetIngredients()

ResetIngredients resets all changes to the "ingredients" edge.

func (*ProductMutation) ResetLocale

func (m *ProductMutation) ResetLocale()

ResetLocale resets all changes to the "locale" field.

func (*ProductMutation) ResetName

func (m *ProductMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProductMutation) ResetRequiredInRecipes

func (m *ProductMutation) ResetRequiredInRecipes()

ResetRequiredInRecipes resets all changes to the "required_in_recipes" edge.

func (*ProductMutation) ResetSlug

func (m *ProductMutation) ResetSlug()

ResetSlug resets all changes to the "slug" field.

func (*ProductMutation) ResetUpdateTime

func (m *ProductMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ProductMutation) SetCreateTime

func (m *ProductMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ProductMutation) SetField

func (m *ProductMutation) 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 (*ProductMutation) SetID

func (m *ProductMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Product entities.

func (*ProductMutation) SetLocale

func (m *ProductMutation) SetLocale(pr product.Locale)

SetLocale sets the "locale" field.

func (*ProductMutation) SetName

func (m *ProductMutation) SetName(s string)

SetName sets the "name" field.

func (*ProductMutation) SetOp

func (m *ProductMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductMutation) SetSlug

func (m *ProductMutation) SetSlug(s string)

SetSlug sets the "slug" field.

func (*ProductMutation) SetUpdateTime

func (m *ProductMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ProductMutation) Slug

func (m *ProductMutation) Slug() (r string, exists bool)

Slug returns the value of the "slug" field in the mutation.

func (ProductMutation) Tx

func (m ProductMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductMutation) Type

func (m *ProductMutation) Type() string

Type returns the node type of this mutation (Product).

func (*ProductMutation) UpdateTime

func (m *ProductMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ProductMutation) Where

func (m *ProductMutation) Where(ps ...predicate.Product)

Where appends a list predicates to the ProductMutation builder.

func (*ProductMutation) WhereP

func (m *ProductMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProductQuery

type ProductQuery struct {
	// contains filtered or unexported fields
}

ProductQuery is the builder for querying Product entities.

func (*ProductQuery) Aggregate

func (pq *ProductQuery) Aggregate(fns ...AggregateFunc) *ProductSelect

Aggregate returns a ProductSelect configured with the given aggregations.

func (*ProductQuery) All

func (pq *ProductQuery) All(ctx context.Context) ([]*Product, error)

All executes the query and returns a list of Products.

func (*ProductQuery) AllX

func (pq *ProductQuery) AllX(ctx context.Context) []*Product

AllX is like All, but panics if an error occurs.

func (*ProductQuery) Clone

func (pq *ProductQuery) Clone() *ProductQuery

Clone returns a duplicate of the ProductQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductQuery) Count

func (pq *ProductQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductQuery) CountX

func (pq *ProductQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductQuery) Exist

func (pq *ProductQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductQuery) ExistX

func (pq *ProductQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductQuery) First

func (pq *ProductQuery) First(ctx context.Context) (*Product, error)

First returns the first Product entity from the query. Returns a *NotFoundError when no Product was found.

func (*ProductQuery) FirstID

func (pq *ProductQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Product ID from the query. Returns a *NotFoundError when no Product ID was found.

func (*ProductQuery) FirstIDX

func (pq *ProductQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProductQuery) FirstX

func (pq *ProductQuery) FirstX(ctx context.Context) *Product

FirstX is like First, but panics if an error occurs.

func (*ProductQuery) GroupBy

func (pq *ProductQuery) GroupBy(field string, fields ...string) *ProductGroupBy

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.Product.Query().
	GroupBy(product.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductQuery) IDs

func (pq *ProductQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Product IDs.

func (*ProductQuery) IDsX

func (pq *ProductQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ProductQuery) Limit

func (pq *ProductQuery) Limit(limit int) *ProductQuery

Limit the number of records to be returned by this query.

func (*ProductQuery) Offset

func (pq *ProductQuery) Offset(offset int) *ProductQuery

Offset to start from.

func (*ProductQuery) Only

func (pq *ProductQuery) Only(ctx context.Context) (*Product, error)

Only returns a single Product entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Product entity is found. Returns a *NotFoundError when no Product entities are found.

func (*ProductQuery) OnlyID

func (pq *ProductQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Product ID in the query. Returns a *NotSingularError when more than one Product ID is found. Returns a *NotFoundError when no entities are found.

func (*ProductQuery) OnlyIDX

func (pq *ProductQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProductQuery) OnlyX

func (pq *ProductQuery) OnlyX(ctx context.Context) *Product

OnlyX is like Only, but panics if an error occurs.

func (*ProductQuery) Order

func (pq *ProductQuery) Order(o ...product.OrderOption) *ProductQuery

Order specifies how the records should be ordered.

func (*ProductQuery) QueryIngredients

func (pq *ProductQuery) QueryIngredients() *IngredientQuery

QueryIngredients chains the current query on the "ingredients" edge.

func (*ProductQuery) QueryRequiredInRecipes

func (pq *ProductQuery) QueryRequiredInRecipes() *RecipeQuery

QueryRequiredInRecipes chains the current query on the "required_in_recipes" edge.

func (*ProductQuery) Select

func (pq *ProductQuery) Select(fields ...string) *ProductSelect

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.Product.Query().
	Select(product.FieldCreateTime).
	Scan(ctx, &v)

func (*ProductQuery) Unique

func (pq *ProductQuery) Unique(unique bool) *ProductQuery

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 (*ProductQuery) Where

func (pq *ProductQuery) Where(ps ...predicate.Product) *ProductQuery

Where adds a new predicate for the ProductQuery builder.

func (*ProductQuery) WithIngredients

func (pq *ProductQuery) WithIngredients(opts ...func(*IngredientQuery)) *ProductQuery

WithIngredients tells the query-builder to eager-load the nodes that are connected to the "ingredients" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProductQuery) WithRequiredInRecipes

func (pq *ProductQuery) WithRequiredInRecipes(opts ...func(*RecipeQuery)) *ProductQuery

WithRequiredInRecipes tells the query-builder to eager-load the nodes that are connected to the "required_in_recipes" edge. The optional arguments are used to configure the query builder of the edge.

type ProductSelect

type ProductSelect struct {
	*ProductQuery
	// contains filtered or unexported fields
}

ProductSelect is the builder for selecting fields of Product entities.

func (*ProductSelect) Aggregate

func (ps *ProductSelect) Aggregate(fns ...AggregateFunc) *ProductSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductSelect) Bool

func (s *ProductSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductSelect) BoolX

func (s *ProductSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductSelect) Bools

func (s *ProductSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductSelect) BoolsX

func (s *ProductSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductSelect) Float64

func (s *ProductSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductSelect) Float64X

func (s *ProductSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductSelect) Float64s

func (s *ProductSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductSelect) Float64sX

func (s *ProductSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductSelect) Int

func (s *ProductSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductSelect) IntX

func (s *ProductSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductSelect) Ints

func (s *ProductSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductSelect) IntsX

func (s *ProductSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductSelect) Scan

func (ps *ProductSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductSelect) ScanX

func (s *ProductSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductSelect) String

func (s *ProductSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductSelect) StringX

func (s *ProductSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductSelect) Strings

func (s *ProductSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductSelect) StringsX

func (s *ProductSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductUpdate

type ProductUpdate struct {
	// contains filtered or unexported fields
}

ProductUpdate is the builder for updating Product entities.

func (*ProductUpdate) AddIngredientIDs

func (pu *ProductUpdate) AddIngredientIDs(ids ...uuid.UUID) *ProductUpdate

AddIngredientIDs adds the "ingredients" edge to the Ingredient entity by IDs.

func (*ProductUpdate) AddIngredients

func (pu *ProductUpdate) AddIngredients(i ...*Ingredient) *ProductUpdate

AddIngredients adds the "ingredients" edges to the Ingredient entity.

func (*ProductUpdate) AddRequiredInRecipeIDs

func (pu *ProductUpdate) AddRequiredInRecipeIDs(ids ...uuid.UUID) *ProductUpdate

AddRequiredInRecipeIDs adds the "required_in_recipes" edge to the Recipe entity by IDs.

func (*ProductUpdate) AddRequiredInRecipes

func (pu *ProductUpdate) AddRequiredInRecipes(r ...*Recipe) *ProductUpdate

AddRequiredInRecipes adds the "required_in_recipes" edges to the Recipe entity.

func (*ProductUpdate) ClearIngredients

func (pu *ProductUpdate) ClearIngredients() *ProductUpdate

ClearIngredients clears all "ingredients" edges to the Ingredient entity.

func (*ProductUpdate) ClearRequiredInRecipes

func (pu *ProductUpdate) ClearRequiredInRecipes() *ProductUpdate

ClearRequiredInRecipes clears all "required_in_recipes" edges to the Recipe entity.

func (*ProductUpdate) Exec

func (pu *ProductUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductUpdate) ExecX

func (pu *ProductUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpdate) Mutation

func (pu *ProductUpdate) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductUpdate) RemoveIngredientIDs

func (pu *ProductUpdate) RemoveIngredientIDs(ids ...uuid.UUID) *ProductUpdate

RemoveIngredientIDs removes the "ingredients" edge to Ingredient entities by IDs.

func (*ProductUpdate) RemoveIngredients

func (pu *ProductUpdate) RemoveIngredients(i ...*Ingredient) *ProductUpdate

RemoveIngredients removes "ingredients" edges to Ingredient entities.

func (*ProductUpdate) RemoveRequiredInRecipeIDs

func (pu *ProductUpdate) RemoveRequiredInRecipeIDs(ids ...uuid.UUID) *ProductUpdate

RemoveRequiredInRecipeIDs removes the "required_in_recipes" edge to Recipe entities by IDs.

func (*ProductUpdate) RemoveRequiredInRecipes

func (pu *ProductUpdate) RemoveRequiredInRecipes(r ...*Recipe) *ProductUpdate

RemoveRequiredInRecipes removes "required_in_recipes" edges to Recipe entities.

func (*ProductUpdate) Save

func (pu *ProductUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductUpdate) SaveX

func (pu *ProductUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductUpdate) SetName

func (pu *ProductUpdate) SetName(s string) *ProductUpdate

SetName sets the "name" field.

func (*ProductUpdate) SetNillableName

func (pu *ProductUpdate) SetNillableName(s *string) *ProductUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ProductUpdate) SetNillableSlug

func (pu *ProductUpdate) SetNillableSlug(s *string) *ProductUpdate

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*ProductUpdate) SetSlug

func (pu *ProductUpdate) SetSlug(s string) *ProductUpdate

SetSlug sets the "slug" field.

func (*ProductUpdate) SetUpdateTime

func (pu *ProductUpdate) SetUpdateTime(t time.Time) *ProductUpdate

SetUpdateTime sets the "update_time" field.

func (*ProductUpdate) Where

func (pu *ProductUpdate) Where(ps ...predicate.Product) *ProductUpdate

Where appends a list predicates to the ProductUpdate builder.

type ProductUpdateOne

type ProductUpdateOne struct {
	// contains filtered or unexported fields
}

ProductUpdateOne is the builder for updating a single Product entity.

func (*ProductUpdateOne) AddIngredientIDs

func (puo *ProductUpdateOne) AddIngredientIDs(ids ...uuid.UUID) *ProductUpdateOne

AddIngredientIDs adds the "ingredients" edge to the Ingredient entity by IDs.

func (*ProductUpdateOne) AddIngredients

func (puo *ProductUpdateOne) AddIngredients(i ...*Ingredient) *ProductUpdateOne

AddIngredients adds the "ingredients" edges to the Ingredient entity.

func (*ProductUpdateOne) AddRequiredInRecipeIDs

func (puo *ProductUpdateOne) AddRequiredInRecipeIDs(ids ...uuid.UUID) *ProductUpdateOne

AddRequiredInRecipeIDs adds the "required_in_recipes" edge to the Recipe entity by IDs.

func (*ProductUpdateOne) AddRequiredInRecipes

func (puo *ProductUpdateOne) AddRequiredInRecipes(r ...*Recipe) *ProductUpdateOne

AddRequiredInRecipes adds the "required_in_recipes" edges to the Recipe entity.

func (*ProductUpdateOne) ClearIngredients

func (puo *ProductUpdateOne) ClearIngredients() *ProductUpdateOne

ClearIngredients clears all "ingredients" edges to the Ingredient entity.

func (*ProductUpdateOne) ClearRequiredInRecipes

func (puo *ProductUpdateOne) ClearRequiredInRecipes() *ProductUpdateOne

ClearRequiredInRecipes clears all "required_in_recipes" edges to the Recipe entity.

func (*ProductUpdateOne) Exec

func (puo *ProductUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductUpdateOne) ExecX

func (puo *ProductUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpdateOne) Mutation

func (puo *ProductUpdateOne) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductUpdateOne) RemoveIngredientIDs

func (puo *ProductUpdateOne) RemoveIngredientIDs(ids ...uuid.UUID) *ProductUpdateOne

RemoveIngredientIDs removes the "ingredients" edge to Ingredient entities by IDs.

func (*ProductUpdateOne) RemoveIngredients

func (puo *ProductUpdateOne) RemoveIngredients(i ...*Ingredient) *ProductUpdateOne

RemoveIngredients removes "ingredients" edges to Ingredient entities.

func (*ProductUpdateOne) RemoveRequiredInRecipeIDs

func (puo *ProductUpdateOne) RemoveRequiredInRecipeIDs(ids ...uuid.UUID) *ProductUpdateOne

RemoveRequiredInRecipeIDs removes the "required_in_recipes" edge to Recipe entities by IDs.

func (*ProductUpdateOne) RemoveRequiredInRecipes

func (puo *ProductUpdateOne) RemoveRequiredInRecipes(r ...*Recipe) *ProductUpdateOne

RemoveRequiredInRecipes removes "required_in_recipes" edges to Recipe entities.

func (*ProductUpdateOne) Save

func (puo *ProductUpdateOne) Save(ctx context.Context) (*Product, error)

Save executes the query and returns the updated Product entity.

func (*ProductUpdateOne) SaveX

func (puo *ProductUpdateOne) SaveX(ctx context.Context) *Product

SaveX is like Save, but panics if an error occurs.

func (*ProductUpdateOne) Select

func (puo *ProductUpdateOne) Select(field string, fields ...string) *ProductUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductUpdateOne) SetName

func (puo *ProductUpdateOne) SetName(s string) *ProductUpdateOne

SetName sets the "name" field.

func (*ProductUpdateOne) SetNillableName

func (puo *ProductUpdateOne) SetNillableName(s *string) *ProductUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableSlug

func (puo *ProductUpdateOne) SetNillableSlug(s *string) *ProductUpdateOne

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*ProductUpdateOne) SetSlug

func (puo *ProductUpdateOne) SetSlug(s string) *ProductUpdateOne

SetSlug sets the "slug" field.

func (*ProductUpdateOne) SetUpdateTime

func (puo *ProductUpdateOne) SetUpdateTime(t time.Time) *ProductUpdateOne

SetUpdateTime sets the "update_time" field.

func (*ProductUpdateOne) Where

Where appends a list predicates to the ProductUpdate builder.

type Products

type Products []*Product

Products is a parsable slice of Product.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type Recipe

type Recipe 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 recipe.Locale `json:"locale,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Slug holds the value of the "slug" field.
	Slug string `json:"slug,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// Rating holds the value of the "rating" field.
	Rating float32 `json:"rating,omitempty"`
	// Servings holds the value of the "servings" field.
	Servings *int `json:"servings,omitempty"`
	// Time holds the value of the "time" field.
	Time *time.Duration `json:"time,omitempty"`
	// Published holds the value of the "published" field.
	Published bool `json:"published,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RecipeQuery when eager-loading is set.
	Edges RecipeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Recipe is the model entity for the Recipe schema.

func (*Recipe) QueryEquipment

func (r *Recipe) QueryEquipment() *EquipmentQuery

QueryEquipment queries the "equipment" edge of the Recipe entity.

func (*Recipe) QueryIdeas

func (r *Recipe) QueryIdeas() *IdeaQuery

QueryIdeas queries the "ideas" edge of the Recipe entity.

func (*Recipe) QueryIngredients

func (r *Recipe) QueryIngredients() *IngredientQuery

QueryIngredients queries the "ingredients" edge of the Recipe entity.

func (*Recipe) QueryInstructions

func (r *Recipe) QueryInstructions() *InstructionQuery

QueryInstructions queries the "instructions" edge of the Recipe entity.

func (*Recipe) QueryNutrition

func (r *Recipe) QueryNutrition() *NutritionQuery

QueryNutrition queries the "nutrition" edge of the Recipe entity.

func (*Recipe) QueryRequiredProducts

func (r *Recipe) QueryRequiredProducts() *ProductQuery

QueryRequiredProducts queries the "required_products" edge of the Recipe entity.

func (*Recipe) QuerySources

func (r *Recipe) QuerySources() *SourceQuery

QuerySources queries the "sources" edge of the Recipe entity.

func (*Recipe) QueryTags

func (r *Recipe) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the Recipe entity.

func (*Recipe) String

func (r *Recipe) String() string

String implements the fmt.Stringer.

func (*Recipe) Unwrap

func (r *Recipe) Unwrap() *Recipe

Unwrap unwraps the Recipe 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 (*Recipe) Update

func (r *Recipe) Update() *RecipeUpdateOne

Update returns a builder for updating this Recipe. Note that you need to call Recipe.Unwrap() before calling this method if this Recipe was returned from a transaction, and the transaction was committed or rolled back.

func (*Recipe) Value

func (r *Recipe) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Recipe. This includes values selected through modifiers, order, etc.

type RecipeClient

type RecipeClient struct {
	// contains filtered or unexported fields
}

RecipeClient is a client for the Recipe schema.

func NewRecipeClient

func NewRecipeClient(c config) *RecipeClient

NewRecipeClient returns a client for the Recipe from the given config.

func (*RecipeClient) Create

func (c *RecipeClient) Create() *RecipeCreate

Create returns a builder for creating a Recipe entity.

func (*RecipeClient) CreateBulk

func (c *RecipeClient) CreateBulk(builders ...*RecipeCreate) *RecipeCreateBulk

CreateBulk returns a builder for creating a bulk of Recipe entities.

func (*RecipeClient) Delete

func (c *RecipeClient) Delete() *RecipeDelete

Delete returns a delete builder for Recipe.

func (*RecipeClient) DeleteOne

func (c *RecipeClient) DeleteOne(r *Recipe) *RecipeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RecipeClient) DeleteOneID

func (c *RecipeClient) DeleteOneID(id uuid.UUID) *RecipeDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RecipeClient) Get

func (c *RecipeClient) Get(ctx context.Context, id uuid.UUID) (*Recipe, error)

Get returns a Recipe entity by its id.

func (*RecipeClient) GetX

func (c *RecipeClient) GetX(ctx context.Context, id uuid.UUID) *Recipe

GetX is like Get, but panics if an error occurs.

func (*RecipeClient) Hooks

func (c *RecipeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RecipeClient) Intercept

func (c *RecipeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `recipe.Intercept(f(g(h())))`.

func (*RecipeClient) Interceptors

func (c *RecipeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RecipeClient) MapCreateBulk

func (c *RecipeClient) MapCreateBulk(slice any, setFunc func(*RecipeCreate, int)) *RecipeCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*RecipeClient) Query

func (c *RecipeClient) Query() *RecipeQuery

Query returns a query builder for Recipe.

func (*RecipeClient) QueryEquipment

func (c *RecipeClient) QueryEquipment(r *Recipe) *EquipmentQuery

QueryEquipment queries the equipment edge of a Recipe.

func (*RecipeClient) QueryIdeas

func (c *RecipeClient) QueryIdeas(r *Recipe) *IdeaQuery

QueryIdeas queries the ideas edge of a Recipe.

func (*RecipeClient) QueryIngredients

func (c *RecipeClient) QueryIngredients(r *Recipe) *IngredientQuery

QueryIngredients queries the ingredients edge of a Recipe.

func (*RecipeClient) QueryInstructions

func (c *RecipeClient) QueryInstructions(r *Recipe) *InstructionQuery

QueryInstructions queries the instructions edge of a Recipe.

func (*RecipeClient) QueryNutrition

func (c *RecipeClient) QueryNutrition(r *Recipe) *NutritionQuery

QueryNutrition queries the nutrition edge of a Recipe.

func (*RecipeClient) QueryRequiredProducts

func (c *RecipeClient) QueryRequiredProducts(r *Recipe) *ProductQuery

QueryRequiredProducts queries the required_products edge of a Recipe.

func (*RecipeClient) QuerySources

func (c *RecipeClient) QuerySources(r *Recipe) *SourceQuery

QuerySources queries the sources edge of a Recipe.

func (*RecipeClient) QueryTags

func (c *RecipeClient) QueryTags(r *Recipe) *TagQuery

QueryTags queries the tags edge of a Recipe.

func (*RecipeClient) Update

func (c *RecipeClient) Update() *RecipeUpdate

Update returns an update builder for Recipe.

func (*RecipeClient) UpdateOne

func (c *RecipeClient) UpdateOne(r *Recipe) *RecipeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RecipeClient) UpdateOneID

func (c *RecipeClient) UpdateOneID(id uuid.UUID) *RecipeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RecipeClient) Use

func (c *RecipeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `recipe.Hooks(f(g(h())))`.

type RecipeCreate

type RecipeCreate struct {
	// contains filtered or unexported fields
}

RecipeCreate is the builder for creating a Recipe entity.

func (*RecipeCreate) AddEquipment

func (rc *RecipeCreate) AddEquipment(e ...*Equipment) *RecipeCreate

AddEquipment adds the "equipment" edges to the Equipment entity.

func (*RecipeCreate) AddEquipmentIDs

func (rc *RecipeCreate) AddEquipmentIDs(ids ...uuid.UUID) *RecipeCreate

AddEquipmentIDs adds the "equipment" edge to the Equipment entity by IDs.

func (*RecipeCreate) AddIdeaIDs

func (rc *RecipeCreate) AddIdeaIDs(ids ...uuid.UUID) *RecipeCreate

AddIdeaIDs adds the "ideas" edge to the Idea entity by IDs.

func (*RecipeCreate) AddIdeas

func (rc *RecipeCreate) AddIdeas(i ...*Idea) *RecipeCreate

AddIdeas adds the "ideas" edges to the Idea entity.

func (*RecipeCreate) AddIngredientIDs

func (rc *RecipeCreate) AddIngredientIDs(ids ...uuid.UUID) *RecipeCreate

AddIngredientIDs adds the "ingredients" edge to the Ingredient entity by IDs.

func (*RecipeCreate) AddIngredients

func (rc *RecipeCreate) AddIngredients(i ...*Ingredient) *RecipeCreate

AddIngredients adds the "ingredients" edges to the Ingredient entity.

func (*RecipeCreate) AddInstructionIDs

func (rc *RecipeCreate) AddInstructionIDs(ids ...uuid.UUID) *RecipeCreate

AddInstructionIDs adds the "instructions" edge to the Instruction entity by IDs.

func (*RecipeCreate) AddInstructions

func (rc *RecipeCreate) AddInstructions(i ...*Instruction) *RecipeCreate

AddInstructions adds the "instructions" edges to the Instruction entity.

func (*RecipeCreate) AddRequiredProductIDs

func (rc *RecipeCreate) AddRequiredProductIDs(ids ...uuid.UUID) *RecipeCreate

AddRequiredProductIDs adds the "required_products" edge to the Product entity by IDs.

func (*RecipeCreate) AddRequiredProducts

func (rc *RecipeCreate) AddRequiredProducts(p ...*Product) *RecipeCreate

AddRequiredProducts adds the "required_products" edges to the Product entity.

func (*RecipeCreate) AddSourceIDs

func (rc *RecipeCreate) AddSourceIDs(ids ...uuid.UUID) *RecipeCreate

AddSourceIDs adds the "sources" edge to the Source entity by IDs.

func (*RecipeCreate) AddSources

func (rc *RecipeCreate) AddSources(s ...*Source) *RecipeCreate

AddSources adds the "sources" edges to the Source entity.

func (*RecipeCreate) AddTagIDs

func (rc *RecipeCreate) AddTagIDs(ids ...uuid.UUID) *RecipeCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*RecipeCreate) AddTags

func (rc *RecipeCreate) AddTags(t ...*Tag) *RecipeCreate

AddTags adds the "tags" edges to the Tag entity.

func (*RecipeCreate) Exec

func (rc *RecipeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RecipeCreate) ExecX

func (rc *RecipeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RecipeCreate) Mutation

func (rc *RecipeCreate) Mutation() *RecipeMutation

Mutation returns the RecipeMutation object of the builder.

func (*RecipeCreate) Save

func (rc *RecipeCreate) Save(ctx context.Context) (*Recipe, error)

Save creates the Recipe in the database.

func (*RecipeCreate) SaveX

func (rc *RecipeCreate) SaveX(ctx context.Context) *Recipe

SaveX calls Save and panics if Save returns an error.

func (*RecipeCreate) SetCreateTime

func (rc *RecipeCreate) SetCreateTime(t time.Time) *RecipeCreate

SetCreateTime sets the "create_time" field.

func (*RecipeCreate) SetDescription

func (rc *RecipeCreate) SetDescription(s string) *RecipeCreate

SetDescription sets the "description" field.

func (*RecipeCreate) SetID

func (rc *RecipeCreate) SetID(u uuid.UUID) *RecipeCreate

SetID sets the "id" field.

func (*RecipeCreate) SetLocale

func (rc *RecipeCreate) SetLocale(r recipe.Locale) *RecipeCreate

SetLocale sets the "locale" field.

func (*RecipeCreate) SetName

func (rc *RecipeCreate) SetName(s string) *RecipeCreate

SetName sets the "name" field.

func (*RecipeCreate) SetNillableCreateTime

func (rc *RecipeCreate) SetNillableCreateTime(t *time.Time) *RecipeCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*RecipeCreate) SetNillableID

func (rc *RecipeCreate) SetNillableID(u *uuid.UUID) *RecipeCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*RecipeCreate) SetNillableLocale

func (rc *RecipeCreate) SetNillableLocale(r *recipe.Locale) *RecipeCreate

SetNillableLocale sets the "locale" field if the given value is not nil.

func (*RecipeCreate) SetNillableNutritionID

func (rc *RecipeCreate) SetNillableNutritionID(id *int) *RecipeCreate

SetNillableNutritionID sets the "nutrition" edge to the Nutrition entity by ID if the given value is not nil.

func (*RecipeCreate) SetNillablePublished

func (rc *RecipeCreate) SetNillablePublished(b *bool) *RecipeCreate

SetNillablePublished sets the "published" field if the given value is not nil.

func (*RecipeCreate) SetNillableRating

func (rc *RecipeCreate) SetNillableRating(f *float32) *RecipeCreate

SetNillableRating sets the "rating" field if the given value is not nil.

func (*RecipeCreate) SetNillableServings

func (rc *RecipeCreate) SetNillableServings(i *int) *RecipeCreate

SetNillableServings sets the "servings" field if the given value is not nil.

func (*RecipeCreate) SetNillableTime

func (rc *RecipeCreate) SetNillableTime(t *time.Duration) *RecipeCreate

SetNillableTime sets the "time" field if the given value is not nil.

func (*RecipeCreate) SetNillableUpdateTime

func (rc *RecipeCreate) SetNillableUpdateTime(t *time.Time) *RecipeCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*RecipeCreate) SetNutrition

func (rc *RecipeCreate) SetNutrition(n *Nutrition) *RecipeCreate

SetNutrition sets the "nutrition" edge to the Nutrition entity.

func (*RecipeCreate) SetNutritionID

func (rc *RecipeCreate) SetNutritionID(id int) *RecipeCreate

SetNutritionID sets the "nutrition" edge to the Nutrition entity by ID.

func (*RecipeCreate) SetPublished

func (rc *RecipeCreate) SetPublished(b bool) *RecipeCreate

SetPublished sets the "published" field.

func (*RecipeCreate) SetRating

func (rc *RecipeCreate) SetRating(f float32) *RecipeCreate

SetRating sets the "rating" field.

func (*RecipeCreate) SetServings

func (rc *RecipeCreate) SetServings(i int) *RecipeCreate

SetServings sets the "servings" field.

func (*RecipeCreate) SetSlug

func (rc *RecipeCreate) SetSlug(s string) *RecipeCreate

SetSlug sets the "slug" field.

func (*RecipeCreate) SetText

func (rc *RecipeCreate) SetText(s string) *RecipeCreate

SetText sets the "text" field.

func (*RecipeCreate) SetTime

func (rc *RecipeCreate) SetTime(t time.Duration) *RecipeCreate

SetTime sets the "time" field.

func (*RecipeCreate) SetUpdateTime

func (rc *RecipeCreate) SetUpdateTime(t time.Time) *RecipeCreate

SetUpdateTime sets the "update_time" field.

type RecipeCreateBulk

type RecipeCreateBulk struct {
	// contains filtered or unexported fields
}

RecipeCreateBulk is the builder for creating many Recipe entities in bulk.

func (*RecipeCreateBulk) Exec

func (rcb *RecipeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RecipeCreateBulk) ExecX

func (rcb *RecipeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RecipeCreateBulk) Save

func (rcb *RecipeCreateBulk) Save(ctx context.Context) ([]*Recipe, error)

Save creates the Recipe entities in the database.

func (*RecipeCreateBulk) SaveX

func (rcb *RecipeCreateBulk) SaveX(ctx context.Context) []*Recipe

SaveX is like Save, but panics if an error occurs.

type RecipeDelete

type RecipeDelete struct {
	// contains filtered or unexported fields
}

RecipeDelete is the builder for deleting a Recipe entity.

func (*RecipeDelete) Exec

func (rd *RecipeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RecipeDelete) ExecX

func (rd *RecipeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RecipeDelete) Where

func (rd *RecipeDelete) Where(ps ...predicate.Recipe) *RecipeDelete

Where appends a list predicates to the RecipeDelete builder.

type RecipeDeleteOne

type RecipeDeleteOne struct {
	// contains filtered or unexported fields
}

RecipeDeleteOne is the builder for deleting a single Recipe entity.

func (*RecipeDeleteOne) Exec

func (rdo *RecipeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RecipeDeleteOne) ExecX

func (rdo *RecipeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RecipeDeleteOne) Where

func (rdo *RecipeDeleteOne) Where(ps ...predicate.Recipe) *RecipeDeleteOne

Where appends a list predicates to the RecipeDelete builder.

type RecipeEdges

type RecipeEdges struct {
	// RequiredProducts holds the value of the required_products edge.
	RequiredProducts []*Product `json:"required_products,omitempty"`
	// Instructions holds the value of the instructions edge.
	Instructions []*Instruction `json:"instructions,omitempty"`
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// Equipment holds the value of the equipment edge.
	Equipment []*Equipment `json:"equipment,omitempty"`
	// Ideas holds the value of the ideas edge.
	Ideas []*Idea `json:"ideas,omitempty"`
	// Sources holds the value of the sources edge.
	Sources []*Source `json:"sources,omitempty"`
	// Nutrition holds the value of the nutrition edge.
	Nutrition *Nutrition `json:"nutrition,omitempty"`
	// Ingredients holds the value of the ingredients edge.
	Ingredients []*Ingredient `json:"ingredients,omitempty"`
	// contains filtered or unexported fields
}

RecipeEdges holds the relations/edges for other nodes in the graph.

func (RecipeEdges) EquipmentOrErr

func (e RecipeEdges) EquipmentOrErr() ([]*Equipment, error)

EquipmentOrErr returns the Equipment value or an error if the edge was not loaded in eager-loading.

func (RecipeEdges) IdeasOrErr

func (e RecipeEdges) IdeasOrErr() ([]*Idea, error)

IdeasOrErr returns the Ideas value or an error if the edge was not loaded in eager-loading.

func (RecipeEdges) IngredientsOrErr

func (e RecipeEdges) IngredientsOrErr() ([]*Ingredient, error)

IngredientsOrErr returns the Ingredients value or an error if the edge was not loaded in eager-loading.

func (RecipeEdges) InstructionsOrErr

func (e RecipeEdges) InstructionsOrErr() ([]*Instruction, error)

InstructionsOrErr returns the Instructions value or an error if the edge was not loaded in eager-loading.

func (RecipeEdges) NutritionOrErr

func (e RecipeEdges) NutritionOrErr() (*Nutrition, error)

NutritionOrErr returns the Nutrition value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (RecipeEdges) RequiredProductsOrErr

func (e RecipeEdges) RequiredProductsOrErr() ([]*Product, error)

RequiredProductsOrErr returns the RequiredProducts value or an error if the edge was not loaded in eager-loading.

func (RecipeEdges) SourcesOrErr

func (e RecipeEdges) SourcesOrErr() ([]*Source, error)

SourcesOrErr returns the Sources value or an error if the edge was not loaded in eager-loading.

func (RecipeEdges) TagsOrErr

func (e RecipeEdges) TagsOrErr() ([]*Tag, error)

TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading.

type RecipeGroupBy

type RecipeGroupBy struct {
	// contains filtered or unexported fields
}

RecipeGroupBy is the group-by builder for Recipe entities.

func (*RecipeGroupBy) Aggregate

func (rgb *RecipeGroupBy) Aggregate(fns ...AggregateFunc) *RecipeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RecipeGroupBy) Bool

func (s *RecipeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RecipeGroupBy) BoolX

func (s *RecipeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RecipeGroupBy) Bools

func (s *RecipeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RecipeGroupBy) BoolsX

func (s *RecipeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RecipeGroupBy) Float64

func (s *RecipeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RecipeGroupBy) Float64X

func (s *RecipeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RecipeGroupBy) Float64s

func (s *RecipeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RecipeGroupBy) Float64sX

func (s *RecipeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RecipeGroupBy) Int

func (s *RecipeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RecipeGroupBy) IntX

func (s *RecipeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RecipeGroupBy) Ints

func (s *RecipeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RecipeGroupBy) IntsX

func (s *RecipeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RecipeGroupBy) Scan

func (rgb *RecipeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RecipeGroupBy) ScanX

func (s *RecipeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RecipeGroupBy) String

func (s *RecipeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RecipeGroupBy) StringX

func (s *RecipeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RecipeGroupBy) Strings

func (s *RecipeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RecipeGroupBy) StringsX

func (s *RecipeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RecipeMutation

type RecipeMutation struct {
	// contains filtered or unexported fields
}

RecipeMutation represents an operation that mutates the Recipe nodes in the graph.

func (*RecipeMutation) AddEquipmentIDs

func (m *RecipeMutation) AddEquipmentIDs(ids ...uuid.UUID)

AddEquipmentIDs adds the "equipment" edge to the Equipment entity by ids.

func (*RecipeMutation) AddField

func (m *RecipeMutation) 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 (*RecipeMutation) AddIdeaIDs

func (m *RecipeMutation) AddIdeaIDs(ids ...uuid.UUID)

AddIdeaIDs adds the "ideas" edge to the Idea entity by ids.

func (*RecipeMutation) AddIngredientIDs

func (m *RecipeMutation) AddIngredientIDs(ids ...uuid.UUID)

AddIngredientIDs adds the "ingredients" edge to the Ingredient entity by ids.

func (*RecipeMutation) AddInstructionIDs

func (m *RecipeMutation) AddInstructionIDs(ids ...uuid.UUID)

AddInstructionIDs adds the "instructions" edge to the Instruction entity by ids.

func (*RecipeMutation) AddRating

func (m *RecipeMutation) AddRating(f float32)

AddRating adds f to the "rating" field.

func (*RecipeMutation) AddRequiredProductIDs

func (m *RecipeMutation) AddRequiredProductIDs(ids ...uuid.UUID)

AddRequiredProductIDs adds the "required_products" edge to the Product entity by ids.

func (*RecipeMutation) AddServings

func (m *RecipeMutation) AddServings(i int)

AddServings adds i to the "servings" field.

func (*RecipeMutation) AddSourceIDs

func (m *RecipeMutation) AddSourceIDs(ids ...uuid.UUID)

AddSourceIDs adds the "sources" edge to the Source entity by ids.

func (*RecipeMutation) AddTagIDs

func (m *RecipeMutation) AddTagIDs(ids ...uuid.UUID)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*RecipeMutation) AddTime

func (m *RecipeMutation) AddTime(t time.Duration)

AddTime adds t to the "time" field.

func (*RecipeMutation) AddedEdges

func (m *RecipeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RecipeMutation) AddedField

func (m *RecipeMutation) 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 (*RecipeMutation) AddedFields

func (m *RecipeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RecipeMutation) AddedIDs

func (m *RecipeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RecipeMutation) AddedRating

func (m *RecipeMutation) AddedRating() (r float32, exists bool)

AddedRating returns the value that was added to the "rating" field in this mutation.

func (*RecipeMutation) AddedServings

func (m *RecipeMutation) AddedServings() (r int, exists bool)

AddedServings returns the value that was added to the "servings" field in this mutation.

func (*RecipeMutation) AddedTime

func (m *RecipeMutation) AddedTime() (r time.Duration, exists bool)

AddedTime returns the value that was added to the "time" field in this mutation.

func (*RecipeMutation) ClearEdge

func (m *RecipeMutation) 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 (*RecipeMutation) ClearEquipment

func (m *RecipeMutation) ClearEquipment()

ClearEquipment clears the "equipment" edge to the Equipment entity.

func (*RecipeMutation) ClearField

func (m *RecipeMutation) 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 (*RecipeMutation) ClearIdeas

func (m *RecipeMutation) ClearIdeas()

ClearIdeas clears the "ideas" edge to the Idea entity.

func (*RecipeMutation) ClearIngredients

func (m *RecipeMutation) ClearIngredients()

ClearIngredients clears the "ingredients" edge to the Ingredient entity.

func (*RecipeMutation) ClearInstructions

func (m *RecipeMutation) ClearInstructions()

ClearInstructions clears the "instructions" edge to the Instruction entity.

func (*RecipeMutation) ClearNutrition

func (m *RecipeMutation) ClearNutrition()

ClearNutrition clears the "nutrition" edge to the Nutrition entity.

func (*RecipeMutation) ClearRating

func (m *RecipeMutation) ClearRating()

ClearRating clears the value of the "rating" field.

func (*RecipeMutation) ClearRequiredProducts

func (m *RecipeMutation) ClearRequiredProducts()

ClearRequiredProducts clears the "required_products" edge to the Product entity.

func (*RecipeMutation) ClearServings

func (m *RecipeMutation) ClearServings()

ClearServings clears the value of the "servings" field.

func (*RecipeMutation) ClearSources

func (m *RecipeMutation) ClearSources()

ClearSources clears the "sources" edge to the Source entity.

func (*RecipeMutation) ClearTags

func (m *RecipeMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*RecipeMutation) ClearTime

func (m *RecipeMutation) ClearTime()

ClearTime clears the value of the "time" field.

func (*RecipeMutation) ClearedEdges

func (m *RecipeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RecipeMutation) ClearedFields

func (m *RecipeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RecipeMutation) Client

func (m RecipeMutation) 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 (*RecipeMutation) CreateTime

func (m *RecipeMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*RecipeMutation) Description

func (m *RecipeMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*RecipeMutation) EdgeCleared

func (m *RecipeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RecipeMutation) EquipmentCleared

func (m *RecipeMutation) EquipmentCleared() bool

EquipmentCleared reports if the "equipment" edge to the Equipment entity was cleared.

func (*RecipeMutation) EquipmentIDs

func (m *RecipeMutation) EquipmentIDs() (ids []uuid.UUID)

EquipmentIDs returns the "equipment" edge IDs in the mutation.

func (*RecipeMutation) Field

func (m *RecipeMutation) 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 (*RecipeMutation) FieldCleared

func (m *RecipeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RecipeMutation) Fields

func (m *RecipeMutation) 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 (*RecipeMutation) ID

func (m *RecipeMutation) 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 (*RecipeMutation) IDs

func (m *RecipeMutation) 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 (*RecipeMutation) IdeasCleared

func (m *RecipeMutation) IdeasCleared() bool

IdeasCleared reports if the "ideas" edge to the Idea entity was cleared.

func (*RecipeMutation) IdeasIDs

func (m *RecipeMutation) IdeasIDs() (ids []uuid.UUID)

IdeasIDs returns the "ideas" edge IDs in the mutation.

func (*RecipeMutation) IngredientsCleared

func (m *RecipeMutation) IngredientsCleared() bool

IngredientsCleared reports if the "ingredients" edge to the Ingredient entity was cleared.

func (*RecipeMutation) IngredientsIDs

func (m *RecipeMutation) IngredientsIDs() (ids []uuid.UUID)

IngredientsIDs returns the "ingredients" edge IDs in the mutation.

func (*RecipeMutation) InstructionsCleared

func (m *RecipeMutation) InstructionsCleared() bool

InstructionsCleared reports if the "instructions" edge to the Instruction entity was cleared.

func (*RecipeMutation) InstructionsIDs

func (m *RecipeMutation) InstructionsIDs() (ids []uuid.UUID)

InstructionsIDs returns the "instructions" edge IDs in the mutation.

func (*RecipeMutation) Locale

func (m *RecipeMutation) Locale() (r recipe.Locale, exists bool)

Locale returns the value of the "locale" field in the mutation.

func (*RecipeMutation) Name

func (m *RecipeMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*RecipeMutation) NutritionCleared

func (m *RecipeMutation) NutritionCleared() bool

NutritionCleared reports if the "nutrition" edge to the Nutrition entity was cleared.

func (*RecipeMutation) NutritionID

func (m *RecipeMutation) NutritionID() (id int, exists bool)

NutritionID returns the "nutrition" edge ID in the mutation.

func (*RecipeMutation) NutritionIDs

func (m *RecipeMutation) NutritionIDs() (ids []int)

NutritionIDs returns the "nutrition" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NutritionID instead. It exists only for internal usage by the builders.

func (*RecipeMutation) OldCreateTime

func (m *RecipeMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Recipe entity. If the Recipe 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 (*RecipeMutation) OldDescription

func (m *RecipeMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Recipe entity. If the Recipe 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 (*RecipeMutation) OldField

func (m *RecipeMutation) 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 (*RecipeMutation) OldLocale

func (m *RecipeMutation) OldLocale(ctx context.Context) (v recipe.Locale, err error)

OldLocale returns the old "locale" field's value of the Recipe entity. If the Recipe 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 (*RecipeMutation) OldName

func (m *RecipeMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Recipe entity. If the Recipe 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 (*RecipeMutation) OldPublished

func (m *RecipeMutation) OldPublished(ctx context.Context) (v bool, err error)

OldPublished returns the old "published" field's value of the Recipe entity. If the Recipe 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 (*RecipeMutation) OldRating

func (m *RecipeMutation) OldRating(ctx context.Context) (v float32, err error)

OldRating returns the old "rating" field's value of the Recipe entity. If the Recipe 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 (*RecipeMutation) OldServings

func (m *RecipeMutation) OldServings(ctx context.Context) (v *int, err error)

OldServings returns the old "servings" field's value of the Recipe entity. If the Recipe 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 (*RecipeMutation) OldSlug

func (m *RecipeMutation) OldSlug(ctx context.Context) (v string, err error)

OldSlug returns the old "slug" field's value of the Recipe entity. If the Recipe 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 (*RecipeMutation) OldText

func (m *RecipeMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Recipe entity. If the Recipe 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 (*RecipeMutation) OldTime

func (m *RecipeMutation) OldTime(ctx context.Context) (v *time.Duration, err error)

OldTime returns the old "time" field's value of the Recipe entity. If the Recipe 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 (*RecipeMutation) OldUpdateTime

func (m *RecipeMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Recipe entity. If the Recipe 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 (*RecipeMutation) Op

func (m *RecipeMutation) Op() Op

Op returns the operation name.

func (*RecipeMutation) Published

func (m *RecipeMutation) Published() (r bool, exists bool)

Published returns the value of the "published" field in the mutation.

func (*RecipeMutation) Rating

func (m *RecipeMutation) Rating() (r float32, exists bool)

Rating returns the value of the "rating" field in the mutation.

func (*RecipeMutation) RatingCleared

func (m *RecipeMutation) RatingCleared() bool

RatingCleared returns if the "rating" field was cleared in this mutation.

func (*RecipeMutation) RemoveEquipmentIDs

func (m *RecipeMutation) RemoveEquipmentIDs(ids ...uuid.UUID)

RemoveEquipmentIDs removes the "equipment" edge to the Equipment entity by IDs.

func (*RecipeMutation) RemoveIdeaIDs

func (m *RecipeMutation) RemoveIdeaIDs(ids ...uuid.UUID)

RemoveIdeaIDs removes the "ideas" edge to the Idea entity by IDs.

func (*RecipeMutation) RemoveIngredientIDs

func (m *RecipeMutation) RemoveIngredientIDs(ids ...uuid.UUID)

RemoveIngredientIDs removes the "ingredients" edge to the Ingredient entity by IDs.

func (*RecipeMutation) RemoveInstructionIDs

func (m *RecipeMutation) RemoveInstructionIDs(ids ...uuid.UUID)

RemoveInstructionIDs removes the "instructions" edge to the Instruction entity by IDs.

func (*RecipeMutation) RemoveRequiredProductIDs

func (m *RecipeMutation) RemoveRequiredProductIDs(ids ...uuid.UUID)

RemoveRequiredProductIDs removes the "required_products" edge to the Product entity by IDs.

func (*RecipeMutation) RemoveSourceIDs

func (m *RecipeMutation) RemoveSourceIDs(ids ...uuid.UUID)

RemoveSourceIDs removes the "sources" edge to the Source entity by IDs.

func (*RecipeMutation) RemoveTagIDs

func (m *RecipeMutation) RemoveTagIDs(ids ...uuid.UUID)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*RecipeMutation) RemovedEdges

func (m *RecipeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RecipeMutation) RemovedEquipmentIDs

func (m *RecipeMutation) RemovedEquipmentIDs() (ids []uuid.UUID)

RemovedEquipment returns the removed IDs of the "equipment" edge to the Equipment entity.

func (*RecipeMutation) RemovedIDs

func (m *RecipeMutation) 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 (*RecipeMutation) RemovedIdeasIDs

func (m *RecipeMutation) RemovedIdeasIDs() (ids []uuid.UUID)

RemovedIdeas returns the removed IDs of the "ideas" edge to the Idea entity.

func (*RecipeMutation) RemovedIngredientsIDs

func (m *RecipeMutation) RemovedIngredientsIDs() (ids []uuid.UUID)

RemovedIngredients returns the removed IDs of the "ingredients" edge to the Ingredient entity.

func (*RecipeMutation) RemovedInstructionsIDs

func (m *RecipeMutation) RemovedInstructionsIDs() (ids []uuid.UUID)

RemovedInstructions returns the removed IDs of the "instructions" edge to the Instruction entity.

func (*RecipeMutation) RemovedRequiredProductsIDs

func (m *RecipeMutation) RemovedRequiredProductsIDs() (ids []uuid.UUID)

RemovedRequiredProducts returns the removed IDs of the "required_products" edge to the Product entity.

func (*RecipeMutation) RemovedSourcesIDs

func (m *RecipeMutation) RemovedSourcesIDs() (ids []uuid.UUID)

RemovedSources returns the removed IDs of the "sources" edge to the Source entity.

func (*RecipeMutation) RemovedTagsIDs

func (m *RecipeMutation) RemovedTagsIDs() (ids []uuid.UUID)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*RecipeMutation) RequiredProductsCleared

func (m *RecipeMutation) RequiredProductsCleared() bool

RequiredProductsCleared reports if the "required_products" edge to the Product entity was cleared.

func (*RecipeMutation) RequiredProductsIDs

func (m *RecipeMutation) RequiredProductsIDs() (ids []uuid.UUID)

RequiredProductsIDs returns the "required_products" edge IDs in the mutation.

func (*RecipeMutation) ResetCreateTime

func (m *RecipeMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*RecipeMutation) ResetDescription

func (m *RecipeMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*RecipeMutation) ResetEdge

func (m *RecipeMutation) 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 (*RecipeMutation) ResetEquipment

func (m *RecipeMutation) ResetEquipment()

ResetEquipment resets all changes to the "equipment" edge.

func (*RecipeMutation) ResetField

func (m *RecipeMutation) 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 (*RecipeMutation) ResetIdeas

func (m *RecipeMutation) ResetIdeas()

ResetIdeas resets all changes to the "ideas" edge.

func (*RecipeMutation) ResetIngredients

func (m *RecipeMutation) ResetIngredients()

ResetIngredients resets all changes to the "ingredients" edge.

func (*RecipeMutation) ResetInstructions

func (m *RecipeMutation) ResetInstructions()

ResetInstructions resets all changes to the "instructions" edge.

func (*RecipeMutation) ResetLocale

func (m *RecipeMutation) ResetLocale()

ResetLocale resets all changes to the "locale" field.

func (*RecipeMutation) ResetName

func (m *RecipeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RecipeMutation) ResetNutrition

func (m *RecipeMutation) ResetNutrition()

ResetNutrition resets all changes to the "nutrition" edge.

func (*RecipeMutation) ResetPublished

func (m *RecipeMutation) ResetPublished()

ResetPublished resets all changes to the "published" field.

func (*RecipeMutation) ResetRating

func (m *RecipeMutation) ResetRating()

ResetRating resets all changes to the "rating" field.

func (*RecipeMutation) ResetRequiredProducts

func (m *RecipeMutation) ResetRequiredProducts()

ResetRequiredProducts resets all changes to the "required_products" edge.

func (*RecipeMutation) ResetServings

func (m *RecipeMutation) ResetServings()

ResetServings resets all changes to the "servings" field.

func (*RecipeMutation) ResetSlug

func (m *RecipeMutation) ResetSlug()

ResetSlug resets all changes to the "slug" field.

func (*RecipeMutation) ResetSources

func (m *RecipeMutation) ResetSources()

ResetSources resets all changes to the "sources" edge.

func (*RecipeMutation) ResetTags

func (m *RecipeMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*RecipeMutation) ResetText

func (m *RecipeMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*RecipeMutation) ResetTime

func (m *RecipeMutation) ResetTime()

ResetTime resets all changes to the "time" field.

func (*RecipeMutation) ResetUpdateTime

func (m *RecipeMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*RecipeMutation) Servings

func (m *RecipeMutation) Servings() (r int, exists bool)

Servings returns the value of the "servings" field in the mutation.

func (*RecipeMutation) ServingsCleared

func (m *RecipeMutation) ServingsCleared() bool

ServingsCleared returns if the "servings" field was cleared in this mutation.

func (*RecipeMutation) SetCreateTime

func (m *RecipeMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*RecipeMutation) SetDescription

func (m *RecipeMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*RecipeMutation) SetField

func (m *RecipeMutation) 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 (*RecipeMutation) SetID

func (m *RecipeMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Recipe entities.

func (*RecipeMutation) SetLocale

func (m *RecipeMutation) SetLocale(r recipe.Locale)

SetLocale sets the "locale" field.

func (*RecipeMutation) SetName

func (m *RecipeMutation) SetName(s string)

SetName sets the "name" field.

func (*RecipeMutation) SetNutritionID

func (m *RecipeMutation) SetNutritionID(id int)

SetNutritionID sets the "nutrition" edge to the Nutrition entity by id.

func (*RecipeMutation) SetOp

func (m *RecipeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RecipeMutation) SetPublished

func (m *RecipeMutation) SetPublished(b bool)

SetPublished sets the "published" field.

func (*RecipeMutation) SetRating

func (m *RecipeMutation) SetRating(f float32)

SetRating sets the "rating" field.

func (*RecipeMutation) SetServings

func (m *RecipeMutation) SetServings(i int)

SetServings sets the "servings" field.

func (*RecipeMutation) SetSlug

func (m *RecipeMutation) SetSlug(s string)

SetSlug sets the "slug" field.

func (*RecipeMutation) SetText

func (m *RecipeMutation) SetText(s string)

SetText sets the "text" field.

func (*RecipeMutation) SetTime

func (m *RecipeMutation) SetTime(t time.Duration)

SetTime sets the "time" field.

func (*RecipeMutation) SetUpdateTime

func (m *RecipeMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*RecipeMutation) Slug

func (m *RecipeMutation) Slug() (r string, exists bool)

Slug returns the value of the "slug" field in the mutation.

func (*RecipeMutation) SourcesCleared

func (m *RecipeMutation) SourcesCleared() bool

SourcesCleared reports if the "sources" edge to the Source entity was cleared.

func (*RecipeMutation) SourcesIDs

func (m *RecipeMutation) SourcesIDs() (ids []uuid.UUID)

SourcesIDs returns the "sources" edge IDs in the mutation.

func (*RecipeMutation) TagsCleared

func (m *RecipeMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*RecipeMutation) TagsIDs

func (m *RecipeMutation) TagsIDs() (ids []uuid.UUID)

TagsIDs returns the "tags" edge IDs in the mutation.

func (*RecipeMutation) Text

func (m *RecipeMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (*RecipeMutation) Time

func (m *RecipeMutation) Time() (r time.Duration, exists bool)

Time returns the value of the "time" field in the mutation.

func (*RecipeMutation) TimeCleared

func (m *RecipeMutation) TimeCleared() bool

TimeCleared returns if the "time" field was cleared in this mutation.

func (RecipeMutation) Tx

func (m RecipeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RecipeMutation) Type

func (m *RecipeMutation) Type() string

Type returns the node type of this mutation (Recipe).

func (*RecipeMutation) UpdateTime

func (m *RecipeMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*RecipeMutation) Where

func (m *RecipeMutation) Where(ps ...predicate.Recipe)

Where appends a list predicates to the RecipeMutation builder.

func (*RecipeMutation) WhereP

func (m *RecipeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RecipeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RecipeQuery

type RecipeQuery struct {
	// contains filtered or unexported fields
}

RecipeQuery is the builder for querying Recipe entities.

func (*RecipeQuery) Aggregate

func (rq *RecipeQuery) Aggregate(fns ...AggregateFunc) *RecipeSelect

Aggregate returns a RecipeSelect configured with the given aggregations.

func (*RecipeQuery) All

func (rq *RecipeQuery) All(ctx context.Context) ([]*Recipe, error)

All executes the query and returns a list of Recipes.

func (*RecipeQuery) AllX

func (rq *RecipeQuery) AllX(ctx context.Context) []*Recipe

AllX is like All, but panics if an error occurs.

func (*RecipeQuery) Clone

func (rq *RecipeQuery) Clone() *RecipeQuery

Clone returns a duplicate of the RecipeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RecipeQuery) Count

func (rq *RecipeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RecipeQuery) CountX

func (rq *RecipeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RecipeQuery) Exist

func (rq *RecipeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RecipeQuery) ExistX

func (rq *RecipeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RecipeQuery) First

func (rq *RecipeQuery) First(ctx context.Context) (*Recipe, error)

First returns the first Recipe entity from the query. Returns a *NotFoundError when no Recipe was found.

func (*RecipeQuery) FirstID

func (rq *RecipeQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Recipe ID from the query. Returns a *NotFoundError when no Recipe ID was found.

func (*RecipeQuery) FirstIDX

func (rq *RecipeQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*RecipeQuery) FirstX

func (rq *RecipeQuery) FirstX(ctx context.Context) *Recipe

FirstX is like First, but panics if an error occurs.

func (*RecipeQuery) GroupBy

func (rq *RecipeQuery) GroupBy(field string, fields ...string) *RecipeGroupBy

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.Recipe.Query().
	GroupBy(recipe.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RecipeQuery) IDs

func (rq *RecipeQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Recipe IDs.

func (*RecipeQuery) IDsX

func (rq *RecipeQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*RecipeQuery) Limit

func (rq *RecipeQuery) Limit(limit int) *RecipeQuery

Limit the number of records to be returned by this query.

func (*RecipeQuery) Offset

func (rq *RecipeQuery) Offset(offset int) *RecipeQuery

Offset to start from.

func (*RecipeQuery) Only

func (rq *RecipeQuery) Only(ctx context.Context) (*Recipe, error)

Only returns a single Recipe entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Recipe entity is found. Returns a *NotFoundError when no Recipe entities are found.

func (*RecipeQuery) OnlyID

func (rq *RecipeQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Recipe ID in the query. Returns a *NotSingularError when more than one Recipe ID is found. Returns a *NotFoundError when no entities are found.

func (*RecipeQuery) OnlyIDX

func (rq *RecipeQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RecipeQuery) OnlyX

func (rq *RecipeQuery) OnlyX(ctx context.Context) *Recipe

OnlyX is like Only, but panics if an error occurs.

func (*RecipeQuery) Order

func (rq *RecipeQuery) Order(o ...recipe.OrderOption) *RecipeQuery

Order specifies how the records should be ordered.

func (*RecipeQuery) QueryEquipment

func (rq *RecipeQuery) QueryEquipment() *EquipmentQuery

QueryEquipment chains the current query on the "equipment" edge.

func (*RecipeQuery) QueryIdeas

func (rq *RecipeQuery) QueryIdeas() *IdeaQuery

QueryIdeas chains the current query on the "ideas" edge.

func (*RecipeQuery) QueryIngredients

func (rq *RecipeQuery) QueryIngredients() *IngredientQuery

QueryIngredients chains the current query on the "ingredients" edge.

func (*RecipeQuery) QueryInstructions

func (rq *RecipeQuery) QueryInstructions() *InstructionQuery

QueryInstructions chains the current query on the "instructions" edge.

func (*RecipeQuery) QueryNutrition

func (rq *RecipeQuery) QueryNutrition() *NutritionQuery

QueryNutrition chains the current query on the "nutrition" edge.

func (*RecipeQuery) QueryRequiredProducts

func (rq *RecipeQuery) QueryRequiredProducts() *ProductQuery

QueryRequiredProducts chains the current query on the "required_products" edge.

func (*RecipeQuery) QuerySources

func (rq *RecipeQuery) QuerySources() *SourceQuery

QuerySources chains the current query on the "sources" edge.

func (*RecipeQuery) QueryTags

func (rq *RecipeQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*RecipeQuery) Select

func (rq *RecipeQuery) Select(fields ...string) *RecipeSelect

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.Recipe.Query().
	Select(recipe.FieldCreateTime).
	Scan(ctx, &v)

func (*RecipeQuery) Unique

func (rq *RecipeQuery) Unique(unique bool) *RecipeQuery

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 (*RecipeQuery) Where

func (rq *RecipeQuery) Where(ps ...predicate.Recipe) *RecipeQuery

Where adds a new predicate for the RecipeQuery builder.

func (*RecipeQuery) WithEquipment

func (rq *RecipeQuery) WithEquipment(opts ...func(*EquipmentQuery)) *RecipeQuery

WithEquipment tells the query-builder to eager-load the nodes that are connected to the "equipment" edge. The optional arguments are used to configure the query builder of the edge.

func (*RecipeQuery) WithIdeas

func (rq *RecipeQuery) WithIdeas(opts ...func(*IdeaQuery)) *RecipeQuery

WithIdeas tells the query-builder to eager-load the nodes that are connected to the "ideas" edge. The optional arguments are used to configure the query builder of the edge.

func (*RecipeQuery) WithIngredients

func (rq *RecipeQuery) WithIngredients(opts ...func(*IngredientQuery)) *RecipeQuery

WithIngredients tells the query-builder to eager-load the nodes that are connected to the "ingredients" edge. The optional arguments are used to configure the query builder of the edge.

func (*RecipeQuery) WithInstructions

func (rq *RecipeQuery) WithInstructions(opts ...func(*InstructionQuery)) *RecipeQuery

WithInstructions tells the query-builder to eager-load the nodes that are connected to the "instructions" edge. The optional arguments are used to configure the query builder of the edge.

func (*RecipeQuery) WithNutrition

func (rq *RecipeQuery) WithNutrition(opts ...func(*NutritionQuery)) *RecipeQuery

WithNutrition tells the query-builder to eager-load the nodes that are connected to the "nutrition" edge. The optional arguments are used to configure the query builder of the edge.

func (*RecipeQuery) WithRequiredProducts

func (rq *RecipeQuery) WithRequiredProducts(opts ...func(*ProductQuery)) *RecipeQuery

WithRequiredProducts tells the query-builder to eager-load the nodes that are connected to the "required_products" edge. The optional arguments are used to configure the query builder of the edge.

func (*RecipeQuery) WithSources

func (rq *RecipeQuery) WithSources(opts ...func(*SourceQuery)) *RecipeQuery

WithSources tells the query-builder to eager-load the nodes that are connected to the "sources" edge. The optional arguments are used to configure the query builder of the edge.

func (*RecipeQuery) WithTags

func (rq *RecipeQuery) WithTags(opts ...func(*TagQuery)) *RecipeQuery

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.

type RecipeSelect

type RecipeSelect struct {
	*RecipeQuery
	// contains filtered or unexported fields
}

RecipeSelect is the builder for selecting fields of Recipe entities.

func (*RecipeSelect) Aggregate

func (rs *RecipeSelect) Aggregate(fns ...AggregateFunc) *RecipeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RecipeSelect) Bool

func (s *RecipeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RecipeSelect) BoolX

func (s *RecipeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RecipeSelect) Bools

func (s *RecipeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RecipeSelect) BoolsX

func (s *RecipeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RecipeSelect) Float64

func (s *RecipeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RecipeSelect) Float64X

func (s *RecipeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RecipeSelect) Float64s

func (s *RecipeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RecipeSelect) Float64sX

func (s *RecipeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RecipeSelect) Int

func (s *RecipeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RecipeSelect) IntX

func (s *RecipeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RecipeSelect) Ints

func (s *RecipeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RecipeSelect) IntsX

func (s *RecipeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RecipeSelect) Scan

func (rs *RecipeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RecipeSelect) ScanX

func (s *RecipeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RecipeSelect) String

func (s *RecipeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RecipeSelect) StringX

func (s *RecipeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RecipeSelect) Strings

func (s *RecipeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RecipeSelect) StringsX

func (s *RecipeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RecipeUpdate

type RecipeUpdate struct {
	// contains filtered or unexported fields
}

RecipeUpdate is the builder for updating Recipe entities.

func (*RecipeUpdate) AddEquipment

func (ru *RecipeUpdate) AddEquipment(e ...*Equipment) *RecipeUpdate

AddEquipment adds the "equipment" edges to the Equipment entity.

func (*RecipeUpdate) AddEquipmentIDs

func (ru *RecipeUpdate) AddEquipmentIDs(ids ...uuid.UUID) *RecipeUpdate

AddEquipmentIDs adds the "equipment" edge to the Equipment entity by IDs.

func (*RecipeUpdate) AddIdeaIDs

func (ru *RecipeUpdate) AddIdeaIDs(ids ...uuid.UUID) *RecipeUpdate

AddIdeaIDs adds the "ideas" edge to the Idea entity by IDs.

func (*RecipeUpdate) AddIdeas

func (ru *RecipeUpdate) AddIdeas(i ...*Idea) *RecipeUpdate

AddIdeas adds the "ideas" edges to the Idea entity.

func (*RecipeUpdate) AddIngredientIDs

func (ru *RecipeUpdate) AddIngredientIDs(ids ...uuid.UUID) *RecipeUpdate

AddIngredientIDs adds the "ingredients" edge to the Ingredient entity by IDs.

func (*RecipeUpdate) AddIngredients

func (ru *RecipeUpdate) AddIngredients(i ...*Ingredient) *RecipeUpdate

AddIngredients adds the "ingredients" edges to the Ingredient entity.

func (*RecipeUpdate) AddInstructionIDs

func (ru *RecipeUpdate) AddInstructionIDs(ids ...uuid.UUID) *RecipeUpdate

AddInstructionIDs adds the "instructions" edge to the Instruction entity by IDs.

func (*RecipeUpdate) AddInstructions

func (ru *RecipeUpdate) AddInstructions(i ...*Instruction) *RecipeUpdate

AddInstructions adds the "instructions" edges to the Instruction entity.

func (*RecipeUpdate) AddRating

func (ru *RecipeUpdate) AddRating(f float32) *RecipeUpdate

AddRating adds f to the "rating" field.

func (*RecipeUpdate) AddRequiredProductIDs

func (ru *RecipeUpdate) AddRequiredProductIDs(ids ...uuid.UUID) *RecipeUpdate

AddRequiredProductIDs adds the "required_products" edge to the Product entity by IDs.

func (*RecipeUpdate) AddRequiredProducts

func (ru *RecipeUpdate) AddRequiredProducts(p ...*Product) *RecipeUpdate

AddRequiredProducts adds the "required_products" edges to the Product entity.

func (*RecipeUpdate) AddServings

func (ru *RecipeUpdate) AddServings(i int) *RecipeUpdate

AddServings adds i to the "servings" field.

func (*RecipeUpdate) AddSourceIDs

func (ru *RecipeUpdate) AddSourceIDs(ids ...uuid.UUID) *RecipeUpdate

AddSourceIDs adds the "sources" edge to the Source entity by IDs.

func (*RecipeUpdate) AddSources

func (ru *RecipeUpdate) AddSources(s ...*Source) *RecipeUpdate

AddSources adds the "sources" edges to the Source entity.

func (*RecipeUpdate) AddTagIDs

func (ru *RecipeUpdate) AddTagIDs(ids ...uuid.UUID) *RecipeUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*RecipeUpdate) AddTags

func (ru *RecipeUpdate) AddTags(t ...*Tag) *RecipeUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*RecipeUpdate) AddTime

func (ru *RecipeUpdate) AddTime(t time.Duration) *RecipeUpdate

AddTime adds t to the "time" field.

func (*RecipeUpdate) ClearEquipment

func (ru *RecipeUpdate) ClearEquipment() *RecipeUpdate

ClearEquipment clears all "equipment" edges to the Equipment entity.

func (*RecipeUpdate) ClearIdeas

func (ru *RecipeUpdate) ClearIdeas() *RecipeUpdate

ClearIdeas clears all "ideas" edges to the Idea entity.

func (*RecipeUpdate) ClearIngredients

func (ru *RecipeUpdate) ClearIngredients() *RecipeUpdate

ClearIngredients clears all "ingredients" edges to the Ingredient entity.

func (*RecipeUpdate) ClearInstructions

func (ru *RecipeUpdate) ClearInstructions() *RecipeUpdate

ClearInstructions clears all "instructions" edges to the Instruction entity.

func (*RecipeUpdate) ClearNutrition

func (ru *RecipeUpdate) ClearNutrition() *RecipeUpdate

ClearNutrition clears the "nutrition" edge to the Nutrition entity.

func (*RecipeUpdate) ClearRating

func (ru *RecipeUpdate) ClearRating() *RecipeUpdate

ClearRating clears the value of the "rating" field.

func (*RecipeUpdate) ClearRequiredProducts

func (ru *RecipeUpdate) ClearRequiredProducts() *RecipeUpdate

ClearRequiredProducts clears all "required_products" edges to the Product entity.

func (*RecipeUpdate) ClearServings

func (ru *RecipeUpdate) ClearServings() *RecipeUpdate

ClearServings clears the value of the "servings" field.

func (*RecipeUpdate) ClearSources

func (ru *RecipeUpdate) ClearSources() *RecipeUpdate

ClearSources clears all "sources" edges to the Source entity.

func (*RecipeUpdate) ClearTags

func (ru *RecipeUpdate) ClearTags() *RecipeUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*RecipeUpdate) ClearTime

func (ru *RecipeUpdate) ClearTime() *RecipeUpdate

ClearTime clears the value of the "time" field.

func (*RecipeUpdate) Exec

func (ru *RecipeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RecipeUpdate) ExecX

func (ru *RecipeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RecipeUpdate) Mutation

func (ru *RecipeUpdate) Mutation() *RecipeMutation

Mutation returns the RecipeMutation object of the builder.

func (*RecipeUpdate) RemoveEquipment

func (ru *RecipeUpdate) RemoveEquipment(e ...*Equipment) *RecipeUpdate

RemoveEquipment removes "equipment" edges to Equipment entities.

func (*RecipeUpdate) RemoveEquipmentIDs

func (ru *RecipeUpdate) RemoveEquipmentIDs(ids ...uuid.UUID) *RecipeUpdate

RemoveEquipmentIDs removes the "equipment" edge to Equipment entities by IDs.

func (*RecipeUpdate) RemoveIdeaIDs

func (ru *RecipeUpdate) RemoveIdeaIDs(ids ...uuid.UUID) *RecipeUpdate

RemoveIdeaIDs removes the "ideas" edge to Idea entities by IDs.

func (*RecipeUpdate) RemoveIdeas

func (ru *RecipeUpdate) RemoveIdeas(i ...*Idea) *RecipeUpdate

RemoveIdeas removes "ideas" edges to Idea entities.

func (*RecipeUpdate) RemoveIngredientIDs

func (ru *RecipeUpdate) RemoveIngredientIDs(ids ...uuid.UUID) *RecipeUpdate

RemoveIngredientIDs removes the "ingredients" edge to Ingredient entities by IDs.

func (*RecipeUpdate) RemoveIngredients

func (ru *RecipeUpdate) RemoveIngredients(i ...*Ingredient) *RecipeUpdate

RemoveIngredients removes "ingredients" edges to Ingredient entities.

func (*RecipeUpdate) RemoveInstructionIDs

func (ru *RecipeUpdate) RemoveInstructionIDs(ids ...uuid.UUID) *RecipeUpdate

RemoveInstructionIDs removes the "instructions" edge to Instruction entities by IDs.

func (*RecipeUpdate) RemoveInstructions

func (ru *RecipeUpdate) RemoveInstructions(i ...*Instruction) *RecipeUpdate

RemoveInstructions removes "instructions" edges to Instruction entities.

func (*RecipeUpdate) RemoveRequiredProductIDs

func (ru *RecipeUpdate) RemoveRequiredProductIDs(ids ...uuid.UUID) *RecipeUpdate

RemoveRequiredProductIDs removes the "required_products" edge to Product entities by IDs.

func (*RecipeUpdate) RemoveRequiredProducts

func (ru *RecipeUpdate) RemoveRequiredProducts(p ...*Product) *RecipeUpdate

RemoveRequiredProducts removes "required_products" edges to Product entities.

func (*RecipeUpdate) RemoveSourceIDs

func (ru *RecipeUpdate) RemoveSourceIDs(ids ...uuid.UUID) *RecipeUpdate

RemoveSourceIDs removes the "sources" edge to Source entities by IDs.

func (*RecipeUpdate) RemoveSources

func (ru *RecipeUpdate) RemoveSources(s ...*Source) *RecipeUpdate

RemoveSources removes "sources" edges to Source entities.

func (*RecipeUpdate) RemoveTagIDs

func (ru *RecipeUpdate) RemoveTagIDs(ids ...uuid.UUID) *RecipeUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*RecipeUpdate) RemoveTags

func (ru *RecipeUpdate) RemoveTags(t ...*Tag) *RecipeUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*RecipeUpdate) Save

func (ru *RecipeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RecipeUpdate) SaveX

func (ru *RecipeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RecipeUpdate) SetDescription

func (ru *RecipeUpdate) SetDescription(s string) *RecipeUpdate

SetDescription sets the "description" field.

func (*RecipeUpdate) SetName

func (ru *RecipeUpdate) SetName(s string) *RecipeUpdate

SetName sets the "name" field.

func (*RecipeUpdate) SetNillableDescription

func (ru *RecipeUpdate) SetNillableDescription(s *string) *RecipeUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*RecipeUpdate) SetNillableName

func (ru *RecipeUpdate) SetNillableName(s *string) *RecipeUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*RecipeUpdate) SetNillableNutritionID

func (ru *RecipeUpdate) SetNillableNutritionID(id *int) *RecipeUpdate

SetNillableNutritionID sets the "nutrition" edge to the Nutrition entity by ID if the given value is not nil.

func (*RecipeUpdate) SetNillablePublished

func (ru *RecipeUpdate) SetNillablePublished(b *bool) *RecipeUpdate

SetNillablePublished sets the "published" field if the given value is not nil.

func (*RecipeUpdate) SetNillableRating

func (ru *RecipeUpdate) SetNillableRating(f *float32) *RecipeUpdate

SetNillableRating sets the "rating" field if the given value is not nil.

func (*RecipeUpdate) SetNillableServings

func (ru *RecipeUpdate) SetNillableServings(i *int) *RecipeUpdate

SetNillableServings sets the "servings" field if the given value is not nil.

func (*RecipeUpdate) SetNillableSlug

func (ru *RecipeUpdate) SetNillableSlug(s *string) *RecipeUpdate

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*RecipeUpdate) SetNillableText

func (ru *RecipeUpdate) SetNillableText(s *string) *RecipeUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*RecipeUpdate) SetNillableTime

func (ru *RecipeUpdate) SetNillableTime(t *time.Duration) *RecipeUpdate

SetNillableTime sets the "time" field if the given value is not nil.

func (*RecipeUpdate) SetNutrition

func (ru *RecipeUpdate) SetNutrition(n *Nutrition) *RecipeUpdate

SetNutrition sets the "nutrition" edge to the Nutrition entity.

func (*RecipeUpdate) SetNutritionID

func (ru *RecipeUpdate) SetNutritionID(id int) *RecipeUpdate

SetNutritionID sets the "nutrition" edge to the Nutrition entity by ID.

func (*RecipeUpdate) SetPublished

func (ru *RecipeUpdate) SetPublished(b bool) *RecipeUpdate

SetPublished sets the "published" field.

func (*RecipeUpdate) SetRating

func (ru *RecipeUpdate) SetRating(f float32) *RecipeUpdate

SetRating sets the "rating" field.

func (*RecipeUpdate) SetServings

func (ru *RecipeUpdate) SetServings(i int) *RecipeUpdate

SetServings sets the "servings" field.

func (*RecipeUpdate) SetSlug

func (ru *RecipeUpdate) SetSlug(s string) *RecipeUpdate

SetSlug sets the "slug" field.

func (*RecipeUpdate) SetText

func (ru *RecipeUpdate) SetText(s string) *RecipeUpdate

SetText sets the "text" field.

func (*RecipeUpdate) SetTime

func (ru *RecipeUpdate) SetTime(t time.Duration) *RecipeUpdate

SetTime sets the "time" field.

func (*RecipeUpdate) SetUpdateTime

func (ru *RecipeUpdate) SetUpdateTime(t time.Time) *RecipeUpdate

SetUpdateTime sets the "update_time" field.

func (*RecipeUpdate) Where

func (ru *RecipeUpdate) Where(ps ...predicate.Recipe) *RecipeUpdate

Where appends a list predicates to the RecipeUpdate builder.

type RecipeUpdateOne

type RecipeUpdateOne struct {
	// contains filtered or unexported fields
}

RecipeUpdateOne is the builder for updating a single Recipe entity.

func (*RecipeUpdateOne) AddEquipment

func (ruo *RecipeUpdateOne) AddEquipment(e ...*Equipment) *RecipeUpdateOne

AddEquipment adds the "equipment" edges to the Equipment entity.

func (*RecipeUpdateOne) AddEquipmentIDs

func (ruo *RecipeUpdateOne) AddEquipmentIDs(ids ...uuid.UUID) *RecipeUpdateOne

AddEquipmentIDs adds the "equipment" edge to the Equipment entity by IDs.

func (*RecipeUpdateOne) AddIdeaIDs

func (ruo *RecipeUpdateOne) AddIdeaIDs(ids ...uuid.UUID) *RecipeUpdateOne

AddIdeaIDs adds the "ideas" edge to the Idea entity by IDs.

func (*RecipeUpdateOne) AddIdeas

func (ruo *RecipeUpdateOne) AddIdeas(i ...*Idea) *RecipeUpdateOne

AddIdeas adds the "ideas" edges to the Idea entity.

func (*RecipeUpdateOne) AddIngredientIDs

func (ruo *RecipeUpdateOne) AddIngredientIDs(ids ...uuid.UUID) *RecipeUpdateOne

AddIngredientIDs adds the "ingredients" edge to the Ingredient entity by IDs.

func (*RecipeUpdateOne) AddIngredients

func (ruo *RecipeUpdateOne) AddIngredients(i ...*Ingredient) *RecipeUpdateOne

AddIngredients adds the "ingredients" edges to the Ingredient entity.

func (*RecipeUpdateOne) AddInstructionIDs

func (ruo *RecipeUpdateOne) AddInstructionIDs(ids ...uuid.UUID) *RecipeUpdateOne

AddInstructionIDs adds the "instructions" edge to the Instruction entity by IDs.

func (*RecipeUpdateOne) AddInstructions

func (ruo *RecipeUpdateOne) AddInstructions(i ...*Instruction) *RecipeUpdateOne

AddInstructions adds the "instructions" edges to the Instruction entity.

func (*RecipeUpdateOne) AddRating

func (ruo *RecipeUpdateOne) AddRating(f float32) *RecipeUpdateOne

AddRating adds f to the "rating" field.

func (*RecipeUpdateOne) AddRequiredProductIDs

func (ruo *RecipeUpdateOne) AddRequiredProductIDs(ids ...uuid.UUID) *RecipeUpdateOne

AddRequiredProductIDs adds the "required_products" edge to the Product entity by IDs.

func (*RecipeUpdateOne) AddRequiredProducts

func (ruo *RecipeUpdateOne) AddRequiredProducts(p ...*Product) *RecipeUpdateOne

AddRequiredProducts adds the "required_products" edges to the Product entity.

func (*RecipeUpdateOne) AddServings

func (ruo *RecipeUpdateOne) AddServings(i int) *RecipeUpdateOne

AddServings adds i to the "servings" field.

func (*RecipeUpdateOne) AddSourceIDs

func (ruo *RecipeUpdateOne) AddSourceIDs(ids ...uuid.UUID) *RecipeUpdateOne

AddSourceIDs adds the "sources" edge to the Source entity by IDs.

func (*RecipeUpdateOne) AddSources

func (ruo *RecipeUpdateOne) AddSources(s ...*Source) *RecipeUpdateOne

AddSources adds the "sources" edges to the Source entity.

func (*RecipeUpdateOne) AddTagIDs

func (ruo *RecipeUpdateOne) AddTagIDs(ids ...uuid.UUID) *RecipeUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*RecipeUpdateOne) AddTags

func (ruo *RecipeUpdateOne) AddTags(t ...*Tag) *RecipeUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*RecipeUpdateOne) AddTime

func (ruo *RecipeUpdateOne) AddTime(t time.Duration) *RecipeUpdateOne

AddTime adds t to the "time" field.

func (*RecipeUpdateOne) ClearEquipment

func (ruo *RecipeUpdateOne) ClearEquipment() *RecipeUpdateOne

ClearEquipment clears all "equipment" edges to the Equipment entity.

func (*RecipeUpdateOne) ClearIdeas

func (ruo *RecipeUpdateOne) ClearIdeas() *RecipeUpdateOne

ClearIdeas clears all "ideas" edges to the Idea entity.

func (*RecipeUpdateOne) ClearIngredients

func (ruo *RecipeUpdateOne) ClearIngredients() *RecipeUpdateOne

ClearIngredients clears all "ingredients" edges to the Ingredient entity.

func (*RecipeUpdateOne) ClearInstructions

func (ruo *RecipeUpdateOne) ClearInstructions() *RecipeUpdateOne

ClearInstructions clears all "instructions" edges to the Instruction entity.

func (*RecipeUpdateOne) ClearNutrition

func (ruo *RecipeUpdateOne) ClearNutrition() *RecipeUpdateOne

ClearNutrition clears the "nutrition" edge to the Nutrition entity.

func (*RecipeUpdateOne) ClearRating

func (ruo *RecipeUpdateOne) ClearRating() *RecipeUpdateOne

ClearRating clears the value of the "rating" field.

func (*RecipeUpdateOne) ClearRequiredProducts

func (ruo *RecipeUpdateOne) ClearRequiredProducts() *RecipeUpdateOne

ClearRequiredProducts clears all "required_products" edges to the Product entity.

func (*RecipeUpdateOne) ClearServings

func (ruo *RecipeUpdateOne) ClearServings() *RecipeUpdateOne

ClearServings clears the value of the "servings" field.

func (*RecipeUpdateOne) ClearSources

func (ruo *RecipeUpdateOne) ClearSources() *RecipeUpdateOne

ClearSources clears all "sources" edges to the Source entity.

func (*RecipeUpdateOne) ClearTags

func (ruo *RecipeUpdateOne) ClearTags() *RecipeUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*RecipeUpdateOne) ClearTime

func (ruo *RecipeUpdateOne) ClearTime() *RecipeUpdateOne

ClearTime clears the value of the "time" field.

func (*RecipeUpdateOne) Exec

func (ruo *RecipeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RecipeUpdateOne) ExecX

func (ruo *RecipeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RecipeUpdateOne) Mutation

func (ruo *RecipeUpdateOne) Mutation() *RecipeMutation

Mutation returns the RecipeMutation object of the builder.

func (*RecipeUpdateOne) RemoveEquipment

func (ruo *RecipeUpdateOne) RemoveEquipment(e ...*Equipment) *RecipeUpdateOne

RemoveEquipment removes "equipment" edges to Equipment entities.

func (*RecipeUpdateOne) RemoveEquipmentIDs

func (ruo *RecipeUpdateOne) RemoveEquipmentIDs(ids ...uuid.UUID) *RecipeUpdateOne

RemoveEquipmentIDs removes the "equipment" edge to Equipment entities by IDs.

func (*RecipeUpdateOne) RemoveIdeaIDs

func (ruo *RecipeUpdateOne) RemoveIdeaIDs(ids ...uuid.UUID) *RecipeUpdateOne

RemoveIdeaIDs removes the "ideas" edge to Idea entities by IDs.

func (*RecipeUpdateOne) RemoveIdeas

func (ruo *RecipeUpdateOne) RemoveIdeas(i ...*Idea) *RecipeUpdateOne

RemoveIdeas removes "ideas" edges to Idea entities.

func (*RecipeUpdateOne) RemoveIngredientIDs

func (ruo *RecipeUpdateOne) RemoveIngredientIDs(ids ...uuid.UUID) *RecipeUpdateOne

RemoveIngredientIDs removes the "ingredients" edge to Ingredient entities by IDs.

func (*RecipeUpdateOne) RemoveIngredients

func (ruo *RecipeUpdateOne) RemoveIngredients(i ...*Ingredient) *RecipeUpdateOne

RemoveIngredients removes "ingredients" edges to Ingredient entities.

func (*RecipeUpdateOne) RemoveInstructionIDs

func (ruo *RecipeUpdateOne) RemoveInstructionIDs(ids ...uuid.UUID) *RecipeUpdateOne

RemoveInstructionIDs removes the "instructions" edge to Instruction entities by IDs.

func (*RecipeUpdateOne) RemoveInstructions

func (ruo *RecipeUpdateOne) RemoveInstructions(i ...*Instruction) *RecipeUpdateOne

RemoveInstructions removes "instructions" edges to Instruction entities.

func (*RecipeUpdateOne) RemoveRequiredProductIDs

func (ruo *RecipeUpdateOne) RemoveRequiredProductIDs(ids ...uuid.UUID) *RecipeUpdateOne

RemoveRequiredProductIDs removes the "required_products" edge to Product entities by IDs.

func (*RecipeUpdateOne) RemoveRequiredProducts

func (ruo *RecipeUpdateOne) RemoveRequiredProducts(p ...*Product) *RecipeUpdateOne

RemoveRequiredProducts removes "required_products" edges to Product entities.

func (*RecipeUpdateOne) RemoveSourceIDs

func (ruo *RecipeUpdateOne) RemoveSourceIDs(ids ...uuid.UUID) *RecipeUpdateOne

RemoveSourceIDs removes the "sources" edge to Source entities by IDs.

func (*RecipeUpdateOne) RemoveSources

func (ruo *RecipeUpdateOne) RemoveSources(s ...*Source) *RecipeUpdateOne

RemoveSources removes "sources" edges to Source entities.

func (*RecipeUpdateOne) RemoveTagIDs

func (ruo *RecipeUpdateOne) RemoveTagIDs(ids ...uuid.UUID) *RecipeUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*RecipeUpdateOne) RemoveTags

func (ruo *RecipeUpdateOne) RemoveTags(t ...*Tag) *RecipeUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*RecipeUpdateOne) Save

func (ruo *RecipeUpdateOne) Save(ctx context.Context) (*Recipe, error)

Save executes the query and returns the updated Recipe entity.

func (*RecipeUpdateOne) SaveX

func (ruo *RecipeUpdateOne) SaveX(ctx context.Context) *Recipe

SaveX is like Save, but panics if an error occurs.

func (*RecipeUpdateOne) Select

func (ruo *RecipeUpdateOne) Select(field string, fields ...string) *RecipeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RecipeUpdateOne) SetDescription

func (ruo *RecipeUpdateOne) SetDescription(s string) *RecipeUpdateOne

SetDescription sets the "description" field.

func (*RecipeUpdateOne) SetName

func (ruo *RecipeUpdateOne) SetName(s string) *RecipeUpdateOne

SetName sets the "name" field.

func (*RecipeUpdateOne) SetNillableDescription

func (ruo *RecipeUpdateOne) SetNillableDescription(s *string) *RecipeUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*RecipeUpdateOne) SetNillableName

func (ruo *RecipeUpdateOne) SetNillableName(s *string) *RecipeUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*RecipeUpdateOne) SetNillableNutritionID

func (ruo *RecipeUpdateOne) SetNillableNutritionID(id *int) *RecipeUpdateOne

SetNillableNutritionID sets the "nutrition" edge to the Nutrition entity by ID if the given value is not nil.

func (*RecipeUpdateOne) SetNillablePublished

func (ruo *RecipeUpdateOne) SetNillablePublished(b *bool) *RecipeUpdateOne

SetNillablePublished sets the "published" field if the given value is not nil.

func (*RecipeUpdateOne) SetNillableRating

func (ruo *RecipeUpdateOne) SetNillableRating(f *float32) *RecipeUpdateOne

SetNillableRating sets the "rating" field if the given value is not nil.

func (*RecipeUpdateOne) SetNillableServings

func (ruo *RecipeUpdateOne) SetNillableServings(i *int) *RecipeUpdateOne

SetNillableServings sets the "servings" field if the given value is not nil.

func (*RecipeUpdateOne) SetNillableSlug

func (ruo *RecipeUpdateOne) SetNillableSlug(s *string) *RecipeUpdateOne

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*RecipeUpdateOne) SetNillableText

func (ruo *RecipeUpdateOne) SetNillableText(s *string) *RecipeUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*RecipeUpdateOne) SetNillableTime

func (ruo *RecipeUpdateOne) SetNillableTime(t *time.Duration) *RecipeUpdateOne

SetNillableTime sets the "time" field if the given value is not nil.

func (*RecipeUpdateOne) SetNutrition

func (ruo *RecipeUpdateOne) SetNutrition(n *Nutrition) *RecipeUpdateOne

SetNutrition sets the "nutrition" edge to the Nutrition entity.

func (*RecipeUpdateOne) SetNutritionID

func (ruo *RecipeUpdateOne) SetNutritionID(id int) *RecipeUpdateOne

SetNutritionID sets the "nutrition" edge to the Nutrition entity by ID.

func (*RecipeUpdateOne) SetPublished

func (ruo *RecipeUpdateOne) SetPublished(b bool) *RecipeUpdateOne

SetPublished sets the "published" field.

func (*RecipeUpdateOne) SetRating

func (ruo *RecipeUpdateOne) SetRating(f float32) *RecipeUpdateOne

SetRating sets the "rating" field.

func (*RecipeUpdateOne) SetServings

func (ruo *RecipeUpdateOne) SetServings(i int) *RecipeUpdateOne

SetServings sets the "servings" field.

func (*RecipeUpdateOne) SetSlug

func (ruo *RecipeUpdateOne) SetSlug(s string) *RecipeUpdateOne

SetSlug sets the "slug" field.

func (*RecipeUpdateOne) SetText

func (ruo *RecipeUpdateOne) SetText(s string) *RecipeUpdateOne

SetText sets the "text" field.

func (*RecipeUpdateOne) SetTime

func (ruo *RecipeUpdateOne) SetTime(t time.Duration) *RecipeUpdateOne

SetTime sets the "time" field.

func (*RecipeUpdateOne) SetUpdateTime

func (ruo *RecipeUpdateOne) SetUpdateTime(t time.Time) *RecipeUpdateOne

SetUpdateTime sets the "update_time" field.

func (*RecipeUpdateOne) Where

func (ruo *RecipeUpdateOne) Where(ps ...predicate.Recipe) *RecipeUpdateOne

Where appends a list predicates to the RecipeUpdate builder.

type Recipes

type Recipes []*Recipe

Recipes is a parsable slice of Recipe.

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 Source

type Source struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SourceQuery when eager-loading is set.
	Edges SourceEdges `json:"edges"`
	// contains filtered or unexported fields
}

Source is the model entity for the Source schema.

func (*Source) QueryRecipe

func (s *Source) QueryRecipe() *RecipeQuery

QueryRecipe queries the "recipe" edge of the Source entity.

func (*Source) String

func (s *Source) String() string

String implements the fmt.Stringer.

func (*Source) Unwrap

func (s *Source) Unwrap() *Source

Unwrap unwraps the Source 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 (*Source) Update

func (s *Source) Update() *SourceUpdateOne

Update returns a builder for updating this Source. Note that you need to call Source.Unwrap() before calling this method if this Source was returned from a transaction, and the transaction was committed or rolled back.

func (*Source) Value

func (s *Source) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Source. This includes values selected through modifiers, order, etc.

type SourceClient

type SourceClient struct {
	// contains filtered or unexported fields
}

SourceClient is a client for the Source schema.

func NewSourceClient

func NewSourceClient(c config) *SourceClient

NewSourceClient returns a client for the Source from the given config.

func (*SourceClient) Create

func (c *SourceClient) Create() *SourceCreate

Create returns a builder for creating a Source entity.

func (*SourceClient) CreateBulk

func (c *SourceClient) CreateBulk(builders ...*SourceCreate) *SourceCreateBulk

CreateBulk returns a builder for creating a bulk of Source entities.

func (*SourceClient) Delete

func (c *SourceClient) Delete() *SourceDelete

Delete returns a delete builder for Source.

func (*SourceClient) DeleteOne

func (c *SourceClient) DeleteOne(s *Source) *SourceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SourceClient) DeleteOneID

func (c *SourceClient) DeleteOneID(id uuid.UUID) *SourceDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SourceClient) Get

func (c *SourceClient) Get(ctx context.Context, id uuid.UUID) (*Source, error)

Get returns a Source entity by its id.

func (*SourceClient) GetX

func (c *SourceClient) GetX(ctx context.Context, id uuid.UUID) *Source

GetX is like Get, but panics if an error occurs.

func (*SourceClient) Hooks

func (c *SourceClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SourceClient) Intercept

func (c *SourceClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `source.Intercept(f(g(h())))`.

func (*SourceClient) Interceptors

func (c *SourceClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SourceClient) MapCreateBulk

func (c *SourceClient) MapCreateBulk(slice any, setFunc func(*SourceCreate, int)) *SourceCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SourceClient) Query

func (c *SourceClient) Query() *SourceQuery

Query returns a query builder for Source.

func (*SourceClient) QueryRecipe

func (c *SourceClient) QueryRecipe(s *Source) *RecipeQuery

QueryRecipe queries the recipe edge of a Source.

func (*SourceClient) Update

func (c *SourceClient) Update() *SourceUpdate

Update returns an update builder for Source.

func (*SourceClient) UpdateOne

func (c *SourceClient) UpdateOne(s *Source) *SourceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SourceClient) UpdateOneID

func (c *SourceClient) UpdateOneID(id uuid.UUID) *SourceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SourceClient) Use

func (c *SourceClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `source.Hooks(f(g(h())))`.

type SourceCreate

type SourceCreate struct {
	// contains filtered or unexported fields
}

SourceCreate is the builder for creating a Source entity.

func (*SourceCreate) Exec

func (sc *SourceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SourceCreate) ExecX

func (sc *SourceCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SourceCreate) Mutation

func (sc *SourceCreate) Mutation() *SourceMutation

Mutation returns the SourceMutation object of the builder.

func (*SourceCreate) Save

func (sc *SourceCreate) Save(ctx context.Context) (*Source, error)

Save creates the Source in the database.

func (*SourceCreate) SaveX

func (sc *SourceCreate) SaveX(ctx context.Context) *Source

SaveX calls Save and panics if Save returns an error.

func (*SourceCreate) SetDescription

func (sc *SourceCreate) SetDescription(s string) *SourceCreate

SetDescription sets the "description" field.

func (*SourceCreate) SetID

func (sc *SourceCreate) SetID(u uuid.UUID) *SourceCreate

SetID sets the "id" field.

func (*SourceCreate) SetName

func (sc *SourceCreate) SetName(s string) *SourceCreate

SetName sets the "name" field.

func (*SourceCreate) SetNillableDescription

func (sc *SourceCreate) SetNillableDescription(s *string) *SourceCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*SourceCreate) SetNillableID

func (sc *SourceCreate) SetNillableID(u *uuid.UUID) *SourceCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SourceCreate) SetNillableName

func (sc *SourceCreate) SetNillableName(s *string) *SourceCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*SourceCreate) SetNillableRecipeID

func (sc *SourceCreate) SetNillableRecipeID(id *uuid.UUID) *SourceCreate

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*SourceCreate) SetNillableURL

func (sc *SourceCreate) SetNillableURL(s *string) *SourceCreate

SetNillableURL sets the "url" field if the given value is not nil.

func (*SourceCreate) SetRecipe

func (sc *SourceCreate) SetRecipe(r *Recipe) *SourceCreate

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*SourceCreate) SetRecipeID

func (sc *SourceCreate) SetRecipeID(id uuid.UUID) *SourceCreate

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

func (*SourceCreate) SetURL

func (sc *SourceCreate) SetURL(s string) *SourceCreate

SetURL sets the "url" field.

type SourceCreateBulk

type SourceCreateBulk struct {
	// contains filtered or unexported fields
}

SourceCreateBulk is the builder for creating many Source entities in bulk.

func (*SourceCreateBulk) Exec

func (scb *SourceCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SourceCreateBulk) ExecX

func (scb *SourceCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SourceCreateBulk) Save

func (scb *SourceCreateBulk) Save(ctx context.Context) ([]*Source, error)

Save creates the Source entities in the database.

func (*SourceCreateBulk) SaveX

func (scb *SourceCreateBulk) SaveX(ctx context.Context) []*Source

SaveX is like Save, but panics if an error occurs.

type SourceDelete

type SourceDelete struct {
	// contains filtered or unexported fields
}

SourceDelete is the builder for deleting a Source entity.

func (*SourceDelete) Exec

func (sd *SourceDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SourceDelete) ExecX

func (sd *SourceDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SourceDelete) Where

func (sd *SourceDelete) Where(ps ...predicate.Source) *SourceDelete

Where appends a list predicates to the SourceDelete builder.

type SourceDeleteOne

type SourceDeleteOne struct {
	// contains filtered or unexported fields
}

SourceDeleteOne is the builder for deleting a single Source entity.

func (*SourceDeleteOne) Exec

func (sdo *SourceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SourceDeleteOne) ExecX

func (sdo *SourceDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SourceDeleteOne) Where

func (sdo *SourceDeleteOne) Where(ps ...predicate.Source) *SourceDeleteOne

Where appends a list predicates to the SourceDelete builder.

type SourceEdges

type SourceEdges struct {
	// Recipe holds the value of the recipe edge.
	Recipe *Recipe `json:"recipe,omitempty"`
	// contains filtered or unexported fields
}

SourceEdges holds the relations/edges for other nodes in the graph.

func (SourceEdges) RecipeOrErr

func (e SourceEdges) RecipeOrErr() (*Recipe, error)

RecipeOrErr returns the Recipe value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SourceGroupBy

type SourceGroupBy struct {
	// contains filtered or unexported fields
}

SourceGroupBy is the group-by builder for Source entities.

func (*SourceGroupBy) Aggregate

func (sgb *SourceGroupBy) Aggregate(fns ...AggregateFunc) *SourceGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SourceGroupBy) Bool

func (s *SourceGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SourceGroupBy) BoolX

func (s *SourceGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SourceGroupBy) Bools

func (s *SourceGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SourceGroupBy) BoolsX

func (s *SourceGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SourceGroupBy) Float64

func (s *SourceGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SourceGroupBy) Float64X

func (s *SourceGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SourceGroupBy) Float64s

func (s *SourceGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SourceGroupBy) Float64sX

func (s *SourceGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SourceGroupBy) Int

func (s *SourceGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SourceGroupBy) IntX

func (s *SourceGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SourceGroupBy) Ints

func (s *SourceGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SourceGroupBy) IntsX

func (s *SourceGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SourceGroupBy) Scan

func (sgb *SourceGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SourceGroupBy) ScanX

func (s *SourceGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SourceGroupBy) String

func (s *SourceGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SourceGroupBy) StringX

func (s *SourceGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SourceGroupBy) Strings

func (s *SourceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SourceGroupBy) StringsX

func (s *SourceGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SourceMutation

type SourceMutation struct {
	// contains filtered or unexported fields
}

SourceMutation represents an operation that mutates the Source nodes in the graph.

func (*SourceMutation) AddField

func (m *SourceMutation) 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 (*SourceMutation) AddedEdges

func (m *SourceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SourceMutation) AddedField

func (m *SourceMutation) 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 (*SourceMutation) AddedFields

func (m *SourceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SourceMutation) AddedIDs

func (m *SourceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SourceMutation) ClearDescription

func (m *SourceMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*SourceMutation) ClearEdge

func (m *SourceMutation) 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 (*SourceMutation) ClearField

func (m *SourceMutation) 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 (*SourceMutation) ClearName

func (m *SourceMutation) ClearName()

ClearName clears the value of the "name" field.

func (*SourceMutation) ClearRecipe

func (m *SourceMutation) ClearRecipe()

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*SourceMutation) ClearURL

func (m *SourceMutation) ClearURL()

ClearURL clears the value of the "url" field.

func (*SourceMutation) ClearedEdges

func (m *SourceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SourceMutation) ClearedFields

func (m *SourceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SourceMutation) Client

func (m SourceMutation) 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 (*SourceMutation) Description

func (m *SourceMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*SourceMutation) DescriptionCleared

func (m *SourceMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*SourceMutation) EdgeCleared

func (m *SourceMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SourceMutation) Field

func (m *SourceMutation) 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 (*SourceMutation) FieldCleared

func (m *SourceMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SourceMutation) Fields

func (m *SourceMutation) 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 (*SourceMutation) ID

func (m *SourceMutation) 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 (*SourceMutation) IDs

func (m *SourceMutation) 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 (*SourceMutation) Name

func (m *SourceMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*SourceMutation) NameCleared

func (m *SourceMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*SourceMutation) OldDescription

func (m *SourceMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Source entity. If the Source 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 (*SourceMutation) OldField

func (m *SourceMutation) 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 (*SourceMutation) OldName

func (m *SourceMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Source entity. If the Source 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 (*SourceMutation) OldURL

func (m *SourceMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Source entity. If the Source 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 (*SourceMutation) Op

func (m *SourceMutation) Op() Op

Op returns the operation name.

func (*SourceMutation) RecipeCleared

func (m *SourceMutation) RecipeCleared() bool

RecipeCleared reports if the "recipe" edge to the Recipe entity was cleared.

func (*SourceMutation) RecipeID

func (m *SourceMutation) RecipeID() (id uuid.UUID, exists bool)

RecipeID returns the "recipe" edge ID in the mutation.

func (*SourceMutation) RecipeIDs

func (m *SourceMutation) RecipeIDs() (ids []uuid.UUID)

RecipeIDs returns the "recipe" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RecipeID instead. It exists only for internal usage by the builders.

func (*SourceMutation) RemovedEdges

func (m *SourceMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SourceMutation) RemovedIDs

func (m *SourceMutation) 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 (*SourceMutation) ResetDescription

func (m *SourceMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*SourceMutation) ResetEdge

func (m *SourceMutation) 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 (*SourceMutation) ResetField

func (m *SourceMutation) 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 (*SourceMutation) ResetName

func (m *SourceMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SourceMutation) ResetRecipe

func (m *SourceMutation) ResetRecipe()

ResetRecipe resets all changes to the "recipe" edge.

func (*SourceMutation) ResetURL

func (m *SourceMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*SourceMutation) SetDescription

func (m *SourceMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*SourceMutation) SetField

func (m *SourceMutation) 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 (*SourceMutation) SetID

func (m *SourceMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Source entities.

func (*SourceMutation) SetName

func (m *SourceMutation) SetName(s string)

SetName sets the "name" field.

func (*SourceMutation) SetOp

func (m *SourceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SourceMutation) SetRecipeID

func (m *SourceMutation) SetRecipeID(id uuid.UUID)

SetRecipeID sets the "recipe" edge to the Recipe entity by id.

func (*SourceMutation) SetURL

func (m *SourceMutation) SetURL(s string)

SetURL sets the "url" field.

func (SourceMutation) Tx

func (m SourceMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SourceMutation) Type

func (m *SourceMutation) Type() string

Type returns the node type of this mutation (Source).

func (*SourceMutation) URL

func (m *SourceMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*SourceMutation) URLCleared

func (m *SourceMutation) URLCleared() bool

URLCleared returns if the "url" field was cleared in this mutation.

func (*SourceMutation) Where

func (m *SourceMutation) Where(ps ...predicate.Source)

Where appends a list predicates to the SourceMutation builder.

func (*SourceMutation) WhereP

func (m *SourceMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SourceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SourceQuery

type SourceQuery struct {
	// contains filtered or unexported fields
}

SourceQuery is the builder for querying Source entities.

func (*SourceQuery) Aggregate

func (sq *SourceQuery) Aggregate(fns ...AggregateFunc) *SourceSelect

Aggregate returns a SourceSelect configured with the given aggregations.

func (*SourceQuery) All

func (sq *SourceQuery) All(ctx context.Context) ([]*Source, error)

All executes the query and returns a list of Sources.

func (*SourceQuery) AllX

func (sq *SourceQuery) AllX(ctx context.Context) []*Source

AllX is like All, but panics if an error occurs.

func (*SourceQuery) Clone

func (sq *SourceQuery) Clone() *SourceQuery

Clone returns a duplicate of the SourceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SourceQuery) Count

func (sq *SourceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SourceQuery) CountX

func (sq *SourceQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SourceQuery) Exist

func (sq *SourceQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SourceQuery) ExistX

func (sq *SourceQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SourceQuery) First

func (sq *SourceQuery) First(ctx context.Context) (*Source, error)

First returns the first Source entity from the query. Returns a *NotFoundError when no Source was found.

func (*SourceQuery) FirstID

func (sq *SourceQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Source ID from the query. Returns a *NotFoundError when no Source ID was found.

func (*SourceQuery) FirstIDX

func (sq *SourceQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*SourceQuery) FirstX

func (sq *SourceQuery) FirstX(ctx context.Context) *Source

FirstX is like First, but panics if an error occurs.

func (*SourceQuery) GroupBy

func (sq *SourceQuery) GroupBy(field string, fields ...string) *SourceGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Source.Query().
	GroupBy(source.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SourceQuery) IDs

func (sq *SourceQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Source IDs.

func (*SourceQuery) IDsX

func (sq *SourceQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*SourceQuery) Limit

func (sq *SourceQuery) Limit(limit int) *SourceQuery

Limit the number of records to be returned by this query.

func (*SourceQuery) Offset

func (sq *SourceQuery) Offset(offset int) *SourceQuery

Offset to start from.

func (*SourceQuery) Only

func (sq *SourceQuery) Only(ctx context.Context) (*Source, error)

Only returns a single Source entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Source entity is found. Returns a *NotFoundError when no Source entities are found.

func (*SourceQuery) OnlyID

func (sq *SourceQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Source ID in the query. Returns a *NotSingularError when more than one Source ID is found. Returns a *NotFoundError when no entities are found.

func (*SourceQuery) OnlyIDX

func (sq *SourceQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SourceQuery) OnlyX

func (sq *SourceQuery) OnlyX(ctx context.Context) *Source

OnlyX is like Only, but panics if an error occurs.

func (*SourceQuery) Order

func (sq *SourceQuery) Order(o ...source.OrderOption) *SourceQuery

Order specifies how the records should be ordered.

func (*SourceQuery) QueryRecipe

func (sq *SourceQuery) QueryRecipe() *RecipeQuery

QueryRecipe chains the current query on the "recipe" edge.

func (*SourceQuery) Select

func (sq *SourceQuery) Select(fields ...string) *SourceSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Source.Query().
	Select(source.FieldName).
	Scan(ctx, &v)

func (*SourceQuery) Unique

func (sq *SourceQuery) Unique(unique bool) *SourceQuery

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 (*SourceQuery) Where

func (sq *SourceQuery) Where(ps ...predicate.Source) *SourceQuery

Where adds a new predicate for the SourceQuery builder.

func (*SourceQuery) WithRecipe

func (sq *SourceQuery) WithRecipe(opts ...func(*RecipeQuery)) *SourceQuery

WithRecipe tells the query-builder to eager-load the nodes that are connected to the "recipe" edge. The optional arguments are used to configure the query builder of the edge.

type SourceSelect

type SourceSelect struct {
	*SourceQuery
	// contains filtered or unexported fields
}

SourceSelect is the builder for selecting fields of Source entities.

func (*SourceSelect) Aggregate

func (ss *SourceSelect) Aggregate(fns ...AggregateFunc) *SourceSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SourceSelect) Bool

func (s *SourceSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SourceSelect) BoolX

func (s *SourceSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SourceSelect) Bools

func (s *SourceSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SourceSelect) BoolsX

func (s *SourceSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SourceSelect) Float64

func (s *SourceSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SourceSelect) Float64X

func (s *SourceSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SourceSelect) Float64s

func (s *SourceSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SourceSelect) Float64sX

func (s *SourceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SourceSelect) Int

func (s *SourceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SourceSelect) IntX

func (s *SourceSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SourceSelect) Ints

func (s *SourceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SourceSelect) IntsX

func (s *SourceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SourceSelect) Scan

func (ss *SourceSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SourceSelect) ScanX

func (s *SourceSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SourceSelect) String

func (s *SourceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SourceSelect) StringX

func (s *SourceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SourceSelect) Strings

func (s *SourceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SourceSelect) StringsX

func (s *SourceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SourceUpdate

type SourceUpdate struct {
	// contains filtered or unexported fields
}

SourceUpdate is the builder for updating Source entities.

func (*SourceUpdate) ClearDescription

func (su *SourceUpdate) ClearDescription() *SourceUpdate

ClearDescription clears the value of the "description" field.

func (*SourceUpdate) ClearName

func (su *SourceUpdate) ClearName() *SourceUpdate

ClearName clears the value of the "name" field.

func (*SourceUpdate) ClearRecipe

func (su *SourceUpdate) ClearRecipe() *SourceUpdate

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*SourceUpdate) ClearURL

func (su *SourceUpdate) ClearURL() *SourceUpdate

ClearURL clears the value of the "url" field.

func (*SourceUpdate) Exec

func (su *SourceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SourceUpdate) ExecX

func (su *SourceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SourceUpdate) Mutation

func (su *SourceUpdate) Mutation() *SourceMutation

Mutation returns the SourceMutation object of the builder.

func (*SourceUpdate) Save

func (su *SourceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SourceUpdate) SaveX

func (su *SourceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SourceUpdate) SetDescription

func (su *SourceUpdate) SetDescription(s string) *SourceUpdate

SetDescription sets the "description" field.

func (*SourceUpdate) SetName

func (su *SourceUpdate) SetName(s string) *SourceUpdate

SetName sets the "name" field.

func (*SourceUpdate) SetNillableDescription

func (su *SourceUpdate) SetNillableDescription(s *string) *SourceUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*SourceUpdate) SetNillableName

func (su *SourceUpdate) SetNillableName(s *string) *SourceUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*SourceUpdate) SetNillableRecipeID

func (su *SourceUpdate) SetNillableRecipeID(id *uuid.UUID) *SourceUpdate

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*SourceUpdate) SetNillableURL

func (su *SourceUpdate) SetNillableURL(s *string) *SourceUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*SourceUpdate) SetRecipe

func (su *SourceUpdate) SetRecipe(r *Recipe) *SourceUpdate

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*SourceUpdate) SetRecipeID

func (su *SourceUpdate) SetRecipeID(id uuid.UUID) *SourceUpdate

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

func (*SourceUpdate) SetURL

func (su *SourceUpdate) SetURL(s string) *SourceUpdate

SetURL sets the "url" field.

func (*SourceUpdate) Where

func (su *SourceUpdate) Where(ps ...predicate.Source) *SourceUpdate

Where appends a list predicates to the SourceUpdate builder.

type SourceUpdateOne

type SourceUpdateOne struct {
	// contains filtered or unexported fields
}

SourceUpdateOne is the builder for updating a single Source entity.

func (*SourceUpdateOne) ClearDescription

func (suo *SourceUpdateOne) ClearDescription() *SourceUpdateOne

ClearDescription clears the value of the "description" field.

func (*SourceUpdateOne) ClearName

func (suo *SourceUpdateOne) ClearName() *SourceUpdateOne

ClearName clears the value of the "name" field.

func (*SourceUpdateOne) ClearRecipe

func (suo *SourceUpdateOne) ClearRecipe() *SourceUpdateOne

ClearRecipe clears the "recipe" edge to the Recipe entity.

func (*SourceUpdateOne) ClearURL

func (suo *SourceUpdateOne) ClearURL() *SourceUpdateOne

ClearURL clears the value of the "url" field.

func (*SourceUpdateOne) Exec

func (suo *SourceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SourceUpdateOne) ExecX

func (suo *SourceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SourceUpdateOne) Mutation

func (suo *SourceUpdateOne) Mutation() *SourceMutation

Mutation returns the SourceMutation object of the builder.

func (*SourceUpdateOne) Save

func (suo *SourceUpdateOne) Save(ctx context.Context) (*Source, error)

Save executes the query and returns the updated Source entity.

func (*SourceUpdateOne) SaveX

func (suo *SourceUpdateOne) SaveX(ctx context.Context) *Source

SaveX is like Save, but panics if an error occurs.

func (*SourceUpdateOne) Select

func (suo *SourceUpdateOne) Select(field string, fields ...string) *SourceUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SourceUpdateOne) SetDescription

func (suo *SourceUpdateOne) SetDescription(s string) *SourceUpdateOne

SetDescription sets the "description" field.

func (*SourceUpdateOne) SetName

func (suo *SourceUpdateOne) SetName(s string) *SourceUpdateOne

SetName sets the "name" field.

func (*SourceUpdateOne) SetNillableDescription

func (suo *SourceUpdateOne) SetNillableDescription(s *string) *SourceUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*SourceUpdateOne) SetNillableName

func (suo *SourceUpdateOne) SetNillableName(s *string) *SourceUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*SourceUpdateOne) SetNillableRecipeID

func (suo *SourceUpdateOne) SetNillableRecipeID(id *uuid.UUID) *SourceUpdateOne

SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.

func (*SourceUpdateOne) SetNillableURL

func (suo *SourceUpdateOne) SetNillableURL(s *string) *SourceUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*SourceUpdateOne) SetRecipe

func (suo *SourceUpdateOne) SetRecipe(r *Recipe) *SourceUpdateOne

SetRecipe sets the "recipe" edge to the Recipe entity.

func (*SourceUpdateOne) SetRecipeID

func (suo *SourceUpdateOne) SetRecipeID(id uuid.UUID) *SourceUpdateOne

SetRecipeID sets the "recipe" edge to the Recipe entity by ID.

func (*SourceUpdateOne) SetURL

func (suo *SourceUpdateOne) SetURL(s string) *SourceUpdateOne

SetURL sets the "url" field.

func (*SourceUpdateOne) Where

func (suo *SourceUpdateOne) Where(ps ...predicate.Source) *SourceUpdateOne

Where appends a list predicates to the SourceUpdate builder.

type Sources

type Sources []*Source

Sources is a parsable slice of Source.

type Tag

type Tag struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Group holds the value of the "group" field.
	Group string `json:"group,omitempty"`
	// Slug holds the value of the "slug" field.
	Slug string `json:"slug,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) QueryRecipes

func (t *Tag) QueryRecipes() *RecipeQuery

QueryRecipes queries the "recipes" 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.

func (*Tag) Value

func (t *Tag) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Tag. This includes values selected through modifiers, order, etc.

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

DeleteOneID 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) Intercept

func (c *TagClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tag.Intercept(f(g(h())))`.

func (*TagClient) Interceptors

func (c *TagClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TagClient) MapCreateBulk

func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*TagClient) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryRecipes

func (c *TagClient) QueryRecipes(t *Tag) *RecipeQuery

QueryRecipes queries the recipes 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) AddRecipeIDs

func (tc *TagCreate) AddRecipeIDs(ids ...uuid.UUID) *TagCreate

AddRecipeIDs adds the "recipes" edge to the Recipe entity by IDs.

func (*TagCreate) AddRecipes

func (tc *TagCreate) AddRecipes(r ...*Recipe) *TagCreate

AddRecipes adds the "recipes" edges to the Recipe 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) SetGroup

func (tc *TagCreate) SetGroup(s string) *TagCreate

SetGroup sets the "group" field.

func (*TagCreate) SetID

func (tc *TagCreate) SetID(u uuid.UUID) *TagCreate

SetID sets the "id" field.

func (*TagCreate) SetName

func (tc *TagCreate) SetName(s string) *TagCreate

SetName sets the "name" field.

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) SetSlug

func (tc *TagCreate) SetSlug(s string) *TagCreate

SetSlug sets the "slug" 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.

func (*TagDeleteOne) Where

func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne

Where appends a list predicates to the TagDelete builder.

type TagEdges

type TagEdges struct {
	// Recipes holds the value of the recipes edge.
	Recipes []*Recipe `json:"recipes,omitempty"`
	// contains filtered or unexported fields
}

TagEdges holds the relations/edges for other nodes in the graph.

func (TagEdges) RecipesOrErr

func (e TagEdges) RecipesOrErr() ([]*Recipe, error)

RecipesOrErr returns the Recipes 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 any) error

Scan applies the selector query and scans the result into the given value.

func (*TagGroupBy) ScanX

func (s *TagGroupBy) ScanX(ctx context.Context, v any)

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) AddRecipeIDs

func (m *TagMutation) AddRecipeIDs(ids ...uuid.UUID)

AddRecipeIDs adds the "recipes" edge to the Recipe 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) ClearRecipes

func (m *TagMutation) ClearRecipes()

ClearRecipes clears the "recipes" edge to the Recipe 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) 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) Group

func (m *TagMutation) Group() (r string, exists bool)

Group returns the value of the "group" 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) Name

func (m *TagMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

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) OldGroup

func (m *TagMutation) OldGroup(ctx context.Context) (v string, err error)

OldGroup returns the old "group" 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) OldName

func (m *TagMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" 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) OldSlug

func (m *TagMutation) OldSlug(ctx context.Context) (v string, err error)

OldSlug returns the old "slug" 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) RecipesCleared

func (m *TagMutation) RecipesCleared() bool

RecipesCleared reports if the "recipes" edge to the Recipe entity was cleared.

func (*TagMutation) RecipesIDs

func (m *TagMutation) RecipesIDs() (ids []uuid.UUID)

RecipesIDs returns the "recipes" edge IDs in the mutation.

func (*TagMutation) RemoveRecipeIDs

func (m *TagMutation) RemoveRecipeIDs(ids ...uuid.UUID)

RemoveRecipeIDs removes the "recipes" edge to the Recipe 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) RemovedRecipesIDs

func (m *TagMutation) RemovedRecipesIDs() (ids []uuid.UUID)

RemovedRecipes returns the removed IDs of the "recipes" edge to the Recipe entity.

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) ResetGroup

func (m *TagMutation) ResetGroup()

ResetGroup resets all changes to the "group" field.

func (*TagMutation) ResetName

func (m *TagMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TagMutation) ResetRecipes

func (m *TagMutation) ResetRecipes()

ResetRecipes resets all changes to the "recipes" edge.

func (*TagMutation) ResetSlug

func (m *TagMutation) ResetSlug()

ResetSlug resets all changes to the "slug" 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) SetGroup

func (m *TagMutation) SetGroup(s string)

SetGroup sets the "group" field.

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) SetName

func (m *TagMutation) SetName(s string)

SetName sets the "name" field.

func (*TagMutation) SetOp

func (m *TagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TagMutation) SetSlug

func (m *TagMutation) SetSlug(s string)

SetSlug sets the "slug" field.

func (*TagMutation) Slug

func (m *TagMutation) Slug() (r string, exists bool)

Slug returns the value of the "slug" field 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) Where

func (m *TagMutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the TagMutation builder.

func (*TagMutation) WhereP

func (m *TagMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TagQuery

type TagQuery struct {
	// contains filtered or unexported fields
}

TagQuery is the builder for querying Tag entities.

func (*TagQuery) Aggregate

func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate returns a TagSelect configured with the given aggregations.

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 {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Tag.Query().
	GroupBy(tag.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TagQuery) IDs

func (tq *TagQuery) IDs(ctx context.Context) (ids []uuid.UUID, err 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 the number of records to be returned by this query.

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset to start from.

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 ...tag.OrderOption) *TagQuery

Order specifies how the records should be ordered.

func (*TagQuery) QueryRecipes

func (tq *TagQuery) QueryRecipes() *RecipeQuery

QueryRecipes chains the current query on the "recipes" 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 {
	Name string `json:"name,omitempty"`
}

client.Tag.Query().
	Select(tag.FieldName).
	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) WithRecipes

func (tq *TagQuery) WithRecipes(opts ...func(*RecipeQuery)) *TagQuery

WithRecipes tells the query-builder to eager-load the nodes that are connected to the "recipes" 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) Aggregate

func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate adds the given aggregation functions to the selector query.

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 any) 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 any)

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 TagUpdate

type TagUpdate struct {
	// contains filtered or unexported fields
}

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddRecipeIDs

func (tu *TagUpdate) AddRecipeIDs(ids ...uuid.UUID) *TagUpdate

AddRecipeIDs adds the "recipes" edge to the Recipe entity by IDs.

func (*TagUpdate) AddRecipes

func (tu *TagUpdate) AddRecipes(r ...*Recipe) *TagUpdate

AddRecipes adds the "recipes" edges to the Recipe entity.

func (*TagUpdate) ClearRecipes

func (tu *TagUpdate) ClearRecipes() *TagUpdate

ClearRecipes clears all "recipes" edges to the Recipe 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) RemoveRecipeIDs

func (tu *TagUpdate) RemoveRecipeIDs(ids ...uuid.UUID) *TagUpdate

RemoveRecipeIDs removes the "recipes" edge to Recipe entities by IDs.

func (*TagUpdate) RemoveRecipes

func (tu *TagUpdate) RemoveRecipes(r ...*Recipe) *TagUpdate

RemoveRecipes removes "recipes" edges to Recipe 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) SetGroup

func (tu *TagUpdate) SetGroup(s string) *TagUpdate

SetGroup sets the "group" field.

func (*TagUpdate) SetName

func (tu *TagUpdate) SetName(s string) *TagUpdate

SetName sets the "name" field.

func (*TagUpdate) SetNillableGroup

func (tu *TagUpdate) SetNillableGroup(s *string) *TagUpdate

SetNillableGroup sets the "group" field if the given value is not nil.

func (*TagUpdate) SetNillableName

func (tu *TagUpdate) SetNillableName(s *string) *TagUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*TagUpdate) SetNillableSlug

func (tu *TagUpdate) SetNillableSlug(s *string) *TagUpdate

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*TagUpdate) SetSlug

func (tu *TagUpdate) SetSlug(s string) *TagUpdate

SetSlug sets the "slug" 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) AddRecipeIDs

func (tuo *TagUpdateOne) AddRecipeIDs(ids ...uuid.UUID) *TagUpdateOne

AddRecipeIDs adds the "recipes" edge to the Recipe entity by IDs.

func (*TagUpdateOne) AddRecipes

func (tuo *TagUpdateOne) AddRecipes(r ...*Recipe) *TagUpdateOne

AddRecipes adds the "recipes" edges to the Recipe entity.

func (*TagUpdateOne) ClearRecipes

func (tuo *TagUpdateOne) ClearRecipes() *TagUpdateOne

ClearRecipes clears all "recipes" edges to the Recipe 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) RemoveRecipeIDs

func (tuo *TagUpdateOne) RemoveRecipeIDs(ids ...uuid.UUID) *TagUpdateOne

RemoveRecipeIDs removes the "recipes" edge to Recipe entities by IDs.

func (*TagUpdateOne) RemoveRecipes

func (tuo *TagUpdateOne) RemoveRecipes(r ...*Recipe) *TagUpdateOne

RemoveRecipes removes "recipes" edges to Recipe 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) SetGroup

func (tuo *TagUpdateOne) SetGroup(s string) *TagUpdateOne

SetGroup sets the "group" field.

func (*TagUpdateOne) SetName

func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne

SetName sets the "name" field.

func (*TagUpdateOne) SetNillableGroup

func (tuo *TagUpdateOne) SetNillableGroup(s *string) *TagUpdateOne

SetNillableGroup sets the "group" field if the given value is not nil.

func (*TagUpdateOne) SetNillableName

func (tuo *TagUpdateOne) SetNillableName(s *string) *TagUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*TagUpdateOne) SetNillableSlug

func (tuo *TagUpdateOne) SetNillableSlug(s *string) *TagUpdateOne

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*TagUpdateOne) SetSlug

func (tuo *TagUpdateOne) SetSlug(s string) *TagUpdateOne

SetSlug sets the "slug" field.

func (*TagUpdateOne) Where

func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne

Where appends a list predicates to the TagUpdate builder.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Equipment is the client for interacting with the Equipment builders.
	Equipment *EquipmentClient
	// Idea is the client for interacting with the Idea builders.
	Idea *IdeaClient
	// Ingredient is the client for interacting with the Ingredient builders.
	Ingredient *IngredientClient
	// Instruction is the client for interacting with the Instruction builders.
	Instruction *InstructionClient
	// Nutrition is the client for interacting with the Nutrition builders.
	Nutrition *NutritionClient
	// Product is the client for interacting with the Product builders.
	Product *ProductClient
	// Recipe is the client for interacting with the Recipe builders.
	Recipe *RecipeClient
	// Source is the client for interacting with the Source builders.
	Source *SourceClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL