Documentation ¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Categories
- type Category
- type CategoryClient
- func (c *CategoryClient) Create() *CategoryCreate
- func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk
- func (c *CategoryClient) Delete() *CategoryDelete
- func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne
- func (c *CategoryClient) DeleteOneID(id int) *CategoryDeleteOne
- func (c *CategoryClient) Get(ctx context.Context, id int) (*Category, error)
- func (c *CategoryClient) GetX(ctx context.Context, id int) *Category
- func (c *CategoryClient) Hooks() []Hook
- func (c *CategoryClient) Query() *CategoryQuery
- func (c *CategoryClient) QueryRecipe(ca *Category) *RecipeQuery
- func (c *CategoryClient) Update() *CategoryUpdate
- func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne
- func (c *CategoryClient) UpdateOneID(id int) *CategoryUpdateOne
- func (c *CategoryClient) Use(hooks ...Hook)
- type CategoryCreate
- func (cc *CategoryCreate) AddRecipe(r ...*Recipe) *CategoryCreate
- func (cc *CategoryCreate) AddRecipeIDs(ids ...int) *CategoryCreate
- func (cc *CategoryCreate) Exec(ctx context.Context) error
- func (cc *CategoryCreate) ExecX(ctx context.Context)
- func (cc *CategoryCreate) Mutation() *CategoryMutation
- func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)
- func (cc *CategoryCreate) SaveX(ctx context.Context) *Category
- func (cc *CategoryCreate) SetName(s string) *CategoryCreate
- type CategoryCreateBulk
- type CategoryDelete
- type CategoryDeleteOne
- type CategoryEdges
- type CategoryGroupBy
- func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy
- func (cgb *CategoryGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (cgb *CategoryGroupBy) BoolX(ctx context.Context) bool
- func (cgb *CategoryGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (cgb *CategoryGroupBy) BoolsX(ctx context.Context) []bool
- func (cgb *CategoryGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (cgb *CategoryGroupBy) Float64X(ctx context.Context) float64
- func (cgb *CategoryGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (cgb *CategoryGroupBy) Float64sX(ctx context.Context) []float64
- func (cgb *CategoryGroupBy) Int(ctx context.Context) (_ int, err error)
- func (cgb *CategoryGroupBy) IntX(ctx context.Context) int
- func (cgb *CategoryGroupBy) Ints(ctx context.Context) ([]int, error)
- func (cgb *CategoryGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CategoryGroupBy) Scan(ctx context.Context, v interface{}) error
- func (cgb *CategoryGroupBy) ScanX(ctx context.Context, v interface{})
- func (cgb *CategoryGroupBy) String(ctx context.Context) (_ string, err error)
- func (cgb *CategoryGroupBy) StringX(ctx context.Context) string
- func (cgb *CategoryGroupBy) Strings(ctx context.Context) ([]string, error)
- func (cgb *CategoryGroupBy) StringsX(ctx context.Context) []string
- type CategoryMutation
- func (m *CategoryMutation) AddField(name string, value ent.Value) error
- func (m *CategoryMutation) AddRecipeIDs(ids ...int)
- func (m *CategoryMutation) AddedEdges() []string
- func (m *CategoryMutation) AddedField(name string) (ent.Value, bool)
- func (m *CategoryMutation) AddedFields() []string
- func (m *CategoryMutation) AddedIDs(name string) []ent.Value
- func (m *CategoryMutation) ClearEdge(name string) error
- func (m *CategoryMutation) ClearField(name string) error
- func (m *CategoryMutation) ClearRecipe()
- func (m *CategoryMutation) ClearedEdges() []string
- func (m *CategoryMutation) ClearedFields() []string
- func (m CategoryMutation) Client() *Client
- func (m *CategoryMutation) EdgeCleared(name string) bool
- func (m *CategoryMutation) Field(name string) (ent.Value, bool)
- func (m *CategoryMutation) FieldCleared(name string) bool
- func (m *CategoryMutation) Fields() []string
- func (m *CategoryMutation) ID() (id int, exists bool)
- func (m *CategoryMutation) Name() (r string, exists bool)
- func (m *CategoryMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CategoryMutation) OldName(ctx context.Context) (v string, err error)
- func (m *CategoryMutation) Op() Op
- func (m *CategoryMutation) RecipeCleared() bool
- func (m *CategoryMutation) RecipeIDs() (ids []int)
- func (m *CategoryMutation) RemoveRecipeIDs(ids ...int)
- func (m *CategoryMutation) RemovedEdges() []string
- func (m *CategoryMutation) RemovedIDs(name string) []ent.Value
- func (m *CategoryMutation) RemovedRecipeIDs() (ids []int)
- func (m *CategoryMutation) ResetEdge(name string) error
- func (m *CategoryMutation) ResetField(name string) error
- func (m *CategoryMutation) ResetName()
- func (m *CategoryMutation) ResetRecipe()
- func (m *CategoryMutation) SetField(name string, value ent.Value) error
- func (m *CategoryMutation) SetName(s string)
- func (m CategoryMutation) Tx() (*Tx, error)
- func (m *CategoryMutation) Type() string
- func (m *CategoryMutation) Where(ps ...predicate.Category)
- type CategoryQuery
- func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)
- func (cq *CategoryQuery) AllX(ctx context.Context) []*Category
- func (cq *CategoryQuery) Clone() *CategoryQuery
- func (cq *CategoryQuery) Count(ctx context.Context) (int, error)
- func (cq *CategoryQuery) CountX(ctx context.Context) int
- func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CategoryQuery) ExistX(ctx context.Context) bool
- func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)
- func (cq *CategoryQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CategoryQuery) FirstIDX(ctx context.Context) int
- func (cq *CategoryQuery) FirstX(ctx context.Context) *Category
- func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy
- func (cq *CategoryQuery) IDs(ctx context.Context) ([]int, error)
- func (cq *CategoryQuery) IDsX(ctx context.Context) []int
- func (cq *CategoryQuery) Limit(limit int) *CategoryQuery
- func (cq *CategoryQuery) Offset(offset int) *CategoryQuery
- func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)
- func (cq *CategoryQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CategoryQuery) OnlyIDX(ctx context.Context) int
- func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category
- func (cq *CategoryQuery) Order(o ...OrderFunc) *CategoryQuery
- func (cq *CategoryQuery) QueryRecipe() *RecipeQuery
- func (cq *CategoryQuery) Select(fields ...string) *CategorySelect
- func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery
- func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery
- func (cq *CategoryQuery) WithRecipe(opts ...func(*RecipeQuery)) *CategoryQuery
- type CategorySelect
- func (cs *CategorySelect) Bool(ctx context.Context) (_ bool, err error)
- func (cs *CategorySelect) BoolX(ctx context.Context) bool
- func (cs *CategorySelect) Bools(ctx context.Context) ([]bool, error)
- func (cs *CategorySelect) BoolsX(ctx context.Context) []bool
- func (cs *CategorySelect) Float64(ctx context.Context) (_ float64, err error)
- func (cs *CategorySelect) Float64X(ctx context.Context) float64
- func (cs *CategorySelect) Float64s(ctx context.Context) ([]float64, error)
- func (cs *CategorySelect) Float64sX(ctx context.Context) []float64
- func (cs *CategorySelect) Int(ctx context.Context) (_ int, err error)
- func (cs *CategorySelect) IntX(ctx context.Context) int
- func (cs *CategorySelect) Ints(ctx context.Context) ([]int, error)
- func (cs *CategorySelect) IntsX(ctx context.Context) []int
- func (cs *CategorySelect) Scan(ctx context.Context, v interface{}) error
- func (cs *CategorySelect) ScanX(ctx context.Context, v interface{})
- func (cs *CategorySelect) String(ctx context.Context) (_ string, err error)
- func (cs *CategorySelect) StringX(ctx context.Context) string
- func (cs *CategorySelect) Strings(ctx context.Context) ([]string, error)
- func (cs *CategorySelect) StringsX(ctx context.Context) []string
- type CategoryUpdate
- func (cu *CategoryUpdate) AddRecipe(r ...*Recipe) *CategoryUpdate
- func (cu *CategoryUpdate) AddRecipeIDs(ids ...int) *CategoryUpdate
- func (cu *CategoryUpdate) ClearRecipe() *CategoryUpdate
- func (cu *CategoryUpdate) Exec(ctx context.Context) error
- func (cu *CategoryUpdate) ExecX(ctx context.Context)
- func (cu *CategoryUpdate) Mutation() *CategoryMutation
- func (cu *CategoryUpdate) RemoveRecipe(r ...*Recipe) *CategoryUpdate
- func (cu *CategoryUpdate) RemoveRecipeIDs(ids ...int) *CategoryUpdate
- func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)
- func (cu *CategoryUpdate) SaveX(ctx context.Context) int
- func (cu *CategoryUpdate) SetName(s string) *CategoryUpdate
- func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate
- type CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddRecipe(r ...*Recipe) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddRecipeIDs(ids ...int) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearRecipe() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error
- func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)
- func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation
- func (cuo *CategoryUpdateOne) RemoveRecipe(r ...*Recipe) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) RemoveRecipeIDs(ids ...int) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)
- func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category
- func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetName(s string) *CategoryUpdateOne
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type Ingredient
- type IngredientClient
- func (c *IngredientClient) Create() *IngredientCreate
- func (c *IngredientClient) CreateBulk(builders ...*IngredientCreate) *IngredientCreateBulk
- func (c *IngredientClient) Delete() *IngredientDelete
- func (c *IngredientClient) DeleteOne(i *Ingredient) *IngredientDeleteOne
- func (c *IngredientClient) DeleteOneID(id int) *IngredientDeleteOne
- func (c *IngredientClient) Get(ctx context.Context, id int) (*Ingredient, error)
- func (c *IngredientClient) GetX(ctx context.Context, id int) *Ingredient
- func (c *IngredientClient) Hooks() []Hook
- func (c *IngredientClient) Query() *IngredientQuery
- func (c *IngredientClient) QueryRecipeIngredients(i *Ingredient) *RecipeIngredientQuery
- func (c *IngredientClient) Update() *IngredientUpdate
- func (c *IngredientClient) UpdateOne(i *Ingredient) *IngredientUpdateOne
- func (c *IngredientClient) UpdateOneID(id int) *IngredientUpdateOne
- func (c *IngredientClient) Use(hooks ...Hook)
- type IngredientCreate
- func (ic *IngredientCreate) AddRecipeIngredientIDs(ids ...int) *IngredientCreate
- func (ic *IngredientCreate) AddRecipeIngredients(r ...*RecipeIngredient) *IngredientCreate
- func (ic *IngredientCreate) Exec(ctx context.Context) error
- func (ic *IngredientCreate) ExecX(ctx context.Context)
- func (ic *IngredientCreate) Mutation() *IngredientMutation
- func (ic *IngredientCreate) Save(ctx context.Context) (*Ingredient, error)
- func (ic *IngredientCreate) SaveX(ctx context.Context) *Ingredient
- func (ic *IngredientCreate) SetName(s string) *IngredientCreate
- type IngredientCreateBulk
- type IngredientDelete
- type IngredientDeleteOne
- type IngredientEdges
- type IngredientGroupBy
- func (igb *IngredientGroupBy) Aggregate(fns ...AggregateFunc) *IngredientGroupBy
- func (igb *IngredientGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (igb *IngredientGroupBy) BoolX(ctx context.Context) bool
- func (igb *IngredientGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (igb *IngredientGroupBy) BoolsX(ctx context.Context) []bool
- func (igb *IngredientGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (igb *IngredientGroupBy) Float64X(ctx context.Context) float64
- func (igb *IngredientGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (igb *IngredientGroupBy) Float64sX(ctx context.Context) []float64
- func (igb *IngredientGroupBy) Int(ctx context.Context) (_ int, err error)
- func (igb *IngredientGroupBy) IntX(ctx context.Context) int
- func (igb *IngredientGroupBy) Ints(ctx context.Context) ([]int, error)
- func (igb *IngredientGroupBy) IntsX(ctx context.Context) []int
- func (igb *IngredientGroupBy) Scan(ctx context.Context, v interface{}) error
- func (igb *IngredientGroupBy) ScanX(ctx context.Context, v interface{})
- func (igb *IngredientGroupBy) String(ctx context.Context) (_ string, err error)
- func (igb *IngredientGroupBy) StringX(ctx context.Context) string
- func (igb *IngredientGroupBy) Strings(ctx context.Context) ([]string, error)
- func (igb *IngredientGroupBy) StringsX(ctx context.Context) []string
- type IngredientMutation
- func (m *IngredientMutation) AddField(name string, value ent.Value) error
- func (m *IngredientMutation) AddRecipeIngredientIDs(ids ...int)
- func (m *IngredientMutation) AddedEdges() []string
- func (m *IngredientMutation) AddedField(name string) (ent.Value, bool)
- func (m *IngredientMutation) AddedFields() []string
- func (m *IngredientMutation) AddedIDs(name string) []ent.Value
- func (m *IngredientMutation) ClearEdge(name string) error
- func (m *IngredientMutation) ClearField(name string) error
- func (m *IngredientMutation) ClearRecipeIngredients()
- func (m *IngredientMutation) ClearedEdges() []string
- func (m *IngredientMutation) ClearedFields() []string
- func (m IngredientMutation) Client() *Client
- func (m *IngredientMutation) EdgeCleared(name string) bool
- func (m *IngredientMutation) Field(name string) (ent.Value, bool)
- func (m *IngredientMutation) FieldCleared(name string) bool
- func (m *IngredientMutation) Fields() []string
- func (m *IngredientMutation) ID() (id int, exists bool)
- func (m *IngredientMutation) Name() (r string, exists bool)
- func (m *IngredientMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *IngredientMutation) OldName(ctx context.Context) (v string, err error)
- func (m *IngredientMutation) Op() Op
- func (m *IngredientMutation) RecipeIngredientsCleared() bool
- func (m *IngredientMutation) RecipeIngredientsIDs() (ids []int)
- func (m *IngredientMutation) RemoveRecipeIngredientIDs(ids ...int)
- func (m *IngredientMutation) RemovedEdges() []string
- func (m *IngredientMutation) RemovedIDs(name string) []ent.Value
- func (m *IngredientMutation) RemovedRecipeIngredientsIDs() (ids []int)
- func (m *IngredientMutation) ResetEdge(name string) error
- func (m *IngredientMutation) ResetField(name string) error
- func (m *IngredientMutation) ResetName()
- func (m *IngredientMutation) ResetRecipeIngredients()
- func (m *IngredientMutation) SetField(name string, value ent.Value) error
- func (m *IngredientMutation) SetName(s string)
- func (m IngredientMutation) Tx() (*Tx, error)
- func (m *IngredientMutation) Type() string
- func (m *IngredientMutation) Where(ps ...predicate.Ingredient)
- type IngredientQuery
- func (iq *IngredientQuery) All(ctx context.Context) ([]*Ingredient, error)
- func (iq *IngredientQuery) AllX(ctx context.Context) []*Ingredient
- func (iq *IngredientQuery) Clone() *IngredientQuery
- func (iq *IngredientQuery) Count(ctx context.Context) (int, error)
- func (iq *IngredientQuery) CountX(ctx context.Context) int
- func (iq *IngredientQuery) Exist(ctx context.Context) (bool, error)
- func (iq *IngredientQuery) ExistX(ctx context.Context) bool
- func (iq *IngredientQuery) First(ctx context.Context) (*Ingredient, error)
- func (iq *IngredientQuery) FirstID(ctx context.Context) (id int, err error)
- func (iq *IngredientQuery) FirstIDX(ctx context.Context) int
- func (iq *IngredientQuery) FirstX(ctx context.Context) *Ingredient
- func (iq *IngredientQuery) GroupBy(field string, fields ...string) *IngredientGroupBy
- func (iq *IngredientQuery) IDs(ctx context.Context) ([]int, error)
- func (iq *IngredientQuery) IDsX(ctx context.Context) []int
- func (iq *IngredientQuery) Limit(limit int) *IngredientQuery
- func (iq *IngredientQuery) Offset(offset int) *IngredientQuery
- func (iq *IngredientQuery) Only(ctx context.Context) (*Ingredient, error)
- func (iq *IngredientQuery) OnlyID(ctx context.Context) (id int, err error)
- func (iq *IngredientQuery) OnlyIDX(ctx context.Context) int
- func (iq *IngredientQuery) OnlyX(ctx context.Context) *Ingredient
- func (iq *IngredientQuery) Order(o ...OrderFunc) *IngredientQuery
- func (iq *IngredientQuery) QueryRecipeIngredients() *RecipeIngredientQuery
- func (iq *IngredientQuery) Select(fields ...string) *IngredientSelect
- func (iq *IngredientQuery) Unique(unique bool) *IngredientQuery
- func (iq *IngredientQuery) Where(ps ...predicate.Ingredient) *IngredientQuery
- func (iq *IngredientQuery) WithRecipeIngredients(opts ...func(*RecipeIngredientQuery)) *IngredientQuery
- type IngredientSelect
- func (is *IngredientSelect) Bool(ctx context.Context) (_ bool, err error)
- func (is *IngredientSelect) BoolX(ctx context.Context) bool
- func (is *IngredientSelect) Bools(ctx context.Context) ([]bool, error)
- func (is *IngredientSelect) BoolsX(ctx context.Context) []bool
- func (is *IngredientSelect) Float64(ctx context.Context) (_ float64, err error)
- func (is *IngredientSelect) Float64X(ctx context.Context) float64
- func (is *IngredientSelect) Float64s(ctx context.Context) ([]float64, error)
- func (is *IngredientSelect) Float64sX(ctx context.Context) []float64
- func (is *IngredientSelect) Int(ctx context.Context) (_ int, err error)
- func (is *IngredientSelect) IntX(ctx context.Context) int
- func (is *IngredientSelect) Ints(ctx context.Context) ([]int, error)
- func (is *IngredientSelect) IntsX(ctx context.Context) []int
- func (is *IngredientSelect) Scan(ctx context.Context, v interface{}) error
- func (is *IngredientSelect) ScanX(ctx context.Context, v interface{})
- func (is *IngredientSelect) String(ctx context.Context) (_ string, err error)
- func (is *IngredientSelect) StringX(ctx context.Context) string
- func (is *IngredientSelect) Strings(ctx context.Context) ([]string, error)
- func (is *IngredientSelect) StringsX(ctx context.Context) []string
- type IngredientUpdate
- func (iu *IngredientUpdate) AddRecipeIngredientIDs(ids ...int) *IngredientUpdate
- func (iu *IngredientUpdate) AddRecipeIngredients(r ...*RecipeIngredient) *IngredientUpdate
- func (iu *IngredientUpdate) ClearRecipeIngredients() *IngredientUpdate
- func (iu *IngredientUpdate) Exec(ctx context.Context) error
- func (iu *IngredientUpdate) ExecX(ctx context.Context)
- func (iu *IngredientUpdate) Mutation() *IngredientMutation
- func (iu *IngredientUpdate) RemoveRecipeIngredientIDs(ids ...int) *IngredientUpdate
- func (iu *IngredientUpdate) RemoveRecipeIngredients(r ...*RecipeIngredient) *IngredientUpdate
- func (iu *IngredientUpdate) Save(ctx context.Context) (int, error)
- func (iu *IngredientUpdate) SaveX(ctx context.Context) int
- func (iu *IngredientUpdate) SetName(s string) *IngredientUpdate
- func (iu *IngredientUpdate) Where(ps ...predicate.Ingredient) *IngredientUpdate
- type IngredientUpdateOne
- func (iuo *IngredientUpdateOne) AddRecipeIngredientIDs(ids ...int) *IngredientUpdateOne
- func (iuo *IngredientUpdateOne) AddRecipeIngredients(r ...*RecipeIngredient) *IngredientUpdateOne
- func (iuo *IngredientUpdateOne) ClearRecipeIngredients() *IngredientUpdateOne
- func (iuo *IngredientUpdateOne) Exec(ctx context.Context) error
- func (iuo *IngredientUpdateOne) ExecX(ctx context.Context)
- func (iuo *IngredientUpdateOne) Mutation() *IngredientMutation
- func (iuo *IngredientUpdateOne) RemoveRecipeIngredientIDs(ids ...int) *IngredientUpdateOne
- func (iuo *IngredientUpdateOne) RemoveRecipeIngredients(r ...*RecipeIngredient) *IngredientUpdateOne
- func (iuo *IngredientUpdateOne) Save(ctx context.Context) (*Ingredient, error)
- func (iuo *IngredientUpdateOne) SaveX(ctx context.Context) *Ingredient
- func (iuo *IngredientUpdateOne) Select(field string, fields ...string) *IngredientUpdateOne
- func (iuo *IngredientUpdateOne) SetName(s string) *IngredientUpdateOne
- type Ingredients
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Query
- type Recipe
- func (r *Recipe) QueryAuthor() *UserQuery
- func (r *Recipe) QueryRecipeIngredients() *RecipeIngredientQuery
- func (r *Recipe) QuerySteps() *StepQuery
- func (r *Recipe) QueryTags() *CategoryQuery
- func (r *Recipe) String() string
- func (r *Recipe) Unwrap() *Recipe
- func (r *Recipe) Update() *RecipeUpdateOne
- type RecipeClient
- func (c *RecipeClient) Create() *RecipeCreate
- func (c *RecipeClient) CreateBulk(builders ...*RecipeCreate) *RecipeCreateBulk
- func (c *RecipeClient) Delete() *RecipeDelete
- func (c *RecipeClient) DeleteOne(r *Recipe) *RecipeDeleteOne
- func (c *RecipeClient) DeleteOneID(id int) *RecipeDeleteOne
- func (c *RecipeClient) Get(ctx context.Context, id int) (*Recipe, error)
- func (c *RecipeClient) GetX(ctx context.Context, id int) *Recipe
- func (c *RecipeClient) Hooks() []Hook
- func (c *RecipeClient) Query() *RecipeQuery
- func (c *RecipeClient) QueryAuthor(r *Recipe) *UserQuery
- func (c *RecipeClient) QueryRecipeIngredients(r *Recipe) *RecipeIngredientQuery
- func (c *RecipeClient) QuerySteps(r *Recipe) *StepQuery
- func (c *RecipeClient) QueryTags(r *Recipe) *CategoryQuery
- func (c *RecipeClient) Update() *RecipeUpdate
- func (c *RecipeClient) UpdateOne(r *Recipe) *RecipeUpdateOne
- func (c *RecipeClient) UpdateOneID(id int) *RecipeUpdateOne
- func (c *RecipeClient) Use(hooks ...Hook)
- type RecipeCreate
- func (rc *RecipeCreate) AddRecipeIngredientIDs(ids ...int) *RecipeCreate
- func (rc *RecipeCreate) AddRecipeIngredients(r ...*RecipeIngredient) *RecipeCreate
- func (rc *RecipeCreate) AddStepIDs(ids ...int) *RecipeCreate
- func (rc *RecipeCreate) AddSteps(s ...*Step) *RecipeCreate
- func (rc *RecipeCreate) AddTagIDs(ids ...int) *RecipeCreate
- func (rc *RecipeCreate) AddTags(c ...*Category) *RecipeCreate
- func (rc *RecipeCreate) Exec(ctx context.Context) error
- func (rc *RecipeCreate) ExecX(ctx context.Context)
- func (rc *RecipeCreate) Mutation() *RecipeMutation
- func (rc *RecipeCreate) Save(ctx context.Context) (*Recipe, error)
- func (rc *RecipeCreate) SaveX(ctx context.Context) *Recipe
- func (rc *RecipeCreate) SetAuthor(u *User) *RecipeCreate
- func (rc *RecipeCreate) SetAuthorID(id int) *RecipeCreate
- func (rc *RecipeCreate) SetName(s string) *RecipeCreate
- func (rc *RecipeCreate) SetNillableAuthorID(id *int) *RecipeCreate
- func (rc *RecipeCreate) SetServings(i int) *RecipeCreate
- type RecipeCreateBulk
- type RecipeDelete
- type RecipeDeleteOne
- type RecipeEdges
- type RecipeGroupBy
- func (rgb *RecipeGroupBy) Aggregate(fns ...AggregateFunc) *RecipeGroupBy
- func (rgb *RecipeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (rgb *RecipeGroupBy) BoolX(ctx context.Context) bool
- func (rgb *RecipeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (rgb *RecipeGroupBy) BoolsX(ctx context.Context) []bool
- func (rgb *RecipeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (rgb *RecipeGroupBy) Float64X(ctx context.Context) float64
- func (rgb *RecipeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (rgb *RecipeGroupBy) Float64sX(ctx context.Context) []float64
- func (rgb *RecipeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (rgb *RecipeGroupBy) IntX(ctx context.Context) int
- func (rgb *RecipeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (rgb *RecipeGroupBy) IntsX(ctx context.Context) []int
- func (rgb *RecipeGroupBy) Scan(ctx context.Context, v interface{}) error
- func (rgb *RecipeGroupBy) ScanX(ctx context.Context, v interface{})
- func (rgb *RecipeGroupBy) String(ctx context.Context) (_ string, err error)
- func (rgb *RecipeGroupBy) StringX(ctx context.Context) string
- func (rgb *RecipeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (rgb *RecipeGroupBy) StringsX(ctx context.Context) []string
- type RecipeIngredient
- type RecipeIngredientClient
- func (c *RecipeIngredientClient) Create() *RecipeIngredientCreate
- func (c *RecipeIngredientClient) CreateBulk(builders ...*RecipeIngredientCreate) *RecipeIngredientCreateBulk
- func (c *RecipeIngredientClient) Delete() *RecipeIngredientDelete
- func (c *RecipeIngredientClient) DeleteOne(ri *RecipeIngredient) *RecipeIngredientDeleteOne
- func (c *RecipeIngredientClient) DeleteOneID(id int) *RecipeIngredientDeleteOne
- func (c *RecipeIngredientClient) Get(ctx context.Context, id int) (*RecipeIngredient, error)
- func (c *RecipeIngredientClient) GetX(ctx context.Context, id int) *RecipeIngredient
- func (c *RecipeIngredientClient) Hooks() []Hook
- func (c *RecipeIngredientClient) Query() *RecipeIngredientQuery
- func (c *RecipeIngredientClient) QueryIngredient(ri *RecipeIngredient) *IngredientQuery
- func (c *RecipeIngredientClient) Update() *RecipeIngredientUpdate
- func (c *RecipeIngredientClient) UpdateOne(ri *RecipeIngredient) *RecipeIngredientUpdateOne
- func (c *RecipeIngredientClient) UpdateOneID(id int) *RecipeIngredientUpdateOne
- func (c *RecipeIngredientClient) Use(hooks ...Hook)
- type RecipeIngredientCreate
- func (ric *RecipeIngredientCreate) Exec(ctx context.Context) error
- func (ric *RecipeIngredientCreate) ExecX(ctx context.Context)
- func (ric *RecipeIngredientCreate) Mutation() *RecipeIngredientMutation
- func (ric *RecipeIngredientCreate) Save(ctx context.Context) (*RecipeIngredient, error)
- func (ric *RecipeIngredientCreate) SaveX(ctx context.Context) *RecipeIngredient
- func (ric *RecipeIngredientCreate) SetIngredient(i *Ingredient) *RecipeIngredientCreate
- func (ric *RecipeIngredientCreate) SetIngredientID(id int) *RecipeIngredientCreate
- func (ric *RecipeIngredientCreate) SetNillableIngredientID(id *int) *RecipeIngredientCreate
- func (ric *RecipeIngredientCreate) SetQuantity(f float32) *RecipeIngredientCreate
- func (ric *RecipeIngredientCreate) SetUnit(s string) *RecipeIngredientCreate
- type RecipeIngredientCreateBulk
- func (ricb *RecipeIngredientCreateBulk) Exec(ctx context.Context) error
- func (ricb *RecipeIngredientCreateBulk) ExecX(ctx context.Context)
- func (ricb *RecipeIngredientCreateBulk) Save(ctx context.Context) ([]*RecipeIngredient, error)
- func (ricb *RecipeIngredientCreateBulk) SaveX(ctx context.Context) []*RecipeIngredient
- type RecipeIngredientDelete
- type RecipeIngredientDeleteOne
- type RecipeIngredientEdges
- type RecipeIngredientGroupBy
- func (rigb *RecipeIngredientGroupBy) Aggregate(fns ...AggregateFunc) *RecipeIngredientGroupBy
- func (rigb *RecipeIngredientGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (rigb *RecipeIngredientGroupBy) BoolX(ctx context.Context) bool
- func (rigb *RecipeIngredientGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (rigb *RecipeIngredientGroupBy) BoolsX(ctx context.Context) []bool
- func (rigb *RecipeIngredientGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (rigb *RecipeIngredientGroupBy) Float64X(ctx context.Context) float64
- func (rigb *RecipeIngredientGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (rigb *RecipeIngredientGroupBy) Float64sX(ctx context.Context) []float64
- func (rigb *RecipeIngredientGroupBy) Int(ctx context.Context) (_ int, err error)
- func (rigb *RecipeIngredientGroupBy) IntX(ctx context.Context) int
- func (rigb *RecipeIngredientGroupBy) Ints(ctx context.Context) ([]int, error)
- func (rigb *RecipeIngredientGroupBy) IntsX(ctx context.Context) []int
- func (rigb *RecipeIngredientGroupBy) Scan(ctx context.Context, v interface{}) error
- func (rigb *RecipeIngredientGroupBy) ScanX(ctx context.Context, v interface{})
- func (rigb *RecipeIngredientGroupBy) String(ctx context.Context) (_ string, err error)
- func (rigb *RecipeIngredientGroupBy) StringX(ctx context.Context) string
- func (rigb *RecipeIngredientGroupBy) Strings(ctx context.Context) ([]string, error)
- func (rigb *RecipeIngredientGroupBy) StringsX(ctx context.Context) []string
- type RecipeIngredientMutation
- func (m *RecipeIngredientMutation) AddField(name string, value ent.Value) error
- func (m *RecipeIngredientMutation) AddQuantity(f float32)
- func (m *RecipeIngredientMutation) AddedEdges() []string
- func (m *RecipeIngredientMutation) AddedField(name string) (ent.Value, bool)
- func (m *RecipeIngredientMutation) AddedFields() []string
- func (m *RecipeIngredientMutation) AddedIDs(name string) []ent.Value
- func (m *RecipeIngredientMutation) AddedQuantity() (r float32, exists bool)
- func (m *RecipeIngredientMutation) ClearEdge(name string) error
- func (m *RecipeIngredientMutation) ClearField(name string) error
- func (m *RecipeIngredientMutation) ClearIngredient()
- func (m *RecipeIngredientMutation) ClearedEdges() []string
- func (m *RecipeIngredientMutation) ClearedFields() []string
- func (m RecipeIngredientMutation) Client() *Client
- func (m *RecipeIngredientMutation) EdgeCleared(name string) bool
- func (m *RecipeIngredientMutation) Field(name string) (ent.Value, bool)
- func (m *RecipeIngredientMutation) FieldCleared(name string) bool
- func (m *RecipeIngredientMutation) Fields() []string
- func (m *RecipeIngredientMutation) ID() (id int, exists bool)
- func (m *RecipeIngredientMutation) IngredientCleared() bool
- func (m *RecipeIngredientMutation) IngredientID() (id int, exists bool)
- func (m *RecipeIngredientMutation) IngredientIDs() (ids []int)
- func (m *RecipeIngredientMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RecipeIngredientMutation) OldQuantity(ctx context.Context) (v float32, err error)
- func (m *RecipeIngredientMutation) OldUnit(ctx context.Context) (v string, err error)
- func (m *RecipeIngredientMutation) Op() Op
- func (m *RecipeIngredientMutation) Quantity() (r float32, exists bool)
- func (m *RecipeIngredientMutation) RemovedEdges() []string
- func (m *RecipeIngredientMutation) RemovedIDs(name string) []ent.Value
- func (m *RecipeIngredientMutation) ResetEdge(name string) error
- func (m *RecipeIngredientMutation) ResetField(name string) error
- func (m *RecipeIngredientMutation) ResetIngredient()
- func (m *RecipeIngredientMutation) ResetQuantity()
- func (m *RecipeIngredientMutation) ResetUnit()
- func (m *RecipeIngredientMutation) SetField(name string, value ent.Value) error
- func (m *RecipeIngredientMutation) SetIngredientID(id int)
- func (m *RecipeIngredientMutation) SetQuantity(f float32)
- func (m *RecipeIngredientMutation) SetUnit(s string)
- func (m RecipeIngredientMutation) Tx() (*Tx, error)
- func (m *RecipeIngredientMutation) Type() string
- func (m *RecipeIngredientMutation) Unit() (r string, exists bool)
- func (m *RecipeIngredientMutation) Where(ps ...predicate.RecipeIngredient)
- type RecipeIngredientQuery
- func (riq *RecipeIngredientQuery) All(ctx context.Context) ([]*RecipeIngredient, error)
- func (riq *RecipeIngredientQuery) AllX(ctx context.Context) []*RecipeIngredient
- func (riq *RecipeIngredientQuery) Clone() *RecipeIngredientQuery
- func (riq *RecipeIngredientQuery) Count(ctx context.Context) (int, error)
- func (riq *RecipeIngredientQuery) CountX(ctx context.Context) int
- func (riq *RecipeIngredientQuery) Exist(ctx context.Context) (bool, error)
- func (riq *RecipeIngredientQuery) ExistX(ctx context.Context) bool
- func (riq *RecipeIngredientQuery) First(ctx context.Context) (*RecipeIngredient, error)
- func (riq *RecipeIngredientQuery) FirstID(ctx context.Context) (id int, err error)
- func (riq *RecipeIngredientQuery) FirstIDX(ctx context.Context) int
- func (riq *RecipeIngredientQuery) FirstX(ctx context.Context) *RecipeIngredient
- func (riq *RecipeIngredientQuery) GroupBy(field string, fields ...string) *RecipeIngredientGroupBy
- func (riq *RecipeIngredientQuery) IDs(ctx context.Context) ([]int, error)
- func (riq *RecipeIngredientQuery) IDsX(ctx context.Context) []int
- func (riq *RecipeIngredientQuery) Limit(limit int) *RecipeIngredientQuery
- func (riq *RecipeIngredientQuery) Offset(offset int) *RecipeIngredientQuery
- func (riq *RecipeIngredientQuery) Only(ctx context.Context) (*RecipeIngredient, error)
- func (riq *RecipeIngredientQuery) OnlyID(ctx context.Context) (id int, err error)
- func (riq *RecipeIngredientQuery) OnlyIDX(ctx context.Context) int
- func (riq *RecipeIngredientQuery) OnlyX(ctx context.Context) *RecipeIngredient
- func (riq *RecipeIngredientQuery) Order(o ...OrderFunc) *RecipeIngredientQuery
- func (riq *RecipeIngredientQuery) QueryIngredient() *IngredientQuery
- func (riq *RecipeIngredientQuery) Select(fields ...string) *RecipeIngredientSelect
- func (riq *RecipeIngredientQuery) Unique(unique bool) *RecipeIngredientQuery
- func (riq *RecipeIngredientQuery) Where(ps ...predicate.RecipeIngredient) *RecipeIngredientQuery
- func (riq *RecipeIngredientQuery) WithIngredient(opts ...func(*IngredientQuery)) *RecipeIngredientQuery
- type RecipeIngredientSelect
- func (ris *RecipeIngredientSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ris *RecipeIngredientSelect) BoolX(ctx context.Context) bool
- func (ris *RecipeIngredientSelect) Bools(ctx context.Context) ([]bool, error)
- func (ris *RecipeIngredientSelect) BoolsX(ctx context.Context) []bool
- func (ris *RecipeIngredientSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ris *RecipeIngredientSelect) Float64X(ctx context.Context) float64
- func (ris *RecipeIngredientSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ris *RecipeIngredientSelect) Float64sX(ctx context.Context) []float64
- func (ris *RecipeIngredientSelect) Int(ctx context.Context) (_ int, err error)
- func (ris *RecipeIngredientSelect) IntX(ctx context.Context) int
- func (ris *RecipeIngredientSelect) Ints(ctx context.Context) ([]int, error)
- func (ris *RecipeIngredientSelect) IntsX(ctx context.Context) []int
- func (ris *RecipeIngredientSelect) Scan(ctx context.Context, v interface{}) error
- func (ris *RecipeIngredientSelect) ScanX(ctx context.Context, v interface{})
- func (ris *RecipeIngredientSelect) String(ctx context.Context) (_ string, err error)
- func (ris *RecipeIngredientSelect) StringX(ctx context.Context) string
- func (ris *RecipeIngredientSelect) Strings(ctx context.Context) ([]string, error)
- func (ris *RecipeIngredientSelect) StringsX(ctx context.Context) []string
- type RecipeIngredientUpdate
- func (riu *RecipeIngredientUpdate) AddQuantity(f float32) *RecipeIngredientUpdate
- func (riu *RecipeIngredientUpdate) ClearIngredient() *RecipeIngredientUpdate
- func (riu *RecipeIngredientUpdate) Exec(ctx context.Context) error
- func (riu *RecipeIngredientUpdate) ExecX(ctx context.Context)
- func (riu *RecipeIngredientUpdate) Mutation() *RecipeIngredientMutation
- func (riu *RecipeIngredientUpdate) Save(ctx context.Context) (int, error)
- func (riu *RecipeIngredientUpdate) SaveX(ctx context.Context) int
- func (riu *RecipeIngredientUpdate) SetIngredient(i *Ingredient) *RecipeIngredientUpdate
- func (riu *RecipeIngredientUpdate) SetIngredientID(id int) *RecipeIngredientUpdate
- func (riu *RecipeIngredientUpdate) SetNillableIngredientID(id *int) *RecipeIngredientUpdate
- func (riu *RecipeIngredientUpdate) SetQuantity(f float32) *RecipeIngredientUpdate
- func (riu *RecipeIngredientUpdate) SetUnit(s string) *RecipeIngredientUpdate
- func (riu *RecipeIngredientUpdate) Where(ps ...predicate.RecipeIngredient) *RecipeIngredientUpdate
- type RecipeIngredientUpdateOne
- func (riuo *RecipeIngredientUpdateOne) AddQuantity(f float32) *RecipeIngredientUpdateOne
- func (riuo *RecipeIngredientUpdateOne) ClearIngredient() *RecipeIngredientUpdateOne
- func (riuo *RecipeIngredientUpdateOne) Exec(ctx context.Context) error
- func (riuo *RecipeIngredientUpdateOne) ExecX(ctx context.Context)
- func (riuo *RecipeIngredientUpdateOne) Mutation() *RecipeIngredientMutation
- func (riuo *RecipeIngredientUpdateOne) Save(ctx context.Context) (*RecipeIngredient, error)
- func (riuo *RecipeIngredientUpdateOne) SaveX(ctx context.Context) *RecipeIngredient
- func (riuo *RecipeIngredientUpdateOne) Select(field string, fields ...string) *RecipeIngredientUpdateOne
- func (riuo *RecipeIngredientUpdateOne) SetIngredient(i *Ingredient) *RecipeIngredientUpdateOne
- func (riuo *RecipeIngredientUpdateOne) SetIngredientID(id int) *RecipeIngredientUpdateOne
- func (riuo *RecipeIngredientUpdateOne) SetNillableIngredientID(id *int) *RecipeIngredientUpdateOne
- func (riuo *RecipeIngredientUpdateOne) SetQuantity(f float32) *RecipeIngredientUpdateOne
- func (riuo *RecipeIngredientUpdateOne) SetUnit(s string) *RecipeIngredientUpdateOne
- type RecipeIngredients
- type RecipeMutation
- func (m *RecipeMutation) AddField(name string, value ent.Value) error
- func (m *RecipeMutation) AddRecipeIngredientIDs(ids ...int)
- func (m *RecipeMutation) AddServings(i int)
- func (m *RecipeMutation) AddStepIDs(ids ...int)
- func (m *RecipeMutation) AddTagIDs(ids ...int)
- func (m *RecipeMutation) AddedEdges() []string
- func (m *RecipeMutation) AddedField(name string) (ent.Value, bool)
- func (m *RecipeMutation) AddedFields() []string
- func (m *RecipeMutation) AddedIDs(name string) []ent.Value
- func (m *RecipeMutation) AddedServings() (r int, exists bool)
- func (m *RecipeMutation) AuthorCleared() bool
- func (m *RecipeMutation) AuthorID() (id int, exists bool)
- func (m *RecipeMutation) AuthorIDs() (ids []int)
- func (m *RecipeMutation) ClearAuthor()
- func (m *RecipeMutation) ClearEdge(name string) error
- func (m *RecipeMutation) ClearField(name string) error
- func (m *RecipeMutation) ClearRecipeIngredients()
- func (m *RecipeMutation) ClearSteps()
- func (m *RecipeMutation) ClearTags()
- func (m *RecipeMutation) ClearedEdges() []string
- func (m *RecipeMutation) ClearedFields() []string
- func (m RecipeMutation) Client() *Client
- func (m *RecipeMutation) EdgeCleared(name string) bool
- func (m *RecipeMutation) Field(name string) (ent.Value, bool)
- func (m *RecipeMutation) FieldCleared(name string) bool
- func (m *RecipeMutation) Fields() []string
- func (m *RecipeMutation) ID() (id int, exists bool)
- func (m *RecipeMutation) Name() (r string, exists bool)
- func (m *RecipeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RecipeMutation) OldName(ctx context.Context) (v string, err error)
- func (m *RecipeMutation) OldServings(ctx context.Context) (v int, err error)
- func (m *RecipeMutation) Op() Op
- func (m *RecipeMutation) RecipeIngredientsCleared() bool
- func (m *RecipeMutation) RecipeIngredientsIDs() (ids []int)
- func (m *RecipeMutation) RemoveRecipeIngredientIDs(ids ...int)
- func (m *RecipeMutation) RemoveStepIDs(ids ...int)
- func (m *RecipeMutation) RemoveTagIDs(ids ...int)
- func (m *RecipeMutation) RemovedEdges() []string
- func (m *RecipeMutation) RemovedIDs(name string) []ent.Value
- func (m *RecipeMutation) RemovedRecipeIngredientsIDs() (ids []int)
- func (m *RecipeMutation) RemovedStepsIDs() (ids []int)
- func (m *RecipeMutation) RemovedTagsIDs() (ids []int)
- func (m *RecipeMutation) ResetAuthor()
- func (m *RecipeMutation) ResetEdge(name string) error
- func (m *RecipeMutation) ResetField(name string) error
- func (m *RecipeMutation) ResetName()
- func (m *RecipeMutation) ResetRecipeIngredients()
- func (m *RecipeMutation) ResetServings()
- func (m *RecipeMutation) ResetSteps()
- func (m *RecipeMutation) ResetTags()
- func (m *RecipeMutation) Servings() (r int, exists bool)
- func (m *RecipeMutation) SetAuthorID(id int)
- func (m *RecipeMutation) SetField(name string, value ent.Value) error
- func (m *RecipeMutation) SetName(s string)
- func (m *RecipeMutation) SetServings(i int)
- func (m *RecipeMutation) StepsCleared() bool
- func (m *RecipeMutation) StepsIDs() (ids []int)
- func (m *RecipeMutation) TagsCleared() bool
- func (m *RecipeMutation) TagsIDs() (ids []int)
- func (m RecipeMutation) Tx() (*Tx, error)
- func (m *RecipeMutation) Type() string
- func (m *RecipeMutation) Where(ps ...predicate.Recipe)
- type RecipeQuery
- func (rq *RecipeQuery) All(ctx context.Context) ([]*Recipe, error)
- func (rq *RecipeQuery) AllX(ctx context.Context) []*Recipe
- func (rq *RecipeQuery) Clone() *RecipeQuery
- func (rq *RecipeQuery) Count(ctx context.Context) (int, error)
- func (rq *RecipeQuery) CountX(ctx context.Context) int
- func (rq *RecipeQuery) Exist(ctx context.Context) (bool, error)
- func (rq *RecipeQuery) ExistX(ctx context.Context) bool
- func (rq *RecipeQuery) First(ctx context.Context) (*Recipe, error)
- func (rq *RecipeQuery) FirstID(ctx context.Context) (id int, err error)
- func (rq *RecipeQuery) FirstIDX(ctx context.Context) int
- func (rq *RecipeQuery) FirstX(ctx context.Context) *Recipe
- func (rq *RecipeQuery) GroupBy(field string, fields ...string) *RecipeGroupBy
- func (rq *RecipeQuery) IDs(ctx context.Context) ([]int, error)
- func (rq *RecipeQuery) IDsX(ctx context.Context) []int
- func (rq *RecipeQuery) Limit(limit int) *RecipeQuery
- func (rq *RecipeQuery) Offset(offset int) *RecipeQuery
- func (rq *RecipeQuery) Only(ctx context.Context) (*Recipe, error)
- func (rq *RecipeQuery) OnlyID(ctx context.Context) (id int, err error)
- func (rq *RecipeQuery) OnlyIDX(ctx context.Context) int
- func (rq *RecipeQuery) OnlyX(ctx context.Context) *Recipe
- func (rq *RecipeQuery) Order(o ...OrderFunc) *RecipeQuery
- func (rq *RecipeQuery) QueryAuthor() *UserQuery
- func (rq *RecipeQuery) QueryRecipeIngredients() *RecipeIngredientQuery
- func (rq *RecipeQuery) QuerySteps() *StepQuery
- func (rq *RecipeQuery) QueryTags() *CategoryQuery
- func (rq *RecipeQuery) Select(fields ...string) *RecipeSelect
- func (rq *RecipeQuery) Unique(unique bool) *RecipeQuery
- func (rq *RecipeQuery) Where(ps ...predicate.Recipe) *RecipeQuery
- func (rq *RecipeQuery) WithAuthor(opts ...func(*UserQuery)) *RecipeQuery
- func (rq *RecipeQuery) WithRecipeIngredients(opts ...func(*RecipeIngredientQuery)) *RecipeQuery
- func (rq *RecipeQuery) WithSteps(opts ...func(*StepQuery)) *RecipeQuery
- func (rq *RecipeQuery) WithTags(opts ...func(*CategoryQuery)) *RecipeQuery
- type RecipeSelect
- func (rs *RecipeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (rs *RecipeSelect) BoolX(ctx context.Context) bool
- func (rs *RecipeSelect) Bools(ctx context.Context) ([]bool, error)
- func (rs *RecipeSelect) BoolsX(ctx context.Context) []bool
- func (rs *RecipeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (rs *RecipeSelect) Float64X(ctx context.Context) float64
- func (rs *RecipeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (rs *RecipeSelect) Float64sX(ctx context.Context) []float64
- func (rs *RecipeSelect) Int(ctx context.Context) (_ int, err error)
- func (rs *RecipeSelect) IntX(ctx context.Context) int
- func (rs *RecipeSelect) Ints(ctx context.Context) ([]int, error)
- func (rs *RecipeSelect) IntsX(ctx context.Context) []int
- func (rs *RecipeSelect) Scan(ctx context.Context, v interface{}) error
- func (rs *RecipeSelect) ScanX(ctx context.Context, v interface{})
- func (rs *RecipeSelect) String(ctx context.Context) (_ string, err error)
- func (rs *RecipeSelect) StringX(ctx context.Context) string
- func (rs *RecipeSelect) Strings(ctx context.Context) ([]string, error)
- func (rs *RecipeSelect) StringsX(ctx context.Context) []string
- type RecipeUpdate
- func (ru *RecipeUpdate) AddRecipeIngredientIDs(ids ...int) *RecipeUpdate
- func (ru *RecipeUpdate) AddRecipeIngredients(r ...*RecipeIngredient) *RecipeUpdate
- func (ru *RecipeUpdate) AddServings(i int) *RecipeUpdate
- func (ru *RecipeUpdate) AddStepIDs(ids ...int) *RecipeUpdate
- func (ru *RecipeUpdate) AddSteps(s ...*Step) *RecipeUpdate
- func (ru *RecipeUpdate) AddTagIDs(ids ...int) *RecipeUpdate
- func (ru *RecipeUpdate) AddTags(c ...*Category) *RecipeUpdate
- func (ru *RecipeUpdate) ClearAuthor() *RecipeUpdate
- func (ru *RecipeUpdate) ClearRecipeIngredients() *RecipeUpdate
- func (ru *RecipeUpdate) ClearSteps() *RecipeUpdate
- func (ru *RecipeUpdate) ClearTags() *RecipeUpdate
- func (ru *RecipeUpdate) Exec(ctx context.Context) error
- func (ru *RecipeUpdate) ExecX(ctx context.Context)
- func (ru *RecipeUpdate) Mutation() *RecipeMutation
- func (ru *RecipeUpdate) RemoveRecipeIngredientIDs(ids ...int) *RecipeUpdate
- func (ru *RecipeUpdate) RemoveRecipeIngredients(r ...*RecipeIngredient) *RecipeUpdate
- func (ru *RecipeUpdate) RemoveStepIDs(ids ...int) *RecipeUpdate
- func (ru *RecipeUpdate) RemoveSteps(s ...*Step) *RecipeUpdate
- func (ru *RecipeUpdate) RemoveTagIDs(ids ...int) *RecipeUpdate
- func (ru *RecipeUpdate) RemoveTags(c ...*Category) *RecipeUpdate
- func (ru *RecipeUpdate) Save(ctx context.Context) (int, error)
- func (ru *RecipeUpdate) SaveX(ctx context.Context) int
- func (ru *RecipeUpdate) SetAuthor(u *User) *RecipeUpdate
- func (ru *RecipeUpdate) SetAuthorID(id int) *RecipeUpdate
- func (ru *RecipeUpdate) SetName(s string) *RecipeUpdate
- func (ru *RecipeUpdate) SetNillableAuthorID(id *int) *RecipeUpdate
- func (ru *RecipeUpdate) SetServings(i int) *RecipeUpdate
- func (ru *RecipeUpdate) Where(ps ...predicate.Recipe) *RecipeUpdate
- type RecipeUpdateOne
- func (ruo *RecipeUpdateOne) AddRecipeIngredientIDs(ids ...int) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) AddRecipeIngredients(r ...*RecipeIngredient) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) AddServings(i int) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) AddStepIDs(ids ...int) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) AddSteps(s ...*Step) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) AddTagIDs(ids ...int) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) AddTags(c ...*Category) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) ClearAuthor() *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) ClearRecipeIngredients() *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) ClearSteps() *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) ClearTags() *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) Exec(ctx context.Context) error
- func (ruo *RecipeUpdateOne) ExecX(ctx context.Context)
- func (ruo *RecipeUpdateOne) Mutation() *RecipeMutation
- func (ruo *RecipeUpdateOne) RemoveRecipeIngredientIDs(ids ...int) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) RemoveRecipeIngredients(r ...*RecipeIngredient) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) RemoveStepIDs(ids ...int) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) RemoveSteps(s ...*Step) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) RemoveTagIDs(ids ...int) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) RemoveTags(c ...*Category) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) Save(ctx context.Context) (*Recipe, error)
- func (ruo *RecipeUpdateOne) SaveX(ctx context.Context) *Recipe
- func (ruo *RecipeUpdateOne) Select(field string, fields ...string) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) SetAuthor(u *User) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) SetAuthorID(id int) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) SetName(s string) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) SetNillableAuthorID(id *int) *RecipeUpdateOne
- func (ruo *RecipeUpdateOne) SetServings(i int) *RecipeUpdateOne
- type Recipes
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Step
- type StepClient
- func (c *StepClient) Create() *StepCreate
- func (c *StepClient) CreateBulk(builders ...*StepCreate) *StepCreateBulk
- func (c *StepClient) Delete() *StepDelete
- func (c *StepClient) DeleteOne(s *Step) *StepDeleteOne
- func (c *StepClient) DeleteOneID(id int) *StepDeleteOne
- func (c *StepClient) Get(ctx context.Context, id int) (*Step, error)
- func (c *StepClient) GetX(ctx context.Context, id int) *Step
- func (c *StepClient) Hooks() []Hook
- func (c *StepClient) Query() *StepQuery
- func (c *StepClient) QueryRecipe(s *Step) *RecipeQuery
- func (c *StepClient) Update() *StepUpdate
- func (c *StepClient) UpdateOne(s *Step) *StepUpdateOne
- func (c *StepClient) UpdateOneID(id int) *StepUpdateOne
- func (c *StepClient) Use(hooks ...Hook)
- type StepCreate
- func (sc *StepCreate) Exec(ctx context.Context) error
- func (sc *StepCreate) ExecX(ctx context.Context)
- func (sc *StepCreate) Mutation() *StepMutation
- func (sc *StepCreate) Save(ctx context.Context) (*Step, error)
- func (sc *StepCreate) SaveX(ctx context.Context) *Step
- func (sc *StepCreate) SetNillableRecipeID(id *int) *StepCreate
- func (sc *StepCreate) SetRecipe(r *Recipe) *StepCreate
- func (sc *StepCreate) SetRecipeID(id int) *StepCreate
- func (sc *StepCreate) SetText(s string) *StepCreate
- type StepCreateBulk
- type StepDelete
- type StepDeleteOne
- type StepEdges
- type StepGroupBy
- func (sgb *StepGroupBy) Aggregate(fns ...AggregateFunc) *StepGroupBy
- func (sgb *StepGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (sgb *StepGroupBy) BoolX(ctx context.Context) bool
- func (sgb *StepGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (sgb *StepGroupBy) BoolsX(ctx context.Context) []bool
- func (sgb *StepGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (sgb *StepGroupBy) Float64X(ctx context.Context) float64
- func (sgb *StepGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (sgb *StepGroupBy) Float64sX(ctx context.Context) []float64
- func (sgb *StepGroupBy) Int(ctx context.Context) (_ int, err error)
- func (sgb *StepGroupBy) IntX(ctx context.Context) int
- func (sgb *StepGroupBy) Ints(ctx context.Context) ([]int, error)
- func (sgb *StepGroupBy) IntsX(ctx context.Context) []int
- func (sgb *StepGroupBy) Scan(ctx context.Context, v interface{}) error
- func (sgb *StepGroupBy) ScanX(ctx context.Context, v interface{})
- func (sgb *StepGroupBy) String(ctx context.Context) (_ string, err error)
- func (sgb *StepGroupBy) StringX(ctx context.Context) string
- func (sgb *StepGroupBy) Strings(ctx context.Context) ([]string, error)
- func (sgb *StepGroupBy) StringsX(ctx context.Context) []string
- type StepMutation
- func (m *StepMutation) AddField(name string, value ent.Value) error
- func (m *StepMutation) AddedEdges() []string
- func (m *StepMutation) AddedField(name string) (ent.Value, bool)
- func (m *StepMutation) AddedFields() []string
- func (m *StepMutation) AddedIDs(name string) []ent.Value
- func (m *StepMutation) ClearEdge(name string) error
- func (m *StepMutation) ClearField(name string) error
- func (m *StepMutation) ClearRecipe()
- func (m *StepMutation) ClearedEdges() []string
- func (m *StepMutation) ClearedFields() []string
- func (m StepMutation) Client() *Client
- func (m *StepMutation) EdgeCleared(name string) bool
- func (m *StepMutation) Field(name string) (ent.Value, bool)
- func (m *StepMutation) FieldCleared(name string) bool
- func (m *StepMutation) Fields() []string
- func (m *StepMutation) ID() (id int, exists bool)
- func (m *StepMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *StepMutation) OldText(ctx context.Context) (v string, err error)
- func (m *StepMutation) Op() Op
- func (m *StepMutation) RecipeCleared() bool
- func (m *StepMutation) RecipeID() (id int, exists bool)
- func (m *StepMutation) RecipeIDs() (ids []int)
- func (m *StepMutation) RemovedEdges() []string
- func (m *StepMutation) RemovedIDs(name string) []ent.Value
- func (m *StepMutation) ResetEdge(name string) error
- func (m *StepMutation) ResetField(name string) error
- func (m *StepMutation) ResetRecipe()
- func (m *StepMutation) ResetText()
- func (m *StepMutation) SetField(name string, value ent.Value) error
- func (m *StepMutation) SetRecipeID(id int)
- func (m *StepMutation) SetText(s string)
- func (m *StepMutation) Text() (r string, exists bool)
- func (m StepMutation) Tx() (*Tx, error)
- func (m *StepMutation) Type() string
- func (m *StepMutation) Where(ps ...predicate.Step)
- type StepQuery
- func (sq *StepQuery) All(ctx context.Context) ([]*Step, error)
- func (sq *StepQuery) AllX(ctx context.Context) []*Step
- func (sq *StepQuery) Clone() *StepQuery
- func (sq *StepQuery) Count(ctx context.Context) (int, error)
- func (sq *StepQuery) CountX(ctx context.Context) int
- func (sq *StepQuery) Exist(ctx context.Context) (bool, error)
- func (sq *StepQuery) ExistX(ctx context.Context) bool
- func (sq *StepQuery) First(ctx context.Context) (*Step, error)
- func (sq *StepQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *StepQuery) FirstIDX(ctx context.Context) int
- func (sq *StepQuery) FirstX(ctx context.Context) *Step
- func (sq *StepQuery) GroupBy(field string, fields ...string) *StepGroupBy
- func (sq *StepQuery) IDs(ctx context.Context) ([]int, error)
- func (sq *StepQuery) IDsX(ctx context.Context) []int
- func (sq *StepQuery) Limit(limit int) *StepQuery
- func (sq *StepQuery) Offset(offset int) *StepQuery
- func (sq *StepQuery) Only(ctx context.Context) (*Step, error)
- func (sq *StepQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *StepQuery) OnlyIDX(ctx context.Context) int
- func (sq *StepQuery) OnlyX(ctx context.Context) *Step
- func (sq *StepQuery) Order(o ...OrderFunc) *StepQuery
- func (sq *StepQuery) QueryRecipe() *RecipeQuery
- func (sq *StepQuery) Select(fields ...string) *StepSelect
- func (sq *StepQuery) Unique(unique bool) *StepQuery
- func (sq *StepQuery) Where(ps ...predicate.Step) *StepQuery
- func (sq *StepQuery) WithRecipe(opts ...func(*RecipeQuery)) *StepQuery
- type StepSelect
- func (ss *StepSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ss *StepSelect) BoolX(ctx context.Context) bool
- func (ss *StepSelect) Bools(ctx context.Context) ([]bool, error)
- func (ss *StepSelect) BoolsX(ctx context.Context) []bool
- func (ss *StepSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ss *StepSelect) Float64X(ctx context.Context) float64
- func (ss *StepSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ss *StepSelect) Float64sX(ctx context.Context) []float64
- func (ss *StepSelect) Int(ctx context.Context) (_ int, err error)
- func (ss *StepSelect) IntX(ctx context.Context) int
- func (ss *StepSelect) Ints(ctx context.Context) ([]int, error)
- func (ss *StepSelect) IntsX(ctx context.Context) []int
- func (ss *StepSelect) Scan(ctx context.Context, v interface{}) error
- func (ss *StepSelect) ScanX(ctx context.Context, v interface{})
- func (ss *StepSelect) String(ctx context.Context) (_ string, err error)
- func (ss *StepSelect) StringX(ctx context.Context) string
- func (ss *StepSelect) Strings(ctx context.Context) ([]string, error)
- func (ss *StepSelect) StringsX(ctx context.Context) []string
- type StepUpdate
- func (su *StepUpdate) ClearRecipe() *StepUpdate
- func (su *StepUpdate) Exec(ctx context.Context) error
- func (su *StepUpdate) ExecX(ctx context.Context)
- func (su *StepUpdate) Mutation() *StepMutation
- func (su *StepUpdate) Save(ctx context.Context) (int, error)
- func (su *StepUpdate) SaveX(ctx context.Context) int
- func (su *StepUpdate) SetNillableRecipeID(id *int) *StepUpdate
- func (su *StepUpdate) SetRecipe(r *Recipe) *StepUpdate
- func (su *StepUpdate) SetRecipeID(id int) *StepUpdate
- func (su *StepUpdate) SetText(s string) *StepUpdate
- func (su *StepUpdate) Where(ps ...predicate.Step) *StepUpdate
- type StepUpdateOne
- func (suo *StepUpdateOne) ClearRecipe() *StepUpdateOne
- func (suo *StepUpdateOne) Exec(ctx context.Context) error
- func (suo *StepUpdateOne) ExecX(ctx context.Context)
- func (suo *StepUpdateOne) Mutation() *StepMutation
- func (suo *StepUpdateOne) Save(ctx context.Context) (*Step, error)
- func (suo *StepUpdateOne) SaveX(ctx context.Context) *Step
- func (suo *StepUpdateOne) Select(field string, fields ...string) *StepUpdateOne
- func (suo *StepUpdateOne) SetNillableRecipeID(id *int) *StepUpdateOne
- func (suo *StepUpdateOne) SetRecipe(r *Recipe) *StepUpdateOne
- func (suo *StepUpdateOne) SetRecipeID(id int) *StepUpdateOne
- func (suo *StepUpdateOne) SetText(s string) *StepUpdateOne
- type Steps
- type Tx
- type User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryRecipes(u *User) *RecipeQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddRecipeIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddRecipes(r ...*Recipe) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetName(s string) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (ugb *UserGroupBy) BoolX(ctx context.Context) bool
- func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (ugb *UserGroupBy) Float64X(ctx context.Context) float64
- func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (ugb *UserGroupBy) IntX(ctx context.Context) int
- func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (ugb *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
- func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})
- func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (ugb *UserGroupBy) StringX(ctx context.Context) string
- func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (ugb *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddRecipeIDs(ids ...int)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearRecipes()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) Name() (r string, exists bool)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) RecipesCleared() bool
- func (m *UserMutation) RecipesIDs() (ids []int)
- func (m *UserMutation) RemoveRecipeIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedRecipesIDs() (ids []int)
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetName()
- func (m *UserMutation) ResetRecipes()
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetName(s string)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) Where(ps ...predicate.User)
- type UserQuery
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (uq *UserQuery) QueryRecipes() *RecipeQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithRecipes(opts ...func(*RecipeQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (us *UserSelect) BoolX(ctx context.Context) bool
- func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (us *UserSelect) BoolsX(ctx context.Context) []bool
- func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (us *UserSelect) Float64X(ctx context.Context) float64
- func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (us *UserSelect) Float64sX(ctx context.Context) []float64
- func (us *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (us *UserSelect) IntX(ctx context.Context) int
- func (us *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (us *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
- func (us *UserSelect) ScanX(ctx context.Context, v interface{})
- func (us *UserSelect) String(ctx context.Context) (_ string, err error)
- func (us *UserSelect) StringX(ctx context.Context) string
- func (us *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (us *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddRecipeIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddRecipes(r ...*Recipe) *UserUpdate
- func (uu *UserUpdate) ClearRecipes() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveRecipeIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveRecipes(r ...*Recipe) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetName(s string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddRecipeIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddRecipes(r ...*Recipe) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearRecipes() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveRecipeIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveRecipes(r ...*Recipe) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeCategory = "Category" TypeIngredient = "Ingredient" TypeRecipe = "Recipe" TypeRecipeIngredient = "RecipeIngredient" TypeStep = "Step" TypeUser = "User" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Category ¶
type Category struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CategoryQuery when eager-loading is set. Edges CategoryEdges `json:"edges"` // contains filtered or unexported fields }
Category is the model entity for the Category schema.
func (*Category) QueryRecipe ¶
func (c *Category) QueryRecipe() *RecipeQuery
QueryRecipe queries the "recipe" edge of the Category entity.
func (*Category) Unwrap ¶
Unwrap unwraps the Category entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Category) Update ¶
func (c *Category) Update() *CategoryUpdateOne
Update returns a builder for updating this Category. Note that you need to call Category.Unwrap() before calling this method if this Category was returned from a transaction, and the transaction was committed or rolled back.
type CategoryClient ¶
type CategoryClient struct {
// contains filtered or unexported fields
}
CategoryClient is a client for the Category schema.
func NewCategoryClient ¶
func NewCategoryClient(c config) *CategoryClient
NewCategoryClient returns a client for the Category from the given config.
func (*CategoryClient) Create ¶
func (c *CategoryClient) Create() *CategoryCreate
Create returns a create builder for Category.
func (*CategoryClient) CreateBulk ¶
func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk
CreateBulk returns a builder for creating a bulk of Category entities.
func (*CategoryClient) Delete ¶
func (c *CategoryClient) Delete() *CategoryDelete
Delete returns a delete builder for Category.
func (*CategoryClient) DeleteOne ¶
func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*CategoryClient) DeleteOneID ¶
func (c *CategoryClient) DeleteOneID(id int) *CategoryDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*CategoryClient) GetX ¶
func (c *CategoryClient) GetX(ctx context.Context, id int) *Category
GetX is like Get, but panics if an error occurs.
func (*CategoryClient) Hooks ¶
func (c *CategoryClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CategoryClient) Query ¶
func (c *CategoryClient) Query() *CategoryQuery
Query returns a query builder for Category.
func (*CategoryClient) QueryRecipe ¶
func (c *CategoryClient) QueryRecipe(ca *Category) *RecipeQuery
QueryRecipe queries the recipe edge of a Category.
func (*CategoryClient) Update ¶
func (c *CategoryClient) Update() *CategoryUpdate
Update returns an update builder for Category.
func (*CategoryClient) UpdateOne ¶
func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CategoryClient) UpdateOneID ¶
func (c *CategoryClient) UpdateOneID(id int) *CategoryUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CategoryClient) Use ¶
func (c *CategoryClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `category.Hooks(f(g(h())))`.
type CategoryCreate ¶
type CategoryCreate struct {
// contains filtered or unexported fields
}
CategoryCreate is the builder for creating a Category entity.
func (*CategoryCreate) AddRecipe ¶
func (cc *CategoryCreate) AddRecipe(r ...*Recipe) *CategoryCreate
AddRecipe adds the "recipe" edges to the Recipe entity.
func (*CategoryCreate) AddRecipeIDs ¶
func (cc *CategoryCreate) AddRecipeIDs(ids ...int) *CategoryCreate
AddRecipeIDs adds the "recipe" edge to the Recipe entity by IDs.
func (*CategoryCreate) Exec ¶
func (cc *CategoryCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryCreate) ExecX ¶
func (cc *CategoryCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryCreate) Mutation ¶
func (cc *CategoryCreate) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryCreate) Save ¶
func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)
Save creates the Category in the database.
func (*CategoryCreate) SaveX ¶
func (cc *CategoryCreate) SaveX(ctx context.Context) *Category
SaveX calls Save and panics if Save returns an error.
func (*CategoryCreate) SetName ¶
func (cc *CategoryCreate) SetName(s string) *CategoryCreate
SetName sets the "name" field.
type CategoryCreateBulk ¶
type CategoryCreateBulk struct {
// contains filtered or unexported fields
}
CategoryCreateBulk is the builder for creating many Category entities in bulk.
func (*CategoryCreateBulk) Exec ¶
func (ccb *CategoryCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryCreateBulk) ExecX ¶
func (ccb *CategoryCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CategoryDelete ¶
type CategoryDelete struct {
// contains filtered or unexported fields
}
CategoryDelete is the builder for deleting a Category entity.
func (*CategoryDelete) Exec ¶
func (cd *CategoryDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CategoryDelete) ExecX ¶
func (cd *CategoryDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CategoryDelete) Where ¶
func (cd *CategoryDelete) Where(ps ...predicate.Category) *CategoryDelete
Where appends a list predicates to the CategoryDelete builder.
type CategoryDeleteOne ¶
type CategoryDeleteOne struct {
// contains filtered or unexported fields
}
CategoryDeleteOne is the builder for deleting a single Category entity.
func (*CategoryDeleteOne) Exec ¶
func (cdo *CategoryDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CategoryDeleteOne) ExecX ¶
func (cdo *CategoryDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CategoryEdges ¶
type CategoryEdges struct { // Recipe holds the value of the recipe edge. Recipe []*Recipe `json:"recipe,omitempty"` // contains filtered or unexported fields }
CategoryEdges holds the relations/edges for other nodes in the graph.
func (CategoryEdges) RecipeOrErr ¶
func (e CategoryEdges) RecipeOrErr() ([]*Recipe, error)
RecipeOrErr returns the Recipe value or an error if the edge was not loaded in eager-loading.
type CategoryGroupBy ¶
type CategoryGroupBy struct {
// contains filtered or unexported fields
}
CategoryGroupBy is the group-by builder for Category entities.
func (*CategoryGroupBy) Aggregate ¶
func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CategoryGroupBy) Bool ¶
func (cgb *CategoryGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*CategoryGroupBy) BoolX ¶
func (cgb *CategoryGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*CategoryGroupBy) Bools ¶
func (cgb *CategoryGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*CategoryGroupBy) BoolsX ¶
func (cgb *CategoryGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*CategoryGroupBy) Float64 ¶
func (cgb *CategoryGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*CategoryGroupBy) Float64X ¶
func (cgb *CategoryGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*CategoryGroupBy) Float64s ¶
func (cgb *CategoryGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*CategoryGroupBy) Float64sX ¶
func (cgb *CategoryGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*CategoryGroupBy) Int ¶
func (cgb *CategoryGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*CategoryGroupBy) IntX ¶
func (cgb *CategoryGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*CategoryGroupBy) Ints ¶
func (cgb *CategoryGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*CategoryGroupBy) IntsX ¶
func (cgb *CategoryGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*CategoryGroupBy) Scan ¶
func (cgb *CategoryGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*CategoryGroupBy) ScanX ¶
func (cgb *CategoryGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*CategoryGroupBy) String ¶
func (cgb *CategoryGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*CategoryGroupBy) StringX ¶
func (cgb *CategoryGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type CategoryMutation ¶
type CategoryMutation struct {
// contains filtered or unexported fields
}
CategoryMutation represents an operation that mutates the Category nodes in the graph.
func (*CategoryMutation) AddField ¶
func (m *CategoryMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*CategoryMutation) AddRecipeIDs ¶
func (m *CategoryMutation) AddRecipeIDs(ids ...int)
AddRecipeIDs adds the "recipe" edge to the Recipe entity by ids.
func (*CategoryMutation) AddedEdges ¶
func (m *CategoryMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CategoryMutation) AddedField ¶
func (m *CategoryMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*CategoryMutation) AddedFields ¶
func (m *CategoryMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CategoryMutation) AddedIDs ¶
func (m *CategoryMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CategoryMutation) ClearEdge ¶
func (m *CategoryMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*CategoryMutation) ClearField ¶
func (m *CategoryMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*CategoryMutation) ClearRecipe ¶
func (m *CategoryMutation) ClearRecipe()
ClearRecipe clears the "recipe" edge to the Recipe entity.
func (*CategoryMutation) ClearedEdges ¶
func (m *CategoryMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CategoryMutation) ClearedFields ¶
func (m *CategoryMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CategoryMutation) Client ¶
func (m CategoryMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*CategoryMutation) EdgeCleared ¶
func (m *CategoryMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CategoryMutation) Field ¶
func (m *CategoryMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*CategoryMutation) FieldCleared ¶
func (m *CategoryMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CategoryMutation) Fields ¶
func (m *CategoryMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*CategoryMutation) ID ¶
func (m *CategoryMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CategoryMutation) Name ¶
func (m *CategoryMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*CategoryMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*CategoryMutation) OldName ¶
func (m *CategoryMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) RecipeCleared ¶
func (m *CategoryMutation) RecipeCleared() bool
RecipeCleared reports if the "recipe" edge to the Recipe entity was cleared.
func (*CategoryMutation) RecipeIDs ¶
func (m *CategoryMutation) RecipeIDs() (ids []int)
RecipeIDs returns the "recipe" edge IDs in the mutation.
func (*CategoryMutation) RemoveRecipeIDs ¶
func (m *CategoryMutation) RemoveRecipeIDs(ids ...int)
RemoveRecipeIDs removes the "recipe" edge to the Recipe entity by IDs.
func (*CategoryMutation) RemovedEdges ¶
func (m *CategoryMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CategoryMutation) RemovedIDs ¶
func (m *CategoryMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*CategoryMutation) RemovedRecipeIDs ¶
func (m *CategoryMutation) RemovedRecipeIDs() (ids []int)
RemovedRecipe returns the removed IDs of the "recipe" edge to the Recipe entity.
func (*CategoryMutation) ResetEdge ¶
func (m *CategoryMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*CategoryMutation) ResetField ¶
func (m *CategoryMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*CategoryMutation) ResetName ¶
func (m *CategoryMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*CategoryMutation) ResetRecipe ¶
func (m *CategoryMutation) ResetRecipe()
ResetRecipe resets all changes to the "recipe" edge.
func (*CategoryMutation) SetField ¶
func (m *CategoryMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*CategoryMutation) SetName ¶
func (m *CategoryMutation) SetName(s string)
SetName sets the "name" field.
func (CategoryMutation) Tx ¶
func (m CategoryMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CategoryMutation) Type ¶
func (m *CategoryMutation) Type() string
Type returns the node type of this mutation (Category).
func (*CategoryMutation) Where ¶
func (m *CategoryMutation) Where(ps ...predicate.Category)
Where appends a list predicates to the CategoryMutation builder.
type CategoryQuery ¶
type CategoryQuery struct {
// contains filtered or unexported fields
}
CategoryQuery is the builder for querying Category entities.
func (*CategoryQuery) All ¶
func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)
All executes the query and returns a list of Categories.
func (*CategoryQuery) AllX ¶
func (cq *CategoryQuery) AllX(ctx context.Context) []*Category
AllX is like All, but panics if an error occurs.
func (*CategoryQuery) Clone ¶
func (cq *CategoryQuery) Clone() *CategoryQuery
Clone returns a duplicate of the CategoryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CategoryQuery) Count ¶
func (cq *CategoryQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CategoryQuery) CountX ¶
func (cq *CategoryQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CategoryQuery) Exist ¶
func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CategoryQuery) ExistX ¶
func (cq *CategoryQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CategoryQuery) First ¶
func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)
First returns the first Category entity from the query. Returns a *NotFoundError when no Category was found.
func (*CategoryQuery) FirstID ¶
func (cq *CategoryQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Category ID from the query. Returns a *NotFoundError when no Category ID was found.
func (*CategoryQuery) FirstIDX ¶
func (cq *CategoryQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*CategoryQuery) FirstX ¶
func (cq *CategoryQuery) FirstX(ctx context.Context) *Category
FirstX is like First, but panics if an error occurs.
func (*CategoryQuery) GroupBy ¶
func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Category.Query(). GroupBy(category.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CategoryQuery) IDs ¶
func (cq *CategoryQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Category IDs.
func (*CategoryQuery) IDsX ¶
func (cq *CategoryQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*CategoryQuery) Limit ¶
func (cq *CategoryQuery) Limit(limit int) *CategoryQuery
Limit adds a limit step to the query.
func (*CategoryQuery) Offset ¶
func (cq *CategoryQuery) Offset(offset int) *CategoryQuery
Offset adds an offset step to the query.
func (*CategoryQuery) Only ¶
func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)
Only returns a single Category entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Category entity is not found. Returns a *NotFoundError when no Category entities are found.
func (*CategoryQuery) OnlyID ¶
func (cq *CategoryQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Category ID in the query. Returns a *NotSingularError when exactly one Category ID is not found. Returns a *NotFoundError when no entities are found.
func (*CategoryQuery) OnlyIDX ¶
func (cq *CategoryQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CategoryQuery) OnlyX ¶
func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category
OnlyX is like Only, but panics if an error occurs.
func (*CategoryQuery) Order ¶
func (cq *CategoryQuery) Order(o ...OrderFunc) *CategoryQuery
Order adds an order step to the query.
func (*CategoryQuery) QueryRecipe ¶
func (cq *CategoryQuery) QueryRecipe() *RecipeQuery
QueryRecipe chains the current query on the "recipe" edge.
func (*CategoryQuery) Select ¶
func (cq *CategoryQuery) Select(fields ...string) *CategorySelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Category.Query(). Select(category.FieldName). Scan(ctx, &v)
func (*CategoryQuery) Unique ¶
func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*CategoryQuery) Where ¶
func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery
Where adds a new predicate for the CategoryQuery builder.
func (*CategoryQuery) WithRecipe ¶
func (cq *CategoryQuery) WithRecipe(opts ...func(*RecipeQuery)) *CategoryQuery
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 CategorySelect ¶
type CategorySelect struct { *CategoryQuery // contains filtered or unexported fields }
CategorySelect is the builder for selecting fields of Category entities.
func (*CategorySelect) Bool ¶
func (cs *CategorySelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CategorySelect) BoolX ¶
func (cs *CategorySelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*CategorySelect) Bools ¶
func (cs *CategorySelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CategorySelect) BoolsX ¶
func (cs *CategorySelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*CategorySelect) Float64 ¶
func (cs *CategorySelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Float64X ¶
func (cs *CategorySelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*CategorySelect) Float64s ¶
func (cs *CategorySelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Float64sX ¶
func (cs *CategorySelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*CategorySelect) Int ¶
func (cs *CategorySelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CategorySelect) IntX ¶
func (cs *CategorySelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*CategorySelect) Ints ¶
func (cs *CategorySelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CategorySelect) IntsX ¶
func (cs *CategorySelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*CategorySelect) Scan ¶
func (cs *CategorySelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*CategorySelect) ScanX ¶
func (cs *CategorySelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*CategorySelect) String ¶
func (cs *CategorySelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*CategorySelect) StringX ¶
func (cs *CategorySelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type CategoryUpdate ¶
type CategoryUpdate struct {
// contains filtered or unexported fields
}
CategoryUpdate is the builder for updating Category entities.
func (*CategoryUpdate) AddRecipe ¶
func (cu *CategoryUpdate) AddRecipe(r ...*Recipe) *CategoryUpdate
AddRecipe adds the "recipe" edges to the Recipe entity.
func (*CategoryUpdate) AddRecipeIDs ¶
func (cu *CategoryUpdate) AddRecipeIDs(ids ...int) *CategoryUpdate
AddRecipeIDs adds the "recipe" edge to the Recipe entity by IDs.
func (*CategoryUpdate) ClearRecipe ¶
func (cu *CategoryUpdate) ClearRecipe() *CategoryUpdate
ClearRecipe clears all "recipe" edges to the Recipe entity.
func (*CategoryUpdate) Exec ¶
func (cu *CategoryUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryUpdate) ExecX ¶
func (cu *CategoryUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryUpdate) Mutation ¶
func (cu *CategoryUpdate) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryUpdate) RemoveRecipe ¶
func (cu *CategoryUpdate) RemoveRecipe(r ...*Recipe) *CategoryUpdate
RemoveRecipe removes "recipe" edges to Recipe entities.
func (*CategoryUpdate) RemoveRecipeIDs ¶
func (cu *CategoryUpdate) RemoveRecipeIDs(ids ...int) *CategoryUpdate
RemoveRecipeIDs removes the "recipe" edge to Recipe entities by IDs.
func (*CategoryUpdate) Save ¶
func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CategoryUpdate) SaveX ¶
func (cu *CategoryUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CategoryUpdate) SetName ¶
func (cu *CategoryUpdate) SetName(s string) *CategoryUpdate
SetName sets the "name" field.
func (*CategoryUpdate) Where ¶
func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate
Where appends a list predicates to the CategoryUpdate builder.
type CategoryUpdateOne ¶
type CategoryUpdateOne struct {
// contains filtered or unexported fields
}
CategoryUpdateOne is the builder for updating a single Category entity.
func (*CategoryUpdateOne) AddRecipe ¶
func (cuo *CategoryUpdateOne) AddRecipe(r ...*Recipe) *CategoryUpdateOne
AddRecipe adds the "recipe" edges to the Recipe entity.
func (*CategoryUpdateOne) AddRecipeIDs ¶
func (cuo *CategoryUpdateOne) AddRecipeIDs(ids ...int) *CategoryUpdateOne
AddRecipeIDs adds the "recipe" edge to the Recipe entity by IDs.
func (*CategoryUpdateOne) ClearRecipe ¶
func (cuo *CategoryUpdateOne) ClearRecipe() *CategoryUpdateOne
ClearRecipe clears all "recipe" edges to the Recipe entity.
func (*CategoryUpdateOne) Exec ¶
func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CategoryUpdateOne) ExecX ¶
func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryUpdateOne) Mutation ¶
func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryUpdateOne) RemoveRecipe ¶
func (cuo *CategoryUpdateOne) RemoveRecipe(r ...*Recipe) *CategoryUpdateOne
RemoveRecipe removes "recipe" edges to Recipe entities.
func (*CategoryUpdateOne) RemoveRecipeIDs ¶
func (cuo *CategoryUpdateOne) RemoveRecipeIDs(ids ...int) *CategoryUpdateOne
RemoveRecipeIDs removes the "recipe" edge to Recipe entities by IDs.
func (*CategoryUpdateOne) Save ¶
func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)
Save executes the query and returns the updated Category entity.
func (*CategoryUpdateOne) SaveX ¶
func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category
SaveX is like Save, but panics if an error occurs.
func (*CategoryUpdateOne) Select ¶
func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CategoryUpdateOne) SetName ¶
func (cuo *CategoryUpdateOne) SetName(s string) *CategoryUpdateOne
SetName sets the "name" field.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Category is the client for interacting with the Category builders. Category *CategoryClient // Ingredient is the client for interacting with the Ingredient builders. Ingredient *IngredientClient // Recipe is the client for interacting with the Recipe builders. Recipe *RecipeClient // RecipeIngredient is the client for interacting with the RecipeIngredient builders. RecipeIngredient *RecipeIngredientClient // Step is the client for interacting with the Step builders. Step *StepClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Category. Query(). Count(ctx)
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type Ingredient ¶
type Ingredient struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the 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) QueryRecipeIngredients ¶
func (i *Ingredient) QueryRecipeIngredients() *RecipeIngredientQuery
QueryRecipeIngredients queries the "recipe_ingredients" 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.
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 create builder for Ingredient.
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 ¶
func (c *IngredientClient) DeleteOne(i *Ingredient) *IngredientDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*IngredientClient) DeleteOneID ¶
func (c *IngredientClient) DeleteOneID(id int) *IngredientDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*IngredientClient) Get ¶
func (c *IngredientClient) Get(ctx context.Context, id int) (*Ingredient, error)
Get returns a Ingredient entity by its id.
func (*IngredientClient) GetX ¶
func (c *IngredientClient) GetX(ctx context.Context, id int) *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) Query ¶
func (c *IngredientClient) Query() *IngredientQuery
Query returns a query builder for Ingredient.
func (*IngredientClient) QueryRecipeIngredients ¶
func (c *IngredientClient) QueryRecipeIngredients(i *Ingredient) *RecipeIngredientQuery
QueryRecipeIngredients queries the recipe_ingredients edge of a Ingredient.
func (*IngredientClient) Update ¶
func (c *IngredientClient) Update() *IngredientUpdate
Update returns an update builder for Ingredient.
func (*IngredientClient) UpdateOne ¶
func (c *IngredientClient) UpdateOne(i *Ingredient) *IngredientUpdateOne
UpdateOne returns an update builder for the given entity.
func (*IngredientClient) UpdateOneID ¶
func (c *IngredientClient) UpdateOneID(id int) *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) AddRecipeIngredientIDs ¶
func (ic *IngredientCreate) AddRecipeIngredientIDs(ids ...int) *IngredientCreate
AddRecipeIngredientIDs adds the "recipe_ingredients" edge to the RecipeIngredient entity by IDs.
func (*IngredientCreate) AddRecipeIngredients ¶
func (ic *IngredientCreate) AddRecipeIngredients(r ...*RecipeIngredient) *IngredientCreate
AddRecipeIngredients adds the "recipe_ingredients" edges to the RecipeIngredient 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) SetName ¶
func (ic *IngredientCreate) SetName(s string) *IngredientCreate
SetName sets the "name" 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 ¶
func (id *IngredientDelete) Where(ps ...predicate.Ingredient) *IngredientDelete
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.
type IngredientEdges ¶
type IngredientEdges struct { // RecipeIngredients holds the value of the recipe_ingredients edge. RecipeIngredients []*RecipeIngredient `json:"recipe_ingredients,omitempty"` // contains filtered or unexported fields }
IngredientEdges holds the relations/edges for other nodes in the graph.
func (IngredientEdges) RecipeIngredientsOrErr ¶
func (e IngredientEdges) RecipeIngredientsOrErr() ([]*RecipeIngredient, error)
RecipeIngredientsOrErr returns the RecipeIngredients value or an error if the edge was not loaded in eager-loading.
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 (igb *IngredientGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*IngredientGroupBy) BoolX ¶
func (igb *IngredientGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*IngredientGroupBy) Bools ¶
func (igb *IngredientGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*IngredientGroupBy) BoolsX ¶
func (igb *IngredientGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*IngredientGroupBy) Float64 ¶
func (igb *IngredientGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*IngredientGroupBy) Float64X ¶
func (igb *IngredientGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*IngredientGroupBy) Float64s ¶
func (igb *IngredientGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*IngredientGroupBy) Float64sX ¶
func (igb *IngredientGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*IngredientGroupBy) Int ¶
func (igb *IngredientGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*IngredientGroupBy) IntX ¶
func (igb *IngredientGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*IngredientGroupBy) Ints ¶
func (igb *IngredientGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*IngredientGroupBy) IntsX ¶
func (igb *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 interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*IngredientGroupBy) ScanX ¶
func (igb *IngredientGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*IngredientGroupBy) String ¶
func (igb *IngredientGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*IngredientGroupBy) StringX ¶
func (igb *IngredientGroupBy) StringX(ctx context.Context) string
StringX is like String, 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) AddRecipeIngredientIDs ¶
func (m *IngredientMutation) AddRecipeIngredientIDs(ids ...int)
AddRecipeIngredientIDs adds the "recipe_ingredients" edge to the RecipeIngredient entity by ids.
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) ClearRecipeIngredients ¶
func (m *IngredientMutation) ClearRecipeIngredients()
ClearRecipeIngredients clears the "recipe_ingredients" edge to the RecipeIngredient entity.
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) 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 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 (*IngredientMutation) Name ¶
func (m *IngredientMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*IngredientMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*IngredientMutation) OldName ¶
func (m *IngredientMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" 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) RecipeIngredientsCleared ¶
func (m *IngredientMutation) RecipeIngredientsCleared() bool
RecipeIngredientsCleared reports if the "recipe_ingredients" edge to the RecipeIngredient entity was cleared.
func (*IngredientMutation) RecipeIngredientsIDs ¶
func (m *IngredientMutation) RecipeIngredientsIDs() (ids []int)
RecipeIngredientsIDs returns the "recipe_ingredients" edge IDs in the mutation.
func (*IngredientMutation) RemoveRecipeIngredientIDs ¶
func (m *IngredientMutation) RemoveRecipeIngredientIDs(ids ...int)
RemoveRecipeIngredientIDs removes the "recipe_ingredients" edge to the RecipeIngredient entity by IDs.
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) RemovedRecipeIngredientsIDs ¶
func (m *IngredientMutation) RemovedRecipeIngredientsIDs() (ids []int)
RemovedRecipeIngredients returns the removed IDs of the "recipe_ingredients" edge to the RecipeIngredient entity.
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) ResetName ¶
func (m *IngredientMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*IngredientMutation) ResetRecipeIngredients ¶
func (m *IngredientMutation) ResetRecipeIngredients()
ResetRecipeIngredients resets all changes to the "recipe_ingredients" edge.
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) SetName ¶
func (m *IngredientMutation) SetName(s string)
SetName sets the "name" 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) Where ¶
func (m *IngredientMutation) Where(ps ...predicate.Ingredient)
Where appends a list predicates to the IngredientMutation builder.
type IngredientQuery ¶
type IngredientQuery struct {
// contains filtered or unexported fields
}
IngredientQuery is the builder for querying Ingredient entities.
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 int, 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) int
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 { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Ingredient.Query(). GroupBy(ingredient.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*IngredientQuery) IDs ¶
func (iq *IngredientQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Ingredient IDs.
func (*IngredientQuery) IDsX ¶
func (iq *IngredientQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*IngredientQuery) Limit ¶
func (iq *IngredientQuery) Limit(limit int) *IngredientQuery
Limit adds a limit step to the query.
func (*IngredientQuery) Offset ¶
func (iq *IngredientQuery) Offset(offset int) *IngredientQuery
Offset adds an offset step to the query.
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 exactly one Ingredient entity is not found. Returns a *NotFoundError when no Ingredient entities are found.
func (*IngredientQuery) OnlyID ¶
func (iq *IngredientQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Ingredient ID in the query. Returns a *NotSingularError when exactly one Ingredient ID is not found. Returns a *NotFoundError when no entities are found.
func (*IngredientQuery) OnlyIDX ¶
func (iq *IngredientQuery) OnlyIDX(ctx context.Context) int
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 ¶
func (iq *IngredientQuery) Order(o ...OrderFunc) *IngredientQuery
Order adds an order step to the query.
func (*IngredientQuery) QueryRecipeIngredients ¶
func (iq *IngredientQuery) QueryRecipeIngredients() *RecipeIngredientQuery
QueryRecipeIngredients chains the current query on the "recipe_ingredients" 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 { Name string `json:"name,omitempty"` } client.Ingredient.Query(). Select(ingredient.FieldName). 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 ¶
func (iq *IngredientQuery) Where(ps ...predicate.Ingredient) *IngredientQuery
Where adds a new predicate for the IngredientQuery builder.
func (*IngredientQuery) WithRecipeIngredients ¶
func (iq *IngredientQuery) WithRecipeIngredients(opts ...func(*RecipeIngredientQuery)) *IngredientQuery
WithRecipeIngredients tells the query-builder to eager-load the nodes that are connected to the "recipe_ingredients" 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) Bool ¶
func (is *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 (is *IngredientSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*IngredientSelect) Bools ¶
func (is *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 (is *IngredientSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*IngredientSelect) Float64 ¶
func (is *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 (is *IngredientSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*IngredientSelect) Float64s ¶
func (is *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 (is *IngredientSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*IngredientSelect) Int ¶
func (is *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 (is *IngredientSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*IngredientSelect) Ints ¶
func (is *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 (is *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 interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*IngredientSelect) ScanX ¶
func (is *IngredientSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*IngredientSelect) String ¶
func (is *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 (is *IngredientSelect) StringX(ctx context.Context) string
StringX is like String, 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) AddRecipeIngredientIDs ¶
func (iu *IngredientUpdate) AddRecipeIngredientIDs(ids ...int) *IngredientUpdate
AddRecipeIngredientIDs adds the "recipe_ingredients" edge to the RecipeIngredient entity by IDs.
func (*IngredientUpdate) AddRecipeIngredients ¶
func (iu *IngredientUpdate) AddRecipeIngredients(r ...*RecipeIngredient) *IngredientUpdate
AddRecipeIngredients adds the "recipe_ingredients" edges to the RecipeIngredient entity.
func (*IngredientUpdate) ClearRecipeIngredients ¶
func (iu *IngredientUpdate) ClearRecipeIngredients() *IngredientUpdate
ClearRecipeIngredients clears all "recipe_ingredients" edges to the RecipeIngredient entity.
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) RemoveRecipeIngredientIDs ¶
func (iu *IngredientUpdate) RemoveRecipeIngredientIDs(ids ...int) *IngredientUpdate
RemoveRecipeIngredientIDs removes the "recipe_ingredients" edge to RecipeIngredient entities by IDs.
func (*IngredientUpdate) RemoveRecipeIngredients ¶
func (iu *IngredientUpdate) RemoveRecipeIngredients(r ...*RecipeIngredient) *IngredientUpdate
RemoveRecipeIngredients removes "recipe_ingredients" edges to RecipeIngredient entities.
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) SetName ¶
func (iu *IngredientUpdate) SetName(s string) *IngredientUpdate
SetName sets the "name" field.
func (*IngredientUpdate) Where ¶
func (iu *IngredientUpdate) Where(ps ...predicate.Ingredient) *IngredientUpdate
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) AddRecipeIngredientIDs ¶
func (iuo *IngredientUpdateOne) AddRecipeIngredientIDs(ids ...int) *IngredientUpdateOne
AddRecipeIngredientIDs adds the "recipe_ingredients" edge to the RecipeIngredient entity by IDs.
func (*IngredientUpdateOne) AddRecipeIngredients ¶
func (iuo *IngredientUpdateOne) AddRecipeIngredients(r ...*RecipeIngredient) *IngredientUpdateOne
AddRecipeIngredients adds the "recipe_ingredients" edges to the RecipeIngredient entity.
func (*IngredientUpdateOne) ClearRecipeIngredients ¶
func (iuo *IngredientUpdateOne) ClearRecipeIngredients() *IngredientUpdateOne
ClearRecipeIngredients clears all "recipe_ingredients" edges to the RecipeIngredient entity.
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) RemoveRecipeIngredientIDs ¶
func (iuo *IngredientUpdateOne) RemoveRecipeIngredientIDs(ids ...int) *IngredientUpdateOne
RemoveRecipeIngredientIDs removes the "recipe_ingredients" edge to RecipeIngredient entities by IDs.
func (*IngredientUpdateOne) RemoveRecipeIngredients ¶
func (iuo *IngredientUpdateOne) RemoveRecipeIngredients(r ...*RecipeIngredient) *IngredientUpdateOne
RemoveRecipeIngredients removes "recipe_ingredients" edges to RecipeIngredient entities.
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) SetName ¶
func (iuo *IngredientUpdateOne) SetName(s string) *IngredientUpdateOne
SetName sets the "name" field.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
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 Recipe ¶
type Recipe struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Servings holds the value of the "servings" field. Servings int `json:"servings,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) QueryAuthor ¶
QueryAuthor queries the "author" edge of the Recipe entity.
func (*Recipe) QueryRecipeIngredients ¶
func (r *Recipe) QueryRecipeIngredients() *RecipeIngredientQuery
QueryRecipeIngredients queries the "recipe_ingredients" edge of the Recipe entity.
func (*Recipe) QuerySteps ¶
QuerySteps queries the "steps" edge of the Recipe entity.
func (*Recipe) QueryTags ¶
func (r *Recipe) QueryTags() *CategoryQuery
QueryTags queries the "tags" edge of the Recipe entity.
func (*Recipe) Unwrap ¶
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.
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 create builder for Recipe.
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 delete builder for the given entity.
func (*RecipeClient) DeleteOneID ¶
func (c *RecipeClient) DeleteOneID(id int) *RecipeDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*RecipeClient) GetX ¶
func (c *RecipeClient) GetX(ctx context.Context, id int) *Recipe
GetX is like Get, but panics if an error occurs.
func (*RecipeClient) Query ¶
func (c *RecipeClient) Query() *RecipeQuery
Query returns a query builder for Recipe.
func (*RecipeClient) QueryAuthor ¶
func (c *RecipeClient) QueryAuthor(r *Recipe) *UserQuery
QueryAuthor queries the author edge of a Recipe.
func (*RecipeClient) QueryRecipeIngredients ¶
func (c *RecipeClient) QueryRecipeIngredients(r *Recipe) *RecipeIngredientQuery
QueryRecipeIngredients queries the recipe_ingredients edge of a Recipe.
func (*RecipeClient) QuerySteps ¶
func (c *RecipeClient) QuerySteps(r *Recipe) *StepQuery
QuerySteps queries the steps edge of a Recipe.
func (*RecipeClient) QueryTags ¶
func (c *RecipeClient) QueryTags(r *Recipe) *CategoryQuery
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 int) *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) AddRecipeIngredientIDs ¶
func (rc *RecipeCreate) AddRecipeIngredientIDs(ids ...int) *RecipeCreate
AddRecipeIngredientIDs adds the "recipe_ingredients" edge to the RecipeIngredient entity by IDs.
func (*RecipeCreate) AddRecipeIngredients ¶
func (rc *RecipeCreate) AddRecipeIngredients(r ...*RecipeIngredient) *RecipeCreate
AddRecipeIngredients adds the "recipe_ingredients" edges to the RecipeIngredient entity.
func (*RecipeCreate) AddStepIDs ¶
func (rc *RecipeCreate) AddStepIDs(ids ...int) *RecipeCreate
AddStepIDs adds the "steps" edge to the Step entity by IDs.
func (*RecipeCreate) AddSteps ¶
func (rc *RecipeCreate) AddSteps(s ...*Step) *RecipeCreate
AddSteps adds the "steps" edges to the Step entity.
func (*RecipeCreate) AddTagIDs ¶
func (rc *RecipeCreate) AddTagIDs(ids ...int) *RecipeCreate
AddTagIDs adds the "tags" edge to the Category entity by IDs.
func (*RecipeCreate) AddTags ¶
func (rc *RecipeCreate) AddTags(c ...*Category) *RecipeCreate
AddTags adds the "tags" edges to the Category 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) SetAuthor ¶
func (rc *RecipeCreate) SetAuthor(u *User) *RecipeCreate
SetAuthor sets the "author" edge to the User entity.
func (*RecipeCreate) SetAuthorID ¶
func (rc *RecipeCreate) SetAuthorID(id int) *RecipeCreate
SetAuthorID sets the "author" edge to the User entity by ID.
func (*RecipeCreate) SetName ¶
func (rc *RecipeCreate) SetName(s string) *RecipeCreate
SetName sets the "name" field.
func (*RecipeCreate) SetNillableAuthorID ¶
func (rc *RecipeCreate) SetNillableAuthorID(id *int) *RecipeCreate
SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.
func (*RecipeCreate) SetServings ¶
func (rc *RecipeCreate) SetServings(i int) *RecipeCreate
SetServings sets the "servings" 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.
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.
type RecipeEdges ¶
type RecipeEdges struct { // Author holds the value of the author edge. Author *User `json:"author,omitempty"` // Tags holds the value of the tags edge. Tags []*Category `json:"tags,omitempty"` // Steps holds the value of the steps edge. Steps []*Step `json:"steps,omitempty"` // RecipeIngredients holds the value of the recipe_ingredients edge. RecipeIngredients []*RecipeIngredient `json:"recipe_ingredients,omitempty"` // contains filtered or unexported fields }
RecipeEdges holds the relations/edges for other nodes in the graph.
func (RecipeEdges) AuthorOrErr ¶
func (e RecipeEdges) AuthorOrErr() (*User, error)
AuthorOrErr returns the Author value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (RecipeEdges) RecipeIngredientsOrErr ¶
func (e RecipeEdges) RecipeIngredientsOrErr() ([]*RecipeIngredient, error)
RecipeIngredientsOrErr returns the RecipeIngredients value or an error if the edge was not loaded in eager-loading.
func (RecipeEdges) StepsOrErr ¶
func (e RecipeEdges) StepsOrErr() ([]*Step, error)
StepsOrErr returns the Steps value or an error if the edge was not loaded in eager-loading.
func (RecipeEdges) TagsOrErr ¶
func (e RecipeEdges) TagsOrErr() ([]*Category, 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 (rgb *RecipeGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RecipeGroupBy) BoolX ¶
func (rgb *RecipeGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*RecipeGroupBy) Bools ¶
func (rgb *RecipeGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*RecipeGroupBy) BoolsX ¶
func (rgb *RecipeGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*RecipeGroupBy) Float64 ¶
func (rgb *RecipeGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RecipeGroupBy) Float64X ¶
func (rgb *RecipeGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*RecipeGroupBy) Float64s ¶
func (rgb *RecipeGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*RecipeGroupBy) Float64sX ¶
func (rgb *RecipeGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*RecipeGroupBy) Int ¶
func (rgb *RecipeGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RecipeGroupBy) IntX ¶
func (rgb *RecipeGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*RecipeGroupBy) Ints ¶
func (rgb *RecipeGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*RecipeGroupBy) IntsX ¶
func (rgb *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 interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*RecipeGroupBy) ScanX ¶
func (rgb *RecipeGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*RecipeGroupBy) String ¶
func (rgb *RecipeGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RecipeGroupBy) StringX ¶
func (rgb *RecipeGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type RecipeIngredient ¶
type RecipeIngredient struct { // ID of the ent. ID int `json:"id,omitempty"` // Quantity holds the value of the "quantity" field. Quantity float32 `json:"quantity,omitempty"` // Unit holds the value of the "unit" field. Unit string `json:"unit,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the RecipeIngredientQuery when eager-loading is set. Edges RecipeIngredientEdges `json:"edges"` // contains filtered or unexported fields }
RecipeIngredient is the model entity for the RecipeIngredient schema.
func (*RecipeIngredient) QueryIngredient ¶
func (ri *RecipeIngredient) QueryIngredient() *IngredientQuery
QueryIngredient queries the "ingredient" edge of the RecipeIngredient entity.
func (*RecipeIngredient) String ¶
func (ri *RecipeIngredient) String() string
String implements the fmt.Stringer.
func (*RecipeIngredient) Unwrap ¶
func (ri *RecipeIngredient) Unwrap() *RecipeIngredient
Unwrap unwraps the RecipeIngredient 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 (*RecipeIngredient) Update ¶
func (ri *RecipeIngredient) Update() *RecipeIngredientUpdateOne
Update returns a builder for updating this RecipeIngredient. Note that you need to call RecipeIngredient.Unwrap() before calling this method if this RecipeIngredient was returned from a transaction, and the transaction was committed or rolled back.
type RecipeIngredientClient ¶
type RecipeIngredientClient struct {
// contains filtered or unexported fields
}
RecipeIngredientClient is a client for the RecipeIngredient schema.
func NewRecipeIngredientClient ¶
func NewRecipeIngredientClient(c config) *RecipeIngredientClient
NewRecipeIngredientClient returns a client for the RecipeIngredient from the given config.
func (*RecipeIngredientClient) Create ¶
func (c *RecipeIngredientClient) Create() *RecipeIngredientCreate
Create returns a create builder for RecipeIngredient.
func (*RecipeIngredientClient) CreateBulk ¶
func (c *RecipeIngredientClient) CreateBulk(builders ...*RecipeIngredientCreate) *RecipeIngredientCreateBulk
CreateBulk returns a builder for creating a bulk of RecipeIngredient entities.
func (*RecipeIngredientClient) Delete ¶
func (c *RecipeIngredientClient) Delete() *RecipeIngredientDelete
Delete returns a delete builder for RecipeIngredient.
func (*RecipeIngredientClient) DeleteOne ¶
func (c *RecipeIngredientClient) DeleteOne(ri *RecipeIngredient) *RecipeIngredientDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*RecipeIngredientClient) DeleteOneID ¶
func (c *RecipeIngredientClient) DeleteOneID(id int) *RecipeIngredientDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*RecipeIngredientClient) Get ¶
func (c *RecipeIngredientClient) Get(ctx context.Context, id int) (*RecipeIngredient, error)
Get returns a RecipeIngredient entity by its id.
func (*RecipeIngredientClient) GetX ¶
func (c *RecipeIngredientClient) GetX(ctx context.Context, id int) *RecipeIngredient
GetX is like Get, but panics if an error occurs.
func (*RecipeIngredientClient) Hooks ¶
func (c *RecipeIngredientClient) Hooks() []Hook
Hooks returns the client hooks.
func (*RecipeIngredientClient) Query ¶
func (c *RecipeIngredientClient) Query() *RecipeIngredientQuery
Query returns a query builder for RecipeIngredient.
func (*RecipeIngredientClient) QueryIngredient ¶
func (c *RecipeIngredientClient) QueryIngredient(ri *RecipeIngredient) *IngredientQuery
QueryIngredient queries the ingredient edge of a RecipeIngredient.
func (*RecipeIngredientClient) Update ¶
func (c *RecipeIngredientClient) Update() *RecipeIngredientUpdate
Update returns an update builder for RecipeIngredient.
func (*RecipeIngredientClient) UpdateOne ¶
func (c *RecipeIngredientClient) UpdateOne(ri *RecipeIngredient) *RecipeIngredientUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RecipeIngredientClient) UpdateOneID ¶
func (c *RecipeIngredientClient) UpdateOneID(id int) *RecipeIngredientUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RecipeIngredientClient) Use ¶
func (c *RecipeIngredientClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `recipeingredient.Hooks(f(g(h())))`.
type RecipeIngredientCreate ¶
type RecipeIngredientCreate struct {
// contains filtered or unexported fields
}
RecipeIngredientCreate is the builder for creating a RecipeIngredient entity.
func (*RecipeIngredientCreate) Exec ¶
func (ric *RecipeIngredientCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RecipeIngredientCreate) ExecX ¶
func (ric *RecipeIngredientCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RecipeIngredientCreate) Mutation ¶
func (ric *RecipeIngredientCreate) Mutation() *RecipeIngredientMutation
Mutation returns the RecipeIngredientMutation object of the builder.
func (*RecipeIngredientCreate) Save ¶
func (ric *RecipeIngredientCreate) Save(ctx context.Context) (*RecipeIngredient, error)
Save creates the RecipeIngredient in the database.
func (*RecipeIngredientCreate) SaveX ¶
func (ric *RecipeIngredientCreate) SaveX(ctx context.Context) *RecipeIngredient
SaveX calls Save and panics if Save returns an error.
func (*RecipeIngredientCreate) SetIngredient ¶
func (ric *RecipeIngredientCreate) SetIngredient(i *Ingredient) *RecipeIngredientCreate
SetIngredient sets the "ingredient" edge to the Ingredient entity.
func (*RecipeIngredientCreate) SetIngredientID ¶
func (ric *RecipeIngredientCreate) SetIngredientID(id int) *RecipeIngredientCreate
SetIngredientID sets the "ingredient" edge to the Ingredient entity by ID.
func (*RecipeIngredientCreate) SetNillableIngredientID ¶
func (ric *RecipeIngredientCreate) SetNillableIngredientID(id *int) *RecipeIngredientCreate
SetNillableIngredientID sets the "ingredient" edge to the Ingredient entity by ID if the given value is not nil.
func (*RecipeIngredientCreate) SetQuantity ¶
func (ric *RecipeIngredientCreate) SetQuantity(f float32) *RecipeIngredientCreate
SetQuantity sets the "quantity" field.
func (*RecipeIngredientCreate) SetUnit ¶
func (ric *RecipeIngredientCreate) SetUnit(s string) *RecipeIngredientCreate
SetUnit sets the "unit" field.
type RecipeIngredientCreateBulk ¶
type RecipeIngredientCreateBulk struct {
// contains filtered or unexported fields
}
RecipeIngredientCreateBulk is the builder for creating many RecipeIngredient entities in bulk.
func (*RecipeIngredientCreateBulk) Exec ¶
func (ricb *RecipeIngredientCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RecipeIngredientCreateBulk) ExecX ¶
func (ricb *RecipeIngredientCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RecipeIngredientCreateBulk) Save ¶
func (ricb *RecipeIngredientCreateBulk) Save(ctx context.Context) ([]*RecipeIngredient, error)
Save creates the RecipeIngredient entities in the database.
func (*RecipeIngredientCreateBulk) SaveX ¶
func (ricb *RecipeIngredientCreateBulk) SaveX(ctx context.Context) []*RecipeIngredient
SaveX is like Save, but panics if an error occurs.
type RecipeIngredientDelete ¶
type RecipeIngredientDelete struct {
// contains filtered or unexported fields
}
RecipeIngredientDelete is the builder for deleting a RecipeIngredient entity.
func (*RecipeIngredientDelete) Exec ¶
func (rid *RecipeIngredientDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RecipeIngredientDelete) ExecX ¶
func (rid *RecipeIngredientDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RecipeIngredientDelete) Where ¶
func (rid *RecipeIngredientDelete) Where(ps ...predicate.RecipeIngredient) *RecipeIngredientDelete
Where appends a list predicates to the RecipeIngredientDelete builder.
type RecipeIngredientDeleteOne ¶
type RecipeIngredientDeleteOne struct {
// contains filtered or unexported fields
}
RecipeIngredientDeleteOne is the builder for deleting a single RecipeIngredient entity.
func (*RecipeIngredientDeleteOne) Exec ¶
func (rido *RecipeIngredientDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RecipeIngredientDeleteOne) ExecX ¶
func (rido *RecipeIngredientDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RecipeIngredientEdges ¶
type RecipeIngredientEdges struct { // Ingredient holds the value of the ingredient edge. Ingredient *Ingredient `json:"ingredient,omitempty"` // contains filtered or unexported fields }
RecipeIngredientEdges holds the relations/edges for other nodes in the graph.
func (RecipeIngredientEdges) IngredientOrErr ¶
func (e RecipeIngredientEdges) IngredientOrErr() (*Ingredient, error)
IngredientOrErr returns the Ingredient value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type RecipeIngredientGroupBy ¶
type RecipeIngredientGroupBy struct {
// contains filtered or unexported fields
}
RecipeIngredientGroupBy is the group-by builder for RecipeIngredient entities.
func (*RecipeIngredientGroupBy) Aggregate ¶
func (rigb *RecipeIngredientGroupBy) Aggregate(fns ...AggregateFunc) *RecipeIngredientGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RecipeIngredientGroupBy) Bool ¶
func (rigb *RecipeIngredientGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RecipeIngredientGroupBy) BoolX ¶
func (rigb *RecipeIngredientGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*RecipeIngredientGroupBy) Bools ¶
func (rigb *RecipeIngredientGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*RecipeIngredientGroupBy) BoolsX ¶
func (rigb *RecipeIngredientGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*RecipeIngredientGroupBy) Float64 ¶
func (rigb *RecipeIngredientGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RecipeIngredientGroupBy) Float64X ¶
func (rigb *RecipeIngredientGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*RecipeIngredientGroupBy) Float64s ¶
func (rigb *RecipeIngredientGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*RecipeIngredientGroupBy) Float64sX ¶
func (rigb *RecipeIngredientGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*RecipeIngredientGroupBy) Int ¶
func (rigb *RecipeIngredientGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RecipeIngredientGroupBy) IntX ¶
func (rigb *RecipeIngredientGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*RecipeIngredientGroupBy) Ints ¶
func (rigb *RecipeIngredientGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*RecipeIngredientGroupBy) IntsX ¶
func (rigb *RecipeIngredientGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*RecipeIngredientGroupBy) Scan ¶
func (rigb *RecipeIngredientGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*RecipeIngredientGroupBy) ScanX ¶
func (rigb *RecipeIngredientGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*RecipeIngredientGroupBy) String ¶
func (rigb *RecipeIngredientGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RecipeIngredientGroupBy) StringX ¶
func (rigb *RecipeIngredientGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type RecipeIngredientMutation ¶
type RecipeIngredientMutation struct {
// contains filtered or unexported fields
}
RecipeIngredientMutation represents an operation that mutates the RecipeIngredient nodes in the graph.
func (*RecipeIngredientMutation) AddField ¶
func (m *RecipeIngredientMutation) 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 (*RecipeIngredientMutation) AddQuantity ¶
func (m *RecipeIngredientMutation) AddQuantity(f float32)
AddQuantity adds f to the "quantity" field.
func (*RecipeIngredientMutation) AddedEdges ¶
func (m *RecipeIngredientMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RecipeIngredientMutation) AddedField ¶
func (m *RecipeIngredientMutation) 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 (*RecipeIngredientMutation) AddedFields ¶
func (m *RecipeIngredientMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RecipeIngredientMutation) AddedIDs ¶
func (m *RecipeIngredientMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RecipeIngredientMutation) AddedQuantity ¶
func (m *RecipeIngredientMutation) AddedQuantity() (r float32, exists bool)
AddedQuantity returns the value that was added to the "quantity" field in this mutation.
func (*RecipeIngredientMutation) ClearEdge ¶
func (m *RecipeIngredientMutation) 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 (*RecipeIngredientMutation) ClearField ¶
func (m *RecipeIngredientMutation) 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 (*RecipeIngredientMutation) ClearIngredient ¶
func (m *RecipeIngredientMutation) ClearIngredient()
ClearIngredient clears the "ingredient" edge to the Ingredient entity.
func (*RecipeIngredientMutation) ClearedEdges ¶
func (m *RecipeIngredientMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RecipeIngredientMutation) ClearedFields ¶
func (m *RecipeIngredientMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RecipeIngredientMutation) Client ¶
func (m RecipeIngredientMutation) 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 (*RecipeIngredientMutation) EdgeCleared ¶
func (m *RecipeIngredientMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RecipeIngredientMutation) Field ¶
func (m *RecipeIngredientMutation) 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 (*RecipeIngredientMutation) FieldCleared ¶
func (m *RecipeIngredientMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RecipeIngredientMutation) Fields ¶
func (m *RecipeIngredientMutation) 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 (*RecipeIngredientMutation) ID ¶
func (m *RecipeIngredientMutation) 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 (*RecipeIngredientMutation) IngredientCleared ¶
func (m *RecipeIngredientMutation) IngredientCleared() bool
IngredientCleared reports if the "ingredient" edge to the Ingredient entity was cleared.
func (*RecipeIngredientMutation) IngredientID ¶
func (m *RecipeIngredientMutation) IngredientID() (id int, exists bool)
IngredientID returns the "ingredient" edge ID in the mutation.
func (*RecipeIngredientMutation) IngredientIDs ¶
func (m *RecipeIngredientMutation) IngredientIDs() (ids []int)
IngredientIDs returns the "ingredient" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use IngredientID instead. It exists only for internal usage by the builders.
func (*RecipeIngredientMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*RecipeIngredientMutation) OldQuantity ¶
func (m *RecipeIngredientMutation) OldQuantity(ctx context.Context) (v float32, err error)
OldQuantity returns the old "quantity" field's value of the RecipeIngredient entity. If the RecipeIngredient 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 (*RecipeIngredientMutation) OldUnit ¶
func (m *RecipeIngredientMutation) OldUnit(ctx context.Context) (v string, err error)
OldUnit returns the old "unit" field's value of the RecipeIngredient entity. If the RecipeIngredient 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 (*RecipeIngredientMutation) Op ¶
func (m *RecipeIngredientMutation) Op() Op
Op returns the operation name.
func (*RecipeIngredientMutation) Quantity ¶
func (m *RecipeIngredientMutation) Quantity() (r float32, exists bool)
Quantity returns the value of the "quantity" field in the mutation.
func (*RecipeIngredientMutation) RemovedEdges ¶
func (m *RecipeIngredientMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RecipeIngredientMutation) RemovedIDs ¶
func (m *RecipeIngredientMutation) 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 (*RecipeIngredientMutation) ResetEdge ¶
func (m *RecipeIngredientMutation) 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 (*RecipeIngredientMutation) ResetField ¶
func (m *RecipeIngredientMutation) 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 (*RecipeIngredientMutation) ResetIngredient ¶
func (m *RecipeIngredientMutation) ResetIngredient()
ResetIngredient resets all changes to the "ingredient" edge.
func (*RecipeIngredientMutation) ResetQuantity ¶
func (m *RecipeIngredientMutation) ResetQuantity()
ResetQuantity resets all changes to the "quantity" field.
func (*RecipeIngredientMutation) ResetUnit ¶
func (m *RecipeIngredientMutation) ResetUnit()
ResetUnit resets all changes to the "unit" field.
func (*RecipeIngredientMutation) SetField ¶
func (m *RecipeIngredientMutation) 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 (*RecipeIngredientMutation) SetIngredientID ¶
func (m *RecipeIngredientMutation) SetIngredientID(id int)
SetIngredientID sets the "ingredient" edge to the Ingredient entity by id.
func (*RecipeIngredientMutation) SetQuantity ¶
func (m *RecipeIngredientMutation) SetQuantity(f float32)
SetQuantity sets the "quantity" field.
func (*RecipeIngredientMutation) SetUnit ¶
func (m *RecipeIngredientMutation) SetUnit(s string)
SetUnit sets the "unit" field.
func (RecipeIngredientMutation) Tx ¶
func (m RecipeIngredientMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RecipeIngredientMutation) Type ¶
func (m *RecipeIngredientMutation) Type() string
Type returns the node type of this mutation (RecipeIngredient).
func (*RecipeIngredientMutation) Unit ¶
func (m *RecipeIngredientMutation) Unit() (r string, exists bool)
Unit returns the value of the "unit" field in the mutation.
func (*RecipeIngredientMutation) Where ¶
func (m *RecipeIngredientMutation) Where(ps ...predicate.RecipeIngredient)
Where appends a list predicates to the RecipeIngredientMutation builder.
type RecipeIngredientQuery ¶
type RecipeIngredientQuery struct {
// contains filtered or unexported fields
}
RecipeIngredientQuery is the builder for querying RecipeIngredient entities.
func (*RecipeIngredientQuery) All ¶
func (riq *RecipeIngredientQuery) All(ctx context.Context) ([]*RecipeIngredient, error)
All executes the query and returns a list of RecipeIngredients.
func (*RecipeIngredientQuery) AllX ¶
func (riq *RecipeIngredientQuery) AllX(ctx context.Context) []*RecipeIngredient
AllX is like All, but panics if an error occurs.
func (*RecipeIngredientQuery) Clone ¶
func (riq *RecipeIngredientQuery) Clone() *RecipeIngredientQuery
Clone returns a duplicate of the RecipeIngredientQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RecipeIngredientQuery) Count ¶
func (riq *RecipeIngredientQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*RecipeIngredientQuery) CountX ¶
func (riq *RecipeIngredientQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*RecipeIngredientQuery) Exist ¶
func (riq *RecipeIngredientQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*RecipeIngredientQuery) ExistX ¶
func (riq *RecipeIngredientQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*RecipeIngredientQuery) First ¶
func (riq *RecipeIngredientQuery) First(ctx context.Context) (*RecipeIngredient, error)
First returns the first RecipeIngredient entity from the query. Returns a *NotFoundError when no RecipeIngredient was found.
func (*RecipeIngredientQuery) FirstID ¶
func (riq *RecipeIngredientQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first RecipeIngredient ID from the query. Returns a *NotFoundError when no RecipeIngredient ID was found.
func (*RecipeIngredientQuery) FirstIDX ¶
func (riq *RecipeIngredientQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*RecipeIngredientQuery) FirstX ¶
func (riq *RecipeIngredientQuery) FirstX(ctx context.Context) *RecipeIngredient
FirstX is like First, but panics if an error occurs.
func (*RecipeIngredientQuery) GroupBy ¶
func (riq *RecipeIngredientQuery) GroupBy(field string, fields ...string) *RecipeIngredientGroupBy
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 { Quantity float32 `json:"quantity,omitempty"` Count int `json:"count,omitempty"` } client.RecipeIngredient.Query(). GroupBy(recipeingredient.FieldQuantity). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RecipeIngredientQuery) IDs ¶
func (riq *RecipeIngredientQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of RecipeIngredient IDs.
func (*RecipeIngredientQuery) IDsX ¶
func (riq *RecipeIngredientQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*RecipeIngredientQuery) Limit ¶
func (riq *RecipeIngredientQuery) Limit(limit int) *RecipeIngredientQuery
Limit adds a limit step to the query.
func (*RecipeIngredientQuery) Offset ¶
func (riq *RecipeIngredientQuery) Offset(offset int) *RecipeIngredientQuery
Offset adds an offset step to the query.
func (*RecipeIngredientQuery) Only ¶
func (riq *RecipeIngredientQuery) Only(ctx context.Context) (*RecipeIngredient, error)
Only returns a single RecipeIngredient entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one RecipeIngredient entity is not found. Returns a *NotFoundError when no RecipeIngredient entities are found.
func (*RecipeIngredientQuery) OnlyID ¶
func (riq *RecipeIngredientQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only RecipeIngredient ID in the query. Returns a *NotSingularError when exactly one RecipeIngredient ID is not found. Returns a *NotFoundError when no entities are found.
func (*RecipeIngredientQuery) OnlyIDX ¶
func (riq *RecipeIngredientQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*RecipeIngredientQuery) OnlyX ¶
func (riq *RecipeIngredientQuery) OnlyX(ctx context.Context) *RecipeIngredient
OnlyX is like Only, but panics if an error occurs.
func (*RecipeIngredientQuery) Order ¶
func (riq *RecipeIngredientQuery) Order(o ...OrderFunc) *RecipeIngredientQuery
Order adds an order step to the query.
func (*RecipeIngredientQuery) QueryIngredient ¶
func (riq *RecipeIngredientQuery) QueryIngredient() *IngredientQuery
QueryIngredient chains the current query on the "ingredient" edge.
func (*RecipeIngredientQuery) Select ¶
func (riq *RecipeIngredientQuery) Select(fields ...string) *RecipeIngredientSelect
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 { Quantity float32 `json:"quantity,omitempty"` } client.RecipeIngredient.Query(). Select(recipeingredient.FieldQuantity). Scan(ctx, &v)
func (*RecipeIngredientQuery) Unique ¶
func (riq *RecipeIngredientQuery) Unique(unique bool) *RecipeIngredientQuery
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 (*RecipeIngredientQuery) Where ¶
func (riq *RecipeIngredientQuery) Where(ps ...predicate.RecipeIngredient) *RecipeIngredientQuery
Where adds a new predicate for the RecipeIngredientQuery builder.
func (*RecipeIngredientQuery) WithIngredient ¶
func (riq *RecipeIngredientQuery) WithIngredient(opts ...func(*IngredientQuery)) *RecipeIngredientQuery
WithIngredient tells the query-builder to eager-load the nodes that are connected to the "ingredient" edge. The optional arguments are used to configure the query builder of the edge.
type RecipeIngredientSelect ¶
type RecipeIngredientSelect struct { *RecipeIngredientQuery // contains filtered or unexported fields }
RecipeIngredientSelect is the builder for selecting fields of RecipeIngredient entities.
func (*RecipeIngredientSelect) Bool ¶
func (ris *RecipeIngredientSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RecipeIngredientSelect) BoolX ¶
func (ris *RecipeIngredientSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*RecipeIngredientSelect) Bools ¶
func (ris *RecipeIngredientSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RecipeIngredientSelect) BoolsX ¶
func (ris *RecipeIngredientSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*RecipeIngredientSelect) Float64 ¶
func (ris *RecipeIngredientSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RecipeIngredientSelect) Float64X ¶
func (ris *RecipeIngredientSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*RecipeIngredientSelect) Float64s ¶
func (ris *RecipeIngredientSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RecipeIngredientSelect) Float64sX ¶
func (ris *RecipeIngredientSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*RecipeIngredientSelect) Int ¶
func (ris *RecipeIngredientSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RecipeIngredientSelect) IntX ¶
func (ris *RecipeIngredientSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*RecipeIngredientSelect) Ints ¶
func (ris *RecipeIngredientSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RecipeIngredientSelect) IntsX ¶
func (ris *RecipeIngredientSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*RecipeIngredientSelect) Scan ¶
func (ris *RecipeIngredientSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*RecipeIngredientSelect) ScanX ¶
func (ris *RecipeIngredientSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*RecipeIngredientSelect) String ¶
func (ris *RecipeIngredientSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*RecipeIngredientSelect) StringX ¶
func (ris *RecipeIngredientSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type RecipeIngredientUpdate ¶
type RecipeIngredientUpdate struct {
// contains filtered or unexported fields
}
RecipeIngredientUpdate is the builder for updating RecipeIngredient entities.
func (*RecipeIngredientUpdate) AddQuantity ¶
func (riu *RecipeIngredientUpdate) AddQuantity(f float32) *RecipeIngredientUpdate
AddQuantity adds f to the "quantity" field.
func (*RecipeIngredientUpdate) ClearIngredient ¶
func (riu *RecipeIngredientUpdate) ClearIngredient() *RecipeIngredientUpdate
ClearIngredient clears the "ingredient" edge to the Ingredient entity.
func (*RecipeIngredientUpdate) Exec ¶
func (riu *RecipeIngredientUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RecipeIngredientUpdate) ExecX ¶
func (riu *RecipeIngredientUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RecipeIngredientUpdate) Mutation ¶
func (riu *RecipeIngredientUpdate) Mutation() *RecipeIngredientMutation
Mutation returns the RecipeIngredientMutation object of the builder.
func (*RecipeIngredientUpdate) Save ¶
func (riu *RecipeIngredientUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RecipeIngredientUpdate) SaveX ¶
func (riu *RecipeIngredientUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RecipeIngredientUpdate) SetIngredient ¶
func (riu *RecipeIngredientUpdate) SetIngredient(i *Ingredient) *RecipeIngredientUpdate
SetIngredient sets the "ingredient" edge to the Ingredient entity.
func (*RecipeIngredientUpdate) SetIngredientID ¶
func (riu *RecipeIngredientUpdate) SetIngredientID(id int) *RecipeIngredientUpdate
SetIngredientID sets the "ingredient" edge to the Ingredient entity by ID.
func (*RecipeIngredientUpdate) SetNillableIngredientID ¶
func (riu *RecipeIngredientUpdate) SetNillableIngredientID(id *int) *RecipeIngredientUpdate
SetNillableIngredientID sets the "ingredient" edge to the Ingredient entity by ID if the given value is not nil.
func (*RecipeIngredientUpdate) SetQuantity ¶
func (riu *RecipeIngredientUpdate) SetQuantity(f float32) *RecipeIngredientUpdate
SetQuantity sets the "quantity" field.
func (*RecipeIngredientUpdate) SetUnit ¶
func (riu *RecipeIngredientUpdate) SetUnit(s string) *RecipeIngredientUpdate
SetUnit sets the "unit" field.
func (*RecipeIngredientUpdate) Where ¶
func (riu *RecipeIngredientUpdate) Where(ps ...predicate.RecipeIngredient) *RecipeIngredientUpdate
Where appends a list predicates to the RecipeIngredientUpdate builder.
type RecipeIngredientUpdateOne ¶
type RecipeIngredientUpdateOne struct {
// contains filtered or unexported fields
}
RecipeIngredientUpdateOne is the builder for updating a single RecipeIngredient entity.
func (*RecipeIngredientUpdateOne) AddQuantity ¶
func (riuo *RecipeIngredientUpdateOne) AddQuantity(f float32) *RecipeIngredientUpdateOne
AddQuantity adds f to the "quantity" field.
func (*RecipeIngredientUpdateOne) ClearIngredient ¶
func (riuo *RecipeIngredientUpdateOne) ClearIngredient() *RecipeIngredientUpdateOne
ClearIngredient clears the "ingredient" edge to the Ingredient entity.
func (*RecipeIngredientUpdateOne) Exec ¶
func (riuo *RecipeIngredientUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RecipeIngredientUpdateOne) ExecX ¶
func (riuo *RecipeIngredientUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RecipeIngredientUpdateOne) Mutation ¶
func (riuo *RecipeIngredientUpdateOne) Mutation() *RecipeIngredientMutation
Mutation returns the RecipeIngredientMutation object of the builder.
func (*RecipeIngredientUpdateOne) Save ¶
func (riuo *RecipeIngredientUpdateOne) Save(ctx context.Context) (*RecipeIngredient, error)
Save executes the query and returns the updated RecipeIngredient entity.
func (*RecipeIngredientUpdateOne) SaveX ¶
func (riuo *RecipeIngredientUpdateOne) SaveX(ctx context.Context) *RecipeIngredient
SaveX is like Save, but panics if an error occurs.
func (*RecipeIngredientUpdateOne) Select ¶
func (riuo *RecipeIngredientUpdateOne) Select(field string, fields ...string) *RecipeIngredientUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RecipeIngredientUpdateOne) SetIngredient ¶
func (riuo *RecipeIngredientUpdateOne) SetIngredient(i *Ingredient) *RecipeIngredientUpdateOne
SetIngredient sets the "ingredient" edge to the Ingredient entity.
func (*RecipeIngredientUpdateOne) SetIngredientID ¶
func (riuo *RecipeIngredientUpdateOne) SetIngredientID(id int) *RecipeIngredientUpdateOne
SetIngredientID sets the "ingredient" edge to the Ingredient entity by ID.
func (*RecipeIngredientUpdateOne) SetNillableIngredientID ¶
func (riuo *RecipeIngredientUpdateOne) SetNillableIngredientID(id *int) *RecipeIngredientUpdateOne
SetNillableIngredientID sets the "ingredient" edge to the Ingredient entity by ID if the given value is not nil.
func (*RecipeIngredientUpdateOne) SetQuantity ¶
func (riuo *RecipeIngredientUpdateOne) SetQuantity(f float32) *RecipeIngredientUpdateOne
SetQuantity sets the "quantity" field.
func (*RecipeIngredientUpdateOne) SetUnit ¶
func (riuo *RecipeIngredientUpdateOne) SetUnit(s string) *RecipeIngredientUpdateOne
SetUnit sets the "unit" field.
type RecipeIngredients ¶
type RecipeIngredients []*RecipeIngredient
RecipeIngredients is a parsable slice of RecipeIngredient.
type RecipeMutation ¶
type RecipeMutation struct {
// contains filtered or unexported fields
}
RecipeMutation represents an operation that mutates the Recipe nodes in the graph.
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) AddRecipeIngredientIDs ¶
func (m *RecipeMutation) AddRecipeIngredientIDs(ids ...int)
AddRecipeIngredientIDs adds the "recipe_ingredients" edge to the RecipeIngredient entity by ids.
func (*RecipeMutation) AddServings ¶
func (m *RecipeMutation) AddServings(i int)
AddServings adds i to the "servings" field.
func (*RecipeMutation) AddStepIDs ¶
func (m *RecipeMutation) AddStepIDs(ids ...int)
AddStepIDs adds the "steps" edge to the Step entity by ids.
func (*RecipeMutation) AddTagIDs ¶
func (m *RecipeMutation) AddTagIDs(ids ...int)
AddTagIDs adds the "tags" edge to the Category entity by ids.
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) 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) AuthorCleared ¶
func (m *RecipeMutation) AuthorCleared() bool
AuthorCleared reports if the "author" edge to the User entity was cleared.
func (*RecipeMutation) AuthorID ¶
func (m *RecipeMutation) AuthorID() (id int, exists bool)
AuthorID returns the "author" edge ID in the mutation.
func (*RecipeMutation) AuthorIDs ¶
func (m *RecipeMutation) AuthorIDs() (ids []int)
AuthorIDs returns the "author" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AuthorID instead. It exists only for internal usage by the builders.
func (*RecipeMutation) ClearAuthor ¶
func (m *RecipeMutation) ClearAuthor()
ClearAuthor clears the "author" edge to the User entity.
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) 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) ClearRecipeIngredients ¶
func (m *RecipeMutation) ClearRecipeIngredients()
ClearRecipeIngredients clears the "recipe_ingredients" edge to the RecipeIngredient entity.
func (*RecipeMutation) ClearSteps ¶
func (m *RecipeMutation) ClearSteps()
ClearSteps clears the "steps" edge to the Step entity.
func (*RecipeMutation) ClearTags ¶
func (m *RecipeMutation) ClearTags()
ClearTags clears the "tags" edge to the Category entity.
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) 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) 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 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 (*RecipeMutation) Name ¶
func (m *RecipeMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*RecipeMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*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) 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) RecipeIngredientsCleared ¶
func (m *RecipeMutation) RecipeIngredientsCleared() bool
RecipeIngredientsCleared reports if the "recipe_ingredients" edge to the RecipeIngredient entity was cleared.
func (*RecipeMutation) RecipeIngredientsIDs ¶
func (m *RecipeMutation) RecipeIngredientsIDs() (ids []int)
RecipeIngredientsIDs returns the "recipe_ingredients" edge IDs in the mutation.
func (*RecipeMutation) RemoveRecipeIngredientIDs ¶
func (m *RecipeMutation) RemoveRecipeIngredientIDs(ids ...int)
RemoveRecipeIngredientIDs removes the "recipe_ingredients" edge to the RecipeIngredient entity by IDs.
func (*RecipeMutation) RemoveStepIDs ¶
func (m *RecipeMutation) RemoveStepIDs(ids ...int)
RemoveStepIDs removes the "steps" edge to the Step entity by IDs.
func (*RecipeMutation) RemoveTagIDs ¶
func (m *RecipeMutation) RemoveTagIDs(ids ...int)
RemoveTagIDs removes the "tags" edge to the Category entity by IDs.
func (*RecipeMutation) RemovedEdges ¶
func (m *RecipeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
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) RemovedRecipeIngredientsIDs ¶
func (m *RecipeMutation) RemovedRecipeIngredientsIDs() (ids []int)
RemovedRecipeIngredients returns the removed IDs of the "recipe_ingredients" edge to the RecipeIngredient entity.
func (*RecipeMutation) RemovedStepsIDs ¶
func (m *RecipeMutation) RemovedStepsIDs() (ids []int)
RemovedSteps returns the removed IDs of the "steps" edge to the Step entity.
func (*RecipeMutation) RemovedTagsIDs ¶
func (m *RecipeMutation) RemovedTagsIDs() (ids []int)
RemovedTags returns the removed IDs of the "tags" edge to the Category entity.
func (*RecipeMutation) ResetAuthor ¶
func (m *RecipeMutation) ResetAuthor()
ResetAuthor resets all changes to the "author" edge.
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) 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) ResetName ¶
func (m *RecipeMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*RecipeMutation) ResetRecipeIngredients ¶
func (m *RecipeMutation) ResetRecipeIngredients()
ResetRecipeIngredients resets all changes to the "recipe_ingredients" edge.
func (*RecipeMutation) ResetServings ¶
func (m *RecipeMutation) ResetServings()
ResetServings resets all changes to the "servings" field.
func (*RecipeMutation) ResetSteps ¶
func (m *RecipeMutation) ResetSteps()
ResetSteps resets all changes to the "steps" edge.
func (*RecipeMutation) ResetTags ¶
func (m *RecipeMutation) ResetTags()
ResetTags resets all changes to the "tags" edge.
func (*RecipeMutation) Servings ¶
func (m *RecipeMutation) Servings() (r int, exists bool)
Servings returns the value of the "servings" field in the mutation.
func (*RecipeMutation) SetAuthorID ¶
func (m *RecipeMutation) SetAuthorID(id int)
SetAuthorID sets the "author" edge to the User entity by id.
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) SetName ¶
func (m *RecipeMutation) SetName(s string)
SetName sets the "name" field.
func (*RecipeMutation) SetServings ¶
func (m *RecipeMutation) SetServings(i int)
SetServings sets the "servings" field.
func (*RecipeMutation) StepsCleared ¶
func (m *RecipeMutation) StepsCleared() bool
StepsCleared reports if the "steps" edge to the Step entity was cleared.
func (*RecipeMutation) StepsIDs ¶
func (m *RecipeMutation) StepsIDs() (ids []int)
StepsIDs returns the "steps" edge IDs in the mutation.
func (*RecipeMutation) TagsCleared ¶
func (m *RecipeMutation) TagsCleared() bool
TagsCleared reports if the "tags" edge to the Category entity was cleared.
func (*RecipeMutation) TagsIDs ¶
func (m *RecipeMutation) TagsIDs() (ids []int)
TagsIDs returns the "tags" edge IDs in the 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) Where ¶
func (m *RecipeMutation) Where(ps ...predicate.Recipe)
Where appends a list predicates to the RecipeMutation builder.
type RecipeQuery ¶
type RecipeQuery struct {
// contains filtered or unexported fields
}
RecipeQuery is the builder for querying Recipe entities.
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 int, 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) int
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 { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Recipe.Query(). GroupBy(recipe.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RecipeQuery) IDs ¶
func (rq *RecipeQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Recipe IDs.
func (*RecipeQuery) IDsX ¶
func (rq *RecipeQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*RecipeQuery) Limit ¶
func (rq *RecipeQuery) Limit(limit int) *RecipeQuery
Limit adds a limit step to the query.
func (*RecipeQuery) Offset ¶
func (rq *RecipeQuery) Offset(offset int) *RecipeQuery
Offset adds an offset step to the query.
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 exactly one Recipe entity is not found. Returns a *NotFoundError when no Recipe entities are found.
func (*RecipeQuery) OnlyID ¶
func (rq *RecipeQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Recipe ID in the query. Returns a *NotSingularError when exactly one Recipe ID is not found. Returns a *NotFoundError when no entities are found.
func (*RecipeQuery) OnlyIDX ¶
func (rq *RecipeQuery) OnlyIDX(ctx context.Context) int
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 ...OrderFunc) *RecipeQuery
Order adds an order step to the query.
func (*RecipeQuery) QueryAuthor ¶
func (rq *RecipeQuery) QueryAuthor() *UserQuery
QueryAuthor chains the current query on the "author" edge.
func (*RecipeQuery) QueryRecipeIngredients ¶
func (rq *RecipeQuery) QueryRecipeIngredients() *RecipeIngredientQuery
QueryRecipeIngredients chains the current query on the "recipe_ingredients" edge.
func (*RecipeQuery) QuerySteps ¶
func (rq *RecipeQuery) QuerySteps() *StepQuery
QuerySteps chains the current query on the "steps" edge.
func (*RecipeQuery) QueryTags ¶
func (rq *RecipeQuery) QueryTags() *CategoryQuery
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 { Name string `json:"name,omitempty"` } client.Recipe.Query(). Select(recipe.FieldName). 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) WithAuthor ¶
func (rq *RecipeQuery) WithAuthor(opts ...func(*UserQuery)) *RecipeQuery
WithAuthor tells the query-builder to eager-load the nodes that are connected to the "author" edge. The optional arguments are used to configure the query builder of the edge.
func (*RecipeQuery) WithRecipeIngredients ¶
func (rq *RecipeQuery) WithRecipeIngredients(opts ...func(*RecipeIngredientQuery)) *RecipeQuery
WithRecipeIngredients tells the query-builder to eager-load the nodes that are connected to the "recipe_ingredients" edge. The optional arguments are used to configure the query builder of the edge.
func (*RecipeQuery) WithSteps ¶
func (rq *RecipeQuery) WithSteps(opts ...func(*StepQuery)) *RecipeQuery
WithSteps tells the query-builder to eager-load the nodes that are connected to the "steps" edge. The optional arguments are used to configure the query builder of the edge.
func (*RecipeQuery) WithTags ¶
func (rq *RecipeQuery) WithTags(opts ...func(*CategoryQuery)) *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) Bool ¶
func (rs *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 (rs *RecipeSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*RecipeSelect) Bools ¶
func (rs *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 (rs *RecipeSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*RecipeSelect) Float64 ¶
func (rs *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 (rs *RecipeSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*RecipeSelect) Float64s ¶
func (rs *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 (rs *RecipeSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*RecipeSelect) Int ¶
func (rs *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 (rs *RecipeSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*RecipeSelect) Ints ¶
func (rs *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 (rs *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 interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*RecipeSelect) ScanX ¶
func (rs *RecipeSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*RecipeSelect) String ¶
func (rs *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 (rs *RecipeSelect) StringX(ctx context.Context) string
StringX is like String, 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) AddRecipeIngredientIDs ¶
func (ru *RecipeUpdate) AddRecipeIngredientIDs(ids ...int) *RecipeUpdate
AddRecipeIngredientIDs adds the "recipe_ingredients" edge to the RecipeIngredient entity by IDs.
func (*RecipeUpdate) AddRecipeIngredients ¶
func (ru *RecipeUpdate) AddRecipeIngredients(r ...*RecipeIngredient) *RecipeUpdate
AddRecipeIngredients adds the "recipe_ingredients" edges to the RecipeIngredient entity.
func (*RecipeUpdate) AddServings ¶
func (ru *RecipeUpdate) AddServings(i int) *RecipeUpdate
AddServings adds i to the "servings" field.
func (*RecipeUpdate) AddStepIDs ¶
func (ru *RecipeUpdate) AddStepIDs(ids ...int) *RecipeUpdate
AddStepIDs adds the "steps" edge to the Step entity by IDs.
func (*RecipeUpdate) AddSteps ¶
func (ru *RecipeUpdate) AddSteps(s ...*Step) *RecipeUpdate
AddSteps adds the "steps" edges to the Step entity.
func (*RecipeUpdate) AddTagIDs ¶
func (ru *RecipeUpdate) AddTagIDs(ids ...int) *RecipeUpdate
AddTagIDs adds the "tags" edge to the Category entity by IDs.
func (*RecipeUpdate) AddTags ¶
func (ru *RecipeUpdate) AddTags(c ...*Category) *RecipeUpdate
AddTags adds the "tags" edges to the Category entity.
func (*RecipeUpdate) ClearAuthor ¶
func (ru *RecipeUpdate) ClearAuthor() *RecipeUpdate
ClearAuthor clears the "author" edge to the User entity.
func (*RecipeUpdate) ClearRecipeIngredients ¶
func (ru *RecipeUpdate) ClearRecipeIngredients() *RecipeUpdate
ClearRecipeIngredients clears all "recipe_ingredients" edges to the RecipeIngredient entity.
func (*RecipeUpdate) ClearSteps ¶
func (ru *RecipeUpdate) ClearSteps() *RecipeUpdate
ClearSteps clears all "steps" edges to the Step entity.
func (*RecipeUpdate) ClearTags ¶
func (ru *RecipeUpdate) ClearTags() *RecipeUpdate
ClearTags clears all "tags" edges to the Category entity.
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) RemoveRecipeIngredientIDs ¶
func (ru *RecipeUpdate) RemoveRecipeIngredientIDs(ids ...int) *RecipeUpdate
RemoveRecipeIngredientIDs removes the "recipe_ingredients" edge to RecipeIngredient entities by IDs.
func (*RecipeUpdate) RemoveRecipeIngredients ¶
func (ru *RecipeUpdate) RemoveRecipeIngredients(r ...*RecipeIngredient) *RecipeUpdate
RemoveRecipeIngredients removes "recipe_ingredients" edges to RecipeIngredient entities.
func (*RecipeUpdate) RemoveStepIDs ¶
func (ru *RecipeUpdate) RemoveStepIDs(ids ...int) *RecipeUpdate
RemoveStepIDs removes the "steps" edge to Step entities by IDs.
func (*RecipeUpdate) RemoveSteps ¶
func (ru *RecipeUpdate) RemoveSteps(s ...*Step) *RecipeUpdate
RemoveSteps removes "steps" edges to Step entities.
func (*RecipeUpdate) RemoveTagIDs ¶
func (ru *RecipeUpdate) RemoveTagIDs(ids ...int) *RecipeUpdate
RemoveTagIDs removes the "tags" edge to Category entities by IDs.
func (*RecipeUpdate) RemoveTags ¶
func (ru *RecipeUpdate) RemoveTags(c ...*Category) *RecipeUpdate
RemoveTags removes "tags" edges to Category 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) SetAuthor ¶
func (ru *RecipeUpdate) SetAuthor(u *User) *RecipeUpdate
SetAuthor sets the "author" edge to the User entity.
func (*RecipeUpdate) SetAuthorID ¶
func (ru *RecipeUpdate) SetAuthorID(id int) *RecipeUpdate
SetAuthorID sets the "author" edge to the User entity by ID.
func (*RecipeUpdate) SetName ¶
func (ru *RecipeUpdate) SetName(s string) *RecipeUpdate
SetName sets the "name" field.
func (*RecipeUpdate) SetNillableAuthorID ¶
func (ru *RecipeUpdate) SetNillableAuthorID(id *int) *RecipeUpdate
SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.
func (*RecipeUpdate) SetServings ¶
func (ru *RecipeUpdate) SetServings(i int) *RecipeUpdate
SetServings sets the "servings" 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) AddRecipeIngredientIDs ¶
func (ruo *RecipeUpdateOne) AddRecipeIngredientIDs(ids ...int) *RecipeUpdateOne
AddRecipeIngredientIDs adds the "recipe_ingredients" edge to the RecipeIngredient entity by IDs.
func (*RecipeUpdateOne) AddRecipeIngredients ¶
func (ruo *RecipeUpdateOne) AddRecipeIngredients(r ...*RecipeIngredient) *RecipeUpdateOne
AddRecipeIngredients adds the "recipe_ingredients" edges to the RecipeIngredient entity.
func (*RecipeUpdateOne) AddServings ¶
func (ruo *RecipeUpdateOne) AddServings(i int) *RecipeUpdateOne
AddServings adds i to the "servings" field.
func (*RecipeUpdateOne) AddStepIDs ¶
func (ruo *RecipeUpdateOne) AddStepIDs(ids ...int) *RecipeUpdateOne
AddStepIDs adds the "steps" edge to the Step entity by IDs.
func (*RecipeUpdateOne) AddSteps ¶
func (ruo *RecipeUpdateOne) AddSteps(s ...*Step) *RecipeUpdateOne
AddSteps adds the "steps" edges to the Step entity.
func (*RecipeUpdateOne) AddTagIDs ¶
func (ruo *RecipeUpdateOne) AddTagIDs(ids ...int) *RecipeUpdateOne
AddTagIDs adds the "tags" edge to the Category entity by IDs.
func (*RecipeUpdateOne) AddTags ¶
func (ruo *RecipeUpdateOne) AddTags(c ...*Category) *RecipeUpdateOne
AddTags adds the "tags" edges to the Category entity.
func (*RecipeUpdateOne) ClearAuthor ¶
func (ruo *RecipeUpdateOne) ClearAuthor() *RecipeUpdateOne
ClearAuthor clears the "author" edge to the User entity.
func (*RecipeUpdateOne) ClearRecipeIngredients ¶
func (ruo *RecipeUpdateOne) ClearRecipeIngredients() *RecipeUpdateOne
ClearRecipeIngredients clears all "recipe_ingredients" edges to the RecipeIngredient entity.
func (*RecipeUpdateOne) ClearSteps ¶
func (ruo *RecipeUpdateOne) ClearSteps() *RecipeUpdateOne
ClearSteps clears all "steps" edges to the Step entity.
func (*RecipeUpdateOne) ClearTags ¶
func (ruo *RecipeUpdateOne) ClearTags() *RecipeUpdateOne
ClearTags clears all "tags" edges to the Category entity.
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) RemoveRecipeIngredientIDs ¶
func (ruo *RecipeUpdateOne) RemoveRecipeIngredientIDs(ids ...int) *RecipeUpdateOne
RemoveRecipeIngredientIDs removes the "recipe_ingredients" edge to RecipeIngredient entities by IDs.
func (*RecipeUpdateOne) RemoveRecipeIngredients ¶
func (ruo *RecipeUpdateOne) RemoveRecipeIngredients(r ...*RecipeIngredient) *RecipeUpdateOne
RemoveRecipeIngredients removes "recipe_ingredients" edges to RecipeIngredient entities.
func (*RecipeUpdateOne) RemoveStepIDs ¶
func (ruo *RecipeUpdateOne) RemoveStepIDs(ids ...int) *RecipeUpdateOne
RemoveStepIDs removes the "steps" edge to Step entities by IDs.
func (*RecipeUpdateOne) RemoveSteps ¶
func (ruo *RecipeUpdateOne) RemoveSteps(s ...*Step) *RecipeUpdateOne
RemoveSteps removes "steps" edges to Step entities.
func (*RecipeUpdateOne) RemoveTagIDs ¶
func (ruo *RecipeUpdateOne) RemoveTagIDs(ids ...int) *RecipeUpdateOne
RemoveTagIDs removes the "tags" edge to Category entities by IDs.
func (*RecipeUpdateOne) RemoveTags ¶
func (ruo *RecipeUpdateOne) RemoveTags(c ...*Category) *RecipeUpdateOne
RemoveTags removes "tags" edges to Category 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) SetAuthor ¶
func (ruo *RecipeUpdateOne) SetAuthor(u *User) *RecipeUpdateOne
SetAuthor sets the "author" edge to the User entity.
func (*RecipeUpdateOne) SetAuthorID ¶
func (ruo *RecipeUpdateOne) SetAuthorID(id int) *RecipeUpdateOne
SetAuthorID sets the "author" edge to the User entity by ID.
func (*RecipeUpdateOne) SetName ¶
func (ruo *RecipeUpdateOne) SetName(s string) *RecipeUpdateOne
SetName sets the "name" field.
func (*RecipeUpdateOne) SetNillableAuthorID ¶
func (ruo *RecipeUpdateOne) SetNillableAuthorID(id *int) *RecipeUpdateOne
SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.
func (*RecipeUpdateOne) SetServings ¶
func (ruo *RecipeUpdateOne) SetServings(i int) *RecipeUpdateOne
SetServings sets the "servings" field.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollbacker method.
type Step ¶
type Step struct { // ID of the ent. ID int `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 StepQuery when eager-loading is set. Edges StepEdges `json:"edges"` // contains filtered or unexported fields }
Step is the model entity for the Step schema.
func (*Step) QueryRecipe ¶
func (s *Step) QueryRecipe() *RecipeQuery
QueryRecipe queries the "recipe" edge of the Step entity.
func (*Step) Unwrap ¶
Unwrap unwraps the Step 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 (*Step) Update ¶
func (s *Step) Update() *StepUpdateOne
Update returns a builder for updating this Step. Note that you need to call Step.Unwrap() before calling this method if this Step was returned from a transaction, and the transaction was committed or rolled back.
type StepClient ¶
type StepClient struct {
// contains filtered or unexported fields
}
StepClient is a client for the Step schema.
func NewStepClient ¶
func NewStepClient(c config) *StepClient
NewStepClient returns a client for the Step from the given config.
func (*StepClient) Create ¶
func (c *StepClient) Create() *StepCreate
Create returns a create builder for Step.
func (*StepClient) CreateBulk ¶
func (c *StepClient) CreateBulk(builders ...*StepCreate) *StepCreateBulk
CreateBulk returns a builder for creating a bulk of Step entities.
func (*StepClient) Delete ¶
func (c *StepClient) Delete() *StepDelete
Delete returns a delete builder for Step.
func (*StepClient) DeleteOne ¶
func (c *StepClient) DeleteOne(s *Step) *StepDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*StepClient) DeleteOneID ¶
func (c *StepClient) DeleteOneID(id int) *StepDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*StepClient) GetX ¶
func (c *StepClient) GetX(ctx context.Context, id int) *Step
GetX is like Get, but panics if an error occurs.
func (*StepClient) Query ¶
func (c *StepClient) Query() *StepQuery
Query returns a query builder for Step.
func (*StepClient) QueryRecipe ¶
func (c *StepClient) QueryRecipe(s *Step) *RecipeQuery
QueryRecipe queries the recipe edge of a Step.
func (*StepClient) Update ¶
func (c *StepClient) Update() *StepUpdate
Update returns an update builder for Step.
func (*StepClient) UpdateOne ¶
func (c *StepClient) UpdateOne(s *Step) *StepUpdateOne
UpdateOne returns an update builder for the given entity.
func (*StepClient) UpdateOneID ¶
func (c *StepClient) UpdateOneID(id int) *StepUpdateOne
UpdateOneID returns an update builder for the given id.
func (*StepClient) Use ¶
func (c *StepClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `step.Hooks(f(g(h())))`.
type StepCreate ¶
type StepCreate struct {
// contains filtered or unexported fields
}
StepCreate is the builder for creating a Step entity.
func (*StepCreate) Exec ¶
func (sc *StepCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*StepCreate) ExecX ¶
func (sc *StepCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StepCreate) Mutation ¶
func (sc *StepCreate) Mutation() *StepMutation
Mutation returns the StepMutation object of the builder.
func (*StepCreate) Save ¶
func (sc *StepCreate) Save(ctx context.Context) (*Step, error)
Save creates the Step in the database.
func (*StepCreate) SaveX ¶
func (sc *StepCreate) SaveX(ctx context.Context) *Step
SaveX calls Save and panics if Save returns an error.
func (*StepCreate) SetNillableRecipeID ¶
func (sc *StepCreate) SetNillableRecipeID(id *int) *StepCreate
SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.
func (*StepCreate) SetRecipe ¶
func (sc *StepCreate) SetRecipe(r *Recipe) *StepCreate
SetRecipe sets the "recipe" edge to the Recipe entity.
func (*StepCreate) SetRecipeID ¶
func (sc *StepCreate) SetRecipeID(id int) *StepCreate
SetRecipeID sets the "recipe" edge to the Recipe entity by ID.
func (*StepCreate) SetText ¶
func (sc *StepCreate) SetText(s string) *StepCreate
SetText sets the "text" field.
type StepCreateBulk ¶
type StepCreateBulk struct {
// contains filtered or unexported fields
}
StepCreateBulk is the builder for creating many Step entities in bulk.
func (*StepCreateBulk) Exec ¶
func (scb *StepCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*StepCreateBulk) ExecX ¶
func (scb *StepCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type StepDelete ¶
type StepDelete struct {
// contains filtered or unexported fields
}
StepDelete is the builder for deleting a Step entity.
func (*StepDelete) Exec ¶
func (sd *StepDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*StepDelete) ExecX ¶
func (sd *StepDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*StepDelete) Where ¶
func (sd *StepDelete) Where(ps ...predicate.Step) *StepDelete
Where appends a list predicates to the StepDelete builder.
type StepDeleteOne ¶
type StepDeleteOne struct {
// contains filtered or unexported fields
}
StepDeleteOne is the builder for deleting a single Step entity.
func (*StepDeleteOne) Exec ¶
func (sdo *StepDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*StepDeleteOne) ExecX ¶
func (sdo *StepDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type StepEdges ¶
type StepEdges struct { // Recipe holds the value of the recipe edge. Recipe *Recipe `json:"recipe,omitempty"` // contains filtered or unexported fields }
StepEdges holds the relations/edges for other nodes in the graph.
func (StepEdges) RecipeOrErr ¶
RecipeOrErr returns the Recipe value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type StepGroupBy ¶
type StepGroupBy struct {
// contains filtered or unexported fields
}
StepGroupBy is the group-by builder for Step entities.
func (*StepGroupBy) Aggregate ¶
func (sgb *StepGroupBy) Aggregate(fns ...AggregateFunc) *StepGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*StepGroupBy) Bool ¶
func (sgb *StepGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*StepGroupBy) BoolX ¶
func (sgb *StepGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*StepGroupBy) Bools ¶
func (sgb *StepGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*StepGroupBy) BoolsX ¶
func (sgb *StepGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*StepGroupBy) Float64 ¶
func (sgb *StepGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*StepGroupBy) Float64X ¶
func (sgb *StepGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*StepGroupBy) Float64s ¶
func (sgb *StepGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*StepGroupBy) Float64sX ¶
func (sgb *StepGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*StepGroupBy) Int ¶
func (sgb *StepGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*StepGroupBy) IntX ¶
func (sgb *StepGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*StepGroupBy) Ints ¶
func (sgb *StepGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*StepGroupBy) IntsX ¶
func (sgb *StepGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*StepGroupBy) Scan ¶
func (sgb *StepGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*StepGroupBy) ScanX ¶
func (sgb *StepGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*StepGroupBy) String ¶
func (sgb *StepGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*StepGroupBy) StringX ¶
func (sgb *StepGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type StepMutation ¶
type StepMutation struct {
// contains filtered or unexported fields
}
StepMutation represents an operation that mutates the Step nodes in the graph.
func (*StepMutation) AddField ¶
func (m *StepMutation) 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 (*StepMutation) AddedEdges ¶
func (m *StepMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*StepMutation) AddedField ¶
func (m *StepMutation) 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 (*StepMutation) AddedFields ¶
func (m *StepMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*StepMutation) AddedIDs ¶
func (m *StepMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*StepMutation) ClearEdge ¶
func (m *StepMutation) 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 (*StepMutation) ClearField ¶
func (m *StepMutation) 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 (*StepMutation) ClearRecipe ¶
func (m *StepMutation) ClearRecipe()
ClearRecipe clears the "recipe" edge to the Recipe entity.
func (*StepMutation) ClearedEdges ¶
func (m *StepMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*StepMutation) ClearedFields ¶
func (m *StepMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (StepMutation) Client ¶
func (m StepMutation) 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 (*StepMutation) EdgeCleared ¶
func (m *StepMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*StepMutation) Field ¶
func (m *StepMutation) 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 (*StepMutation) FieldCleared ¶
func (m *StepMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*StepMutation) Fields ¶
func (m *StepMutation) 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 (*StepMutation) ID ¶
func (m *StepMutation) 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 (*StepMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*StepMutation) OldText ¶
func (m *StepMutation) OldText(ctx context.Context) (v string, err error)
OldText returns the old "text" field's value of the Step entity. If the Step 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 (*StepMutation) RecipeCleared ¶
func (m *StepMutation) RecipeCleared() bool
RecipeCleared reports if the "recipe" edge to the Recipe entity was cleared.
func (*StepMutation) RecipeID ¶
func (m *StepMutation) RecipeID() (id int, exists bool)
RecipeID returns the "recipe" edge ID in the mutation.
func (*StepMutation) RecipeIDs ¶
func (m *StepMutation) RecipeIDs() (ids []int)
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 (*StepMutation) RemovedEdges ¶
func (m *StepMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*StepMutation) RemovedIDs ¶
func (m *StepMutation) 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 (*StepMutation) ResetEdge ¶
func (m *StepMutation) 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 (*StepMutation) ResetField ¶
func (m *StepMutation) 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 (*StepMutation) ResetRecipe ¶
func (m *StepMutation) ResetRecipe()
ResetRecipe resets all changes to the "recipe" edge.
func (*StepMutation) ResetText ¶
func (m *StepMutation) ResetText()
ResetText resets all changes to the "text" field.
func (*StepMutation) SetField ¶
func (m *StepMutation) 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 (*StepMutation) SetRecipeID ¶
func (m *StepMutation) SetRecipeID(id int)
SetRecipeID sets the "recipe" edge to the Recipe entity by id.
func (*StepMutation) SetText ¶
func (m *StepMutation) SetText(s string)
SetText sets the "text" field.
func (*StepMutation) Text ¶
func (m *StepMutation) Text() (r string, exists bool)
Text returns the value of the "text" field in the mutation.
func (StepMutation) Tx ¶
func (m StepMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*StepMutation) Type ¶
func (m *StepMutation) Type() string
Type returns the node type of this mutation (Step).
func (*StepMutation) Where ¶
func (m *StepMutation) Where(ps ...predicate.Step)
Where appends a list predicates to the StepMutation builder.
type StepQuery ¶
type StepQuery struct {
// contains filtered or unexported fields
}
StepQuery is the builder for querying Step entities.
func (*StepQuery) Clone ¶
Clone returns a duplicate of the StepQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*StepQuery) First ¶
First returns the first Step entity from the query. Returns a *NotFoundError when no Step was found.
func (*StepQuery) FirstID ¶
FirstID returns the first Step ID from the query. Returns a *NotFoundError when no Step ID was found.
func (*StepQuery) GroupBy ¶
func (sq *StepQuery) GroupBy(field string, fields ...string) *StepGroupBy
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.Step.Query(). GroupBy(step.FieldText). Aggregate(ent.Count()). Scan(ctx, &v)
func (*StepQuery) Only ¶
Only returns a single Step entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Step entity is not found. Returns a *NotFoundError when no Step entities are found.
func (*StepQuery) OnlyID ¶
OnlyID is like Only, but returns the only Step ID in the query. Returns a *NotSingularError when exactly one Step ID is not found. Returns a *NotFoundError when no entities are found.
func (*StepQuery) QueryRecipe ¶
func (sq *StepQuery) QueryRecipe() *RecipeQuery
QueryRecipe chains the current query on the "recipe" edge.
func (*StepQuery) Select ¶
func (sq *StepQuery) Select(fields ...string) *StepSelect
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.Step.Query(). Select(step.FieldText). Scan(ctx, &v)
func (*StepQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*StepQuery) WithRecipe ¶
func (sq *StepQuery) WithRecipe(opts ...func(*RecipeQuery)) *StepQuery
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 StepSelect ¶
type StepSelect struct { *StepQuery // contains filtered or unexported fields }
StepSelect is the builder for selecting fields of Step entities.
func (*StepSelect) Bool ¶
func (ss *StepSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*StepSelect) BoolX ¶
func (ss *StepSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*StepSelect) Bools ¶
func (ss *StepSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*StepSelect) BoolsX ¶
func (ss *StepSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*StepSelect) Float64 ¶
func (ss *StepSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*StepSelect) Float64X ¶
func (ss *StepSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*StepSelect) Float64s ¶
func (ss *StepSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*StepSelect) Float64sX ¶
func (ss *StepSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*StepSelect) Int ¶
func (ss *StepSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*StepSelect) IntX ¶
func (ss *StepSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*StepSelect) Ints ¶
func (ss *StepSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*StepSelect) IntsX ¶
func (ss *StepSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*StepSelect) Scan ¶
func (ss *StepSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*StepSelect) ScanX ¶
func (ss *StepSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*StepSelect) String ¶
func (ss *StepSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*StepSelect) StringX ¶
func (ss *StepSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type StepUpdate ¶
type StepUpdate struct {
// contains filtered or unexported fields
}
StepUpdate is the builder for updating Step entities.
func (*StepUpdate) ClearRecipe ¶
func (su *StepUpdate) ClearRecipe() *StepUpdate
ClearRecipe clears the "recipe" edge to the Recipe entity.
func (*StepUpdate) Exec ¶
func (su *StepUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*StepUpdate) ExecX ¶
func (su *StepUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StepUpdate) Mutation ¶
func (su *StepUpdate) Mutation() *StepMutation
Mutation returns the StepMutation object of the builder.
func (*StepUpdate) Save ¶
func (su *StepUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*StepUpdate) SaveX ¶
func (su *StepUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*StepUpdate) SetNillableRecipeID ¶
func (su *StepUpdate) SetNillableRecipeID(id *int) *StepUpdate
SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.
func (*StepUpdate) SetRecipe ¶
func (su *StepUpdate) SetRecipe(r *Recipe) *StepUpdate
SetRecipe sets the "recipe" edge to the Recipe entity.
func (*StepUpdate) SetRecipeID ¶
func (su *StepUpdate) SetRecipeID(id int) *StepUpdate
SetRecipeID sets the "recipe" edge to the Recipe entity by ID.
func (*StepUpdate) SetText ¶
func (su *StepUpdate) SetText(s string) *StepUpdate
SetText sets the "text" field.
func (*StepUpdate) Where ¶
func (su *StepUpdate) Where(ps ...predicate.Step) *StepUpdate
Where appends a list predicates to the StepUpdate builder.
type StepUpdateOne ¶
type StepUpdateOne struct {
// contains filtered or unexported fields
}
StepUpdateOne is the builder for updating a single Step entity.
func (*StepUpdateOne) ClearRecipe ¶
func (suo *StepUpdateOne) ClearRecipe() *StepUpdateOne
ClearRecipe clears the "recipe" edge to the Recipe entity.
func (*StepUpdateOne) Exec ¶
func (suo *StepUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*StepUpdateOne) ExecX ¶
func (suo *StepUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StepUpdateOne) Mutation ¶
func (suo *StepUpdateOne) Mutation() *StepMutation
Mutation returns the StepMutation object of the builder.
func (*StepUpdateOne) Save ¶
func (suo *StepUpdateOne) Save(ctx context.Context) (*Step, error)
Save executes the query and returns the updated Step entity.
func (*StepUpdateOne) SaveX ¶
func (suo *StepUpdateOne) SaveX(ctx context.Context) *Step
SaveX is like Save, but panics if an error occurs.
func (*StepUpdateOne) Select ¶
func (suo *StepUpdateOne) Select(field string, fields ...string) *StepUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*StepUpdateOne) SetNillableRecipeID ¶
func (suo *StepUpdateOne) SetNillableRecipeID(id *int) *StepUpdateOne
SetNillableRecipeID sets the "recipe" edge to the Recipe entity by ID if the given value is not nil.
func (*StepUpdateOne) SetRecipe ¶
func (suo *StepUpdateOne) SetRecipe(r *Recipe) *StepUpdateOne
SetRecipe sets the "recipe" edge to the Recipe entity.
func (*StepUpdateOne) SetRecipeID ¶
func (suo *StepUpdateOne) SetRecipeID(id int) *StepUpdateOne
SetRecipeID sets the "recipe" edge to the Recipe entity by ID.
func (*StepUpdateOne) SetText ¶
func (suo *StepUpdateOne) SetText(s string) *StepUpdateOne
SetText sets the "text" field.
type Tx ¶
type Tx struct { // Category is the client for interacting with the Category builders. Category *CategoryClient // Ingredient is the client for interacting with the Ingredient builders. Ingredient *IngredientClient // Recipe is the client for interacting with the Recipe builders. Recipe *RecipeClient // RecipeIngredient is the client for interacting with the RecipeIngredient builders. RecipeIngredient *RecipeIngredientClient // Step is the client for interacting with the Step builders. Step *StepClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) QueryRecipes ¶
func (u *User) QueryRecipes() *RecipeQuery
QueryRecipes queries the "recipes" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a create builder for User.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryRecipes ¶
func (c *UserClient) QueryRecipes(u *User) *RecipeQuery
QueryRecipes queries the recipes edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddRecipeIDs ¶
func (uc *UserCreate) AddRecipeIDs(ids ...int) *UserCreate
AddRecipeIDs adds the "recipes" edge to the Recipe entity by IDs.
func (*UserCreate) AddRecipes ¶
func (uc *UserCreate) AddRecipes(r ...*Recipe) *UserCreate
AddRecipes adds the "recipes" edges to the Recipe entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetName ¶
func (uc *UserCreate) SetName(s string) *UserCreate
SetName sets the "name" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserEdges ¶
type UserEdges struct { // Recipes holds the value of the recipes edge. Recipes []*Recipe `json:"recipes,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) RecipesOrErr ¶
RecipesOrErr returns the Recipes value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) BoolX ¶
func (ugb *UserGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserGroupBy) Bools ¶
func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) BoolsX ¶
func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserGroupBy) Float64 ¶
func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) Float64X ¶
func (ugb *UserGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserGroupBy) Float64s ¶
func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) Float64sX ¶
func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserGroupBy) Int ¶
func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) IntX ¶
func (ugb *UserGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserGroupBy) Ints ¶
func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) IntsX ¶
func (ugb *UserGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*UserGroupBy) ScanX ¶
func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserGroupBy) String ¶
func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) StringX ¶
func (ugb *UserGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddRecipeIDs ¶
func (m *UserMutation) AddRecipeIDs(ids ...int)
AddRecipeIDs adds the "recipes" edge to the Recipe entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearRecipes ¶
func (m *UserMutation) ClearRecipes()
ClearRecipes clears the "recipes" edge to the Recipe entity.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id 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 (*UserMutation) Name ¶
func (m *UserMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) OldName ¶
func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) RecipesCleared ¶
func (m *UserMutation) RecipesCleared() bool
RecipesCleared reports if the "recipes" edge to the Recipe entity was cleared.
func (*UserMutation) RecipesIDs ¶
func (m *UserMutation) RecipesIDs() (ids []int)
RecipesIDs returns the "recipes" edge IDs in the mutation.
func (*UserMutation) RemoveRecipeIDs ¶
func (m *UserMutation) RemoveRecipeIDs(ids ...int)
RemoveRecipeIDs removes the "recipes" edge to the Recipe entity by IDs.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) RemovedRecipesIDs ¶
func (m *UserMutation) RemovedRecipesIDs() (ids []int)
RemovedRecipes returns the removed IDs of the "recipes" edge to the Recipe entity.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetName ¶
func (m *UserMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*UserMutation) ResetRecipes ¶
func (m *UserMutation) ResetRecipes()
ResetRecipes resets all changes to the "recipes" edge.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetName ¶
func (m *UserMutation) SetName(s string)
SetName sets the "name" field.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one User entity is not found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when exactly one User ID is not found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) QueryRecipes ¶
func (uq *UserQuery) QueryRecipes() *RecipeQuery
QueryRecipes chains the current query on the "recipes" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.User.Query(). Select(user.FieldName). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithRecipes ¶
func (uq *UserQuery) WithRecipes(opts ...func(*RecipeQuery)) *UserQuery
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 UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Bool ¶
func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) BoolX ¶
func (us *UserSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserSelect) Bools ¶
func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) BoolsX ¶
func (us *UserSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserSelect) Float64 ¶
func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64X ¶
func (us *UserSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserSelect) Float64s ¶
func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64sX ¶
func (us *UserSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserSelect) Int ¶
func (us *UserSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) IntX ¶
func (us *UserSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserSelect) Ints ¶
func (us *UserSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) IntsX ¶
func (us *UserSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) ScanX ¶
func (us *UserSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserSelect) String ¶
func (us *UserSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*UserSelect) StringX ¶
func (us *UserSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddRecipeIDs ¶
func (uu *UserUpdate) AddRecipeIDs(ids ...int) *UserUpdate
AddRecipeIDs adds the "recipes" edge to the Recipe entity by IDs.
func (*UserUpdate) AddRecipes ¶
func (uu *UserUpdate) AddRecipes(r ...*Recipe) *UserUpdate
AddRecipes adds the "recipes" edges to the Recipe entity.
func (*UserUpdate) ClearRecipes ¶
func (uu *UserUpdate) ClearRecipes() *UserUpdate
ClearRecipes clears all "recipes" edges to the Recipe entity.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveRecipeIDs ¶
func (uu *UserUpdate) RemoveRecipeIDs(ids ...int) *UserUpdate
RemoveRecipeIDs removes the "recipes" edge to Recipe entities by IDs.
func (*UserUpdate) RemoveRecipes ¶
func (uu *UserUpdate) RemoveRecipes(r ...*Recipe) *UserUpdate
RemoveRecipes removes "recipes" edges to Recipe entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetName ¶
func (uu *UserUpdate) SetName(s string) *UserUpdate
SetName sets the "name" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddRecipeIDs ¶
func (uuo *UserUpdateOne) AddRecipeIDs(ids ...int) *UserUpdateOne
AddRecipeIDs adds the "recipes" edge to the Recipe entity by IDs.
func (*UserUpdateOne) AddRecipes ¶
func (uuo *UserUpdateOne) AddRecipes(r ...*Recipe) *UserUpdateOne
AddRecipes adds the "recipes" edges to the Recipe entity.
func (*UserUpdateOne) ClearRecipes ¶
func (uuo *UserUpdateOne) ClearRecipes() *UserUpdateOne
ClearRecipes clears all "recipes" edges to the Recipe entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveRecipeIDs ¶
func (uuo *UserUpdateOne) RemoveRecipeIDs(ids ...int) *UserUpdateOne
RemoveRecipeIDs removes the "recipes" edge to Recipe entities by IDs.
func (*UserUpdateOne) RemoveRecipes ¶
func (uuo *UserUpdateOne) RemoveRecipes(r ...*Recipe) *UserUpdateOne
RemoveRecipes removes "recipes" edges to Recipe entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetName ¶
func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
SetName sets the "name" field.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- category.go
- category_create.go
- category_delete.go
- category_query.go
- category_update.go
- client.go
- config.go
- context.go
- ent.go
- generate.go
- ingredient.go
- ingredient_create.go
- ingredient_delete.go
- ingredient_query.go
- ingredient_update.go
- mutation.go
- recipe.go
- recipe_create.go
- recipe_delete.go
- recipe_query.go
- recipe_update.go
- recipeingredient.go
- recipeingredient_create.go
- recipeingredient_delete.go
- recipeingredient_query.go
- recipeingredient_update.go
- runtime.go
- step.go
- step_create.go
- step_delete.go
- step_query.go
- step_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go