ent

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeDish       = "Dish"
	TypeDishAlias  = "DishAlias"
	TypeImage      = "Image"
	TypeLocation   = "Location"
	TypeOccurrence = "Occurrence"
	TypeReview     = "Review"
	TypeTag        = "Tag"
	TypeUser       = "User"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Dish is the client for interacting with the Dish builders.
	Dish *DishClient
	// DishAlias is the client for interacting with the DishAlias builders.
	DishAlias *DishAliasClient
	// Image is the client for interacting with the Image builders.
	Image *ImageClient
	// Location is the client for interacting with the Location builders.
	Location *LocationClient
	// Occurrence is the client for interacting with the Occurrence builders.
	Occurrence *OccurrenceClient
	// Review is the client for interacting with the Review builders.
	Review *ReviewClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// 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

func FromContext(ctx context.Context) *Client

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

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

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

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

func (*Client) BeginTx

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

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Debug

func (c *Client) Debug() *Client

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

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

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Dish

type Dish struct {

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

Dish is the model entity for the Dish schema.

func (*Dish) QueryAliases

func (d *Dish) QueryAliases() *DishAliasQuery

QueryAliases queries the "aliases" edge of the Dish entity.

func (*Dish) QueryDishOccurrences

func (d *Dish) QueryDishOccurrences() *OccurrenceQuery

QueryDishOccurrences queries the "dish_occurrences" edge of the Dish entity.

func (*Dish) QuerySideDishOccurrence

func (d *Dish) QuerySideDishOccurrence() *OccurrenceQuery

QuerySideDishOccurrence queries the "side_dish_occurrence" edge of the Dish entity.

func (*Dish) String

func (d *Dish) String() string

String implements the fmt.Stringer.

func (*Dish) Unwrap

func (d *Dish) Unwrap() *Dish

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

func (d *Dish) Update() *DishUpdateOne

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

func (*Dish) Value

func (d *Dish) Value(name string) (ent.Value, error)

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

type DishAlias

type DishAlias struct {

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

DishAlias is the model entity for the DishAlias schema.

func (*DishAlias) QueryDish

func (da *DishAlias) QueryDish() *DishQuery

QueryDish queries the "dish" edge of the DishAlias entity.

func (*DishAlias) String

func (da *DishAlias) String() string

String implements the fmt.Stringer.

func (*DishAlias) Unwrap

func (da *DishAlias) Unwrap() *DishAlias

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

func (da *DishAlias) Update() *DishAliasUpdateOne

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

func (*DishAlias) Value

func (da *DishAlias) Value(name string) (ent.Value, error)

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

type DishAliasClient

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

DishAliasClient is a client for the DishAlias schema.

func NewDishAliasClient

func NewDishAliasClient(c config) *DishAliasClient

NewDishAliasClient returns a client for the DishAlias from the given config.

func (*DishAliasClient) Create

func (c *DishAliasClient) Create() *DishAliasCreate

Create returns a builder for creating a DishAlias entity.

func (*DishAliasClient) CreateBulk

func (c *DishAliasClient) CreateBulk(builders ...*DishAliasCreate) *DishAliasCreateBulk

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

func (*DishAliasClient) Delete

func (c *DishAliasClient) Delete() *DishAliasDelete

Delete returns a delete builder for DishAlias.

func (*DishAliasClient) DeleteOne

func (c *DishAliasClient) DeleteOne(da *DishAlias) *DishAliasDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DishAliasClient) DeleteOneID

func (c *DishAliasClient) DeleteOneID(id string) *DishAliasDeleteOne

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

func (*DishAliasClient) Get

func (c *DishAliasClient) Get(ctx context.Context, id string) (*DishAlias, error)

Get returns a DishAlias entity by its id.

func (*DishAliasClient) GetX

func (c *DishAliasClient) GetX(ctx context.Context, id string) *DishAlias

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

func (*DishAliasClient) Hooks

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

Hooks returns the client hooks.

func (*DishAliasClient) Intercept

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

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

func (*DishAliasClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DishAliasClient) MapCreateBulk added in v0.8.3

func (c *DishAliasClient) MapCreateBulk(slice any, setFunc func(*DishAliasCreate, int)) *DishAliasCreateBulk

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

func (*DishAliasClient) Query

func (c *DishAliasClient) Query() *DishAliasQuery

Query returns a query builder for DishAlias.

func (*DishAliasClient) QueryDish

func (c *DishAliasClient) QueryDish(da *DishAlias) *DishQuery

QueryDish queries the dish edge of a DishAlias.

func (*DishAliasClient) Update

func (c *DishAliasClient) Update() *DishAliasUpdate

Update returns an update builder for DishAlias.

func (*DishAliasClient) UpdateOne

func (c *DishAliasClient) UpdateOne(da *DishAlias) *DishAliasUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DishAliasClient) UpdateOneID

func (c *DishAliasClient) UpdateOneID(id string) *DishAliasUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DishAliasClient) Use

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

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

type DishAliasCreate

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

DishAliasCreate is the builder for creating a DishAlias entity.

func (*DishAliasCreate) Exec

func (dac *DishAliasCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DishAliasCreate) ExecX

func (dac *DishAliasCreate) ExecX(ctx context.Context)

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

func (*DishAliasCreate) Mutation

func (dac *DishAliasCreate) Mutation() *DishAliasMutation

Mutation returns the DishAliasMutation object of the builder.

func (*DishAliasCreate) OnConflict

func (dac *DishAliasCreate) OnConflict(opts ...sql.ConflictOption) *DishAliasUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.DishAlias.Create().
	SetNormalizedAliasName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DishAliasUpsert) {
		SetNormalizedAliasName(v+v).
	}).
	Exec(ctx)

func (*DishAliasCreate) OnConflictColumns

func (dac *DishAliasCreate) OnConflictColumns(columns ...string) *DishAliasUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.DishAlias.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DishAliasCreate) Save

func (dac *DishAliasCreate) Save(ctx context.Context) (*DishAlias, error)

Save creates the DishAlias in the database.

func (*DishAliasCreate) SaveX

func (dac *DishAliasCreate) SaveX(ctx context.Context) *DishAlias

SaveX calls Save and panics if Save returns an error.

func (*DishAliasCreate) SetDish

func (dac *DishAliasCreate) SetDish(d *Dish) *DishAliasCreate

SetDish sets the "dish" edge to the Dish entity.

func (*DishAliasCreate) SetDishID

func (dac *DishAliasCreate) SetDishID(id uuid.UUID) *DishAliasCreate

SetDishID sets the "dish" edge to the Dish entity by ID.

func (*DishAliasCreate) SetID

func (dac *DishAliasCreate) SetID(s string) *DishAliasCreate

SetID sets the "id" field.

func (*DishAliasCreate) SetNormalizedAliasName

func (dac *DishAliasCreate) SetNormalizedAliasName(s string) *DishAliasCreate

SetNormalizedAliasName sets the "normalized_alias_name" field.

type DishAliasCreateBulk

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

DishAliasCreateBulk is the builder for creating many DishAlias entities in bulk.

func (*DishAliasCreateBulk) Exec

func (dacb *DishAliasCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DishAliasCreateBulk) ExecX

func (dacb *DishAliasCreateBulk) ExecX(ctx context.Context)

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

func (*DishAliasCreateBulk) OnConflict

func (dacb *DishAliasCreateBulk) OnConflict(opts ...sql.ConflictOption) *DishAliasUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.DishAlias.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DishAliasUpsert) {
		SetNormalizedAliasName(v+v).
	}).
	Exec(ctx)

func (*DishAliasCreateBulk) OnConflictColumns

func (dacb *DishAliasCreateBulk) OnConflictColumns(columns ...string) *DishAliasUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.DishAlias.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DishAliasCreateBulk) Save

func (dacb *DishAliasCreateBulk) Save(ctx context.Context) ([]*DishAlias, error)

Save creates the DishAlias entities in the database.

func (*DishAliasCreateBulk) SaveX

func (dacb *DishAliasCreateBulk) SaveX(ctx context.Context) []*DishAlias

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

type DishAliasDelete

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

DishAliasDelete is the builder for deleting a DishAlias entity.

func (*DishAliasDelete) Exec

func (dad *DishAliasDelete) Exec(ctx context.Context) (int, error)

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

func (*DishAliasDelete) ExecX

func (dad *DishAliasDelete) ExecX(ctx context.Context) int

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

func (*DishAliasDelete) Where

Where appends a list predicates to the DishAliasDelete builder.

type DishAliasDeleteOne

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

DishAliasDeleteOne is the builder for deleting a single DishAlias entity.

func (*DishAliasDeleteOne) Exec

func (dado *DishAliasDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DishAliasDeleteOne) ExecX

func (dado *DishAliasDeleteOne) ExecX(ctx context.Context)

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

func (*DishAliasDeleteOne) Where

Where appends a list predicates to the DishAliasDelete builder.

type DishAliasEdges

type DishAliasEdges struct {
	// Dish holds the value of the dish edge.
	Dish *Dish `json:"dish,omitempty"`
	// contains filtered or unexported fields
}

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

func (DishAliasEdges) DishOrErr

func (e DishAliasEdges) DishOrErr() (*Dish, error)

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

type DishAliasGroupBy

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

DishAliasGroupBy is the group-by builder for DishAlias entities.

func (*DishAliasGroupBy) Aggregate

func (dagb *DishAliasGroupBy) Aggregate(fns ...AggregateFunc) *DishAliasGroupBy

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

func (*DishAliasGroupBy) Bool

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

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

func (*DishAliasGroupBy) BoolX

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

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

func (*DishAliasGroupBy) Bools

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

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

func (*DishAliasGroupBy) BoolsX

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

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

func (*DishAliasGroupBy) Float64

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

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

func (*DishAliasGroupBy) Float64X

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

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

func (*DishAliasGroupBy) Float64s

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

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

func (*DishAliasGroupBy) Float64sX

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

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

func (*DishAliasGroupBy) Int

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

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

func (*DishAliasGroupBy) IntX

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

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

func (*DishAliasGroupBy) Ints

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

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

func (*DishAliasGroupBy) IntsX

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

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

func (*DishAliasGroupBy) Scan

func (dagb *DishAliasGroupBy) Scan(ctx context.Context, v any) error

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

func (*DishAliasGroupBy) ScanX

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

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

func (*DishAliasGroupBy) String

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

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

func (*DishAliasGroupBy) StringX

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

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

func (*DishAliasGroupBy) Strings

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

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

func (*DishAliasGroupBy) StringsX

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

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

type DishAliasMutation

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

DishAliasMutation represents an operation that mutates the DishAlias nodes in the graph.

func (*DishAliasMutation) AddField

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

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

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

func (*DishAliasMutation) AddedField

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

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

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

func (*DishAliasMutation) AddedIDs

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

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

func (*DishAliasMutation) ClearDish

func (m *DishAliasMutation) ClearDish()

ClearDish clears the "dish" edge to the Dish entity.

func (*DishAliasMutation) ClearEdge

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

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

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

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

func (*DishAliasMutation) ClearedFields

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

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

func (DishAliasMutation) Client

func (m DishAliasMutation) 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 (*DishAliasMutation) DishCleared

func (m *DishAliasMutation) DishCleared() bool

DishCleared reports if the "dish" edge to the Dish entity was cleared.

func (*DishAliasMutation) DishID

func (m *DishAliasMutation) DishID() (id uuid.UUID, exists bool)

DishID returns the "dish" edge ID in the mutation.

func (*DishAliasMutation) DishIDs

func (m *DishAliasMutation) DishIDs() (ids []uuid.UUID)

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

func (*DishAliasMutation) EdgeCleared

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

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

func (*DishAliasMutation) Field

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

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

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

func (*DishAliasMutation) Fields

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

func (m *DishAliasMutation) ID() (id string, 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 (*DishAliasMutation) IDs

func (m *DishAliasMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*DishAliasMutation) NormalizedAliasName

func (m *DishAliasMutation) NormalizedAliasName() (r string, exists bool)

NormalizedAliasName returns the value of the "normalized_alias_name" field in the mutation.

func (*DishAliasMutation) OldField

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

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

func (*DishAliasMutation) OldNormalizedAliasName

func (m *DishAliasMutation) OldNormalizedAliasName(ctx context.Context) (v string, err error)

OldNormalizedAliasName returns the old "normalized_alias_name" field's value of the DishAlias entity. If the DishAlias 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 (*DishAliasMutation) Op

func (m *DishAliasMutation) Op() Op

Op returns the operation name.

func (*DishAliasMutation) RemovedEdges

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

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

func (*DishAliasMutation) RemovedIDs

func (m *DishAliasMutation) 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 (*DishAliasMutation) ResetDish

func (m *DishAliasMutation) ResetDish()

ResetDish resets all changes to the "dish" edge.

func (*DishAliasMutation) ResetEdge

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

func (m *DishAliasMutation) 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 (*DishAliasMutation) ResetNormalizedAliasName

func (m *DishAliasMutation) ResetNormalizedAliasName()

ResetNormalizedAliasName resets all changes to the "normalized_alias_name" field.

func (*DishAliasMutation) SetDishID

func (m *DishAliasMutation) SetDishID(id uuid.UUID)

SetDishID sets the "dish" edge to the Dish entity by id.

func (*DishAliasMutation) SetField

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

func (m *DishAliasMutation) SetID(id string)

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

func (*DishAliasMutation) SetNormalizedAliasName

func (m *DishAliasMutation) SetNormalizedAliasName(s string)

SetNormalizedAliasName sets the "normalized_alias_name" field.

func (*DishAliasMutation) SetOp

func (m *DishAliasMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (DishAliasMutation) Tx

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

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

func (*DishAliasMutation) Type

func (m *DishAliasMutation) Type() string

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

func (*DishAliasMutation) Where

func (m *DishAliasMutation) Where(ps ...predicate.DishAlias)

Where appends a list predicates to the DishAliasMutation builder.

func (*DishAliasMutation) WhereP

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

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

type DishAliasQuery

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

DishAliasQuery is the builder for querying DishAlias entities.

func (*DishAliasQuery) Aggregate

func (daq *DishAliasQuery) Aggregate(fns ...AggregateFunc) *DishAliasSelect

Aggregate returns a DishAliasSelect configured with the given aggregations.

func (*DishAliasQuery) All

func (daq *DishAliasQuery) All(ctx context.Context) ([]*DishAlias, error)

All executes the query and returns a list of DishAliasSlice.

func (*DishAliasQuery) AllX

func (daq *DishAliasQuery) AllX(ctx context.Context) []*DishAlias

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

func (*DishAliasQuery) Clone

func (daq *DishAliasQuery) Clone() *DishAliasQuery

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

func (*DishAliasQuery) Count

func (daq *DishAliasQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DishAliasQuery) CountX

func (daq *DishAliasQuery) CountX(ctx context.Context) int

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

func (*DishAliasQuery) Exist

func (daq *DishAliasQuery) Exist(ctx context.Context) (bool, error)

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

func (*DishAliasQuery) ExistX

func (daq *DishAliasQuery) ExistX(ctx context.Context) bool

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

func (*DishAliasQuery) First

func (daq *DishAliasQuery) First(ctx context.Context) (*DishAlias, error)

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

func (*DishAliasQuery) FirstID

func (daq *DishAliasQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*DishAliasQuery) FirstIDX

func (daq *DishAliasQuery) FirstIDX(ctx context.Context) string

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

func (*DishAliasQuery) FirstX

func (daq *DishAliasQuery) FirstX(ctx context.Context) *DishAlias

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

func (*DishAliasQuery) GroupBy

func (daq *DishAliasQuery) GroupBy(field string, fields ...string) *DishAliasGroupBy

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

client.DishAlias.Query().
	GroupBy(dishalias.FieldNormalizedAliasName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DishAliasQuery) IDs

func (daq *DishAliasQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*DishAliasQuery) IDsX

func (daq *DishAliasQuery) IDsX(ctx context.Context) []string

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

func (*DishAliasQuery) Limit

func (daq *DishAliasQuery) Limit(limit int) *DishAliasQuery

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

func (*DishAliasQuery) Offset

func (daq *DishAliasQuery) Offset(offset int) *DishAliasQuery

Offset to start from.

func (*DishAliasQuery) Only

func (daq *DishAliasQuery) Only(ctx context.Context) (*DishAlias, error)

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

func (*DishAliasQuery) OnlyID

func (daq *DishAliasQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*DishAliasQuery) OnlyIDX

func (daq *DishAliasQuery) OnlyIDX(ctx context.Context) string

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

func (*DishAliasQuery) OnlyX

func (daq *DishAliasQuery) OnlyX(ctx context.Context) *DishAlias

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

func (*DishAliasQuery) Order

Order specifies how the records should be ordered.

func (*DishAliasQuery) QueryDish

func (daq *DishAliasQuery) QueryDish() *DishQuery

QueryDish chains the current query on the "dish" edge.

func (*DishAliasQuery) Select

func (daq *DishAliasQuery) Select(fields ...string) *DishAliasSelect

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

client.DishAlias.Query().
	Select(dishalias.FieldNormalizedAliasName).
	Scan(ctx, &v)

func (*DishAliasQuery) Unique

func (daq *DishAliasQuery) Unique(unique bool) *DishAliasQuery

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

func (daq *DishAliasQuery) Where(ps ...predicate.DishAlias) *DishAliasQuery

Where adds a new predicate for the DishAliasQuery builder.

func (*DishAliasQuery) WithDish

func (daq *DishAliasQuery) WithDish(opts ...func(*DishQuery)) *DishAliasQuery

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

type DishAliasSelect

type DishAliasSelect struct {
	*DishAliasQuery
	// contains filtered or unexported fields
}

DishAliasSelect is the builder for selecting fields of DishAlias entities.

func (*DishAliasSelect) Aggregate

func (das *DishAliasSelect) Aggregate(fns ...AggregateFunc) *DishAliasSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DishAliasSelect) Bool

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

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

func (*DishAliasSelect) BoolX

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

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

func (*DishAliasSelect) Bools

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

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

func (*DishAliasSelect) BoolsX

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

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

func (*DishAliasSelect) Float64

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

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

func (*DishAliasSelect) Float64X

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

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

func (*DishAliasSelect) Float64s

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

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

func (*DishAliasSelect) Float64sX

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

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

func (*DishAliasSelect) Int

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

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

func (*DishAliasSelect) IntX

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

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

func (*DishAliasSelect) Ints

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

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

func (*DishAliasSelect) IntsX

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

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

func (*DishAliasSelect) Scan

func (das *DishAliasSelect) Scan(ctx context.Context, v any) error

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

func (*DishAliasSelect) ScanX

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

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

func (*DishAliasSelect) String

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

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

func (*DishAliasSelect) StringX

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

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

func (*DishAliasSelect) Strings

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

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

func (*DishAliasSelect) StringsX

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

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

type DishAliasSlice

type DishAliasSlice []*DishAlias

DishAliasSlice is a parsable slice of DishAlias.

type DishAliasUpdate

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

DishAliasUpdate is the builder for updating DishAlias entities.

func (*DishAliasUpdate) ClearDish

func (dau *DishAliasUpdate) ClearDish() *DishAliasUpdate

ClearDish clears the "dish" edge to the Dish entity.

func (*DishAliasUpdate) Exec

func (dau *DishAliasUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DishAliasUpdate) ExecX

func (dau *DishAliasUpdate) ExecX(ctx context.Context)

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

func (*DishAliasUpdate) Mutation

func (dau *DishAliasUpdate) Mutation() *DishAliasMutation

Mutation returns the DishAliasMutation object of the builder.

func (*DishAliasUpdate) Save

func (dau *DishAliasUpdate) Save(ctx context.Context) (int, error)

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

func (*DishAliasUpdate) SaveX

func (dau *DishAliasUpdate) SaveX(ctx context.Context) int

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

func (*DishAliasUpdate) SetDish

func (dau *DishAliasUpdate) SetDish(d *Dish) *DishAliasUpdate

SetDish sets the "dish" edge to the Dish entity.

func (*DishAliasUpdate) SetDishID

func (dau *DishAliasUpdate) SetDishID(id uuid.UUID) *DishAliasUpdate

SetDishID sets the "dish" edge to the Dish entity by ID.

func (*DishAliasUpdate) SetNillableNormalizedAliasName added in v0.8.3

func (dau *DishAliasUpdate) SetNillableNormalizedAliasName(s *string) *DishAliasUpdate

SetNillableNormalizedAliasName sets the "normalized_alias_name" field if the given value is not nil.

func (*DishAliasUpdate) SetNormalizedAliasName

func (dau *DishAliasUpdate) SetNormalizedAliasName(s string) *DishAliasUpdate

SetNormalizedAliasName sets the "normalized_alias_name" field.

func (*DishAliasUpdate) Where

Where appends a list predicates to the DishAliasUpdate builder.

type DishAliasUpdateOne

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

DishAliasUpdateOne is the builder for updating a single DishAlias entity.

func (*DishAliasUpdateOne) ClearDish

func (dauo *DishAliasUpdateOne) ClearDish() *DishAliasUpdateOne

ClearDish clears the "dish" edge to the Dish entity.

func (*DishAliasUpdateOne) Exec

func (dauo *DishAliasUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DishAliasUpdateOne) ExecX

func (dauo *DishAliasUpdateOne) ExecX(ctx context.Context)

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

func (*DishAliasUpdateOne) Mutation

func (dauo *DishAliasUpdateOne) Mutation() *DishAliasMutation

Mutation returns the DishAliasMutation object of the builder.

func (*DishAliasUpdateOne) Save

func (dauo *DishAliasUpdateOne) Save(ctx context.Context) (*DishAlias, error)

Save executes the query and returns the updated DishAlias entity.

func (*DishAliasUpdateOne) SaveX

func (dauo *DishAliasUpdateOne) SaveX(ctx context.Context) *DishAlias

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

func (*DishAliasUpdateOne) Select

func (dauo *DishAliasUpdateOne) Select(field string, fields ...string) *DishAliasUpdateOne

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

func (*DishAliasUpdateOne) SetDish

func (dauo *DishAliasUpdateOne) SetDish(d *Dish) *DishAliasUpdateOne

SetDish sets the "dish" edge to the Dish entity.

func (*DishAliasUpdateOne) SetDishID

func (dauo *DishAliasUpdateOne) SetDishID(id uuid.UUID) *DishAliasUpdateOne

SetDishID sets the "dish" edge to the Dish entity by ID.

func (*DishAliasUpdateOne) SetNillableNormalizedAliasName added in v0.8.3

func (dauo *DishAliasUpdateOne) SetNillableNormalizedAliasName(s *string) *DishAliasUpdateOne

SetNillableNormalizedAliasName sets the "normalized_alias_name" field if the given value is not nil.

func (*DishAliasUpdateOne) SetNormalizedAliasName

func (dauo *DishAliasUpdateOne) SetNormalizedAliasName(s string) *DishAliasUpdateOne

SetNormalizedAliasName sets the "normalized_alias_name" field.

func (*DishAliasUpdateOne) Where

Where appends a list predicates to the DishAliasUpdate builder.

type DishAliasUpsert

type DishAliasUpsert struct {
	*sql.UpdateSet
}

DishAliasUpsert is the "OnConflict" setter.

func (*DishAliasUpsert) SetNormalizedAliasName

func (u *DishAliasUpsert) SetNormalizedAliasName(v string) *DishAliasUpsert

SetNormalizedAliasName sets the "normalized_alias_name" field.

func (*DishAliasUpsert) UpdateNormalizedAliasName

func (u *DishAliasUpsert) UpdateNormalizedAliasName() *DishAliasUpsert

UpdateNormalizedAliasName sets the "normalized_alias_name" field to the value that was provided on create.

type DishAliasUpsertBulk

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

DishAliasUpsertBulk is the builder for "upsert"-ing a bulk of DishAlias nodes.

func (*DishAliasUpsertBulk) DoNothing

func (u *DishAliasUpsertBulk) DoNothing() *DishAliasUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DishAliasUpsertBulk) Exec

Exec executes the query.

func (*DishAliasUpsertBulk) ExecX

func (u *DishAliasUpsertBulk) ExecX(ctx context.Context)

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

func (*DishAliasUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.DishAlias.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*DishAliasUpsertBulk) SetNormalizedAliasName

func (u *DishAliasUpsertBulk) SetNormalizedAliasName(v string) *DishAliasUpsertBulk

SetNormalizedAliasName sets the "normalized_alias_name" field.

func (*DishAliasUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the DishAliasCreateBulk.OnConflict documentation for more info.

func (*DishAliasUpsertBulk) UpdateNewValues

func (u *DishAliasUpsertBulk) UpdateNewValues() *DishAliasUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.DishAlias.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(dishalias.FieldID)
		}),
	).
	Exec(ctx)

func (*DishAliasUpsertBulk) UpdateNormalizedAliasName

func (u *DishAliasUpsertBulk) UpdateNormalizedAliasName() *DishAliasUpsertBulk

UpdateNormalizedAliasName sets the "normalized_alias_name" field to the value that was provided on create.

type DishAliasUpsertOne

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

DishAliasUpsertOne is the builder for "upsert"-ing

one DishAlias node.

func (*DishAliasUpsertOne) DoNothing

func (u *DishAliasUpsertOne) DoNothing() *DishAliasUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DishAliasUpsertOne) Exec

func (u *DishAliasUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*DishAliasUpsertOne) ExecX

func (u *DishAliasUpsertOne) ExecX(ctx context.Context)

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

func (*DishAliasUpsertOne) ID

func (u *DishAliasUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*DishAliasUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*DishAliasUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.DishAlias.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*DishAliasUpsertOne) SetNormalizedAliasName

func (u *DishAliasUpsertOne) SetNormalizedAliasName(v string) *DishAliasUpsertOne

SetNormalizedAliasName sets the "normalized_alias_name" field.

func (*DishAliasUpsertOne) Update

func (u *DishAliasUpsertOne) Update(set func(*DishAliasUpsert)) *DishAliasUpsertOne

Update allows overriding fields `UPDATE` values. See the DishAliasCreate.OnConflict documentation for more info.

func (*DishAliasUpsertOne) UpdateNewValues

func (u *DishAliasUpsertOne) UpdateNewValues() *DishAliasUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.DishAlias.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(dishalias.FieldID)
		}),
	).
	Exec(ctx)

func (*DishAliasUpsertOne) UpdateNormalizedAliasName

func (u *DishAliasUpsertOne) UpdateNormalizedAliasName() *DishAliasUpsertOne

UpdateNormalizedAliasName sets the "normalized_alias_name" field to the value that was provided on create.

type DishClient

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

DishClient is a client for the Dish schema.

func NewDishClient

func NewDishClient(c config) *DishClient

NewDishClient returns a client for the Dish from the given config.

func (*DishClient) Create

func (c *DishClient) Create() *DishCreate

Create returns a builder for creating a Dish entity.

func (*DishClient) CreateBulk

func (c *DishClient) CreateBulk(builders ...*DishCreate) *DishCreateBulk

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

func (*DishClient) Delete

func (c *DishClient) Delete() *DishDelete

Delete returns a delete builder for Dish.

func (*DishClient) DeleteOne

func (c *DishClient) DeleteOne(d *Dish) *DishDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DishClient) DeleteOneID

func (c *DishClient) DeleteOneID(id uuid.UUID) *DishDeleteOne

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

func (*DishClient) Get

func (c *DishClient) Get(ctx context.Context, id uuid.UUID) (*Dish, error)

Get returns a Dish entity by its id.

func (*DishClient) GetX

func (c *DishClient) GetX(ctx context.Context, id uuid.UUID) *Dish

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

func (*DishClient) Hooks

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

Hooks returns the client hooks.

func (*DishClient) Intercept

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

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

func (*DishClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DishClient) MapCreateBulk added in v0.8.3

func (c *DishClient) MapCreateBulk(slice any, setFunc func(*DishCreate, int)) *DishCreateBulk

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

func (*DishClient) Query

func (c *DishClient) Query() *DishQuery

Query returns a query builder for Dish.

func (*DishClient) QueryAliases

func (c *DishClient) QueryAliases(d *Dish) *DishAliasQuery

QueryAliases queries the aliases edge of a Dish.

func (*DishClient) QueryDishOccurrences

func (c *DishClient) QueryDishOccurrences(d *Dish) *OccurrenceQuery

QueryDishOccurrences queries the dish_occurrences edge of a Dish.

func (*DishClient) QuerySideDishOccurrence

func (c *DishClient) QuerySideDishOccurrence(d *Dish) *OccurrenceQuery

QuerySideDishOccurrence queries the side_dish_occurrence edge of a Dish.

func (*DishClient) Update

func (c *DishClient) Update() *DishUpdate

Update returns an update builder for Dish.

func (*DishClient) UpdateOne

func (c *DishClient) UpdateOne(d *Dish) *DishUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DishClient) UpdateOneID

func (c *DishClient) UpdateOneID(id uuid.UUID) *DishUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DishClient) Use

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

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

type DishCreate

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

DishCreate is the builder for creating a Dish entity.

func (*DishCreate) AddAliasIDs

func (dc *DishCreate) AddAliasIDs(ids ...string) *DishCreate

AddAliasIDs adds the "aliases" edge to the DishAlias entity by IDs.

func (*DishCreate) AddAliases

func (dc *DishCreate) AddAliases(d ...*DishAlias) *DishCreate

AddAliases adds the "aliases" edges to the DishAlias entity.

func (*DishCreate) AddDishOccurrenceIDs

func (dc *DishCreate) AddDishOccurrenceIDs(ids ...uuid.UUID) *DishCreate

AddDishOccurrenceIDs adds the "dish_occurrences" edge to the Occurrence entity by IDs.

func (*DishCreate) AddDishOccurrences

func (dc *DishCreate) AddDishOccurrences(o ...*Occurrence) *DishCreate

AddDishOccurrences adds the "dish_occurrences" edges to the Occurrence entity.

func (*DishCreate) AddSideDishOccurrence

func (dc *DishCreate) AddSideDishOccurrence(o ...*Occurrence) *DishCreate

AddSideDishOccurrence adds the "side_dish_occurrence" edges to the Occurrence entity.

func (*DishCreate) AddSideDishOccurrenceIDs

func (dc *DishCreate) AddSideDishOccurrenceIDs(ids ...uuid.UUID) *DishCreate

AddSideDishOccurrenceIDs adds the "side_dish_occurrence" edge to the Occurrence entity by IDs.

func (*DishCreate) Exec

func (dc *DishCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DishCreate) ExecX

func (dc *DishCreate) ExecX(ctx context.Context)

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

func (*DishCreate) Mutation

func (dc *DishCreate) Mutation() *DishMutation

Mutation returns the DishMutation object of the builder.

func (*DishCreate) OnConflict

func (dc *DishCreate) OnConflict(opts ...sql.ConflictOption) *DishUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Dish.Create().
	SetNameDe(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DishUpsert) {
		SetNameDe(v+v).
	}).
	Exec(ctx)

func (*DishCreate) OnConflictColumns

func (dc *DishCreate) OnConflictColumns(columns ...string) *DishUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Dish.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DishCreate) Save

func (dc *DishCreate) Save(ctx context.Context) (*Dish, error)

Save creates the Dish in the database.

func (*DishCreate) SaveX

func (dc *DishCreate) SaveX(ctx context.Context) *Dish

SaveX calls Save and panics if Save returns an error.

func (*DishCreate) SetID

func (dc *DishCreate) SetID(u uuid.UUID) *DishCreate

SetID sets the "id" field.

func (*DishCreate) SetNameDe

func (dc *DishCreate) SetNameDe(s string) *DishCreate

SetNameDe sets the "name_de" field.

func (*DishCreate) SetNameEn

func (dc *DishCreate) SetNameEn(s string) *DishCreate

SetNameEn sets the "name_en" field.

func (*DishCreate) SetNillableID

func (dc *DishCreate) SetNillableID(u *uuid.UUID) *DishCreate

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

func (*DishCreate) SetNillableNameEn

func (dc *DishCreate) SetNillableNameEn(s *string) *DishCreate

SetNillableNameEn sets the "name_en" field if the given value is not nil.

type DishCreateBulk

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

DishCreateBulk is the builder for creating many Dish entities in bulk.

func (*DishCreateBulk) Exec

func (dcb *DishCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DishCreateBulk) ExecX

func (dcb *DishCreateBulk) ExecX(ctx context.Context)

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

func (*DishCreateBulk) OnConflict

func (dcb *DishCreateBulk) OnConflict(opts ...sql.ConflictOption) *DishUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Dish.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DishUpsert) {
		SetNameDe(v+v).
	}).
	Exec(ctx)

func (*DishCreateBulk) OnConflictColumns

func (dcb *DishCreateBulk) OnConflictColumns(columns ...string) *DishUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Dish.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DishCreateBulk) Save

func (dcb *DishCreateBulk) Save(ctx context.Context) ([]*Dish, error)

Save creates the Dish entities in the database.

func (*DishCreateBulk) SaveX

func (dcb *DishCreateBulk) SaveX(ctx context.Context) []*Dish

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

type DishDelete

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

DishDelete is the builder for deleting a Dish entity.

func (*DishDelete) Exec

func (dd *DishDelete) Exec(ctx context.Context) (int, error)

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

func (*DishDelete) ExecX

func (dd *DishDelete) ExecX(ctx context.Context) int

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

func (*DishDelete) Where

func (dd *DishDelete) Where(ps ...predicate.Dish) *DishDelete

Where appends a list predicates to the DishDelete builder.

type DishDeleteOne

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

DishDeleteOne is the builder for deleting a single Dish entity.

func (*DishDeleteOne) Exec

func (ddo *DishDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DishDeleteOne) ExecX

func (ddo *DishDeleteOne) ExecX(ctx context.Context)

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

func (*DishDeleteOne) Where

func (ddo *DishDeleteOne) Where(ps ...predicate.Dish) *DishDeleteOne

Where appends a list predicates to the DishDelete builder.

type DishEdges

type DishEdges struct {
	// DishOccurrences holds the value of the dish_occurrences edge.
	DishOccurrences []*Occurrence `json:"dish_occurrences,omitempty"`
	// Aliases holds the value of the aliases edge.
	Aliases []*DishAlias `json:"aliases,omitempty"`
	// SideDishOccurrence holds the value of the side_dish_occurrence edge.
	SideDishOccurrence []*Occurrence `json:"side_dish_occurrence,omitempty"`
	// contains filtered or unexported fields
}

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

func (DishEdges) AliasesOrErr

func (e DishEdges) AliasesOrErr() ([]*DishAlias, error)

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

func (DishEdges) DishOccurrencesOrErr

func (e DishEdges) DishOccurrencesOrErr() ([]*Occurrence, error)

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

func (DishEdges) SideDishOccurrenceOrErr

func (e DishEdges) SideDishOccurrenceOrErr() ([]*Occurrence, error)

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

type DishGroupBy

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

DishGroupBy is the group-by builder for Dish entities.

func (*DishGroupBy) Aggregate

func (dgb *DishGroupBy) Aggregate(fns ...AggregateFunc) *DishGroupBy

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

func (*DishGroupBy) Bool

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

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

func (*DishGroupBy) BoolX

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

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

func (*DishGroupBy) Bools

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

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

func (*DishGroupBy) BoolsX

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

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

func (*DishGroupBy) Float64

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

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

func (*DishGroupBy) Float64X

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

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

func (*DishGroupBy) Float64s

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

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

func (*DishGroupBy) Float64sX

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

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

func (*DishGroupBy) Int

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

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

func (*DishGroupBy) IntX

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

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

func (*DishGroupBy) Ints

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

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

func (*DishGroupBy) IntsX

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

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

func (*DishGroupBy) Scan

func (dgb *DishGroupBy) Scan(ctx context.Context, v any) error

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

func (*DishGroupBy) ScanX

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

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

func (*DishGroupBy) String

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

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

func (*DishGroupBy) StringX

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

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

func (*DishGroupBy) Strings

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

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

func (*DishGroupBy) StringsX

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

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

type DishMutation

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

DishMutation represents an operation that mutates the Dish nodes in the graph.

func (*DishMutation) AddAliasIDs

func (m *DishMutation) AddAliasIDs(ids ...string)

AddAliasIDs adds the "aliases" edge to the DishAlias entity by ids.

func (*DishMutation) AddDishOccurrenceIDs

func (m *DishMutation) AddDishOccurrenceIDs(ids ...uuid.UUID)

AddDishOccurrenceIDs adds the "dish_occurrences" edge to the Occurrence entity by ids.

func (*DishMutation) AddField

func (m *DishMutation) 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 (*DishMutation) AddSideDishOccurrenceIDs

func (m *DishMutation) AddSideDishOccurrenceIDs(ids ...uuid.UUID)

AddSideDishOccurrenceIDs adds the "side_dish_occurrence" edge to the Occurrence entity by ids.

func (*DishMutation) AddedEdges

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

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

func (*DishMutation) AddedField

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

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

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

func (*DishMutation) AddedIDs

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

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

func (*DishMutation) AliasesCleared

func (m *DishMutation) AliasesCleared() bool

AliasesCleared reports if the "aliases" edge to the DishAlias entity was cleared.

func (*DishMutation) AliasesIDs

func (m *DishMutation) AliasesIDs() (ids []string)

AliasesIDs returns the "aliases" edge IDs in the mutation.

func (*DishMutation) ClearAliases

func (m *DishMutation) ClearAliases()

ClearAliases clears the "aliases" edge to the DishAlias entity.

func (*DishMutation) ClearDishOccurrences

func (m *DishMutation) ClearDishOccurrences()

ClearDishOccurrences clears the "dish_occurrences" edge to the Occurrence entity.

func (*DishMutation) ClearEdge

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

func (m *DishMutation) 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 (*DishMutation) ClearNameEn

func (m *DishMutation) ClearNameEn()

ClearNameEn clears the value of the "name_en" field.

func (*DishMutation) ClearSideDishOccurrence

func (m *DishMutation) ClearSideDishOccurrence()

ClearSideDishOccurrence clears the "side_dish_occurrence" edge to the Occurrence entity.

func (*DishMutation) ClearedEdges

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

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

func (*DishMutation) ClearedFields

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

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

func (DishMutation) Client

func (m DishMutation) 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 (*DishMutation) DishOccurrencesCleared

func (m *DishMutation) DishOccurrencesCleared() bool

DishOccurrencesCleared reports if the "dish_occurrences" edge to the Occurrence entity was cleared.

func (*DishMutation) DishOccurrencesIDs

func (m *DishMutation) DishOccurrencesIDs() (ids []uuid.UUID)

DishOccurrencesIDs returns the "dish_occurrences" edge IDs in the mutation.

func (*DishMutation) EdgeCleared

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

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

func (*DishMutation) Field

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

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

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

func (*DishMutation) Fields

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

func (m *DishMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*DishMutation) IDs

func (m *DishMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*DishMutation) NameDe

func (m *DishMutation) NameDe() (r string, exists bool)

NameDe returns the value of the "name_de" field in the mutation.

func (*DishMutation) NameEn

func (m *DishMutation) NameEn() (r string, exists bool)

NameEn returns the value of the "name_en" field in the mutation.

func (*DishMutation) NameEnCleared

func (m *DishMutation) NameEnCleared() bool

NameEnCleared returns if the "name_en" field was cleared in this mutation.

func (*DishMutation) OldField

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

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

func (*DishMutation) OldNameDe

func (m *DishMutation) OldNameDe(ctx context.Context) (v string, err error)

OldNameDe returns the old "name_de" field's value of the Dish entity. If the Dish 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 (*DishMutation) OldNameEn

func (m *DishMutation) OldNameEn(ctx context.Context) (v *string, err error)

OldNameEn returns the old "name_en" field's value of the Dish entity. If the Dish 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 (*DishMutation) Op

func (m *DishMutation) Op() Op

Op returns the operation name.

func (*DishMutation) RemoveAliasIDs

func (m *DishMutation) RemoveAliasIDs(ids ...string)

RemoveAliasIDs removes the "aliases" edge to the DishAlias entity by IDs.

func (*DishMutation) RemoveDishOccurrenceIDs

func (m *DishMutation) RemoveDishOccurrenceIDs(ids ...uuid.UUID)

RemoveDishOccurrenceIDs removes the "dish_occurrences" edge to the Occurrence entity by IDs.

func (*DishMutation) RemoveSideDishOccurrenceIDs

func (m *DishMutation) RemoveSideDishOccurrenceIDs(ids ...uuid.UUID)

RemoveSideDishOccurrenceIDs removes the "side_dish_occurrence" edge to the Occurrence entity by IDs.

func (*DishMutation) RemovedAliasesIDs

func (m *DishMutation) RemovedAliasesIDs() (ids []string)

RemovedAliases returns the removed IDs of the "aliases" edge to the DishAlias entity.

func (*DishMutation) RemovedDishOccurrencesIDs

func (m *DishMutation) RemovedDishOccurrencesIDs() (ids []uuid.UUID)

RemovedDishOccurrences returns the removed IDs of the "dish_occurrences" edge to the Occurrence entity.

func (*DishMutation) RemovedEdges

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

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

func (*DishMutation) RemovedIDs

func (m *DishMutation) 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 (*DishMutation) RemovedSideDishOccurrenceIDs

func (m *DishMutation) RemovedSideDishOccurrenceIDs() (ids []uuid.UUID)

RemovedSideDishOccurrence returns the removed IDs of the "side_dish_occurrence" edge to the Occurrence entity.

func (*DishMutation) ResetAliases

func (m *DishMutation) ResetAliases()

ResetAliases resets all changes to the "aliases" edge.

func (*DishMutation) ResetDishOccurrences

func (m *DishMutation) ResetDishOccurrences()

ResetDishOccurrences resets all changes to the "dish_occurrences" edge.

func (*DishMutation) ResetEdge

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

func (m *DishMutation) 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 (*DishMutation) ResetNameDe

func (m *DishMutation) ResetNameDe()

ResetNameDe resets all changes to the "name_de" field.

func (*DishMutation) ResetNameEn

func (m *DishMutation) ResetNameEn()

ResetNameEn resets all changes to the "name_en" field.

func (*DishMutation) ResetSideDishOccurrence

func (m *DishMutation) ResetSideDishOccurrence()

ResetSideDishOccurrence resets all changes to the "side_dish_occurrence" edge.

func (*DishMutation) SetField

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

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

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

func (*DishMutation) SetNameDe

func (m *DishMutation) SetNameDe(s string)

SetNameDe sets the "name_de" field.

func (*DishMutation) SetNameEn

func (m *DishMutation) SetNameEn(s string)

SetNameEn sets the "name_en" field.

func (*DishMutation) SetOp

func (m *DishMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DishMutation) SideDishOccurrenceCleared

func (m *DishMutation) SideDishOccurrenceCleared() bool

SideDishOccurrenceCleared reports if the "side_dish_occurrence" edge to the Occurrence entity was cleared.

func (*DishMutation) SideDishOccurrenceIDs

func (m *DishMutation) SideDishOccurrenceIDs() (ids []uuid.UUID)

SideDishOccurrenceIDs returns the "side_dish_occurrence" edge IDs in the mutation.

func (DishMutation) Tx

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

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

func (*DishMutation) Type

func (m *DishMutation) Type() string

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

func (*DishMutation) Where

func (m *DishMutation) Where(ps ...predicate.Dish)

Where appends a list predicates to the DishMutation builder.

func (*DishMutation) WhereP

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

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

type DishQuery

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

DishQuery is the builder for querying Dish entities.

func (*DishQuery) Aggregate

func (dq *DishQuery) Aggregate(fns ...AggregateFunc) *DishSelect

Aggregate returns a DishSelect configured with the given aggregations.

func (*DishQuery) All

func (dq *DishQuery) All(ctx context.Context) ([]*Dish, error)

All executes the query and returns a list of Dishes.

func (*DishQuery) AllX

func (dq *DishQuery) AllX(ctx context.Context) []*Dish

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

func (*DishQuery) Clone

func (dq *DishQuery) Clone() *DishQuery

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

func (*DishQuery) Count

func (dq *DishQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DishQuery) CountX

func (dq *DishQuery) CountX(ctx context.Context) int

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

func (*DishQuery) Exist

func (dq *DishQuery) Exist(ctx context.Context) (bool, error)

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

func (*DishQuery) ExistX

func (dq *DishQuery) ExistX(ctx context.Context) bool

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

func (*DishQuery) First

func (dq *DishQuery) First(ctx context.Context) (*Dish, error)

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

func (*DishQuery) FirstID

func (dq *DishQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*DishQuery) FirstIDX

func (dq *DishQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*DishQuery) FirstX

func (dq *DishQuery) FirstX(ctx context.Context) *Dish

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

func (*DishQuery) GroupBy

func (dq *DishQuery) GroupBy(field string, fields ...string) *DishGroupBy

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

client.Dish.Query().
	GroupBy(dish.FieldNameDe).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DishQuery) IDs

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

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

func (*DishQuery) IDsX

func (dq *DishQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*DishQuery) Limit

func (dq *DishQuery) Limit(limit int) *DishQuery

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

func (*DishQuery) Offset

func (dq *DishQuery) Offset(offset int) *DishQuery

Offset to start from.

func (*DishQuery) Only

func (dq *DishQuery) Only(ctx context.Context) (*Dish, error)

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

func (*DishQuery) OnlyID

func (dq *DishQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*DishQuery) OnlyIDX

func (dq *DishQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*DishQuery) OnlyX

func (dq *DishQuery) OnlyX(ctx context.Context) *Dish

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

func (*DishQuery) Order

func (dq *DishQuery) Order(o ...dish.OrderOption) *DishQuery

Order specifies how the records should be ordered.

func (*DishQuery) QueryAliases

func (dq *DishQuery) QueryAliases() *DishAliasQuery

QueryAliases chains the current query on the "aliases" edge.

func (*DishQuery) QueryDishOccurrences

func (dq *DishQuery) QueryDishOccurrences() *OccurrenceQuery

QueryDishOccurrences chains the current query on the "dish_occurrences" edge.

func (*DishQuery) QuerySideDishOccurrence

func (dq *DishQuery) QuerySideDishOccurrence() *OccurrenceQuery

QuerySideDishOccurrence chains the current query on the "side_dish_occurrence" edge.

func (*DishQuery) Select

func (dq *DishQuery) Select(fields ...string) *DishSelect

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

client.Dish.Query().
	Select(dish.FieldNameDe).
	Scan(ctx, &v)

func (*DishQuery) Unique

func (dq *DishQuery) Unique(unique bool) *DishQuery

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

func (dq *DishQuery) Where(ps ...predicate.Dish) *DishQuery

Where adds a new predicate for the DishQuery builder.

func (*DishQuery) WithAliases

func (dq *DishQuery) WithAliases(opts ...func(*DishAliasQuery)) *DishQuery

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

func (*DishQuery) WithDishOccurrences

func (dq *DishQuery) WithDishOccurrences(opts ...func(*OccurrenceQuery)) *DishQuery

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

func (*DishQuery) WithSideDishOccurrence

func (dq *DishQuery) WithSideDishOccurrence(opts ...func(*OccurrenceQuery)) *DishQuery

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

type DishSelect

type DishSelect struct {
	*DishQuery
	// contains filtered or unexported fields
}

DishSelect is the builder for selecting fields of Dish entities.

func (*DishSelect) Aggregate

func (ds *DishSelect) Aggregate(fns ...AggregateFunc) *DishSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DishSelect) Bool

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

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

func (*DishSelect) BoolX

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

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

func (*DishSelect) Bools

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

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

func (*DishSelect) BoolsX

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

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

func (*DishSelect) Float64

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

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

func (*DishSelect) Float64X

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

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

func (*DishSelect) Float64s

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

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

func (*DishSelect) Float64sX

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

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

func (*DishSelect) Int

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

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

func (*DishSelect) IntX

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

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

func (*DishSelect) Ints

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

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

func (*DishSelect) IntsX

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

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

func (*DishSelect) Scan

func (ds *DishSelect) Scan(ctx context.Context, v any) error

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

func (*DishSelect) ScanX

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

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

func (*DishSelect) String

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

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

func (*DishSelect) StringX

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

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

func (*DishSelect) Strings

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

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

func (*DishSelect) StringsX

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

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

type DishUpdate

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

DishUpdate is the builder for updating Dish entities.

func (*DishUpdate) AddAliasIDs

func (du *DishUpdate) AddAliasIDs(ids ...string) *DishUpdate

AddAliasIDs adds the "aliases" edge to the DishAlias entity by IDs.

func (*DishUpdate) AddAliases

func (du *DishUpdate) AddAliases(d ...*DishAlias) *DishUpdate

AddAliases adds the "aliases" edges to the DishAlias entity.

func (*DishUpdate) AddDishOccurrenceIDs

func (du *DishUpdate) AddDishOccurrenceIDs(ids ...uuid.UUID) *DishUpdate

AddDishOccurrenceIDs adds the "dish_occurrences" edge to the Occurrence entity by IDs.

func (*DishUpdate) AddDishOccurrences

func (du *DishUpdate) AddDishOccurrences(o ...*Occurrence) *DishUpdate

AddDishOccurrences adds the "dish_occurrences" edges to the Occurrence entity.

func (*DishUpdate) AddSideDishOccurrence

func (du *DishUpdate) AddSideDishOccurrence(o ...*Occurrence) *DishUpdate

AddSideDishOccurrence adds the "side_dish_occurrence" edges to the Occurrence entity.

func (*DishUpdate) AddSideDishOccurrenceIDs

func (du *DishUpdate) AddSideDishOccurrenceIDs(ids ...uuid.UUID) *DishUpdate

AddSideDishOccurrenceIDs adds the "side_dish_occurrence" edge to the Occurrence entity by IDs.

func (*DishUpdate) ClearAliases

func (du *DishUpdate) ClearAliases() *DishUpdate

ClearAliases clears all "aliases" edges to the DishAlias entity.

func (*DishUpdate) ClearDishOccurrences

func (du *DishUpdate) ClearDishOccurrences() *DishUpdate

ClearDishOccurrences clears all "dish_occurrences" edges to the Occurrence entity.

func (*DishUpdate) ClearNameEn

func (du *DishUpdate) ClearNameEn() *DishUpdate

ClearNameEn clears the value of the "name_en" field.

func (*DishUpdate) ClearSideDishOccurrence

func (du *DishUpdate) ClearSideDishOccurrence() *DishUpdate

ClearSideDishOccurrence clears all "side_dish_occurrence" edges to the Occurrence entity.

func (*DishUpdate) Exec

func (du *DishUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DishUpdate) ExecX

func (du *DishUpdate) ExecX(ctx context.Context)

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

func (*DishUpdate) Mutation

func (du *DishUpdate) Mutation() *DishMutation

Mutation returns the DishMutation object of the builder.

func (*DishUpdate) RemoveAliasIDs

func (du *DishUpdate) RemoveAliasIDs(ids ...string) *DishUpdate

RemoveAliasIDs removes the "aliases" edge to DishAlias entities by IDs.

func (*DishUpdate) RemoveAliases

func (du *DishUpdate) RemoveAliases(d ...*DishAlias) *DishUpdate

RemoveAliases removes "aliases" edges to DishAlias entities.

func (*DishUpdate) RemoveDishOccurrenceIDs

func (du *DishUpdate) RemoveDishOccurrenceIDs(ids ...uuid.UUID) *DishUpdate

RemoveDishOccurrenceIDs removes the "dish_occurrences" edge to Occurrence entities by IDs.

func (*DishUpdate) RemoveDishOccurrences

func (du *DishUpdate) RemoveDishOccurrences(o ...*Occurrence) *DishUpdate

RemoveDishOccurrences removes "dish_occurrences" edges to Occurrence entities.

func (*DishUpdate) RemoveSideDishOccurrence

func (du *DishUpdate) RemoveSideDishOccurrence(o ...*Occurrence) *DishUpdate

RemoveSideDishOccurrence removes "side_dish_occurrence" edges to Occurrence entities.

func (*DishUpdate) RemoveSideDishOccurrenceIDs

func (du *DishUpdate) RemoveSideDishOccurrenceIDs(ids ...uuid.UUID) *DishUpdate

RemoveSideDishOccurrenceIDs removes the "side_dish_occurrence" edge to Occurrence entities by IDs.

func (*DishUpdate) Save

func (du *DishUpdate) Save(ctx context.Context) (int, error)

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

func (*DishUpdate) SaveX

func (du *DishUpdate) SaveX(ctx context.Context) int

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

func (*DishUpdate) SetNameDe

func (du *DishUpdate) SetNameDe(s string) *DishUpdate

SetNameDe sets the "name_de" field.

func (*DishUpdate) SetNameEn

func (du *DishUpdate) SetNameEn(s string) *DishUpdate

SetNameEn sets the "name_en" field.

func (*DishUpdate) SetNillableNameDe added in v0.8.3

func (du *DishUpdate) SetNillableNameDe(s *string) *DishUpdate

SetNillableNameDe sets the "name_de" field if the given value is not nil.

func (*DishUpdate) SetNillableNameEn

func (du *DishUpdate) SetNillableNameEn(s *string) *DishUpdate

SetNillableNameEn sets the "name_en" field if the given value is not nil.

func (*DishUpdate) Where

func (du *DishUpdate) Where(ps ...predicate.Dish) *DishUpdate

Where appends a list predicates to the DishUpdate builder.

type DishUpdateOne

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

DishUpdateOne is the builder for updating a single Dish entity.

func (*DishUpdateOne) AddAliasIDs

func (duo *DishUpdateOne) AddAliasIDs(ids ...string) *DishUpdateOne

AddAliasIDs adds the "aliases" edge to the DishAlias entity by IDs.

func (*DishUpdateOne) AddAliases

func (duo *DishUpdateOne) AddAliases(d ...*DishAlias) *DishUpdateOne

AddAliases adds the "aliases" edges to the DishAlias entity.

func (*DishUpdateOne) AddDishOccurrenceIDs

func (duo *DishUpdateOne) AddDishOccurrenceIDs(ids ...uuid.UUID) *DishUpdateOne

AddDishOccurrenceIDs adds the "dish_occurrences" edge to the Occurrence entity by IDs.

func (*DishUpdateOne) AddDishOccurrences

func (duo *DishUpdateOne) AddDishOccurrences(o ...*Occurrence) *DishUpdateOne

AddDishOccurrences adds the "dish_occurrences" edges to the Occurrence entity.

func (*DishUpdateOne) AddSideDishOccurrence

func (duo *DishUpdateOne) AddSideDishOccurrence(o ...*Occurrence) *DishUpdateOne

AddSideDishOccurrence adds the "side_dish_occurrence" edges to the Occurrence entity.

func (*DishUpdateOne) AddSideDishOccurrenceIDs

func (duo *DishUpdateOne) AddSideDishOccurrenceIDs(ids ...uuid.UUID) *DishUpdateOne

AddSideDishOccurrenceIDs adds the "side_dish_occurrence" edge to the Occurrence entity by IDs.

func (*DishUpdateOne) ClearAliases

func (duo *DishUpdateOne) ClearAliases() *DishUpdateOne

ClearAliases clears all "aliases" edges to the DishAlias entity.

func (*DishUpdateOne) ClearDishOccurrences

func (duo *DishUpdateOne) ClearDishOccurrences() *DishUpdateOne

ClearDishOccurrences clears all "dish_occurrences" edges to the Occurrence entity.

func (*DishUpdateOne) ClearNameEn

func (duo *DishUpdateOne) ClearNameEn() *DishUpdateOne

ClearNameEn clears the value of the "name_en" field.

func (*DishUpdateOne) ClearSideDishOccurrence

func (duo *DishUpdateOne) ClearSideDishOccurrence() *DishUpdateOne

ClearSideDishOccurrence clears all "side_dish_occurrence" edges to the Occurrence entity.

func (*DishUpdateOne) Exec

func (duo *DishUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DishUpdateOne) ExecX

func (duo *DishUpdateOne) ExecX(ctx context.Context)

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

func (*DishUpdateOne) Mutation

func (duo *DishUpdateOne) Mutation() *DishMutation

Mutation returns the DishMutation object of the builder.

func (*DishUpdateOne) RemoveAliasIDs

func (duo *DishUpdateOne) RemoveAliasIDs(ids ...string) *DishUpdateOne

RemoveAliasIDs removes the "aliases" edge to DishAlias entities by IDs.

func (*DishUpdateOne) RemoveAliases

func (duo *DishUpdateOne) RemoveAliases(d ...*DishAlias) *DishUpdateOne

RemoveAliases removes "aliases" edges to DishAlias entities.

func (*DishUpdateOne) RemoveDishOccurrenceIDs

func (duo *DishUpdateOne) RemoveDishOccurrenceIDs(ids ...uuid.UUID) *DishUpdateOne

RemoveDishOccurrenceIDs removes the "dish_occurrences" edge to Occurrence entities by IDs.

func (*DishUpdateOne) RemoveDishOccurrences

func (duo *DishUpdateOne) RemoveDishOccurrences(o ...*Occurrence) *DishUpdateOne

RemoveDishOccurrences removes "dish_occurrences" edges to Occurrence entities.

func (*DishUpdateOne) RemoveSideDishOccurrence

func (duo *DishUpdateOne) RemoveSideDishOccurrence(o ...*Occurrence) *DishUpdateOne

RemoveSideDishOccurrence removes "side_dish_occurrence" edges to Occurrence entities.

func (*DishUpdateOne) RemoveSideDishOccurrenceIDs

func (duo *DishUpdateOne) RemoveSideDishOccurrenceIDs(ids ...uuid.UUID) *DishUpdateOne

RemoveSideDishOccurrenceIDs removes the "side_dish_occurrence" edge to Occurrence entities by IDs.

func (*DishUpdateOne) Save

func (duo *DishUpdateOne) Save(ctx context.Context) (*Dish, error)

Save executes the query and returns the updated Dish entity.

func (*DishUpdateOne) SaveX

func (duo *DishUpdateOne) SaveX(ctx context.Context) *Dish

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

func (*DishUpdateOne) Select

func (duo *DishUpdateOne) Select(field string, fields ...string) *DishUpdateOne

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

func (*DishUpdateOne) SetNameDe

func (duo *DishUpdateOne) SetNameDe(s string) *DishUpdateOne

SetNameDe sets the "name_de" field.

func (*DishUpdateOne) SetNameEn

func (duo *DishUpdateOne) SetNameEn(s string) *DishUpdateOne

SetNameEn sets the "name_en" field.

func (*DishUpdateOne) SetNillableNameDe added in v0.8.3

func (duo *DishUpdateOne) SetNillableNameDe(s *string) *DishUpdateOne

SetNillableNameDe sets the "name_de" field if the given value is not nil.

func (*DishUpdateOne) SetNillableNameEn

func (duo *DishUpdateOne) SetNillableNameEn(s *string) *DishUpdateOne

SetNillableNameEn sets the "name_en" field if the given value is not nil.

func (*DishUpdateOne) Where

func (duo *DishUpdateOne) Where(ps ...predicate.Dish) *DishUpdateOne

Where appends a list predicates to the DishUpdate builder.

type DishUpsert

type DishUpsert struct {
	*sql.UpdateSet
}

DishUpsert is the "OnConflict" setter.

func (*DishUpsert) ClearNameEn

func (u *DishUpsert) ClearNameEn() *DishUpsert

ClearNameEn clears the value of the "name_en" field.

func (*DishUpsert) SetNameDe

func (u *DishUpsert) SetNameDe(v string) *DishUpsert

SetNameDe sets the "name_de" field.

func (*DishUpsert) SetNameEn

func (u *DishUpsert) SetNameEn(v string) *DishUpsert

SetNameEn sets the "name_en" field.

func (*DishUpsert) UpdateNameDe

func (u *DishUpsert) UpdateNameDe() *DishUpsert

UpdateNameDe sets the "name_de" field to the value that was provided on create.

func (*DishUpsert) UpdateNameEn

func (u *DishUpsert) UpdateNameEn() *DishUpsert

UpdateNameEn sets the "name_en" field to the value that was provided on create.

type DishUpsertBulk

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

DishUpsertBulk is the builder for "upsert"-ing a bulk of Dish nodes.

func (*DishUpsertBulk) ClearNameEn

func (u *DishUpsertBulk) ClearNameEn() *DishUpsertBulk

ClearNameEn clears the value of the "name_en" field.

func (*DishUpsertBulk) DoNothing

func (u *DishUpsertBulk) DoNothing() *DishUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DishUpsertBulk) Exec

func (u *DishUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DishUpsertBulk) ExecX

func (u *DishUpsertBulk) ExecX(ctx context.Context)

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

func (*DishUpsertBulk) Ignore

func (u *DishUpsertBulk) Ignore() *DishUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Dish.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*DishUpsertBulk) SetNameDe

func (u *DishUpsertBulk) SetNameDe(v string) *DishUpsertBulk

SetNameDe sets the "name_de" field.

func (*DishUpsertBulk) SetNameEn

func (u *DishUpsertBulk) SetNameEn(v string) *DishUpsertBulk

SetNameEn sets the "name_en" field.

func (*DishUpsertBulk) Update

func (u *DishUpsertBulk) Update(set func(*DishUpsert)) *DishUpsertBulk

Update allows overriding fields `UPDATE` values. See the DishCreateBulk.OnConflict documentation for more info.

func (*DishUpsertBulk) UpdateNameDe

func (u *DishUpsertBulk) UpdateNameDe() *DishUpsertBulk

UpdateNameDe sets the "name_de" field to the value that was provided on create.

func (*DishUpsertBulk) UpdateNameEn

func (u *DishUpsertBulk) UpdateNameEn() *DishUpsertBulk

UpdateNameEn sets the "name_en" field to the value that was provided on create.

func (*DishUpsertBulk) UpdateNewValues

func (u *DishUpsertBulk) UpdateNewValues() *DishUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Dish.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(dish.FieldID)
		}),
	).
	Exec(ctx)

type DishUpsertOne

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

DishUpsertOne is the builder for "upsert"-ing

one Dish node.

func (*DishUpsertOne) ClearNameEn

func (u *DishUpsertOne) ClearNameEn() *DishUpsertOne

ClearNameEn clears the value of the "name_en" field.

func (*DishUpsertOne) DoNothing

func (u *DishUpsertOne) DoNothing() *DishUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DishUpsertOne) Exec

func (u *DishUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*DishUpsertOne) ExecX

func (u *DishUpsertOne) ExecX(ctx context.Context)

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

func (*DishUpsertOne) ID

func (u *DishUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*DishUpsertOne) IDX

func (u *DishUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*DishUpsertOne) Ignore

func (u *DishUpsertOne) Ignore() *DishUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Dish.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*DishUpsertOne) SetNameDe

func (u *DishUpsertOne) SetNameDe(v string) *DishUpsertOne

SetNameDe sets the "name_de" field.

func (*DishUpsertOne) SetNameEn

func (u *DishUpsertOne) SetNameEn(v string) *DishUpsertOne

SetNameEn sets the "name_en" field.

func (*DishUpsertOne) Update

func (u *DishUpsertOne) Update(set func(*DishUpsert)) *DishUpsertOne

Update allows overriding fields `UPDATE` values. See the DishCreate.OnConflict documentation for more info.

func (*DishUpsertOne) UpdateNameDe

func (u *DishUpsertOne) UpdateNameDe() *DishUpsertOne

UpdateNameDe sets the "name_de" field to the value that was provided on create.

func (*DishUpsertOne) UpdateNameEn

func (u *DishUpsertOne) UpdateNameEn() *DishUpsertOne

UpdateNameEn sets the "name_en" field to the value that was provided on create.

func (*DishUpsertOne) UpdateNewValues

func (u *DishUpsertOne) UpdateNewValues() *DishUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Dish.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(dish.FieldID)
		}),
	).
	Exec(ctx)

type Dishes

type Dishes []*Dish

Dishes is a parsable slice of Dish.

type Hook

type Hook = ent.Hook

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

type Image

type Image struct {

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

Image is the model entity for the Image schema.

func (*Image) QueryReview

func (i *Image) QueryReview() *ReviewQuery

QueryReview queries the "review" edge of the Image entity.

func (*Image) String

func (i *Image) String() string

String implements the fmt.Stringer.

func (*Image) Unwrap

func (i *Image) Unwrap() *Image

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

func (i *Image) Update() *ImageUpdateOne

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

func (*Image) Value

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

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

type ImageClient

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

ImageClient is a client for the Image schema.

func NewImageClient

func NewImageClient(c config) *ImageClient

NewImageClient returns a client for the Image from the given config.

func (*ImageClient) Create

func (c *ImageClient) Create() *ImageCreate

Create returns a builder for creating a Image entity.

func (*ImageClient) CreateBulk

func (c *ImageClient) CreateBulk(builders ...*ImageCreate) *ImageCreateBulk

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

func (*ImageClient) Delete

func (c *ImageClient) Delete() *ImageDelete

Delete returns a delete builder for Image.

func (*ImageClient) DeleteOne

func (c *ImageClient) DeleteOne(i *Image) *ImageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ImageClient) DeleteOneID

func (c *ImageClient) DeleteOneID(id uuid.UUID) *ImageDeleteOne

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

func (*ImageClient) Get

func (c *ImageClient) Get(ctx context.Context, id uuid.UUID) (*Image, error)

Get returns a Image entity by its id.

func (*ImageClient) GetX

func (c *ImageClient) GetX(ctx context.Context, id uuid.UUID) *Image

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

func (*ImageClient) Hooks

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

Hooks returns the client hooks.

func (*ImageClient) Intercept

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

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

func (*ImageClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ImageClient) MapCreateBulk added in v0.8.3

func (c *ImageClient) MapCreateBulk(slice any, setFunc func(*ImageCreate, int)) *ImageCreateBulk

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

func (*ImageClient) Query

func (c *ImageClient) Query() *ImageQuery

Query returns a query builder for Image.

func (*ImageClient) QueryReview

func (c *ImageClient) QueryReview(i *Image) *ReviewQuery

QueryReview queries the review edge of a Image.

func (*ImageClient) Update

func (c *ImageClient) Update() *ImageUpdate

Update returns an update builder for Image.

func (*ImageClient) UpdateOne

func (c *ImageClient) UpdateOne(i *Image) *ImageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ImageClient) UpdateOneID

func (c *ImageClient) UpdateOneID(id uuid.UUID) *ImageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ImageClient) Use

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

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

type ImageCreate

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

ImageCreate is the builder for creating a Image entity.

func (*ImageCreate) Exec

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

Exec executes the query.

func (*ImageCreate) ExecX

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

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

func (*ImageCreate) Mutation

func (ic *ImageCreate) Mutation() *ImageMutation

Mutation returns the ImageMutation object of the builder.

func (*ImageCreate) OnConflict

func (ic *ImageCreate) OnConflict(opts ...sql.ConflictOption) *ImageUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Image.Create().
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ImageCreate) OnConflictColumns

func (ic *ImageCreate) OnConflictColumns(columns ...string) *ImageUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Image.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ImageCreate) Save

func (ic *ImageCreate) Save(ctx context.Context) (*Image, error)

Save creates the Image in the database.

func (*ImageCreate) SaveX

func (ic *ImageCreate) SaveX(ctx context.Context) *Image

SaveX calls Save and panics if Save returns an error.

func (*ImageCreate) SetID

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

SetID sets the "id" field.

func (*ImageCreate) SetNillableID

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

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

func (*ImageCreate) SetReview

func (ic *ImageCreate) SetReview(r *Review) *ImageCreate

SetReview sets the "review" edge to the Review entity.

func (*ImageCreate) SetReviewID

func (ic *ImageCreate) SetReviewID(id uuid.UUID) *ImageCreate

SetReviewID sets the "review" edge to the Review entity by ID.

type ImageCreateBulk

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

ImageCreateBulk is the builder for creating many Image entities in bulk.

func (*ImageCreateBulk) Exec

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

Exec executes the query.

func (*ImageCreateBulk) ExecX

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

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

func (*ImageCreateBulk) OnConflict

func (icb *ImageCreateBulk) OnConflict(opts ...sql.ConflictOption) *ImageUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Image.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ImageCreateBulk) OnConflictColumns

func (icb *ImageCreateBulk) OnConflictColumns(columns ...string) *ImageUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Image.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ImageCreateBulk) Save

func (icb *ImageCreateBulk) Save(ctx context.Context) ([]*Image, error)

Save creates the Image entities in the database.

func (*ImageCreateBulk) SaveX

func (icb *ImageCreateBulk) SaveX(ctx context.Context) []*Image

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

type ImageDelete

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

ImageDelete is the builder for deleting a Image entity.

func (*ImageDelete) Exec

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

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

func (*ImageDelete) ExecX

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

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

func (*ImageDelete) Where

func (id *ImageDelete) Where(ps ...predicate.Image) *ImageDelete

Where appends a list predicates to the ImageDelete builder.

type ImageDeleteOne

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

ImageDeleteOne is the builder for deleting a single Image entity.

func (*ImageDeleteOne) Exec

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

Exec executes the deletion query.

func (*ImageDeleteOne) ExecX

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

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

func (*ImageDeleteOne) Where

func (ido *ImageDeleteOne) Where(ps ...predicate.Image) *ImageDeleteOne

Where appends a list predicates to the ImageDelete builder.

type ImageEdges

type ImageEdges struct {
	// Review holds the value of the review edge.
	Review *Review `json:"review,omitempty"`
	// contains filtered or unexported fields
}

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

func (ImageEdges) ReviewOrErr

func (e ImageEdges) ReviewOrErr() (*Review, error)

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

type ImageGroupBy

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

ImageGroupBy is the group-by builder for Image entities.

func (*ImageGroupBy) Aggregate

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

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

func (*ImageGroupBy) Bool

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

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

func (*ImageGroupBy) BoolX

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

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

func (*ImageGroupBy) Bools

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

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

func (*ImageGroupBy) BoolsX

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

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

func (*ImageGroupBy) Float64

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

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

func (*ImageGroupBy) Float64X

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

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

func (*ImageGroupBy) Float64s

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

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

func (*ImageGroupBy) Float64sX

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

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

func (*ImageGroupBy) Int

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

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

func (*ImageGroupBy) IntX

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

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

func (*ImageGroupBy) Ints

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

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

func (*ImageGroupBy) IntsX

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

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

func (*ImageGroupBy) Scan

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

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

func (*ImageGroupBy) ScanX

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

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

func (*ImageGroupBy) String

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

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

func (*ImageGroupBy) StringX

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

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

func (*ImageGroupBy) Strings

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

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

func (*ImageGroupBy) StringsX

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

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

type ImageMutation

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

ImageMutation represents an operation that mutates the Image nodes in the graph.

func (*ImageMutation) AddField

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

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

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

func (*ImageMutation) AddedField

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

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

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

func (*ImageMutation) AddedIDs

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

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

func (*ImageMutation) ClearEdge

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

func (m *ImageMutation) 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 (*ImageMutation) ClearReview

func (m *ImageMutation) ClearReview()

ClearReview clears the "review" edge to the Review entity.

func (*ImageMutation) ClearedEdges

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

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

func (*ImageMutation) ClearedFields

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

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

func (ImageMutation) Client

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

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

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

func (*ImageMutation) Field

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

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

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

func (*ImageMutation) Fields

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

func (m *ImageMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ImageMutation) IDs

func (m *ImageMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ImageMutation) OldField

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

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

func (*ImageMutation) Op

func (m *ImageMutation) Op() Op

Op returns the operation name.

func (*ImageMutation) RemovedEdges

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

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

func (*ImageMutation) RemovedIDs

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

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

func (m *ImageMutation) 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 (*ImageMutation) ResetReview

func (m *ImageMutation) ResetReview()

ResetReview resets all changes to the "review" edge.

func (*ImageMutation) ReviewCleared

func (m *ImageMutation) ReviewCleared() bool

ReviewCleared reports if the "review" edge to the Review entity was cleared.

func (*ImageMutation) ReviewID

func (m *ImageMutation) ReviewID() (id uuid.UUID, exists bool)

ReviewID returns the "review" edge ID in the mutation.

func (*ImageMutation) ReviewIDs

func (m *ImageMutation) ReviewIDs() (ids []uuid.UUID)

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

func (*ImageMutation) SetField

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

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

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

func (*ImageMutation) SetOp

func (m *ImageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ImageMutation) SetReviewID

func (m *ImageMutation) SetReviewID(id uuid.UUID)

SetReviewID sets the "review" edge to the Review entity by id.

func (ImageMutation) Tx

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

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

func (*ImageMutation) Type

func (m *ImageMutation) Type() string

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

func (*ImageMutation) Where

func (m *ImageMutation) Where(ps ...predicate.Image)

Where appends a list predicates to the ImageMutation builder.

func (*ImageMutation) WhereP

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

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

type ImageQuery

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

ImageQuery is the builder for querying Image entities.

func (*ImageQuery) Aggregate

func (iq *ImageQuery) Aggregate(fns ...AggregateFunc) *ImageSelect

Aggregate returns a ImageSelect configured with the given aggregations.

func (*ImageQuery) All

func (iq *ImageQuery) All(ctx context.Context) ([]*Image, error)

All executes the query and returns a list of Images.

func (*ImageQuery) AllX

func (iq *ImageQuery) AllX(ctx context.Context) []*Image

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

func (*ImageQuery) Clone

func (iq *ImageQuery) Clone() *ImageQuery

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

func (*ImageQuery) Count

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

Count returns the count of the given query.

func (*ImageQuery) CountX

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

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

func (*ImageQuery) Exist

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

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

func (*ImageQuery) ExistX

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

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

func (*ImageQuery) First

func (iq *ImageQuery) First(ctx context.Context) (*Image, error)

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

func (*ImageQuery) FirstID

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

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

func (*ImageQuery) FirstIDX

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

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

func (*ImageQuery) FirstX

func (iq *ImageQuery) FirstX(ctx context.Context) *Image

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

func (*ImageQuery) GroupBy

func (iq *ImageQuery) GroupBy(field string, fields ...string) *ImageGroupBy

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.

func (*ImageQuery) IDs

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

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

func (*ImageQuery) IDsX

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

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

func (*ImageQuery) Limit

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

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

func (*ImageQuery) Offset

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

Offset to start from.

func (*ImageQuery) Only

func (iq *ImageQuery) Only(ctx context.Context) (*Image, error)

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

func (*ImageQuery) OnlyID

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

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

func (*ImageQuery) OnlyIDX

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

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

func (*ImageQuery) OnlyX

func (iq *ImageQuery) OnlyX(ctx context.Context) *Image

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

func (*ImageQuery) Order

func (iq *ImageQuery) Order(o ...image.OrderOption) *ImageQuery

Order specifies how the records should be ordered.

func (*ImageQuery) QueryReview

func (iq *ImageQuery) QueryReview() *ReviewQuery

QueryReview chains the current query on the "review" edge.

func (*ImageQuery) Select

func (iq *ImageQuery) Select(fields ...string) *ImageSelect

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

func (*ImageQuery) Unique

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

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

func (iq *ImageQuery) Where(ps ...predicate.Image) *ImageQuery

Where adds a new predicate for the ImageQuery builder.

func (*ImageQuery) WithReview

func (iq *ImageQuery) WithReview(opts ...func(*ReviewQuery)) *ImageQuery

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

type ImageSelect

type ImageSelect struct {
	*ImageQuery
	// contains filtered or unexported fields
}

ImageSelect is the builder for selecting fields of Image entities.

func (*ImageSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*ImageSelect) Bool

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

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

func (*ImageSelect) BoolX

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

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

func (*ImageSelect) Bools

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

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

func (*ImageSelect) BoolsX

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

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

func (*ImageSelect) Float64

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

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

func (*ImageSelect) Float64X

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

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

func (*ImageSelect) Float64s

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

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

func (*ImageSelect) Float64sX

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

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

func (*ImageSelect) Int

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

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

func (*ImageSelect) IntX

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

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

func (*ImageSelect) Ints

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

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

func (*ImageSelect) IntsX

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

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

func (*ImageSelect) Scan

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

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

func (*ImageSelect) ScanX

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

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

func (*ImageSelect) String

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

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

func (*ImageSelect) StringX

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

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

func (*ImageSelect) Strings

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

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

func (*ImageSelect) StringsX

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

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

type ImageUpdate

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

ImageUpdate is the builder for updating Image entities.

func (*ImageUpdate) ClearReview

func (iu *ImageUpdate) ClearReview() *ImageUpdate

ClearReview clears the "review" edge to the Review entity.

func (*ImageUpdate) Exec

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

Exec executes the query.

func (*ImageUpdate) ExecX

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

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

func (*ImageUpdate) Mutation

func (iu *ImageUpdate) Mutation() *ImageMutation

Mutation returns the ImageMutation object of the builder.

func (*ImageUpdate) Save

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

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

func (*ImageUpdate) SaveX

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

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

func (*ImageUpdate) SetReview

func (iu *ImageUpdate) SetReview(r *Review) *ImageUpdate

SetReview sets the "review" edge to the Review entity.

func (*ImageUpdate) SetReviewID

func (iu *ImageUpdate) SetReviewID(id uuid.UUID) *ImageUpdate

SetReviewID sets the "review" edge to the Review entity by ID.

func (*ImageUpdate) Where

func (iu *ImageUpdate) Where(ps ...predicate.Image) *ImageUpdate

Where appends a list predicates to the ImageUpdate builder.

type ImageUpdateOne

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

ImageUpdateOne is the builder for updating a single Image entity.

func (*ImageUpdateOne) ClearReview

func (iuo *ImageUpdateOne) ClearReview() *ImageUpdateOne

ClearReview clears the "review" edge to the Review entity.

func (*ImageUpdateOne) Exec

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

Exec executes the query on the entity.

func (*ImageUpdateOne) ExecX

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

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

func (*ImageUpdateOne) Mutation

func (iuo *ImageUpdateOne) Mutation() *ImageMutation

Mutation returns the ImageMutation object of the builder.

func (*ImageUpdateOne) Save

func (iuo *ImageUpdateOne) Save(ctx context.Context) (*Image, error)

Save executes the query and returns the updated Image entity.

func (*ImageUpdateOne) SaveX

func (iuo *ImageUpdateOne) SaveX(ctx context.Context) *Image

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

func (*ImageUpdateOne) Select

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

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

func (*ImageUpdateOne) SetReview

func (iuo *ImageUpdateOne) SetReview(r *Review) *ImageUpdateOne

SetReview sets the "review" edge to the Review entity.

func (*ImageUpdateOne) SetReviewID

func (iuo *ImageUpdateOne) SetReviewID(id uuid.UUID) *ImageUpdateOne

SetReviewID sets the "review" edge to the Review entity by ID.

func (*ImageUpdateOne) Where

func (iuo *ImageUpdateOne) Where(ps ...predicate.Image) *ImageUpdateOne

Where appends a list predicates to the ImageUpdate builder.

type ImageUpsert

type ImageUpsert struct {
	*sql.UpdateSet
}

ImageUpsert is the "OnConflict" setter.

type ImageUpsertBulk

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

ImageUpsertBulk is the builder for "upsert"-ing a bulk of Image nodes.

func (*ImageUpsertBulk) DoNothing

func (u *ImageUpsertBulk) DoNothing() *ImageUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ImageUpsertBulk) Exec

func (u *ImageUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ImageUpsertBulk) ExecX

func (u *ImageUpsertBulk) ExecX(ctx context.Context)

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

func (*ImageUpsertBulk) Ignore

func (u *ImageUpsertBulk) Ignore() *ImageUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Image.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ImageUpsertBulk) Update

func (u *ImageUpsertBulk) Update(set func(*ImageUpsert)) *ImageUpsertBulk

Update allows overriding fields `UPDATE` values. See the ImageCreateBulk.OnConflict documentation for more info.

func (*ImageUpsertBulk) UpdateNewValues

func (u *ImageUpsertBulk) UpdateNewValues() *ImageUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Image.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(image.FieldID)
		}),
	).
	Exec(ctx)

type ImageUpsertOne

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

ImageUpsertOne is the builder for "upsert"-ing

one Image node.

func (*ImageUpsertOne) DoNothing

func (u *ImageUpsertOne) DoNothing() *ImageUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ImageUpsertOne) Exec

func (u *ImageUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ImageUpsertOne) ExecX

func (u *ImageUpsertOne) ExecX(ctx context.Context)

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

func (*ImageUpsertOne) ID

func (u *ImageUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ImageUpsertOne) IDX

func (u *ImageUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*ImageUpsertOne) Ignore

func (u *ImageUpsertOne) Ignore() *ImageUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Image.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ImageUpsertOne) Update

func (u *ImageUpsertOne) Update(set func(*ImageUpsert)) *ImageUpsertOne

Update allows overriding fields `UPDATE` values. See the ImageCreate.OnConflict documentation for more info.

func (*ImageUpsertOne) UpdateNewValues

func (u *ImageUpsertOne) UpdateNewValues() *ImageUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Image.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(image.FieldID)
		}),
	).
	Exec(ctx)

type Images

type Images []*Image

Images is a parsable slice of Image.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type Location

type Location struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// ExternalID holds the value of the "external_id" field.
	ExternalID int `json:"external_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Visible holds the value of the "visible" field.
	Visible bool `json:"visible,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the LocationQuery when eager-loading is set.
	Edges LocationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Location is the model entity for the Location schema.

func (*Location) QueryOccurrences

func (l *Location) QueryOccurrences() *OccurrenceQuery

QueryOccurrences queries the "occurrences" edge of the Location entity.

func (*Location) String

func (l *Location) String() string

String implements the fmt.Stringer.

func (*Location) Unwrap

func (l *Location) Unwrap() *Location

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

func (l *Location) Update() *LocationUpdateOne

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

func (*Location) Value

func (l *Location) Value(name string) (ent.Value, error)

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

type LocationClient

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

LocationClient is a client for the Location schema.

func NewLocationClient

func NewLocationClient(c config) *LocationClient

NewLocationClient returns a client for the Location from the given config.

func (*LocationClient) Create

func (c *LocationClient) Create() *LocationCreate

Create returns a builder for creating a Location entity.

func (*LocationClient) CreateBulk

func (c *LocationClient) CreateBulk(builders ...*LocationCreate) *LocationCreateBulk

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

func (*LocationClient) Delete

func (c *LocationClient) Delete() *LocationDelete

Delete returns a delete builder for Location.

func (*LocationClient) DeleteOne

func (c *LocationClient) DeleteOne(l *Location) *LocationDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LocationClient) DeleteOneID

func (c *LocationClient) DeleteOneID(id uuid.UUID) *LocationDeleteOne

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

func (*LocationClient) Get

func (c *LocationClient) Get(ctx context.Context, id uuid.UUID) (*Location, error)

Get returns a Location entity by its id.

func (*LocationClient) GetX

func (c *LocationClient) GetX(ctx context.Context, id uuid.UUID) *Location

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

func (*LocationClient) Hooks

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

Hooks returns the client hooks.

func (*LocationClient) Intercept

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

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

func (*LocationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*LocationClient) MapCreateBulk added in v0.8.3

func (c *LocationClient) MapCreateBulk(slice any, setFunc func(*LocationCreate, int)) *LocationCreateBulk

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

func (*LocationClient) Query

func (c *LocationClient) Query() *LocationQuery

Query returns a query builder for Location.

func (*LocationClient) QueryOccurrences

func (c *LocationClient) QueryOccurrences(l *Location) *OccurrenceQuery

QueryOccurrences queries the occurrences edge of a Location.

func (*LocationClient) Update

func (c *LocationClient) Update() *LocationUpdate

Update returns an update builder for Location.

func (*LocationClient) UpdateOne

func (c *LocationClient) UpdateOne(l *Location) *LocationUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LocationClient) UpdateOneID

func (c *LocationClient) UpdateOneID(id uuid.UUID) *LocationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LocationClient) Use

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

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

type LocationCreate

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

LocationCreate is the builder for creating a Location entity.

func (*LocationCreate) AddOccurrenceIDs

func (lc *LocationCreate) AddOccurrenceIDs(ids ...uuid.UUID) *LocationCreate

AddOccurrenceIDs adds the "occurrences" edge to the Occurrence entity by IDs.

func (*LocationCreate) AddOccurrences

func (lc *LocationCreate) AddOccurrences(o ...*Occurrence) *LocationCreate

AddOccurrences adds the "occurrences" edges to the Occurrence entity.

func (*LocationCreate) Exec

func (lc *LocationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationCreate) ExecX

func (lc *LocationCreate) ExecX(ctx context.Context)

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

func (*LocationCreate) Mutation

func (lc *LocationCreate) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationCreate) OnConflict

func (lc *LocationCreate) OnConflict(opts ...sql.ConflictOption) *LocationUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Location.Create().
	SetExternalID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.LocationUpsert) {
		SetExternalID(v+v).
	}).
	Exec(ctx)

func (*LocationCreate) OnConflictColumns

func (lc *LocationCreate) OnConflictColumns(columns ...string) *LocationUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Location.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*LocationCreate) Save

func (lc *LocationCreate) Save(ctx context.Context) (*Location, error)

Save creates the Location in the database.

func (*LocationCreate) SaveX

func (lc *LocationCreate) SaveX(ctx context.Context) *Location

SaveX calls Save and panics if Save returns an error.

func (*LocationCreate) SetExternalID

func (lc *LocationCreate) SetExternalID(i int) *LocationCreate

SetExternalID sets the "external_id" field.

func (*LocationCreate) SetID

func (lc *LocationCreate) SetID(u uuid.UUID) *LocationCreate

SetID sets the "id" field.

func (*LocationCreate) SetName

func (lc *LocationCreate) SetName(s string) *LocationCreate

SetName sets the "name" field.

func (*LocationCreate) SetNillableID

func (lc *LocationCreate) SetNillableID(u *uuid.UUID) *LocationCreate

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

func (*LocationCreate) SetNillableVisible

func (lc *LocationCreate) SetNillableVisible(b *bool) *LocationCreate

SetNillableVisible sets the "visible" field if the given value is not nil.

func (*LocationCreate) SetVisible

func (lc *LocationCreate) SetVisible(b bool) *LocationCreate

SetVisible sets the "visible" field.

type LocationCreateBulk

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

LocationCreateBulk is the builder for creating many Location entities in bulk.

func (*LocationCreateBulk) Exec

func (lcb *LocationCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationCreateBulk) ExecX

func (lcb *LocationCreateBulk) ExecX(ctx context.Context)

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

func (*LocationCreateBulk) OnConflict

func (lcb *LocationCreateBulk) OnConflict(opts ...sql.ConflictOption) *LocationUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Location.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.LocationUpsert) {
		SetExternalID(v+v).
	}).
	Exec(ctx)

func (*LocationCreateBulk) OnConflictColumns

func (lcb *LocationCreateBulk) OnConflictColumns(columns ...string) *LocationUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Location.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*LocationCreateBulk) Save

func (lcb *LocationCreateBulk) Save(ctx context.Context) ([]*Location, error)

Save creates the Location entities in the database.

func (*LocationCreateBulk) SaveX

func (lcb *LocationCreateBulk) SaveX(ctx context.Context) []*Location

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

type LocationDelete

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

LocationDelete is the builder for deleting a Location entity.

func (*LocationDelete) Exec

func (ld *LocationDelete) Exec(ctx context.Context) (int, error)

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

func (*LocationDelete) ExecX

func (ld *LocationDelete) ExecX(ctx context.Context) int

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

func (*LocationDelete) Where

func (ld *LocationDelete) Where(ps ...predicate.Location) *LocationDelete

Where appends a list predicates to the LocationDelete builder.

type LocationDeleteOne

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

LocationDeleteOne is the builder for deleting a single Location entity.

func (*LocationDeleteOne) Exec

func (ldo *LocationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LocationDeleteOne) ExecX

func (ldo *LocationDeleteOne) ExecX(ctx context.Context)

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

func (*LocationDeleteOne) Where

Where appends a list predicates to the LocationDelete builder.

type LocationEdges

type LocationEdges struct {
	// Occurrences holds the value of the occurrences edge.
	Occurrences []*Occurrence `json:"occurrences,omitempty"`
	// contains filtered or unexported fields
}

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

func (LocationEdges) OccurrencesOrErr

func (e LocationEdges) OccurrencesOrErr() ([]*Occurrence, error)

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

type LocationGroupBy

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

LocationGroupBy is the group-by builder for Location entities.

func (*LocationGroupBy) Aggregate

func (lgb *LocationGroupBy) Aggregate(fns ...AggregateFunc) *LocationGroupBy

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

func (*LocationGroupBy) Bool

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

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

func (*LocationGroupBy) BoolX

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

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

func (*LocationGroupBy) Bools

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

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

func (*LocationGroupBy) BoolsX

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

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

func (*LocationGroupBy) Float64

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

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

func (*LocationGroupBy) Float64X

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

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

func (*LocationGroupBy) Float64s

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

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

func (*LocationGroupBy) Float64sX

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

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

func (*LocationGroupBy) Int

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

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

func (*LocationGroupBy) IntX

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

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

func (*LocationGroupBy) Ints

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

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

func (*LocationGroupBy) IntsX

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

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

func (*LocationGroupBy) Scan

func (lgb *LocationGroupBy) Scan(ctx context.Context, v any) error

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

func (*LocationGroupBy) ScanX

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

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

func (*LocationGroupBy) String

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

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

func (*LocationGroupBy) StringX

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

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

func (*LocationGroupBy) Strings

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

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

func (*LocationGroupBy) StringsX

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

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

type LocationMutation

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

LocationMutation represents an operation that mutates the Location nodes in the graph.

func (*LocationMutation) AddExternalID

func (m *LocationMutation) AddExternalID(i int)

AddExternalID adds i to the "external_id" field.

func (*LocationMutation) AddField

func (m *LocationMutation) 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 (*LocationMutation) AddOccurrenceIDs

func (m *LocationMutation) AddOccurrenceIDs(ids ...uuid.UUID)

AddOccurrenceIDs adds the "occurrences" edge to the Occurrence entity by ids.

func (*LocationMutation) AddedEdges

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

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

func (*LocationMutation) AddedExternalID

func (m *LocationMutation) AddedExternalID() (r int, exists bool)

AddedExternalID returns the value that was added to the "external_id" field in this mutation.

func (*LocationMutation) AddedField

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

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

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

func (*LocationMutation) AddedIDs

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

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

func (*LocationMutation) ClearEdge

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

func (m *LocationMutation) 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 (*LocationMutation) ClearOccurrences

func (m *LocationMutation) ClearOccurrences()

ClearOccurrences clears the "occurrences" edge to the Occurrence entity.

func (*LocationMutation) ClearedEdges

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

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

func (*LocationMutation) ClearedFields

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

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

func (LocationMutation) Client

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

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

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

func (*LocationMutation) ExternalID

func (m *LocationMutation) ExternalID() (r int, exists bool)

ExternalID returns the value of the "external_id" field in the mutation.

func (*LocationMutation) Field

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

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

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

func (*LocationMutation) Fields

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

func (m *LocationMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*LocationMutation) IDs

func (m *LocationMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*LocationMutation) Name

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

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

func (*LocationMutation) OccurrencesCleared

func (m *LocationMutation) OccurrencesCleared() bool

OccurrencesCleared reports if the "occurrences" edge to the Occurrence entity was cleared.

func (*LocationMutation) OccurrencesIDs

func (m *LocationMutation) OccurrencesIDs() (ids []uuid.UUID)

OccurrencesIDs returns the "occurrences" edge IDs in the mutation.

func (*LocationMutation) OldExternalID

func (m *LocationMutation) OldExternalID(ctx context.Context) (v int, err error)

OldExternalID returns the old "external_id" field's value of the Location entity. If the Location 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 (*LocationMutation) OldField

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

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

func (*LocationMutation) OldName

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

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

func (m *LocationMutation) OldVisible(ctx context.Context) (v bool, err error)

OldVisible returns the old "visible" field's value of the Location entity. If the Location 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 (*LocationMutation) Op

func (m *LocationMutation) Op() Op

Op returns the operation name.

func (*LocationMutation) RemoveOccurrenceIDs

func (m *LocationMutation) RemoveOccurrenceIDs(ids ...uuid.UUID)

RemoveOccurrenceIDs removes the "occurrences" edge to the Occurrence entity by IDs.

func (*LocationMutation) RemovedEdges

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

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

func (*LocationMutation) RemovedIDs

func (m *LocationMutation) 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 (*LocationMutation) RemovedOccurrencesIDs

func (m *LocationMutation) RemovedOccurrencesIDs() (ids []uuid.UUID)

RemovedOccurrences returns the removed IDs of the "occurrences" edge to the Occurrence entity.

func (*LocationMutation) ResetEdge

func (m *LocationMutation) 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 (*LocationMutation) ResetExternalID

func (m *LocationMutation) ResetExternalID()

ResetExternalID resets all changes to the "external_id" field.

func (*LocationMutation) ResetField

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

func (m *LocationMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*LocationMutation) ResetOccurrences

func (m *LocationMutation) ResetOccurrences()

ResetOccurrences resets all changes to the "occurrences" edge.

func (*LocationMutation) ResetVisible

func (m *LocationMutation) ResetVisible()

ResetVisible resets all changes to the "visible" field.

func (*LocationMutation) SetExternalID

func (m *LocationMutation) SetExternalID(i int)

SetExternalID sets the "external_id" field.

func (*LocationMutation) SetField

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

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

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

func (*LocationMutation) SetName

func (m *LocationMutation) SetName(s string)

SetName sets the "name" field.

func (*LocationMutation) SetOp

func (m *LocationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LocationMutation) SetVisible

func (m *LocationMutation) SetVisible(b bool)

SetVisible sets the "visible" field.

func (LocationMutation) Tx

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

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

func (*LocationMutation) Type

func (m *LocationMutation) Type() string

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

func (*LocationMutation) Visible

func (m *LocationMutation) Visible() (r bool, exists bool)

Visible returns the value of the "visible" field in the mutation.

func (*LocationMutation) Where

func (m *LocationMutation) Where(ps ...predicate.Location)

Where appends a list predicates to the LocationMutation builder.

func (*LocationMutation) WhereP

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

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

type LocationQuery

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

LocationQuery is the builder for querying Location entities.

func (*LocationQuery) Aggregate

func (lq *LocationQuery) Aggregate(fns ...AggregateFunc) *LocationSelect

Aggregate returns a LocationSelect configured with the given aggregations.

func (*LocationQuery) All

func (lq *LocationQuery) All(ctx context.Context) ([]*Location, error)

All executes the query and returns a list of Locations.

func (*LocationQuery) AllX

func (lq *LocationQuery) AllX(ctx context.Context) []*Location

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

func (*LocationQuery) Clone

func (lq *LocationQuery) Clone() *LocationQuery

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

func (*LocationQuery) Count

func (lq *LocationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LocationQuery) CountX

func (lq *LocationQuery) CountX(ctx context.Context) int

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

func (*LocationQuery) Exist

func (lq *LocationQuery) Exist(ctx context.Context) (bool, error)

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

func (*LocationQuery) ExistX

func (lq *LocationQuery) ExistX(ctx context.Context) bool

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

func (*LocationQuery) First

func (lq *LocationQuery) First(ctx context.Context) (*Location, error)

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

func (*LocationQuery) FirstID

func (lq *LocationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*LocationQuery) FirstIDX

func (lq *LocationQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*LocationQuery) FirstX

func (lq *LocationQuery) FirstX(ctx context.Context) *Location

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

func (*LocationQuery) GroupBy

func (lq *LocationQuery) GroupBy(field string, fields ...string) *LocationGroupBy

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 {
	ExternalID int `json:"external_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Location.Query().
	GroupBy(location.FieldExternalID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LocationQuery) IDs

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

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

func (*LocationQuery) IDsX

func (lq *LocationQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*LocationQuery) Limit

func (lq *LocationQuery) Limit(limit int) *LocationQuery

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

func (*LocationQuery) Offset

func (lq *LocationQuery) Offset(offset int) *LocationQuery

Offset to start from.

func (*LocationQuery) Only

func (lq *LocationQuery) Only(ctx context.Context) (*Location, error)

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

func (*LocationQuery) OnlyID

func (lq *LocationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*LocationQuery) OnlyIDX

func (lq *LocationQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*LocationQuery) OnlyX

func (lq *LocationQuery) OnlyX(ctx context.Context) *Location

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

func (*LocationQuery) Order

Order specifies how the records should be ordered.

func (*LocationQuery) QueryOccurrences

func (lq *LocationQuery) QueryOccurrences() *OccurrenceQuery

QueryOccurrences chains the current query on the "occurrences" edge.

func (*LocationQuery) Select

func (lq *LocationQuery) Select(fields ...string) *LocationSelect

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 {
	ExternalID int `json:"external_id,omitempty"`
}

client.Location.Query().
	Select(location.FieldExternalID).
	Scan(ctx, &v)

func (*LocationQuery) Unique

func (lq *LocationQuery) Unique(unique bool) *LocationQuery

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

func (lq *LocationQuery) Where(ps ...predicate.Location) *LocationQuery

Where adds a new predicate for the LocationQuery builder.

func (*LocationQuery) WithOccurrences

func (lq *LocationQuery) WithOccurrences(opts ...func(*OccurrenceQuery)) *LocationQuery

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

type LocationSelect

type LocationSelect struct {
	*LocationQuery
	// contains filtered or unexported fields
}

LocationSelect is the builder for selecting fields of Location entities.

func (*LocationSelect) Aggregate

func (ls *LocationSelect) Aggregate(fns ...AggregateFunc) *LocationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LocationSelect) Bool

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

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

func (*LocationSelect) BoolX

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

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

func (*LocationSelect) Bools

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

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

func (*LocationSelect) BoolsX

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

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

func (*LocationSelect) Float64

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

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

func (*LocationSelect) Float64X

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

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

func (*LocationSelect) Float64s

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

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

func (*LocationSelect) Float64sX

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

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

func (*LocationSelect) Int

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

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

func (*LocationSelect) IntX

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

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

func (*LocationSelect) Ints

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

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

func (*LocationSelect) IntsX

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

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

func (*LocationSelect) Scan

func (ls *LocationSelect) Scan(ctx context.Context, v any) error

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

func (*LocationSelect) ScanX

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

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

func (*LocationSelect) String

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

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

func (*LocationSelect) StringX

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

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

func (*LocationSelect) Strings

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

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

func (*LocationSelect) StringsX

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

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

type LocationUpdate

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

LocationUpdate is the builder for updating Location entities.

func (*LocationUpdate) AddExternalID

func (lu *LocationUpdate) AddExternalID(i int) *LocationUpdate

AddExternalID adds i to the "external_id" field.

func (*LocationUpdate) AddOccurrenceIDs

func (lu *LocationUpdate) AddOccurrenceIDs(ids ...uuid.UUID) *LocationUpdate

AddOccurrenceIDs adds the "occurrences" edge to the Occurrence entity by IDs.

func (*LocationUpdate) AddOccurrences

func (lu *LocationUpdate) AddOccurrences(o ...*Occurrence) *LocationUpdate

AddOccurrences adds the "occurrences" edges to the Occurrence entity.

func (*LocationUpdate) ClearOccurrences

func (lu *LocationUpdate) ClearOccurrences() *LocationUpdate

ClearOccurrences clears all "occurrences" edges to the Occurrence entity.

func (*LocationUpdate) Exec

func (lu *LocationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationUpdate) ExecX

func (lu *LocationUpdate) ExecX(ctx context.Context)

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

func (*LocationUpdate) Mutation

func (lu *LocationUpdate) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationUpdate) RemoveOccurrenceIDs

func (lu *LocationUpdate) RemoveOccurrenceIDs(ids ...uuid.UUID) *LocationUpdate

RemoveOccurrenceIDs removes the "occurrences" edge to Occurrence entities by IDs.

func (*LocationUpdate) RemoveOccurrences

func (lu *LocationUpdate) RemoveOccurrences(o ...*Occurrence) *LocationUpdate

RemoveOccurrences removes "occurrences" edges to Occurrence entities.

func (*LocationUpdate) Save

func (lu *LocationUpdate) Save(ctx context.Context) (int, error)

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

func (*LocationUpdate) SaveX

func (lu *LocationUpdate) SaveX(ctx context.Context) int

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

func (*LocationUpdate) SetExternalID

func (lu *LocationUpdate) SetExternalID(i int) *LocationUpdate

SetExternalID sets the "external_id" field.

func (*LocationUpdate) SetName

func (lu *LocationUpdate) SetName(s string) *LocationUpdate

SetName sets the "name" field.

func (*LocationUpdate) SetNillableExternalID added in v0.8.3

func (lu *LocationUpdate) SetNillableExternalID(i *int) *LocationUpdate

SetNillableExternalID sets the "external_id" field if the given value is not nil.

func (*LocationUpdate) SetNillableName added in v0.8.3

func (lu *LocationUpdate) SetNillableName(s *string) *LocationUpdate

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

func (*LocationUpdate) SetNillableVisible

func (lu *LocationUpdate) SetNillableVisible(b *bool) *LocationUpdate

SetNillableVisible sets the "visible" field if the given value is not nil.

func (*LocationUpdate) SetVisible

func (lu *LocationUpdate) SetVisible(b bool) *LocationUpdate

SetVisible sets the "visible" field.

func (*LocationUpdate) Where

func (lu *LocationUpdate) Where(ps ...predicate.Location) *LocationUpdate

Where appends a list predicates to the LocationUpdate builder.

type LocationUpdateOne

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

LocationUpdateOne is the builder for updating a single Location entity.

func (*LocationUpdateOne) AddExternalID

func (luo *LocationUpdateOne) AddExternalID(i int) *LocationUpdateOne

AddExternalID adds i to the "external_id" field.

func (*LocationUpdateOne) AddOccurrenceIDs

func (luo *LocationUpdateOne) AddOccurrenceIDs(ids ...uuid.UUID) *LocationUpdateOne

AddOccurrenceIDs adds the "occurrences" edge to the Occurrence entity by IDs.

func (*LocationUpdateOne) AddOccurrences

func (luo *LocationUpdateOne) AddOccurrences(o ...*Occurrence) *LocationUpdateOne

AddOccurrences adds the "occurrences" edges to the Occurrence entity.

func (*LocationUpdateOne) ClearOccurrences

func (luo *LocationUpdateOne) ClearOccurrences() *LocationUpdateOne

ClearOccurrences clears all "occurrences" edges to the Occurrence entity.

func (*LocationUpdateOne) Exec

func (luo *LocationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LocationUpdateOne) ExecX

func (luo *LocationUpdateOne) ExecX(ctx context.Context)

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

func (*LocationUpdateOne) Mutation

func (luo *LocationUpdateOne) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationUpdateOne) RemoveOccurrenceIDs

func (luo *LocationUpdateOne) RemoveOccurrenceIDs(ids ...uuid.UUID) *LocationUpdateOne

RemoveOccurrenceIDs removes the "occurrences" edge to Occurrence entities by IDs.

func (*LocationUpdateOne) RemoveOccurrences

func (luo *LocationUpdateOne) RemoveOccurrences(o ...*Occurrence) *LocationUpdateOne

RemoveOccurrences removes "occurrences" edges to Occurrence entities.

func (*LocationUpdateOne) Save

func (luo *LocationUpdateOne) Save(ctx context.Context) (*Location, error)

Save executes the query and returns the updated Location entity.

func (*LocationUpdateOne) SaveX

func (luo *LocationUpdateOne) SaveX(ctx context.Context) *Location

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

func (*LocationUpdateOne) Select

func (luo *LocationUpdateOne) Select(field string, fields ...string) *LocationUpdateOne

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

func (*LocationUpdateOne) SetExternalID

func (luo *LocationUpdateOne) SetExternalID(i int) *LocationUpdateOne

SetExternalID sets the "external_id" field.

func (*LocationUpdateOne) SetName

func (luo *LocationUpdateOne) SetName(s string) *LocationUpdateOne

SetName sets the "name" field.

func (*LocationUpdateOne) SetNillableExternalID added in v0.8.3

func (luo *LocationUpdateOne) SetNillableExternalID(i *int) *LocationUpdateOne

SetNillableExternalID sets the "external_id" field if the given value is not nil.

func (*LocationUpdateOne) SetNillableName added in v0.8.3

func (luo *LocationUpdateOne) SetNillableName(s *string) *LocationUpdateOne

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

func (*LocationUpdateOne) SetNillableVisible

func (luo *LocationUpdateOne) SetNillableVisible(b *bool) *LocationUpdateOne

SetNillableVisible sets the "visible" field if the given value is not nil.

func (*LocationUpdateOne) SetVisible

func (luo *LocationUpdateOne) SetVisible(b bool) *LocationUpdateOne

SetVisible sets the "visible" field.

func (*LocationUpdateOne) Where

Where appends a list predicates to the LocationUpdate builder.

type LocationUpsert

type LocationUpsert struct {
	*sql.UpdateSet
}

LocationUpsert is the "OnConflict" setter.

func (*LocationUpsert) AddExternalID

func (u *LocationUpsert) AddExternalID(v int) *LocationUpsert

AddExternalID adds v to the "external_id" field.

func (*LocationUpsert) SetExternalID

func (u *LocationUpsert) SetExternalID(v int) *LocationUpsert

SetExternalID sets the "external_id" field.

func (*LocationUpsert) SetName

func (u *LocationUpsert) SetName(v string) *LocationUpsert

SetName sets the "name" field.

func (*LocationUpsert) SetVisible

func (u *LocationUpsert) SetVisible(v bool) *LocationUpsert

SetVisible sets the "visible" field.

func (*LocationUpsert) UpdateExternalID

func (u *LocationUpsert) UpdateExternalID() *LocationUpsert

UpdateExternalID sets the "external_id" field to the value that was provided on create.

func (*LocationUpsert) UpdateName

func (u *LocationUpsert) UpdateName() *LocationUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*LocationUpsert) UpdateVisible

func (u *LocationUpsert) UpdateVisible() *LocationUpsert

UpdateVisible sets the "visible" field to the value that was provided on create.

type LocationUpsertBulk

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

LocationUpsertBulk is the builder for "upsert"-ing a bulk of Location nodes.

func (*LocationUpsertBulk) AddExternalID

func (u *LocationUpsertBulk) AddExternalID(v int) *LocationUpsertBulk

AddExternalID adds v to the "external_id" field.

func (*LocationUpsertBulk) DoNothing

func (u *LocationUpsertBulk) DoNothing() *LocationUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*LocationUpsertBulk) Exec

func (u *LocationUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationUpsertBulk) ExecX

func (u *LocationUpsertBulk) ExecX(ctx context.Context)

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

func (*LocationUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Location.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*LocationUpsertBulk) SetExternalID

func (u *LocationUpsertBulk) SetExternalID(v int) *LocationUpsertBulk

SetExternalID sets the "external_id" field.

func (*LocationUpsertBulk) SetName

SetName sets the "name" field.

func (*LocationUpsertBulk) SetVisible

func (u *LocationUpsertBulk) SetVisible(v bool) *LocationUpsertBulk

SetVisible sets the "visible" field.

func (*LocationUpsertBulk) Update

func (u *LocationUpsertBulk) Update(set func(*LocationUpsert)) *LocationUpsertBulk

Update allows overriding fields `UPDATE` values. See the LocationCreateBulk.OnConflict documentation for more info.

func (*LocationUpsertBulk) UpdateExternalID

func (u *LocationUpsertBulk) UpdateExternalID() *LocationUpsertBulk

UpdateExternalID sets the "external_id" field to the value that was provided on create.

func (*LocationUpsertBulk) UpdateName

func (u *LocationUpsertBulk) UpdateName() *LocationUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*LocationUpsertBulk) UpdateNewValues

func (u *LocationUpsertBulk) UpdateNewValues() *LocationUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Location.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(location.FieldID)
		}),
	).
	Exec(ctx)

func (*LocationUpsertBulk) UpdateVisible

func (u *LocationUpsertBulk) UpdateVisible() *LocationUpsertBulk

UpdateVisible sets the "visible" field to the value that was provided on create.

type LocationUpsertOne

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

LocationUpsertOne is the builder for "upsert"-ing

one Location node.

func (*LocationUpsertOne) AddExternalID

func (u *LocationUpsertOne) AddExternalID(v int) *LocationUpsertOne

AddExternalID adds v to the "external_id" field.

func (*LocationUpsertOne) DoNothing

func (u *LocationUpsertOne) DoNothing() *LocationUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*LocationUpsertOne) Exec

func (u *LocationUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationUpsertOne) ExecX

func (u *LocationUpsertOne) ExecX(ctx context.Context)

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

func (*LocationUpsertOne) ID

func (u *LocationUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*LocationUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*LocationUpsertOne) Ignore

func (u *LocationUpsertOne) Ignore() *LocationUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Location.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*LocationUpsertOne) SetExternalID

func (u *LocationUpsertOne) SetExternalID(v int) *LocationUpsertOne

SetExternalID sets the "external_id" field.

func (*LocationUpsertOne) SetName

SetName sets the "name" field.

func (*LocationUpsertOne) SetVisible

func (u *LocationUpsertOne) SetVisible(v bool) *LocationUpsertOne

SetVisible sets the "visible" field.

func (*LocationUpsertOne) Update

func (u *LocationUpsertOne) Update(set func(*LocationUpsert)) *LocationUpsertOne

Update allows overriding fields `UPDATE` values. See the LocationCreate.OnConflict documentation for more info.

func (*LocationUpsertOne) UpdateExternalID

func (u *LocationUpsertOne) UpdateExternalID() *LocationUpsertOne

UpdateExternalID sets the "external_id" field to the value that was provided on create.

func (*LocationUpsertOne) UpdateName

func (u *LocationUpsertOne) UpdateName() *LocationUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*LocationUpsertOne) UpdateNewValues

func (u *LocationUpsertOne) UpdateNewValues() *LocationUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Location.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(location.FieldID)
		}),
	).
	Exec(ctx)

func (*LocationUpsertOne) UpdateVisible

func (u *LocationUpsertOne) UpdateVisible() *LocationUpsertOne

UpdateVisible sets the "visible" field to the value that was provided on create.

type Locations

type Locations []*Location

Locations is a parsable slice of Location.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Occurrence

type Occurrence struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Date holds the value of the "date" field.
	Date time.Time `json:"date,omitempty"`
	// Kj holds the value of the "kj" field.
	Kj *int `json:"kj,omitempty"`
	// Kcal holds the value of the "kcal" field.
	Kcal *int `json:"kcal,omitempty"`
	// Fat holds the value of the "fat" field.
	Fat *int `json:"fat,omitempty"`
	// SaturatedFat holds the value of the "saturated_fat" field.
	SaturatedFat *int `json:"saturated_fat,omitempty"`
	// Carbohydrates holds the value of the "carbohydrates" field.
	Carbohydrates *int `json:"carbohydrates,omitempty"`
	// Sugar holds the value of the "sugar" field.
	Sugar *int `json:"sugar,omitempty"`
	// Fiber holds the value of the "fiber" field.
	Fiber *int `json:"fiber,omitempty"`
	// Protein holds the value of the "protein" field.
	Protein *int `json:"protein,omitempty"`
	// Salt holds the value of the "salt" field.
	Salt *int `json:"salt,omitempty"`
	// PriceStudent holds the value of the "price_student" field.
	PriceStudent *int `json:"price_student,omitempty"`
	// PriceStaff holds the value of the "price_staff" field.
	PriceStaff *int `json:"price_staff,omitempty"`
	// PriceGuest holds the value of the "price_guest" field.
	PriceGuest *int `json:"price_guest,omitempty"`
	// NotAvailableAfter holds the value of the "not_available_after" field.
	NotAvailableAfter *time.Time `json:"not_available_after,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OccurrenceQuery when eager-loading is set.
	Edges OccurrenceEdges `json:"edges"`
	// contains filtered or unexported fields
}

Occurrence is the model entity for the Occurrence schema.

func (*Occurrence) QueryDish

func (o *Occurrence) QueryDish() *DishQuery

QueryDish queries the "dish" edge of the Occurrence entity.

func (*Occurrence) QueryLocation

func (o *Occurrence) QueryLocation() *LocationQuery

QueryLocation queries the "location" edge of the Occurrence entity.

func (*Occurrence) QueryReviews

func (o *Occurrence) QueryReviews() *ReviewQuery

QueryReviews queries the "reviews" edge of the Occurrence entity.

func (*Occurrence) QuerySideDishes

func (o *Occurrence) QuerySideDishes() *DishQuery

QuerySideDishes queries the "side_dishes" edge of the Occurrence entity.

func (*Occurrence) QueryTags

func (o *Occurrence) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the Occurrence entity.

func (*Occurrence) String

func (o *Occurrence) String() string

String implements the fmt.Stringer.

func (*Occurrence) Unwrap

func (o *Occurrence) Unwrap() *Occurrence

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

func (o *Occurrence) Update() *OccurrenceUpdateOne

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

func (*Occurrence) Value

func (o *Occurrence) Value(name string) (ent.Value, error)

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

type OccurrenceClient

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

OccurrenceClient is a client for the Occurrence schema.

func NewOccurrenceClient

func NewOccurrenceClient(c config) *OccurrenceClient

NewOccurrenceClient returns a client for the Occurrence from the given config.

func (*OccurrenceClient) Create

func (c *OccurrenceClient) Create() *OccurrenceCreate

Create returns a builder for creating a Occurrence entity.

func (*OccurrenceClient) CreateBulk

func (c *OccurrenceClient) CreateBulk(builders ...*OccurrenceCreate) *OccurrenceCreateBulk

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

func (*OccurrenceClient) Delete

func (c *OccurrenceClient) Delete() *OccurrenceDelete

Delete returns a delete builder for Occurrence.

func (*OccurrenceClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OccurrenceClient) DeleteOneID

func (c *OccurrenceClient) DeleteOneID(id uuid.UUID) *OccurrenceDeleteOne

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

func (*OccurrenceClient) Get

Get returns a Occurrence entity by its id.

func (*OccurrenceClient) GetX

func (c *OccurrenceClient) GetX(ctx context.Context, id uuid.UUID) *Occurrence

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

func (*OccurrenceClient) Hooks

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

Hooks returns the client hooks.

func (*OccurrenceClient) Intercept

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

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

func (*OccurrenceClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OccurrenceClient) MapCreateBulk added in v0.8.3

func (c *OccurrenceClient) MapCreateBulk(slice any, setFunc func(*OccurrenceCreate, int)) *OccurrenceCreateBulk

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

func (*OccurrenceClient) Query

func (c *OccurrenceClient) Query() *OccurrenceQuery

Query returns a query builder for Occurrence.

func (*OccurrenceClient) QueryDish

func (c *OccurrenceClient) QueryDish(o *Occurrence) *DishQuery

QueryDish queries the dish edge of a Occurrence.

func (*OccurrenceClient) QueryLocation

func (c *OccurrenceClient) QueryLocation(o *Occurrence) *LocationQuery

QueryLocation queries the location edge of a Occurrence.

func (*OccurrenceClient) QueryReviews

func (c *OccurrenceClient) QueryReviews(o *Occurrence) *ReviewQuery

QueryReviews queries the reviews edge of a Occurrence.

func (*OccurrenceClient) QuerySideDishes

func (c *OccurrenceClient) QuerySideDishes(o *Occurrence) *DishQuery

QuerySideDishes queries the side_dishes edge of a Occurrence.

func (*OccurrenceClient) QueryTags

func (c *OccurrenceClient) QueryTags(o *Occurrence) *TagQuery

QueryTags queries the tags edge of a Occurrence.

func (*OccurrenceClient) Update

func (c *OccurrenceClient) Update() *OccurrenceUpdate

Update returns an update builder for Occurrence.

func (*OccurrenceClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OccurrenceClient) UpdateOneID

func (c *OccurrenceClient) UpdateOneID(id uuid.UUID) *OccurrenceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OccurrenceClient) Use

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

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

type OccurrenceCreate

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

OccurrenceCreate is the builder for creating a Occurrence entity.

func (*OccurrenceCreate) AddReviewIDs

func (oc *OccurrenceCreate) AddReviewIDs(ids ...uuid.UUID) *OccurrenceCreate

AddReviewIDs adds the "reviews" edge to the Review entity by IDs.

func (*OccurrenceCreate) AddReviews

func (oc *OccurrenceCreate) AddReviews(r ...*Review) *OccurrenceCreate

AddReviews adds the "reviews" edges to the Review entity.

func (*OccurrenceCreate) AddSideDishIDs

func (oc *OccurrenceCreate) AddSideDishIDs(ids ...uuid.UUID) *OccurrenceCreate

AddSideDishIDs adds the "side_dishes" edge to the Dish entity by IDs.

func (*OccurrenceCreate) AddSideDishes

func (oc *OccurrenceCreate) AddSideDishes(d ...*Dish) *OccurrenceCreate

AddSideDishes adds the "side_dishes" edges to the Dish entity.

func (*OccurrenceCreate) AddTagIDs

func (oc *OccurrenceCreate) AddTagIDs(ids ...string) *OccurrenceCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*OccurrenceCreate) AddTags

func (oc *OccurrenceCreate) AddTags(t ...*Tag) *OccurrenceCreate

AddTags adds the "tags" edges to the Tag entity.

func (*OccurrenceCreate) Exec

func (oc *OccurrenceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OccurrenceCreate) ExecX

func (oc *OccurrenceCreate) ExecX(ctx context.Context)

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

func (*OccurrenceCreate) Mutation

func (oc *OccurrenceCreate) Mutation() *OccurrenceMutation

Mutation returns the OccurrenceMutation object of the builder.

func (*OccurrenceCreate) OnConflict

func (oc *OccurrenceCreate) OnConflict(opts ...sql.ConflictOption) *OccurrenceUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Occurrence.Create().
	SetDate(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.OccurrenceUpsert) {
		SetDate(v+v).
	}).
	Exec(ctx)

func (*OccurrenceCreate) OnConflictColumns

func (oc *OccurrenceCreate) OnConflictColumns(columns ...string) *OccurrenceUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Occurrence.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*OccurrenceCreate) Save

func (oc *OccurrenceCreate) Save(ctx context.Context) (*Occurrence, error)

Save creates the Occurrence in the database.

func (*OccurrenceCreate) SaveX

func (oc *OccurrenceCreate) SaveX(ctx context.Context) *Occurrence

SaveX calls Save and panics if Save returns an error.

func (*OccurrenceCreate) SetCarbohydrates

func (oc *OccurrenceCreate) SetCarbohydrates(i int) *OccurrenceCreate

SetCarbohydrates sets the "carbohydrates" field.

func (*OccurrenceCreate) SetDate

func (oc *OccurrenceCreate) SetDate(t time.Time) *OccurrenceCreate

SetDate sets the "date" field.

func (*OccurrenceCreate) SetDish

func (oc *OccurrenceCreate) SetDish(d *Dish) *OccurrenceCreate

SetDish sets the "dish" edge to the Dish entity.

func (*OccurrenceCreate) SetDishID

func (oc *OccurrenceCreate) SetDishID(id uuid.UUID) *OccurrenceCreate

SetDishID sets the "dish" edge to the Dish entity by ID.

func (*OccurrenceCreate) SetFat

func (oc *OccurrenceCreate) SetFat(i int) *OccurrenceCreate

SetFat sets the "fat" field.

func (*OccurrenceCreate) SetFiber

func (oc *OccurrenceCreate) SetFiber(i int) *OccurrenceCreate

SetFiber sets the "fiber" field.

func (*OccurrenceCreate) SetID

SetID sets the "id" field.

func (*OccurrenceCreate) SetKcal

func (oc *OccurrenceCreate) SetKcal(i int) *OccurrenceCreate

SetKcal sets the "kcal" field.

func (*OccurrenceCreate) SetKj

func (oc *OccurrenceCreate) SetKj(i int) *OccurrenceCreate

SetKj sets the "kj" field.

func (*OccurrenceCreate) SetLocation

func (oc *OccurrenceCreate) SetLocation(l *Location) *OccurrenceCreate

SetLocation sets the "location" edge to the Location entity.

func (*OccurrenceCreate) SetLocationID

func (oc *OccurrenceCreate) SetLocationID(id uuid.UUID) *OccurrenceCreate

SetLocationID sets the "location" edge to the Location entity by ID.

func (*OccurrenceCreate) SetNillableCarbohydrates

func (oc *OccurrenceCreate) SetNillableCarbohydrates(i *int) *OccurrenceCreate

SetNillableCarbohydrates sets the "carbohydrates" field if the given value is not nil.

func (*OccurrenceCreate) SetNillableDate

func (oc *OccurrenceCreate) SetNillableDate(t *time.Time) *OccurrenceCreate

SetNillableDate sets the "date" field if the given value is not nil.

func (*OccurrenceCreate) SetNillableFat

func (oc *OccurrenceCreate) SetNillableFat(i *int) *OccurrenceCreate

SetNillableFat sets the "fat" field if the given value is not nil.

func (*OccurrenceCreate) SetNillableFiber

func (oc *OccurrenceCreate) SetNillableFiber(i *int) *OccurrenceCreate

SetNillableFiber sets the "fiber" field if the given value is not nil.

func (*OccurrenceCreate) SetNillableID

func (oc *OccurrenceCreate) SetNillableID(u *uuid.UUID) *OccurrenceCreate

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

func (*OccurrenceCreate) SetNillableKcal

func (oc *OccurrenceCreate) SetNillableKcal(i *int) *OccurrenceCreate

SetNillableKcal sets the "kcal" field if the given value is not nil.

func (*OccurrenceCreate) SetNillableKj

func (oc *OccurrenceCreate) SetNillableKj(i *int) *OccurrenceCreate

SetNillableKj sets the "kj" field if the given value is not nil.

func (*OccurrenceCreate) SetNillableNotAvailableAfter added in v0.7.0

func (oc *OccurrenceCreate) SetNillableNotAvailableAfter(t *time.Time) *OccurrenceCreate

SetNillableNotAvailableAfter sets the "not_available_after" field if the given value is not nil.

func (*OccurrenceCreate) SetNillablePriceGuest

func (oc *OccurrenceCreate) SetNillablePriceGuest(i *int) *OccurrenceCreate

SetNillablePriceGuest sets the "price_guest" field if the given value is not nil.

func (*OccurrenceCreate) SetNillablePriceStaff

func (oc *OccurrenceCreate) SetNillablePriceStaff(i *int) *OccurrenceCreate

SetNillablePriceStaff sets the "price_staff" field if the given value is not nil.

func (*OccurrenceCreate) SetNillablePriceStudent

func (oc *OccurrenceCreate) SetNillablePriceStudent(i *int) *OccurrenceCreate

SetNillablePriceStudent sets the "price_student" field if the given value is not nil.

func (*OccurrenceCreate) SetNillableProtein

func (oc *OccurrenceCreate) SetNillableProtein(i *int) *OccurrenceCreate

SetNillableProtein sets the "protein" field if the given value is not nil.

func (*OccurrenceCreate) SetNillableSalt

func (oc *OccurrenceCreate) SetNillableSalt(i *int) *OccurrenceCreate

SetNillableSalt sets the "salt" field if the given value is not nil.

func (*OccurrenceCreate) SetNillableSaturatedFat

func (oc *OccurrenceCreate) SetNillableSaturatedFat(i *int) *OccurrenceCreate

SetNillableSaturatedFat sets the "saturated_fat" field if the given value is not nil.

func (*OccurrenceCreate) SetNillableSugar

func (oc *OccurrenceCreate) SetNillableSugar(i *int) *OccurrenceCreate

SetNillableSugar sets the "sugar" field if the given value is not nil.

func (*OccurrenceCreate) SetNotAvailableAfter added in v0.7.0

func (oc *OccurrenceCreate) SetNotAvailableAfter(t time.Time) *OccurrenceCreate

SetNotAvailableAfter sets the "not_available_after" field.

func (*OccurrenceCreate) SetPriceGuest

func (oc *OccurrenceCreate) SetPriceGuest(i int) *OccurrenceCreate

SetPriceGuest sets the "price_guest" field.

func (*OccurrenceCreate) SetPriceStaff

func (oc *OccurrenceCreate) SetPriceStaff(i int) *OccurrenceCreate

SetPriceStaff sets the "price_staff" field.

func (*OccurrenceCreate) SetPriceStudent

func (oc *OccurrenceCreate) SetPriceStudent(i int) *OccurrenceCreate

SetPriceStudent sets the "price_student" field.

func (*OccurrenceCreate) SetProtein

func (oc *OccurrenceCreate) SetProtein(i int) *OccurrenceCreate

SetProtein sets the "protein" field.

func (*OccurrenceCreate) SetSalt

func (oc *OccurrenceCreate) SetSalt(i int) *OccurrenceCreate

SetSalt sets the "salt" field.

func (*OccurrenceCreate) SetSaturatedFat

func (oc *OccurrenceCreate) SetSaturatedFat(i int) *OccurrenceCreate

SetSaturatedFat sets the "saturated_fat" field.

func (*OccurrenceCreate) SetSugar

func (oc *OccurrenceCreate) SetSugar(i int) *OccurrenceCreate

SetSugar sets the "sugar" field.

type OccurrenceCreateBulk

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

OccurrenceCreateBulk is the builder for creating many Occurrence entities in bulk.

func (*OccurrenceCreateBulk) Exec

func (ocb *OccurrenceCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OccurrenceCreateBulk) ExecX

func (ocb *OccurrenceCreateBulk) ExecX(ctx context.Context)

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

func (*OccurrenceCreateBulk) OnConflict

func (ocb *OccurrenceCreateBulk) OnConflict(opts ...sql.ConflictOption) *OccurrenceUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Occurrence.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.OccurrenceUpsert) {
		SetDate(v+v).
	}).
	Exec(ctx)

func (*OccurrenceCreateBulk) OnConflictColumns

func (ocb *OccurrenceCreateBulk) OnConflictColumns(columns ...string) *OccurrenceUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Occurrence.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*OccurrenceCreateBulk) Save

func (ocb *OccurrenceCreateBulk) Save(ctx context.Context) ([]*Occurrence, error)

Save creates the Occurrence entities in the database.

func (*OccurrenceCreateBulk) SaveX

func (ocb *OccurrenceCreateBulk) SaveX(ctx context.Context) []*Occurrence

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

type OccurrenceDelete

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

OccurrenceDelete is the builder for deleting a Occurrence entity.

func (*OccurrenceDelete) Exec

func (od *OccurrenceDelete) Exec(ctx context.Context) (int, error)

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

func (*OccurrenceDelete) ExecX

func (od *OccurrenceDelete) ExecX(ctx context.Context) int

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

func (*OccurrenceDelete) Where

Where appends a list predicates to the OccurrenceDelete builder.

type OccurrenceDeleteOne

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

OccurrenceDeleteOne is the builder for deleting a single Occurrence entity.

func (*OccurrenceDeleteOne) Exec

func (odo *OccurrenceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OccurrenceDeleteOne) ExecX

func (odo *OccurrenceDeleteOne) ExecX(ctx context.Context)

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

func (*OccurrenceDeleteOne) Where

Where appends a list predicates to the OccurrenceDelete builder.

type OccurrenceEdges

type OccurrenceEdges struct {
	// Location holds the value of the location edge.
	Location *Location `json:"location,omitempty"`
	// Dish holds the value of the dish edge.
	Dish *Dish `json:"dish,omitempty"`
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// SideDishes holds the value of the side_dishes edge.
	SideDishes []*Dish `json:"side_dishes,omitempty"`
	// Reviews holds the value of the reviews edge.
	Reviews []*Review `json:"reviews,omitempty"`
	// contains filtered or unexported fields
}

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

func (OccurrenceEdges) DishOrErr

func (e OccurrenceEdges) DishOrErr() (*Dish, error)

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

func (OccurrenceEdges) LocationOrErr

func (e OccurrenceEdges) LocationOrErr() (*Location, error)

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

func (OccurrenceEdges) ReviewsOrErr

func (e OccurrenceEdges) ReviewsOrErr() ([]*Review, error)

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

func (OccurrenceEdges) SideDishesOrErr

func (e OccurrenceEdges) SideDishesOrErr() ([]*Dish, error)

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

func (OccurrenceEdges) TagsOrErr

func (e OccurrenceEdges) TagsOrErr() ([]*Tag, error)

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

type OccurrenceGroupBy

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

OccurrenceGroupBy is the group-by builder for Occurrence entities.

func (*OccurrenceGroupBy) Aggregate

func (ogb *OccurrenceGroupBy) Aggregate(fns ...AggregateFunc) *OccurrenceGroupBy

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

func (*OccurrenceGroupBy) Bool

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

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

func (*OccurrenceGroupBy) BoolX

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

BoolX is like Bool, but panics if an error occurs.

func (*OccurrenceGroupBy) Bools

func (s *OccurrenceGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OccurrenceGroupBy) BoolsX

func (s *OccurrenceGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OccurrenceGroupBy) Float64

func (s *OccurrenceGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OccurrenceGroupBy) Float64X

func (s *OccurrenceGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OccurrenceGroupBy) Float64s

func (s *OccurrenceGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OccurrenceGroupBy) Float64sX

func (s *OccurrenceGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OccurrenceGroupBy) Int

func (s *OccurrenceGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OccurrenceGroupBy) IntX

func (s *OccurrenceGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OccurrenceGroupBy) Ints

func (s *OccurrenceGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OccurrenceGroupBy) IntsX

func (s *OccurrenceGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OccurrenceGroupBy) Scan

func (ogb *OccurrenceGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OccurrenceGroupBy) ScanX

func (s *OccurrenceGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OccurrenceGroupBy) String

func (s *OccurrenceGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OccurrenceGroupBy) StringX

func (s *OccurrenceGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OccurrenceGroupBy) Strings

func (s *OccurrenceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OccurrenceGroupBy) StringsX

func (s *OccurrenceGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OccurrenceMutation

type OccurrenceMutation struct {
	// contains filtered or unexported fields
}

OccurrenceMutation represents an operation that mutates the Occurrence nodes in the graph.

func (*OccurrenceMutation) AddCarbohydrates

func (m *OccurrenceMutation) AddCarbohydrates(i int)

AddCarbohydrates adds i to the "carbohydrates" field.

func (*OccurrenceMutation) AddFat

func (m *OccurrenceMutation) AddFat(i int)

AddFat adds i to the "fat" field.

func (*OccurrenceMutation) AddFiber

func (m *OccurrenceMutation) AddFiber(i int)

AddFiber adds i to the "fiber" field.

func (*OccurrenceMutation) AddField

func (m *OccurrenceMutation) 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 (*OccurrenceMutation) AddKcal

func (m *OccurrenceMutation) AddKcal(i int)

AddKcal adds i to the "kcal" field.

func (*OccurrenceMutation) AddKj

func (m *OccurrenceMutation) AddKj(i int)

AddKj adds i to the "kj" field.

func (*OccurrenceMutation) AddPriceGuest

func (m *OccurrenceMutation) AddPriceGuest(i int)

AddPriceGuest adds i to the "price_guest" field.

func (*OccurrenceMutation) AddPriceStaff

func (m *OccurrenceMutation) AddPriceStaff(i int)

AddPriceStaff adds i to the "price_staff" field.

func (*OccurrenceMutation) AddPriceStudent

func (m *OccurrenceMutation) AddPriceStudent(i int)

AddPriceStudent adds i to the "price_student" field.

func (*OccurrenceMutation) AddProtein

func (m *OccurrenceMutation) AddProtein(i int)

AddProtein adds i to the "protein" field.

func (*OccurrenceMutation) AddReviewIDs

func (m *OccurrenceMutation) AddReviewIDs(ids ...uuid.UUID)

AddReviewIDs adds the "reviews" edge to the Review entity by ids.

func (*OccurrenceMutation) AddSalt

func (m *OccurrenceMutation) AddSalt(i int)

AddSalt adds i to the "salt" field.

func (*OccurrenceMutation) AddSaturatedFat

func (m *OccurrenceMutation) AddSaturatedFat(i int)

AddSaturatedFat adds i to the "saturated_fat" field.

func (*OccurrenceMutation) AddSideDishIDs

func (m *OccurrenceMutation) AddSideDishIDs(ids ...uuid.UUID)

AddSideDishIDs adds the "side_dishes" edge to the Dish entity by ids.

func (*OccurrenceMutation) AddSugar

func (m *OccurrenceMutation) AddSugar(i int)

AddSugar adds i to the "sugar" field.

func (*OccurrenceMutation) AddTagIDs

func (m *OccurrenceMutation) AddTagIDs(ids ...string)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*OccurrenceMutation) AddedCarbohydrates

func (m *OccurrenceMutation) AddedCarbohydrates() (r int, exists bool)

AddedCarbohydrates returns the value that was added to the "carbohydrates" field in this mutation.

func (*OccurrenceMutation) AddedEdges

func (m *OccurrenceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OccurrenceMutation) AddedFat

func (m *OccurrenceMutation) AddedFat() (r int, exists bool)

AddedFat returns the value that was added to the "fat" field in this mutation.

func (*OccurrenceMutation) AddedFiber

func (m *OccurrenceMutation) AddedFiber() (r int, exists bool)

AddedFiber returns the value that was added to the "fiber" field in this mutation.

func (*OccurrenceMutation) AddedField

func (m *OccurrenceMutation) 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 (*OccurrenceMutation) AddedFields

func (m *OccurrenceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OccurrenceMutation) AddedIDs

func (m *OccurrenceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OccurrenceMutation) AddedKcal

func (m *OccurrenceMutation) AddedKcal() (r int, exists bool)

AddedKcal returns the value that was added to the "kcal" field in this mutation.

func (*OccurrenceMutation) AddedKj

func (m *OccurrenceMutation) AddedKj() (r int, exists bool)

AddedKj returns the value that was added to the "kj" field in this mutation.

func (*OccurrenceMutation) AddedPriceGuest

func (m *OccurrenceMutation) AddedPriceGuest() (r int, exists bool)

AddedPriceGuest returns the value that was added to the "price_guest" field in this mutation.

func (*OccurrenceMutation) AddedPriceStaff

func (m *OccurrenceMutation) AddedPriceStaff() (r int, exists bool)

AddedPriceStaff returns the value that was added to the "price_staff" field in this mutation.

func (*OccurrenceMutation) AddedPriceStudent

func (m *OccurrenceMutation) AddedPriceStudent() (r int, exists bool)

AddedPriceStudent returns the value that was added to the "price_student" field in this mutation.

func (*OccurrenceMutation) AddedProtein

func (m *OccurrenceMutation) AddedProtein() (r int, exists bool)

AddedProtein returns the value that was added to the "protein" field in this mutation.

func (*OccurrenceMutation) AddedSalt

func (m *OccurrenceMutation) AddedSalt() (r int, exists bool)

AddedSalt returns the value that was added to the "salt" field in this mutation.

func (*OccurrenceMutation) AddedSaturatedFat

func (m *OccurrenceMutation) AddedSaturatedFat() (r int, exists bool)

AddedSaturatedFat returns the value that was added to the "saturated_fat" field in this mutation.

func (*OccurrenceMutation) AddedSugar

func (m *OccurrenceMutation) AddedSugar() (r int, exists bool)

AddedSugar returns the value that was added to the "sugar" field in this mutation.

func (*OccurrenceMutation) Carbohydrates

func (m *OccurrenceMutation) Carbohydrates() (r int, exists bool)

Carbohydrates returns the value of the "carbohydrates" field in the mutation.

func (*OccurrenceMutation) CarbohydratesCleared

func (m *OccurrenceMutation) CarbohydratesCleared() bool

CarbohydratesCleared returns if the "carbohydrates" field was cleared in this mutation.

func (*OccurrenceMutation) ClearCarbohydrates

func (m *OccurrenceMutation) ClearCarbohydrates()

ClearCarbohydrates clears the value of the "carbohydrates" field.

func (*OccurrenceMutation) ClearDish

func (m *OccurrenceMutation) ClearDish()

ClearDish clears the "dish" edge to the Dish entity.

func (*OccurrenceMutation) ClearEdge

func (m *OccurrenceMutation) 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 (*OccurrenceMutation) ClearFat

func (m *OccurrenceMutation) ClearFat()

ClearFat clears the value of the "fat" field.

func (*OccurrenceMutation) ClearFiber

func (m *OccurrenceMutation) ClearFiber()

ClearFiber clears the value of the "fiber" field.

func (*OccurrenceMutation) ClearField

func (m *OccurrenceMutation) 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 (*OccurrenceMutation) ClearKcal

func (m *OccurrenceMutation) ClearKcal()

ClearKcal clears the value of the "kcal" field.

func (*OccurrenceMutation) ClearKj

func (m *OccurrenceMutation) ClearKj()

ClearKj clears the value of the "kj" field.

func (*OccurrenceMutation) ClearLocation

func (m *OccurrenceMutation) ClearLocation()

ClearLocation clears the "location" edge to the Location entity.

func (*OccurrenceMutation) ClearNotAvailableAfter added in v0.7.0

func (m *OccurrenceMutation) ClearNotAvailableAfter()

ClearNotAvailableAfter clears the value of the "not_available_after" field.

func (*OccurrenceMutation) ClearPriceGuest

func (m *OccurrenceMutation) ClearPriceGuest()

ClearPriceGuest clears the value of the "price_guest" field.

func (*OccurrenceMutation) ClearPriceStaff

func (m *OccurrenceMutation) ClearPriceStaff()

ClearPriceStaff clears the value of the "price_staff" field.

func (*OccurrenceMutation) ClearPriceStudent

func (m *OccurrenceMutation) ClearPriceStudent()

ClearPriceStudent clears the value of the "price_student" field.

func (*OccurrenceMutation) ClearProtein

func (m *OccurrenceMutation) ClearProtein()

ClearProtein clears the value of the "protein" field.

func (*OccurrenceMutation) ClearReviews

func (m *OccurrenceMutation) ClearReviews()

ClearReviews clears the "reviews" edge to the Review entity.

func (*OccurrenceMutation) ClearSalt

func (m *OccurrenceMutation) ClearSalt()

ClearSalt clears the value of the "salt" field.

func (*OccurrenceMutation) ClearSaturatedFat

func (m *OccurrenceMutation) ClearSaturatedFat()

ClearSaturatedFat clears the value of the "saturated_fat" field.

func (*OccurrenceMutation) ClearSideDishes

func (m *OccurrenceMutation) ClearSideDishes()

ClearSideDishes clears the "side_dishes" edge to the Dish entity.

func (*OccurrenceMutation) ClearSugar

func (m *OccurrenceMutation) ClearSugar()

ClearSugar clears the value of the "sugar" field.

func (*OccurrenceMutation) ClearTags

func (m *OccurrenceMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*OccurrenceMutation) ClearedEdges

func (m *OccurrenceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OccurrenceMutation) ClearedFields

func (m *OccurrenceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OccurrenceMutation) Client

func (m OccurrenceMutation) 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 (*OccurrenceMutation) Date

func (m *OccurrenceMutation) Date() (r time.Time, exists bool)

Date returns the value of the "date" field in the mutation.

func (*OccurrenceMutation) DishCleared

func (m *OccurrenceMutation) DishCleared() bool

DishCleared reports if the "dish" edge to the Dish entity was cleared.

func (*OccurrenceMutation) DishID

func (m *OccurrenceMutation) DishID() (id uuid.UUID, exists bool)

DishID returns the "dish" edge ID in the mutation.

func (*OccurrenceMutation) DishIDs

func (m *OccurrenceMutation) DishIDs() (ids []uuid.UUID)

DishIDs returns the "dish" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DishID instead. It exists only for internal usage by the builders.

func (*OccurrenceMutation) EdgeCleared

func (m *OccurrenceMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OccurrenceMutation) Fat

func (m *OccurrenceMutation) Fat() (r int, exists bool)

Fat returns the value of the "fat" field in the mutation.

func (*OccurrenceMutation) FatCleared

func (m *OccurrenceMutation) FatCleared() bool

FatCleared returns if the "fat" field was cleared in this mutation.

func (*OccurrenceMutation) Fiber

func (m *OccurrenceMutation) Fiber() (r int, exists bool)

Fiber returns the value of the "fiber" field in the mutation.

func (*OccurrenceMutation) FiberCleared

func (m *OccurrenceMutation) FiberCleared() bool

FiberCleared returns if the "fiber" field was cleared in this mutation.

func (*OccurrenceMutation) Field

func (m *OccurrenceMutation) 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 (*OccurrenceMutation) FieldCleared

func (m *OccurrenceMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OccurrenceMutation) Fields

func (m *OccurrenceMutation) 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 (*OccurrenceMutation) ID

func (m *OccurrenceMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*OccurrenceMutation) IDs

func (m *OccurrenceMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*OccurrenceMutation) Kcal

func (m *OccurrenceMutation) Kcal() (r int, exists bool)

Kcal returns the value of the "kcal" field in the mutation.

func (*OccurrenceMutation) KcalCleared

func (m *OccurrenceMutation) KcalCleared() bool

KcalCleared returns if the "kcal" field was cleared in this mutation.

func (*OccurrenceMutation) Kj

func (m *OccurrenceMutation) Kj() (r int, exists bool)

Kj returns the value of the "kj" field in the mutation.

func (*OccurrenceMutation) KjCleared

func (m *OccurrenceMutation) KjCleared() bool

KjCleared returns if the "kj" field was cleared in this mutation.

func (*OccurrenceMutation) LocationCleared

func (m *OccurrenceMutation) LocationCleared() bool

LocationCleared reports if the "location" edge to the Location entity was cleared.

func (*OccurrenceMutation) LocationID

func (m *OccurrenceMutation) LocationID() (id uuid.UUID, exists bool)

LocationID returns the "location" edge ID in the mutation.

func (*OccurrenceMutation) LocationIDs

func (m *OccurrenceMutation) LocationIDs() (ids []uuid.UUID)

LocationIDs returns the "location" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LocationID instead. It exists only for internal usage by the builders.

func (*OccurrenceMutation) NotAvailableAfter added in v0.7.0

func (m *OccurrenceMutation) NotAvailableAfter() (r time.Time, exists bool)

NotAvailableAfter returns the value of the "not_available_after" field in the mutation.

func (*OccurrenceMutation) NotAvailableAfterCleared added in v0.7.0

func (m *OccurrenceMutation) NotAvailableAfterCleared() bool

NotAvailableAfterCleared returns if the "not_available_after" field was cleared in this mutation.

func (*OccurrenceMutation) OldCarbohydrates

func (m *OccurrenceMutation) OldCarbohydrates(ctx context.Context) (v *int, err error)

OldCarbohydrates returns the old "carbohydrates" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldDate

func (m *OccurrenceMutation) OldDate(ctx context.Context) (v time.Time, err error)

OldDate returns the old "date" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldFat

func (m *OccurrenceMutation) OldFat(ctx context.Context) (v *int, err error)

OldFat returns the old "fat" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldFiber

func (m *OccurrenceMutation) OldFiber(ctx context.Context) (v *int, err error)

OldFiber returns the old "fiber" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldField

func (m *OccurrenceMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*OccurrenceMutation) OldKcal

func (m *OccurrenceMutation) OldKcal(ctx context.Context) (v *int, err error)

OldKcal returns the old "kcal" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldKj

func (m *OccurrenceMutation) OldKj(ctx context.Context) (v *int, err error)

OldKj returns the old "kj" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldNotAvailableAfter added in v0.7.0

func (m *OccurrenceMutation) OldNotAvailableAfter(ctx context.Context) (v *time.Time, err error)

OldNotAvailableAfter returns the old "not_available_after" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldPriceGuest

func (m *OccurrenceMutation) OldPriceGuest(ctx context.Context) (v *int, err error)

OldPriceGuest returns the old "price_guest" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldPriceStaff

func (m *OccurrenceMutation) OldPriceStaff(ctx context.Context) (v *int, err error)

OldPriceStaff returns the old "price_staff" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldPriceStudent

func (m *OccurrenceMutation) OldPriceStudent(ctx context.Context) (v *int, err error)

OldPriceStudent returns the old "price_student" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldProtein

func (m *OccurrenceMutation) OldProtein(ctx context.Context) (v *int, err error)

OldProtein returns the old "protein" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldSalt

func (m *OccurrenceMutation) OldSalt(ctx context.Context) (v *int, err error)

OldSalt returns the old "salt" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldSaturatedFat

func (m *OccurrenceMutation) OldSaturatedFat(ctx context.Context) (v *int, err error)

OldSaturatedFat returns the old "saturated_fat" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) OldSugar

func (m *OccurrenceMutation) OldSugar(ctx context.Context) (v *int, err error)

OldSugar returns the old "sugar" field's value of the Occurrence entity. If the Occurrence 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 (*OccurrenceMutation) Op

func (m *OccurrenceMutation) Op() Op

Op returns the operation name.

func (*OccurrenceMutation) PriceGuest

func (m *OccurrenceMutation) PriceGuest() (r int, exists bool)

PriceGuest returns the value of the "price_guest" field in the mutation.

func (*OccurrenceMutation) PriceGuestCleared

func (m *OccurrenceMutation) PriceGuestCleared() bool

PriceGuestCleared returns if the "price_guest" field was cleared in this mutation.

func (*OccurrenceMutation) PriceStaff

func (m *OccurrenceMutation) PriceStaff() (r int, exists bool)

PriceStaff returns the value of the "price_staff" field in the mutation.

func (*OccurrenceMutation) PriceStaffCleared

func (m *OccurrenceMutation) PriceStaffCleared() bool

PriceStaffCleared returns if the "price_staff" field was cleared in this mutation.

func (*OccurrenceMutation) PriceStudent

func (m *OccurrenceMutation) PriceStudent() (r int, exists bool)

PriceStudent returns the value of the "price_student" field in the mutation.

func (*OccurrenceMutation) PriceStudentCleared

func (m *OccurrenceMutation) PriceStudentCleared() bool

PriceStudentCleared returns if the "price_student" field was cleared in this mutation.

func (*OccurrenceMutation) Protein

func (m *OccurrenceMutation) Protein() (r int, exists bool)

Protein returns the value of the "protein" field in the mutation.

func (*OccurrenceMutation) ProteinCleared

func (m *OccurrenceMutation) ProteinCleared() bool

ProteinCleared returns if the "protein" field was cleared in this mutation.

func (*OccurrenceMutation) RemoveReviewIDs

func (m *OccurrenceMutation) RemoveReviewIDs(ids ...uuid.UUID)

RemoveReviewIDs removes the "reviews" edge to the Review entity by IDs.

func (*OccurrenceMutation) RemoveSideDishIDs

func (m *OccurrenceMutation) RemoveSideDishIDs(ids ...uuid.UUID)

RemoveSideDishIDs removes the "side_dishes" edge to the Dish entity by IDs.

func (*OccurrenceMutation) RemoveTagIDs

func (m *OccurrenceMutation) RemoveTagIDs(ids ...string)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*OccurrenceMutation) RemovedEdges

func (m *OccurrenceMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OccurrenceMutation) RemovedIDs

func (m *OccurrenceMutation) 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 (*OccurrenceMutation) RemovedReviewsIDs

func (m *OccurrenceMutation) RemovedReviewsIDs() (ids []uuid.UUID)

RemovedReviews returns the removed IDs of the "reviews" edge to the Review entity.

func (*OccurrenceMutation) RemovedSideDishesIDs

func (m *OccurrenceMutation) RemovedSideDishesIDs() (ids []uuid.UUID)

RemovedSideDishes returns the removed IDs of the "side_dishes" edge to the Dish entity.

func (*OccurrenceMutation) RemovedTagsIDs

func (m *OccurrenceMutation) RemovedTagsIDs() (ids []string)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*OccurrenceMutation) ResetCarbohydrates

func (m *OccurrenceMutation) ResetCarbohydrates()

ResetCarbohydrates resets all changes to the "carbohydrates" field.

func (*OccurrenceMutation) ResetDate

func (m *OccurrenceMutation) ResetDate()

ResetDate resets all changes to the "date" field.

func (*OccurrenceMutation) ResetDish

func (m *OccurrenceMutation) ResetDish()

ResetDish resets all changes to the "dish" edge.

func (*OccurrenceMutation) ResetEdge

func (m *OccurrenceMutation) 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 (*OccurrenceMutation) ResetFat

func (m *OccurrenceMutation) ResetFat()

ResetFat resets all changes to the "fat" field.

func (*OccurrenceMutation) ResetFiber

func (m *OccurrenceMutation) ResetFiber()

ResetFiber resets all changes to the "fiber" field.

func (*OccurrenceMutation) ResetField

func (m *OccurrenceMutation) 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 (*OccurrenceMutation) ResetKcal

func (m *OccurrenceMutation) ResetKcal()

ResetKcal resets all changes to the "kcal" field.

func (*OccurrenceMutation) ResetKj

func (m *OccurrenceMutation) ResetKj()

ResetKj resets all changes to the "kj" field.

func (*OccurrenceMutation) ResetLocation

func (m *OccurrenceMutation) ResetLocation()

ResetLocation resets all changes to the "location" edge.

func (*OccurrenceMutation) ResetNotAvailableAfter added in v0.7.0

func (m *OccurrenceMutation) ResetNotAvailableAfter()

ResetNotAvailableAfter resets all changes to the "not_available_after" field.

func (*OccurrenceMutation) ResetPriceGuest

func (m *OccurrenceMutation) ResetPriceGuest()

ResetPriceGuest resets all changes to the "price_guest" field.

func (*OccurrenceMutation) ResetPriceStaff

func (m *OccurrenceMutation) ResetPriceStaff()

ResetPriceStaff resets all changes to the "price_staff" field.

func (*OccurrenceMutation) ResetPriceStudent

func (m *OccurrenceMutation) ResetPriceStudent()

ResetPriceStudent resets all changes to the "price_student" field.

func (*OccurrenceMutation) ResetProtein

func (m *OccurrenceMutation) ResetProtein()

ResetProtein resets all changes to the "protein" field.

func (*OccurrenceMutation) ResetReviews

func (m *OccurrenceMutation) ResetReviews()

ResetReviews resets all changes to the "reviews" edge.

func (*OccurrenceMutation) ResetSalt

func (m *OccurrenceMutation) ResetSalt()

ResetSalt resets all changes to the "salt" field.

func (*OccurrenceMutation) ResetSaturatedFat

func (m *OccurrenceMutation) ResetSaturatedFat()

ResetSaturatedFat resets all changes to the "saturated_fat" field.

func (*OccurrenceMutation) ResetSideDishes

func (m *OccurrenceMutation) ResetSideDishes()

ResetSideDishes resets all changes to the "side_dishes" edge.

func (*OccurrenceMutation) ResetSugar

func (m *OccurrenceMutation) ResetSugar()

ResetSugar resets all changes to the "sugar" field.

func (*OccurrenceMutation) ResetTags

func (m *OccurrenceMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*OccurrenceMutation) ReviewsCleared

func (m *OccurrenceMutation) ReviewsCleared() bool

ReviewsCleared reports if the "reviews" edge to the Review entity was cleared.

func (*OccurrenceMutation) ReviewsIDs

func (m *OccurrenceMutation) ReviewsIDs() (ids []uuid.UUID)

ReviewsIDs returns the "reviews" edge IDs in the mutation.

func (*OccurrenceMutation) Salt

func (m *OccurrenceMutation) Salt() (r int, exists bool)

Salt returns the value of the "salt" field in the mutation.

func (*OccurrenceMutation) SaltCleared

func (m *OccurrenceMutation) SaltCleared() bool

SaltCleared returns if the "salt" field was cleared in this mutation.

func (*OccurrenceMutation) SaturatedFat

func (m *OccurrenceMutation) SaturatedFat() (r int, exists bool)

SaturatedFat returns the value of the "saturated_fat" field in the mutation.

func (*OccurrenceMutation) SaturatedFatCleared

func (m *OccurrenceMutation) SaturatedFatCleared() bool

SaturatedFatCleared returns if the "saturated_fat" field was cleared in this mutation.

func (*OccurrenceMutation) SetCarbohydrates

func (m *OccurrenceMutation) SetCarbohydrates(i int)

SetCarbohydrates sets the "carbohydrates" field.

func (*OccurrenceMutation) SetDate

func (m *OccurrenceMutation) SetDate(t time.Time)

SetDate sets the "date" field.

func (*OccurrenceMutation) SetDishID

func (m *OccurrenceMutation) SetDishID(id uuid.UUID)

SetDishID sets the "dish" edge to the Dish entity by id.

func (*OccurrenceMutation) SetFat

func (m *OccurrenceMutation) SetFat(i int)

SetFat sets the "fat" field.

func (*OccurrenceMutation) SetFiber

func (m *OccurrenceMutation) SetFiber(i int)

SetFiber sets the "fiber" field.

func (*OccurrenceMutation) SetField

func (m *OccurrenceMutation) 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 (*OccurrenceMutation) SetID

func (m *OccurrenceMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Occurrence entities.

func (*OccurrenceMutation) SetKcal

func (m *OccurrenceMutation) SetKcal(i int)

SetKcal sets the "kcal" field.

func (*OccurrenceMutation) SetKj

func (m *OccurrenceMutation) SetKj(i int)

SetKj sets the "kj" field.

func (*OccurrenceMutation) SetLocationID

func (m *OccurrenceMutation) SetLocationID(id uuid.UUID)

SetLocationID sets the "location" edge to the Location entity by id.

func (*OccurrenceMutation) SetNotAvailableAfter added in v0.7.0

func (m *OccurrenceMutation) SetNotAvailableAfter(t time.Time)

SetNotAvailableAfter sets the "not_available_after" field.

func (*OccurrenceMutation) SetOp

func (m *OccurrenceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OccurrenceMutation) SetPriceGuest

func (m *OccurrenceMutation) SetPriceGuest(i int)

SetPriceGuest sets the "price_guest" field.

func (*OccurrenceMutation) SetPriceStaff

func (m *OccurrenceMutation) SetPriceStaff(i int)

SetPriceStaff sets the "price_staff" field.

func (*OccurrenceMutation) SetPriceStudent

func (m *OccurrenceMutation) SetPriceStudent(i int)

SetPriceStudent sets the "price_student" field.

func (*OccurrenceMutation) SetProtein

func (m *OccurrenceMutation) SetProtein(i int)

SetProtein sets the "protein" field.

func (*OccurrenceMutation) SetSalt

func (m *OccurrenceMutation) SetSalt(i int)

SetSalt sets the "salt" field.

func (*OccurrenceMutation) SetSaturatedFat

func (m *OccurrenceMutation) SetSaturatedFat(i int)

SetSaturatedFat sets the "saturated_fat" field.

func (*OccurrenceMutation) SetSugar

func (m *OccurrenceMutation) SetSugar(i int)

SetSugar sets the "sugar" field.

func (*OccurrenceMutation) SideDishesCleared

func (m *OccurrenceMutation) SideDishesCleared() bool

SideDishesCleared reports if the "side_dishes" edge to the Dish entity was cleared.

func (*OccurrenceMutation) SideDishesIDs

func (m *OccurrenceMutation) SideDishesIDs() (ids []uuid.UUID)

SideDishesIDs returns the "side_dishes" edge IDs in the mutation.

func (*OccurrenceMutation) Sugar

func (m *OccurrenceMutation) Sugar() (r int, exists bool)

Sugar returns the value of the "sugar" field in the mutation.

func (*OccurrenceMutation) SugarCleared

func (m *OccurrenceMutation) SugarCleared() bool

SugarCleared returns if the "sugar" field was cleared in this mutation.

func (*OccurrenceMutation) TagsCleared

func (m *OccurrenceMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*OccurrenceMutation) TagsIDs

func (m *OccurrenceMutation) TagsIDs() (ids []string)

TagsIDs returns the "tags" edge IDs in the mutation.

func (OccurrenceMutation) Tx

func (m OccurrenceMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OccurrenceMutation) Type

func (m *OccurrenceMutation) Type() string

Type returns the node type of this mutation (Occurrence).

func (*OccurrenceMutation) Where

func (m *OccurrenceMutation) Where(ps ...predicate.Occurrence)

Where appends a list predicates to the OccurrenceMutation builder.

func (*OccurrenceMutation) WhereP

func (m *OccurrenceMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OccurrenceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OccurrenceQuery

type OccurrenceQuery struct {
	// contains filtered or unexported fields
}

OccurrenceQuery is the builder for querying Occurrence entities.

func (*OccurrenceQuery) Aggregate

func (oq *OccurrenceQuery) Aggregate(fns ...AggregateFunc) *OccurrenceSelect

Aggregate returns a OccurrenceSelect configured with the given aggregations.

func (*OccurrenceQuery) All

func (oq *OccurrenceQuery) All(ctx context.Context) ([]*Occurrence, error)

All executes the query and returns a list of Occurrences.

func (*OccurrenceQuery) AllX

func (oq *OccurrenceQuery) AllX(ctx context.Context) []*Occurrence

AllX is like All, but panics if an error occurs.

func (*OccurrenceQuery) Clone

func (oq *OccurrenceQuery) Clone() *OccurrenceQuery

Clone returns a duplicate of the OccurrenceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OccurrenceQuery) Count

func (oq *OccurrenceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OccurrenceQuery) CountX

func (oq *OccurrenceQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OccurrenceQuery) Exist

func (oq *OccurrenceQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OccurrenceQuery) ExistX

func (oq *OccurrenceQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OccurrenceQuery) First

func (oq *OccurrenceQuery) First(ctx context.Context) (*Occurrence, error)

First returns the first Occurrence entity from the query. Returns a *NotFoundError when no Occurrence was found.

func (*OccurrenceQuery) FirstID

func (oq *OccurrenceQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Occurrence ID from the query. Returns a *NotFoundError when no Occurrence ID was found.

func (*OccurrenceQuery) FirstIDX

func (oq *OccurrenceQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*OccurrenceQuery) FirstX

func (oq *OccurrenceQuery) FirstX(ctx context.Context) *Occurrence

FirstX is like First, but panics if an error occurs.

func (*OccurrenceQuery) GroupBy

func (oq *OccurrenceQuery) GroupBy(field string, fields ...string) *OccurrenceGroupBy

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 {
	Date time.Time `json:"date,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Occurrence.Query().
	GroupBy(occurrence.FieldDate).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OccurrenceQuery) IDs

func (oq *OccurrenceQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Occurrence IDs.

func (*OccurrenceQuery) IDsX

func (oq *OccurrenceQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*OccurrenceQuery) Limit

func (oq *OccurrenceQuery) Limit(limit int) *OccurrenceQuery

Limit the number of records to be returned by this query.

func (*OccurrenceQuery) Offset

func (oq *OccurrenceQuery) Offset(offset int) *OccurrenceQuery

Offset to start from.

func (*OccurrenceQuery) Only

func (oq *OccurrenceQuery) Only(ctx context.Context) (*Occurrence, error)

Only returns a single Occurrence entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Occurrence entity is found. Returns a *NotFoundError when no Occurrence entities are found.

func (*OccurrenceQuery) OnlyID

func (oq *OccurrenceQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Occurrence ID in the query. Returns a *NotSingularError when more than one Occurrence ID is found. Returns a *NotFoundError when no entities are found.

func (*OccurrenceQuery) OnlyIDX

func (oq *OccurrenceQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OccurrenceQuery) OnlyX

func (oq *OccurrenceQuery) OnlyX(ctx context.Context) *Occurrence

OnlyX is like Only, but panics if an error occurs.

func (*OccurrenceQuery) Order

Order specifies how the records should be ordered.

func (*OccurrenceQuery) QueryDish

func (oq *OccurrenceQuery) QueryDish() *DishQuery

QueryDish chains the current query on the "dish" edge.

func (*OccurrenceQuery) QueryLocation

func (oq *OccurrenceQuery) QueryLocation() *LocationQuery

QueryLocation chains the current query on the "location" edge.

func (*OccurrenceQuery) QueryReviews

func (oq *OccurrenceQuery) QueryReviews() *ReviewQuery

QueryReviews chains the current query on the "reviews" edge.

func (*OccurrenceQuery) QuerySideDishes

func (oq *OccurrenceQuery) QuerySideDishes() *DishQuery

QuerySideDishes chains the current query on the "side_dishes" edge.

func (*OccurrenceQuery) QueryTags

func (oq *OccurrenceQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*OccurrenceQuery) Select

func (oq *OccurrenceQuery) Select(fields ...string) *OccurrenceSelect

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 {
	Date time.Time `json:"date,omitempty"`
}

client.Occurrence.Query().
	Select(occurrence.FieldDate).
	Scan(ctx, &v)

func (*OccurrenceQuery) Unique

func (oq *OccurrenceQuery) Unique(unique bool) *OccurrenceQuery

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 (*OccurrenceQuery) Where

Where adds a new predicate for the OccurrenceQuery builder.

func (*OccurrenceQuery) WithDish

func (oq *OccurrenceQuery) WithDish(opts ...func(*DishQuery)) *OccurrenceQuery

WithDish tells the query-builder to eager-load the nodes that are connected to the "dish" edge. The optional arguments are used to configure the query builder of the edge.

func (*OccurrenceQuery) WithLocation

func (oq *OccurrenceQuery) WithLocation(opts ...func(*LocationQuery)) *OccurrenceQuery

WithLocation tells the query-builder to eager-load the nodes that are connected to the "location" edge. The optional arguments are used to configure the query builder of the edge.

func (*OccurrenceQuery) WithReviews

func (oq *OccurrenceQuery) WithReviews(opts ...func(*ReviewQuery)) *OccurrenceQuery

WithReviews tells the query-builder to eager-load the nodes that are connected to the "reviews" edge. The optional arguments are used to configure the query builder of the edge.

func (*OccurrenceQuery) WithSideDishes

func (oq *OccurrenceQuery) WithSideDishes(opts ...func(*DishQuery)) *OccurrenceQuery

WithSideDishes tells the query-builder to eager-load the nodes that are connected to the "side_dishes" edge. The optional arguments are used to configure the query builder of the edge.

func (*OccurrenceQuery) WithTags

func (oq *OccurrenceQuery) WithTags(opts ...func(*TagQuery)) *OccurrenceQuery

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 OccurrenceSelect

type OccurrenceSelect struct {
	*OccurrenceQuery
	// contains filtered or unexported fields
}

OccurrenceSelect is the builder for selecting fields of Occurrence entities.

func (*OccurrenceSelect) Aggregate

func (os *OccurrenceSelect) Aggregate(fns ...AggregateFunc) *OccurrenceSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OccurrenceSelect) Bool

func (s *OccurrenceSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OccurrenceSelect) BoolX

func (s *OccurrenceSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OccurrenceSelect) Bools

func (s *OccurrenceSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OccurrenceSelect) BoolsX

func (s *OccurrenceSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OccurrenceSelect) Float64

func (s *OccurrenceSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OccurrenceSelect) Float64X

func (s *OccurrenceSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OccurrenceSelect) Float64s

func (s *OccurrenceSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OccurrenceSelect) Float64sX

func (s *OccurrenceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OccurrenceSelect) Int

func (s *OccurrenceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OccurrenceSelect) IntX

func (s *OccurrenceSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OccurrenceSelect) Ints

func (s *OccurrenceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OccurrenceSelect) IntsX

func (s *OccurrenceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OccurrenceSelect) Scan

func (os *OccurrenceSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OccurrenceSelect) ScanX

func (s *OccurrenceSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OccurrenceSelect) String

func (s *OccurrenceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OccurrenceSelect) StringX

func (s *OccurrenceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OccurrenceSelect) Strings

func (s *OccurrenceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OccurrenceSelect) StringsX

func (s *OccurrenceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OccurrenceUpdate

type OccurrenceUpdate struct {
	// contains filtered or unexported fields
}

OccurrenceUpdate is the builder for updating Occurrence entities.

func (*OccurrenceUpdate) AddCarbohydrates

func (ou *OccurrenceUpdate) AddCarbohydrates(i int) *OccurrenceUpdate

AddCarbohydrates adds i to the "carbohydrates" field.

func (*OccurrenceUpdate) AddFat

func (ou *OccurrenceUpdate) AddFat(i int) *OccurrenceUpdate

AddFat adds i to the "fat" field.

func (*OccurrenceUpdate) AddFiber

func (ou *OccurrenceUpdate) AddFiber(i int) *OccurrenceUpdate

AddFiber adds i to the "fiber" field.

func (*OccurrenceUpdate) AddKcal

func (ou *OccurrenceUpdate) AddKcal(i int) *OccurrenceUpdate

AddKcal adds i to the "kcal" field.

func (*OccurrenceUpdate) AddKj

func (ou *OccurrenceUpdate) AddKj(i int) *OccurrenceUpdate

AddKj adds i to the "kj" field.

func (*OccurrenceUpdate) AddPriceGuest

func (ou *OccurrenceUpdate) AddPriceGuest(i int) *OccurrenceUpdate

AddPriceGuest adds i to the "price_guest" field.

func (*OccurrenceUpdate) AddPriceStaff

func (ou *OccurrenceUpdate) AddPriceStaff(i int) *OccurrenceUpdate

AddPriceStaff adds i to the "price_staff" field.

func (*OccurrenceUpdate) AddPriceStudent

func (ou *OccurrenceUpdate) AddPriceStudent(i int) *OccurrenceUpdate

AddPriceStudent adds i to the "price_student" field.

func (*OccurrenceUpdate) AddProtein

func (ou *OccurrenceUpdate) AddProtein(i int) *OccurrenceUpdate

AddProtein adds i to the "protein" field.

func (*OccurrenceUpdate) AddReviewIDs

func (ou *OccurrenceUpdate) AddReviewIDs(ids ...uuid.UUID) *OccurrenceUpdate

AddReviewIDs adds the "reviews" edge to the Review entity by IDs.

func (*OccurrenceUpdate) AddReviews

func (ou *OccurrenceUpdate) AddReviews(r ...*Review) *OccurrenceUpdate

AddReviews adds the "reviews" edges to the Review entity.

func (*OccurrenceUpdate) AddSalt

func (ou *OccurrenceUpdate) AddSalt(i int) *OccurrenceUpdate

AddSalt adds i to the "salt" field.

func (*OccurrenceUpdate) AddSaturatedFat

func (ou *OccurrenceUpdate) AddSaturatedFat(i int) *OccurrenceUpdate

AddSaturatedFat adds i to the "saturated_fat" field.

func (*OccurrenceUpdate) AddSideDishIDs

func (ou *OccurrenceUpdate) AddSideDishIDs(ids ...uuid.UUID) *OccurrenceUpdate

AddSideDishIDs adds the "side_dishes" edge to the Dish entity by IDs.

func (*OccurrenceUpdate) AddSideDishes

func (ou *OccurrenceUpdate) AddSideDishes(d ...*Dish) *OccurrenceUpdate

AddSideDishes adds the "side_dishes" edges to the Dish entity.

func (*OccurrenceUpdate) AddSugar

func (ou *OccurrenceUpdate) AddSugar(i int) *OccurrenceUpdate

AddSugar adds i to the "sugar" field.

func (*OccurrenceUpdate) AddTagIDs

func (ou *OccurrenceUpdate) AddTagIDs(ids ...string) *OccurrenceUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*OccurrenceUpdate) AddTags

func (ou *OccurrenceUpdate) AddTags(t ...*Tag) *OccurrenceUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*OccurrenceUpdate) ClearCarbohydrates

func (ou *OccurrenceUpdate) ClearCarbohydrates() *OccurrenceUpdate

ClearCarbohydrates clears the value of the "carbohydrates" field.

func (*OccurrenceUpdate) ClearDish

func (ou *OccurrenceUpdate) ClearDish() *OccurrenceUpdate

ClearDish clears the "dish" edge to the Dish entity.

func (*OccurrenceUpdate) ClearFat

func (ou *OccurrenceUpdate) ClearFat() *OccurrenceUpdate

ClearFat clears the value of the "fat" field.

func (*OccurrenceUpdate) ClearFiber

func (ou *OccurrenceUpdate) ClearFiber() *OccurrenceUpdate

ClearFiber clears the value of the "fiber" field.

func (*OccurrenceUpdate) ClearKcal

func (ou *OccurrenceUpdate) ClearKcal() *OccurrenceUpdate

ClearKcal clears the value of the "kcal" field.

func (*OccurrenceUpdate) ClearKj

func (ou *OccurrenceUpdate) ClearKj() *OccurrenceUpdate

ClearKj clears the value of the "kj" field.

func (*OccurrenceUpdate) ClearLocation

func (ou *OccurrenceUpdate) ClearLocation() *OccurrenceUpdate

ClearLocation clears the "location" edge to the Location entity.

func (*OccurrenceUpdate) ClearNotAvailableAfter added in v0.7.0

func (ou *OccurrenceUpdate) ClearNotAvailableAfter() *OccurrenceUpdate

ClearNotAvailableAfter clears the value of the "not_available_after" field.

func (*OccurrenceUpdate) ClearPriceGuest

func (ou *OccurrenceUpdate) ClearPriceGuest() *OccurrenceUpdate

ClearPriceGuest clears the value of the "price_guest" field.

func (*OccurrenceUpdate) ClearPriceStaff

func (ou *OccurrenceUpdate) ClearPriceStaff() *OccurrenceUpdate

ClearPriceStaff clears the value of the "price_staff" field.

func (*OccurrenceUpdate) ClearPriceStudent

func (ou *OccurrenceUpdate) ClearPriceStudent() *OccurrenceUpdate

ClearPriceStudent clears the value of the "price_student" field.

func (*OccurrenceUpdate) ClearProtein

func (ou *OccurrenceUpdate) ClearProtein() *OccurrenceUpdate

ClearProtein clears the value of the "protein" field.

func (*OccurrenceUpdate) ClearReviews

func (ou *OccurrenceUpdate) ClearReviews() *OccurrenceUpdate

ClearReviews clears all "reviews" edges to the Review entity.

func (*OccurrenceUpdate) ClearSalt

func (ou *OccurrenceUpdate) ClearSalt() *OccurrenceUpdate

ClearSalt clears the value of the "salt" field.

func (*OccurrenceUpdate) ClearSaturatedFat

func (ou *OccurrenceUpdate) ClearSaturatedFat() *OccurrenceUpdate

ClearSaturatedFat clears the value of the "saturated_fat" field.

func (*OccurrenceUpdate) ClearSideDishes

func (ou *OccurrenceUpdate) ClearSideDishes() *OccurrenceUpdate

ClearSideDishes clears all "side_dishes" edges to the Dish entity.

func (*OccurrenceUpdate) ClearSugar

func (ou *OccurrenceUpdate) ClearSugar() *OccurrenceUpdate

ClearSugar clears the value of the "sugar" field.

func (*OccurrenceUpdate) ClearTags

func (ou *OccurrenceUpdate) ClearTags() *OccurrenceUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*OccurrenceUpdate) Exec

func (ou *OccurrenceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OccurrenceUpdate) ExecX

func (ou *OccurrenceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OccurrenceUpdate) Mutation

func (ou *OccurrenceUpdate) Mutation() *OccurrenceMutation

Mutation returns the OccurrenceMutation object of the builder.

func (*OccurrenceUpdate) RemoveReviewIDs

func (ou *OccurrenceUpdate) RemoveReviewIDs(ids ...uuid.UUID) *OccurrenceUpdate

RemoveReviewIDs removes the "reviews" edge to Review entities by IDs.

func (*OccurrenceUpdate) RemoveReviews

func (ou *OccurrenceUpdate) RemoveReviews(r ...*Review) *OccurrenceUpdate

RemoveReviews removes "reviews" edges to Review entities.

func (*OccurrenceUpdate) RemoveSideDishIDs

func (ou *OccurrenceUpdate) RemoveSideDishIDs(ids ...uuid.UUID) *OccurrenceUpdate

RemoveSideDishIDs removes the "side_dishes" edge to Dish entities by IDs.

func (*OccurrenceUpdate) RemoveSideDishes

func (ou *OccurrenceUpdate) RemoveSideDishes(d ...*Dish) *OccurrenceUpdate

RemoveSideDishes removes "side_dishes" edges to Dish entities.

func (*OccurrenceUpdate) RemoveTagIDs

func (ou *OccurrenceUpdate) RemoveTagIDs(ids ...string) *OccurrenceUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*OccurrenceUpdate) RemoveTags

func (ou *OccurrenceUpdate) RemoveTags(t ...*Tag) *OccurrenceUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*OccurrenceUpdate) Save

func (ou *OccurrenceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OccurrenceUpdate) SaveX

func (ou *OccurrenceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OccurrenceUpdate) SetCarbohydrates

func (ou *OccurrenceUpdate) SetCarbohydrates(i int) *OccurrenceUpdate

SetCarbohydrates sets the "carbohydrates" field.

func (*OccurrenceUpdate) SetDate

func (ou *OccurrenceUpdate) SetDate(t time.Time) *OccurrenceUpdate

SetDate sets the "date" field.

func (*OccurrenceUpdate) SetDish

func (ou *OccurrenceUpdate) SetDish(d *Dish) *OccurrenceUpdate

SetDish sets the "dish" edge to the Dish entity.

func (*OccurrenceUpdate) SetDishID

func (ou *OccurrenceUpdate) SetDishID(id uuid.UUID) *OccurrenceUpdate

SetDishID sets the "dish" edge to the Dish entity by ID.

func (*OccurrenceUpdate) SetFat

func (ou *OccurrenceUpdate) SetFat(i int) *OccurrenceUpdate

SetFat sets the "fat" field.

func (*OccurrenceUpdate) SetFiber

func (ou *OccurrenceUpdate) SetFiber(i int) *OccurrenceUpdate

SetFiber sets the "fiber" field.

func (*OccurrenceUpdate) SetKcal

func (ou *OccurrenceUpdate) SetKcal(i int) *OccurrenceUpdate

SetKcal sets the "kcal" field.

func (*OccurrenceUpdate) SetKj

func (ou *OccurrenceUpdate) SetKj(i int) *OccurrenceUpdate

SetKj sets the "kj" field.

func (*OccurrenceUpdate) SetLocation

func (ou *OccurrenceUpdate) SetLocation(l *Location) *OccurrenceUpdate

SetLocation sets the "location" edge to the Location entity.

func (*OccurrenceUpdate) SetLocationID

func (ou *OccurrenceUpdate) SetLocationID(id uuid.UUID) *OccurrenceUpdate

SetLocationID sets the "location" edge to the Location entity by ID.

func (*OccurrenceUpdate) SetNillableCarbohydrates

func (ou *OccurrenceUpdate) SetNillableCarbohydrates(i *int) *OccurrenceUpdate

SetNillableCarbohydrates sets the "carbohydrates" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillableDate

func (ou *OccurrenceUpdate) SetNillableDate(t *time.Time) *OccurrenceUpdate

SetNillableDate sets the "date" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillableFat

func (ou *OccurrenceUpdate) SetNillableFat(i *int) *OccurrenceUpdate

SetNillableFat sets the "fat" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillableFiber

func (ou *OccurrenceUpdate) SetNillableFiber(i *int) *OccurrenceUpdate

SetNillableFiber sets the "fiber" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillableKcal

func (ou *OccurrenceUpdate) SetNillableKcal(i *int) *OccurrenceUpdate

SetNillableKcal sets the "kcal" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillableKj

func (ou *OccurrenceUpdate) SetNillableKj(i *int) *OccurrenceUpdate

SetNillableKj sets the "kj" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillableNotAvailableAfter added in v0.7.0

func (ou *OccurrenceUpdate) SetNillableNotAvailableAfter(t *time.Time) *OccurrenceUpdate

SetNillableNotAvailableAfter sets the "not_available_after" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillablePriceGuest

func (ou *OccurrenceUpdate) SetNillablePriceGuest(i *int) *OccurrenceUpdate

SetNillablePriceGuest sets the "price_guest" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillablePriceStaff

func (ou *OccurrenceUpdate) SetNillablePriceStaff(i *int) *OccurrenceUpdate

SetNillablePriceStaff sets the "price_staff" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillablePriceStudent

func (ou *OccurrenceUpdate) SetNillablePriceStudent(i *int) *OccurrenceUpdate

SetNillablePriceStudent sets the "price_student" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillableProtein

func (ou *OccurrenceUpdate) SetNillableProtein(i *int) *OccurrenceUpdate

SetNillableProtein sets the "protein" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillableSalt

func (ou *OccurrenceUpdate) SetNillableSalt(i *int) *OccurrenceUpdate

SetNillableSalt sets the "salt" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillableSaturatedFat

func (ou *OccurrenceUpdate) SetNillableSaturatedFat(i *int) *OccurrenceUpdate

SetNillableSaturatedFat sets the "saturated_fat" field if the given value is not nil.

func (*OccurrenceUpdate) SetNillableSugar

func (ou *OccurrenceUpdate) SetNillableSugar(i *int) *OccurrenceUpdate

SetNillableSugar sets the "sugar" field if the given value is not nil.

func (*OccurrenceUpdate) SetNotAvailableAfter added in v0.7.0

func (ou *OccurrenceUpdate) SetNotAvailableAfter(t time.Time) *OccurrenceUpdate

SetNotAvailableAfter sets the "not_available_after" field.

func (*OccurrenceUpdate) SetPriceGuest

func (ou *OccurrenceUpdate) SetPriceGuest(i int) *OccurrenceUpdate

SetPriceGuest sets the "price_guest" field.

func (*OccurrenceUpdate) SetPriceStaff

func (ou *OccurrenceUpdate) SetPriceStaff(i int) *OccurrenceUpdate

SetPriceStaff sets the "price_staff" field.

func (*OccurrenceUpdate) SetPriceStudent

func (ou *OccurrenceUpdate) SetPriceStudent(i int) *OccurrenceUpdate

SetPriceStudent sets the "price_student" field.

func (*OccurrenceUpdate) SetProtein

func (ou *OccurrenceUpdate) SetProtein(i int) *OccurrenceUpdate

SetProtein sets the "protein" field.

func (*OccurrenceUpdate) SetSalt

func (ou *OccurrenceUpdate) SetSalt(i int) *OccurrenceUpdate

SetSalt sets the "salt" field.

func (*OccurrenceUpdate) SetSaturatedFat

func (ou *OccurrenceUpdate) SetSaturatedFat(i int) *OccurrenceUpdate

SetSaturatedFat sets the "saturated_fat" field.

func (*OccurrenceUpdate) SetSugar

func (ou *OccurrenceUpdate) SetSugar(i int) *OccurrenceUpdate

SetSugar sets the "sugar" field.

func (*OccurrenceUpdate) Where

Where appends a list predicates to the OccurrenceUpdate builder.

type OccurrenceUpdateOne

type OccurrenceUpdateOne struct {
	// contains filtered or unexported fields
}

OccurrenceUpdateOne is the builder for updating a single Occurrence entity.

func (*OccurrenceUpdateOne) AddCarbohydrates

func (ouo *OccurrenceUpdateOne) AddCarbohydrates(i int) *OccurrenceUpdateOne

AddCarbohydrates adds i to the "carbohydrates" field.

func (*OccurrenceUpdateOne) AddFat

AddFat adds i to the "fat" field.

func (*OccurrenceUpdateOne) AddFiber

func (ouo *OccurrenceUpdateOne) AddFiber(i int) *OccurrenceUpdateOne

AddFiber adds i to the "fiber" field.

func (*OccurrenceUpdateOne) AddKcal

func (ouo *OccurrenceUpdateOne) AddKcal(i int) *OccurrenceUpdateOne

AddKcal adds i to the "kcal" field.

func (*OccurrenceUpdateOne) AddKj

AddKj adds i to the "kj" field.

func (*OccurrenceUpdateOne) AddPriceGuest

func (ouo *OccurrenceUpdateOne) AddPriceGuest(i int) *OccurrenceUpdateOne

AddPriceGuest adds i to the "price_guest" field.

func (*OccurrenceUpdateOne) AddPriceStaff

func (ouo *OccurrenceUpdateOne) AddPriceStaff(i int) *OccurrenceUpdateOne

AddPriceStaff adds i to the "price_staff" field.

func (*OccurrenceUpdateOne) AddPriceStudent

func (ouo *OccurrenceUpdateOne) AddPriceStudent(i int) *OccurrenceUpdateOne

AddPriceStudent adds i to the "price_student" field.

func (*OccurrenceUpdateOne) AddProtein

func (ouo *OccurrenceUpdateOne) AddProtein(i int) *OccurrenceUpdateOne

AddProtein adds i to the "protein" field.

func (*OccurrenceUpdateOne) AddReviewIDs

func (ouo *OccurrenceUpdateOne) AddReviewIDs(ids ...uuid.UUID) *OccurrenceUpdateOne

AddReviewIDs adds the "reviews" edge to the Review entity by IDs.

func (*OccurrenceUpdateOne) AddReviews

func (ouo *OccurrenceUpdateOne) AddReviews(r ...*Review) *OccurrenceUpdateOne

AddReviews adds the "reviews" edges to the Review entity.

func (*OccurrenceUpdateOne) AddSalt

func (ouo *OccurrenceUpdateOne) AddSalt(i int) *OccurrenceUpdateOne

AddSalt adds i to the "salt" field.

func (*OccurrenceUpdateOne) AddSaturatedFat

func (ouo *OccurrenceUpdateOne) AddSaturatedFat(i int) *OccurrenceUpdateOne

AddSaturatedFat adds i to the "saturated_fat" field.

func (*OccurrenceUpdateOne) AddSideDishIDs

func (ouo *OccurrenceUpdateOne) AddSideDishIDs(ids ...uuid.UUID) *OccurrenceUpdateOne

AddSideDishIDs adds the "side_dishes" edge to the Dish entity by IDs.

func (*OccurrenceUpdateOne) AddSideDishes

func (ouo *OccurrenceUpdateOne) AddSideDishes(d ...*Dish) *OccurrenceUpdateOne

AddSideDishes adds the "side_dishes" edges to the Dish entity.

func (*OccurrenceUpdateOne) AddSugar

func (ouo *OccurrenceUpdateOne) AddSugar(i int) *OccurrenceUpdateOne

AddSugar adds i to the "sugar" field.

func (*OccurrenceUpdateOne) AddTagIDs

func (ouo *OccurrenceUpdateOne) AddTagIDs(ids ...string) *OccurrenceUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*OccurrenceUpdateOne) AddTags

func (ouo *OccurrenceUpdateOne) AddTags(t ...*Tag) *OccurrenceUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*OccurrenceUpdateOne) ClearCarbohydrates

func (ouo *OccurrenceUpdateOne) ClearCarbohydrates() *OccurrenceUpdateOne

ClearCarbohydrates clears the value of the "carbohydrates" field.

func (*OccurrenceUpdateOne) ClearDish

func (ouo *OccurrenceUpdateOne) ClearDish() *OccurrenceUpdateOne

ClearDish clears the "dish" edge to the Dish entity.

func (*OccurrenceUpdateOne) ClearFat

func (ouo *OccurrenceUpdateOne) ClearFat() *OccurrenceUpdateOne

ClearFat clears the value of the "fat" field.

func (*OccurrenceUpdateOne) ClearFiber

func (ouo *OccurrenceUpdateOne) ClearFiber() *OccurrenceUpdateOne

ClearFiber clears the value of the "fiber" field.

func (*OccurrenceUpdateOne) ClearKcal

func (ouo *OccurrenceUpdateOne) ClearKcal() *OccurrenceUpdateOne

ClearKcal clears the value of the "kcal" field.

func (*OccurrenceUpdateOne) ClearKj

func (ouo *OccurrenceUpdateOne) ClearKj() *OccurrenceUpdateOne

ClearKj clears the value of the "kj" field.

func (*OccurrenceUpdateOne) ClearLocation

func (ouo *OccurrenceUpdateOne) ClearLocation() *OccurrenceUpdateOne

ClearLocation clears the "location" edge to the Location entity.

func (*OccurrenceUpdateOne) ClearNotAvailableAfter added in v0.7.0

func (ouo *OccurrenceUpdateOne) ClearNotAvailableAfter() *OccurrenceUpdateOne

ClearNotAvailableAfter clears the value of the "not_available_after" field.

func (*OccurrenceUpdateOne) ClearPriceGuest

func (ouo *OccurrenceUpdateOne) ClearPriceGuest() *OccurrenceUpdateOne

ClearPriceGuest clears the value of the "price_guest" field.

func (*OccurrenceUpdateOne) ClearPriceStaff

func (ouo *OccurrenceUpdateOne) ClearPriceStaff() *OccurrenceUpdateOne

ClearPriceStaff clears the value of the "price_staff" field.

func (*OccurrenceUpdateOne) ClearPriceStudent

func (ouo *OccurrenceUpdateOne) ClearPriceStudent() *OccurrenceUpdateOne

ClearPriceStudent clears the value of the "price_student" field.

func (*OccurrenceUpdateOne) ClearProtein

func (ouo *OccurrenceUpdateOne) ClearProtein() *OccurrenceUpdateOne

ClearProtein clears the value of the "protein" field.

func (*OccurrenceUpdateOne) ClearReviews

func (ouo *OccurrenceUpdateOne) ClearReviews() *OccurrenceUpdateOne

ClearReviews clears all "reviews" edges to the Review entity.

func (*OccurrenceUpdateOne) ClearSalt

func (ouo *OccurrenceUpdateOne) ClearSalt() *OccurrenceUpdateOne

ClearSalt clears the value of the "salt" field.

func (*OccurrenceUpdateOne) ClearSaturatedFat

func (ouo *OccurrenceUpdateOne) ClearSaturatedFat() *OccurrenceUpdateOne

ClearSaturatedFat clears the value of the "saturated_fat" field.

func (*OccurrenceUpdateOne) ClearSideDishes

func (ouo *OccurrenceUpdateOne) ClearSideDishes() *OccurrenceUpdateOne

ClearSideDishes clears all "side_dishes" edges to the Dish entity.

func (*OccurrenceUpdateOne) ClearSugar

func (ouo *OccurrenceUpdateOne) ClearSugar() *OccurrenceUpdateOne

ClearSugar clears the value of the "sugar" field.

func (*OccurrenceUpdateOne) ClearTags

func (ouo *OccurrenceUpdateOne) ClearTags() *OccurrenceUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*OccurrenceUpdateOne) Exec

func (ouo *OccurrenceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OccurrenceUpdateOne) ExecX

func (ouo *OccurrenceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OccurrenceUpdateOne) Mutation

func (ouo *OccurrenceUpdateOne) Mutation() *OccurrenceMutation

Mutation returns the OccurrenceMutation object of the builder.

func (*OccurrenceUpdateOne) RemoveReviewIDs

func (ouo *OccurrenceUpdateOne) RemoveReviewIDs(ids ...uuid.UUID) *OccurrenceUpdateOne

RemoveReviewIDs removes the "reviews" edge to Review entities by IDs.

func (*OccurrenceUpdateOne) RemoveReviews

func (ouo *OccurrenceUpdateOne) RemoveReviews(r ...*Review) *OccurrenceUpdateOne

RemoveReviews removes "reviews" edges to Review entities.

func (*OccurrenceUpdateOne) RemoveSideDishIDs

func (ouo *OccurrenceUpdateOne) RemoveSideDishIDs(ids ...uuid.UUID) *OccurrenceUpdateOne

RemoveSideDishIDs removes the "side_dishes" edge to Dish entities by IDs.

func (*OccurrenceUpdateOne) RemoveSideDishes

func (ouo *OccurrenceUpdateOne) RemoveSideDishes(d ...*Dish) *OccurrenceUpdateOne

RemoveSideDishes removes "side_dishes" edges to Dish entities.

func (*OccurrenceUpdateOne) RemoveTagIDs

func (ouo *OccurrenceUpdateOne) RemoveTagIDs(ids ...string) *OccurrenceUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*OccurrenceUpdateOne) RemoveTags

func (ouo *OccurrenceUpdateOne) RemoveTags(t ...*Tag) *OccurrenceUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*OccurrenceUpdateOne) Save

func (ouo *OccurrenceUpdateOne) Save(ctx context.Context) (*Occurrence, error)

Save executes the query and returns the updated Occurrence entity.

func (*OccurrenceUpdateOne) SaveX

func (ouo *OccurrenceUpdateOne) SaveX(ctx context.Context) *Occurrence

SaveX is like Save, but panics if an error occurs.

func (*OccurrenceUpdateOne) Select

func (ouo *OccurrenceUpdateOne) Select(field string, fields ...string) *OccurrenceUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OccurrenceUpdateOne) SetCarbohydrates

func (ouo *OccurrenceUpdateOne) SetCarbohydrates(i int) *OccurrenceUpdateOne

SetCarbohydrates sets the "carbohydrates" field.

func (*OccurrenceUpdateOne) SetDate

SetDate sets the "date" field.

func (*OccurrenceUpdateOne) SetDish

func (ouo *OccurrenceUpdateOne) SetDish(d *Dish) *OccurrenceUpdateOne

SetDish sets the "dish" edge to the Dish entity.

func (*OccurrenceUpdateOne) SetDishID

func (ouo *OccurrenceUpdateOne) SetDishID(id uuid.UUID) *OccurrenceUpdateOne

SetDishID sets the "dish" edge to the Dish entity by ID.

func (*OccurrenceUpdateOne) SetFat

SetFat sets the "fat" field.

func (*OccurrenceUpdateOne) SetFiber

func (ouo *OccurrenceUpdateOne) SetFiber(i int) *OccurrenceUpdateOne

SetFiber sets the "fiber" field.

func (*OccurrenceUpdateOne) SetKcal

func (ouo *OccurrenceUpdateOne) SetKcal(i int) *OccurrenceUpdateOne

SetKcal sets the "kcal" field.

func (*OccurrenceUpdateOne) SetKj

SetKj sets the "kj" field.

func (*OccurrenceUpdateOne) SetLocation

func (ouo *OccurrenceUpdateOne) SetLocation(l *Location) *OccurrenceUpdateOne

SetLocation sets the "location" edge to the Location entity.

func (*OccurrenceUpdateOne) SetLocationID

func (ouo *OccurrenceUpdateOne) SetLocationID(id uuid.UUID) *OccurrenceUpdateOne

SetLocationID sets the "location" edge to the Location entity by ID.

func (*OccurrenceUpdateOne) SetNillableCarbohydrates

func (ouo *OccurrenceUpdateOne) SetNillableCarbohydrates(i *int) *OccurrenceUpdateOne

SetNillableCarbohydrates sets the "carbohydrates" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillableDate

func (ouo *OccurrenceUpdateOne) SetNillableDate(t *time.Time) *OccurrenceUpdateOne

SetNillableDate sets the "date" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillableFat

func (ouo *OccurrenceUpdateOne) SetNillableFat(i *int) *OccurrenceUpdateOne

SetNillableFat sets the "fat" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillableFiber

func (ouo *OccurrenceUpdateOne) SetNillableFiber(i *int) *OccurrenceUpdateOne

SetNillableFiber sets the "fiber" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillableKcal

func (ouo *OccurrenceUpdateOne) SetNillableKcal(i *int) *OccurrenceUpdateOne

SetNillableKcal sets the "kcal" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillableKj

func (ouo *OccurrenceUpdateOne) SetNillableKj(i *int) *OccurrenceUpdateOne

SetNillableKj sets the "kj" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillableNotAvailableAfter added in v0.7.0

func (ouo *OccurrenceUpdateOne) SetNillableNotAvailableAfter(t *time.Time) *OccurrenceUpdateOne

SetNillableNotAvailableAfter sets the "not_available_after" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillablePriceGuest

func (ouo *OccurrenceUpdateOne) SetNillablePriceGuest(i *int) *OccurrenceUpdateOne

SetNillablePriceGuest sets the "price_guest" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillablePriceStaff

func (ouo *OccurrenceUpdateOne) SetNillablePriceStaff(i *int) *OccurrenceUpdateOne

SetNillablePriceStaff sets the "price_staff" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillablePriceStudent

func (ouo *OccurrenceUpdateOne) SetNillablePriceStudent(i *int) *OccurrenceUpdateOne

SetNillablePriceStudent sets the "price_student" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillableProtein

func (ouo *OccurrenceUpdateOne) SetNillableProtein(i *int) *OccurrenceUpdateOne

SetNillableProtein sets the "protein" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillableSalt

func (ouo *OccurrenceUpdateOne) SetNillableSalt(i *int) *OccurrenceUpdateOne

SetNillableSalt sets the "salt" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillableSaturatedFat

func (ouo *OccurrenceUpdateOne) SetNillableSaturatedFat(i *int) *OccurrenceUpdateOne

SetNillableSaturatedFat sets the "saturated_fat" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNillableSugar

func (ouo *OccurrenceUpdateOne) SetNillableSugar(i *int) *OccurrenceUpdateOne

SetNillableSugar sets the "sugar" field if the given value is not nil.

func (*OccurrenceUpdateOne) SetNotAvailableAfter added in v0.7.0

func (ouo *OccurrenceUpdateOne) SetNotAvailableAfter(t time.Time) *OccurrenceUpdateOne

SetNotAvailableAfter sets the "not_available_after" field.

func (*OccurrenceUpdateOne) SetPriceGuest

func (ouo *OccurrenceUpdateOne) SetPriceGuest(i int) *OccurrenceUpdateOne

SetPriceGuest sets the "price_guest" field.

func (*OccurrenceUpdateOne) SetPriceStaff

func (ouo *OccurrenceUpdateOne) SetPriceStaff(i int) *OccurrenceUpdateOne

SetPriceStaff sets the "price_staff" field.

func (*OccurrenceUpdateOne) SetPriceStudent

func (ouo *OccurrenceUpdateOne) SetPriceStudent(i int) *OccurrenceUpdateOne

SetPriceStudent sets the "price_student" field.

func (*OccurrenceUpdateOne) SetProtein

func (ouo *OccurrenceUpdateOne) SetProtein(i int) *OccurrenceUpdateOne

SetProtein sets the "protein" field.

func (*OccurrenceUpdateOne) SetSalt

func (ouo *OccurrenceUpdateOne) SetSalt(i int) *OccurrenceUpdateOne

SetSalt sets the "salt" field.

func (*OccurrenceUpdateOne) SetSaturatedFat

func (ouo *OccurrenceUpdateOne) SetSaturatedFat(i int) *OccurrenceUpdateOne

SetSaturatedFat sets the "saturated_fat" field.

func (*OccurrenceUpdateOne) SetSugar

func (ouo *OccurrenceUpdateOne) SetSugar(i int) *OccurrenceUpdateOne

SetSugar sets the "sugar" field.

func (*OccurrenceUpdateOne) Where

Where appends a list predicates to the OccurrenceUpdate builder.

type OccurrenceUpsert

type OccurrenceUpsert struct {
	*sql.UpdateSet
}

OccurrenceUpsert is the "OnConflict" setter.

func (*OccurrenceUpsert) AddCarbohydrates

func (u *OccurrenceUpsert) AddCarbohydrates(v int) *OccurrenceUpsert

AddCarbohydrates adds v to the "carbohydrates" field.

func (*OccurrenceUpsert) AddFat

func (u *OccurrenceUpsert) AddFat(v int) *OccurrenceUpsert

AddFat adds v to the "fat" field.

func (*OccurrenceUpsert) AddFiber

func (u *OccurrenceUpsert) AddFiber(v int) *OccurrenceUpsert

AddFiber adds v to the "fiber" field.

func (*OccurrenceUpsert) AddKcal

func (u *OccurrenceUpsert) AddKcal(v int) *OccurrenceUpsert

AddKcal adds v to the "kcal" field.

func (*OccurrenceUpsert) AddKj

func (u *OccurrenceUpsert) AddKj(v int) *OccurrenceUpsert

AddKj adds v to the "kj" field.

func (*OccurrenceUpsert) AddPriceGuest

func (u *OccurrenceUpsert) AddPriceGuest(v int) *OccurrenceUpsert

AddPriceGuest adds v to the "price_guest" field.

func (*OccurrenceUpsert) AddPriceStaff

func (u *OccurrenceUpsert) AddPriceStaff(v int) *OccurrenceUpsert

AddPriceStaff adds v to the "price_staff" field.

func (*OccurrenceUpsert) AddPriceStudent

func (u *OccurrenceUpsert) AddPriceStudent(v int) *OccurrenceUpsert

AddPriceStudent adds v to the "price_student" field.

func (*OccurrenceUpsert) AddProtein

func (u *OccurrenceUpsert) AddProtein(v int) *OccurrenceUpsert

AddProtein adds v to the "protein" field.

func (*OccurrenceUpsert) AddSalt

func (u *OccurrenceUpsert) AddSalt(v int) *OccurrenceUpsert

AddSalt adds v to the "salt" field.

func (*OccurrenceUpsert) AddSaturatedFat

func (u *OccurrenceUpsert) AddSaturatedFat(v int) *OccurrenceUpsert

AddSaturatedFat adds v to the "saturated_fat" field.

func (*OccurrenceUpsert) AddSugar

func (u *OccurrenceUpsert) AddSugar(v int) *OccurrenceUpsert

AddSugar adds v to the "sugar" field.

func (*OccurrenceUpsert) ClearCarbohydrates

func (u *OccurrenceUpsert) ClearCarbohydrates() *OccurrenceUpsert

ClearCarbohydrates clears the value of the "carbohydrates" field.

func (*OccurrenceUpsert) ClearFat

func (u *OccurrenceUpsert) ClearFat() *OccurrenceUpsert

ClearFat clears the value of the "fat" field.

func (*OccurrenceUpsert) ClearFiber

func (u *OccurrenceUpsert) ClearFiber() *OccurrenceUpsert

ClearFiber clears the value of the "fiber" field.

func (*OccurrenceUpsert) ClearKcal

func (u *OccurrenceUpsert) ClearKcal() *OccurrenceUpsert

ClearKcal clears the value of the "kcal" field.

func (*OccurrenceUpsert) ClearKj

func (u *OccurrenceUpsert) ClearKj() *OccurrenceUpsert

ClearKj clears the value of the "kj" field.

func (*OccurrenceUpsert) ClearNotAvailableAfter added in v0.7.0

func (u *OccurrenceUpsert) ClearNotAvailableAfter() *OccurrenceUpsert

ClearNotAvailableAfter clears the value of the "not_available_after" field.

func (*OccurrenceUpsert) ClearPriceGuest

func (u *OccurrenceUpsert) ClearPriceGuest() *OccurrenceUpsert

ClearPriceGuest clears the value of the "price_guest" field.

func (*OccurrenceUpsert) ClearPriceStaff

func (u *OccurrenceUpsert) ClearPriceStaff() *OccurrenceUpsert

ClearPriceStaff clears the value of the "price_staff" field.

func (*OccurrenceUpsert) ClearPriceStudent

func (u *OccurrenceUpsert) ClearPriceStudent() *OccurrenceUpsert

ClearPriceStudent clears the value of the "price_student" field.

func (*OccurrenceUpsert) ClearProtein

func (u *OccurrenceUpsert) ClearProtein() *OccurrenceUpsert

ClearProtein clears the value of the "protein" field.

func (*OccurrenceUpsert) ClearSalt

func (u *OccurrenceUpsert) ClearSalt() *OccurrenceUpsert

ClearSalt clears the value of the "salt" field.

func (*OccurrenceUpsert) ClearSaturatedFat

func (u *OccurrenceUpsert) ClearSaturatedFat() *OccurrenceUpsert

ClearSaturatedFat clears the value of the "saturated_fat" field.

func (*OccurrenceUpsert) ClearSugar

func (u *OccurrenceUpsert) ClearSugar() *OccurrenceUpsert

ClearSugar clears the value of the "sugar" field.

func (*OccurrenceUpsert) SetCarbohydrates

func (u *OccurrenceUpsert) SetCarbohydrates(v int) *OccurrenceUpsert

SetCarbohydrates sets the "carbohydrates" field.

func (*OccurrenceUpsert) SetDate

func (u *OccurrenceUpsert) SetDate(v time.Time) *OccurrenceUpsert

SetDate sets the "date" field.

func (*OccurrenceUpsert) SetFat

func (u *OccurrenceUpsert) SetFat(v int) *OccurrenceUpsert

SetFat sets the "fat" field.

func (*OccurrenceUpsert) SetFiber

func (u *OccurrenceUpsert) SetFiber(v int) *OccurrenceUpsert

SetFiber sets the "fiber" field.

func (*OccurrenceUpsert) SetKcal

func (u *OccurrenceUpsert) SetKcal(v int) *OccurrenceUpsert

SetKcal sets the "kcal" field.

func (*OccurrenceUpsert) SetKj

func (u *OccurrenceUpsert) SetKj(v int) *OccurrenceUpsert

SetKj sets the "kj" field.

func (*OccurrenceUpsert) SetNotAvailableAfter added in v0.7.0

func (u *OccurrenceUpsert) SetNotAvailableAfter(v time.Time) *OccurrenceUpsert

SetNotAvailableAfter sets the "not_available_after" field.

func (*OccurrenceUpsert) SetPriceGuest

func (u *OccurrenceUpsert) SetPriceGuest(v int) *OccurrenceUpsert

SetPriceGuest sets the "price_guest" field.

func (*OccurrenceUpsert) SetPriceStaff

func (u *OccurrenceUpsert) SetPriceStaff(v int) *OccurrenceUpsert

SetPriceStaff sets the "price_staff" field.

func (*OccurrenceUpsert) SetPriceStudent

func (u *OccurrenceUpsert) SetPriceStudent(v int) *OccurrenceUpsert

SetPriceStudent sets the "price_student" field.

func (*OccurrenceUpsert) SetProtein

func (u *OccurrenceUpsert) SetProtein(v int) *OccurrenceUpsert

SetProtein sets the "protein" field.

func (*OccurrenceUpsert) SetSalt

func (u *OccurrenceUpsert) SetSalt(v int) *OccurrenceUpsert

SetSalt sets the "salt" field.

func (*OccurrenceUpsert) SetSaturatedFat

func (u *OccurrenceUpsert) SetSaturatedFat(v int) *OccurrenceUpsert

SetSaturatedFat sets the "saturated_fat" field.

func (*OccurrenceUpsert) SetSugar

func (u *OccurrenceUpsert) SetSugar(v int) *OccurrenceUpsert

SetSugar sets the "sugar" field.

func (*OccurrenceUpsert) UpdateCarbohydrates

func (u *OccurrenceUpsert) UpdateCarbohydrates() *OccurrenceUpsert

UpdateCarbohydrates sets the "carbohydrates" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdateDate

func (u *OccurrenceUpsert) UpdateDate() *OccurrenceUpsert

UpdateDate sets the "date" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdateFat

func (u *OccurrenceUpsert) UpdateFat() *OccurrenceUpsert

UpdateFat sets the "fat" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdateFiber

func (u *OccurrenceUpsert) UpdateFiber() *OccurrenceUpsert

UpdateFiber sets the "fiber" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdateKcal

func (u *OccurrenceUpsert) UpdateKcal() *OccurrenceUpsert

UpdateKcal sets the "kcal" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdateKj

func (u *OccurrenceUpsert) UpdateKj() *OccurrenceUpsert

UpdateKj sets the "kj" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdateNotAvailableAfter added in v0.7.0

func (u *OccurrenceUpsert) UpdateNotAvailableAfter() *OccurrenceUpsert

UpdateNotAvailableAfter sets the "not_available_after" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdatePriceGuest

func (u *OccurrenceUpsert) UpdatePriceGuest() *OccurrenceUpsert

UpdatePriceGuest sets the "price_guest" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdatePriceStaff

func (u *OccurrenceUpsert) UpdatePriceStaff() *OccurrenceUpsert

UpdatePriceStaff sets the "price_staff" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdatePriceStudent

func (u *OccurrenceUpsert) UpdatePriceStudent() *OccurrenceUpsert

UpdatePriceStudent sets the "price_student" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdateProtein

func (u *OccurrenceUpsert) UpdateProtein() *OccurrenceUpsert

UpdateProtein sets the "protein" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdateSalt

func (u *OccurrenceUpsert) UpdateSalt() *OccurrenceUpsert

UpdateSalt sets the "salt" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdateSaturatedFat

func (u *OccurrenceUpsert) UpdateSaturatedFat() *OccurrenceUpsert

UpdateSaturatedFat sets the "saturated_fat" field to the value that was provided on create.

func (*OccurrenceUpsert) UpdateSugar

func (u *OccurrenceUpsert) UpdateSugar() *OccurrenceUpsert

UpdateSugar sets the "sugar" field to the value that was provided on create.

type OccurrenceUpsertBulk

type OccurrenceUpsertBulk struct {
	// contains filtered or unexported fields
}

OccurrenceUpsertBulk is the builder for "upsert"-ing a bulk of Occurrence nodes.

func (*OccurrenceUpsertBulk) AddCarbohydrates

func (u *OccurrenceUpsertBulk) AddCarbohydrates(v int) *OccurrenceUpsertBulk

AddCarbohydrates adds v to the "carbohydrates" field.

func (*OccurrenceUpsertBulk) AddFat

AddFat adds v to the "fat" field.

func (*OccurrenceUpsertBulk) AddFiber

AddFiber adds v to the "fiber" field.

func (*OccurrenceUpsertBulk) AddKcal

AddKcal adds v to the "kcal" field.

func (*OccurrenceUpsertBulk) AddKj

AddKj adds v to the "kj" field.

func (*OccurrenceUpsertBulk) AddPriceGuest

func (u *OccurrenceUpsertBulk) AddPriceGuest(v int) *OccurrenceUpsertBulk

AddPriceGuest adds v to the "price_guest" field.

func (*OccurrenceUpsertBulk) AddPriceStaff

func (u *OccurrenceUpsertBulk) AddPriceStaff(v int) *OccurrenceUpsertBulk

AddPriceStaff adds v to the "price_staff" field.

func (*OccurrenceUpsertBulk) AddPriceStudent

func (u *OccurrenceUpsertBulk) AddPriceStudent(v int) *OccurrenceUpsertBulk

AddPriceStudent adds v to the "price_student" field.

func (*OccurrenceUpsertBulk) AddProtein

func (u *OccurrenceUpsertBulk) AddProtein(v int) *OccurrenceUpsertBulk

AddProtein adds v to the "protein" field.

func (*OccurrenceUpsertBulk) AddSalt

AddSalt adds v to the "salt" field.

func (*OccurrenceUpsertBulk) AddSaturatedFat

func (u *OccurrenceUpsertBulk) AddSaturatedFat(v int) *OccurrenceUpsertBulk

AddSaturatedFat adds v to the "saturated_fat" field.

func (*OccurrenceUpsertBulk) AddSugar

AddSugar adds v to the "sugar" field.

func (*OccurrenceUpsertBulk) ClearCarbohydrates

func (u *OccurrenceUpsertBulk) ClearCarbohydrates() *OccurrenceUpsertBulk

ClearCarbohydrates clears the value of the "carbohydrates" field.

func (*OccurrenceUpsertBulk) ClearFat

ClearFat clears the value of the "fat" field.

func (*OccurrenceUpsertBulk) ClearFiber

func (u *OccurrenceUpsertBulk) ClearFiber() *OccurrenceUpsertBulk

ClearFiber clears the value of the "fiber" field.

func (*OccurrenceUpsertBulk) ClearKcal

ClearKcal clears the value of the "kcal" field.

func (*OccurrenceUpsertBulk) ClearKj

ClearKj clears the value of the "kj" field.

func (*OccurrenceUpsertBulk) ClearNotAvailableAfter added in v0.7.0

func (u *OccurrenceUpsertBulk) ClearNotAvailableAfter() *OccurrenceUpsertBulk

ClearNotAvailableAfter clears the value of the "not_available_after" field.

func (*OccurrenceUpsertBulk) ClearPriceGuest

func (u *OccurrenceUpsertBulk) ClearPriceGuest() *OccurrenceUpsertBulk

ClearPriceGuest clears the value of the "price_guest" field.

func (*OccurrenceUpsertBulk) ClearPriceStaff

func (u *OccurrenceUpsertBulk) ClearPriceStaff() *OccurrenceUpsertBulk

ClearPriceStaff clears the value of the "price_staff" field.

func (*OccurrenceUpsertBulk) ClearPriceStudent

func (u *OccurrenceUpsertBulk) ClearPriceStudent() *OccurrenceUpsertBulk

ClearPriceStudent clears the value of the "price_student" field.

func (*OccurrenceUpsertBulk) ClearProtein

func (u *OccurrenceUpsertBulk) ClearProtein() *OccurrenceUpsertBulk

ClearProtein clears the value of the "protein" field.

func (*OccurrenceUpsertBulk) ClearSalt

ClearSalt clears the value of the "salt" field.

func (*OccurrenceUpsertBulk) ClearSaturatedFat

func (u *OccurrenceUpsertBulk) ClearSaturatedFat() *OccurrenceUpsertBulk

ClearSaturatedFat clears the value of the "saturated_fat" field.

func (*OccurrenceUpsertBulk) ClearSugar

func (u *OccurrenceUpsertBulk) ClearSugar() *OccurrenceUpsertBulk

ClearSugar clears the value of the "sugar" field.

func (*OccurrenceUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*OccurrenceUpsertBulk) Exec

Exec executes the query.

func (*OccurrenceUpsertBulk) ExecX

func (u *OccurrenceUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OccurrenceUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Occurrence.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*OccurrenceUpsertBulk) SetCarbohydrates

func (u *OccurrenceUpsertBulk) SetCarbohydrates(v int) *OccurrenceUpsertBulk

SetCarbohydrates sets the "carbohydrates" field.

func (*OccurrenceUpsertBulk) SetDate

SetDate sets the "date" field.

func (*OccurrenceUpsertBulk) SetFat

SetFat sets the "fat" field.

func (*OccurrenceUpsertBulk) SetFiber

SetFiber sets the "fiber" field.

func (*OccurrenceUpsertBulk) SetKcal

SetKcal sets the "kcal" field.

func (*OccurrenceUpsertBulk) SetKj

SetKj sets the "kj" field.

func (*OccurrenceUpsertBulk) SetNotAvailableAfter added in v0.7.0

func (u *OccurrenceUpsertBulk) SetNotAvailableAfter(v time.Time) *OccurrenceUpsertBulk

SetNotAvailableAfter sets the "not_available_after" field.

func (*OccurrenceUpsertBulk) SetPriceGuest

func (u *OccurrenceUpsertBulk) SetPriceGuest(v int) *OccurrenceUpsertBulk

SetPriceGuest sets the "price_guest" field.

func (*OccurrenceUpsertBulk) SetPriceStaff

func (u *OccurrenceUpsertBulk) SetPriceStaff(v int) *OccurrenceUpsertBulk

SetPriceStaff sets the "price_staff" field.

func (*OccurrenceUpsertBulk) SetPriceStudent

func (u *OccurrenceUpsertBulk) SetPriceStudent(v int) *OccurrenceUpsertBulk

SetPriceStudent sets the "price_student" field.

func (*OccurrenceUpsertBulk) SetProtein

func (u *OccurrenceUpsertBulk) SetProtein(v int) *OccurrenceUpsertBulk

SetProtein sets the "protein" field.

func (*OccurrenceUpsertBulk) SetSalt

SetSalt sets the "salt" field.

func (*OccurrenceUpsertBulk) SetSaturatedFat

func (u *OccurrenceUpsertBulk) SetSaturatedFat(v int) *OccurrenceUpsertBulk

SetSaturatedFat sets the "saturated_fat" field.

func (*OccurrenceUpsertBulk) SetSugar

SetSugar sets the "sugar" field.

func (*OccurrenceUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the OccurrenceCreateBulk.OnConflict documentation for more info.

func (*OccurrenceUpsertBulk) UpdateCarbohydrates

func (u *OccurrenceUpsertBulk) UpdateCarbohydrates() *OccurrenceUpsertBulk

UpdateCarbohydrates sets the "carbohydrates" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdateDate

func (u *OccurrenceUpsertBulk) UpdateDate() *OccurrenceUpsertBulk

UpdateDate sets the "date" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdateFat

UpdateFat sets the "fat" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdateFiber

func (u *OccurrenceUpsertBulk) UpdateFiber() *OccurrenceUpsertBulk

UpdateFiber sets the "fiber" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdateKcal

func (u *OccurrenceUpsertBulk) UpdateKcal() *OccurrenceUpsertBulk

UpdateKcal sets the "kcal" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdateKj

UpdateKj sets the "kj" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdateNewValues

func (u *OccurrenceUpsertBulk) UpdateNewValues() *OccurrenceUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Occurrence.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(occurrence.FieldID)
		}),
	).
	Exec(ctx)

func (*OccurrenceUpsertBulk) UpdateNotAvailableAfter added in v0.7.0

func (u *OccurrenceUpsertBulk) UpdateNotAvailableAfter() *OccurrenceUpsertBulk

UpdateNotAvailableAfter sets the "not_available_after" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdatePriceGuest

func (u *OccurrenceUpsertBulk) UpdatePriceGuest() *OccurrenceUpsertBulk

UpdatePriceGuest sets the "price_guest" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdatePriceStaff

func (u *OccurrenceUpsertBulk) UpdatePriceStaff() *OccurrenceUpsertBulk

UpdatePriceStaff sets the "price_staff" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdatePriceStudent

func (u *OccurrenceUpsertBulk) UpdatePriceStudent() *OccurrenceUpsertBulk

UpdatePriceStudent sets the "price_student" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdateProtein

func (u *OccurrenceUpsertBulk) UpdateProtein() *OccurrenceUpsertBulk

UpdateProtein sets the "protein" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdateSalt

func (u *OccurrenceUpsertBulk) UpdateSalt() *OccurrenceUpsertBulk

UpdateSalt sets the "salt" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdateSaturatedFat

func (u *OccurrenceUpsertBulk) UpdateSaturatedFat() *OccurrenceUpsertBulk

UpdateSaturatedFat sets the "saturated_fat" field to the value that was provided on create.

func (*OccurrenceUpsertBulk) UpdateSugar

func (u *OccurrenceUpsertBulk) UpdateSugar() *OccurrenceUpsertBulk

UpdateSugar sets the "sugar" field to the value that was provided on create.

type OccurrenceUpsertOne

type OccurrenceUpsertOne struct {
	// contains filtered or unexported fields
}

OccurrenceUpsertOne is the builder for "upsert"-ing

one Occurrence node.

func (*OccurrenceUpsertOne) AddCarbohydrates

func (u *OccurrenceUpsertOne) AddCarbohydrates(v int) *OccurrenceUpsertOne

AddCarbohydrates adds v to the "carbohydrates" field.

func (*OccurrenceUpsertOne) AddFat

AddFat adds v to the "fat" field.

func (*OccurrenceUpsertOne) AddFiber

AddFiber adds v to the "fiber" field.

func (*OccurrenceUpsertOne) AddKcal

AddKcal adds v to the "kcal" field.

func (*OccurrenceUpsertOne) AddKj

AddKj adds v to the "kj" field.

func (*OccurrenceUpsertOne) AddPriceGuest

func (u *OccurrenceUpsertOne) AddPriceGuest(v int) *OccurrenceUpsertOne

AddPriceGuest adds v to the "price_guest" field.

func (*OccurrenceUpsertOne) AddPriceStaff

func (u *OccurrenceUpsertOne) AddPriceStaff(v int) *OccurrenceUpsertOne

AddPriceStaff adds v to the "price_staff" field.

func (*OccurrenceUpsertOne) AddPriceStudent

func (u *OccurrenceUpsertOne) AddPriceStudent(v int) *OccurrenceUpsertOne

AddPriceStudent adds v to the "price_student" field.

func (*OccurrenceUpsertOne) AddProtein

func (u *OccurrenceUpsertOne) AddProtein(v int) *OccurrenceUpsertOne

AddProtein adds v to the "protein" field.

func (*OccurrenceUpsertOne) AddSalt

AddSalt adds v to the "salt" field.

func (*OccurrenceUpsertOne) AddSaturatedFat

func (u *OccurrenceUpsertOne) AddSaturatedFat(v int) *OccurrenceUpsertOne

AddSaturatedFat adds v to the "saturated_fat" field.

func (*OccurrenceUpsertOne) AddSugar

AddSugar adds v to the "sugar" field.

func (*OccurrenceUpsertOne) ClearCarbohydrates

func (u *OccurrenceUpsertOne) ClearCarbohydrates() *OccurrenceUpsertOne

ClearCarbohydrates clears the value of the "carbohydrates" field.

func (*OccurrenceUpsertOne) ClearFat

ClearFat clears the value of the "fat" field.

func (*OccurrenceUpsertOne) ClearFiber

func (u *OccurrenceUpsertOne) ClearFiber() *OccurrenceUpsertOne

ClearFiber clears the value of the "fiber" field.

func (*OccurrenceUpsertOne) ClearKcal

func (u *OccurrenceUpsertOne) ClearKcal() *OccurrenceUpsertOne

ClearKcal clears the value of the "kcal" field.

func (*OccurrenceUpsertOne) ClearKj

ClearKj clears the value of the "kj" field.

func (*OccurrenceUpsertOne) ClearNotAvailableAfter added in v0.7.0

func (u *OccurrenceUpsertOne) ClearNotAvailableAfter() *OccurrenceUpsertOne

ClearNotAvailableAfter clears the value of the "not_available_after" field.

func (*OccurrenceUpsertOne) ClearPriceGuest

func (u *OccurrenceUpsertOne) ClearPriceGuest() *OccurrenceUpsertOne

ClearPriceGuest clears the value of the "price_guest" field.

func (*OccurrenceUpsertOne) ClearPriceStaff

func (u *OccurrenceUpsertOne) ClearPriceStaff() *OccurrenceUpsertOne

ClearPriceStaff clears the value of the "price_staff" field.

func (*OccurrenceUpsertOne) ClearPriceStudent

func (u *OccurrenceUpsertOne) ClearPriceStudent() *OccurrenceUpsertOne

ClearPriceStudent clears the value of the "price_student" field.

func (*OccurrenceUpsertOne) ClearProtein

func (u *OccurrenceUpsertOne) ClearProtein() *OccurrenceUpsertOne

ClearProtein clears the value of the "protein" field.

func (*OccurrenceUpsertOne) ClearSalt

func (u *OccurrenceUpsertOne) ClearSalt() *OccurrenceUpsertOne

ClearSalt clears the value of the "salt" field.

func (*OccurrenceUpsertOne) ClearSaturatedFat

func (u *OccurrenceUpsertOne) ClearSaturatedFat() *OccurrenceUpsertOne

ClearSaturatedFat clears the value of the "saturated_fat" field.

func (*OccurrenceUpsertOne) ClearSugar

func (u *OccurrenceUpsertOne) ClearSugar() *OccurrenceUpsertOne

ClearSugar clears the value of the "sugar" field.

func (*OccurrenceUpsertOne) DoNothing

func (u *OccurrenceUpsertOne) DoNothing() *OccurrenceUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*OccurrenceUpsertOne) Exec

Exec executes the query.

func (*OccurrenceUpsertOne) ExecX

func (u *OccurrenceUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OccurrenceUpsertOne) ID

func (u *OccurrenceUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*OccurrenceUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*OccurrenceUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Occurrence.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*OccurrenceUpsertOne) SetCarbohydrates

func (u *OccurrenceUpsertOne) SetCarbohydrates(v int) *OccurrenceUpsertOne

SetCarbohydrates sets the "carbohydrates" field.

func (*OccurrenceUpsertOne) SetDate

SetDate sets the "date" field.

func (*OccurrenceUpsertOne) SetFat

SetFat sets the "fat" field.

func (*OccurrenceUpsertOne) SetFiber

SetFiber sets the "fiber" field.

func (*OccurrenceUpsertOne) SetKcal

SetKcal sets the "kcal" field.

func (*OccurrenceUpsertOne) SetKj

SetKj sets the "kj" field.

func (*OccurrenceUpsertOne) SetNotAvailableAfter added in v0.7.0

func (u *OccurrenceUpsertOne) SetNotAvailableAfter(v time.Time) *OccurrenceUpsertOne

SetNotAvailableAfter sets the "not_available_after" field.

func (*OccurrenceUpsertOne) SetPriceGuest

func (u *OccurrenceUpsertOne) SetPriceGuest(v int) *OccurrenceUpsertOne

SetPriceGuest sets the "price_guest" field.

func (*OccurrenceUpsertOne) SetPriceStaff

func (u *OccurrenceUpsertOne) SetPriceStaff(v int) *OccurrenceUpsertOne

SetPriceStaff sets the "price_staff" field.

func (*OccurrenceUpsertOne) SetPriceStudent

func (u *OccurrenceUpsertOne) SetPriceStudent(v int) *OccurrenceUpsertOne

SetPriceStudent sets the "price_student" field.

func (*OccurrenceUpsertOne) SetProtein

func (u *OccurrenceUpsertOne) SetProtein(v int) *OccurrenceUpsertOne

SetProtein sets the "protein" field.

func (*OccurrenceUpsertOne) SetSalt

SetSalt sets the "salt" field.

func (*OccurrenceUpsertOne) SetSaturatedFat

func (u *OccurrenceUpsertOne) SetSaturatedFat(v int) *OccurrenceUpsertOne

SetSaturatedFat sets the "saturated_fat" field.

func (*OccurrenceUpsertOne) SetSugar

SetSugar sets the "sugar" field.

func (*OccurrenceUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the OccurrenceCreate.OnConflict documentation for more info.

func (*OccurrenceUpsertOne) UpdateCarbohydrates

func (u *OccurrenceUpsertOne) UpdateCarbohydrates() *OccurrenceUpsertOne

UpdateCarbohydrates sets the "carbohydrates" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdateDate

func (u *OccurrenceUpsertOne) UpdateDate() *OccurrenceUpsertOne

UpdateDate sets the "date" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdateFat

func (u *OccurrenceUpsertOne) UpdateFat() *OccurrenceUpsertOne

UpdateFat sets the "fat" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdateFiber

func (u *OccurrenceUpsertOne) UpdateFiber() *OccurrenceUpsertOne

UpdateFiber sets the "fiber" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdateKcal

func (u *OccurrenceUpsertOne) UpdateKcal() *OccurrenceUpsertOne

UpdateKcal sets the "kcal" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdateKj

UpdateKj sets the "kj" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdateNewValues

func (u *OccurrenceUpsertOne) UpdateNewValues() *OccurrenceUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Occurrence.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(occurrence.FieldID)
		}),
	).
	Exec(ctx)

func (*OccurrenceUpsertOne) UpdateNotAvailableAfter added in v0.7.0

func (u *OccurrenceUpsertOne) UpdateNotAvailableAfter() *OccurrenceUpsertOne

UpdateNotAvailableAfter sets the "not_available_after" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdatePriceGuest

func (u *OccurrenceUpsertOne) UpdatePriceGuest() *OccurrenceUpsertOne

UpdatePriceGuest sets the "price_guest" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdatePriceStaff

func (u *OccurrenceUpsertOne) UpdatePriceStaff() *OccurrenceUpsertOne

UpdatePriceStaff sets the "price_staff" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdatePriceStudent

func (u *OccurrenceUpsertOne) UpdatePriceStudent() *OccurrenceUpsertOne

UpdatePriceStudent sets the "price_student" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdateProtein

func (u *OccurrenceUpsertOne) UpdateProtein() *OccurrenceUpsertOne

UpdateProtein sets the "protein" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdateSalt

func (u *OccurrenceUpsertOne) UpdateSalt() *OccurrenceUpsertOne

UpdateSalt sets the "salt" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdateSaturatedFat

func (u *OccurrenceUpsertOne) UpdateSaturatedFat() *OccurrenceUpsertOne

UpdateSaturatedFat sets the "saturated_fat" field to the value that was provided on create.

func (*OccurrenceUpsertOne) UpdateSugar

func (u *OccurrenceUpsertOne) UpdateSugar() *OccurrenceUpsertOne

UpdateSugar sets the "sugar" field to the value that was provided on create.

type Occurrences

type Occurrences []*Occurrence

Occurrences is a parsable slice of Occurrence.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type Review

type Review struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName *string `json:"display_name,omitempty"`
	// Stars holds the value of the "stars" field.
	Stars int `json:"stars,omitempty"`
	// Text holds the value of the "text" field.
	Text *string `json:"text,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// AcceptedAt holds the value of the "accepted_at" field.
	AcceptedAt *time.Time `json:"accepted_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ReviewQuery when eager-loading is set.
	Edges ReviewEdges `json:"edges"`
	// contains filtered or unexported fields
}

Review is the model entity for the Review schema.

func (*Review) QueryImages

func (r *Review) QueryImages() *ImageQuery

QueryImages queries the "images" edge of the Review entity.

func (*Review) QueryOccurrence

func (r *Review) QueryOccurrence() *OccurrenceQuery

QueryOccurrence queries the "occurrence" edge of the Review entity.

func (*Review) String

func (r *Review) String() string

String implements the fmt.Stringer.

func (*Review) Unwrap

func (r *Review) Unwrap() *Review

Unwrap unwraps the Review 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 (*Review) Update

func (r *Review) Update() *ReviewUpdateOne

Update returns a builder for updating this Review. Note that you need to call Review.Unwrap() before calling this method if this Review was returned from a transaction, and the transaction was committed or rolled back.

func (*Review) Value

func (r *Review) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Review. This includes values selected through modifiers, order, etc.

type ReviewClient

type ReviewClient struct {
	// contains filtered or unexported fields
}

ReviewClient is a client for the Review schema.

func NewReviewClient

func NewReviewClient(c config) *ReviewClient

NewReviewClient returns a client for the Review from the given config.

func (*ReviewClient) Create

func (c *ReviewClient) Create() *ReviewCreate

Create returns a builder for creating a Review entity.

func (*ReviewClient) CreateBulk

func (c *ReviewClient) CreateBulk(builders ...*ReviewCreate) *ReviewCreateBulk

CreateBulk returns a builder for creating a bulk of Review entities.

func (*ReviewClient) Delete

func (c *ReviewClient) Delete() *ReviewDelete

Delete returns a delete builder for Review.

func (*ReviewClient) DeleteOne

func (c *ReviewClient) DeleteOne(r *Review) *ReviewDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ReviewClient) DeleteOneID

func (c *ReviewClient) DeleteOneID(id uuid.UUID) *ReviewDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ReviewClient) Get

func (c *ReviewClient) Get(ctx context.Context, id uuid.UUID) (*Review, error)

Get returns a Review entity by its id.

func (*ReviewClient) GetX

func (c *ReviewClient) GetX(ctx context.Context, id uuid.UUID) *Review

GetX is like Get, but panics if an error occurs.

func (*ReviewClient) Hooks

func (c *ReviewClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ReviewClient) Intercept

func (c *ReviewClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `review.Intercept(f(g(h())))`.

func (*ReviewClient) Interceptors

func (c *ReviewClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ReviewClient) MapCreateBulk added in v0.8.3

func (c *ReviewClient) MapCreateBulk(slice any, setFunc func(*ReviewCreate, int)) *ReviewCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ReviewClient) Query

func (c *ReviewClient) Query() *ReviewQuery

Query returns a query builder for Review.

func (*ReviewClient) QueryImages

func (c *ReviewClient) QueryImages(r *Review) *ImageQuery

QueryImages queries the images edge of a Review.

func (*ReviewClient) QueryOccurrence

func (c *ReviewClient) QueryOccurrence(r *Review) *OccurrenceQuery

QueryOccurrence queries the occurrence edge of a Review.

func (*ReviewClient) Update

func (c *ReviewClient) Update() *ReviewUpdate

Update returns an update builder for Review.

func (*ReviewClient) UpdateOne

func (c *ReviewClient) UpdateOne(r *Review) *ReviewUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReviewClient) UpdateOneID

func (c *ReviewClient) UpdateOneID(id uuid.UUID) *ReviewUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ReviewClient) Use

func (c *ReviewClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `review.Hooks(f(g(h())))`.

type ReviewCreate

type ReviewCreate struct {
	// contains filtered or unexported fields
}

ReviewCreate is the builder for creating a Review entity.

func (*ReviewCreate) AddImageIDs

func (rc *ReviewCreate) AddImageIDs(ids ...uuid.UUID) *ReviewCreate

AddImageIDs adds the "images" edge to the Image entity by IDs.

func (*ReviewCreate) AddImages

func (rc *ReviewCreate) AddImages(i ...*Image) *ReviewCreate

AddImages adds the "images" edges to the Image entity.

func (*ReviewCreate) Exec

func (rc *ReviewCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReviewCreate) ExecX

func (rc *ReviewCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReviewCreate) Mutation

func (rc *ReviewCreate) Mutation() *ReviewMutation

Mutation returns the ReviewMutation object of the builder.

func (*ReviewCreate) OnConflict

func (rc *ReviewCreate) OnConflict(opts ...sql.ConflictOption) *ReviewUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Review.Create().
	SetDisplayName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ReviewUpsert) {
		SetDisplayName(v+v).
	}).
	Exec(ctx)

func (*ReviewCreate) OnConflictColumns

func (rc *ReviewCreate) OnConflictColumns(columns ...string) *ReviewUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Review.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ReviewCreate) Save

func (rc *ReviewCreate) Save(ctx context.Context) (*Review, error)

Save creates the Review in the database.

func (*ReviewCreate) SaveX

func (rc *ReviewCreate) SaveX(ctx context.Context) *Review

SaveX calls Save and panics if Save returns an error.

func (*ReviewCreate) SetAcceptedAt

func (rc *ReviewCreate) SetAcceptedAt(t time.Time) *ReviewCreate

SetAcceptedAt sets the "accepted_at" field.

func (*ReviewCreate) SetCreatedAt

func (rc *ReviewCreate) SetCreatedAt(t time.Time) *ReviewCreate

SetCreatedAt sets the "created_at" field.

func (*ReviewCreate) SetDisplayName

func (rc *ReviewCreate) SetDisplayName(s string) *ReviewCreate

SetDisplayName sets the "display_name" field.

func (*ReviewCreate) SetID

func (rc *ReviewCreate) SetID(u uuid.UUID) *ReviewCreate

SetID sets the "id" field.

func (*ReviewCreate) SetNillableAcceptedAt

func (rc *ReviewCreate) SetNillableAcceptedAt(t *time.Time) *ReviewCreate

SetNillableAcceptedAt sets the "accepted_at" field if the given value is not nil.

func (*ReviewCreate) SetNillableCreatedAt

func (rc *ReviewCreate) SetNillableCreatedAt(t *time.Time) *ReviewCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ReviewCreate) SetNillableDisplayName

func (rc *ReviewCreate) SetNillableDisplayName(s *string) *ReviewCreate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*ReviewCreate) SetNillableID

func (rc *ReviewCreate) SetNillableID(u *uuid.UUID) *ReviewCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ReviewCreate) SetNillableText

func (rc *ReviewCreate) SetNillableText(s *string) *ReviewCreate

SetNillableText sets the "text" field if the given value is not nil.

func (*ReviewCreate) SetNillableUpdatedAt

func (rc *ReviewCreate) SetNillableUpdatedAt(t *time.Time) *ReviewCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ReviewCreate) SetOccurrence

func (rc *ReviewCreate) SetOccurrence(o *Occurrence) *ReviewCreate

SetOccurrence sets the "occurrence" edge to the Occurrence entity.

func (*ReviewCreate) SetOccurrenceID

func (rc *ReviewCreate) SetOccurrenceID(id uuid.UUID) *ReviewCreate

SetOccurrenceID sets the "occurrence" edge to the Occurrence entity by ID.

func (*ReviewCreate) SetStars

func (rc *ReviewCreate) SetStars(i int) *ReviewCreate

SetStars sets the "stars" field.

func (*ReviewCreate) SetText

func (rc *ReviewCreate) SetText(s string) *ReviewCreate

SetText sets the "text" field.

func (*ReviewCreate) SetUpdatedAt

func (rc *ReviewCreate) SetUpdatedAt(t time.Time) *ReviewCreate

SetUpdatedAt sets the "updated_at" field.

type ReviewCreateBulk

type ReviewCreateBulk struct {
	// contains filtered or unexported fields
}

ReviewCreateBulk is the builder for creating many Review entities in bulk.

func (*ReviewCreateBulk) Exec

func (rcb *ReviewCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReviewCreateBulk) ExecX

func (rcb *ReviewCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReviewCreateBulk) OnConflict

func (rcb *ReviewCreateBulk) OnConflict(opts ...sql.ConflictOption) *ReviewUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Review.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ReviewUpsert) {
		SetDisplayName(v+v).
	}).
	Exec(ctx)

func (*ReviewCreateBulk) OnConflictColumns

func (rcb *ReviewCreateBulk) OnConflictColumns(columns ...string) *ReviewUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Review.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ReviewCreateBulk) Save

func (rcb *ReviewCreateBulk) Save(ctx context.Context) ([]*Review, error)

Save creates the Review entities in the database.

func (*ReviewCreateBulk) SaveX

func (rcb *ReviewCreateBulk) SaveX(ctx context.Context) []*Review

SaveX is like Save, but panics if an error occurs.

type ReviewDelete

type ReviewDelete struct {
	// contains filtered or unexported fields
}

ReviewDelete is the builder for deleting a Review entity.

func (*ReviewDelete) Exec

func (rd *ReviewDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ReviewDelete) ExecX

func (rd *ReviewDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ReviewDelete) Where

func (rd *ReviewDelete) Where(ps ...predicate.Review) *ReviewDelete

Where appends a list predicates to the ReviewDelete builder.

type ReviewDeleteOne

type ReviewDeleteOne struct {
	// contains filtered or unexported fields
}

ReviewDeleteOne is the builder for deleting a single Review entity.

func (*ReviewDeleteOne) Exec

func (rdo *ReviewDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReviewDeleteOne) ExecX

func (rdo *ReviewDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReviewDeleteOne) Where

func (rdo *ReviewDeleteOne) Where(ps ...predicate.Review) *ReviewDeleteOne

Where appends a list predicates to the ReviewDelete builder.

type ReviewEdges

type ReviewEdges struct {
	// Occurrence holds the value of the occurrence edge.
	Occurrence *Occurrence `json:"occurrence,omitempty"`
	// Images holds the value of the images edge.
	Images []*Image `json:"images,omitempty"`
	// contains filtered or unexported fields
}

ReviewEdges holds the relations/edges for other nodes in the graph.

func (ReviewEdges) ImagesOrErr

func (e ReviewEdges) ImagesOrErr() ([]*Image, error)

ImagesOrErr returns the Images value or an error if the edge was not loaded in eager-loading.

func (ReviewEdges) OccurrenceOrErr

func (e ReviewEdges) OccurrenceOrErr() (*Occurrence, error)

OccurrenceOrErr returns the Occurrence value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ReviewGroupBy

type ReviewGroupBy struct {
	// contains filtered or unexported fields
}

ReviewGroupBy is the group-by builder for Review entities.

func (*ReviewGroupBy) Aggregate

func (rgb *ReviewGroupBy) Aggregate(fns ...AggregateFunc) *ReviewGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ReviewGroupBy) Bool

func (s *ReviewGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReviewGroupBy) BoolX

func (s *ReviewGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReviewGroupBy) Bools

func (s *ReviewGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReviewGroupBy) BoolsX

func (s *ReviewGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ReviewGroupBy) Float64

func (s *ReviewGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReviewGroupBy) Float64X

func (s *ReviewGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReviewGroupBy) Float64s

func (s *ReviewGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReviewGroupBy) Float64sX

func (s *ReviewGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReviewGroupBy) Int

func (s *ReviewGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReviewGroupBy) IntX

func (s *ReviewGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReviewGroupBy) Ints

func (s *ReviewGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReviewGroupBy) IntsX

func (s *ReviewGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ReviewGroupBy) Scan

func (rgb *ReviewGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReviewGroupBy) ScanX

func (s *ReviewGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReviewGroupBy) String

func (s *ReviewGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReviewGroupBy) StringX

func (s *ReviewGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReviewGroupBy) Strings

func (s *ReviewGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReviewGroupBy) StringsX

func (s *ReviewGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReviewMutation

type ReviewMutation struct {
	// contains filtered or unexported fields
}

ReviewMutation represents an operation that mutates the Review nodes in the graph.

func (*ReviewMutation) AcceptedAt

func (m *ReviewMutation) AcceptedAt() (r time.Time, exists bool)

AcceptedAt returns the value of the "accepted_at" field in the mutation.

func (*ReviewMutation) AcceptedAtCleared

func (m *ReviewMutation) AcceptedAtCleared() bool

AcceptedAtCleared returns if the "accepted_at" field was cleared in this mutation.

func (*ReviewMutation) AddField

func (m *ReviewMutation) 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 (*ReviewMutation) AddImageIDs

func (m *ReviewMutation) AddImageIDs(ids ...uuid.UUID)

AddImageIDs adds the "images" edge to the Image entity by ids.

func (*ReviewMutation) AddStars

func (m *ReviewMutation) AddStars(i int)

AddStars adds i to the "stars" field.

func (*ReviewMutation) AddedEdges

func (m *ReviewMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ReviewMutation) AddedField

func (m *ReviewMutation) 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 (*ReviewMutation) AddedFields

func (m *ReviewMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ReviewMutation) AddedIDs

func (m *ReviewMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ReviewMutation) AddedStars

func (m *ReviewMutation) AddedStars() (r int, exists bool)

AddedStars returns the value that was added to the "stars" field in this mutation.

func (*ReviewMutation) ClearAcceptedAt

func (m *ReviewMutation) ClearAcceptedAt()

ClearAcceptedAt clears the value of the "accepted_at" field.

func (*ReviewMutation) ClearDisplayName

func (m *ReviewMutation) ClearDisplayName()

ClearDisplayName clears the value of the "display_name" field.

func (*ReviewMutation) ClearEdge

func (m *ReviewMutation) 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 (*ReviewMutation) ClearField

func (m *ReviewMutation) 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 (*ReviewMutation) ClearImages

func (m *ReviewMutation) ClearImages()

ClearImages clears the "images" edge to the Image entity.

func (*ReviewMutation) ClearOccurrence

func (m *ReviewMutation) ClearOccurrence()

ClearOccurrence clears the "occurrence" edge to the Occurrence entity.

func (*ReviewMutation) ClearText

func (m *ReviewMutation) ClearText()

ClearText clears the value of the "text" field.

func (*ReviewMutation) ClearedEdges

func (m *ReviewMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ReviewMutation) ClearedFields

func (m *ReviewMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ReviewMutation) Client

func (m ReviewMutation) 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 (*ReviewMutation) CreatedAt

func (m *ReviewMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ReviewMutation) DisplayName

func (m *ReviewMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*ReviewMutation) DisplayNameCleared

func (m *ReviewMutation) DisplayNameCleared() bool

DisplayNameCleared returns if the "display_name" field was cleared in this mutation.

func (*ReviewMutation) EdgeCleared

func (m *ReviewMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ReviewMutation) Field

func (m *ReviewMutation) 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 (*ReviewMutation) FieldCleared

func (m *ReviewMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ReviewMutation) Fields

func (m *ReviewMutation) 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 (*ReviewMutation) ID

func (m *ReviewMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ReviewMutation) IDs

func (m *ReviewMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ReviewMutation) ImagesCleared

func (m *ReviewMutation) ImagesCleared() bool

ImagesCleared reports if the "images" edge to the Image entity was cleared.

func (*ReviewMutation) ImagesIDs

func (m *ReviewMutation) ImagesIDs() (ids []uuid.UUID)

ImagesIDs returns the "images" edge IDs in the mutation.

func (*ReviewMutation) OccurrenceCleared

func (m *ReviewMutation) OccurrenceCleared() bool

OccurrenceCleared reports if the "occurrence" edge to the Occurrence entity was cleared.

func (*ReviewMutation) OccurrenceID

func (m *ReviewMutation) OccurrenceID() (id uuid.UUID, exists bool)

OccurrenceID returns the "occurrence" edge ID in the mutation.

func (*ReviewMutation) OccurrenceIDs

func (m *ReviewMutation) OccurrenceIDs() (ids []uuid.UUID)

OccurrenceIDs returns the "occurrence" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OccurrenceID instead. It exists only for internal usage by the builders.

func (*ReviewMutation) OldAcceptedAt

func (m *ReviewMutation) OldAcceptedAt(ctx context.Context) (v *time.Time, err error)

OldAcceptedAt returns the old "accepted_at" field's value of the Review entity. If the Review 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 (*ReviewMutation) OldCreatedAt

func (m *ReviewMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Review entity. If the Review 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 (*ReviewMutation) OldDisplayName

func (m *ReviewMutation) OldDisplayName(ctx context.Context) (v *string, err error)

OldDisplayName returns the old "display_name" field's value of the Review entity. If the Review 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 (*ReviewMutation) OldField

func (m *ReviewMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ReviewMutation) OldStars

func (m *ReviewMutation) OldStars(ctx context.Context) (v int, err error)

OldStars returns the old "stars" field's value of the Review entity. If the Review 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 (*ReviewMutation) OldText

func (m *ReviewMutation) OldText(ctx context.Context) (v *string, err error)

OldText returns the old "text" field's value of the Review entity. If the Review 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 (*ReviewMutation) OldUpdatedAt

func (m *ReviewMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Review entity. If the Review 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 (*ReviewMutation) Op

func (m *ReviewMutation) Op() Op

Op returns the operation name.

func (*ReviewMutation) RemoveImageIDs

func (m *ReviewMutation) RemoveImageIDs(ids ...uuid.UUID)

RemoveImageIDs removes the "images" edge to the Image entity by IDs.

func (*ReviewMutation) RemovedEdges

func (m *ReviewMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ReviewMutation) RemovedIDs

func (m *ReviewMutation) 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 (*ReviewMutation) RemovedImagesIDs

func (m *ReviewMutation) RemovedImagesIDs() (ids []uuid.UUID)

RemovedImages returns the removed IDs of the "images" edge to the Image entity.

func (*ReviewMutation) ResetAcceptedAt

func (m *ReviewMutation) ResetAcceptedAt()

ResetAcceptedAt resets all changes to the "accepted_at" field.

func (*ReviewMutation) ResetCreatedAt

func (m *ReviewMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ReviewMutation) ResetDisplayName

func (m *ReviewMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*ReviewMutation) ResetEdge

func (m *ReviewMutation) 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 (*ReviewMutation) ResetField

func (m *ReviewMutation) 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 (*ReviewMutation) ResetImages

func (m *ReviewMutation) ResetImages()

ResetImages resets all changes to the "images" edge.

func (*ReviewMutation) ResetOccurrence

func (m *ReviewMutation) ResetOccurrence()

ResetOccurrence resets all changes to the "occurrence" edge.

func (*ReviewMutation) ResetStars

func (m *ReviewMutation) ResetStars()

ResetStars resets all changes to the "stars" field.

func (*ReviewMutation) ResetText

func (m *ReviewMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*ReviewMutation) ResetUpdatedAt

func (m *ReviewMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ReviewMutation) SetAcceptedAt

func (m *ReviewMutation) SetAcceptedAt(t time.Time)

SetAcceptedAt sets the "accepted_at" field.

func (*ReviewMutation) SetCreatedAt

func (m *ReviewMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ReviewMutation) SetDisplayName

func (m *ReviewMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*ReviewMutation) SetField

func (m *ReviewMutation) 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 (*ReviewMutation) SetID

func (m *ReviewMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Review entities.

func (*ReviewMutation) SetOccurrenceID

func (m *ReviewMutation) SetOccurrenceID(id uuid.UUID)

SetOccurrenceID sets the "occurrence" edge to the Occurrence entity by id.

func (*ReviewMutation) SetOp

func (m *ReviewMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ReviewMutation) SetStars

func (m *ReviewMutation) SetStars(i int)

SetStars sets the "stars" field.

func (*ReviewMutation) SetText

func (m *ReviewMutation) SetText(s string)

SetText sets the "text" field.

func (*ReviewMutation) SetUpdatedAt

func (m *ReviewMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ReviewMutation) Stars

func (m *ReviewMutation) Stars() (r int, exists bool)

Stars returns the value of the "stars" field in the mutation.

func (*ReviewMutation) Text

func (m *ReviewMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (*ReviewMutation) TextCleared

func (m *ReviewMutation) TextCleared() bool

TextCleared returns if the "text" field was cleared in this mutation.

func (ReviewMutation) Tx

func (m ReviewMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ReviewMutation) Type

func (m *ReviewMutation) Type() string

Type returns the node type of this mutation (Review).

func (*ReviewMutation) UpdatedAt

func (m *ReviewMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ReviewMutation) Where

func (m *ReviewMutation) Where(ps ...predicate.Review)

Where appends a list predicates to the ReviewMutation builder.

func (*ReviewMutation) WhereP

func (m *ReviewMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ReviewMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ReviewQuery

type ReviewQuery struct {
	// contains filtered or unexported fields
}

ReviewQuery is the builder for querying Review entities.

func (*ReviewQuery) Aggregate

func (rq *ReviewQuery) Aggregate(fns ...AggregateFunc) *ReviewSelect

Aggregate returns a ReviewSelect configured with the given aggregations.

func (*ReviewQuery) All

func (rq *ReviewQuery) All(ctx context.Context) ([]*Review, error)

All executes the query and returns a list of Reviews.

func (*ReviewQuery) AllX

func (rq *ReviewQuery) AllX(ctx context.Context) []*Review

AllX is like All, but panics if an error occurs.

func (*ReviewQuery) Clone

func (rq *ReviewQuery) Clone() *ReviewQuery

Clone returns a duplicate of the ReviewQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ReviewQuery) Count

func (rq *ReviewQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReviewQuery) CountX

func (rq *ReviewQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ReviewQuery) Exist

func (rq *ReviewQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ReviewQuery) ExistX

func (rq *ReviewQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ReviewQuery) First

func (rq *ReviewQuery) First(ctx context.Context) (*Review, error)

First returns the first Review entity from the query. Returns a *NotFoundError when no Review was found.

func (*ReviewQuery) FirstID

func (rq *ReviewQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Review ID from the query. Returns a *NotFoundError when no Review ID was found.

func (*ReviewQuery) FirstIDX

func (rq *ReviewQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ReviewQuery) FirstX

func (rq *ReviewQuery) FirstX(ctx context.Context) *Review

FirstX is like First, but panics if an error occurs.

func (*ReviewQuery) GroupBy

func (rq *ReviewQuery) GroupBy(field string, fields ...string) *ReviewGroupBy

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 {
	DisplayName string `json:"display_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Review.Query().
	GroupBy(review.FieldDisplayName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReviewQuery) IDs

func (rq *ReviewQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Review IDs.

func (*ReviewQuery) IDsX

func (rq *ReviewQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ReviewQuery) Limit

func (rq *ReviewQuery) Limit(limit int) *ReviewQuery

Limit the number of records to be returned by this query.

func (*ReviewQuery) Offset

func (rq *ReviewQuery) Offset(offset int) *ReviewQuery

Offset to start from.

func (*ReviewQuery) Only

func (rq *ReviewQuery) Only(ctx context.Context) (*Review, error)

Only returns a single Review entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Review entity is found. Returns a *NotFoundError when no Review entities are found.

func (*ReviewQuery) OnlyID

func (rq *ReviewQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Review ID in the query. Returns a *NotSingularError when more than one Review ID is found. Returns a *NotFoundError when no entities are found.

func (*ReviewQuery) OnlyIDX

func (rq *ReviewQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ReviewQuery) OnlyX

func (rq *ReviewQuery) OnlyX(ctx context.Context) *Review

OnlyX is like Only, but panics if an error occurs.

func (*ReviewQuery) Order

func (rq *ReviewQuery) Order(o ...review.OrderOption) *ReviewQuery

Order specifies how the records should be ordered.

func (*ReviewQuery) QueryImages

func (rq *ReviewQuery) QueryImages() *ImageQuery

QueryImages chains the current query on the "images" edge.

func (*ReviewQuery) QueryOccurrence

func (rq *ReviewQuery) QueryOccurrence() *OccurrenceQuery

QueryOccurrence chains the current query on the "occurrence" edge.

func (*ReviewQuery) Select

func (rq *ReviewQuery) Select(fields ...string) *ReviewSelect

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 {
	DisplayName string `json:"display_name,omitempty"`
}

client.Review.Query().
	Select(review.FieldDisplayName).
	Scan(ctx, &v)

func (*ReviewQuery) Unique

func (rq *ReviewQuery) Unique(unique bool) *ReviewQuery

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 (*ReviewQuery) Where

func (rq *ReviewQuery) Where(ps ...predicate.Review) *ReviewQuery

Where adds a new predicate for the ReviewQuery builder.

func (*ReviewQuery) WithImages

func (rq *ReviewQuery) WithImages(opts ...func(*ImageQuery)) *ReviewQuery

WithImages tells the query-builder to eager-load the nodes that are connected to the "images" edge. The optional arguments are used to configure the query builder of the edge.

func (*ReviewQuery) WithOccurrence

func (rq *ReviewQuery) WithOccurrence(opts ...func(*OccurrenceQuery)) *ReviewQuery

WithOccurrence tells the query-builder to eager-load the nodes that are connected to the "occurrence" edge. The optional arguments are used to configure the query builder of the edge.

type ReviewSelect

type ReviewSelect struct {
	*ReviewQuery
	// contains filtered or unexported fields
}

ReviewSelect is the builder for selecting fields of Review entities.

func (*ReviewSelect) Aggregate

func (rs *ReviewSelect) Aggregate(fns ...AggregateFunc) *ReviewSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ReviewSelect) Bool

func (s *ReviewSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReviewSelect) BoolX

func (s *ReviewSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReviewSelect) Bools

func (s *ReviewSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReviewSelect) BoolsX

func (s *ReviewSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ReviewSelect) Float64

func (s *ReviewSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReviewSelect) Float64X

func (s *ReviewSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReviewSelect) Float64s

func (s *ReviewSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReviewSelect) Float64sX

func (s *ReviewSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReviewSelect) Int

func (s *ReviewSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReviewSelect) IntX

func (s *ReviewSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReviewSelect) Ints

func (s *ReviewSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReviewSelect) IntsX

func (s *ReviewSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ReviewSelect) Scan

func (rs *ReviewSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReviewSelect) ScanX

func (s *ReviewSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReviewSelect) String

func (s *ReviewSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReviewSelect) StringX

func (s *ReviewSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReviewSelect) Strings

func (s *ReviewSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReviewSelect) StringsX

func (s *ReviewSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReviewUpdate

type ReviewUpdate struct {
	// contains filtered or unexported fields
}

ReviewUpdate is the builder for updating Review entities.

func (*ReviewUpdate) AddImageIDs

func (ru *ReviewUpdate) AddImageIDs(ids ...uuid.UUID) *ReviewUpdate

AddImageIDs adds the "images" edge to the Image entity by IDs.

func (*ReviewUpdate) AddImages

func (ru *ReviewUpdate) AddImages(i ...*Image) *ReviewUpdate

AddImages adds the "images" edges to the Image entity.

func (*ReviewUpdate) AddStars

func (ru *ReviewUpdate) AddStars(i int) *ReviewUpdate

AddStars adds i to the "stars" field.

func (*ReviewUpdate) ClearAcceptedAt

func (ru *ReviewUpdate) ClearAcceptedAt() *ReviewUpdate

ClearAcceptedAt clears the value of the "accepted_at" field.

func (*ReviewUpdate) ClearDisplayName

func (ru *ReviewUpdate) ClearDisplayName() *ReviewUpdate

ClearDisplayName clears the value of the "display_name" field.

func (*ReviewUpdate) ClearImages

func (ru *ReviewUpdate) ClearImages() *ReviewUpdate

ClearImages clears all "images" edges to the Image entity.

func (*ReviewUpdate) ClearOccurrence

func (ru *ReviewUpdate) ClearOccurrence() *ReviewUpdate

ClearOccurrence clears the "occurrence" edge to the Occurrence entity.

func (*ReviewUpdate) ClearText

func (ru *ReviewUpdate) ClearText() *ReviewUpdate

ClearText clears the value of the "text" field.

func (*ReviewUpdate) Exec

func (ru *ReviewUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReviewUpdate) ExecX

func (ru *ReviewUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReviewUpdate) Mutation

func (ru *ReviewUpdate) Mutation() *ReviewMutation

Mutation returns the ReviewMutation object of the builder.

func (*ReviewUpdate) RemoveImageIDs

func (ru *ReviewUpdate) RemoveImageIDs(ids ...uuid.UUID) *ReviewUpdate

RemoveImageIDs removes the "images" edge to Image entities by IDs.

func (*ReviewUpdate) RemoveImages

func (ru *ReviewUpdate) RemoveImages(i ...*Image) *ReviewUpdate

RemoveImages removes "images" edges to Image entities.

func (*ReviewUpdate) Save

func (ru *ReviewUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ReviewUpdate) SaveX

func (ru *ReviewUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ReviewUpdate) SetAcceptedAt

func (ru *ReviewUpdate) SetAcceptedAt(t time.Time) *ReviewUpdate

SetAcceptedAt sets the "accepted_at" field.

func (*ReviewUpdate) SetDisplayName

func (ru *ReviewUpdate) SetDisplayName(s string) *ReviewUpdate

SetDisplayName sets the "display_name" field.

func (*ReviewUpdate) SetNillableAcceptedAt

func (ru *ReviewUpdate) SetNillableAcceptedAt(t *time.Time) *ReviewUpdate

SetNillableAcceptedAt sets the "accepted_at" field if the given value is not nil.

func (*ReviewUpdate) SetNillableDisplayName

func (ru *ReviewUpdate) SetNillableDisplayName(s *string) *ReviewUpdate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*ReviewUpdate) SetNillableStars added in v0.8.3

func (ru *ReviewUpdate) SetNillableStars(i *int) *ReviewUpdate

SetNillableStars sets the "stars" field if the given value is not nil.

func (*ReviewUpdate) SetNillableText

func (ru *ReviewUpdate) SetNillableText(s *string) *ReviewUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*ReviewUpdate) SetOccurrence

func (ru *ReviewUpdate) SetOccurrence(o *Occurrence) *ReviewUpdate

SetOccurrence sets the "occurrence" edge to the Occurrence entity.

func (*ReviewUpdate) SetOccurrenceID

func (ru *ReviewUpdate) SetOccurrenceID(id uuid.UUID) *ReviewUpdate

SetOccurrenceID sets the "occurrence" edge to the Occurrence entity by ID.

func (*ReviewUpdate) SetStars

func (ru *ReviewUpdate) SetStars(i int) *ReviewUpdate

SetStars sets the "stars" field.

func (*ReviewUpdate) SetText

func (ru *ReviewUpdate) SetText(s string) *ReviewUpdate

SetText sets the "text" field.

func (*ReviewUpdate) SetUpdatedAt

func (ru *ReviewUpdate) SetUpdatedAt(t time.Time) *ReviewUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ReviewUpdate) Where

func (ru *ReviewUpdate) Where(ps ...predicate.Review) *ReviewUpdate

Where appends a list predicates to the ReviewUpdate builder.

type ReviewUpdateOne

type ReviewUpdateOne struct {
	// contains filtered or unexported fields
}

ReviewUpdateOne is the builder for updating a single Review entity.

func (*ReviewUpdateOne) AddImageIDs

func (ruo *ReviewUpdateOne) AddImageIDs(ids ...uuid.UUID) *ReviewUpdateOne

AddImageIDs adds the "images" edge to the Image entity by IDs.

func (*ReviewUpdateOne) AddImages

func (ruo *ReviewUpdateOne) AddImages(i ...*Image) *ReviewUpdateOne

AddImages adds the "images" edges to the Image entity.

func (*ReviewUpdateOne) AddStars

func (ruo *ReviewUpdateOne) AddStars(i int) *ReviewUpdateOne

AddStars adds i to the "stars" field.

func (*ReviewUpdateOne) ClearAcceptedAt

func (ruo *ReviewUpdateOne) ClearAcceptedAt() *ReviewUpdateOne

ClearAcceptedAt clears the value of the "accepted_at" field.

func (*ReviewUpdateOne) ClearDisplayName

func (ruo *ReviewUpdateOne) ClearDisplayName() *ReviewUpdateOne

ClearDisplayName clears the value of the "display_name" field.

func (*ReviewUpdateOne) ClearImages

func (ruo *ReviewUpdateOne) ClearImages() *ReviewUpdateOne

ClearImages clears all "images" edges to the Image entity.

func (*ReviewUpdateOne) ClearOccurrence

func (ruo *ReviewUpdateOne) ClearOccurrence() *ReviewUpdateOne

ClearOccurrence clears the "occurrence" edge to the Occurrence entity.

func (*ReviewUpdateOne) ClearText

func (ruo *ReviewUpdateOne) ClearText() *ReviewUpdateOne

ClearText clears the value of the "text" field.

func (*ReviewUpdateOne) Exec

func (ruo *ReviewUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReviewUpdateOne) ExecX

func (ruo *ReviewUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReviewUpdateOne) Mutation

func (ruo *ReviewUpdateOne) Mutation() *ReviewMutation

Mutation returns the ReviewMutation object of the builder.

func (*ReviewUpdateOne) RemoveImageIDs

func (ruo *ReviewUpdateOne) RemoveImageIDs(ids ...uuid.UUID) *ReviewUpdateOne

RemoveImageIDs removes the "images" edge to Image entities by IDs.

func (*ReviewUpdateOne) RemoveImages

func (ruo *ReviewUpdateOne) RemoveImages(i ...*Image) *ReviewUpdateOne

RemoveImages removes "images" edges to Image entities.

func (*ReviewUpdateOne) Save

func (ruo *ReviewUpdateOne) Save(ctx context.Context) (*Review, error)

Save executes the query and returns the updated Review entity.

func (*ReviewUpdateOne) SaveX

func (ruo *ReviewUpdateOne) SaveX(ctx context.Context) *Review

SaveX is like Save, but panics if an error occurs.

func (*ReviewUpdateOne) Select

func (ruo *ReviewUpdateOne) Select(field string, fields ...string) *ReviewUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ReviewUpdateOne) SetAcceptedAt

func (ruo *ReviewUpdateOne) SetAcceptedAt(t time.Time) *ReviewUpdateOne

SetAcceptedAt sets the "accepted_at" field.

func (*ReviewUpdateOne) SetDisplayName

func (ruo *ReviewUpdateOne) SetDisplayName(s string) *ReviewUpdateOne

SetDisplayName sets the "display_name" field.

func (*ReviewUpdateOne) SetNillableAcceptedAt

func (ruo *ReviewUpdateOne) SetNillableAcceptedAt(t *time.Time) *ReviewUpdateOne

SetNillableAcceptedAt sets the "accepted_at" field if the given value is not nil.

func (*ReviewUpdateOne) SetNillableDisplayName

func (ruo *ReviewUpdateOne) SetNillableDisplayName(s *string) *ReviewUpdateOne

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*ReviewUpdateOne) SetNillableStars added in v0.8.3

func (ruo *ReviewUpdateOne) SetNillableStars(i *int) *ReviewUpdateOne

SetNillableStars sets the "stars" field if the given value is not nil.

func (*ReviewUpdateOne) SetNillableText

func (ruo *ReviewUpdateOne) SetNillableText(s *string) *ReviewUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*ReviewUpdateOne) SetOccurrence

func (ruo *ReviewUpdateOne) SetOccurrence(o *Occurrence) *ReviewUpdateOne

SetOccurrence sets the "occurrence" edge to the Occurrence entity.

func (*ReviewUpdateOne) SetOccurrenceID

func (ruo *ReviewUpdateOne) SetOccurrenceID(id uuid.UUID) *ReviewUpdateOne

SetOccurrenceID sets the "occurrence" edge to the Occurrence entity by ID.

func (*ReviewUpdateOne) SetStars

func (ruo *ReviewUpdateOne) SetStars(i int) *ReviewUpdateOne

SetStars sets the "stars" field.

func (*ReviewUpdateOne) SetText

func (ruo *ReviewUpdateOne) SetText(s string) *ReviewUpdateOne

SetText sets the "text" field.

func (*ReviewUpdateOne) SetUpdatedAt

func (ruo *ReviewUpdateOne) SetUpdatedAt(t time.Time) *ReviewUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ReviewUpdateOne) Where

func (ruo *ReviewUpdateOne) Where(ps ...predicate.Review) *ReviewUpdateOne

Where appends a list predicates to the ReviewUpdate builder.

type ReviewUpsert

type ReviewUpsert struct {
	*sql.UpdateSet
}

ReviewUpsert is the "OnConflict" setter.

func (*ReviewUpsert) AddStars

func (u *ReviewUpsert) AddStars(v int) *ReviewUpsert

AddStars adds v to the "stars" field.

func (*ReviewUpsert) ClearAcceptedAt

func (u *ReviewUpsert) ClearAcceptedAt() *ReviewUpsert

ClearAcceptedAt clears the value of the "accepted_at" field.

func (*ReviewUpsert) ClearDisplayName

func (u *ReviewUpsert) ClearDisplayName() *ReviewUpsert

ClearDisplayName clears the value of the "display_name" field.

func (*ReviewUpsert) ClearText

func (u *ReviewUpsert) ClearText() *ReviewUpsert

ClearText clears the value of the "text" field.

func (*ReviewUpsert) SetAcceptedAt

func (u *ReviewUpsert) SetAcceptedAt(v time.Time) *ReviewUpsert

SetAcceptedAt sets the "accepted_at" field.

func (*ReviewUpsert) SetDisplayName

func (u *ReviewUpsert) SetDisplayName(v string) *ReviewUpsert

SetDisplayName sets the "display_name" field.

func (*ReviewUpsert) SetStars

func (u *ReviewUpsert) SetStars(v int) *ReviewUpsert

SetStars sets the "stars" field.

func (*ReviewUpsert) SetText

func (u *ReviewUpsert) SetText(v string) *ReviewUpsert

SetText sets the "text" field.

func (*ReviewUpsert) SetUpdatedAt

func (u *ReviewUpsert) SetUpdatedAt(v time.Time) *ReviewUpsert

SetUpdatedAt sets the "updated_at" field.

func (*ReviewUpsert) UpdateAcceptedAt

func (u *ReviewUpsert) UpdateAcceptedAt() *ReviewUpsert

UpdateAcceptedAt sets the "accepted_at" field to the value that was provided on create.

func (*ReviewUpsert) UpdateDisplayName

func (u *ReviewUpsert) UpdateDisplayName() *ReviewUpsert

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*ReviewUpsert) UpdateStars

func (u *ReviewUpsert) UpdateStars() *ReviewUpsert

UpdateStars sets the "stars" field to the value that was provided on create.

func (*ReviewUpsert) UpdateText

func (u *ReviewUpsert) UpdateText() *ReviewUpsert

UpdateText sets the "text" field to the value that was provided on create.

func (*ReviewUpsert) UpdateUpdatedAt

func (u *ReviewUpsert) UpdateUpdatedAt() *ReviewUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ReviewUpsertBulk

type ReviewUpsertBulk struct {
	// contains filtered or unexported fields
}

ReviewUpsertBulk is the builder for "upsert"-ing a bulk of Review nodes.

func (*ReviewUpsertBulk) AddStars

func (u *ReviewUpsertBulk) AddStars(v int) *ReviewUpsertBulk

AddStars adds v to the "stars" field.

func (*ReviewUpsertBulk) ClearAcceptedAt

func (u *ReviewUpsertBulk) ClearAcceptedAt() *ReviewUpsertBulk

ClearAcceptedAt clears the value of the "accepted_at" field.

func (*ReviewUpsertBulk) ClearDisplayName

func (u *ReviewUpsertBulk) ClearDisplayName() *ReviewUpsertBulk

ClearDisplayName clears the value of the "display_name" field.

func (*ReviewUpsertBulk) ClearText

func (u *ReviewUpsertBulk) ClearText() *ReviewUpsertBulk

ClearText clears the value of the "text" field.

func (*ReviewUpsertBulk) DoNothing

func (u *ReviewUpsertBulk) DoNothing() *ReviewUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ReviewUpsertBulk) Exec

func (u *ReviewUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReviewUpsertBulk) ExecX

func (u *ReviewUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReviewUpsertBulk) Ignore

func (u *ReviewUpsertBulk) Ignore() *ReviewUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Review.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ReviewUpsertBulk) SetAcceptedAt

func (u *ReviewUpsertBulk) SetAcceptedAt(v time.Time) *ReviewUpsertBulk

SetAcceptedAt sets the "accepted_at" field.

func (*ReviewUpsertBulk) SetDisplayName

func (u *ReviewUpsertBulk) SetDisplayName(v string) *ReviewUpsertBulk

SetDisplayName sets the "display_name" field.

func (*ReviewUpsertBulk) SetStars

func (u *ReviewUpsertBulk) SetStars(v int) *ReviewUpsertBulk

SetStars sets the "stars" field.

func (*ReviewUpsertBulk) SetText

func (u *ReviewUpsertBulk) SetText(v string) *ReviewUpsertBulk

SetText sets the "text" field.

func (*ReviewUpsertBulk) SetUpdatedAt

func (u *ReviewUpsertBulk) SetUpdatedAt(v time.Time) *ReviewUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*ReviewUpsertBulk) Update

func (u *ReviewUpsertBulk) Update(set func(*ReviewUpsert)) *ReviewUpsertBulk

Update allows overriding fields `UPDATE` values. See the ReviewCreateBulk.OnConflict documentation for more info.

func (*ReviewUpsertBulk) UpdateAcceptedAt

func (u *ReviewUpsertBulk) UpdateAcceptedAt() *ReviewUpsertBulk

UpdateAcceptedAt sets the "accepted_at" field to the value that was provided on create.

func (*ReviewUpsertBulk) UpdateDisplayName

func (u *ReviewUpsertBulk) UpdateDisplayName() *ReviewUpsertBulk

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*ReviewUpsertBulk) UpdateNewValues

func (u *ReviewUpsertBulk) UpdateNewValues() *ReviewUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Review.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(review.FieldID)
		}),
	).
	Exec(ctx)

func (*ReviewUpsertBulk) UpdateStars

func (u *ReviewUpsertBulk) UpdateStars() *ReviewUpsertBulk

UpdateStars sets the "stars" field to the value that was provided on create.

func (*ReviewUpsertBulk) UpdateText

func (u *ReviewUpsertBulk) UpdateText() *ReviewUpsertBulk

UpdateText sets the "text" field to the value that was provided on create.

func (*ReviewUpsertBulk) UpdateUpdatedAt

func (u *ReviewUpsertBulk) UpdateUpdatedAt() *ReviewUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ReviewUpsertOne

type ReviewUpsertOne struct {
	// contains filtered or unexported fields
}

ReviewUpsertOne is the builder for "upsert"-ing

one Review node.

func (*ReviewUpsertOne) AddStars

func (u *ReviewUpsertOne) AddStars(v int) *ReviewUpsertOne

AddStars adds v to the "stars" field.

func (*ReviewUpsertOne) ClearAcceptedAt

func (u *ReviewUpsertOne) ClearAcceptedAt() *ReviewUpsertOne

ClearAcceptedAt clears the value of the "accepted_at" field.

func (*ReviewUpsertOne) ClearDisplayName

func (u *ReviewUpsertOne) ClearDisplayName() *ReviewUpsertOne

ClearDisplayName clears the value of the "display_name" field.

func (*ReviewUpsertOne) ClearText

func (u *ReviewUpsertOne) ClearText() *ReviewUpsertOne

ClearText clears the value of the "text" field.

func (*ReviewUpsertOne) DoNothing

func (u *ReviewUpsertOne) DoNothing() *ReviewUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ReviewUpsertOne) Exec

func (u *ReviewUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ReviewUpsertOne) ExecX

func (u *ReviewUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReviewUpsertOne) ID

func (u *ReviewUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ReviewUpsertOne) IDX

func (u *ReviewUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*ReviewUpsertOne) Ignore

func (u *ReviewUpsertOne) Ignore() *ReviewUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Review.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ReviewUpsertOne) SetAcceptedAt

func (u *ReviewUpsertOne) SetAcceptedAt(v time.Time) *ReviewUpsertOne

SetAcceptedAt sets the "accepted_at" field.

func (*ReviewUpsertOne) SetDisplayName

func (u *ReviewUpsertOne) SetDisplayName(v string) *ReviewUpsertOne

SetDisplayName sets the "display_name" field.

func (*ReviewUpsertOne) SetStars

func (u *ReviewUpsertOne) SetStars(v int) *ReviewUpsertOne

SetStars sets the "stars" field.

func (*ReviewUpsertOne) SetText

func (u *ReviewUpsertOne) SetText(v string) *ReviewUpsertOne

SetText sets the "text" field.

func (*ReviewUpsertOne) SetUpdatedAt

func (u *ReviewUpsertOne) SetUpdatedAt(v time.Time) *ReviewUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*ReviewUpsertOne) Update

func (u *ReviewUpsertOne) Update(set func(*ReviewUpsert)) *ReviewUpsertOne

Update allows overriding fields `UPDATE` values. See the ReviewCreate.OnConflict documentation for more info.

func (*ReviewUpsertOne) UpdateAcceptedAt

func (u *ReviewUpsertOne) UpdateAcceptedAt() *ReviewUpsertOne

UpdateAcceptedAt sets the "accepted_at" field to the value that was provided on create.

func (*ReviewUpsertOne) UpdateDisplayName

func (u *ReviewUpsertOne) UpdateDisplayName() *ReviewUpsertOne

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*ReviewUpsertOne) UpdateNewValues

func (u *ReviewUpsertOne) UpdateNewValues() *ReviewUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Review.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(review.FieldID)
		}),
	).
	Exec(ctx)

func (*ReviewUpsertOne) UpdateStars

func (u *ReviewUpsertOne) UpdateStars() *ReviewUpsertOne

UpdateStars sets the "stars" field to the value that was provided on create.

func (*ReviewUpsertOne) UpdateText

func (u *ReviewUpsertOne) UpdateText() *ReviewUpsertOne

UpdateText sets the "text" field to the value that was provided on create.

func (*ReviewUpsertOne) UpdateUpdatedAt

func (u *ReviewUpsertOne) UpdateUpdatedAt() *ReviewUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Reviews

type Reviews []*Review

Reviews is a parsable slice of Review.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Tag

type Tag struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// ShortName holds the value of the "short_name" field.
	ShortName *string `json:"short_name,omitempty"`
	// Priority holds the value of the "priority" field.
	Priority schema.TagPriority `json:"priority,omitempty"`
	// IsAllergy holds the value of the "is_allergy" field.
	IsAllergy bool `json:"is_allergy,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TagQuery when eager-loading is set.
	Edges TagEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tag is the model entity for the Tag schema.

func (*Tag) QueryOccurrence

func (t *Tag) QueryOccurrence() *OccurrenceQuery

QueryOccurrence queries the "occurrence" edge of the Tag entity.

func (*Tag) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

Unwrap unwraps the Tag entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Tag) Update

func (t *Tag) Update() *TagUpdateOne

Update returns a builder for updating this Tag. Note that you need to call Tag.Unwrap() before calling this method if this Tag was returned from a transaction, and the transaction was committed or rolled back.

func (*Tag) Value

func (t *Tag) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Tag. This includes values selected through modifiers, order, etc.

type TagClient

type TagClient struct {
	// contains filtered or unexported fields
}

TagClient is a client for the Tag schema.

func NewTagClient

func NewTagClient(c config) *TagClient

NewTagClient returns a client for the Tag from the given config.

func (*TagClient) Create

func (c *TagClient) Create() *TagCreate

Create returns a builder for creating a Tag entity.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

CreateBulk returns a builder for creating a bulk of Tag entities.

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

func (*TagClient) DeleteOne

func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TagClient) DeleteOneID

func (c *TagClient) DeleteOneID(id string) *TagDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TagClient) Get

func (c *TagClient) Get(ctx context.Context, id string) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id string) *Tag

GetX is like Get, but panics if an error occurs.

func (*TagClient) Hooks

func (c *TagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TagClient) Intercept

func (c *TagClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tag.Intercept(f(g(h())))`.

func (*TagClient) Interceptors

func (c *TagClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TagClient) MapCreateBulk added in v0.8.3

func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*TagClient) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryOccurrence

func (c *TagClient) QueryOccurrence(t *Tag) *OccurrenceQuery

QueryOccurrence queries the occurrence edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for Tag.

func (*TagClient) UpdateOne

func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagClient) UpdateOneID

func (c *TagClient) UpdateOneID(id string) *TagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TagClient) Use

func (c *TagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tag.Hooks(f(g(h())))`.

type TagCreate

type TagCreate struct {
	// contains filtered or unexported fields
}

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) AddOccurrence

func (tc *TagCreate) AddOccurrence(o ...*Occurrence) *TagCreate

AddOccurrence adds the "occurrence" edges to the Occurrence entity.

func (*TagCreate) AddOccurrenceIDs

func (tc *TagCreate) AddOccurrenceIDs(ids ...uuid.UUID) *TagCreate

AddOccurrenceIDs adds the "occurrence" edge to the Occurrence entity by IDs.

func (*TagCreate) Exec

func (tc *TagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreate) ExecX

func (tc *TagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) OnConflict

func (tc *TagCreate) OnConflict(opts ...sql.ConflictOption) *TagUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tag.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TagUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*TagCreate) OnConflictColumns

func (tc *TagCreate) OnConflictColumns(columns ...string) *TagUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tag.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetDescription

func (tc *TagCreate) SetDescription(s string) *TagCreate

SetDescription sets the "description" field.

func (*TagCreate) SetID

func (tc *TagCreate) SetID(s string) *TagCreate

SetID sets the "id" field.

func (*TagCreate) SetIsAllergy

func (tc *TagCreate) SetIsAllergy(b bool) *TagCreate

SetIsAllergy sets the "is_allergy" field.

func (*TagCreate) SetName

func (tc *TagCreate) SetName(s string) *TagCreate

SetName sets the "name" field.

func (*TagCreate) SetNillableIsAllergy

func (tc *TagCreate) SetNillableIsAllergy(b *bool) *TagCreate

SetNillableIsAllergy sets the "is_allergy" field if the given value is not nil.

func (*TagCreate) SetNillablePriority

func (tc *TagCreate) SetNillablePriority(sp *schema.TagPriority) *TagCreate

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*TagCreate) SetNillableShortName

func (tc *TagCreate) SetNillableShortName(s *string) *TagCreate

SetNillableShortName sets the "short_name" field if the given value is not nil.

func (*TagCreate) SetPriority

func (tc *TagCreate) SetPriority(sp schema.TagPriority) *TagCreate

SetPriority sets the "priority" field.

func (*TagCreate) SetShortName

func (tc *TagCreate) SetShortName(s string) *TagCreate

SetShortName sets the "short_name" field.

type TagCreateBulk

type TagCreateBulk struct {
	// contains filtered or unexported fields
}

TagCreateBulk is the builder for creating many Tag entities in bulk.

func (*TagCreateBulk) Exec

func (tcb *TagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreateBulk) ExecX

func (tcb *TagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagCreateBulk) OnConflict

func (tcb *TagCreateBulk) OnConflict(opts ...sql.ConflictOption) *TagUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tag.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TagUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*TagCreateBulk) OnConflictColumns

func (tcb *TagCreateBulk) OnConflictColumns(columns ...string) *TagUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tag.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

SaveX is like Save, but panics if an error occurs.

type TagDelete

type TagDelete struct {
	// contains filtered or unexported fields
}

TagDelete is the builder for deleting a Tag entity.

func (*TagDelete) Exec

func (td *TagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TagDelete) ExecX

func (td *TagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where appends a list predicates to the TagDelete builder.

type TagDeleteOne

type TagDeleteOne struct {
	// contains filtered or unexported fields
}

TagDeleteOne is the builder for deleting a single Tag entity.

func (*TagDeleteOne) Exec

func (tdo *TagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TagDeleteOne) ExecX

func (tdo *TagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagDeleteOne) Where

func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne

Where appends a list predicates to the TagDelete builder.

type TagEdges

type TagEdges struct {
	// Occurrence holds the value of the occurrence edge.
	Occurrence []*Occurrence `json:"occurrence,omitempty"`
	// contains filtered or unexported fields
}

TagEdges holds the relations/edges for other nodes in the graph.

func (TagEdges) OccurrenceOrErr

func (e TagEdges) OccurrenceOrErr() ([]*Occurrence, error)

OccurrenceOrErr returns the Occurrence value or an error if the edge was not loaded in eager-loading.

type TagGroupBy

type TagGroupBy struct {
	// contains filtered or unexported fields
}

TagGroupBy is the group-by builder for Tag entities.

func (*TagGroupBy) Aggregate

func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TagGroupBy) Bool

func (s *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolX

func (s *TagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagGroupBy) Bools

func (s *TagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolsX

func (s *TagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagGroupBy) Float64

func (s *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64X

func (s *TagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagGroupBy) Float64s

func (s *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64sX

func (s *TagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagGroupBy) Int

func (s *TagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntX

func (s *TagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagGroupBy) Ints

func (s *TagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntsX

func (s *TagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagGroupBy) Scan

func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TagGroupBy) ScanX

func (s *TagGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TagGroupBy) String

func (s *TagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringX

func (s *TagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagGroupBy) Strings

func (s *TagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringsX

func (s *TagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagMutation

type TagMutation struct {
	// contains filtered or unexported fields
}

TagMutation represents an operation that mutates the Tag nodes in the graph.

func (*TagMutation) AddField

func (m *TagMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TagMutation) AddOccurrenceIDs

func (m *TagMutation) AddOccurrenceIDs(ids ...uuid.UUID)

AddOccurrenceIDs adds the "occurrence" edge to the Occurrence entity by ids.

func (*TagMutation) AddedEdges

func (m *TagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TagMutation) AddedField

func (m *TagMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TagMutation) AddedFields

func (m *TagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TagMutation) AddedIDs

func (m *TagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TagMutation) ClearEdge

func (m *TagMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*TagMutation) ClearField

func (m *TagMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*TagMutation) ClearOccurrence

func (m *TagMutation) ClearOccurrence()

ClearOccurrence clears the "occurrence" edge to the Occurrence entity.

func (*TagMutation) ClearShortName

func (m *TagMutation) ClearShortName()

ClearShortName clears the value of the "short_name" field.

func (*TagMutation) ClearedEdges

func (m *TagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TagMutation) ClearedFields

func (m *TagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TagMutation) Client

func (m TagMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*TagMutation) Description

func (m *TagMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*TagMutation) EdgeCleared

func (m *TagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TagMutation) Field

func (m *TagMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TagMutation) FieldCleared

func (m *TagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TagMutation) Fields

func (m *TagMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*TagMutation) ID

func (m *TagMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*TagMutation) IDs

func (m *TagMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*TagMutation) IsAllergy

func (m *TagMutation) IsAllergy() (r bool, exists bool)

IsAllergy returns the value of the "is_allergy" field in the mutation.

func (*TagMutation) Name

func (m *TagMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*TagMutation) OccurrenceCleared

func (m *TagMutation) OccurrenceCleared() bool

OccurrenceCleared reports if the "occurrence" edge to the Occurrence entity was cleared.

func (*TagMutation) OccurrenceIDs

func (m *TagMutation) OccurrenceIDs() (ids []uuid.UUID)

OccurrenceIDs returns the "occurrence" edge IDs in the mutation.

func (*TagMutation) OldDescription

func (m *TagMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TagMutation) OldField

func (m *TagMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*TagMutation) OldIsAllergy

func (m *TagMutation) OldIsAllergy(ctx context.Context) (v bool, err error)

OldIsAllergy returns the old "is_allergy" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TagMutation) OldName

func (m *TagMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TagMutation) OldPriority

func (m *TagMutation) OldPriority(ctx context.Context) (v schema.TagPriority, err error)

OldPriority returns the old "priority" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TagMutation) OldShortName

func (m *TagMutation) OldShortName(ctx context.Context) (v *string, err error)

OldShortName returns the old "short_name" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TagMutation) Op

func (m *TagMutation) Op() Op

Op returns the operation name.

func (*TagMutation) Priority

func (m *TagMutation) Priority() (r schema.TagPriority, exists bool)

Priority returns the value of the "priority" field in the mutation.

func (*TagMutation) RemoveOccurrenceIDs

func (m *TagMutation) RemoveOccurrenceIDs(ids ...uuid.UUID)

RemoveOccurrenceIDs removes the "occurrence" edge to the Occurrence entity by IDs.

func (*TagMutation) RemovedEdges

func (m *TagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TagMutation) RemovedIDs

func (m *TagMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*TagMutation) RemovedOccurrenceIDs

func (m *TagMutation) RemovedOccurrenceIDs() (ids []uuid.UUID)

RemovedOccurrence returns the removed IDs of the "occurrence" edge to the Occurrence entity.

func (*TagMutation) ResetDescription

func (m *TagMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*TagMutation) ResetEdge

func (m *TagMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*TagMutation) ResetField

func (m *TagMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*TagMutation) ResetIsAllergy

func (m *TagMutation) ResetIsAllergy()

ResetIsAllergy resets all changes to the "is_allergy" field.

func (*TagMutation) ResetName

func (m *TagMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TagMutation) ResetOccurrence

func (m *TagMutation) ResetOccurrence()

ResetOccurrence resets all changes to the "occurrence" edge.

func (*TagMutation) ResetPriority

func (m *TagMutation) ResetPriority()

ResetPriority resets all changes to the "priority" field.

func (*TagMutation) ResetShortName

func (m *TagMutation) ResetShortName()

ResetShortName resets all changes to the "short_name" field.

func (*TagMutation) SetDescription

func (m *TagMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*TagMutation) SetField

func (m *TagMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TagMutation) SetID

func (m *TagMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Tag entities.

func (*TagMutation) SetIsAllergy

func (m *TagMutation) SetIsAllergy(b bool)

SetIsAllergy sets the "is_allergy" field.

func (*TagMutation) SetName

func (m *TagMutation) SetName(s string)

SetName sets the "name" field.

func (*TagMutation) SetOp

func (m *TagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TagMutation) SetPriority

func (m *TagMutation) SetPriority(sp schema.TagPriority)

SetPriority sets the "priority" field.

func (*TagMutation) SetShortName

func (m *TagMutation) SetShortName(s string)

SetShortName sets the "short_name" field.

func (*TagMutation) ShortName

func (m *TagMutation) ShortName() (r string, exists bool)

ShortName returns the value of the "short_name" field in the mutation.

func (*TagMutation) ShortNameCleared

func (m *TagMutation) ShortNameCleared() bool

ShortNameCleared returns if the "short_name" field was cleared in this mutation.

func (TagMutation) Tx

func (m TagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TagMutation) Type

func (m *TagMutation) Type() string

Type returns the node type of this mutation (Tag).

func (*TagMutation) Where

func (m *TagMutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the TagMutation builder.

func (*TagMutation) WhereP

func (m *TagMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TagQuery

type TagQuery struct {
	// contains filtered or unexported fields
}

TagQuery is the builder for querying Tag entities.

func (*TagQuery) Aggregate

func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate returns a TagSelect configured with the given aggregations.

func (*TagQuery) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

AllX is like All, but panics if an error occurs.

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

Clone returns a duplicate of the TagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TagQuery) Count

func (tq *TagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagQuery) CountX

func (tq *TagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TagQuery) Exist

func (tq *TagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TagQuery) ExistX

func (tq *TagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

First returns the first Tag entity from the query. Returns a *NotFoundError when no Tag was found.

func (*TagQuery) FirstID

func (tq *TagQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Tag ID from the query. Returns a *NotFoundError when no Tag ID was found.

func (*TagQuery) FirstIDX

func (tq *TagQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

FirstX is like First, but panics if an error occurs.

func (*TagQuery) GroupBy

func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Tag.Query().
	GroupBy(tag.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TagQuery) IDs

func (tq *TagQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of Tag IDs.

func (*TagQuery) IDsX

func (tq *TagQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*TagQuery) Limit

func (tq *TagQuery) Limit(limit int) *TagQuery

Limit the number of records to be returned by this query.

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset to start from.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

Only returns a single Tag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tag entity is found. Returns a *NotFoundError when no Tag entities are found.

func (*TagQuery) OnlyID

func (tq *TagQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Tag ID in the query. Returns a *NotSingularError when more than one Tag ID is found. Returns a *NotFoundError when no entities are found.

func (*TagQuery) OnlyIDX

func (tq *TagQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

OnlyX is like Only, but panics if an error occurs.

func (*TagQuery) Order

func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery

Order specifies how the records should be ordered.

func (*TagQuery) QueryOccurrence

func (tq *TagQuery) QueryOccurrence() *OccurrenceQuery

QueryOccurrence chains the current query on the "occurrence" edge.

func (*TagQuery) Select

func (tq *TagQuery) Select(fields ...string) *TagSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Tag.Query().
	Select(tag.FieldName).
	Scan(ctx, &v)

func (*TagQuery) Unique

func (tq *TagQuery) Unique(unique bool) *TagQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*TagQuery) Where

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the TagQuery builder.

func (*TagQuery) WithOccurrence

func (tq *TagQuery) WithOccurrence(opts ...func(*OccurrenceQuery)) *TagQuery

WithOccurrence tells the query-builder to eager-load the nodes that are connected to the "occurrence" edge. The optional arguments are used to configure the query builder of the edge.

type TagSelect

type TagSelect struct {
	*TagQuery
	// contains filtered or unexported fields
}

TagSelect is the builder for selecting fields of Tag entities.

func (*TagSelect) Aggregate

func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TagSelect) Bool

func (s *TagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolX

func (s *TagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagSelect) Bools

func (s *TagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolsX

func (s *TagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagSelect) Float64

func (s *TagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64X

func (s *TagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagSelect) Float64s

func (s *TagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64sX

func (s *TagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagSelect) Int

func (s *TagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntX

func (s *TagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagSelect) Ints

func (s *TagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntsX

func (s *TagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagSelect) Scan

func (ts *TagSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TagSelect) ScanX

func (s *TagSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TagSelect) String

func (s *TagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringX

func (s *TagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagSelect) Strings

func (s *TagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringsX

func (s *TagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagUpdate

type TagUpdate struct {
	// contains filtered or unexported fields
}

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddOccurrence

func (tu *TagUpdate) AddOccurrence(o ...*Occurrence) *TagUpdate

AddOccurrence adds the "occurrence" edges to the Occurrence entity.

func (*TagUpdate) AddOccurrenceIDs

func (tu *TagUpdate) AddOccurrenceIDs(ids ...uuid.UUID) *TagUpdate

AddOccurrenceIDs adds the "occurrence" edge to the Occurrence entity by IDs.

func (*TagUpdate) ClearOccurrence

func (tu *TagUpdate) ClearOccurrence() *TagUpdate

ClearOccurrence clears all "occurrence" edges to the Occurrence entity.

func (*TagUpdate) ClearShortName

func (tu *TagUpdate) ClearShortName() *TagUpdate

ClearShortName clears the value of the "short_name" field.

func (*TagUpdate) Exec

func (tu *TagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpdate) ExecX

func (tu *TagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) RemoveOccurrence

func (tu *TagUpdate) RemoveOccurrence(o ...*Occurrence) *TagUpdate

RemoveOccurrence removes "occurrence" edges to Occurrence entities.

func (*TagUpdate) RemoveOccurrenceIDs

func (tu *TagUpdate) RemoveOccurrenceIDs(ids ...uuid.UUID) *TagUpdate

RemoveOccurrenceIDs removes the "occurrence" edge to Occurrence entities by IDs.

func (*TagUpdate) Save

func (tu *TagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TagUpdate) SaveX

func (tu *TagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TagUpdate) SetDescription

func (tu *TagUpdate) SetDescription(s string) *TagUpdate

SetDescription sets the "description" field.

func (*TagUpdate) SetIsAllergy

func (tu *TagUpdate) SetIsAllergy(b bool) *TagUpdate

SetIsAllergy sets the "is_allergy" field.

func (*TagUpdate) SetName

func (tu *TagUpdate) SetName(s string) *TagUpdate

SetName sets the "name" field.

func (*TagUpdate) SetNillableDescription added in v0.8.3

func (tu *TagUpdate) SetNillableDescription(s *string) *TagUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TagUpdate) SetNillableIsAllergy

func (tu *TagUpdate) SetNillableIsAllergy(b *bool) *TagUpdate

SetNillableIsAllergy sets the "is_allergy" field if the given value is not nil.

func (*TagUpdate) SetNillableName added in v0.8.3

func (tu *TagUpdate) SetNillableName(s *string) *TagUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*TagUpdate) SetNillablePriority

func (tu *TagUpdate) SetNillablePriority(sp *schema.TagPriority) *TagUpdate

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*TagUpdate) SetNillableShortName

func (tu *TagUpdate) SetNillableShortName(s *string) *TagUpdate

SetNillableShortName sets the "short_name" field if the given value is not nil.

func (*TagUpdate) SetPriority

func (tu *TagUpdate) SetPriority(sp schema.TagPriority) *TagUpdate

SetPriority sets the "priority" field.

func (*TagUpdate) SetShortName

func (tu *TagUpdate) SetShortName(s string) *TagUpdate

SetShortName sets the "short_name" field.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where appends a list predicates to the TagUpdate builder.

type TagUpdateOne

type TagUpdateOne struct {
	// contains filtered or unexported fields
}

TagUpdateOne is the builder for updating a single Tag entity.

func (*TagUpdateOne) AddOccurrence

func (tuo *TagUpdateOne) AddOccurrence(o ...*Occurrence) *TagUpdateOne

AddOccurrence adds the "occurrence" edges to the Occurrence entity.

func (*TagUpdateOne) AddOccurrenceIDs

func (tuo *TagUpdateOne) AddOccurrenceIDs(ids ...uuid.UUID) *TagUpdateOne

AddOccurrenceIDs adds the "occurrence" edge to the Occurrence entity by IDs.

func (*TagUpdateOne) ClearOccurrence

func (tuo *TagUpdateOne) ClearOccurrence() *TagUpdateOne

ClearOccurrence clears all "occurrence" edges to the Occurrence entity.

func (*TagUpdateOne) ClearShortName

func (tuo *TagUpdateOne) ClearShortName() *TagUpdateOne

ClearShortName clears the value of the "short_name" field.

func (*TagUpdateOne) Exec

func (tuo *TagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TagUpdateOne) ExecX

func (tuo *TagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdateOne) Mutation

func (tuo *TagUpdateOne) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdateOne) RemoveOccurrence

func (tuo *TagUpdateOne) RemoveOccurrence(o ...*Occurrence) *TagUpdateOne

RemoveOccurrence removes "occurrence" edges to Occurrence entities.

func (*TagUpdateOne) RemoveOccurrenceIDs

func (tuo *TagUpdateOne) RemoveOccurrenceIDs(ids ...uuid.UUID) *TagUpdateOne

RemoveOccurrenceIDs removes the "occurrence" edge to Occurrence entities by IDs.

func (*TagUpdateOne) Save

func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)

Save executes the query and returns the updated Tag entity.

func (*TagUpdateOne) SaveX

func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag

SaveX is like Save, but panics if an error occurs.

func (*TagUpdateOne) Select

func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TagUpdateOne) SetDescription

func (tuo *TagUpdateOne) SetDescription(s string) *TagUpdateOne

SetDescription sets the "description" field.

func (*TagUpdateOne) SetIsAllergy

func (tuo *TagUpdateOne) SetIsAllergy(b bool) *TagUpdateOne

SetIsAllergy sets the "is_allergy" field.

func (*TagUpdateOne) SetName

func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne

SetName sets the "name" field.

func (*TagUpdateOne) SetNillableDescription added in v0.8.3

func (tuo *TagUpdateOne) SetNillableDescription(s *string) *TagUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TagUpdateOne) SetNillableIsAllergy

func (tuo *TagUpdateOne) SetNillableIsAllergy(b *bool) *TagUpdateOne

SetNillableIsAllergy sets the "is_allergy" field if the given value is not nil.

func (*TagUpdateOne) SetNillableName added in v0.8.3

func (tuo *TagUpdateOne) SetNillableName(s *string) *TagUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*TagUpdateOne) SetNillablePriority

func (tuo *TagUpdateOne) SetNillablePriority(sp *schema.TagPriority) *TagUpdateOne

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*TagUpdateOne) SetNillableShortName

func (tuo *TagUpdateOne) SetNillableShortName(s *string) *TagUpdateOne

SetNillableShortName sets the "short_name" field if the given value is not nil.

func (*TagUpdateOne) SetPriority

func (tuo *TagUpdateOne) SetPriority(sp schema.TagPriority) *TagUpdateOne

SetPriority sets the "priority" field.

func (*TagUpdateOne) SetShortName

func (tuo *TagUpdateOne) SetShortName(s string) *TagUpdateOne

SetShortName sets the "short_name" field.

func (*TagUpdateOne) Where

func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne

Where appends a list predicates to the TagUpdate builder.

type TagUpsert

type TagUpsert struct {
	*sql.UpdateSet
}

TagUpsert is the "OnConflict" setter.

func (*TagUpsert) ClearShortName

func (u *TagUpsert) ClearShortName() *TagUpsert

ClearShortName clears the value of the "short_name" field.

func (*TagUpsert) SetDescription

func (u *TagUpsert) SetDescription(v string) *TagUpsert

SetDescription sets the "description" field.

func (*TagUpsert) SetIsAllergy

func (u *TagUpsert) SetIsAllergy(v bool) *TagUpsert

SetIsAllergy sets the "is_allergy" field.

func (*TagUpsert) SetName

func (u *TagUpsert) SetName(v string) *TagUpsert

SetName sets the "name" field.

func (*TagUpsert) SetPriority

func (u *TagUpsert) SetPriority(v schema.TagPriority) *TagUpsert

SetPriority sets the "priority" field.

func (*TagUpsert) SetShortName

func (u *TagUpsert) SetShortName(v string) *TagUpsert

SetShortName sets the "short_name" field.

func (*TagUpsert) UpdateDescription

func (u *TagUpsert) UpdateDescription() *TagUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*TagUpsert) UpdateIsAllergy

func (u *TagUpsert) UpdateIsAllergy() *TagUpsert

UpdateIsAllergy sets the "is_allergy" field to the value that was provided on create.

func (*TagUpsert) UpdateName

func (u *TagUpsert) UpdateName() *TagUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*TagUpsert) UpdatePriority

func (u *TagUpsert) UpdatePriority() *TagUpsert

UpdatePriority sets the "priority" field to the value that was provided on create.

func (*TagUpsert) UpdateShortName

func (u *TagUpsert) UpdateShortName() *TagUpsert

UpdateShortName sets the "short_name" field to the value that was provided on create.

type TagUpsertBulk

type TagUpsertBulk struct {
	// contains filtered or unexported fields
}

TagUpsertBulk is the builder for "upsert"-ing a bulk of Tag nodes.

func (*TagUpsertBulk) ClearShortName

func (u *TagUpsertBulk) ClearShortName() *TagUpsertBulk

ClearShortName clears the value of the "short_name" field.

func (*TagUpsertBulk) DoNothing

func (u *TagUpsertBulk) DoNothing() *TagUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TagUpsertBulk) Exec

func (u *TagUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpsertBulk) ExecX

func (u *TagUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpsertBulk) Ignore

func (u *TagUpsertBulk) Ignore() *TagUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tag.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TagUpsertBulk) SetDescription

func (u *TagUpsertBulk) SetDescription(v string) *TagUpsertBulk

SetDescription sets the "description" field.

func (*TagUpsertBulk) SetIsAllergy

func (u *TagUpsertBulk) SetIsAllergy(v bool) *TagUpsertBulk

SetIsAllergy sets the "is_allergy" field.

func (*TagUpsertBulk) SetName

func (u *TagUpsertBulk) SetName(v string) *TagUpsertBulk

SetName sets the "name" field.

func (*TagUpsertBulk) SetPriority

func (u *TagUpsertBulk) SetPriority(v schema.TagPriority) *TagUpsertBulk

SetPriority sets the "priority" field.

func (*TagUpsertBulk) SetShortName

func (u *TagUpsertBulk) SetShortName(v string) *TagUpsertBulk

SetShortName sets the "short_name" field.

func (*TagUpsertBulk) Update

func (u *TagUpsertBulk) Update(set func(*TagUpsert)) *TagUpsertBulk

Update allows overriding fields `UPDATE` values. See the TagCreateBulk.OnConflict documentation for more info.

func (*TagUpsertBulk) UpdateDescription

func (u *TagUpsertBulk) UpdateDescription() *TagUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*TagUpsertBulk) UpdateIsAllergy

func (u *TagUpsertBulk) UpdateIsAllergy() *TagUpsertBulk

UpdateIsAllergy sets the "is_allergy" field to the value that was provided on create.

func (*TagUpsertBulk) UpdateName

func (u *TagUpsertBulk) UpdateName() *TagUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*TagUpsertBulk) UpdateNewValues

func (u *TagUpsertBulk) UpdateNewValues() *TagUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Tag.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(tag.FieldID)
		}),
	).
	Exec(ctx)

func (*TagUpsertBulk) UpdatePriority

func (u *TagUpsertBulk) UpdatePriority() *TagUpsertBulk

UpdatePriority sets the "priority" field to the value that was provided on create.

func (*TagUpsertBulk) UpdateShortName

func (u *TagUpsertBulk) UpdateShortName() *TagUpsertBulk

UpdateShortName sets the "short_name" field to the value that was provided on create.

type TagUpsertOne

type TagUpsertOne struct {
	// contains filtered or unexported fields
}

TagUpsertOne is the builder for "upsert"-ing

one Tag node.

func (*TagUpsertOne) ClearShortName

func (u *TagUpsertOne) ClearShortName() *TagUpsertOne

ClearShortName clears the value of the "short_name" field.

func (*TagUpsertOne) DoNothing

func (u *TagUpsertOne) DoNothing() *TagUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TagUpsertOne) Exec

func (u *TagUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpsertOne) ExecX

func (u *TagUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpsertOne) ID

func (u *TagUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*TagUpsertOne) IDX

func (u *TagUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*TagUpsertOne) Ignore

func (u *TagUpsertOne) Ignore() *TagUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tag.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TagUpsertOne) SetDescription

func (u *TagUpsertOne) SetDescription(v string) *TagUpsertOne

SetDescription sets the "description" field.

func (*TagUpsertOne) SetIsAllergy

func (u *TagUpsertOne) SetIsAllergy(v bool) *TagUpsertOne

SetIsAllergy sets the "is_allergy" field.

func (*TagUpsertOne) SetName

func (u *TagUpsertOne) SetName(v string) *TagUpsertOne

SetName sets the "name" field.

func (*TagUpsertOne) SetPriority

func (u *TagUpsertOne) SetPriority(v schema.TagPriority) *TagUpsertOne

SetPriority sets the "priority" field.

func (*TagUpsertOne) SetShortName

func (u *TagUpsertOne) SetShortName(v string) *TagUpsertOne

SetShortName sets the "short_name" field.

func (*TagUpsertOne) Update

func (u *TagUpsertOne) Update(set func(*TagUpsert)) *TagUpsertOne

Update allows overriding fields `UPDATE` values. See the TagCreate.OnConflict documentation for more info.

func (*TagUpsertOne) UpdateDescription

func (u *TagUpsertOne) UpdateDescription() *TagUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*TagUpsertOne) UpdateIsAllergy

func (u *TagUpsertOne) UpdateIsAllergy() *TagUpsertOne

UpdateIsAllergy sets the "is_allergy" field to the value that was provided on create.

func (*TagUpsertOne) UpdateName

func (u *TagUpsertOne) UpdateName() *TagUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*TagUpsertOne) UpdateNewValues

func (u *TagUpsertOne) UpdateNewValues() *TagUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Tag.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(tag.FieldID)
		}),
	).
	Exec(ctx)

func (*TagUpsertOne) UpdatePriority

func (u *TagUpsertOne) UpdatePriority() *TagUpsertOne

UpdatePriority sets the "priority" field to the value that was provided on create.

func (*TagUpsertOne) UpdateShortName

func (u *TagUpsertOne) UpdateShortName() *TagUpsertOne

UpdateShortName sets the "short_name" field to the value that was provided on create.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Dish is the client for interacting with the Dish builders.
	Dish *DishClient
	// DishAlias is the client for interacting with the DishAlias builders.
	DishAlias *DishAliasClient
	// Image is the client for interacting with the Image builders.
	Image *ImageClient
	// Location is the client for interacting with the Location builders.
	Location *LocationClient
	// Occurrence is the client for interacting with the Occurrence builders.
	Occurrence *OccurrenceClient
	// Review is the client for interacting with the Review builders.
	Review *ReviewClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// 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

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"-"`
	// PasswordHash holds the value of the "password_hash" field.
	PasswordHash string `json:"-"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk added in v0.8.3

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) 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) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetEmail(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetEmail(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

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) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserCreate) SetPasswordHash

func (uc *UserCreate) SetPasswordHash(s string) *UserCreate

SetPasswordHash sets the "password_hash" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetEmail(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) 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) 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) 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) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldPasswordHash

func (m *UserMutation) OldPasswordHash(ctx context.Context) (v string, err error)

OldPasswordHash returns the old "password_hash" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) PasswordHash

func (m *UserMutation) PasswordHash() (r string, exists bool)

PasswordHash returns the value of the "password_hash" field in the mutation.

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) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetPasswordHash

func (m *UserMutation) ResetPasswordHash()

ResetPasswordHash resets all changes to the "password_hash" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPasswordHash

func (m *UserMutation) SetPasswordHash(s string)

SetPasswordHash sets the "password_hash" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" 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) UpdatedAt

func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Email string `json:"email,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldEmail).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

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 {
	Email string `json:"email,omitempty"`
}

client.User.Query().
	Select(user.FieldEmail).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

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) 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) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetNillableEmail added in v0.8.3

func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillablePasswordHash added in v0.8.3

func (uu *UserUpdate) SetNillablePasswordHash(s *string) *UserUpdate

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*UserUpdate) SetPasswordHash

func (uu *UserUpdate) SetPasswordHash(s string) *UserUpdate

SetPasswordHash sets the "password_hash" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" 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) 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) 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) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetNillableEmail added in v0.8.3

func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePasswordHash added in v0.8.3

func (uuo *UserUpdateOne) SetNillablePasswordHash(s *string) *UserUpdateOne

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*UserUpdateOne) SetPasswordHash

func (uuo *UserUpdateOne) SetPasswordHash(s string) *UserUpdateOne

SetPasswordHash sets the "password_hash" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) SetEmail

func (u *UserUpsert) SetEmail(v string) *UserUpsert

SetEmail sets the "email" field.

func (*UserUpsert) SetPasswordHash

func (u *UserUpsert) SetPasswordHash(v string) *UserUpsert

SetPasswordHash sets the "password_hash" field.

func (*UserUpsert) SetUpdatedAt

func (u *UserUpsert) SetUpdatedAt(v time.Time) *UserUpsert

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsert) UpdateEmail

func (u *UserUpsert) UpdateEmail() *UserUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsert) UpdatePasswordHash

func (u *UserUpsert) UpdatePasswordHash() *UserUpsert

UpdatePasswordHash sets the "password_hash" field to the value that was provided on create.

func (*UserUpsert) UpdateUpdatedAt

func (u *UserUpsert) UpdateUpdatedAt() *UserUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type UserUpsertBulk

type UserUpsertBulk struct {
	// contains filtered or unexported fields
}

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetEmail

func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk

SetEmail sets the "email" field.

func (*UserUpsertBulk) SetPasswordHash

func (u *UserUpsertBulk) SetPasswordHash(v string) *UserUpsertBulk

SetPasswordHash sets the "password_hash" field.

func (*UserUpsertBulk) SetUpdatedAt

func (u *UserUpsertBulk) SetUpdatedAt(v time.Time) *UserUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateEmail

func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdatePasswordHash

func (u *UserUpsertBulk) UpdatePasswordHash() *UserUpsertBulk

UpdatePasswordHash sets the "password_hash" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUpdatedAt

func (u *UserUpsertBulk) UpdateUpdatedAt() *UserUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type UserUpsertOne

type UserUpsertOne struct {
	// contains filtered or unexported fields
}

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetEmail

func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne

SetEmail sets the "email" field.

func (*UserUpsertOne) SetPasswordHash

func (u *UserUpsertOne) SetPasswordHash(v string) *UserUpsertOne

SetPasswordHash sets the "password_hash" field.

func (*UserUpsertOne) SetUpdatedAt

func (u *UserUpsertOne) SetUpdatedAt(v time.Time) *UserUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateEmail

func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdatePasswordHash

func (u *UserUpsertOne) UpdatePasswordHash() *UserUpsertOne

UpdatePasswordHash sets the "password_hash" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUpdatedAt

func (u *UserUpsertOne) UpdateUpdatedAt() *UserUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL