ent

package
v0.0.0-...-1d99369 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 29 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.
	TypeAmazonList           = "AmazonList"
	TypeAmazonOrder          = "AmazonOrder"
	TypeAmazonShare          = "AmazonShare"
	TypeDrink                = "Drink"
	TypeGroceryList          = "GroceryList"
	TypeGroceryListItem      = "GroceryListItem"
	TypeGroceryListShare     = "GroceryListShare"
	TypeMovie                = "Movie"
	TypeMovieCollection      = "MovieCollection"
	TypeMovieCollectionShare = "MovieCollectionShare"
	TypeUser                 = "User"
)

Variables

This section is empty.

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 AmazonList

type AmazonList struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AmazonListQuery when eager-loading is set.
	Edges AmazonListEdges `json:"edges"`
	// contains filtered or unexported fields
}

AmazonList is the model entity for the AmazonList schema.

func (*AmazonList) QueryAmazonOrders

func (al *AmazonList) QueryAmazonOrders() *AmazonOrderQuery

QueryAmazonOrders queries the "amazon_orders" edge of the AmazonList entity.

func (*AmazonList) QueryAmazonShares

func (al *AmazonList) QueryAmazonShares() *AmazonShareQuery

QueryAmazonShares queries the "amazon_shares" edge of the AmazonList entity.

func (*AmazonList) QueryOwner

func (al *AmazonList) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the AmazonList entity.

func (*AmazonList) String

func (al *AmazonList) String() string

String implements the fmt.Stringer.

func (*AmazonList) Unwrap

func (al *AmazonList) Unwrap() *AmazonList

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

func (al *AmazonList) Update() *AmazonListUpdateOne

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

func (*AmazonList) Value

func (al *AmazonList) Value(name string) (ent.Value, error)

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

type AmazonListClient

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

AmazonListClient is a client for the AmazonList schema.

func NewAmazonListClient

func NewAmazonListClient(c config) *AmazonListClient

NewAmazonListClient returns a client for the AmazonList from the given config.

func (*AmazonListClient) Create

func (c *AmazonListClient) Create() *AmazonListCreate

Create returns a builder for creating a AmazonList entity.

func (*AmazonListClient) CreateBulk

func (c *AmazonListClient) CreateBulk(builders ...*AmazonListCreate) *AmazonListCreateBulk

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

func (*AmazonListClient) Delete

func (c *AmazonListClient) Delete() *AmazonListDelete

Delete returns a delete builder for AmazonList.

func (*AmazonListClient) DeleteOne

func (c *AmazonListClient) DeleteOne(al *AmazonList) *AmazonListDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AmazonListClient) DeleteOneID

func (c *AmazonListClient) DeleteOneID(id int) *AmazonListDeleteOne

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

func (*AmazonListClient) Get

func (c *AmazonListClient) Get(ctx context.Context, id int) (*AmazonList, error)

Get returns a AmazonList entity by its id.

func (*AmazonListClient) GetX

func (c *AmazonListClient) GetX(ctx context.Context, id int) *AmazonList

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

func (*AmazonListClient) Hooks

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

Hooks returns the client hooks.

func (*AmazonListClient) Intercept

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

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

func (*AmazonListClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AmazonListClient) Query

func (c *AmazonListClient) Query() *AmazonListQuery

Query returns a query builder for AmazonList.

func (*AmazonListClient) QueryAmazonOrders

func (c *AmazonListClient) QueryAmazonOrders(al *AmazonList) *AmazonOrderQuery

QueryAmazonOrders queries the amazon_orders edge of a AmazonList.

func (*AmazonListClient) QueryAmazonShares

func (c *AmazonListClient) QueryAmazonShares(al *AmazonList) *AmazonShareQuery

QueryAmazonShares queries the amazon_shares edge of a AmazonList.

func (*AmazonListClient) QueryOwner

func (c *AmazonListClient) QueryOwner(al *AmazonList) *UserQuery

QueryOwner queries the owner edge of a AmazonList.

func (*AmazonListClient) Update

func (c *AmazonListClient) Update() *AmazonListUpdate

Update returns an update builder for AmazonList.

func (*AmazonListClient) UpdateOne

func (c *AmazonListClient) UpdateOne(al *AmazonList) *AmazonListUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AmazonListClient) UpdateOneID

func (c *AmazonListClient) UpdateOneID(id int) *AmazonListUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AmazonListClient) Use

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

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

type AmazonListCreate

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

AmazonListCreate is the builder for creating a AmazonList entity.

func (*AmazonListCreate) AddAmazonOrderIDs

func (alc *AmazonListCreate) AddAmazonOrderIDs(ids ...int) *AmazonListCreate

AddAmazonOrderIDs adds the "amazon_orders" edge to the AmazonOrder entity by IDs.

func (*AmazonListCreate) AddAmazonOrders

func (alc *AmazonListCreate) AddAmazonOrders(a ...*AmazonOrder) *AmazonListCreate

AddAmazonOrders adds the "amazon_orders" edges to the AmazonOrder entity.

func (*AmazonListCreate) AddAmazonShareIDs

func (alc *AmazonListCreate) AddAmazonShareIDs(ids ...int) *AmazonListCreate

AddAmazonShareIDs adds the "amazon_shares" edge to the AmazonShare entity by IDs.

func (*AmazonListCreate) AddAmazonShares

func (alc *AmazonListCreate) AddAmazonShares(a ...*AmazonShare) *AmazonListCreate

AddAmazonShares adds the "amazon_shares" edges to the AmazonShare entity.

func (*AmazonListCreate) AddOwner

func (alc *AmazonListCreate) AddOwner(u ...*User) *AmazonListCreate

AddOwner adds the "owner" edges to the User entity.

func (*AmazonListCreate) AddOwnerIDs

func (alc *AmazonListCreate) AddOwnerIDs(ids ...int) *AmazonListCreate

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*AmazonListCreate) Exec

func (alc *AmazonListCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AmazonListCreate) ExecX

func (alc *AmazonListCreate) ExecX(ctx context.Context)

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

func (*AmazonListCreate) Mutation

func (alc *AmazonListCreate) Mutation() *AmazonListMutation

Mutation returns the AmazonListMutation object of the builder.

func (*AmazonListCreate) Save

func (alc *AmazonListCreate) Save(ctx context.Context) (*AmazonList, error)

Save creates the AmazonList in the database.

func (*AmazonListCreate) SaveX

func (alc *AmazonListCreate) SaveX(ctx context.Context) *AmazonList

SaveX calls Save and panics if Save returns an error.

func (*AmazonListCreate) SetCreatedAt

func (alc *AmazonListCreate) SetCreatedAt(t time.Time) *AmazonListCreate

SetCreatedAt sets the "created_at" field.

func (*AmazonListCreate) SetNillableCreatedAt

func (alc *AmazonListCreate) SetNillableCreatedAt(t *time.Time) *AmazonListCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

type AmazonListCreateBulk

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

AmazonListCreateBulk is the builder for creating many AmazonList entities in bulk.

func (*AmazonListCreateBulk) Exec

func (alcb *AmazonListCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AmazonListCreateBulk) ExecX

func (alcb *AmazonListCreateBulk) ExecX(ctx context.Context)

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

func (*AmazonListCreateBulk) Save

func (alcb *AmazonListCreateBulk) Save(ctx context.Context) ([]*AmazonList, error)

Save creates the AmazonList entities in the database.

func (*AmazonListCreateBulk) SaveX

func (alcb *AmazonListCreateBulk) SaveX(ctx context.Context) []*AmazonList

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

type AmazonListDelete

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

AmazonListDelete is the builder for deleting a AmazonList entity.

func (*AmazonListDelete) Exec

func (ald *AmazonListDelete) Exec(ctx context.Context) (int, error)

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

func (*AmazonListDelete) ExecX

func (ald *AmazonListDelete) ExecX(ctx context.Context) int

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

func (*AmazonListDelete) Where

Where appends a list predicates to the AmazonListDelete builder.

type AmazonListDeleteOne

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

AmazonListDeleteOne is the builder for deleting a single AmazonList entity.

func (*AmazonListDeleteOne) Exec

func (aldo *AmazonListDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AmazonListDeleteOne) ExecX

func (aldo *AmazonListDeleteOne) ExecX(ctx context.Context)

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

func (*AmazonListDeleteOne) Where

Where appends a list predicates to the AmazonListDelete builder.

type AmazonListEdges

type AmazonListEdges struct {
	// AmazonOrders holds the value of the amazon_orders edge.
	AmazonOrders []*AmazonOrder `json:"amazon_orders,omitempty"`
	// Owner holds the value of the owner edge.
	Owner []*User `json:"owner,omitempty"`
	// AmazonShares holds the value of the amazon_shares edge.
	AmazonShares []*AmazonShare `json:"amazon_shares,omitempty"`
	// contains filtered or unexported fields
}

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

func (AmazonListEdges) AmazonOrdersOrErr

func (e AmazonListEdges) AmazonOrdersOrErr() ([]*AmazonOrder, error)

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

func (AmazonListEdges) AmazonSharesOrErr

func (e AmazonListEdges) AmazonSharesOrErr() ([]*AmazonShare, error)

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

func (AmazonListEdges) OwnerOrErr

func (e AmazonListEdges) OwnerOrErr() ([]*User, error)

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

type AmazonListGroupBy

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

AmazonListGroupBy is the group-by builder for AmazonList entities.

func (*AmazonListGroupBy) Aggregate

func (algb *AmazonListGroupBy) Aggregate(fns ...AggregateFunc) *AmazonListGroupBy

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

func (*AmazonListGroupBy) Bool

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

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

func (*AmazonListGroupBy) BoolX

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

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

func (*AmazonListGroupBy) Bools

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

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

func (*AmazonListGroupBy) BoolsX

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

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

func (*AmazonListGroupBy) Float64

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

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

func (*AmazonListGroupBy) Float64X

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

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

func (*AmazonListGroupBy) Float64s

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

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

func (*AmazonListGroupBy) Float64sX

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

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

func (*AmazonListGroupBy) Int

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

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

func (*AmazonListGroupBy) IntX

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

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

func (*AmazonListGroupBy) Ints

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

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

func (*AmazonListGroupBy) IntsX

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

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

func (*AmazonListGroupBy) Scan

func (algb *AmazonListGroupBy) Scan(ctx context.Context, v any) error

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

func (*AmazonListGroupBy) ScanX

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

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

func (*AmazonListGroupBy) String

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

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

func (*AmazonListGroupBy) StringX

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

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

func (*AmazonListGroupBy) Strings

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

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

func (*AmazonListGroupBy) StringsX

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

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

type AmazonListMutation

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

AmazonListMutation represents an operation that mutates the AmazonList nodes in the graph.

func (*AmazonListMutation) AddAmazonOrderIDs

func (m *AmazonListMutation) AddAmazonOrderIDs(ids ...int)

AddAmazonOrderIDs adds the "amazon_orders" edge to the AmazonOrder entity by ids.

func (*AmazonListMutation) AddAmazonShareIDs

func (m *AmazonListMutation) AddAmazonShareIDs(ids ...int)

AddAmazonShareIDs adds the "amazon_shares" edge to the AmazonShare entity by ids.

func (*AmazonListMutation) AddField

func (m *AmazonListMutation) 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 (*AmazonListMutation) AddOwnerIDs

func (m *AmazonListMutation) AddOwnerIDs(ids ...int)

AddOwnerIDs adds the "owner" edge to the User entity by ids.

func (*AmazonListMutation) AddedEdges

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

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

func (*AmazonListMutation) AddedField

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

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

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

func (*AmazonListMutation) AddedIDs

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

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

func (*AmazonListMutation) AmazonOrdersCleared

func (m *AmazonListMutation) AmazonOrdersCleared() bool

AmazonOrdersCleared reports if the "amazon_orders" edge to the AmazonOrder entity was cleared.

func (*AmazonListMutation) AmazonOrdersIDs

func (m *AmazonListMutation) AmazonOrdersIDs() (ids []int)

AmazonOrdersIDs returns the "amazon_orders" edge IDs in the mutation.

func (*AmazonListMutation) AmazonSharesCleared

func (m *AmazonListMutation) AmazonSharesCleared() bool

AmazonSharesCleared reports if the "amazon_shares" edge to the AmazonShare entity was cleared.

func (*AmazonListMutation) AmazonSharesIDs

func (m *AmazonListMutation) AmazonSharesIDs() (ids []int)

AmazonSharesIDs returns the "amazon_shares" edge IDs in the mutation.

func (*AmazonListMutation) ClearAmazonOrders

func (m *AmazonListMutation) ClearAmazonOrders()

ClearAmazonOrders clears the "amazon_orders" edge to the AmazonOrder entity.

func (*AmazonListMutation) ClearAmazonShares

func (m *AmazonListMutation) ClearAmazonShares()

ClearAmazonShares clears the "amazon_shares" edge to the AmazonShare entity.

func (*AmazonListMutation) ClearEdge

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

func (m *AmazonListMutation) 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 (*AmazonListMutation) ClearOwner

func (m *AmazonListMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*AmazonListMutation) ClearedEdges

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

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

func (*AmazonListMutation) ClearedFields

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

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

func (AmazonListMutation) Client

func (m AmazonListMutation) 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 (*AmazonListMutation) CreatedAt

func (m *AmazonListMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*AmazonListMutation) EdgeCleared

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

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

func (*AmazonListMutation) Field

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

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

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

func (*AmazonListMutation) Fields

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

func (m *AmazonListMutation) ID() (id int, exists bool)

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

func (*AmazonListMutation) IDs

func (m *AmazonListMutation) IDs(ctx context.Context) ([]int, error)

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

func (*AmazonListMutation) OldCreatedAt

func (m *AmazonListMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the AmazonList entity. If the AmazonList 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 (*AmazonListMutation) OldField

func (m *AmazonListMutation) 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 (*AmazonListMutation) Op

func (m *AmazonListMutation) Op() Op

Op returns the operation name.

func (*AmazonListMutation) OwnerCleared

func (m *AmazonListMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*AmazonListMutation) OwnerIDs

func (m *AmazonListMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation.

func (*AmazonListMutation) RemoveAmazonOrderIDs

func (m *AmazonListMutation) RemoveAmazonOrderIDs(ids ...int)

RemoveAmazonOrderIDs removes the "amazon_orders" edge to the AmazonOrder entity by IDs.

func (*AmazonListMutation) RemoveAmazonShareIDs

func (m *AmazonListMutation) RemoveAmazonShareIDs(ids ...int)

RemoveAmazonShareIDs removes the "amazon_shares" edge to the AmazonShare entity by IDs.

func (*AmazonListMutation) RemoveOwnerIDs

func (m *AmazonListMutation) RemoveOwnerIDs(ids ...int)

RemoveOwnerIDs removes the "owner" edge to the User entity by IDs.

func (*AmazonListMutation) RemovedAmazonOrdersIDs

func (m *AmazonListMutation) RemovedAmazonOrdersIDs() (ids []int)

RemovedAmazonOrders returns the removed IDs of the "amazon_orders" edge to the AmazonOrder entity.

func (*AmazonListMutation) RemovedAmazonSharesIDs

func (m *AmazonListMutation) RemovedAmazonSharesIDs() (ids []int)

RemovedAmazonShares returns the removed IDs of the "amazon_shares" edge to the AmazonShare entity.

func (*AmazonListMutation) RemovedEdges

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

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

func (*AmazonListMutation) RemovedIDs

func (m *AmazonListMutation) 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 (*AmazonListMutation) RemovedOwnerIDs

func (m *AmazonListMutation) RemovedOwnerIDs() (ids []int)

RemovedOwner returns the removed IDs of the "owner" edge to the User entity.

func (*AmazonListMutation) ResetAmazonOrders

func (m *AmazonListMutation) ResetAmazonOrders()

ResetAmazonOrders resets all changes to the "amazon_orders" edge.

func (*AmazonListMutation) ResetAmazonShares

func (m *AmazonListMutation) ResetAmazonShares()

ResetAmazonShares resets all changes to the "amazon_shares" edge.

func (*AmazonListMutation) ResetCreatedAt

func (m *AmazonListMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AmazonListMutation) ResetEdge

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

func (m *AmazonListMutation) 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 (*AmazonListMutation) ResetOwner

func (m *AmazonListMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*AmazonListMutation) SetCreatedAt

func (m *AmazonListMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*AmazonListMutation) SetField

func (m *AmazonListMutation) 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 (*AmazonListMutation) SetOp

func (m *AmazonListMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (AmazonListMutation) Tx

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

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

func (*AmazonListMutation) Type

func (m *AmazonListMutation) Type() string

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

func (*AmazonListMutation) Where

func (m *AmazonListMutation) Where(ps ...predicate.AmazonList)

Where appends a list predicates to the AmazonListMutation builder.

func (*AmazonListMutation) WhereP

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

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

type AmazonListQuery

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

AmazonListQuery is the builder for querying AmazonList entities.

func (*AmazonListQuery) Aggregate

func (alq *AmazonListQuery) Aggregate(fns ...AggregateFunc) *AmazonListSelect

Aggregate returns a AmazonListSelect configured with the given aggregations.

func (*AmazonListQuery) All

func (alq *AmazonListQuery) All(ctx context.Context) ([]*AmazonList, error)

All executes the query and returns a list of AmazonLists.

func (*AmazonListQuery) AllX

func (alq *AmazonListQuery) AllX(ctx context.Context) []*AmazonList

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

func (*AmazonListQuery) Clone

func (alq *AmazonListQuery) Clone() *AmazonListQuery

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

func (*AmazonListQuery) Count

func (alq *AmazonListQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AmazonListQuery) CountX

func (alq *AmazonListQuery) CountX(ctx context.Context) int

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

func (*AmazonListQuery) Exist

func (alq *AmazonListQuery) Exist(ctx context.Context) (bool, error)

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

func (*AmazonListQuery) ExistX

func (alq *AmazonListQuery) ExistX(ctx context.Context) bool

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

func (*AmazonListQuery) First

func (alq *AmazonListQuery) First(ctx context.Context) (*AmazonList, error)

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

func (*AmazonListQuery) FirstID

func (alq *AmazonListQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AmazonListQuery) FirstIDX

func (alq *AmazonListQuery) FirstIDX(ctx context.Context) int

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

func (*AmazonListQuery) FirstX

func (alq *AmazonListQuery) FirstX(ctx context.Context) *AmazonList

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

func (*AmazonListQuery) GroupBy

func (alq *AmazonListQuery) GroupBy(field string, fields ...string) *AmazonListGroupBy

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

client.AmazonList.Query().
	GroupBy(amazonlist.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AmazonListQuery) IDs

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

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

func (*AmazonListQuery) IDsX

func (alq *AmazonListQuery) IDsX(ctx context.Context) []int

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

func (*AmazonListQuery) Limit

func (alq *AmazonListQuery) Limit(limit int) *AmazonListQuery

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

func (*AmazonListQuery) Offset

func (alq *AmazonListQuery) Offset(offset int) *AmazonListQuery

Offset to start from.

func (*AmazonListQuery) Only

func (alq *AmazonListQuery) Only(ctx context.Context) (*AmazonList, error)

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

func (*AmazonListQuery) OnlyID

func (alq *AmazonListQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AmazonListQuery) OnlyIDX

func (alq *AmazonListQuery) OnlyIDX(ctx context.Context) int

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

func (*AmazonListQuery) OnlyX

func (alq *AmazonListQuery) OnlyX(ctx context.Context) *AmazonList

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

func (*AmazonListQuery) Order

Order specifies how the records should be ordered.

func (*AmazonListQuery) QueryAmazonOrders

func (alq *AmazonListQuery) QueryAmazonOrders() *AmazonOrderQuery

QueryAmazonOrders chains the current query on the "amazon_orders" edge.

func (*AmazonListQuery) QueryAmazonShares

func (alq *AmazonListQuery) QueryAmazonShares() *AmazonShareQuery

QueryAmazonShares chains the current query on the "amazon_shares" edge.

func (*AmazonListQuery) QueryOwner

func (alq *AmazonListQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*AmazonListQuery) Select

func (alq *AmazonListQuery) Select(fields ...string) *AmazonListSelect

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

client.AmazonList.Query().
	Select(amazonlist.FieldCreatedAt).
	Scan(ctx, &v)

func (*AmazonListQuery) Unique

func (alq *AmazonListQuery) Unique(unique bool) *AmazonListQuery

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

Where adds a new predicate for the AmazonListQuery builder.

func (*AmazonListQuery) WithAmazonOrders

func (alq *AmazonListQuery) WithAmazonOrders(opts ...func(*AmazonOrderQuery)) *AmazonListQuery

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

func (*AmazonListQuery) WithAmazonShares

func (alq *AmazonListQuery) WithAmazonShares(opts ...func(*AmazonShareQuery)) *AmazonListQuery

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

func (*AmazonListQuery) WithOwner

func (alq *AmazonListQuery) WithOwner(opts ...func(*UserQuery)) *AmazonListQuery

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

type AmazonListSelect

type AmazonListSelect struct {
	*AmazonListQuery
	// contains filtered or unexported fields
}

AmazonListSelect is the builder for selecting fields of AmazonList entities.

func (*AmazonListSelect) Aggregate

func (als *AmazonListSelect) Aggregate(fns ...AggregateFunc) *AmazonListSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AmazonListSelect) Bool

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

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

func (*AmazonListSelect) BoolX

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

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

func (*AmazonListSelect) Bools

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

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

func (*AmazonListSelect) BoolsX

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

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

func (*AmazonListSelect) Float64

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

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

func (*AmazonListSelect) Float64X

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

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

func (*AmazonListSelect) Float64s

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

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

func (*AmazonListSelect) Float64sX

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

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

func (*AmazonListSelect) Int

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

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

func (*AmazonListSelect) IntX

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

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

func (*AmazonListSelect) Ints

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

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

func (*AmazonListSelect) IntsX

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

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

func (*AmazonListSelect) Scan

func (als *AmazonListSelect) Scan(ctx context.Context, v any) error

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

func (*AmazonListSelect) ScanX

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

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

func (*AmazonListSelect) String

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

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

func (*AmazonListSelect) StringX

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

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

func (*AmazonListSelect) Strings

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

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

func (*AmazonListSelect) StringsX

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

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

type AmazonListUpdate

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

AmazonListUpdate is the builder for updating AmazonList entities.

func (*AmazonListUpdate) AddAmazonOrderIDs

func (alu *AmazonListUpdate) AddAmazonOrderIDs(ids ...int) *AmazonListUpdate

AddAmazonOrderIDs adds the "amazon_orders" edge to the AmazonOrder entity by IDs.

func (*AmazonListUpdate) AddAmazonOrders

func (alu *AmazonListUpdate) AddAmazonOrders(a ...*AmazonOrder) *AmazonListUpdate

AddAmazonOrders adds the "amazon_orders" edges to the AmazonOrder entity.

func (*AmazonListUpdate) AddAmazonShareIDs

func (alu *AmazonListUpdate) AddAmazonShareIDs(ids ...int) *AmazonListUpdate

AddAmazonShareIDs adds the "amazon_shares" edge to the AmazonShare entity by IDs.

func (*AmazonListUpdate) AddAmazonShares

func (alu *AmazonListUpdate) AddAmazonShares(a ...*AmazonShare) *AmazonListUpdate

AddAmazonShares adds the "amazon_shares" edges to the AmazonShare entity.

func (*AmazonListUpdate) AddOwner

func (alu *AmazonListUpdate) AddOwner(u ...*User) *AmazonListUpdate

AddOwner adds the "owner" edges to the User entity.

func (*AmazonListUpdate) AddOwnerIDs

func (alu *AmazonListUpdate) AddOwnerIDs(ids ...int) *AmazonListUpdate

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*AmazonListUpdate) ClearAmazonOrders

func (alu *AmazonListUpdate) ClearAmazonOrders() *AmazonListUpdate

ClearAmazonOrders clears all "amazon_orders" edges to the AmazonOrder entity.

func (*AmazonListUpdate) ClearAmazonShares

func (alu *AmazonListUpdate) ClearAmazonShares() *AmazonListUpdate

ClearAmazonShares clears all "amazon_shares" edges to the AmazonShare entity.

func (*AmazonListUpdate) ClearOwner

func (alu *AmazonListUpdate) ClearOwner() *AmazonListUpdate

ClearOwner clears all "owner" edges to the User entity.

func (*AmazonListUpdate) Exec

func (alu *AmazonListUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AmazonListUpdate) ExecX

func (alu *AmazonListUpdate) ExecX(ctx context.Context)

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

func (*AmazonListUpdate) Mutation

func (alu *AmazonListUpdate) Mutation() *AmazonListMutation

Mutation returns the AmazonListMutation object of the builder.

func (*AmazonListUpdate) RemoveAmazonOrderIDs

func (alu *AmazonListUpdate) RemoveAmazonOrderIDs(ids ...int) *AmazonListUpdate

RemoveAmazonOrderIDs removes the "amazon_orders" edge to AmazonOrder entities by IDs.

func (*AmazonListUpdate) RemoveAmazonOrders

func (alu *AmazonListUpdate) RemoveAmazonOrders(a ...*AmazonOrder) *AmazonListUpdate

RemoveAmazonOrders removes "amazon_orders" edges to AmazonOrder entities.

func (*AmazonListUpdate) RemoveAmazonShareIDs

func (alu *AmazonListUpdate) RemoveAmazonShareIDs(ids ...int) *AmazonListUpdate

RemoveAmazonShareIDs removes the "amazon_shares" edge to AmazonShare entities by IDs.

func (*AmazonListUpdate) RemoveAmazonShares

func (alu *AmazonListUpdate) RemoveAmazonShares(a ...*AmazonShare) *AmazonListUpdate

RemoveAmazonShares removes "amazon_shares" edges to AmazonShare entities.

func (*AmazonListUpdate) RemoveOwner

func (alu *AmazonListUpdate) RemoveOwner(u ...*User) *AmazonListUpdate

RemoveOwner removes "owner" edges to User entities.

func (*AmazonListUpdate) RemoveOwnerIDs

func (alu *AmazonListUpdate) RemoveOwnerIDs(ids ...int) *AmazonListUpdate

RemoveOwnerIDs removes the "owner" edge to User entities by IDs.

func (*AmazonListUpdate) Save

func (alu *AmazonListUpdate) Save(ctx context.Context) (int, error)

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

func (*AmazonListUpdate) SaveX

func (alu *AmazonListUpdate) SaveX(ctx context.Context) int

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

func (*AmazonListUpdate) SetCreatedAt

func (alu *AmazonListUpdate) SetCreatedAt(t time.Time) *AmazonListUpdate

SetCreatedAt sets the "created_at" field.

func (*AmazonListUpdate) SetNillableCreatedAt

func (alu *AmazonListUpdate) SetNillableCreatedAt(t *time.Time) *AmazonListUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*AmazonListUpdate) Where

Where appends a list predicates to the AmazonListUpdate builder.

type AmazonListUpdateOne

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

AmazonListUpdateOne is the builder for updating a single AmazonList entity.

func (*AmazonListUpdateOne) AddAmazonOrderIDs

func (aluo *AmazonListUpdateOne) AddAmazonOrderIDs(ids ...int) *AmazonListUpdateOne

AddAmazonOrderIDs adds the "amazon_orders" edge to the AmazonOrder entity by IDs.

func (*AmazonListUpdateOne) AddAmazonOrders

func (aluo *AmazonListUpdateOne) AddAmazonOrders(a ...*AmazonOrder) *AmazonListUpdateOne

AddAmazonOrders adds the "amazon_orders" edges to the AmazonOrder entity.

func (*AmazonListUpdateOne) AddAmazonShareIDs

func (aluo *AmazonListUpdateOne) AddAmazonShareIDs(ids ...int) *AmazonListUpdateOne

AddAmazonShareIDs adds the "amazon_shares" edge to the AmazonShare entity by IDs.

func (*AmazonListUpdateOne) AddAmazonShares

func (aluo *AmazonListUpdateOne) AddAmazonShares(a ...*AmazonShare) *AmazonListUpdateOne

AddAmazonShares adds the "amazon_shares" edges to the AmazonShare entity.

func (*AmazonListUpdateOne) AddOwner

func (aluo *AmazonListUpdateOne) AddOwner(u ...*User) *AmazonListUpdateOne

AddOwner adds the "owner" edges to the User entity.

func (*AmazonListUpdateOne) AddOwnerIDs

func (aluo *AmazonListUpdateOne) AddOwnerIDs(ids ...int) *AmazonListUpdateOne

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*AmazonListUpdateOne) ClearAmazonOrders

func (aluo *AmazonListUpdateOne) ClearAmazonOrders() *AmazonListUpdateOne

ClearAmazonOrders clears all "amazon_orders" edges to the AmazonOrder entity.

func (*AmazonListUpdateOne) ClearAmazonShares

func (aluo *AmazonListUpdateOne) ClearAmazonShares() *AmazonListUpdateOne

ClearAmazonShares clears all "amazon_shares" edges to the AmazonShare entity.

func (*AmazonListUpdateOne) ClearOwner

func (aluo *AmazonListUpdateOne) ClearOwner() *AmazonListUpdateOne

ClearOwner clears all "owner" edges to the User entity.

func (*AmazonListUpdateOne) Exec

func (aluo *AmazonListUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AmazonListUpdateOne) ExecX

func (aluo *AmazonListUpdateOne) ExecX(ctx context.Context)

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

func (*AmazonListUpdateOne) Mutation

func (aluo *AmazonListUpdateOne) Mutation() *AmazonListMutation

Mutation returns the AmazonListMutation object of the builder.

func (*AmazonListUpdateOne) RemoveAmazonOrderIDs

func (aluo *AmazonListUpdateOne) RemoveAmazonOrderIDs(ids ...int) *AmazonListUpdateOne

RemoveAmazonOrderIDs removes the "amazon_orders" edge to AmazonOrder entities by IDs.

func (*AmazonListUpdateOne) RemoveAmazonOrders

func (aluo *AmazonListUpdateOne) RemoveAmazonOrders(a ...*AmazonOrder) *AmazonListUpdateOne

RemoveAmazonOrders removes "amazon_orders" edges to AmazonOrder entities.

func (*AmazonListUpdateOne) RemoveAmazonShareIDs

func (aluo *AmazonListUpdateOne) RemoveAmazonShareIDs(ids ...int) *AmazonListUpdateOne

RemoveAmazonShareIDs removes the "amazon_shares" edge to AmazonShare entities by IDs.

func (*AmazonListUpdateOne) RemoveAmazonShares

func (aluo *AmazonListUpdateOne) RemoveAmazonShares(a ...*AmazonShare) *AmazonListUpdateOne

RemoveAmazonShares removes "amazon_shares" edges to AmazonShare entities.

func (*AmazonListUpdateOne) RemoveOwner

func (aluo *AmazonListUpdateOne) RemoveOwner(u ...*User) *AmazonListUpdateOne

RemoveOwner removes "owner" edges to User entities.

func (*AmazonListUpdateOne) RemoveOwnerIDs

func (aluo *AmazonListUpdateOne) RemoveOwnerIDs(ids ...int) *AmazonListUpdateOne

RemoveOwnerIDs removes the "owner" edge to User entities by IDs.

func (*AmazonListUpdateOne) Save

func (aluo *AmazonListUpdateOne) Save(ctx context.Context) (*AmazonList, error)

Save executes the query and returns the updated AmazonList entity.

func (*AmazonListUpdateOne) SaveX

func (aluo *AmazonListUpdateOne) SaveX(ctx context.Context) *AmazonList

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

func (*AmazonListUpdateOne) Select

func (aluo *AmazonListUpdateOne) Select(field string, fields ...string) *AmazonListUpdateOne

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

func (*AmazonListUpdateOne) SetCreatedAt

func (aluo *AmazonListUpdateOne) SetCreatedAt(t time.Time) *AmazonListUpdateOne

SetCreatedAt sets the "created_at" field.

func (*AmazonListUpdateOne) SetNillableCreatedAt

func (aluo *AmazonListUpdateOne) SetNillableCreatedAt(t *time.Time) *AmazonListUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*AmazonListUpdateOne) Where

Where appends a list predicates to the AmazonListUpdate builder.

type AmazonLists

type AmazonLists []*AmazonList

AmazonLists is a parsable slice of AmazonList.

type AmazonOrder

type AmazonOrder struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Category holds the value of the "category" field.
	Category string `json:"category,omitempty"`
	// Brand holds the value of the "brand" field.
	Brand string `json:"brand,omitempty"`
	// Seller holds the value of the "seller" field.
	Seller string `json:"seller,omitempty"`
	// Address1 holds the value of the "address1" field.
	Address1 string `json:"address1,omitempty"`
	// Address2 holds the value of the "address2" field.
	Address2 string `json:"address2,omitempty"`
	// City holds the value of the "city" field.
	City string `json:"city,omitempty"`
	// State holds the value of the "state" field.
	State string `json:"state,omitempty"`
	// Zip holds the value of the "zip" field.
	Zip string `json:"zip,omitempty"`
	// Price holds the value of the "price" field.
	Price float32 `json:"price,omitempty"`
	// Tax holds the value of the "tax" field.
	Tax float32 `json:"tax,omitempty"`
	// Refund holds the value of the "refund" field.
	Refund bool `json:"refund,omitempty"`
	// OrderedAt holds the value of the "ordered_at" field.
	OrderedAt time.Time `json:"ordered_at,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AmazonOrderQuery when eager-loading is set.
	Edges AmazonOrderEdges `json:"edges"`
	// contains filtered or unexported fields
}

AmazonOrder is the model entity for the AmazonOrder schema.

func (*AmazonOrder) QueryAmazonList

func (ao *AmazonOrder) QueryAmazonList() *AmazonListQuery

QueryAmazonList queries the "amazon_list" edge of the AmazonOrder entity.

func (*AmazonOrder) String

func (ao *AmazonOrder) String() string

String implements the fmt.Stringer.

func (*AmazonOrder) Unwrap

func (ao *AmazonOrder) Unwrap() *AmazonOrder

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

func (ao *AmazonOrder) Update() *AmazonOrderUpdateOne

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

func (*AmazonOrder) Value

func (ao *AmazonOrder) Value(name string) (ent.Value, error)

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

type AmazonOrderClient

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

AmazonOrderClient is a client for the AmazonOrder schema.

func NewAmazonOrderClient

func NewAmazonOrderClient(c config) *AmazonOrderClient

NewAmazonOrderClient returns a client for the AmazonOrder from the given config.

func (*AmazonOrderClient) Create

func (c *AmazonOrderClient) Create() *AmazonOrderCreate

Create returns a builder for creating a AmazonOrder entity.

func (*AmazonOrderClient) CreateBulk

func (c *AmazonOrderClient) CreateBulk(builders ...*AmazonOrderCreate) *AmazonOrderCreateBulk

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

func (*AmazonOrderClient) Delete

func (c *AmazonOrderClient) Delete() *AmazonOrderDelete

Delete returns a delete builder for AmazonOrder.

func (*AmazonOrderClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AmazonOrderClient) DeleteOneID

func (c *AmazonOrderClient) DeleteOneID(id int) *AmazonOrderDeleteOne

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

func (*AmazonOrderClient) Get

func (c *AmazonOrderClient) Get(ctx context.Context, id int) (*AmazonOrder, error)

Get returns a AmazonOrder entity by its id.

func (*AmazonOrderClient) GetX

func (c *AmazonOrderClient) GetX(ctx context.Context, id int) *AmazonOrder

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

func (*AmazonOrderClient) Hooks

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

Hooks returns the client hooks.

func (*AmazonOrderClient) Intercept

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

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

func (*AmazonOrderClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AmazonOrderClient) Query

func (c *AmazonOrderClient) Query() *AmazonOrderQuery

Query returns a query builder for AmazonOrder.

func (*AmazonOrderClient) QueryAmazonList

func (c *AmazonOrderClient) QueryAmazonList(ao *AmazonOrder) *AmazonListQuery

QueryAmazonList queries the amazon_list edge of a AmazonOrder.

func (*AmazonOrderClient) Update

func (c *AmazonOrderClient) Update() *AmazonOrderUpdate

Update returns an update builder for AmazonOrder.

func (*AmazonOrderClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AmazonOrderClient) UpdateOneID

func (c *AmazonOrderClient) UpdateOneID(id int) *AmazonOrderUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AmazonOrderClient) Use

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

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

type AmazonOrderCreate

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

AmazonOrderCreate is the builder for creating a AmazonOrder entity.

func (*AmazonOrderCreate) Exec

func (aoc *AmazonOrderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AmazonOrderCreate) ExecX

func (aoc *AmazonOrderCreate) ExecX(ctx context.Context)

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

func (*AmazonOrderCreate) Mutation

func (aoc *AmazonOrderCreate) Mutation() *AmazonOrderMutation

Mutation returns the AmazonOrderMutation object of the builder.

func (*AmazonOrderCreate) Save

func (aoc *AmazonOrderCreate) Save(ctx context.Context) (*AmazonOrder, error)

Save creates the AmazonOrder in the database.

func (*AmazonOrderCreate) SaveX

func (aoc *AmazonOrderCreate) SaveX(ctx context.Context) *AmazonOrder

SaveX calls Save and panics if Save returns an error.

func (*AmazonOrderCreate) SetAddress1

func (aoc *AmazonOrderCreate) SetAddress1(s string) *AmazonOrderCreate

SetAddress1 sets the "address1" field.

func (*AmazonOrderCreate) SetAddress2

func (aoc *AmazonOrderCreate) SetAddress2(s string) *AmazonOrderCreate

SetAddress2 sets the "address2" field.

func (*AmazonOrderCreate) SetAmazonList

func (aoc *AmazonOrderCreate) SetAmazonList(a *AmazonList) *AmazonOrderCreate

SetAmazonList sets the "amazon_list" edge to the AmazonList entity.

func (*AmazonOrderCreate) SetAmazonListID

func (aoc *AmazonOrderCreate) SetAmazonListID(id int) *AmazonOrderCreate

SetAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID.

func (*AmazonOrderCreate) SetBrand

func (aoc *AmazonOrderCreate) SetBrand(s string) *AmazonOrderCreate

SetBrand sets the "brand" field.

func (*AmazonOrderCreate) SetCategory

func (aoc *AmazonOrderCreate) SetCategory(s string) *AmazonOrderCreate

SetCategory sets the "category" field.

func (*AmazonOrderCreate) SetCity

func (aoc *AmazonOrderCreate) SetCity(s string) *AmazonOrderCreate

SetCity sets the "city" field.

func (*AmazonOrderCreate) SetCreatedAt

func (aoc *AmazonOrderCreate) SetCreatedAt(t time.Time) *AmazonOrderCreate

SetCreatedAt sets the "created_at" field.

func (*AmazonOrderCreate) SetName

func (aoc *AmazonOrderCreate) SetName(s string) *AmazonOrderCreate

SetName sets the "name" field.

func (*AmazonOrderCreate) SetNillableAmazonListID

func (aoc *AmazonOrderCreate) SetNillableAmazonListID(id *int) *AmazonOrderCreate

SetNillableAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID if the given value is not nil.

func (*AmazonOrderCreate) SetNillableCreatedAt

func (aoc *AmazonOrderCreate) SetNillableCreatedAt(t *time.Time) *AmazonOrderCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*AmazonOrderCreate) SetOrderedAt

func (aoc *AmazonOrderCreate) SetOrderedAt(t time.Time) *AmazonOrderCreate

SetOrderedAt sets the "ordered_at" field.

func (*AmazonOrderCreate) SetPrice

func (aoc *AmazonOrderCreate) SetPrice(f float32) *AmazonOrderCreate

SetPrice sets the "price" field.

func (*AmazonOrderCreate) SetRefund

func (aoc *AmazonOrderCreate) SetRefund(b bool) *AmazonOrderCreate

SetRefund sets the "refund" field.

func (*AmazonOrderCreate) SetSeller

func (aoc *AmazonOrderCreate) SetSeller(s string) *AmazonOrderCreate

SetSeller sets the "seller" field.

func (*AmazonOrderCreate) SetState

func (aoc *AmazonOrderCreate) SetState(s string) *AmazonOrderCreate

SetState sets the "state" field.

func (*AmazonOrderCreate) SetTax

SetTax sets the "tax" field.

func (*AmazonOrderCreate) SetZip

func (aoc *AmazonOrderCreate) SetZip(s string) *AmazonOrderCreate

SetZip sets the "zip" field.

type AmazonOrderCreateBulk

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

AmazonOrderCreateBulk is the builder for creating many AmazonOrder entities in bulk.

func (*AmazonOrderCreateBulk) Exec

func (aocb *AmazonOrderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AmazonOrderCreateBulk) ExecX

func (aocb *AmazonOrderCreateBulk) ExecX(ctx context.Context)

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

func (*AmazonOrderCreateBulk) Save

func (aocb *AmazonOrderCreateBulk) Save(ctx context.Context) ([]*AmazonOrder, error)

Save creates the AmazonOrder entities in the database.

func (*AmazonOrderCreateBulk) SaveX

func (aocb *AmazonOrderCreateBulk) SaveX(ctx context.Context) []*AmazonOrder

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

type AmazonOrderDelete

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

AmazonOrderDelete is the builder for deleting a AmazonOrder entity.

func (*AmazonOrderDelete) Exec

func (aod *AmazonOrderDelete) Exec(ctx context.Context) (int, error)

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

func (*AmazonOrderDelete) ExecX

func (aod *AmazonOrderDelete) ExecX(ctx context.Context) int

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

func (*AmazonOrderDelete) Where

Where appends a list predicates to the AmazonOrderDelete builder.

type AmazonOrderDeleteOne

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

AmazonOrderDeleteOne is the builder for deleting a single AmazonOrder entity.

func (*AmazonOrderDeleteOne) Exec

func (aodo *AmazonOrderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AmazonOrderDeleteOne) ExecX

func (aodo *AmazonOrderDeleteOne) ExecX(ctx context.Context)

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

func (*AmazonOrderDeleteOne) Where

Where appends a list predicates to the AmazonOrderDelete builder.

type AmazonOrderEdges

type AmazonOrderEdges struct {
	// AmazonList holds the value of the amazon_list edge.
	AmazonList *AmazonList `json:"amazon_list,omitempty"`
	// contains filtered or unexported fields
}

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

func (AmazonOrderEdges) AmazonListOrErr

func (e AmazonOrderEdges) AmazonListOrErr() (*AmazonList, error)

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

type AmazonOrderGroupBy

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

AmazonOrderGroupBy is the group-by builder for AmazonOrder entities.

func (*AmazonOrderGroupBy) Aggregate

func (aogb *AmazonOrderGroupBy) Aggregate(fns ...AggregateFunc) *AmazonOrderGroupBy

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

func (*AmazonOrderGroupBy) Bool

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

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

func (*AmazonOrderGroupBy) BoolX

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

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

func (*AmazonOrderGroupBy) Bools

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

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

func (*AmazonOrderGroupBy) BoolsX

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

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

func (*AmazonOrderGroupBy) Float64

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

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

func (*AmazonOrderGroupBy) Float64X

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

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

func (*AmazonOrderGroupBy) Float64s

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

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

func (*AmazonOrderGroupBy) Float64sX

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

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

func (*AmazonOrderGroupBy) Int

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

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

func (*AmazonOrderGroupBy) IntX

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

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

func (*AmazonOrderGroupBy) Ints

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

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

func (*AmazonOrderGroupBy) IntsX

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

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

func (*AmazonOrderGroupBy) Scan

func (aogb *AmazonOrderGroupBy) Scan(ctx context.Context, v any) error

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

func (*AmazonOrderGroupBy) ScanX

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

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

func (*AmazonOrderGroupBy) String

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

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

func (*AmazonOrderGroupBy) StringX

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

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

func (*AmazonOrderGroupBy) Strings

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

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

func (*AmazonOrderGroupBy) StringsX

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

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

type AmazonOrderMutation

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

AmazonOrderMutation represents an operation that mutates the AmazonOrder nodes in the graph.

func (*AmazonOrderMutation) AddField

func (m *AmazonOrderMutation) 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 (*AmazonOrderMutation) AddPrice

func (m *AmazonOrderMutation) AddPrice(f float32)

AddPrice adds f to the "price" field.

func (*AmazonOrderMutation) AddTax

func (m *AmazonOrderMutation) AddTax(f float32)

AddTax adds f to the "tax" field.

func (*AmazonOrderMutation) AddedEdges

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

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

func (*AmazonOrderMutation) AddedField

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

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

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

func (*AmazonOrderMutation) AddedIDs

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

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

func (*AmazonOrderMutation) AddedPrice

func (m *AmazonOrderMutation) AddedPrice() (r float32, exists bool)

AddedPrice returns the value that was added to the "price" field in this mutation.

func (*AmazonOrderMutation) AddedTax

func (m *AmazonOrderMutation) AddedTax() (r float32, exists bool)

AddedTax returns the value that was added to the "tax" field in this mutation.

func (*AmazonOrderMutation) Address1

func (m *AmazonOrderMutation) Address1() (r string, exists bool)

Address1 returns the value of the "address1" field in the mutation.

func (*AmazonOrderMutation) Address2

func (m *AmazonOrderMutation) Address2() (r string, exists bool)

Address2 returns the value of the "address2" field in the mutation.

func (*AmazonOrderMutation) AmazonListCleared

func (m *AmazonOrderMutation) AmazonListCleared() bool

AmazonListCleared reports if the "amazon_list" edge to the AmazonList entity was cleared.

func (*AmazonOrderMutation) AmazonListID

func (m *AmazonOrderMutation) AmazonListID() (id int, exists bool)

AmazonListID returns the "amazon_list" edge ID in the mutation.

func (*AmazonOrderMutation) AmazonListIDs

func (m *AmazonOrderMutation) AmazonListIDs() (ids []int)

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

func (*AmazonOrderMutation) Brand

func (m *AmazonOrderMutation) Brand() (r string, exists bool)

Brand returns the value of the "brand" field in the mutation.

func (*AmazonOrderMutation) Category

func (m *AmazonOrderMutation) Category() (r string, exists bool)

Category returns the value of the "category" field in the mutation.

func (*AmazonOrderMutation) City

func (m *AmazonOrderMutation) City() (r string, exists bool)

City returns the value of the "city" field in the mutation.

func (*AmazonOrderMutation) ClearAmazonList

func (m *AmazonOrderMutation) ClearAmazonList()

ClearAmazonList clears the "amazon_list" edge to the AmazonList entity.

func (*AmazonOrderMutation) ClearEdge

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

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

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

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

func (*AmazonOrderMutation) ClearedFields

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

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

func (AmazonOrderMutation) Client

func (m AmazonOrderMutation) 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 (*AmazonOrderMutation) CreatedAt

func (m *AmazonOrderMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*AmazonOrderMutation) EdgeCleared

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

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

func (*AmazonOrderMutation) Field

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

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

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

func (*AmazonOrderMutation) Fields

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

func (m *AmazonOrderMutation) ID() (id int, exists bool)

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

func (*AmazonOrderMutation) IDs

func (m *AmazonOrderMutation) IDs(ctx context.Context) ([]int, error)

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

func (*AmazonOrderMutation) Name

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

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

func (*AmazonOrderMutation) OldAddress1

func (m *AmazonOrderMutation) OldAddress1(ctx context.Context) (v string, err error)

OldAddress1 returns the old "address1" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldAddress2

func (m *AmazonOrderMutation) OldAddress2(ctx context.Context) (v string, err error)

OldAddress2 returns the old "address2" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldBrand

func (m *AmazonOrderMutation) OldBrand(ctx context.Context) (v string, err error)

OldBrand returns the old "brand" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldCategory

func (m *AmazonOrderMutation) OldCategory(ctx context.Context) (v string, err error)

OldCategory returns the old "category" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldCity

func (m *AmazonOrderMutation) OldCity(ctx context.Context) (v string, err error)

OldCity returns the old "city" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldCreatedAt

func (m *AmazonOrderMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldField

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

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

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

func (m *AmazonOrderMutation) OldOrderedAt(ctx context.Context) (v time.Time, err error)

OldOrderedAt returns the old "ordered_at" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldPrice

func (m *AmazonOrderMutation) OldPrice(ctx context.Context) (v float32, err error)

OldPrice returns the old "price" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldRefund

func (m *AmazonOrderMutation) OldRefund(ctx context.Context) (v bool, err error)

OldRefund returns the old "refund" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldSeller

func (m *AmazonOrderMutation) OldSeller(ctx context.Context) (v string, err error)

OldSeller returns the old "seller" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldState

func (m *AmazonOrderMutation) OldState(ctx context.Context) (v string, err error)

OldState returns the old "state" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldTax

func (m *AmazonOrderMutation) OldTax(ctx context.Context) (v float32, err error)

OldTax returns the old "tax" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) OldZip

func (m *AmazonOrderMutation) OldZip(ctx context.Context) (v string, err error)

OldZip returns the old "zip" field's value of the AmazonOrder entity. If the AmazonOrder 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 (*AmazonOrderMutation) Op

func (m *AmazonOrderMutation) Op() Op

Op returns the operation name.

func (*AmazonOrderMutation) OrderedAt

func (m *AmazonOrderMutation) OrderedAt() (r time.Time, exists bool)

OrderedAt returns the value of the "ordered_at" field in the mutation.

func (*AmazonOrderMutation) Price

func (m *AmazonOrderMutation) Price() (r float32, exists bool)

Price returns the value of the "price" field in the mutation.

func (*AmazonOrderMutation) Refund

func (m *AmazonOrderMutation) Refund() (r bool, exists bool)

Refund returns the value of the "refund" field in the mutation.

func (*AmazonOrderMutation) RemovedEdges

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

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

func (*AmazonOrderMutation) RemovedIDs

func (m *AmazonOrderMutation) 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 (*AmazonOrderMutation) ResetAddress1

func (m *AmazonOrderMutation) ResetAddress1()

ResetAddress1 resets all changes to the "address1" field.

func (*AmazonOrderMutation) ResetAddress2

func (m *AmazonOrderMutation) ResetAddress2()

ResetAddress2 resets all changes to the "address2" field.

func (*AmazonOrderMutation) ResetAmazonList

func (m *AmazonOrderMutation) ResetAmazonList()

ResetAmazonList resets all changes to the "amazon_list" edge.

func (*AmazonOrderMutation) ResetBrand

func (m *AmazonOrderMutation) ResetBrand()

ResetBrand resets all changes to the "brand" field.

func (*AmazonOrderMutation) ResetCategory

func (m *AmazonOrderMutation) ResetCategory()

ResetCategory resets all changes to the "category" field.

func (*AmazonOrderMutation) ResetCity

func (m *AmazonOrderMutation) ResetCity()

ResetCity resets all changes to the "city" field.

func (*AmazonOrderMutation) ResetCreatedAt

func (m *AmazonOrderMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AmazonOrderMutation) ResetEdge

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

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

func (m *AmazonOrderMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*AmazonOrderMutation) ResetOrderedAt

func (m *AmazonOrderMutation) ResetOrderedAt()

ResetOrderedAt resets all changes to the "ordered_at" field.

func (*AmazonOrderMutation) ResetPrice

func (m *AmazonOrderMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*AmazonOrderMutation) ResetRefund

func (m *AmazonOrderMutation) ResetRefund()

ResetRefund resets all changes to the "refund" field.

func (*AmazonOrderMutation) ResetSeller

func (m *AmazonOrderMutation) ResetSeller()

ResetSeller resets all changes to the "seller" field.

func (*AmazonOrderMutation) ResetState

func (m *AmazonOrderMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*AmazonOrderMutation) ResetTax

func (m *AmazonOrderMutation) ResetTax()

ResetTax resets all changes to the "tax" field.

func (*AmazonOrderMutation) ResetZip

func (m *AmazonOrderMutation) ResetZip()

ResetZip resets all changes to the "zip" field.

func (*AmazonOrderMutation) Seller

func (m *AmazonOrderMutation) Seller() (r string, exists bool)

Seller returns the value of the "seller" field in the mutation.

func (*AmazonOrderMutation) SetAddress1

func (m *AmazonOrderMutation) SetAddress1(s string)

SetAddress1 sets the "address1" field.

func (*AmazonOrderMutation) SetAddress2

func (m *AmazonOrderMutation) SetAddress2(s string)

SetAddress2 sets the "address2" field.

func (*AmazonOrderMutation) SetAmazonListID

func (m *AmazonOrderMutation) SetAmazonListID(id int)

SetAmazonListID sets the "amazon_list" edge to the AmazonList entity by id.

func (*AmazonOrderMutation) SetBrand

func (m *AmazonOrderMutation) SetBrand(s string)

SetBrand sets the "brand" field.

func (*AmazonOrderMutation) SetCategory

func (m *AmazonOrderMutation) SetCategory(s string)

SetCategory sets the "category" field.

func (*AmazonOrderMutation) SetCity

func (m *AmazonOrderMutation) SetCity(s string)

SetCity sets the "city" field.

func (*AmazonOrderMutation) SetCreatedAt

func (m *AmazonOrderMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*AmazonOrderMutation) SetField

func (m *AmazonOrderMutation) 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 (*AmazonOrderMutation) SetName

func (m *AmazonOrderMutation) SetName(s string)

SetName sets the "name" field.

func (*AmazonOrderMutation) SetOp

func (m *AmazonOrderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AmazonOrderMutation) SetOrderedAt

func (m *AmazonOrderMutation) SetOrderedAt(t time.Time)

SetOrderedAt sets the "ordered_at" field.

func (*AmazonOrderMutation) SetPrice

func (m *AmazonOrderMutation) SetPrice(f float32)

SetPrice sets the "price" field.

func (*AmazonOrderMutation) SetRefund

func (m *AmazonOrderMutation) SetRefund(b bool)

SetRefund sets the "refund" field.

func (*AmazonOrderMutation) SetSeller

func (m *AmazonOrderMutation) SetSeller(s string)

SetSeller sets the "seller" field.

func (*AmazonOrderMutation) SetState

func (m *AmazonOrderMutation) SetState(s string)

SetState sets the "state" field.

func (*AmazonOrderMutation) SetTax

func (m *AmazonOrderMutation) SetTax(f float32)

SetTax sets the "tax" field.

func (*AmazonOrderMutation) SetZip

func (m *AmazonOrderMutation) SetZip(s string)

SetZip sets the "zip" field.

func (*AmazonOrderMutation) State

func (m *AmazonOrderMutation) State() (r string, exists bool)

State returns the value of the "state" field in the mutation.

func (*AmazonOrderMutation) Tax

func (m *AmazonOrderMutation) Tax() (r float32, exists bool)

Tax returns the value of the "tax" field in the mutation.

func (AmazonOrderMutation) Tx

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

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

func (*AmazonOrderMutation) Type

func (m *AmazonOrderMutation) Type() string

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

func (*AmazonOrderMutation) Where

func (m *AmazonOrderMutation) Where(ps ...predicate.AmazonOrder)

Where appends a list predicates to the AmazonOrderMutation builder.

func (*AmazonOrderMutation) WhereP

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

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

func (*AmazonOrderMutation) Zip

func (m *AmazonOrderMutation) Zip() (r string, exists bool)

Zip returns the value of the "zip" field in the mutation.

type AmazonOrderQuery

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

AmazonOrderQuery is the builder for querying AmazonOrder entities.

func (*AmazonOrderQuery) Aggregate

func (aoq *AmazonOrderQuery) Aggregate(fns ...AggregateFunc) *AmazonOrderSelect

Aggregate returns a AmazonOrderSelect configured with the given aggregations.

func (*AmazonOrderQuery) All

func (aoq *AmazonOrderQuery) All(ctx context.Context) ([]*AmazonOrder, error)

All executes the query and returns a list of AmazonOrders.

func (*AmazonOrderQuery) AllX

func (aoq *AmazonOrderQuery) AllX(ctx context.Context) []*AmazonOrder

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

func (*AmazonOrderQuery) Clone

func (aoq *AmazonOrderQuery) Clone() *AmazonOrderQuery

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

func (*AmazonOrderQuery) Count

func (aoq *AmazonOrderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AmazonOrderQuery) CountX

func (aoq *AmazonOrderQuery) CountX(ctx context.Context) int

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

func (*AmazonOrderQuery) Exist

func (aoq *AmazonOrderQuery) Exist(ctx context.Context) (bool, error)

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

func (*AmazonOrderQuery) ExistX

func (aoq *AmazonOrderQuery) ExistX(ctx context.Context) bool

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

func (*AmazonOrderQuery) First

func (aoq *AmazonOrderQuery) First(ctx context.Context) (*AmazonOrder, error)

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

func (*AmazonOrderQuery) FirstID

func (aoq *AmazonOrderQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AmazonOrderQuery) FirstIDX

func (aoq *AmazonOrderQuery) FirstIDX(ctx context.Context) int

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

func (*AmazonOrderQuery) FirstX

func (aoq *AmazonOrderQuery) FirstX(ctx context.Context) *AmazonOrder

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

func (*AmazonOrderQuery) GroupBy

func (aoq *AmazonOrderQuery) GroupBy(field string, fields ...string) *AmazonOrderGroupBy

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.AmazonOrder.Query().
	GroupBy(amazonorder.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AmazonOrderQuery) IDs

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

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

func (*AmazonOrderQuery) IDsX

func (aoq *AmazonOrderQuery) IDsX(ctx context.Context) []int

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

func (*AmazonOrderQuery) Limit

func (aoq *AmazonOrderQuery) Limit(limit int) *AmazonOrderQuery

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

func (*AmazonOrderQuery) Offset

func (aoq *AmazonOrderQuery) Offset(offset int) *AmazonOrderQuery

Offset to start from.

func (*AmazonOrderQuery) Only

func (aoq *AmazonOrderQuery) Only(ctx context.Context) (*AmazonOrder, error)

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

func (*AmazonOrderQuery) OnlyID

func (aoq *AmazonOrderQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AmazonOrderQuery) OnlyIDX

func (aoq *AmazonOrderQuery) OnlyIDX(ctx context.Context) int

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

func (*AmazonOrderQuery) OnlyX

func (aoq *AmazonOrderQuery) OnlyX(ctx context.Context) *AmazonOrder

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

func (*AmazonOrderQuery) Order

Order specifies how the records should be ordered.

func (*AmazonOrderQuery) QueryAmazonList

func (aoq *AmazonOrderQuery) QueryAmazonList() *AmazonListQuery

QueryAmazonList chains the current query on the "amazon_list" edge.

func (*AmazonOrderQuery) Select

func (aoq *AmazonOrderQuery) Select(fields ...string) *AmazonOrderSelect

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.AmazonOrder.Query().
	Select(amazonorder.FieldName).
	Scan(ctx, &v)

func (*AmazonOrderQuery) Unique

func (aoq *AmazonOrderQuery) Unique(unique bool) *AmazonOrderQuery

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

Where adds a new predicate for the AmazonOrderQuery builder.

func (*AmazonOrderQuery) WithAmazonList

func (aoq *AmazonOrderQuery) WithAmazonList(opts ...func(*AmazonListQuery)) *AmazonOrderQuery

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

type AmazonOrderSelect

type AmazonOrderSelect struct {
	*AmazonOrderQuery
	// contains filtered or unexported fields
}

AmazonOrderSelect is the builder for selecting fields of AmazonOrder entities.

func (*AmazonOrderSelect) Aggregate

func (aos *AmazonOrderSelect) Aggregate(fns ...AggregateFunc) *AmazonOrderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AmazonOrderSelect) Bool

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

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

func (*AmazonOrderSelect) BoolX

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

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

func (*AmazonOrderSelect) Bools

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

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

func (*AmazonOrderSelect) BoolsX

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

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

func (*AmazonOrderSelect) Float64

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

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

func (*AmazonOrderSelect) Float64X

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

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

func (*AmazonOrderSelect) Float64s

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

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

func (*AmazonOrderSelect) Float64sX

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

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

func (*AmazonOrderSelect) Int

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

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

func (*AmazonOrderSelect) IntX

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

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

func (*AmazonOrderSelect) Ints

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

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

func (*AmazonOrderSelect) IntsX

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

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

func (*AmazonOrderSelect) Scan

func (aos *AmazonOrderSelect) Scan(ctx context.Context, v any) error

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

func (*AmazonOrderSelect) ScanX

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

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

func (*AmazonOrderSelect) String

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

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

func (*AmazonOrderSelect) StringX

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

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

func (*AmazonOrderSelect) Strings

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

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

func (*AmazonOrderSelect) StringsX

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

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

type AmazonOrderUpdate

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

AmazonOrderUpdate is the builder for updating AmazonOrder entities.

func (*AmazonOrderUpdate) AddPrice

func (aou *AmazonOrderUpdate) AddPrice(f float32) *AmazonOrderUpdate

AddPrice adds f to the "price" field.

func (*AmazonOrderUpdate) AddTax

AddTax adds f to the "tax" field.

func (*AmazonOrderUpdate) ClearAmazonList

func (aou *AmazonOrderUpdate) ClearAmazonList() *AmazonOrderUpdate

ClearAmazonList clears the "amazon_list" edge to the AmazonList entity.

func (*AmazonOrderUpdate) Exec

func (aou *AmazonOrderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AmazonOrderUpdate) ExecX

func (aou *AmazonOrderUpdate) ExecX(ctx context.Context)

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

func (*AmazonOrderUpdate) Mutation

func (aou *AmazonOrderUpdate) Mutation() *AmazonOrderMutation

Mutation returns the AmazonOrderMutation object of the builder.

func (*AmazonOrderUpdate) Save

func (aou *AmazonOrderUpdate) Save(ctx context.Context) (int, error)

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

func (*AmazonOrderUpdate) SaveX

func (aou *AmazonOrderUpdate) SaveX(ctx context.Context) int

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

func (*AmazonOrderUpdate) SetAddress1

func (aou *AmazonOrderUpdate) SetAddress1(s string) *AmazonOrderUpdate

SetAddress1 sets the "address1" field.

func (*AmazonOrderUpdate) SetAddress2

func (aou *AmazonOrderUpdate) SetAddress2(s string) *AmazonOrderUpdate

SetAddress2 sets the "address2" field.

func (*AmazonOrderUpdate) SetAmazonList

func (aou *AmazonOrderUpdate) SetAmazonList(a *AmazonList) *AmazonOrderUpdate

SetAmazonList sets the "amazon_list" edge to the AmazonList entity.

func (*AmazonOrderUpdate) SetAmazonListID

func (aou *AmazonOrderUpdate) SetAmazonListID(id int) *AmazonOrderUpdate

SetAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID.

func (*AmazonOrderUpdate) SetBrand

func (aou *AmazonOrderUpdate) SetBrand(s string) *AmazonOrderUpdate

SetBrand sets the "brand" field.

func (*AmazonOrderUpdate) SetCategory

func (aou *AmazonOrderUpdate) SetCategory(s string) *AmazonOrderUpdate

SetCategory sets the "category" field.

func (*AmazonOrderUpdate) SetCity

func (aou *AmazonOrderUpdate) SetCity(s string) *AmazonOrderUpdate

SetCity sets the "city" field.

func (*AmazonOrderUpdate) SetCreatedAt

func (aou *AmazonOrderUpdate) SetCreatedAt(t time.Time) *AmazonOrderUpdate

SetCreatedAt sets the "created_at" field.

func (*AmazonOrderUpdate) SetName

func (aou *AmazonOrderUpdate) SetName(s string) *AmazonOrderUpdate

SetName sets the "name" field.

func (*AmazonOrderUpdate) SetNillableAmazonListID

func (aou *AmazonOrderUpdate) SetNillableAmazonListID(id *int) *AmazonOrderUpdate

SetNillableAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID if the given value is not nil.

func (*AmazonOrderUpdate) SetNillableCreatedAt

func (aou *AmazonOrderUpdate) SetNillableCreatedAt(t *time.Time) *AmazonOrderUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*AmazonOrderUpdate) SetOrderedAt

func (aou *AmazonOrderUpdate) SetOrderedAt(t time.Time) *AmazonOrderUpdate

SetOrderedAt sets the "ordered_at" field.

func (*AmazonOrderUpdate) SetPrice

func (aou *AmazonOrderUpdate) SetPrice(f float32) *AmazonOrderUpdate

SetPrice sets the "price" field.

func (*AmazonOrderUpdate) SetRefund

func (aou *AmazonOrderUpdate) SetRefund(b bool) *AmazonOrderUpdate

SetRefund sets the "refund" field.

func (*AmazonOrderUpdate) SetSeller

func (aou *AmazonOrderUpdate) SetSeller(s string) *AmazonOrderUpdate

SetSeller sets the "seller" field.

func (*AmazonOrderUpdate) SetState

func (aou *AmazonOrderUpdate) SetState(s string) *AmazonOrderUpdate

SetState sets the "state" field.

func (*AmazonOrderUpdate) SetTax

SetTax sets the "tax" field.

func (*AmazonOrderUpdate) SetZip

func (aou *AmazonOrderUpdate) SetZip(s string) *AmazonOrderUpdate

SetZip sets the "zip" field.

func (*AmazonOrderUpdate) Where

Where appends a list predicates to the AmazonOrderUpdate builder.

type AmazonOrderUpdateOne

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

AmazonOrderUpdateOne is the builder for updating a single AmazonOrder entity.

func (*AmazonOrderUpdateOne) AddPrice

AddPrice adds f to the "price" field.

func (*AmazonOrderUpdateOne) AddTax

AddTax adds f to the "tax" field.

func (*AmazonOrderUpdateOne) ClearAmazonList

func (aouo *AmazonOrderUpdateOne) ClearAmazonList() *AmazonOrderUpdateOne

ClearAmazonList clears the "amazon_list" edge to the AmazonList entity.

func (*AmazonOrderUpdateOne) Exec

func (aouo *AmazonOrderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AmazonOrderUpdateOne) ExecX

func (aouo *AmazonOrderUpdateOne) ExecX(ctx context.Context)

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

func (*AmazonOrderUpdateOne) Mutation

func (aouo *AmazonOrderUpdateOne) Mutation() *AmazonOrderMutation

Mutation returns the AmazonOrderMutation object of the builder.

func (*AmazonOrderUpdateOne) Save

Save executes the query and returns the updated AmazonOrder entity.

func (*AmazonOrderUpdateOne) SaveX

func (aouo *AmazonOrderUpdateOne) SaveX(ctx context.Context) *AmazonOrder

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

func (*AmazonOrderUpdateOne) Select

func (aouo *AmazonOrderUpdateOne) Select(field string, fields ...string) *AmazonOrderUpdateOne

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

func (*AmazonOrderUpdateOne) SetAddress1

func (aouo *AmazonOrderUpdateOne) SetAddress1(s string) *AmazonOrderUpdateOne

SetAddress1 sets the "address1" field.

func (*AmazonOrderUpdateOne) SetAddress2

func (aouo *AmazonOrderUpdateOne) SetAddress2(s string) *AmazonOrderUpdateOne

SetAddress2 sets the "address2" field.

func (*AmazonOrderUpdateOne) SetAmazonList

func (aouo *AmazonOrderUpdateOne) SetAmazonList(a *AmazonList) *AmazonOrderUpdateOne

SetAmazonList sets the "amazon_list" edge to the AmazonList entity.

func (*AmazonOrderUpdateOne) SetAmazonListID

func (aouo *AmazonOrderUpdateOne) SetAmazonListID(id int) *AmazonOrderUpdateOne

SetAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID.

func (*AmazonOrderUpdateOne) SetBrand

SetBrand sets the "brand" field.

func (*AmazonOrderUpdateOne) SetCategory

func (aouo *AmazonOrderUpdateOne) SetCategory(s string) *AmazonOrderUpdateOne

SetCategory sets the "category" field.

func (*AmazonOrderUpdateOne) SetCity

SetCity sets the "city" field.

func (*AmazonOrderUpdateOne) SetCreatedAt

func (aouo *AmazonOrderUpdateOne) SetCreatedAt(t time.Time) *AmazonOrderUpdateOne

SetCreatedAt sets the "created_at" field.

func (*AmazonOrderUpdateOne) SetName

SetName sets the "name" field.

func (*AmazonOrderUpdateOne) SetNillableAmazonListID

func (aouo *AmazonOrderUpdateOne) SetNillableAmazonListID(id *int) *AmazonOrderUpdateOne

SetNillableAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID if the given value is not nil.

func (*AmazonOrderUpdateOne) SetNillableCreatedAt

func (aouo *AmazonOrderUpdateOne) SetNillableCreatedAt(t *time.Time) *AmazonOrderUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*AmazonOrderUpdateOne) SetOrderedAt

func (aouo *AmazonOrderUpdateOne) SetOrderedAt(t time.Time) *AmazonOrderUpdateOne

SetOrderedAt sets the "ordered_at" field.

func (*AmazonOrderUpdateOne) SetPrice

SetPrice sets the "price" field.

func (*AmazonOrderUpdateOne) SetRefund

func (aouo *AmazonOrderUpdateOne) SetRefund(b bool) *AmazonOrderUpdateOne

SetRefund sets the "refund" field.

func (*AmazonOrderUpdateOne) SetSeller

func (aouo *AmazonOrderUpdateOne) SetSeller(s string) *AmazonOrderUpdateOne

SetSeller sets the "seller" field.

func (*AmazonOrderUpdateOne) SetState

SetState sets the "state" field.

func (*AmazonOrderUpdateOne) SetTax

SetTax sets the "tax" field.

func (*AmazonOrderUpdateOne) SetZip

SetZip sets the "zip" field.

func (*AmazonOrderUpdateOne) Where

Where appends a list predicates to the AmazonOrderUpdate builder.

type AmazonOrders

type AmazonOrders []*AmazonOrder

AmazonOrders is a parsable slice of AmazonOrder.

type AmazonShare

type AmazonShare struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CanEdit holds the value of the "can_edit" field.
	CanEdit bool `json:"can_edit,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AmazonShareQuery when eager-loading is set.
	Edges AmazonShareEdges `json:"edges"`
	// contains filtered or unexported fields
}

AmazonShare is the model entity for the AmazonShare schema.

func (*AmazonShare) QueryAmazonList

func (as *AmazonShare) QueryAmazonList() *AmazonListQuery

QueryAmazonList queries the "amazon_list" edge of the AmazonShare entity.

func (*AmazonShare) QueryUser

func (as *AmazonShare) QueryUser() *UserQuery

QueryUser queries the "user" edge of the AmazonShare entity.

func (*AmazonShare) String

func (as *AmazonShare) String() string

String implements the fmt.Stringer.

func (*AmazonShare) Unwrap

func (as *AmazonShare) Unwrap() *AmazonShare

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

func (as *AmazonShare) Update() *AmazonShareUpdateOne

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

func (*AmazonShare) Value

func (as *AmazonShare) Value(name string) (ent.Value, error)

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

type AmazonShareClient

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

AmazonShareClient is a client for the AmazonShare schema.

func NewAmazonShareClient

func NewAmazonShareClient(c config) *AmazonShareClient

NewAmazonShareClient returns a client for the AmazonShare from the given config.

func (*AmazonShareClient) Create

func (c *AmazonShareClient) Create() *AmazonShareCreate

Create returns a builder for creating a AmazonShare entity.

func (*AmazonShareClient) CreateBulk

func (c *AmazonShareClient) CreateBulk(builders ...*AmazonShareCreate) *AmazonShareCreateBulk

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

func (*AmazonShareClient) Delete

func (c *AmazonShareClient) Delete() *AmazonShareDelete

Delete returns a delete builder for AmazonShare.

func (*AmazonShareClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AmazonShareClient) DeleteOneID

func (c *AmazonShareClient) DeleteOneID(id int) *AmazonShareDeleteOne

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

func (*AmazonShareClient) Get

func (c *AmazonShareClient) Get(ctx context.Context, id int) (*AmazonShare, error)

Get returns a AmazonShare entity by its id.

func (*AmazonShareClient) GetX

func (c *AmazonShareClient) GetX(ctx context.Context, id int) *AmazonShare

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

func (*AmazonShareClient) Hooks

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

Hooks returns the client hooks.

func (*AmazonShareClient) Intercept

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

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

func (*AmazonShareClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AmazonShareClient) Query

func (c *AmazonShareClient) Query() *AmazonShareQuery

Query returns a query builder for AmazonShare.

func (*AmazonShareClient) QueryAmazonList

func (c *AmazonShareClient) QueryAmazonList(as *AmazonShare) *AmazonListQuery

QueryAmazonList queries the amazon_list edge of a AmazonShare.

func (*AmazonShareClient) QueryUser

func (c *AmazonShareClient) QueryUser(as *AmazonShare) *UserQuery

QueryUser queries the user edge of a AmazonShare.

func (*AmazonShareClient) Update

func (c *AmazonShareClient) Update() *AmazonShareUpdate

Update returns an update builder for AmazonShare.

func (*AmazonShareClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AmazonShareClient) UpdateOneID

func (c *AmazonShareClient) UpdateOneID(id int) *AmazonShareUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AmazonShareClient) Use

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

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

type AmazonShareCreate

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

AmazonShareCreate is the builder for creating a AmazonShare entity.

func (*AmazonShareCreate) Exec

func (asc *AmazonShareCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AmazonShareCreate) ExecX

func (asc *AmazonShareCreate) ExecX(ctx context.Context)

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

func (*AmazonShareCreate) Mutation

func (asc *AmazonShareCreate) Mutation() *AmazonShareMutation

Mutation returns the AmazonShareMutation object of the builder.

func (*AmazonShareCreate) Save

func (asc *AmazonShareCreate) Save(ctx context.Context) (*AmazonShare, error)

Save creates the AmazonShare in the database.

func (*AmazonShareCreate) SaveX

func (asc *AmazonShareCreate) SaveX(ctx context.Context) *AmazonShare

SaveX calls Save and panics if Save returns an error.

func (*AmazonShareCreate) SetAmazonList

func (asc *AmazonShareCreate) SetAmazonList(a *AmazonList) *AmazonShareCreate

SetAmazonList sets the "amazon_list" edge to the AmazonList entity.

func (*AmazonShareCreate) SetAmazonListID

func (asc *AmazonShareCreate) SetAmazonListID(id int) *AmazonShareCreate

SetAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID.

func (*AmazonShareCreate) SetCanEdit

func (asc *AmazonShareCreate) SetCanEdit(b bool) *AmazonShareCreate

SetCanEdit sets the "can_edit" field.

func (*AmazonShareCreate) SetCreatedAt

func (asc *AmazonShareCreate) SetCreatedAt(t time.Time) *AmazonShareCreate

SetCreatedAt sets the "created_at" field.

func (*AmazonShareCreate) SetNillableAmazonListID

func (asc *AmazonShareCreate) SetNillableAmazonListID(id *int) *AmazonShareCreate

SetNillableAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID if the given value is not nil.

func (*AmazonShareCreate) SetNillableCanEdit

func (asc *AmazonShareCreate) SetNillableCanEdit(b *bool) *AmazonShareCreate

SetNillableCanEdit sets the "can_edit" field if the given value is not nil.

func (*AmazonShareCreate) SetNillableUserID

func (asc *AmazonShareCreate) SetNillableUserID(id *int) *AmazonShareCreate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*AmazonShareCreate) SetUser

func (asc *AmazonShareCreate) SetUser(u *User) *AmazonShareCreate

SetUser sets the "user" edge to the User entity.

func (*AmazonShareCreate) SetUserID

func (asc *AmazonShareCreate) SetUserID(id int) *AmazonShareCreate

SetUserID sets the "user" edge to the User entity by ID.

type AmazonShareCreateBulk

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

AmazonShareCreateBulk is the builder for creating many AmazonShare entities in bulk.

func (*AmazonShareCreateBulk) Exec

func (ascb *AmazonShareCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AmazonShareCreateBulk) ExecX

func (ascb *AmazonShareCreateBulk) ExecX(ctx context.Context)

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

func (*AmazonShareCreateBulk) Save

func (ascb *AmazonShareCreateBulk) Save(ctx context.Context) ([]*AmazonShare, error)

Save creates the AmazonShare entities in the database.

func (*AmazonShareCreateBulk) SaveX

func (ascb *AmazonShareCreateBulk) SaveX(ctx context.Context) []*AmazonShare

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

type AmazonShareDelete

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

AmazonShareDelete is the builder for deleting a AmazonShare entity.

func (*AmazonShareDelete) Exec

func (asd *AmazonShareDelete) Exec(ctx context.Context) (int, error)

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

func (*AmazonShareDelete) ExecX

func (asd *AmazonShareDelete) ExecX(ctx context.Context) int

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

func (*AmazonShareDelete) Where

Where appends a list predicates to the AmazonShareDelete builder.

type AmazonShareDeleteOne

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

AmazonShareDeleteOne is the builder for deleting a single AmazonShare entity.

func (*AmazonShareDeleteOne) Exec

func (asdo *AmazonShareDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AmazonShareDeleteOne) ExecX

func (asdo *AmazonShareDeleteOne) ExecX(ctx context.Context)

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

func (*AmazonShareDeleteOne) Where

Where appends a list predicates to the AmazonShareDelete builder.

type AmazonShareEdges

type AmazonShareEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// AmazonList holds the value of the amazon_list edge.
	AmazonList *AmazonList `json:"amazon_list,omitempty"`
	// contains filtered or unexported fields
}

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

func (AmazonShareEdges) AmazonListOrErr

func (e AmazonShareEdges) AmazonListOrErr() (*AmazonList, error)

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

func (AmazonShareEdges) UserOrErr

func (e AmazonShareEdges) UserOrErr() (*User, error)

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

type AmazonShareGroupBy

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

AmazonShareGroupBy is the group-by builder for AmazonShare entities.

func (*AmazonShareGroupBy) Aggregate

func (asgb *AmazonShareGroupBy) Aggregate(fns ...AggregateFunc) *AmazonShareGroupBy

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

func (*AmazonShareGroupBy) Bool

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

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

func (*AmazonShareGroupBy) BoolX

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

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

func (*AmazonShareGroupBy) Bools

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

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

func (*AmazonShareGroupBy) BoolsX

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

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

func (*AmazonShareGroupBy) Float64

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

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

func (*AmazonShareGroupBy) Float64X

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

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

func (*AmazonShareGroupBy) Float64s

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

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

func (*AmazonShareGroupBy) Float64sX

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

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

func (*AmazonShareGroupBy) Int

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

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

func (*AmazonShareGroupBy) IntX

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

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

func (*AmazonShareGroupBy) Ints

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

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

func (*AmazonShareGroupBy) IntsX

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

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

func (*AmazonShareGroupBy) Scan

func (asgb *AmazonShareGroupBy) Scan(ctx context.Context, v any) error

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

func (*AmazonShareGroupBy) ScanX

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

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

func (*AmazonShareGroupBy) String

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

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

func (*AmazonShareGroupBy) StringX

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

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

func (*AmazonShareGroupBy) Strings

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

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

func (*AmazonShareGroupBy) StringsX

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

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

type AmazonShareMutation

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

AmazonShareMutation represents an operation that mutates the AmazonShare nodes in the graph.

func (*AmazonShareMutation) AddField

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

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

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

func (*AmazonShareMutation) AddedField

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

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

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

func (*AmazonShareMutation) AddedIDs

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

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

func (*AmazonShareMutation) AmazonListCleared

func (m *AmazonShareMutation) AmazonListCleared() bool

AmazonListCleared reports if the "amazon_list" edge to the AmazonList entity was cleared.

func (*AmazonShareMutation) AmazonListID

func (m *AmazonShareMutation) AmazonListID() (id int, exists bool)

AmazonListID returns the "amazon_list" edge ID in the mutation.

func (*AmazonShareMutation) AmazonListIDs

func (m *AmazonShareMutation) AmazonListIDs() (ids []int)

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

func (*AmazonShareMutation) CanEdit

func (m *AmazonShareMutation) CanEdit() (r bool, exists bool)

CanEdit returns the value of the "can_edit" field in the mutation.

func (*AmazonShareMutation) ClearAmazonList

func (m *AmazonShareMutation) ClearAmazonList()

ClearAmazonList clears the "amazon_list" edge to the AmazonList entity.

func (*AmazonShareMutation) ClearEdge

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

func (m *AmazonShareMutation) 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 (*AmazonShareMutation) ClearUser

func (m *AmazonShareMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*AmazonShareMutation) ClearedEdges

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

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

func (*AmazonShareMutation) ClearedFields

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

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

func (AmazonShareMutation) Client

func (m AmazonShareMutation) 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 (*AmazonShareMutation) CreatedAt

func (m *AmazonShareMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*AmazonShareMutation) EdgeCleared

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

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

func (*AmazonShareMutation) Field

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

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

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

func (*AmazonShareMutation) Fields

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

func (m *AmazonShareMutation) ID() (id int, exists bool)

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

func (*AmazonShareMutation) IDs

func (m *AmazonShareMutation) IDs(ctx context.Context) ([]int, error)

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

func (*AmazonShareMutation) OldCanEdit

func (m *AmazonShareMutation) OldCanEdit(ctx context.Context) (v bool, err error)

OldCanEdit returns the old "can_edit" field's value of the AmazonShare entity. If the AmazonShare 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 (*AmazonShareMutation) OldCreatedAt

func (m *AmazonShareMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the AmazonShare entity. If the AmazonShare 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 (*AmazonShareMutation) OldField

func (m *AmazonShareMutation) 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 (*AmazonShareMutation) Op

func (m *AmazonShareMutation) Op() Op

Op returns the operation name.

func (*AmazonShareMutation) RemovedEdges

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

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

func (*AmazonShareMutation) RemovedIDs

func (m *AmazonShareMutation) 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 (*AmazonShareMutation) ResetAmazonList

func (m *AmazonShareMutation) ResetAmazonList()

ResetAmazonList resets all changes to the "amazon_list" edge.

func (*AmazonShareMutation) ResetCanEdit

func (m *AmazonShareMutation) ResetCanEdit()

ResetCanEdit resets all changes to the "can_edit" field.

func (*AmazonShareMutation) ResetCreatedAt

func (m *AmazonShareMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AmazonShareMutation) ResetEdge

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

func (m *AmazonShareMutation) 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 (*AmazonShareMutation) ResetUser

func (m *AmazonShareMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*AmazonShareMutation) SetAmazonListID

func (m *AmazonShareMutation) SetAmazonListID(id int)

SetAmazonListID sets the "amazon_list" edge to the AmazonList entity by id.

func (*AmazonShareMutation) SetCanEdit

func (m *AmazonShareMutation) SetCanEdit(b bool)

SetCanEdit sets the "can_edit" field.

func (*AmazonShareMutation) SetCreatedAt

func (m *AmazonShareMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*AmazonShareMutation) SetField

func (m *AmazonShareMutation) 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 (*AmazonShareMutation) SetOp

func (m *AmazonShareMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AmazonShareMutation) SetUserID

func (m *AmazonShareMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (AmazonShareMutation) Tx

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

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

func (*AmazonShareMutation) Type

func (m *AmazonShareMutation) Type() string

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

func (*AmazonShareMutation) UserCleared

func (m *AmazonShareMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*AmazonShareMutation) UserID

func (m *AmazonShareMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*AmazonShareMutation) UserIDs

func (m *AmazonShareMutation) UserIDs() (ids []int)

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

func (*AmazonShareMutation) Where

func (m *AmazonShareMutation) Where(ps ...predicate.AmazonShare)

Where appends a list predicates to the AmazonShareMutation builder.

func (*AmazonShareMutation) WhereP

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

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

type AmazonShareQuery

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

AmazonShareQuery is the builder for querying AmazonShare entities.

func (*AmazonShareQuery) Aggregate

func (asq *AmazonShareQuery) Aggregate(fns ...AggregateFunc) *AmazonShareSelect

Aggregate returns a AmazonShareSelect configured with the given aggregations.

func (*AmazonShareQuery) All

func (asq *AmazonShareQuery) All(ctx context.Context) ([]*AmazonShare, error)

All executes the query and returns a list of AmazonShares.

func (*AmazonShareQuery) AllX

func (asq *AmazonShareQuery) AllX(ctx context.Context) []*AmazonShare

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

func (*AmazonShareQuery) Clone

func (asq *AmazonShareQuery) Clone() *AmazonShareQuery

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

func (*AmazonShareQuery) Count

func (asq *AmazonShareQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AmazonShareQuery) CountX

func (asq *AmazonShareQuery) CountX(ctx context.Context) int

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

func (*AmazonShareQuery) Exist

func (asq *AmazonShareQuery) Exist(ctx context.Context) (bool, error)

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

func (*AmazonShareQuery) ExistX

func (asq *AmazonShareQuery) ExistX(ctx context.Context) bool

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

func (*AmazonShareQuery) First

func (asq *AmazonShareQuery) First(ctx context.Context) (*AmazonShare, error)

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

func (*AmazonShareQuery) FirstID

func (asq *AmazonShareQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AmazonShareQuery) FirstIDX

func (asq *AmazonShareQuery) FirstIDX(ctx context.Context) int

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

func (*AmazonShareQuery) FirstX

func (asq *AmazonShareQuery) FirstX(ctx context.Context) *AmazonShare

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

func (*AmazonShareQuery) GroupBy

func (asq *AmazonShareQuery) GroupBy(field string, fields ...string) *AmazonShareGroupBy

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 {
	CanEdit bool `json:"can_edit,omitempty"`
	Count int `json:"count,omitempty"`
}

client.AmazonShare.Query().
	GroupBy(amazonshare.FieldCanEdit).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AmazonShareQuery) IDs

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

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

func (*AmazonShareQuery) IDsX

func (asq *AmazonShareQuery) IDsX(ctx context.Context) []int

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

func (*AmazonShareQuery) Limit

func (asq *AmazonShareQuery) Limit(limit int) *AmazonShareQuery

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

func (*AmazonShareQuery) Offset

func (asq *AmazonShareQuery) Offset(offset int) *AmazonShareQuery

Offset to start from.

func (*AmazonShareQuery) Only

func (asq *AmazonShareQuery) Only(ctx context.Context) (*AmazonShare, error)

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

func (*AmazonShareQuery) OnlyID

func (asq *AmazonShareQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AmazonShareQuery) OnlyIDX

func (asq *AmazonShareQuery) OnlyIDX(ctx context.Context) int

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

func (*AmazonShareQuery) OnlyX

func (asq *AmazonShareQuery) OnlyX(ctx context.Context) *AmazonShare

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

func (*AmazonShareQuery) Order

Order specifies how the records should be ordered.

func (*AmazonShareQuery) QueryAmazonList

func (asq *AmazonShareQuery) QueryAmazonList() *AmazonListQuery

QueryAmazonList chains the current query on the "amazon_list" edge.

func (*AmazonShareQuery) QueryUser

func (asq *AmazonShareQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*AmazonShareQuery) Select

func (asq *AmazonShareQuery) Select(fields ...string) *AmazonShareSelect

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 {
	CanEdit bool `json:"can_edit,omitempty"`
}

client.AmazonShare.Query().
	Select(amazonshare.FieldCanEdit).
	Scan(ctx, &v)

func (*AmazonShareQuery) Unique

func (asq *AmazonShareQuery) Unique(unique bool) *AmazonShareQuery

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

Where adds a new predicate for the AmazonShareQuery builder.

func (*AmazonShareQuery) WithAmazonList

func (asq *AmazonShareQuery) WithAmazonList(opts ...func(*AmazonListQuery)) *AmazonShareQuery

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

func (*AmazonShareQuery) WithUser

func (asq *AmazonShareQuery) WithUser(opts ...func(*UserQuery)) *AmazonShareQuery

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

type AmazonShareSelect

type AmazonShareSelect struct {
	*AmazonShareQuery
	// contains filtered or unexported fields
}

AmazonShareSelect is the builder for selecting fields of AmazonShare entities.

func (*AmazonShareSelect) Aggregate

func (ass *AmazonShareSelect) Aggregate(fns ...AggregateFunc) *AmazonShareSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AmazonShareSelect) Bool

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

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

func (*AmazonShareSelect) BoolX

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

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

func (*AmazonShareSelect) Bools

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

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

func (*AmazonShareSelect) BoolsX

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

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

func (*AmazonShareSelect) Float64

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

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

func (*AmazonShareSelect) Float64X

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

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

func (*AmazonShareSelect) Float64s

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

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

func (*AmazonShareSelect) Float64sX

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

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

func (*AmazonShareSelect) Int

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

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

func (*AmazonShareSelect) IntX

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

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

func (*AmazonShareSelect) Ints

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

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

func (*AmazonShareSelect) IntsX

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

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

func (*AmazonShareSelect) Scan

func (ass *AmazonShareSelect) Scan(ctx context.Context, v any) error

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

func (*AmazonShareSelect) ScanX

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

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

func (*AmazonShareSelect) String

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

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

func (*AmazonShareSelect) StringX

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

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

func (*AmazonShareSelect) Strings

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

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

func (*AmazonShareSelect) StringsX

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

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

type AmazonShareUpdate

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

AmazonShareUpdate is the builder for updating AmazonShare entities.

func (*AmazonShareUpdate) ClearAmazonList

func (asu *AmazonShareUpdate) ClearAmazonList() *AmazonShareUpdate

ClearAmazonList clears the "amazon_list" edge to the AmazonList entity.

func (*AmazonShareUpdate) ClearUser

func (asu *AmazonShareUpdate) ClearUser() *AmazonShareUpdate

ClearUser clears the "user" edge to the User entity.

func (*AmazonShareUpdate) Exec

func (asu *AmazonShareUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AmazonShareUpdate) ExecX

func (asu *AmazonShareUpdate) ExecX(ctx context.Context)

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

func (*AmazonShareUpdate) Mutation

func (asu *AmazonShareUpdate) Mutation() *AmazonShareMutation

Mutation returns the AmazonShareMutation object of the builder.

func (*AmazonShareUpdate) Save

func (asu *AmazonShareUpdate) Save(ctx context.Context) (int, error)

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

func (*AmazonShareUpdate) SaveX

func (asu *AmazonShareUpdate) SaveX(ctx context.Context) int

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

func (*AmazonShareUpdate) SetAmazonList

func (asu *AmazonShareUpdate) SetAmazonList(a *AmazonList) *AmazonShareUpdate

SetAmazonList sets the "amazon_list" edge to the AmazonList entity.

func (*AmazonShareUpdate) SetAmazonListID

func (asu *AmazonShareUpdate) SetAmazonListID(id int) *AmazonShareUpdate

SetAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID.

func (*AmazonShareUpdate) SetCanEdit

func (asu *AmazonShareUpdate) SetCanEdit(b bool) *AmazonShareUpdate

SetCanEdit sets the "can_edit" field.

func (*AmazonShareUpdate) SetCreatedAt

func (asu *AmazonShareUpdate) SetCreatedAt(t time.Time) *AmazonShareUpdate

SetCreatedAt sets the "created_at" field.

func (*AmazonShareUpdate) SetNillableAmazonListID

func (asu *AmazonShareUpdate) SetNillableAmazonListID(id *int) *AmazonShareUpdate

SetNillableAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID if the given value is not nil.

func (*AmazonShareUpdate) SetNillableCanEdit

func (asu *AmazonShareUpdate) SetNillableCanEdit(b *bool) *AmazonShareUpdate

SetNillableCanEdit sets the "can_edit" field if the given value is not nil.

func (*AmazonShareUpdate) SetNillableUserID

func (asu *AmazonShareUpdate) SetNillableUserID(id *int) *AmazonShareUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*AmazonShareUpdate) SetUser

func (asu *AmazonShareUpdate) SetUser(u *User) *AmazonShareUpdate

SetUser sets the "user" edge to the User entity.

func (*AmazonShareUpdate) SetUserID

func (asu *AmazonShareUpdate) SetUserID(id int) *AmazonShareUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*AmazonShareUpdate) Where

Where appends a list predicates to the AmazonShareUpdate builder.

type AmazonShareUpdateOne

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

AmazonShareUpdateOne is the builder for updating a single AmazonShare entity.

func (*AmazonShareUpdateOne) ClearAmazonList

func (asuo *AmazonShareUpdateOne) ClearAmazonList() *AmazonShareUpdateOne

ClearAmazonList clears the "amazon_list" edge to the AmazonList entity.

func (*AmazonShareUpdateOne) ClearUser

func (asuo *AmazonShareUpdateOne) ClearUser() *AmazonShareUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*AmazonShareUpdateOne) Exec

func (asuo *AmazonShareUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AmazonShareUpdateOne) ExecX

func (asuo *AmazonShareUpdateOne) ExecX(ctx context.Context)

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

func (*AmazonShareUpdateOne) Mutation

func (asuo *AmazonShareUpdateOne) Mutation() *AmazonShareMutation

Mutation returns the AmazonShareMutation object of the builder.

func (*AmazonShareUpdateOne) Save

Save executes the query and returns the updated AmazonShare entity.

func (*AmazonShareUpdateOne) SaveX

func (asuo *AmazonShareUpdateOne) SaveX(ctx context.Context) *AmazonShare

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

func (*AmazonShareUpdateOne) Select

func (asuo *AmazonShareUpdateOne) Select(field string, fields ...string) *AmazonShareUpdateOne

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

func (*AmazonShareUpdateOne) SetAmazonList

func (asuo *AmazonShareUpdateOne) SetAmazonList(a *AmazonList) *AmazonShareUpdateOne

SetAmazonList sets the "amazon_list" edge to the AmazonList entity.

func (*AmazonShareUpdateOne) SetAmazonListID

func (asuo *AmazonShareUpdateOne) SetAmazonListID(id int) *AmazonShareUpdateOne

SetAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID.

func (*AmazonShareUpdateOne) SetCanEdit

func (asuo *AmazonShareUpdateOne) SetCanEdit(b bool) *AmazonShareUpdateOne

SetCanEdit sets the "can_edit" field.

func (*AmazonShareUpdateOne) SetCreatedAt

func (asuo *AmazonShareUpdateOne) SetCreatedAt(t time.Time) *AmazonShareUpdateOne

SetCreatedAt sets the "created_at" field.

func (*AmazonShareUpdateOne) SetNillableAmazonListID

func (asuo *AmazonShareUpdateOne) SetNillableAmazonListID(id *int) *AmazonShareUpdateOne

SetNillableAmazonListID sets the "amazon_list" edge to the AmazonList entity by ID if the given value is not nil.

func (*AmazonShareUpdateOne) SetNillableCanEdit

func (asuo *AmazonShareUpdateOne) SetNillableCanEdit(b *bool) *AmazonShareUpdateOne

SetNillableCanEdit sets the "can_edit" field if the given value is not nil.

func (*AmazonShareUpdateOne) SetNillableUserID

func (asuo *AmazonShareUpdateOne) SetNillableUserID(id *int) *AmazonShareUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*AmazonShareUpdateOne) SetUser

func (asuo *AmazonShareUpdateOne) SetUser(u *User) *AmazonShareUpdateOne

SetUser sets the "user" edge to the User entity.

func (*AmazonShareUpdateOne) SetUserID

func (asuo *AmazonShareUpdateOne) SetUserID(id int) *AmazonShareUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

func (*AmazonShareUpdateOne) Where

Where appends a list predicates to the AmazonShareUpdate builder.

type AmazonShares

type AmazonShares []*AmazonShare

AmazonShares is a parsable slice of AmazonShare.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// AmazonList is the client for interacting with the AmazonList builders.
	AmazonList *AmazonListClient
	// AmazonOrder is the client for interacting with the AmazonOrder builders.
	AmazonOrder *AmazonOrderClient
	// AmazonShare is the client for interacting with the AmazonShare builders.
	AmazonShare *AmazonShareClient
	// Drink is the client for interacting with the Drink builders.
	Drink *DrinkClient
	// GroceryList is the client for interacting with the GroceryList builders.
	GroceryList *GroceryListClient
	// GroceryListItem is the client for interacting with the GroceryListItem builders.
	GroceryListItem *GroceryListItemClient
	// GroceryListShare is the client for interacting with the GroceryListShare builders.
	GroceryListShare *GroceryListShareClient
	// Movie is the client for interacting with the Movie builders.
	Movie *MovieClient
	// MovieCollection is the client for interacting with the MovieCollection builders.
	MovieCollection *MovieCollectionClient
	// MovieCollectionShare is the client for interacting with the MovieCollectionShare builders.
	MovieCollectionShare *MovieCollectionShareClient
	// 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().
	AmazonList.
	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 Drink

type Drink struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type drink.Type `json:"type,omitempty"`
	// Abv holds the value of the "abv" field.
	Abv int8 `json:"abv,omitempty"`
	// Ounces holds the value of the "ounces" field.
	Ounces int8 `json:"ounces,omitempty"`
	// Year holds the value of the "year" field.
	Year int `json:"year,omitempty"`
	// Month holds the value of the "month" field.
	Month int `json:"month,omitempty"`
	// Day holds the value of the "day" field.
	Day int `json:"day,omitempty"`
	// Note holds the value of the "note" field.
	Note string `json:"note,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DrinkQuery when eager-loading is set.
	Edges DrinkEdges `json:"edges"`
	// contains filtered or unexported fields
}

Drink is the model entity for the Drink schema.

func (*Drink) QueryOwner

func (d *Drink) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the Drink entity.

func (*Drink) String

func (d *Drink) String() string

String implements the fmt.Stringer.

func (*Drink) Unwrap

func (d *Drink) Unwrap() *Drink

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

func (d *Drink) Update() *DrinkUpdateOne

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

func (*Drink) Value

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

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

type DrinkClient

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

DrinkClient is a client for the Drink schema.

func NewDrinkClient

func NewDrinkClient(c config) *DrinkClient

NewDrinkClient returns a client for the Drink from the given config.

func (*DrinkClient) Create

func (c *DrinkClient) Create() *DrinkCreate

Create returns a builder for creating a Drink entity.

func (*DrinkClient) CreateBulk

func (c *DrinkClient) CreateBulk(builders ...*DrinkCreate) *DrinkCreateBulk

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

func (*DrinkClient) Delete

func (c *DrinkClient) Delete() *DrinkDelete

Delete returns a delete builder for Drink.

func (*DrinkClient) DeleteOne

func (c *DrinkClient) DeleteOne(d *Drink) *DrinkDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DrinkClient) DeleteOneID

func (c *DrinkClient) DeleteOneID(id int) *DrinkDeleteOne

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

func (*DrinkClient) Get

func (c *DrinkClient) Get(ctx context.Context, id int) (*Drink, error)

Get returns a Drink entity by its id.

func (*DrinkClient) GetX

func (c *DrinkClient) GetX(ctx context.Context, id int) *Drink

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

func (*DrinkClient) Hooks

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

Hooks returns the client hooks.

func (*DrinkClient) Intercept

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

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

func (*DrinkClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DrinkClient) Query

func (c *DrinkClient) Query() *DrinkQuery

Query returns a query builder for Drink.

func (*DrinkClient) QueryOwner

func (c *DrinkClient) QueryOwner(d *Drink) *UserQuery

QueryOwner queries the owner edge of a Drink.

func (*DrinkClient) Update

func (c *DrinkClient) Update() *DrinkUpdate

Update returns an update builder for Drink.

func (*DrinkClient) UpdateOne

func (c *DrinkClient) UpdateOne(d *Drink) *DrinkUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DrinkClient) UpdateOneID

func (c *DrinkClient) UpdateOneID(id int) *DrinkUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DrinkClient) Use

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

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

type DrinkCreate

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

DrinkCreate is the builder for creating a Drink entity.

func (*DrinkCreate) Exec

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

Exec executes the query.

func (*DrinkCreate) ExecX

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

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

func (*DrinkCreate) Mutation

func (dc *DrinkCreate) Mutation() *DrinkMutation

Mutation returns the DrinkMutation object of the builder.

func (*DrinkCreate) Save

func (dc *DrinkCreate) Save(ctx context.Context) (*Drink, error)

Save creates the Drink in the database.

func (*DrinkCreate) SaveX

func (dc *DrinkCreate) SaveX(ctx context.Context) *Drink

SaveX calls Save and panics if Save returns an error.

func (*DrinkCreate) SetAbv

func (dc *DrinkCreate) SetAbv(i int8) *DrinkCreate

SetAbv sets the "abv" field.

func (*DrinkCreate) SetCreatedAt

func (dc *DrinkCreate) SetCreatedAt(t time.Time) *DrinkCreate

SetCreatedAt sets the "created_at" field.

func (*DrinkCreate) SetDay

func (dc *DrinkCreate) SetDay(i int) *DrinkCreate

SetDay sets the "day" field.

func (*DrinkCreate) SetMonth

func (dc *DrinkCreate) SetMonth(i int) *DrinkCreate

SetMonth sets the "month" field.

func (*DrinkCreate) SetNillableAbv

func (dc *DrinkCreate) SetNillableAbv(i *int8) *DrinkCreate

SetNillableAbv sets the "abv" field if the given value is not nil.

func (*DrinkCreate) SetNillableCreatedAt

func (dc *DrinkCreate) SetNillableCreatedAt(t *time.Time) *DrinkCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*DrinkCreate) SetNillableDay

func (dc *DrinkCreate) SetNillableDay(i *int) *DrinkCreate

SetNillableDay sets the "day" field if the given value is not nil.

func (*DrinkCreate) SetNillableMonth

func (dc *DrinkCreate) SetNillableMonth(i *int) *DrinkCreate

SetNillableMonth sets the "month" field if the given value is not nil.

func (*DrinkCreate) SetNillableNote

func (dc *DrinkCreate) SetNillableNote(s *string) *DrinkCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*DrinkCreate) SetNillableOunces

func (dc *DrinkCreate) SetNillableOunces(i *int8) *DrinkCreate

SetNillableOunces sets the "ounces" field if the given value is not nil.

func (*DrinkCreate) SetNillableOwnerID

func (dc *DrinkCreate) SetNillableOwnerID(id *int) *DrinkCreate

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*DrinkCreate) SetNillableType

func (dc *DrinkCreate) SetNillableType(d *drink.Type) *DrinkCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*DrinkCreate) SetNillableYear

func (dc *DrinkCreate) SetNillableYear(i *int) *DrinkCreate

SetNillableYear sets the "year" field if the given value is not nil.

func (*DrinkCreate) SetNote

func (dc *DrinkCreate) SetNote(s string) *DrinkCreate

SetNote sets the "note" field.

func (*DrinkCreate) SetOunces

func (dc *DrinkCreate) SetOunces(i int8) *DrinkCreate

SetOunces sets the "ounces" field.

func (*DrinkCreate) SetOwner

func (dc *DrinkCreate) SetOwner(u *User) *DrinkCreate

SetOwner sets the "owner" edge to the User entity.

func (*DrinkCreate) SetOwnerID

func (dc *DrinkCreate) SetOwnerID(id int) *DrinkCreate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*DrinkCreate) SetType

func (dc *DrinkCreate) SetType(d drink.Type) *DrinkCreate

SetType sets the "type" field.

func (*DrinkCreate) SetYear

func (dc *DrinkCreate) SetYear(i int) *DrinkCreate

SetYear sets the "year" field.

type DrinkCreateBulk

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

DrinkCreateBulk is the builder for creating many Drink entities in bulk.

func (*DrinkCreateBulk) Exec

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

Exec executes the query.

func (*DrinkCreateBulk) ExecX

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

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

func (*DrinkCreateBulk) Save

func (dcb *DrinkCreateBulk) Save(ctx context.Context) ([]*Drink, error)

Save creates the Drink entities in the database.

func (*DrinkCreateBulk) SaveX

func (dcb *DrinkCreateBulk) SaveX(ctx context.Context) []*Drink

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

type DrinkDelete

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

DrinkDelete is the builder for deleting a Drink entity.

func (*DrinkDelete) Exec

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

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

func (*DrinkDelete) ExecX

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

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

func (*DrinkDelete) Where

func (dd *DrinkDelete) Where(ps ...predicate.Drink) *DrinkDelete

Where appends a list predicates to the DrinkDelete builder.

type DrinkDeleteOne

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

DrinkDeleteOne is the builder for deleting a single Drink entity.

func (*DrinkDeleteOne) Exec

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

Exec executes the deletion query.

func (*DrinkDeleteOne) ExecX

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

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

func (*DrinkDeleteOne) Where

func (ddo *DrinkDeleteOne) Where(ps ...predicate.Drink) *DrinkDeleteOne

Where appends a list predicates to the DrinkDelete builder.

type DrinkEdges

type DrinkEdges struct {
	// Owner holds the value of the owner edge.
	Owner *User `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (DrinkEdges) OwnerOrErr

func (e DrinkEdges) OwnerOrErr() (*User, error)

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

type DrinkGroupBy

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

DrinkGroupBy is the group-by builder for Drink entities.

func (*DrinkGroupBy) Aggregate

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

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

func (*DrinkGroupBy) Bool

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

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

func (*DrinkGroupBy) BoolX

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

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

func (*DrinkGroupBy) Bools

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

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

func (*DrinkGroupBy) BoolsX

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

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

func (*DrinkGroupBy) Float64

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

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

func (*DrinkGroupBy) Float64X

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

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

func (*DrinkGroupBy) Float64s

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

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

func (*DrinkGroupBy) Float64sX

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

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

func (*DrinkGroupBy) Int

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

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

func (*DrinkGroupBy) IntX

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

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

func (*DrinkGroupBy) Ints

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

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

func (*DrinkGroupBy) IntsX

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

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

func (*DrinkGroupBy) Scan

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

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

func (*DrinkGroupBy) ScanX

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

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

func (*DrinkGroupBy) String

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

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

func (*DrinkGroupBy) StringX

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

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

func (*DrinkGroupBy) Strings

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

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

func (*DrinkGroupBy) StringsX

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

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

type DrinkMutation

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

DrinkMutation represents an operation that mutates the Drink nodes in the graph.

func (*DrinkMutation) Abv

func (m *DrinkMutation) Abv() (r int8, exists bool)

Abv returns the value of the "abv" field in the mutation.

func (*DrinkMutation) AddAbv

func (m *DrinkMutation) AddAbv(i int8)

AddAbv adds i to the "abv" field.

func (*DrinkMutation) AddDay

func (m *DrinkMutation) AddDay(i int)

AddDay adds i to the "day" field.

func (*DrinkMutation) AddField

func (m *DrinkMutation) 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 (*DrinkMutation) AddMonth

func (m *DrinkMutation) AddMonth(i int)

AddMonth adds i to the "month" field.

func (*DrinkMutation) AddOunces

func (m *DrinkMutation) AddOunces(i int8)

AddOunces adds i to the "ounces" field.

func (*DrinkMutation) AddYear

func (m *DrinkMutation) AddYear(i int)

AddYear adds i to the "year" field.

func (*DrinkMutation) AddedAbv

func (m *DrinkMutation) AddedAbv() (r int8, exists bool)

AddedAbv returns the value that was added to the "abv" field in this mutation.

func (*DrinkMutation) AddedDay

func (m *DrinkMutation) AddedDay() (r int, exists bool)

AddedDay returns the value that was added to the "day" field in this mutation.

func (*DrinkMutation) AddedEdges

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

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

func (*DrinkMutation) AddedField

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

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

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

func (*DrinkMutation) AddedIDs

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

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

func (*DrinkMutation) AddedMonth

func (m *DrinkMutation) AddedMonth() (r int, exists bool)

AddedMonth returns the value that was added to the "month" field in this mutation.

func (*DrinkMutation) AddedOunces

func (m *DrinkMutation) AddedOunces() (r int8, exists bool)

AddedOunces returns the value that was added to the "ounces" field in this mutation.

func (*DrinkMutation) AddedYear

func (m *DrinkMutation) AddedYear() (r int, exists bool)

AddedYear returns the value that was added to the "year" field in this mutation.

func (*DrinkMutation) ClearEdge

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

func (m *DrinkMutation) 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 (*DrinkMutation) ClearOwner

func (m *DrinkMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*DrinkMutation) ClearedEdges

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

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

func (*DrinkMutation) ClearedFields

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

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

func (DrinkMutation) Client

func (m DrinkMutation) 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 (*DrinkMutation) CreatedAt

func (m *DrinkMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*DrinkMutation) Day

func (m *DrinkMutation) Day() (r int, exists bool)

Day returns the value of the "day" field in the mutation.

func (*DrinkMutation) EdgeCleared

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

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

func (*DrinkMutation) Field

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

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

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

func (*DrinkMutation) Fields

func (m *DrinkMutation) 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 (*DrinkMutation) GetType

func (m *DrinkMutation) GetType() (r drink.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*DrinkMutation) ID

func (m *DrinkMutation) ID() (id int, exists bool)

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

func (*DrinkMutation) IDs

func (m *DrinkMutation) IDs(ctx context.Context) ([]int, error)

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

func (*DrinkMutation) Month

func (m *DrinkMutation) Month() (r int, exists bool)

Month returns the value of the "month" field in the mutation.

func (*DrinkMutation) Note

func (m *DrinkMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*DrinkMutation) OldAbv

func (m *DrinkMutation) OldAbv(ctx context.Context) (v int8, err error)

OldAbv returns the old "abv" field's value of the Drink entity. If the Drink 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 (*DrinkMutation) OldCreatedAt

func (m *DrinkMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Drink entity. If the Drink 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 (*DrinkMutation) OldDay

func (m *DrinkMutation) OldDay(ctx context.Context) (v int, err error)

OldDay returns the old "day" field's value of the Drink entity. If the Drink 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 (*DrinkMutation) OldField

func (m *DrinkMutation) 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 (*DrinkMutation) OldMonth

func (m *DrinkMutation) OldMonth(ctx context.Context) (v int, err error)

OldMonth returns the old "month" field's value of the Drink entity. If the Drink 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 (*DrinkMutation) OldNote

func (m *DrinkMutation) OldNote(ctx context.Context) (v string, err error)

OldNote returns the old "note" field's value of the Drink entity. If the Drink 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 (*DrinkMutation) OldOunces

func (m *DrinkMutation) OldOunces(ctx context.Context) (v int8, err error)

OldOunces returns the old "ounces" field's value of the Drink entity. If the Drink 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 (*DrinkMutation) OldType

func (m *DrinkMutation) OldType(ctx context.Context) (v drink.Type, err error)

OldType returns the old "type" field's value of the Drink entity. If the Drink 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 (*DrinkMutation) OldYear

func (m *DrinkMutation) OldYear(ctx context.Context) (v int, err error)

OldYear returns the old "year" field's value of the Drink entity. If the Drink 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 (*DrinkMutation) Op

func (m *DrinkMutation) Op() Op

Op returns the operation name.

func (*DrinkMutation) Ounces

func (m *DrinkMutation) Ounces() (r int8, exists bool)

Ounces returns the value of the "ounces" field in the mutation.

func (*DrinkMutation) OwnerCleared

func (m *DrinkMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*DrinkMutation) OwnerID

func (m *DrinkMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*DrinkMutation) OwnerIDs

func (m *DrinkMutation) OwnerIDs() (ids []int)

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

func (*DrinkMutation) RemovedEdges

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

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

func (*DrinkMutation) RemovedIDs

func (m *DrinkMutation) 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 (*DrinkMutation) ResetAbv

func (m *DrinkMutation) ResetAbv()

ResetAbv resets all changes to the "abv" field.

func (*DrinkMutation) ResetCreatedAt

func (m *DrinkMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DrinkMutation) ResetDay

func (m *DrinkMutation) ResetDay()

ResetDay resets all changes to the "day" field.

func (*DrinkMutation) ResetEdge

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

func (m *DrinkMutation) 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 (*DrinkMutation) ResetMonth

func (m *DrinkMutation) ResetMonth()

ResetMonth resets all changes to the "month" field.

func (*DrinkMutation) ResetNote

func (m *DrinkMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*DrinkMutation) ResetOunces

func (m *DrinkMutation) ResetOunces()

ResetOunces resets all changes to the "ounces" field.

func (*DrinkMutation) ResetOwner

func (m *DrinkMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*DrinkMutation) ResetType

func (m *DrinkMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*DrinkMutation) ResetYear

func (m *DrinkMutation) ResetYear()

ResetYear resets all changes to the "year" field.

func (*DrinkMutation) SetAbv

func (m *DrinkMutation) SetAbv(i int8)

SetAbv sets the "abv" field.

func (*DrinkMutation) SetCreatedAt

func (m *DrinkMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*DrinkMutation) SetDay

func (m *DrinkMutation) SetDay(i int)

SetDay sets the "day" field.

func (*DrinkMutation) SetField

func (m *DrinkMutation) 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 (*DrinkMutation) SetMonth

func (m *DrinkMutation) SetMonth(i int)

SetMonth sets the "month" field.

func (*DrinkMutation) SetNote

func (m *DrinkMutation) SetNote(s string)

SetNote sets the "note" field.

func (*DrinkMutation) SetOp

func (m *DrinkMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DrinkMutation) SetOunces

func (m *DrinkMutation) SetOunces(i int8)

SetOunces sets the "ounces" field.

func (*DrinkMutation) SetOwnerID

func (m *DrinkMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the User entity by id.

func (*DrinkMutation) SetType

func (m *DrinkMutation) SetType(d drink.Type)

SetType sets the "type" field.

func (*DrinkMutation) SetYear

func (m *DrinkMutation) SetYear(i int)

SetYear sets the "year" field.

func (DrinkMutation) Tx

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

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

func (*DrinkMutation) Type

func (m *DrinkMutation) Type() string

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

func (*DrinkMutation) Where

func (m *DrinkMutation) Where(ps ...predicate.Drink)

Where appends a list predicates to the DrinkMutation builder.

func (*DrinkMutation) WhereP

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

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

func (*DrinkMutation) Year

func (m *DrinkMutation) Year() (r int, exists bool)

Year returns the value of the "year" field in the mutation.

type DrinkQuery

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

DrinkQuery is the builder for querying Drink entities.

func (*DrinkQuery) Aggregate

func (dq *DrinkQuery) Aggregate(fns ...AggregateFunc) *DrinkSelect

Aggregate returns a DrinkSelect configured with the given aggregations.

func (*DrinkQuery) All

func (dq *DrinkQuery) All(ctx context.Context) ([]*Drink, error)

All executes the query and returns a list of Drinks.

func (*DrinkQuery) AllX

func (dq *DrinkQuery) AllX(ctx context.Context) []*Drink

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

func (*DrinkQuery) Clone

func (dq *DrinkQuery) Clone() *DrinkQuery

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

func (*DrinkQuery) Count

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

Count returns the count of the given query.

func (*DrinkQuery) CountX

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

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

func (*DrinkQuery) Exist

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

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

func (*DrinkQuery) ExistX

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

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

func (*DrinkQuery) First

func (dq *DrinkQuery) First(ctx context.Context) (*Drink, error)

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

func (*DrinkQuery) FirstID

func (dq *DrinkQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DrinkQuery) FirstIDX

func (dq *DrinkQuery) FirstIDX(ctx context.Context) int

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

func (*DrinkQuery) FirstX

func (dq *DrinkQuery) FirstX(ctx context.Context) *Drink

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

func (*DrinkQuery) GroupBy

func (dq *DrinkQuery) GroupBy(field string, fields ...string) *DrinkGroupBy

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 {
	Type drink.Type `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Drink.Query().
	GroupBy(drink.FieldType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DrinkQuery) IDs

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

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

func (*DrinkQuery) IDsX

func (dq *DrinkQuery) IDsX(ctx context.Context) []int

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

func (*DrinkQuery) Limit

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

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

func (*DrinkQuery) Offset

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

Offset to start from.

func (*DrinkQuery) Only

func (dq *DrinkQuery) Only(ctx context.Context) (*Drink, error)

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

func (*DrinkQuery) OnlyID

func (dq *DrinkQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DrinkQuery) OnlyIDX

func (dq *DrinkQuery) OnlyIDX(ctx context.Context) int

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

func (*DrinkQuery) OnlyX

func (dq *DrinkQuery) OnlyX(ctx context.Context) *Drink

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

func (*DrinkQuery) Order

func (dq *DrinkQuery) Order(o ...drink.OrderOption) *DrinkQuery

Order specifies how the records should be ordered.

func (*DrinkQuery) QueryOwner

func (dq *DrinkQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*DrinkQuery) Select

func (dq *DrinkQuery) Select(fields ...string) *DrinkSelect

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 {
	Type drink.Type `json:"type,omitempty"`
}

client.Drink.Query().
	Select(drink.FieldType).
	Scan(ctx, &v)

func (*DrinkQuery) Unique

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

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

func (dq *DrinkQuery) Where(ps ...predicate.Drink) *DrinkQuery

Where adds a new predicate for the DrinkQuery builder.

func (*DrinkQuery) WithOwner

func (dq *DrinkQuery) WithOwner(opts ...func(*UserQuery)) *DrinkQuery

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

type DrinkSelect

type DrinkSelect struct {
	*DrinkQuery
	// contains filtered or unexported fields
}

DrinkSelect is the builder for selecting fields of Drink entities.

func (*DrinkSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*DrinkSelect) Bool

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

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

func (*DrinkSelect) BoolX

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

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

func (*DrinkSelect) Bools

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

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

func (*DrinkSelect) BoolsX

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

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

func (*DrinkSelect) Float64

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

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

func (*DrinkSelect) Float64X

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

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

func (*DrinkSelect) Float64s

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

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

func (*DrinkSelect) Float64sX

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

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

func (*DrinkSelect) Int

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

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

func (*DrinkSelect) IntX

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

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

func (*DrinkSelect) Ints

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

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

func (*DrinkSelect) IntsX

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

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

func (*DrinkSelect) Scan

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

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

func (*DrinkSelect) ScanX

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

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

func (*DrinkSelect) String

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

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

func (*DrinkSelect) StringX

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

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

func (*DrinkSelect) Strings

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

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

func (*DrinkSelect) StringsX

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

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

type DrinkUpdate

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

DrinkUpdate is the builder for updating Drink entities.

func (*DrinkUpdate) AddAbv

func (du *DrinkUpdate) AddAbv(i int8) *DrinkUpdate

AddAbv adds i to the "abv" field.

func (*DrinkUpdate) AddDay

func (du *DrinkUpdate) AddDay(i int) *DrinkUpdate

AddDay adds i to the "day" field.

func (*DrinkUpdate) AddMonth

func (du *DrinkUpdate) AddMonth(i int) *DrinkUpdate

AddMonth adds i to the "month" field.

func (*DrinkUpdate) AddOunces

func (du *DrinkUpdate) AddOunces(i int8) *DrinkUpdate

AddOunces adds i to the "ounces" field.

func (*DrinkUpdate) AddYear

func (du *DrinkUpdate) AddYear(i int) *DrinkUpdate

AddYear adds i to the "year" field.

func (*DrinkUpdate) ClearOwner

func (du *DrinkUpdate) ClearOwner() *DrinkUpdate

ClearOwner clears the "owner" edge to the User entity.

func (*DrinkUpdate) Exec

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

Exec executes the query.

func (*DrinkUpdate) ExecX

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

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

func (*DrinkUpdate) Mutation

func (du *DrinkUpdate) Mutation() *DrinkMutation

Mutation returns the DrinkMutation object of the builder.

func (*DrinkUpdate) Save

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

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

func (*DrinkUpdate) SaveX

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

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

func (*DrinkUpdate) SetAbv

func (du *DrinkUpdate) SetAbv(i int8) *DrinkUpdate

SetAbv sets the "abv" field.

func (*DrinkUpdate) SetCreatedAt

func (du *DrinkUpdate) SetCreatedAt(t time.Time) *DrinkUpdate

SetCreatedAt sets the "created_at" field.

func (*DrinkUpdate) SetDay

func (du *DrinkUpdate) SetDay(i int) *DrinkUpdate

SetDay sets the "day" field.

func (*DrinkUpdate) SetMonth

func (du *DrinkUpdate) SetMonth(i int) *DrinkUpdate

SetMonth sets the "month" field.

func (*DrinkUpdate) SetNillableAbv

func (du *DrinkUpdate) SetNillableAbv(i *int8) *DrinkUpdate

SetNillableAbv sets the "abv" field if the given value is not nil.

func (*DrinkUpdate) SetNillableCreatedAt

func (du *DrinkUpdate) SetNillableCreatedAt(t *time.Time) *DrinkUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*DrinkUpdate) SetNillableDay

func (du *DrinkUpdate) SetNillableDay(i *int) *DrinkUpdate

SetNillableDay sets the "day" field if the given value is not nil.

func (*DrinkUpdate) SetNillableMonth

func (du *DrinkUpdate) SetNillableMonth(i *int) *DrinkUpdate

SetNillableMonth sets the "month" field if the given value is not nil.

func (*DrinkUpdate) SetNillableNote

func (du *DrinkUpdate) SetNillableNote(s *string) *DrinkUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*DrinkUpdate) SetNillableOunces

func (du *DrinkUpdate) SetNillableOunces(i *int8) *DrinkUpdate

SetNillableOunces sets the "ounces" field if the given value is not nil.

func (*DrinkUpdate) SetNillableOwnerID

func (du *DrinkUpdate) SetNillableOwnerID(id *int) *DrinkUpdate

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*DrinkUpdate) SetNillableType

func (du *DrinkUpdate) SetNillableType(d *drink.Type) *DrinkUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*DrinkUpdate) SetNillableYear

func (du *DrinkUpdate) SetNillableYear(i *int) *DrinkUpdate

SetNillableYear sets the "year" field if the given value is not nil.

func (*DrinkUpdate) SetNote

func (du *DrinkUpdate) SetNote(s string) *DrinkUpdate

SetNote sets the "note" field.

func (*DrinkUpdate) SetOunces

func (du *DrinkUpdate) SetOunces(i int8) *DrinkUpdate

SetOunces sets the "ounces" field.

func (*DrinkUpdate) SetOwner

func (du *DrinkUpdate) SetOwner(u *User) *DrinkUpdate

SetOwner sets the "owner" edge to the User entity.

func (*DrinkUpdate) SetOwnerID

func (du *DrinkUpdate) SetOwnerID(id int) *DrinkUpdate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*DrinkUpdate) SetType

func (du *DrinkUpdate) SetType(d drink.Type) *DrinkUpdate

SetType sets the "type" field.

func (*DrinkUpdate) SetYear

func (du *DrinkUpdate) SetYear(i int) *DrinkUpdate

SetYear sets the "year" field.

func (*DrinkUpdate) Where

func (du *DrinkUpdate) Where(ps ...predicate.Drink) *DrinkUpdate

Where appends a list predicates to the DrinkUpdate builder.

type DrinkUpdateOne

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

DrinkUpdateOne is the builder for updating a single Drink entity.

func (*DrinkUpdateOne) AddAbv

func (duo *DrinkUpdateOne) AddAbv(i int8) *DrinkUpdateOne

AddAbv adds i to the "abv" field.

func (*DrinkUpdateOne) AddDay

func (duo *DrinkUpdateOne) AddDay(i int) *DrinkUpdateOne

AddDay adds i to the "day" field.

func (*DrinkUpdateOne) AddMonth

func (duo *DrinkUpdateOne) AddMonth(i int) *DrinkUpdateOne

AddMonth adds i to the "month" field.

func (*DrinkUpdateOne) AddOunces

func (duo *DrinkUpdateOne) AddOunces(i int8) *DrinkUpdateOne

AddOunces adds i to the "ounces" field.

func (*DrinkUpdateOne) AddYear

func (duo *DrinkUpdateOne) AddYear(i int) *DrinkUpdateOne

AddYear adds i to the "year" field.

func (*DrinkUpdateOne) ClearOwner

func (duo *DrinkUpdateOne) ClearOwner() *DrinkUpdateOne

ClearOwner clears the "owner" edge to the User entity.

func (*DrinkUpdateOne) Exec

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

Exec executes the query on the entity.

func (*DrinkUpdateOne) ExecX

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

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

func (*DrinkUpdateOne) Mutation

func (duo *DrinkUpdateOne) Mutation() *DrinkMutation

Mutation returns the DrinkMutation object of the builder.

func (*DrinkUpdateOne) Save

func (duo *DrinkUpdateOne) Save(ctx context.Context) (*Drink, error)

Save executes the query and returns the updated Drink entity.

func (*DrinkUpdateOne) SaveX

func (duo *DrinkUpdateOne) SaveX(ctx context.Context) *Drink

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

func (*DrinkUpdateOne) Select

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

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

func (*DrinkUpdateOne) SetAbv

func (duo *DrinkUpdateOne) SetAbv(i int8) *DrinkUpdateOne

SetAbv sets the "abv" field.

func (*DrinkUpdateOne) SetCreatedAt

func (duo *DrinkUpdateOne) SetCreatedAt(t time.Time) *DrinkUpdateOne

SetCreatedAt sets the "created_at" field.

func (*DrinkUpdateOne) SetDay

func (duo *DrinkUpdateOne) SetDay(i int) *DrinkUpdateOne

SetDay sets the "day" field.

func (*DrinkUpdateOne) SetMonth

func (duo *DrinkUpdateOne) SetMonth(i int) *DrinkUpdateOne

SetMonth sets the "month" field.

func (*DrinkUpdateOne) SetNillableAbv

func (duo *DrinkUpdateOne) SetNillableAbv(i *int8) *DrinkUpdateOne

SetNillableAbv sets the "abv" field if the given value is not nil.

func (*DrinkUpdateOne) SetNillableCreatedAt

func (duo *DrinkUpdateOne) SetNillableCreatedAt(t *time.Time) *DrinkUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*DrinkUpdateOne) SetNillableDay

func (duo *DrinkUpdateOne) SetNillableDay(i *int) *DrinkUpdateOne

SetNillableDay sets the "day" field if the given value is not nil.

func (*DrinkUpdateOne) SetNillableMonth

func (duo *DrinkUpdateOne) SetNillableMonth(i *int) *DrinkUpdateOne

SetNillableMonth sets the "month" field if the given value is not nil.

func (*DrinkUpdateOne) SetNillableNote

func (duo *DrinkUpdateOne) SetNillableNote(s *string) *DrinkUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*DrinkUpdateOne) SetNillableOunces

func (duo *DrinkUpdateOne) SetNillableOunces(i *int8) *DrinkUpdateOne

SetNillableOunces sets the "ounces" field if the given value is not nil.

func (*DrinkUpdateOne) SetNillableOwnerID

func (duo *DrinkUpdateOne) SetNillableOwnerID(id *int) *DrinkUpdateOne

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*DrinkUpdateOne) SetNillableType

func (duo *DrinkUpdateOne) SetNillableType(d *drink.Type) *DrinkUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*DrinkUpdateOne) SetNillableYear

func (duo *DrinkUpdateOne) SetNillableYear(i *int) *DrinkUpdateOne

SetNillableYear sets the "year" field if the given value is not nil.

func (*DrinkUpdateOne) SetNote

func (duo *DrinkUpdateOne) SetNote(s string) *DrinkUpdateOne

SetNote sets the "note" field.

func (*DrinkUpdateOne) SetOunces

func (duo *DrinkUpdateOne) SetOunces(i int8) *DrinkUpdateOne

SetOunces sets the "ounces" field.

func (*DrinkUpdateOne) SetOwner

func (duo *DrinkUpdateOne) SetOwner(u *User) *DrinkUpdateOne

SetOwner sets the "owner" edge to the User entity.

func (*DrinkUpdateOne) SetOwnerID

func (duo *DrinkUpdateOne) SetOwnerID(id int) *DrinkUpdateOne

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*DrinkUpdateOne) SetType

func (duo *DrinkUpdateOne) SetType(d drink.Type) *DrinkUpdateOne

SetType sets the "type" field.

func (*DrinkUpdateOne) SetYear

func (duo *DrinkUpdateOne) SetYear(i int) *DrinkUpdateOne

SetYear sets the "year" field.

func (*DrinkUpdateOne) Where

func (duo *DrinkUpdateOne) Where(ps ...predicate.Drink) *DrinkUpdateOne

Where appends a list predicates to the DrinkUpdate builder.

type Drinks

type Drinks []*Drink

Drinks is a parsable slice of Drink.

type GroceryList

type GroceryList struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Note holds the value of the "note" field.
	Note string `json:"note,omitempty"`
	// Archived holds the value of the "archived" field.
	Archived bool `json:"archived,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroceryListQuery when eager-loading is set.
	Edges GroceryListEdges `json:"edges"`
	// contains filtered or unexported fields
}

GroceryList is the model entity for the GroceryList schema.

func (*GroceryList) QueryGroceryListItems

func (gl *GroceryList) QueryGroceryListItems() *GroceryListItemQuery

QueryGroceryListItems queries the "grocery_list_items" edge of the GroceryList entity.

func (*GroceryList) QueryGroceryListShares

func (gl *GroceryList) QueryGroceryListShares() *GroceryListShareQuery

QueryGroceryListShares queries the "grocery_list_shares" edge of the GroceryList entity.

func (*GroceryList) QueryOwner

func (gl *GroceryList) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the GroceryList entity.

func (*GroceryList) String

func (gl *GroceryList) String() string

String implements the fmt.Stringer.

func (*GroceryList) Unwrap

func (gl *GroceryList) Unwrap() *GroceryList

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

func (gl *GroceryList) Update() *GroceryListUpdateOne

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

func (*GroceryList) Value

func (gl *GroceryList) Value(name string) (ent.Value, error)

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

type GroceryListClient

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

GroceryListClient is a client for the GroceryList schema.

func NewGroceryListClient

func NewGroceryListClient(c config) *GroceryListClient

NewGroceryListClient returns a client for the GroceryList from the given config.

func (*GroceryListClient) Create

func (c *GroceryListClient) Create() *GroceryListCreate

Create returns a builder for creating a GroceryList entity.

func (*GroceryListClient) CreateBulk

func (c *GroceryListClient) CreateBulk(builders ...*GroceryListCreate) *GroceryListCreateBulk

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

func (*GroceryListClient) Delete

func (c *GroceryListClient) Delete() *GroceryListDelete

Delete returns a delete builder for GroceryList.

func (*GroceryListClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroceryListClient) DeleteOneID

func (c *GroceryListClient) DeleteOneID(id int) *GroceryListDeleteOne

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

func (*GroceryListClient) Get

func (c *GroceryListClient) Get(ctx context.Context, id int) (*GroceryList, error)

Get returns a GroceryList entity by its id.

func (*GroceryListClient) GetX

func (c *GroceryListClient) GetX(ctx context.Context, id int) *GroceryList

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

func (*GroceryListClient) Hooks

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

Hooks returns the client hooks.

func (*GroceryListClient) Intercept

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

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

func (*GroceryListClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GroceryListClient) Query

func (c *GroceryListClient) Query() *GroceryListQuery

Query returns a query builder for GroceryList.

func (*GroceryListClient) QueryGroceryListItems

func (c *GroceryListClient) QueryGroceryListItems(gl *GroceryList) *GroceryListItemQuery

QueryGroceryListItems queries the grocery_list_items edge of a GroceryList.

func (*GroceryListClient) QueryGroceryListShares

func (c *GroceryListClient) QueryGroceryListShares(gl *GroceryList) *GroceryListShareQuery

QueryGroceryListShares queries the grocery_list_shares edge of a GroceryList.

func (*GroceryListClient) QueryOwner

func (c *GroceryListClient) QueryOwner(gl *GroceryList) *UserQuery

QueryOwner queries the owner edge of a GroceryList.

func (*GroceryListClient) Update

func (c *GroceryListClient) Update() *GroceryListUpdate

Update returns an update builder for GroceryList.

func (*GroceryListClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroceryListClient) UpdateOneID

func (c *GroceryListClient) UpdateOneID(id int) *GroceryListUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroceryListClient) Use

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

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

type GroceryListCreate

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

GroceryListCreate is the builder for creating a GroceryList entity.

func (*GroceryListCreate) AddGroceryListItemIDs

func (glc *GroceryListCreate) AddGroceryListItemIDs(ids ...int) *GroceryListCreate

AddGroceryListItemIDs adds the "grocery_list_items" edge to the GroceryListItem entity by IDs.

func (*GroceryListCreate) AddGroceryListItems

func (glc *GroceryListCreate) AddGroceryListItems(g ...*GroceryListItem) *GroceryListCreate

AddGroceryListItems adds the "grocery_list_items" edges to the GroceryListItem entity.

func (*GroceryListCreate) AddGroceryListShareIDs

func (glc *GroceryListCreate) AddGroceryListShareIDs(ids ...int) *GroceryListCreate

AddGroceryListShareIDs adds the "grocery_list_shares" edge to the GroceryListShare entity by IDs.

func (*GroceryListCreate) AddGroceryListShares

func (glc *GroceryListCreate) AddGroceryListShares(g ...*GroceryListShare) *GroceryListCreate

AddGroceryListShares adds the "grocery_list_shares" edges to the GroceryListShare entity.

func (*GroceryListCreate) Exec

func (glc *GroceryListCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroceryListCreate) ExecX

func (glc *GroceryListCreate) ExecX(ctx context.Context)

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

func (*GroceryListCreate) Mutation

func (glc *GroceryListCreate) Mutation() *GroceryListMutation

Mutation returns the GroceryListMutation object of the builder.

func (*GroceryListCreate) Save

func (glc *GroceryListCreate) Save(ctx context.Context) (*GroceryList, error)

Save creates the GroceryList in the database.

func (*GroceryListCreate) SaveX

func (glc *GroceryListCreate) SaveX(ctx context.Context) *GroceryList

SaveX calls Save and panics if Save returns an error.

func (*GroceryListCreate) SetArchived

func (glc *GroceryListCreate) SetArchived(b bool) *GroceryListCreate

SetArchived sets the "archived" field.

func (*GroceryListCreate) SetCreatedAt

func (glc *GroceryListCreate) SetCreatedAt(t time.Time) *GroceryListCreate

SetCreatedAt sets the "created_at" field.

func (*GroceryListCreate) SetName

func (glc *GroceryListCreate) SetName(s string) *GroceryListCreate

SetName sets the "name" field.

func (*GroceryListCreate) SetNillableArchived

func (glc *GroceryListCreate) SetNillableArchived(b *bool) *GroceryListCreate

SetNillableArchived sets the "archived" field if the given value is not nil.

func (*GroceryListCreate) SetNillableCreatedAt

func (glc *GroceryListCreate) SetNillableCreatedAt(t *time.Time) *GroceryListCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroceryListCreate) SetNillableName

func (glc *GroceryListCreate) SetNillableName(s *string) *GroceryListCreate

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

func (*GroceryListCreate) SetNillableNote

func (glc *GroceryListCreate) SetNillableNote(s *string) *GroceryListCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*GroceryListCreate) SetNillableOwnerID

func (glc *GroceryListCreate) SetNillableOwnerID(id *int) *GroceryListCreate

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*GroceryListCreate) SetNote

func (glc *GroceryListCreate) SetNote(s string) *GroceryListCreate

SetNote sets the "note" field.

func (*GroceryListCreate) SetOwner

func (glc *GroceryListCreate) SetOwner(u *User) *GroceryListCreate

SetOwner sets the "owner" edge to the User entity.

func (*GroceryListCreate) SetOwnerID

func (glc *GroceryListCreate) SetOwnerID(id int) *GroceryListCreate

SetOwnerID sets the "owner" edge to the User entity by ID.

type GroceryListCreateBulk

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

GroceryListCreateBulk is the builder for creating many GroceryList entities in bulk.

func (*GroceryListCreateBulk) Exec

func (glcb *GroceryListCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroceryListCreateBulk) ExecX

func (glcb *GroceryListCreateBulk) ExecX(ctx context.Context)

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

func (*GroceryListCreateBulk) Save

func (glcb *GroceryListCreateBulk) Save(ctx context.Context) ([]*GroceryList, error)

Save creates the GroceryList entities in the database.

func (*GroceryListCreateBulk) SaveX

func (glcb *GroceryListCreateBulk) SaveX(ctx context.Context) []*GroceryList

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

type GroceryListDelete

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

GroceryListDelete is the builder for deleting a GroceryList entity.

func (*GroceryListDelete) Exec

func (gld *GroceryListDelete) Exec(ctx context.Context) (int, error)

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

func (*GroceryListDelete) ExecX

func (gld *GroceryListDelete) ExecX(ctx context.Context) int

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

func (*GroceryListDelete) Where

Where appends a list predicates to the GroceryListDelete builder.

type GroceryListDeleteOne

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

GroceryListDeleteOne is the builder for deleting a single GroceryList entity.

func (*GroceryListDeleteOne) Exec

func (gldo *GroceryListDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroceryListDeleteOne) ExecX

func (gldo *GroceryListDeleteOne) ExecX(ctx context.Context)

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

func (*GroceryListDeleteOne) Where

Where appends a list predicates to the GroceryListDelete builder.

type GroceryListEdges

type GroceryListEdges struct {
	// GroceryListItems holds the value of the grocery_list_items edge.
	GroceryListItems []*GroceryListItem `json:"grocery_list_items,omitempty"`
	// Owner holds the value of the owner edge.
	Owner *User `json:"owner,omitempty"`
	// GroceryListShares holds the value of the grocery_list_shares edge.
	GroceryListShares []*GroceryListShare `json:"grocery_list_shares,omitempty"`
	// contains filtered or unexported fields
}

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

func (GroceryListEdges) GroceryListItemsOrErr

func (e GroceryListEdges) GroceryListItemsOrErr() ([]*GroceryListItem, error)

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

func (GroceryListEdges) GroceryListSharesOrErr

func (e GroceryListEdges) GroceryListSharesOrErr() ([]*GroceryListShare, error)

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

func (GroceryListEdges) OwnerOrErr

func (e GroceryListEdges) OwnerOrErr() (*User, error)

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

type GroceryListGroupBy

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

GroceryListGroupBy is the group-by builder for GroceryList entities.

func (*GroceryListGroupBy) Aggregate

func (glgb *GroceryListGroupBy) Aggregate(fns ...AggregateFunc) *GroceryListGroupBy

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

func (*GroceryListGroupBy) Bool

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

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

func (*GroceryListGroupBy) BoolX

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

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

func (*GroceryListGroupBy) Bools

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

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

func (*GroceryListGroupBy) BoolsX

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

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

func (*GroceryListGroupBy) Float64

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

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

func (*GroceryListGroupBy) Float64X

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

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

func (*GroceryListGroupBy) Float64s

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

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

func (*GroceryListGroupBy) Float64sX

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

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

func (*GroceryListGroupBy) Int

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

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

func (*GroceryListGroupBy) IntX

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

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

func (*GroceryListGroupBy) Ints

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

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

func (*GroceryListGroupBy) IntsX

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

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

func (*GroceryListGroupBy) Scan

func (glgb *GroceryListGroupBy) Scan(ctx context.Context, v any) error

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

func (*GroceryListGroupBy) ScanX

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

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

func (*GroceryListGroupBy) String

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

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

func (*GroceryListGroupBy) StringX

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

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

func (*GroceryListGroupBy) Strings

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

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

func (*GroceryListGroupBy) StringsX

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

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

type GroceryListItem

type GroceryListItem struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Quantity holds the value of the "quantity" field.
	Quantity int `json:"quantity,omitempty"`
	// Note holds the value of the "note" field.
	Note string `json:"note,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroceryListItemQuery when eager-loading is set.
	Edges GroceryListItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

GroceryListItem is the model entity for the GroceryListItem schema.

func (*GroceryListItem) QueryGroceryList

func (gli *GroceryListItem) QueryGroceryList() *GroceryListQuery

QueryGroceryList queries the "grocery_list" edge of the GroceryListItem entity.

func (*GroceryListItem) String

func (gli *GroceryListItem) String() string

String implements the fmt.Stringer.

func (*GroceryListItem) Unwrap

func (gli *GroceryListItem) Unwrap() *GroceryListItem

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

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

func (*GroceryListItem) Value

func (gli *GroceryListItem) Value(name string) (ent.Value, error)

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

type GroceryListItemClient

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

GroceryListItemClient is a client for the GroceryListItem schema.

func NewGroceryListItemClient

func NewGroceryListItemClient(c config) *GroceryListItemClient

NewGroceryListItemClient returns a client for the GroceryListItem from the given config.

func (*GroceryListItemClient) Create

Create returns a builder for creating a GroceryListItem entity.

func (*GroceryListItemClient) CreateBulk

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

func (*GroceryListItemClient) Delete

Delete returns a delete builder for GroceryListItem.

func (*GroceryListItemClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroceryListItemClient) DeleteOneID

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

func (*GroceryListItemClient) Get

Get returns a GroceryListItem entity by its id.

func (*GroceryListItemClient) GetX

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

func (*GroceryListItemClient) Hooks

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

Hooks returns the client hooks.

func (*GroceryListItemClient) Intercept

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

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

func (*GroceryListItemClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GroceryListItemClient) Query

Query returns a query builder for GroceryListItem.

func (*GroceryListItemClient) QueryGroceryList

func (c *GroceryListItemClient) QueryGroceryList(gli *GroceryListItem) *GroceryListQuery

QueryGroceryList queries the grocery_list edge of a GroceryListItem.

func (*GroceryListItemClient) Update

Update returns an update builder for GroceryListItem.

func (*GroceryListItemClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroceryListItemClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*GroceryListItemClient) Use

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

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

type GroceryListItemCreate

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

GroceryListItemCreate is the builder for creating a GroceryListItem entity.

func (*GroceryListItemCreate) Exec

func (glic *GroceryListItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroceryListItemCreate) ExecX

func (glic *GroceryListItemCreate) ExecX(ctx context.Context)

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

func (*GroceryListItemCreate) Mutation

Mutation returns the GroceryListItemMutation object of the builder.

func (*GroceryListItemCreate) Save

Save creates the GroceryListItem in the database.

func (*GroceryListItemCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*GroceryListItemCreate) SetCreatedAt

func (glic *GroceryListItemCreate) SetCreatedAt(t time.Time) *GroceryListItemCreate

SetCreatedAt sets the "created_at" field.

func (*GroceryListItemCreate) SetGroceryList

func (glic *GroceryListItemCreate) SetGroceryList(g *GroceryList) *GroceryListItemCreate

SetGroceryList sets the "grocery_list" edge to the GroceryList entity.

func (*GroceryListItemCreate) SetGroceryListID

func (glic *GroceryListItemCreate) SetGroceryListID(id int) *GroceryListItemCreate

SetGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID.

func (*GroceryListItemCreate) SetName

SetName sets the "name" field.

func (*GroceryListItemCreate) SetNillableCreatedAt

func (glic *GroceryListItemCreate) SetNillableCreatedAt(t *time.Time) *GroceryListItemCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroceryListItemCreate) SetNillableGroceryListID

func (glic *GroceryListItemCreate) SetNillableGroceryListID(id *int) *GroceryListItemCreate

SetNillableGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID if the given value is not nil.

func (*GroceryListItemCreate) SetNillableNote

func (glic *GroceryListItemCreate) SetNillableNote(s *string) *GroceryListItemCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*GroceryListItemCreate) SetNillableQuantity

func (glic *GroceryListItemCreate) SetNillableQuantity(i *int) *GroceryListItemCreate

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

func (*GroceryListItemCreate) SetNote

SetNote sets the "note" field.

func (*GroceryListItemCreate) SetQuantity

func (glic *GroceryListItemCreate) SetQuantity(i int) *GroceryListItemCreate

SetQuantity sets the "quantity" field.

type GroceryListItemCreateBulk

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

GroceryListItemCreateBulk is the builder for creating many GroceryListItem entities in bulk.

func (*GroceryListItemCreateBulk) Exec

Exec executes the query.

func (*GroceryListItemCreateBulk) ExecX

func (glicb *GroceryListItemCreateBulk) ExecX(ctx context.Context)

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

func (*GroceryListItemCreateBulk) Save

Save creates the GroceryListItem entities in the database.

func (*GroceryListItemCreateBulk) SaveX

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

type GroceryListItemDelete

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

GroceryListItemDelete is the builder for deleting a GroceryListItem entity.

func (*GroceryListItemDelete) Exec

func (glid *GroceryListItemDelete) Exec(ctx context.Context) (int, error)

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

func (*GroceryListItemDelete) ExecX

func (glid *GroceryListItemDelete) ExecX(ctx context.Context) int

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

func (*GroceryListItemDelete) Where

Where appends a list predicates to the GroceryListItemDelete builder.

type GroceryListItemDeleteOne

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

GroceryListItemDeleteOne is the builder for deleting a single GroceryListItem entity.

func (*GroceryListItemDeleteOne) Exec

func (glido *GroceryListItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroceryListItemDeleteOne) ExecX

func (glido *GroceryListItemDeleteOne) ExecX(ctx context.Context)

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

func (*GroceryListItemDeleteOne) Where

Where appends a list predicates to the GroceryListItemDelete builder.

type GroceryListItemEdges

type GroceryListItemEdges struct {
	// GroceryList holds the value of the grocery_list edge.
	GroceryList *GroceryList `json:"grocery_list,omitempty"`
	// contains filtered or unexported fields
}

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

func (GroceryListItemEdges) GroceryListOrErr

func (e GroceryListItemEdges) GroceryListOrErr() (*GroceryList, error)

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

type GroceryListItemGroupBy

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

GroceryListItemGroupBy is the group-by builder for GroceryListItem entities.

func (*GroceryListItemGroupBy) Aggregate

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

func (*GroceryListItemGroupBy) Bool

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

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

func (*GroceryListItemGroupBy) BoolX

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

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

func (*GroceryListItemGroupBy) Bools

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

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

func (*GroceryListItemGroupBy) BoolsX

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

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

func (*GroceryListItemGroupBy) Float64

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

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

func (*GroceryListItemGroupBy) Float64X

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

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

func (*GroceryListItemGroupBy) Float64s

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

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

func (*GroceryListItemGroupBy) Float64sX

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

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

func (*GroceryListItemGroupBy) Int

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

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

func (*GroceryListItemGroupBy) IntX

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

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

func (*GroceryListItemGroupBy) Ints

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

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

func (*GroceryListItemGroupBy) IntsX

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

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

func (*GroceryListItemGroupBy) Scan

func (gligb *GroceryListItemGroupBy) Scan(ctx context.Context, v any) error

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

func (*GroceryListItemGroupBy) ScanX

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

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

func (*GroceryListItemGroupBy) String

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

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

func (*GroceryListItemGroupBy) StringX

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

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

func (*GroceryListItemGroupBy) Strings

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

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

func (*GroceryListItemGroupBy) StringsX

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

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

type GroceryListItemMutation

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

GroceryListItemMutation represents an operation that mutates the GroceryListItem nodes in the graph.

func (*GroceryListItemMutation) AddField

func (m *GroceryListItemMutation) 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 (*GroceryListItemMutation) AddQuantity

func (m *GroceryListItemMutation) AddQuantity(i int)

AddQuantity adds i to the "quantity" field.

func (*GroceryListItemMutation) AddedEdges

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

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

func (*GroceryListItemMutation) AddedField

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

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

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

func (*GroceryListItemMutation) AddedIDs

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

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

func (*GroceryListItemMutation) AddedQuantity

func (m *GroceryListItemMutation) AddedQuantity() (r int, exists bool)

AddedQuantity returns the value that was added to the "quantity" field in this mutation.

func (*GroceryListItemMutation) ClearEdge

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

func (m *GroceryListItemMutation) 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 (*GroceryListItemMutation) ClearGroceryList

func (m *GroceryListItemMutation) ClearGroceryList()

ClearGroceryList clears the "grocery_list" edge to the GroceryList entity.

func (*GroceryListItemMutation) ClearedEdges

func (m *GroceryListItemMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroceryListItemMutation) ClearedFields

func (m *GroceryListItemMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroceryListItemMutation) Client

func (m GroceryListItemMutation) 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 (*GroceryListItemMutation) CreatedAt

func (m *GroceryListItemMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*GroceryListItemMutation) EdgeCleared

func (m *GroceryListItemMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroceryListItemMutation) Field

func (m *GroceryListItemMutation) 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 (*GroceryListItemMutation) FieldCleared

func (m *GroceryListItemMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroceryListItemMutation) Fields

func (m *GroceryListItemMutation) 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 (*GroceryListItemMutation) GroceryListCleared

func (m *GroceryListItemMutation) GroceryListCleared() bool

GroceryListCleared reports if the "grocery_list" edge to the GroceryList entity was cleared.

func (*GroceryListItemMutation) GroceryListID

func (m *GroceryListItemMutation) GroceryListID() (id int, exists bool)

GroceryListID returns the "grocery_list" edge ID in the mutation.

func (*GroceryListItemMutation) GroceryListIDs

func (m *GroceryListItemMutation) GroceryListIDs() (ids []int)

GroceryListIDs returns the "grocery_list" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroceryListID instead. It exists only for internal usage by the builders.

func (*GroceryListItemMutation) ID

func (m *GroceryListItemMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*GroceryListItemMutation) IDs

func (m *GroceryListItemMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*GroceryListItemMutation) Name

func (m *GroceryListItemMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*GroceryListItemMutation) Note

func (m *GroceryListItemMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*GroceryListItemMutation) OldCreatedAt

func (m *GroceryListItemMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the GroceryListItem entity. If the GroceryListItem 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 (*GroceryListItemMutation) OldField

func (m *GroceryListItemMutation) 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 (*GroceryListItemMutation) OldName

func (m *GroceryListItemMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the GroceryListItem entity. If the GroceryListItem 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 (*GroceryListItemMutation) OldNote

func (m *GroceryListItemMutation) OldNote(ctx context.Context) (v string, err error)

OldNote returns the old "note" field's value of the GroceryListItem entity. If the GroceryListItem 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 (*GroceryListItemMutation) OldQuantity

func (m *GroceryListItemMutation) OldQuantity(ctx context.Context) (v int, err error)

OldQuantity returns the old "quantity" field's value of the GroceryListItem entity. If the GroceryListItem 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 (*GroceryListItemMutation) Op

func (m *GroceryListItemMutation) Op() Op

Op returns the operation name.

func (*GroceryListItemMutation) Quantity

func (m *GroceryListItemMutation) Quantity() (r int, exists bool)

Quantity returns the value of the "quantity" field in the mutation.

func (*GroceryListItemMutation) RemovedEdges

func (m *GroceryListItemMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroceryListItemMutation) RemovedIDs

func (m *GroceryListItemMutation) 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 (*GroceryListItemMutation) ResetCreatedAt

func (m *GroceryListItemMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GroceryListItemMutation) ResetEdge

func (m *GroceryListItemMutation) 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 (*GroceryListItemMutation) ResetField

func (m *GroceryListItemMutation) 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 (*GroceryListItemMutation) ResetGroceryList

func (m *GroceryListItemMutation) ResetGroceryList()

ResetGroceryList resets all changes to the "grocery_list" edge.

func (*GroceryListItemMutation) ResetName

func (m *GroceryListItemMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GroceryListItemMutation) ResetNote

func (m *GroceryListItemMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*GroceryListItemMutation) ResetQuantity

func (m *GroceryListItemMutation) ResetQuantity()

ResetQuantity resets all changes to the "quantity" field.

func (*GroceryListItemMutation) SetCreatedAt

func (m *GroceryListItemMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*GroceryListItemMutation) SetField

func (m *GroceryListItemMutation) 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 (*GroceryListItemMutation) SetGroceryListID

func (m *GroceryListItemMutation) SetGroceryListID(id int)

SetGroceryListID sets the "grocery_list" edge to the GroceryList entity by id.

func (*GroceryListItemMutation) SetName

func (m *GroceryListItemMutation) SetName(s string)

SetName sets the "name" field.

func (*GroceryListItemMutation) SetNote

func (m *GroceryListItemMutation) SetNote(s string)

SetNote sets the "note" field.

func (*GroceryListItemMutation) SetOp

func (m *GroceryListItemMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroceryListItemMutation) SetQuantity

func (m *GroceryListItemMutation) SetQuantity(i int)

SetQuantity sets the "quantity" field.

func (GroceryListItemMutation) Tx

func (m GroceryListItemMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroceryListItemMutation) Type

func (m *GroceryListItemMutation) Type() string

Type returns the node type of this mutation (GroceryListItem).

func (*GroceryListItemMutation) Where

Where appends a list predicates to the GroceryListItemMutation builder.

func (*GroceryListItemMutation) WhereP

func (m *GroceryListItemMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroceryListItemMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroceryListItemQuery

type GroceryListItemQuery struct {
	// contains filtered or unexported fields
}

GroceryListItemQuery is the builder for querying GroceryListItem entities.

func (*GroceryListItemQuery) Aggregate

func (gliq *GroceryListItemQuery) Aggregate(fns ...AggregateFunc) *GroceryListItemSelect

Aggregate returns a GroceryListItemSelect configured with the given aggregations.

func (*GroceryListItemQuery) All

All executes the query and returns a list of GroceryListItems.

func (*GroceryListItemQuery) AllX

AllX is like All, but panics if an error occurs.

func (*GroceryListItemQuery) Clone

Clone returns a duplicate of the GroceryListItemQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroceryListItemQuery) Count

func (gliq *GroceryListItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroceryListItemQuery) CountX

func (gliq *GroceryListItemQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroceryListItemQuery) Exist

func (gliq *GroceryListItemQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroceryListItemQuery) ExistX

func (gliq *GroceryListItemQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroceryListItemQuery) First

First returns the first GroceryListItem entity from the query. Returns a *NotFoundError when no GroceryListItem was found.

func (*GroceryListItemQuery) FirstID

func (gliq *GroceryListItemQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first GroceryListItem ID from the query. Returns a *NotFoundError when no GroceryListItem ID was found.

func (*GroceryListItemQuery) FirstIDX

func (gliq *GroceryListItemQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*GroceryListItemQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*GroceryListItemQuery) GroupBy

func (gliq *GroceryListItemQuery) GroupBy(field string, fields ...string) *GroceryListItemGroupBy

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.GroceryListItem.Query().
	GroupBy(grocerylistitem.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroceryListItemQuery) IDs

func (gliq *GroceryListItemQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of GroceryListItem IDs.

func (*GroceryListItemQuery) IDsX

func (gliq *GroceryListItemQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*GroceryListItemQuery) Limit

func (gliq *GroceryListItemQuery) Limit(limit int) *GroceryListItemQuery

Limit the number of records to be returned by this query.

func (*GroceryListItemQuery) Offset

func (gliq *GroceryListItemQuery) Offset(offset int) *GroceryListItemQuery

Offset to start from.

func (*GroceryListItemQuery) Only

Only returns a single GroceryListItem entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GroceryListItem entity is found. Returns a *NotFoundError when no GroceryListItem entities are found.

func (*GroceryListItemQuery) OnlyID

func (gliq *GroceryListItemQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only GroceryListItem ID in the query. Returns a *NotSingularError when more than one GroceryListItem ID is found. Returns a *NotFoundError when no entities are found.

func (*GroceryListItemQuery) OnlyIDX

func (gliq *GroceryListItemQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GroceryListItemQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*GroceryListItemQuery) Order

Order specifies how the records should be ordered.

func (*GroceryListItemQuery) QueryGroceryList

func (gliq *GroceryListItemQuery) QueryGroceryList() *GroceryListQuery

QueryGroceryList chains the current query on the "grocery_list" edge.

func (*GroceryListItemQuery) Select

func (gliq *GroceryListItemQuery) Select(fields ...string) *GroceryListItemSelect

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.GroceryListItem.Query().
	Select(grocerylistitem.FieldName).
	Scan(ctx, &v)

func (*GroceryListItemQuery) Unique

func (gliq *GroceryListItemQuery) Unique(unique bool) *GroceryListItemQuery

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 (*GroceryListItemQuery) Where

Where adds a new predicate for the GroceryListItemQuery builder.

func (*GroceryListItemQuery) WithGroceryList

func (gliq *GroceryListItemQuery) WithGroceryList(opts ...func(*GroceryListQuery)) *GroceryListItemQuery

WithGroceryList tells the query-builder to eager-load the nodes that are connected to the "grocery_list" edge. The optional arguments are used to configure the query builder of the edge.

type GroceryListItemSelect

type GroceryListItemSelect struct {
	*GroceryListItemQuery
	// contains filtered or unexported fields
}

GroceryListItemSelect is the builder for selecting fields of GroceryListItem entities.

func (*GroceryListItemSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*GroceryListItemSelect) Bool

func (s *GroceryListItemSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroceryListItemSelect) BoolX

func (s *GroceryListItemSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroceryListItemSelect) Bools

func (s *GroceryListItemSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroceryListItemSelect) BoolsX

func (s *GroceryListItemSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroceryListItemSelect) Float64

func (s *GroceryListItemSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroceryListItemSelect) Float64X

func (s *GroceryListItemSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroceryListItemSelect) Float64s

func (s *GroceryListItemSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroceryListItemSelect) Float64sX

func (s *GroceryListItemSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroceryListItemSelect) Int

func (s *GroceryListItemSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroceryListItemSelect) IntX

func (s *GroceryListItemSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroceryListItemSelect) Ints

func (s *GroceryListItemSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroceryListItemSelect) IntsX

func (s *GroceryListItemSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroceryListItemSelect) Scan

func (glis *GroceryListItemSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroceryListItemSelect) ScanX

func (s *GroceryListItemSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroceryListItemSelect) String

func (s *GroceryListItemSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroceryListItemSelect) StringX

func (s *GroceryListItemSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroceryListItemSelect) Strings

func (s *GroceryListItemSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroceryListItemSelect) StringsX

func (s *GroceryListItemSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroceryListItemUpdate

type GroceryListItemUpdate struct {
	// contains filtered or unexported fields
}

GroceryListItemUpdate is the builder for updating GroceryListItem entities.

func (*GroceryListItemUpdate) AddQuantity

func (gliu *GroceryListItemUpdate) AddQuantity(i int) *GroceryListItemUpdate

AddQuantity adds i to the "quantity" field.

func (*GroceryListItemUpdate) ClearGroceryList

func (gliu *GroceryListItemUpdate) ClearGroceryList() *GroceryListItemUpdate

ClearGroceryList clears the "grocery_list" edge to the GroceryList entity.

func (*GroceryListItemUpdate) Exec

func (gliu *GroceryListItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroceryListItemUpdate) ExecX

func (gliu *GroceryListItemUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroceryListItemUpdate) Mutation

Mutation returns the GroceryListItemMutation object of the builder.

func (*GroceryListItemUpdate) Save

func (gliu *GroceryListItemUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroceryListItemUpdate) SaveX

func (gliu *GroceryListItemUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroceryListItemUpdate) SetCreatedAt

func (gliu *GroceryListItemUpdate) SetCreatedAt(t time.Time) *GroceryListItemUpdate

SetCreatedAt sets the "created_at" field.

func (*GroceryListItemUpdate) SetGroceryList

func (gliu *GroceryListItemUpdate) SetGroceryList(g *GroceryList) *GroceryListItemUpdate

SetGroceryList sets the "grocery_list" edge to the GroceryList entity.

func (*GroceryListItemUpdate) SetGroceryListID

func (gliu *GroceryListItemUpdate) SetGroceryListID(id int) *GroceryListItemUpdate

SetGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID.

func (*GroceryListItemUpdate) SetName

SetName sets the "name" field.

func (*GroceryListItemUpdate) SetNillableCreatedAt

func (gliu *GroceryListItemUpdate) SetNillableCreatedAt(t *time.Time) *GroceryListItemUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroceryListItemUpdate) SetNillableGroceryListID

func (gliu *GroceryListItemUpdate) SetNillableGroceryListID(id *int) *GroceryListItemUpdate

SetNillableGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID if the given value is not nil.

func (*GroceryListItemUpdate) SetNillableNote

func (gliu *GroceryListItemUpdate) SetNillableNote(s *string) *GroceryListItemUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*GroceryListItemUpdate) SetNillableQuantity

func (gliu *GroceryListItemUpdate) SetNillableQuantity(i *int) *GroceryListItemUpdate

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*GroceryListItemUpdate) SetNote

SetNote sets the "note" field.

func (*GroceryListItemUpdate) SetQuantity

func (gliu *GroceryListItemUpdate) SetQuantity(i int) *GroceryListItemUpdate

SetQuantity sets the "quantity" field.

func (*GroceryListItemUpdate) Where

Where appends a list predicates to the GroceryListItemUpdate builder.

type GroceryListItemUpdateOne

type GroceryListItemUpdateOne struct {
	// contains filtered or unexported fields
}

GroceryListItemUpdateOne is the builder for updating a single GroceryListItem entity.

func (*GroceryListItemUpdateOne) AddQuantity

func (gliuo *GroceryListItemUpdateOne) AddQuantity(i int) *GroceryListItemUpdateOne

AddQuantity adds i to the "quantity" field.

func (*GroceryListItemUpdateOne) ClearGroceryList

func (gliuo *GroceryListItemUpdateOne) ClearGroceryList() *GroceryListItemUpdateOne

ClearGroceryList clears the "grocery_list" edge to the GroceryList entity.

func (*GroceryListItemUpdateOne) Exec

func (gliuo *GroceryListItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroceryListItemUpdateOne) ExecX

func (gliuo *GroceryListItemUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroceryListItemUpdateOne) Mutation

Mutation returns the GroceryListItemMutation object of the builder.

func (*GroceryListItemUpdateOne) Save

Save executes the query and returns the updated GroceryListItem entity.

func (*GroceryListItemUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*GroceryListItemUpdateOne) Select

func (gliuo *GroceryListItemUpdateOne) Select(field string, fields ...string) *GroceryListItemUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroceryListItemUpdateOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*GroceryListItemUpdateOne) SetGroceryList

SetGroceryList sets the "grocery_list" edge to the GroceryList entity.

func (*GroceryListItemUpdateOne) SetGroceryListID

func (gliuo *GroceryListItemUpdateOne) SetGroceryListID(id int) *GroceryListItemUpdateOne

SetGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID.

func (*GroceryListItemUpdateOne) SetName

SetName sets the "name" field.

func (*GroceryListItemUpdateOne) SetNillableCreatedAt

func (gliuo *GroceryListItemUpdateOne) SetNillableCreatedAt(t *time.Time) *GroceryListItemUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroceryListItemUpdateOne) SetNillableGroceryListID

func (gliuo *GroceryListItemUpdateOne) SetNillableGroceryListID(id *int) *GroceryListItemUpdateOne

SetNillableGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID if the given value is not nil.

func (*GroceryListItemUpdateOne) SetNillableNote

func (gliuo *GroceryListItemUpdateOne) SetNillableNote(s *string) *GroceryListItemUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*GroceryListItemUpdateOne) SetNillableQuantity

func (gliuo *GroceryListItemUpdateOne) SetNillableQuantity(i *int) *GroceryListItemUpdateOne

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*GroceryListItemUpdateOne) SetNote

SetNote sets the "note" field.

func (*GroceryListItemUpdateOne) SetQuantity

func (gliuo *GroceryListItemUpdateOne) SetQuantity(i int) *GroceryListItemUpdateOne

SetQuantity sets the "quantity" field.

func (*GroceryListItemUpdateOne) Where

Where appends a list predicates to the GroceryListItemUpdate builder.

type GroceryListItems

type GroceryListItems []*GroceryListItem

GroceryListItems is a parsable slice of GroceryListItem.

type GroceryListMutation

type GroceryListMutation struct {
	// contains filtered or unexported fields
}

GroceryListMutation represents an operation that mutates the GroceryList nodes in the graph.

func (*GroceryListMutation) AddField

func (m *GroceryListMutation) 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 (*GroceryListMutation) AddGroceryListItemIDs

func (m *GroceryListMutation) AddGroceryListItemIDs(ids ...int)

AddGroceryListItemIDs adds the "grocery_list_items" edge to the GroceryListItem entity by ids.

func (*GroceryListMutation) AddGroceryListShareIDs

func (m *GroceryListMutation) AddGroceryListShareIDs(ids ...int)

AddGroceryListShareIDs adds the "grocery_list_shares" edge to the GroceryListShare entity by ids.

func (*GroceryListMutation) AddedEdges

func (m *GroceryListMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroceryListMutation) AddedField

func (m *GroceryListMutation) 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 (*GroceryListMutation) AddedFields

func (m *GroceryListMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroceryListMutation) AddedIDs

func (m *GroceryListMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroceryListMutation) Archived

func (m *GroceryListMutation) Archived() (r bool, exists bool)

Archived returns the value of the "archived" field in the mutation.

func (*GroceryListMutation) ClearEdge

func (m *GroceryListMutation) 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 (*GroceryListMutation) ClearField

func (m *GroceryListMutation) 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 (*GroceryListMutation) ClearGroceryListItems

func (m *GroceryListMutation) ClearGroceryListItems()

ClearGroceryListItems clears the "grocery_list_items" edge to the GroceryListItem entity.

func (*GroceryListMutation) ClearGroceryListShares

func (m *GroceryListMutation) ClearGroceryListShares()

ClearGroceryListShares clears the "grocery_list_shares" edge to the GroceryListShare entity.

func (*GroceryListMutation) ClearOwner

func (m *GroceryListMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*GroceryListMutation) ClearedEdges

func (m *GroceryListMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroceryListMutation) ClearedFields

func (m *GroceryListMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroceryListMutation) Client

func (m GroceryListMutation) 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 (*GroceryListMutation) CreatedAt

func (m *GroceryListMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*GroceryListMutation) EdgeCleared

func (m *GroceryListMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroceryListMutation) Field

func (m *GroceryListMutation) 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 (*GroceryListMutation) FieldCleared

func (m *GroceryListMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroceryListMutation) Fields

func (m *GroceryListMutation) 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 (*GroceryListMutation) GroceryListItemsCleared

func (m *GroceryListMutation) GroceryListItemsCleared() bool

GroceryListItemsCleared reports if the "grocery_list_items" edge to the GroceryListItem entity was cleared.

func (*GroceryListMutation) GroceryListItemsIDs

func (m *GroceryListMutation) GroceryListItemsIDs() (ids []int)

GroceryListItemsIDs returns the "grocery_list_items" edge IDs in the mutation.

func (*GroceryListMutation) GroceryListSharesCleared

func (m *GroceryListMutation) GroceryListSharesCleared() bool

GroceryListSharesCleared reports if the "grocery_list_shares" edge to the GroceryListShare entity was cleared.

func (*GroceryListMutation) GroceryListSharesIDs

func (m *GroceryListMutation) GroceryListSharesIDs() (ids []int)

GroceryListSharesIDs returns the "grocery_list_shares" edge IDs in the mutation.

func (*GroceryListMutation) ID

func (m *GroceryListMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*GroceryListMutation) IDs

func (m *GroceryListMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*GroceryListMutation) Name

func (m *GroceryListMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*GroceryListMutation) Note

func (m *GroceryListMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*GroceryListMutation) OldArchived

func (m *GroceryListMutation) OldArchived(ctx context.Context) (v bool, err error)

OldArchived returns the old "archived" field's value of the GroceryList entity. If the GroceryList 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 (*GroceryListMutation) OldCreatedAt

func (m *GroceryListMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the GroceryList entity. If the GroceryList 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 (*GroceryListMutation) OldField

func (m *GroceryListMutation) 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 (*GroceryListMutation) OldName

func (m *GroceryListMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the GroceryList entity. If the GroceryList 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 (*GroceryListMutation) OldNote

func (m *GroceryListMutation) OldNote(ctx context.Context) (v string, err error)

OldNote returns the old "note" field's value of the GroceryList entity. If the GroceryList 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 (*GroceryListMutation) Op

func (m *GroceryListMutation) Op() Op

Op returns the operation name.

func (*GroceryListMutation) OwnerCleared

func (m *GroceryListMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*GroceryListMutation) OwnerID

func (m *GroceryListMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*GroceryListMutation) OwnerIDs

func (m *GroceryListMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.

func (*GroceryListMutation) RemoveGroceryListItemIDs

func (m *GroceryListMutation) RemoveGroceryListItemIDs(ids ...int)

RemoveGroceryListItemIDs removes the "grocery_list_items" edge to the GroceryListItem entity by IDs.

func (*GroceryListMutation) RemoveGroceryListShareIDs

func (m *GroceryListMutation) RemoveGroceryListShareIDs(ids ...int)

RemoveGroceryListShareIDs removes the "grocery_list_shares" edge to the GroceryListShare entity by IDs.

func (*GroceryListMutation) RemovedEdges

func (m *GroceryListMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroceryListMutation) RemovedGroceryListItemsIDs

func (m *GroceryListMutation) RemovedGroceryListItemsIDs() (ids []int)

RemovedGroceryListItems returns the removed IDs of the "grocery_list_items" edge to the GroceryListItem entity.

func (*GroceryListMutation) RemovedGroceryListSharesIDs

func (m *GroceryListMutation) RemovedGroceryListSharesIDs() (ids []int)

RemovedGroceryListShares returns the removed IDs of the "grocery_list_shares" edge to the GroceryListShare entity.

func (*GroceryListMutation) RemovedIDs

func (m *GroceryListMutation) 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 (*GroceryListMutation) ResetArchived

func (m *GroceryListMutation) ResetArchived()

ResetArchived resets all changes to the "archived" field.

func (*GroceryListMutation) ResetCreatedAt

func (m *GroceryListMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GroceryListMutation) ResetEdge

func (m *GroceryListMutation) 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 (*GroceryListMutation) ResetField

func (m *GroceryListMutation) 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 (*GroceryListMutation) ResetGroceryListItems

func (m *GroceryListMutation) ResetGroceryListItems()

ResetGroceryListItems resets all changes to the "grocery_list_items" edge.

func (*GroceryListMutation) ResetGroceryListShares

func (m *GroceryListMutation) ResetGroceryListShares()

ResetGroceryListShares resets all changes to the "grocery_list_shares" edge.

func (*GroceryListMutation) ResetName

func (m *GroceryListMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GroceryListMutation) ResetNote

func (m *GroceryListMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*GroceryListMutation) ResetOwner

func (m *GroceryListMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*GroceryListMutation) SetArchived

func (m *GroceryListMutation) SetArchived(b bool)

SetArchived sets the "archived" field.

func (*GroceryListMutation) SetCreatedAt

func (m *GroceryListMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*GroceryListMutation) SetField

func (m *GroceryListMutation) 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 (*GroceryListMutation) SetName

func (m *GroceryListMutation) SetName(s string)

SetName sets the "name" field.

func (*GroceryListMutation) SetNote

func (m *GroceryListMutation) SetNote(s string)

SetNote sets the "note" field.

func (*GroceryListMutation) SetOp

func (m *GroceryListMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroceryListMutation) SetOwnerID

func (m *GroceryListMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the User entity by id.

func (GroceryListMutation) Tx

func (m GroceryListMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroceryListMutation) Type

func (m *GroceryListMutation) Type() string

Type returns the node type of this mutation (GroceryList).

func (*GroceryListMutation) Where

func (m *GroceryListMutation) Where(ps ...predicate.GroceryList)

Where appends a list predicates to the GroceryListMutation builder.

func (*GroceryListMutation) WhereP

func (m *GroceryListMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroceryListMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroceryListQuery

type GroceryListQuery struct {
	// contains filtered or unexported fields
}

GroceryListQuery is the builder for querying GroceryList entities.

func (*GroceryListQuery) Aggregate

func (glq *GroceryListQuery) Aggregate(fns ...AggregateFunc) *GroceryListSelect

Aggregate returns a GroceryListSelect configured with the given aggregations.

func (*GroceryListQuery) All

func (glq *GroceryListQuery) All(ctx context.Context) ([]*GroceryList, error)

All executes the query and returns a list of GroceryLists.

func (*GroceryListQuery) AllX

func (glq *GroceryListQuery) AllX(ctx context.Context) []*GroceryList

AllX is like All, but panics if an error occurs.

func (*GroceryListQuery) Clone

func (glq *GroceryListQuery) Clone() *GroceryListQuery

Clone returns a duplicate of the GroceryListQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroceryListQuery) Count

func (glq *GroceryListQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroceryListQuery) CountX

func (glq *GroceryListQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroceryListQuery) Exist

func (glq *GroceryListQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroceryListQuery) ExistX

func (glq *GroceryListQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroceryListQuery) First

func (glq *GroceryListQuery) First(ctx context.Context) (*GroceryList, error)

First returns the first GroceryList entity from the query. Returns a *NotFoundError when no GroceryList was found.

func (*GroceryListQuery) FirstID

func (glq *GroceryListQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first GroceryList ID from the query. Returns a *NotFoundError when no GroceryList ID was found.

func (*GroceryListQuery) FirstIDX

func (glq *GroceryListQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*GroceryListQuery) FirstX

func (glq *GroceryListQuery) FirstX(ctx context.Context) *GroceryList

FirstX is like First, but panics if an error occurs.

func (*GroceryListQuery) GroupBy

func (glq *GroceryListQuery) GroupBy(field string, fields ...string) *GroceryListGroupBy

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.GroceryList.Query().
	GroupBy(grocerylist.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroceryListQuery) IDs

func (glq *GroceryListQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of GroceryList IDs.

func (*GroceryListQuery) IDsX

func (glq *GroceryListQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*GroceryListQuery) Limit

func (glq *GroceryListQuery) Limit(limit int) *GroceryListQuery

Limit the number of records to be returned by this query.

func (*GroceryListQuery) Offset

func (glq *GroceryListQuery) Offset(offset int) *GroceryListQuery

Offset to start from.

func (*GroceryListQuery) Only

func (glq *GroceryListQuery) Only(ctx context.Context) (*GroceryList, error)

Only returns a single GroceryList entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GroceryList entity is found. Returns a *NotFoundError when no GroceryList entities are found.

func (*GroceryListQuery) OnlyID

func (glq *GroceryListQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only GroceryList ID in the query. Returns a *NotSingularError when more than one GroceryList ID is found. Returns a *NotFoundError when no entities are found.

func (*GroceryListQuery) OnlyIDX

func (glq *GroceryListQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GroceryListQuery) OnlyX

func (glq *GroceryListQuery) OnlyX(ctx context.Context) *GroceryList

OnlyX is like Only, but panics if an error occurs.

func (*GroceryListQuery) Order

Order specifies how the records should be ordered.

func (*GroceryListQuery) QueryGroceryListItems

func (glq *GroceryListQuery) QueryGroceryListItems() *GroceryListItemQuery

QueryGroceryListItems chains the current query on the "grocery_list_items" edge.

func (*GroceryListQuery) QueryGroceryListShares

func (glq *GroceryListQuery) QueryGroceryListShares() *GroceryListShareQuery

QueryGroceryListShares chains the current query on the "grocery_list_shares" edge.

func (*GroceryListQuery) QueryOwner

func (glq *GroceryListQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*GroceryListQuery) Select

func (glq *GroceryListQuery) Select(fields ...string) *GroceryListSelect

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.GroceryList.Query().
	Select(grocerylist.FieldName).
	Scan(ctx, &v)

func (*GroceryListQuery) Unique

func (glq *GroceryListQuery) Unique(unique bool) *GroceryListQuery

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 (*GroceryListQuery) Where

Where adds a new predicate for the GroceryListQuery builder.

func (*GroceryListQuery) WithGroceryListItems

func (glq *GroceryListQuery) WithGroceryListItems(opts ...func(*GroceryListItemQuery)) *GroceryListQuery

WithGroceryListItems tells the query-builder to eager-load the nodes that are connected to the "grocery_list_items" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroceryListQuery) WithGroceryListShares

func (glq *GroceryListQuery) WithGroceryListShares(opts ...func(*GroceryListShareQuery)) *GroceryListQuery

WithGroceryListShares tells the query-builder to eager-load the nodes that are connected to the "grocery_list_shares" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroceryListQuery) WithOwner

func (glq *GroceryListQuery) WithOwner(opts ...func(*UserQuery)) *GroceryListQuery

WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.

type GroceryListSelect

type GroceryListSelect struct {
	*GroceryListQuery
	// contains filtered or unexported fields
}

GroceryListSelect is the builder for selecting fields of GroceryList entities.

func (*GroceryListSelect) Aggregate

func (gls *GroceryListSelect) Aggregate(fns ...AggregateFunc) *GroceryListSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GroceryListSelect) Bool

func (s *GroceryListSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroceryListSelect) BoolX

func (s *GroceryListSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroceryListSelect) Bools

func (s *GroceryListSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroceryListSelect) BoolsX

func (s *GroceryListSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroceryListSelect) Float64

func (s *GroceryListSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroceryListSelect) Float64X

func (s *GroceryListSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroceryListSelect) Float64s

func (s *GroceryListSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroceryListSelect) Float64sX

func (s *GroceryListSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroceryListSelect) Int

func (s *GroceryListSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroceryListSelect) IntX

func (s *GroceryListSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroceryListSelect) Ints

func (s *GroceryListSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroceryListSelect) IntsX

func (s *GroceryListSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroceryListSelect) Scan

func (gls *GroceryListSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroceryListSelect) ScanX

func (s *GroceryListSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroceryListSelect) String

func (s *GroceryListSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroceryListSelect) StringX

func (s *GroceryListSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroceryListSelect) Strings

func (s *GroceryListSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroceryListSelect) StringsX

func (s *GroceryListSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroceryListShare

type GroceryListShare struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CanEdit holds the value of the "can_edit" field.
	CanEdit bool `json:"can_edit,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroceryListShareQuery when eager-loading is set.
	Edges GroceryListShareEdges `json:"edges"`
	// contains filtered or unexported fields
}

GroceryListShare is the model entity for the GroceryListShare schema.

func (*GroceryListShare) QueryGroceryList

func (gls *GroceryListShare) QueryGroceryList() *GroceryListQuery

QueryGroceryList queries the "grocery_list" edge of the GroceryListShare entity.

func (*GroceryListShare) QueryUser

func (gls *GroceryListShare) QueryUser() *UserQuery

QueryUser queries the "user" edge of the GroceryListShare entity.

func (*GroceryListShare) String

func (gls *GroceryListShare) String() string

String implements the fmt.Stringer.

func (*GroceryListShare) Unwrap

func (gls *GroceryListShare) Unwrap() *GroceryListShare

Unwrap unwraps the GroceryListShare 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 (*GroceryListShare) Update

Update returns a builder for updating this GroceryListShare. Note that you need to call GroceryListShare.Unwrap() before calling this method if this GroceryListShare was returned from a transaction, and the transaction was committed or rolled back.

func (*GroceryListShare) Value

func (gls *GroceryListShare) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the GroceryListShare. This includes values selected through modifiers, order, etc.

type GroceryListShareClient

type GroceryListShareClient struct {
	// contains filtered or unexported fields
}

GroceryListShareClient is a client for the GroceryListShare schema.

func NewGroceryListShareClient

func NewGroceryListShareClient(c config) *GroceryListShareClient

NewGroceryListShareClient returns a client for the GroceryListShare from the given config.

func (*GroceryListShareClient) Create

Create returns a builder for creating a GroceryListShare entity.

func (*GroceryListShareClient) CreateBulk

CreateBulk returns a builder for creating a bulk of GroceryListShare entities.

func (*GroceryListShareClient) Delete

Delete returns a delete builder for GroceryListShare.

func (*GroceryListShareClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroceryListShareClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*GroceryListShareClient) Get

Get returns a GroceryListShare entity by its id.

func (*GroceryListShareClient) GetX

GetX is like Get, but panics if an error occurs.

func (*GroceryListShareClient) Hooks

func (c *GroceryListShareClient) Hooks() []Hook

Hooks returns the client hooks.

func (*GroceryListShareClient) Intercept

func (c *GroceryListShareClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `grocerylistshare.Intercept(f(g(h())))`.

func (*GroceryListShareClient) Interceptors

func (c *GroceryListShareClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*GroceryListShareClient) Query

Query returns a query builder for GroceryListShare.

func (*GroceryListShareClient) QueryGroceryList

func (c *GroceryListShareClient) QueryGroceryList(gls *GroceryListShare) *GroceryListQuery

QueryGroceryList queries the grocery_list edge of a GroceryListShare.

func (*GroceryListShareClient) QueryUser

QueryUser queries the user edge of a GroceryListShare.

func (*GroceryListShareClient) Update

Update returns an update builder for GroceryListShare.

func (*GroceryListShareClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroceryListShareClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*GroceryListShareClient) Use

func (c *GroceryListShareClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `grocerylistshare.Hooks(f(g(h())))`.

type GroceryListShareCreate

type GroceryListShareCreate struct {
	// contains filtered or unexported fields
}

GroceryListShareCreate is the builder for creating a GroceryListShare entity.

func (*GroceryListShareCreate) Exec

func (glsc *GroceryListShareCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroceryListShareCreate) ExecX

func (glsc *GroceryListShareCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroceryListShareCreate) Mutation

Mutation returns the GroceryListShareMutation object of the builder.

func (*GroceryListShareCreate) Save

Save creates the GroceryListShare in the database.

func (*GroceryListShareCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*GroceryListShareCreate) SetCanEdit

func (glsc *GroceryListShareCreate) SetCanEdit(b bool) *GroceryListShareCreate

SetCanEdit sets the "can_edit" field.

func (*GroceryListShareCreate) SetCreatedAt

func (glsc *GroceryListShareCreate) SetCreatedAt(t time.Time) *GroceryListShareCreate

SetCreatedAt sets the "created_at" field.

func (*GroceryListShareCreate) SetGroceryList

func (glsc *GroceryListShareCreate) SetGroceryList(g *GroceryList) *GroceryListShareCreate

SetGroceryList sets the "grocery_list" edge to the GroceryList entity.

func (*GroceryListShareCreate) SetGroceryListID

func (glsc *GroceryListShareCreate) SetGroceryListID(id int) *GroceryListShareCreate

SetGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID.

func (*GroceryListShareCreate) SetNillableCanEdit

func (glsc *GroceryListShareCreate) SetNillableCanEdit(b *bool) *GroceryListShareCreate

SetNillableCanEdit sets the "can_edit" field if the given value is not nil.

func (*GroceryListShareCreate) SetNillableCreatedAt

func (glsc *GroceryListShareCreate) SetNillableCreatedAt(t *time.Time) *GroceryListShareCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroceryListShareCreate) SetNillableGroceryListID

func (glsc *GroceryListShareCreate) SetNillableGroceryListID(id *int) *GroceryListShareCreate

SetNillableGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID if the given value is not nil.

func (*GroceryListShareCreate) SetNillableUserID

func (glsc *GroceryListShareCreate) SetNillableUserID(id *int) *GroceryListShareCreate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*GroceryListShareCreate) SetUser

SetUser sets the "user" edge to the User entity.

func (*GroceryListShareCreate) SetUserID

func (glsc *GroceryListShareCreate) SetUserID(id int) *GroceryListShareCreate

SetUserID sets the "user" edge to the User entity by ID.

type GroceryListShareCreateBulk

type GroceryListShareCreateBulk struct {
	// contains filtered or unexported fields
}

GroceryListShareCreateBulk is the builder for creating many GroceryListShare entities in bulk.

func (*GroceryListShareCreateBulk) Exec

Exec executes the query.

func (*GroceryListShareCreateBulk) ExecX

func (glscb *GroceryListShareCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroceryListShareCreateBulk) Save

Save creates the GroceryListShare entities in the database.

func (*GroceryListShareCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type GroceryListShareDelete

type GroceryListShareDelete struct {
	// contains filtered or unexported fields
}

GroceryListShareDelete is the builder for deleting a GroceryListShare entity.

func (*GroceryListShareDelete) Exec

func (glsd *GroceryListShareDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GroceryListShareDelete) ExecX

func (glsd *GroceryListShareDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GroceryListShareDelete) Where

Where appends a list predicates to the GroceryListShareDelete builder.

type GroceryListShareDeleteOne

type GroceryListShareDeleteOne struct {
	// contains filtered or unexported fields
}

GroceryListShareDeleteOne is the builder for deleting a single GroceryListShare entity.

func (*GroceryListShareDeleteOne) Exec

Exec executes the deletion query.

func (*GroceryListShareDeleteOne) ExecX

func (glsdo *GroceryListShareDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroceryListShareDeleteOne) Where

Where appends a list predicates to the GroceryListShareDelete builder.

type GroceryListShareEdges

type GroceryListShareEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// GroceryList holds the value of the grocery_list edge.
	GroceryList *GroceryList `json:"grocery_list,omitempty"`
	// contains filtered or unexported fields
}

GroceryListShareEdges holds the relations/edges for other nodes in the graph.

func (GroceryListShareEdges) GroceryListOrErr

func (e GroceryListShareEdges) GroceryListOrErr() (*GroceryList, error)

GroceryListOrErr returns the GroceryList value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (GroceryListShareEdges) UserOrErr

func (e GroceryListShareEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type GroceryListShareGroupBy

type GroceryListShareGroupBy struct {
	// contains filtered or unexported fields
}

GroceryListShareGroupBy is the group-by builder for GroceryListShare entities.

func (*GroceryListShareGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*GroceryListShareGroupBy) Bool

func (s *GroceryListShareGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroceryListShareGroupBy) BoolX

func (s *GroceryListShareGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroceryListShareGroupBy) Bools

func (s *GroceryListShareGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroceryListShareGroupBy) BoolsX

func (s *GroceryListShareGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroceryListShareGroupBy) Float64

func (s *GroceryListShareGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroceryListShareGroupBy) Float64X

func (s *GroceryListShareGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroceryListShareGroupBy) Float64s

func (s *GroceryListShareGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroceryListShareGroupBy) Float64sX

func (s *GroceryListShareGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroceryListShareGroupBy) Int

func (s *GroceryListShareGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroceryListShareGroupBy) IntX

func (s *GroceryListShareGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroceryListShareGroupBy) Ints

func (s *GroceryListShareGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroceryListShareGroupBy) IntsX

func (s *GroceryListShareGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroceryListShareGroupBy) Scan

func (glsgb *GroceryListShareGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroceryListShareGroupBy) ScanX

func (s *GroceryListShareGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroceryListShareGroupBy) String

func (s *GroceryListShareGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroceryListShareGroupBy) StringX

func (s *GroceryListShareGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroceryListShareGroupBy) Strings

func (s *GroceryListShareGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroceryListShareGroupBy) StringsX

func (s *GroceryListShareGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroceryListShareMutation

type GroceryListShareMutation struct {
	// contains filtered or unexported fields
}

GroceryListShareMutation represents an operation that mutates the GroceryListShare nodes in the graph.

func (*GroceryListShareMutation) AddField

func (m *GroceryListShareMutation) 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 (*GroceryListShareMutation) AddedEdges

func (m *GroceryListShareMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroceryListShareMutation) AddedField

func (m *GroceryListShareMutation) 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 (*GroceryListShareMutation) AddedFields

func (m *GroceryListShareMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroceryListShareMutation) AddedIDs

func (m *GroceryListShareMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroceryListShareMutation) CanEdit

func (m *GroceryListShareMutation) CanEdit() (r bool, exists bool)

CanEdit returns the value of the "can_edit" field in the mutation.

func (*GroceryListShareMutation) ClearEdge

func (m *GroceryListShareMutation) 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 (*GroceryListShareMutation) ClearField

func (m *GroceryListShareMutation) 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 (*GroceryListShareMutation) ClearGroceryList

func (m *GroceryListShareMutation) ClearGroceryList()

ClearGroceryList clears the "grocery_list" edge to the GroceryList entity.

func (*GroceryListShareMutation) ClearUser

func (m *GroceryListShareMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*GroceryListShareMutation) ClearedEdges

func (m *GroceryListShareMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroceryListShareMutation) ClearedFields

func (m *GroceryListShareMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroceryListShareMutation) Client

func (m GroceryListShareMutation) 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 (*GroceryListShareMutation) CreatedAt

func (m *GroceryListShareMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*GroceryListShareMutation) EdgeCleared

func (m *GroceryListShareMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroceryListShareMutation) Field

func (m *GroceryListShareMutation) 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 (*GroceryListShareMutation) FieldCleared

func (m *GroceryListShareMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroceryListShareMutation) Fields

func (m *GroceryListShareMutation) 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 (*GroceryListShareMutation) GroceryListCleared

func (m *GroceryListShareMutation) GroceryListCleared() bool

GroceryListCleared reports if the "grocery_list" edge to the GroceryList entity was cleared.

func (*GroceryListShareMutation) GroceryListID

func (m *GroceryListShareMutation) GroceryListID() (id int, exists bool)

GroceryListID returns the "grocery_list" edge ID in the mutation.

func (*GroceryListShareMutation) GroceryListIDs

func (m *GroceryListShareMutation) GroceryListIDs() (ids []int)

GroceryListIDs returns the "grocery_list" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroceryListID instead. It exists only for internal usage by the builders.

func (*GroceryListShareMutation) ID

func (m *GroceryListShareMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*GroceryListShareMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*GroceryListShareMutation) OldCanEdit

func (m *GroceryListShareMutation) OldCanEdit(ctx context.Context) (v bool, err error)

OldCanEdit returns the old "can_edit" field's value of the GroceryListShare entity. If the GroceryListShare 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 (*GroceryListShareMutation) OldCreatedAt

func (m *GroceryListShareMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the GroceryListShare entity. If the GroceryListShare 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 (*GroceryListShareMutation) OldField

func (m *GroceryListShareMutation) 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 (*GroceryListShareMutation) Op

func (m *GroceryListShareMutation) Op() Op

Op returns the operation name.

func (*GroceryListShareMutation) RemovedEdges

func (m *GroceryListShareMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroceryListShareMutation) RemovedIDs

func (m *GroceryListShareMutation) 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 (*GroceryListShareMutation) ResetCanEdit

func (m *GroceryListShareMutation) ResetCanEdit()

ResetCanEdit resets all changes to the "can_edit" field.

func (*GroceryListShareMutation) ResetCreatedAt

func (m *GroceryListShareMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GroceryListShareMutation) ResetEdge

func (m *GroceryListShareMutation) 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 (*GroceryListShareMutation) ResetField

func (m *GroceryListShareMutation) 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 (*GroceryListShareMutation) ResetGroceryList

func (m *GroceryListShareMutation) ResetGroceryList()

ResetGroceryList resets all changes to the "grocery_list" edge.

func (*GroceryListShareMutation) ResetUser

func (m *GroceryListShareMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*GroceryListShareMutation) SetCanEdit

func (m *GroceryListShareMutation) SetCanEdit(b bool)

SetCanEdit sets the "can_edit" field.

func (*GroceryListShareMutation) SetCreatedAt

func (m *GroceryListShareMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*GroceryListShareMutation) SetField

func (m *GroceryListShareMutation) 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 (*GroceryListShareMutation) SetGroceryListID

func (m *GroceryListShareMutation) SetGroceryListID(id int)

SetGroceryListID sets the "grocery_list" edge to the GroceryList entity by id.

func (*GroceryListShareMutation) SetOp

func (m *GroceryListShareMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroceryListShareMutation) SetUserID

func (m *GroceryListShareMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (GroceryListShareMutation) Tx

func (m GroceryListShareMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroceryListShareMutation) Type

func (m *GroceryListShareMutation) Type() string

Type returns the node type of this mutation (GroceryListShare).

func (*GroceryListShareMutation) UserCleared

func (m *GroceryListShareMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*GroceryListShareMutation) UserID

func (m *GroceryListShareMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*GroceryListShareMutation) UserIDs

func (m *GroceryListShareMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*GroceryListShareMutation) Where

Where appends a list predicates to the GroceryListShareMutation builder.

func (*GroceryListShareMutation) WhereP

func (m *GroceryListShareMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroceryListShareMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroceryListShareQuery

type GroceryListShareQuery struct {
	// contains filtered or unexported fields
}

GroceryListShareQuery is the builder for querying GroceryListShare entities.

func (*GroceryListShareQuery) Aggregate

Aggregate returns a GroceryListShareSelect configured with the given aggregations.

func (*GroceryListShareQuery) All

All executes the query and returns a list of GroceryListShares.

func (*GroceryListShareQuery) AllX

AllX is like All, but panics if an error occurs.

func (*GroceryListShareQuery) Clone

Clone returns a duplicate of the GroceryListShareQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroceryListShareQuery) Count

func (glsq *GroceryListShareQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroceryListShareQuery) CountX

func (glsq *GroceryListShareQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroceryListShareQuery) Exist

func (glsq *GroceryListShareQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroceryListShareQuery) ExistX

func (glsq *GroceryListShareQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroceryListShareQuery) First

First returns the first GroceryListShare entity from the query. Returns a *NotFoundError when no GroceryListShare was found.

func (*GroceryListShareQuery) FirstID

func (glsq *GroceryListShareQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first GroceryListShare ID from the query. Returns a *NotFoundError when no GroceryListShare ID was found.

func (*GroceryListShareQuery) FirstIDX

func (glsq *GroceryListShareQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*GroceryListShareQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*GroceryListShareQuery) GroupBy

func (glsq *GroceryListShareQuery) GroupBy(field string, fields ...string) *GroceryListShareGroupBy

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 {
	CanEdit bool `json:"can_edit,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GroceryListShare.Query().
	GroupBy(grocerylistshare.FieldCanEdit).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroceryListShareQuery) IDs

func (glsq *GroceryListShareQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of GroceryListShare IDs.

func (*GroceryListShareQuery) IDsX

func (glsq *GroceryListShareQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*GroceryListShareQuery) Limit

func (glsq *GroceryListShareQuery) Limit(limit int) *GroceryListShareQuery

Limit the number of records to be returned by this query.

func (*GroceryListShareQuery) Offset

func (glsq *GroceryListShareQuery) Offset(offset int) *GroceryListShareQuery

Offset to start from.

func (*GroceryListShareQuery) Only

Only returns a single GroceryListShare entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GroceryListShare entity is found. Returns a *NotFoundError when no GroceryListShare entities are found.

func (*GroceryListShareQuery) OnlyID

func (glsq *GroceryListShareQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only GroceryListShare ID in the query. Returns a *NotSingularError when more than one GroceryListShare ID is found. Returns a *NotFoundError when no entities are found.

func (*GroceryListShareQuery) OnlyIDX

func (glsq *GroceryListShareQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GroceryListShareQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*GroceryListShareQuery) Order

Order specifies how the records should be ordered.

func (*GroceryListShareQuery) QueryGroceryList

func (glsq *GroceryListShareQuery) QueryGroceryList() *GroceryListQuery

QueryGroceryList chains the current query on the "grocery_list" edge.

func (*GroceryListShareQuery) QueryUser

func (glsq *GroceryListShareQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*GroceryListShareQuery) Select

func (glsq *GroceryListShareQuery) Select(fields ...string) *GroceryListShareSelect

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 {
	CanEdit bool `json:"can_edit,omitempty"`
}

client.GroceryListShare.Query().
	Select(grocerylistshare.FieldCanEdit).
	Scan(ctx, &v)

func (*GroceryListShareQuery) Unique

func (glsq *GroceryListShareQuery) Unique(unique bool) *GroceryListShareQuery

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 (*GroceryListShareQuery) Where

Where adds a new predicate for the GroceryListShareQuery builder.

func (*GroceryListShareQuery) WithGroceryList

func (glsq *GroceryListShareQuery) WithGroceryList(opts ...func(*GroceryListQuery)) *GroceryListShareQuery

WithGroceryList tells the query-builder to eager-load the nodes that are connected to the "grocery_list" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroceryListShareQuery) WithUser

func (glsq *GroceryListShareQuery) WithUser(opts ...func(*UserQuery)) *GroceryListShareQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type GroceryListShareSelect

type GroceryListShareSelect struct {
	*GroceryListShareQuery
	// contains filtered or unexported fields
}

GroceryListShareSelect is the builder for selecting fields of GroceryListShare entities.

func (*GroceryListShareSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*GroceryListShareSelect) Bool

func (s *GroceryListShareSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroceryListShareSelect) BoolX

func (s *GroceryListShareSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroceryListShareSelect) Bools

func (s *GroceryListShareSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroceryListShareSelect) BoolsX

func (s *GroceryListShareSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroceryListShareSelect) Float64

func (s *GroceryListShareSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroceryListShareSelect) Float64X

func (s *GroceryListShareSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroceryListShareSelect) Float64s

func (s *GroceryListShareSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroceryListShareSelect) Float64sX

func (s *GroceryListShareSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroceryListShareSelect) Int

func (s *GroceryListShareSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroceryListShareSelect) IntX

func (s *GroceryListShareSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroceryListShareSelect) Ints

func (s *GroceryListShareSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroceryListShareSelect) IntsX

func (s *GroceryListShareSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroceryListShareSelect) Scan

func (glss *GroceryListShareSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroceryListShareSelect) ScanX

func (s *GroceryListShareSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroceryListShareSelect) String

func (s *GroceryListShareSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroceryListShareSelect) StringX

func (s *GroceryListShareSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroceryListShareSelect) Strings

func (s *GroceryListShareSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroceryListShareSelect) StringsX

func (s *GroceryListShareSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroceryListShareUpdate

type GroceryListShareUpdate struct {
	// contains filtered or unexported fields
}

GroceryListShareUpdate is the builder for updating GroceryListShare entities.

func (*GroceryListShareUpdate) ClearGroceryList

func (glsu *GroceryListShareUpdate) ClearGroceryList() *GroceryListShareUpdate

ClearGroceryList clears the "grocery_list" edge to the GroceryList entity.

func (*GroceryListShareUpdate) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*GroceryListShareUpdate) Exec

func (glsu *GroceryListShareUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroceryListShareUpdate) ExecX

func (glsu *GroceryListShareUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroceryListShareUpdate) Mutation

Mutation returns the GroceryListShareMutation object of the builder.

func (*GroceryListShareUpdate) Save

func (glsu *GroceryListShareUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroceryListShareUpdate) SaveX

func (glsu *GroceryListShareUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroceryListShareUpdate) SetCanEdit

func (glsu *GroceryListShareUpdate) SetCanEdit(b bool) *GroceryListShareUpdate

SetCanEdit sets the "can_edit" field.

func (*GroceryListShareUpdate) SetCreatedAt

func (glsu *GroceryListShareUpdate) SetCreatedAt(t time.Time) *GroceryListShareUpdate

SetCreatedAt sets the "created_at" field.

func (*GroceryListShareUpdate) SetGroceryList

func (glsu *GroceryListShareUpdate) SetGroceryList(g *GroceryList) *GroceryListShareUpdate

SetGroceryList sets the "grocery_list" edge to the GroceryList entity.

func (*GroceryListShareUpdate) SetGroceryListID

func (glsu *GroceryListShareUpdate) SetGroceryListID(id int) *GroceryListShareUpdate

SetGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID.

func (*GroceryListShareUpdate) SetNillableCanEdit

func (glsu *GroceryListShareUpdate) SetNillableCanEdit(b *bool) *GroceryListShareUpdate

SetNillableCanEdit sets the "can_edit" field if the given value is not nil.

func (*GroceryListShareUpdate) SetNillableCreatedAt

func (glsu *GroceryListShareUpdate) SetNillableCreatedAt(t *time.Time) *GroceryListShareUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroceryListShareUpdate) SetNillableGroceryListID

func (glsu *GroceryListShareUpdate) SetNillableGroceryListID(id *int) *GroceryListShareUpdate

SetNillableGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID if the given value is not nil.

func (*GroceryListShareUpdate) SetNillableUserID

func (glsu *GroceryListShareUpdate) SetNillableUserID(id *int) *GroceryListShareUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*GroceryListShareUpdate) SetUser

SetUser sets the "user" edge to the User entity.

func (*GroceryListShareUpdate) SetUserID

func (glsu *GroceryListShareUpdate) SetUserID(id int) *GroceryListShareUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*GroceryListShareUpdate) Where

Where appends a list predicates to the GroceryListShareUpdate builder.

type GroceryListShareUpdateOne

type GroceryListShareUpdateOne struct {
	// contains filtered or unexported fields
}

GroceryListShareUpdateOne is the builder for updating a single GroceryListShare entity.

func (*GroceryListShareUpdateOne) ClearGroceryList

func (glsuo *GroceryListShareUpdateOne) ClearGroceryList() *GroceryListShareUpdateOne

ClearGroceryList clears the "grocery_list" edge to the GroceryList entity.

func (*GroceryListShareUpdateOne) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*GroceryListShareUpdateOne) Exec

Exec executes the query on the entity.

func (*GroceryListShareUpdateOne) ExecX

func (glsuo *GroceryListShareUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroceryListShareUpdateOne) Mutation

Mutation returns the GroceryListShareMutation object of the builder.

func (*GroceryListShareUpdateOne) Save

Save executes the query and returns the updated GroceryListShare entity.

func (*GroceryListShareUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*GroceryListShareUpdateOne) Select

func (glsuo *GroceryListShareUpdateOne) Select(field string, fields ...string) *GroceryListShareUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroceryListShareUpdateOne) SetCanEdit

SetCanEdit sets the "can_edit" field.

func (*GroceryListShareUpdateOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*GroceryListShareUpdateOne) SetGroceryList

SetGroceryList sets the "grocery_list" edge to the GroceryList entity.

func (*GroceryListShareUpdateOne) SetGroceryListID

func (glsuo *GroceryListShareUpdateOne) SetGroceryListID(id int) *GroceryListShareUpdateOne

SetGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID.

func (*GroceryListShareUpdateOne) SetNillableCanEdit

func (glsuo *GroceryListShareUpdateOne) SetNillableCanEdit(b *bool) *GroceryListShareUpdateOne

SetNillableCanEdit sets the "can_edit" field if the given value is not nil.

func (*GroceryListShareUpdateOne) SetNillableCreatedAt

func (glsuo *GroceryListShareUpdateOne) SetNillableCreatedAt(t *time.Time) *GroceryListShareUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroceryListShareUpdateOne) SetNillableGroceryListID

func (glsuo *GroceryListShareUpdateOne) SetNillableGroceryListID(id *int) *GroceryListShareUpdateOne

SetNillableGroceryListID sets the "grocery_list" edge to the GroceryList entity by ID if the given value is not nil.

func (*GroceryListShareUpdateOne) SetNillableUserID

func (glsuo *GroceryListShareUpdateOne) SetNillableUserID(id *int) *GroceryListShareUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*GroceryListShareUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*GroceryListShareUpdateOne) SetUserID

SetUserID sets the "user" edge to the User entity by ID.

func (*GroceryListShareUpdateOne) Where

Where appends a list predicates to the GroceryListShareUpdate builder.

type GroceryListShares

type GroceryListShares []*GroceryListShare

GroceryListShares is a parsable slice of GroceryListShare.

type GroceryListUpdate

type GroceryListUpdate struct {
	// contains filtered or unexported fields
}

GroceryListUpdate is the builder for updating GroceryList entities.

func (*GroceryListUpdate) AddGroceryListItemIDs

func (glu *GroceryListUpdate) AddGroceryListItemIDs(ids ...int) *GroceryListUpdate

AddGroceryListItemIDs adds the "grocery_list_items" edge to the GroceryListItem entity by IDs.

func (*GroceryListUpdate) AddGroceryListItems

func (glu *GroceryListUpdate) AddGroceryListItems(g ...*GroceryListItem) *GroceryListUpdate

AddGroceryListItems adds the "grocery_list_items" edges to the GroceryListItem entity.

func (*GroceryListUpdate) AddGroceryListShareIDs

func (glu *GroceryListUpdate) AddGroceryListShareIDs(ids ...int) *GroceryListUpdate

AddGroceryListShareIDs adds the "grocery_list_shares" edge to the GroceryListShare entity by IDs.

func (*GroceryListUpdate) AddGroceryListShares

func (glu *GroceryListUpdate) AddGroceryListShares(g ...*GroceryListShare) *GroceryListUpdate

AddGroceryListShares adds the "grocery_list_shares" edges to the GroceryListShare entity.

func (*GroceryListUpdate) ClearGroceryListItems

func (glu *GroceryListUpdate) ClearGroceryListItems() *GroceryListUpdate

ClearGroceryListItems clears all "grocery_list_items" edges to the GroceryListItem entity.

func (*GroceryListUpdate) ClearGroceryListShares

func (glu *GroceryListUpdate) ClearGroceryListShares() *GroceryListUpdate

ClearGroceryListShares clears all "grocery_list_shares" edges to the GroceryListShare entity.

func (*GroceryListUpdate) ClearOwner

func (glu *GroceryListUpdate) ClearOwner() *GroceryListUpdate

ClearOwner clears the "owner" edge to the User entity.

func (*GroceryListUpdate) Exec

func (glu *GroceryListUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroceryListUpdate) ExecX

func (glu *GroceryListUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroceryListUpdate) Mutation

func (glu *GroceryListUpdate) Mutation() *GroceryListMutation

Mutation returns the GroceryListMutation object of the builder.

func (*GroceryListUpdate) RemoveGroceryListItemIDs

func (glu *GroceryListUpdate) RemoveGroceryListItemIDs(ids ...int) *GroceryListUpdate

RemoveGroceryListItemIDs removes the "grocery_list_items" edge to GroceryListItem entities by IDs.

func (*GroceryListUpdate) RemoveGroceryListItems

func (glu *GroceryListUpdate) RemoveGroceryListItems(g ...*GroceryListItem) *GroceryListUpdate

RemoveGroceryListItems removes "grocery_list_items" edges to GroceryListItem entities.

func (*GroceryListUpdate) RemoveGroceryListShareIDs

func (glu *GroceryListUpdate) RemoveGroceryListShareIDs(ids ...int) *GroceryListUpdate

RemoveGroceryListShareIDs removes the "grocery_list_shares" edge to GroceryListShare entities by IDs.

func (*GroceryListUpdate) RemoveGroceryListShares

func (glu *GroceryListUpdate) RemoveGroceryListShares(g ...*GroceryListShare) *GroceryListUpdate

RemoveGroceryListShares removes "grocery_list_shares" edges to GroceryListShare entities.

func (*GroceryListUpdate) Save

func (glu *GroceryListUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroceryListUpdate) SaveX

func (glu *GroceryListUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroceryListUpdate) SetArchived

func (glu *GroceryListUpdate) SetArchived(b bool) *GroceryListUpdate

SetArchived sets the "archived" field.

func (*GroceryListUpdate) SetCreatedAt

func (glu *GroceryListUpdate) SetCreatedAt(t time.Time) *GroceryListUpdate

SetCreatedAt sets the "created_at" field.

func (*GroceryListUpdate) SetName

func (glu *GroceryListUpdate) SetName(s string) *GroceryListUpdate

SetName sets the "name" field.

func (*GroceryListUpdate) SetNillableArchived

func (glu *GroceryListUpdate) SetNillableArchived(b *bool) *GroceryListUpdate

SetNillableArchived sets the "archived" field if the given value is not nil.

func (*GroceryListUpdate) SetNillableCreatedAt

func (glu *GroceryListUpdate) SetNillableCreatedAt(t *time.Time) *GroceryListUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroceryListUpdate) SetNillableName

func (glu *GroceryListUpdate) SetNillableName(s *string) *GroceryListUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*GroceryListUpdate) SetNillableNote

func (glu *GroceryListUpdate) SetNillableNote(s *string) *GroceryListUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*GroceryListUpdate) SetNillableOwnerID

func (glu *GroceryListUpdate) SetNillableOwnerID(id *int) *GroceryListUpdate

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*GroceryListUpdate) SetNote

func (glu *GroceryListUpdate) SetNote(s string) *GroceryListUpdate

SetNote sets the "note" field.

func (*GroceryListUpdate) SetOwner

func (glu *GroceryListUpdate) SetOwner(u *User) *GroceryListUpdate

SetOwner sets the "owner" edge to the User entity.

func (*GroceryListUpdate) SetOwnerID

func (glu *GroceryListUpdate) SetOwnerID(id int) *GroceryListUpdate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*GroceryListUpdate) Where

Where appends a list predicates to the GroceryListUpdate builder.

type GroceryListUpdateOne

type GroceryListUpdateOne struct {
	// contains filtered or unexported fields
}

GroceryListUpdateOne is the builder for updating a single GroceryList entity.

func (*GroceryListUpdateOne) AddGroceryListItemIDs

func (gluo *GroceryListUpdateOne) AddGroceryListItemIDs(ids ...int) *GroceryListUpdateOne

AddGroceryListItemIDs adds the "grocery_list_items" edge to the GroceryListItem entity by IDs.

func (*GroceryListUpdateOne) AddGroceryListItems

func (gluo *GroceryListUpdateOne) AddGroceryListItems(g ...*GroceryListItem) *GroceryListUpdateOne

AddGroceryListItems adds the "grocery_list_items" edges to the GroceryListItem entity.

func (*GroceryListUpdateOne) AddGroceryListShareIDs

func (gluo *GroceryListUpdateOne) AddGroceryListShareIDs(ids ...int) *GroceryListUpdateOne

AddGroceryListShareIDs adds the "grocery_list_shares" edge to the GroceryListShare entity by IDs.

func (*GroceryListUpdateOne) AddGroceryListShares

func (gluo *GroceryListUpdateOne) AddGroceryListShares(g ...*GroceryListShare) *GroceryListUpdateOne

AddGroceryListShares adds the "grocery_list_shares" edges to the GroceryListShare entity.

func (*GroceryListUpdateOne) ClearGroceryListItems

func (gluo *GroceryListUpdateOne) ClearGroceryListItems() *GroceryListUpdateOne

ClearGroceryListItems clears all "grocery_list_items" edges to the GroceryListItem entity.

func (*GroceryListUpdateOne) ClearGroceryListShares

func (gluo *GroceryListUpdateOne) ClearGroceryListShares() *GroceryListUpdateOne

ClearGroceryListShares clears all "grocery_list_shares" edges to the GroceryListShare entity.

func (*GroceryListUpdateOne) ClearOwner

func (gluo *GroceryListUpdateOne) ClearOwner() *GroceryListUpdateOne

ClearOwner clears the "owner" edge to the User entity.

func (*GroceryListUpdateOne) Exec

func (gluo *GroceryListUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroceryListUpdateOne) ExecX

func (gluo *GroceryListUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroceryListUpdateOne) Mutation

func (gluo *GroceryListUpdateOne) Mutation() *GroceryListMutation

Mutation returns the GroceryListMutation object of the builder.

func (*GroceryListUpdateOne) RemoveGroceryListItemIDs

func (gluo *GroceryListUpdateOne) RemoveGroceryListItemIDs(ids ...int) *GroceryListUpdateOne

RemoveGroceryListItemIDs removes the "grocery_list_items" edge to GroceryListItem entities by IDs.

func (*GroceryListUpdateOne) RemoveGroceryListItems

func (gluo *GroceryListUpdateOne) RemoveGroceryListItems(g ...*GroceryListItem) *GroceryListUpdateOne

RemoveGroceryListItems removes "grocery_list_items" edges to GroceryListItem entities.

func (*GroceryListUpdateOne) RemoveGroceryListShareIDs

func (gluo *GroceryListUpdateOne) RemoveGroceryListShareIDs(ids ...int) *GroceryListUpdateOne

RemoveGroceryListShareIDs removes the "grocery_list_shares" edge to GroceryListShare entities by IDs.

func (*GroceryListUpdateOne) RemoveGroceryListShares

func (gluo *GroceryListUpdateOne) RemoveGroceryListShares(g ...*GroceryListShare) *GroceryListUpdateOne

RemoveGroceryListShares removes "grocery_list_shares" edges to GroceryListShare entities.

func (*GroceryListUpdateOne) Save

Save executes the query and returns the updated GroceryList entity.

func (*GroceryListUpdateOne) SaveX

func (gluo *GroceryListUpdateOne) SaveX(ctx context.Context) *GroceryList

SaveX is like Save, but panics if an error occurs.

func (*GroceryListUpdateOne) Select

func (gluo *GroceryListUpdateOne) Select(field string, fields ...string) *GroceryListUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroceryListUpdateOne) SetArchived

func (gluo *GroceryListUpdateOne) SetArchived(b bool) *GroceryListUpdateOne

SetArchived sets the "archived" field.

func (*GroceryListUpdateOne) SetCreatedAt

func (gluo *GroceryListUpdateOne) SetCreatedAt(t time.Time) *GroceryListUpdateOne

SetCreatedAt sets the "created_at" field.

func (*GroceryListUpdateOne) SetName

SetName sets the "name" field.

func (*GroceryListUpdateOne) SetNillableArchived

func (gluo *GroceryListUpdateOne) SetNillableArchived(b *bool) *GroceryListUpdateOne

SetNillableArchived sets the "archived" field if the given value is not nil.

func (*GroceryListUpdateOne) SetNillableCreatedAt

func (gluo *GroceryListUpdateOne) SetNillableCreatedAt(t *time.Time) *GroceryListUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroceryListUpdateOne) SetNillableName

func (gluo *GroceryListUpdateOne) SetNillableName(s *string) *GroceryListUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*GroceryListUpdateOne) SetNillableNote

func (gluo *GroceryListUpdateOne) SetNillableNote(s *string) *GroceryListUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*GroceryListUpdateOne) SetNillableOwnerID

func (gluo *GroceryListUpdateOne) SetNillableOwnerID(id *int) *GroceryListUpdateOne

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*GroceryListUpdateOne) SetNote

SetNote sets the "note" field.

func (*GroceryListUpdateOne) SetOwner

func (gluo *GroceryListUpdateOne) SetOwner(u *User) *GroceryListUpdateOne

SetOwner sets the "owner" edge to the User entity.

func (*GroceryListUpdateOne) SetOwnerID

func (gluo *GroceryListUpdateOne) SetOwnerID(id int) *GroceryListUpdateOne

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*GroceryListUpdateOne) Where

Where appends a list predicates to the GroceryListUpdate builder.

type GroceryLists

type GroceryLists []*GroceryList

GroceryLists is a parsable slice of GroceryList.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type Movie

type Movie struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Note holds the value of the "note" field.
	Note string `json:"note,omitempty"`
	// Watched holds the value of the "watched" field.
	Watched bool `json:"watched,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MovieQuery when eager-loading is set.
	Edges MovieEdges `json:"edges"`
	// contains filtered or unexported fields
}

Movie is the model entity for the Movie schema.

func (*Movie) QueryMovieCollection

func (m *Movie) QueryMovieCollection() *MovieCollectionQuery

QueryMovieCollection queries the "movie_collection" edge of the Movie entity.

func (*Movie) String

func (m *Movie) String() string

String implements the fmt.Stringer.

func (*Movie) Unwrap

func (m *Movie) Unwrap() *Movie

Unwrap unwraps the Movie 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 (*Movie) Update

func (m *Movie) Update() *MovieUpdateOne

Update returns a builder for updating this Movie. Note that you need to call Movie.Unwrap() before calling this method if this Movie was returned from a transaction, and the transaction was committed or rolled back.

func (*Movie) Value

func (m *Movie) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Movie. This includes values selected through modifiers, order, etc.

type MovieClient

type MovieClient struct {
	// contains filtered or unexported fields
}

MovieClient is a client for the Movie schema.

func NewMovieClient

func NewMovieClient(c config) *MovieClient

NewMovieClient returns a client for the Movie from the given config.

func (*MovieClient) Create

func (c *MovieClient) Create() *MovieCreate

Create returns a builder for creating a Movie entity.

func (*MovieClient) CreateBulk

func (c *MovieClient) CreateBulk(builders ...*MovieCreate) *MovieCreateBulk

CreateBulk returns a builder for creating a bulk of Movie entities.

func (*MovieClient) Delete

func (c *MovieClient) Delete() *MovieDelete

Delete returns a delete builder for Movie.

func (*MovieClient) DeleteOne

func (c *MovieClient) DeleteOne(m *Movie) *MovieDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MovieClient) DeleteOneID

func (c *MovieClient) DeleteOneID(id int) *MovieDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MovieClient) Get

func (c *MovieClient) Get(ctx context.Context, id int) (*Movie, error)

Get returns a Movie entity by its id.

func (*MovieClient) GetX

func (c *MovieClient) GetX(ctx context.Context, id int) *Movie

GetX is like Get, but panics if an error occurs.

func (*MovieClient) Hooks

func (c *MovieClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MovieClient) Intercept

func (c *MovieClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `movie.Intercept(f(g(h())))`.

func (*MovieClient) Interceptors

func (c *MovieClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MovieClient) Query

func (c *MovieClient) Query() *MovieQuery

Query returns a query builder for Movie.

func (*MovieClient) QueryMovieCollection

func (c *MovieClient) QueryMovieCollection(m *Movie) *MovieCollectionQuery

QueryMovieCollection queries the movie_collection edge of a Movie.

func (*MovieClient) Update

func (c *MovieClient) Update() *MovieUpdate

Update returns an update builder for Movie.

func (*MovieClient) UpdateOne

func (c *MovieClient) UpdateOne(m *Movie) *MovieUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MovieClient) UpdateOneID

func (c *MovieClient) UpdateOneID(id int) *MovieUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MovieClient) Use

func (c *MovieClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `movie.Hooks(f(g(h())))`.

type MovieCollection

type MovieCollection struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Note holds the value of the "note" field.
	Note string `json:"note,omitempty"`
	// ShowWatched holds the value of the "show_watched" field.
	ShowWatched bool `json:"show_watched,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MovieCollectionQuery when eager-loading is set.
	Edges MovieCollectionEdges `json:"edges"`
	// contains filtered or unexported fields
}

MovieCollection is the model entity for the MovieCollection schema.

func (*MovieCollection) QueryMovieCollectionShares

func (mc *MovieCollection) QueryMovieCollectionShares() *MovieCollectionShareQuery

QueryMovieCollectionShares queries the "movie_collection_shares" edge of the MovieCollection entity.

func (*MovieCollection) QueryMovies

func (mc *MovieCollection) QueryMovies() *MovieQuery

QueryMovies queries the "movies" edge of the MovieCollection entity.

func (*MovieCollection) QueryOwner

func (mc *MovieCollection) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the MovieCollection entity.

func (*MovieCollection) String

func (mc *MovieCollection) String() string

String implements the fmt.Stringer.

func (*MovieCollection) Unwrap

func (mc *MovieCollection) Unwrap() *MovieCollection

Unwrap unwraps the MovieCollection 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 (*MovieCollection) Update

Update returns a builder for updating this MovieCollection. Note that you need to call MovieCollection.Unwrap() before calling this method if this MovieCollection was returned from a transaction, and the transaction was committed or rolled back.

func (*MovieCollection) Value

func (mc *MovieCollection) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the MovieCollection. This includes values selected through modifiers, order, etc.

type MovieCollectionClient

type MovieCollectionClient struct {
	// contains filtered or unexported fields
}

MovieCollectionClient is a client for the MovieCollection schema.

func NewMovieCollectionClient

func NewMovieCollectionClient(c config) *MovieCollectionClient

NewMovieCollectionClient returns a client for the MovieCollection from the given config.

func (*MovieCollectionClient) Create

Create returns a builder for creating a MovieCollection entity.

func (*MovieCollectionClient) CreateBulk

CreateBulk returns a builder for creating a bulk of MovieCollection entities.

func (*MovieCollectionClient) Delete

Delete returns a delete builder for MovieCollection.

func (*MovieCollectionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MovieCollectionClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MovieCollectionClient) Get

Get returns a MovieCollection entity by its id.

func (*MovieCollectionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*MovieCollectionClient) Hooks

func (c *MovieCollectionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MovieCollectionClient) Intercept

func (c *MovieCollectionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `moviecollection.Intercept(f(g(h())))`.

func (*MovieCollectionClient) Interceptors

func (c *MovieCollectionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MovieCollectionClient) Query

Query returns a query builder for MovieCollection.

func (*MovieCollectionClient) QueryMovieCollectionShares

func (c *MovieCollectionClient) QueryMovieCollectionShares(mc *MovieCollection) *MovieCollectionShareQuery

QueryMovieCollectionShares queries the movie_collection_shares edge of a MovieCollection.

func (*MovieCollectionClient) QueryMovies

func (c *MovieCollectionClient) QueryMovies(mc *MovieCollection) *MovieQuery

QueryMovies queries the movies edge of a MovieCollection.

func (*MovieCollectionClient) QueryOwner

func (c *MovieCollectionClient) QueryOwner(mc *MovieCollection) *UserQuery

QueryOwner queries the owner edge of a MovieCollection.

func (*MovieCollectionClient) Update

Update returns an update builder for MovieCollection.

func (*MovieCollectionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MovieCollectionClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*MovieCollectionClient) Use

func (c *MovieCollectionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `moviecollection.Hooks(f(g(h())))`.

type MovieCollectionCreate

type MovieCollectionCreate struct {
	// contains filtered or unexported fields
}

MovieCollectionCreate is the builder for creating a MovieCollection entity.

func (*MovieCollectionCreate) AddMovieCollectionShareIDs

func (mcc *MovieCollectionCreate) AddMovieCollectionShareIDs(ids ...int) *MovieCollectionCreate

AddMovieCollectionShareIDs adds the "movie_collection_shares" edge to the MovieCollectionShare entity by IDs.

func (*MovieCollectionCreate) AddMovieCollectionShares

func (mcc *MovieCollectionCreate) AddMovieCollectionShares(m ...*MovieCollectionShare) *MovieCollectionCreate

AddMovieCollectionShares adds the "movie_collection_shares" edges to the MovieCollectionShare entity.

func (*MovieCollectionCreate) AddMovieIDs

func (mcc *MovieCollectionCreate) AddMovieIDs(ids ...int) *MovieCollectionCreate

AddMovieIDs adds the "movies" edge to the Movie entity by IDs.

func (*MovieCollectionCreate) AddMovies

func (mcc *MovieCollectionCreate) AddMovies(m ...*Movie) *MovieCollectionCreate

AddMovies adds the "movies" edges to the Movie entity.

func (*MovieCollectionCreate) Exec

func (mcc *MovieCollectionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MovieCollectionCreate) ExecX

func (mcc *MovieCollectionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionCreate) Mutation

Mutation returns the MovieCollectionMutation object of the builder.

func (*MovieCollectionCreate) Save

Save creates the MovieCollection in the database.

func (*MovieCollectionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*MovieCollectionCreate) SetCreatedAt

func (mcc *MovieCollectionCreate) SetCreatedAt(t time.Time) *MovieCollectionCreate

SetCreatedAt sets the "created_at" field.

func (*MovieCollectionCreate) SetName

SetName sets the "name" field.

func (*MovieCollectionCreate) SetNillableCreatedAt

func (mcc *MovieCollectionCreate) SetNillableCreatedAt(t *time.Time) *MovieCollectionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MovieCollectionCreate) SetNillableName

func (mcc *MovieCollectionCreate) SetNillableName(s *string) *MovieCollectionCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*MovieCollectionCreate) SetNillableNote

func (mcc *MovieCollectionCreate) SetNillableNote(s *string) *MovieCollectionCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*MovieCollectionCreate) SetNillableOwnerID

func (mcc *MovieCollectionCreate) SetNillableOwnerID(id *int) *MovieCollectionCreate

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*MovieCollectionCreate) SetNillableShowWatched

func (mcc *MovieCollectionCreate) SetNillableShowWatched(b *bool) *MovieCollectionCreate

SetNillableShowWatched sets the "show_watched" field if the given value is not nil.

func (*MovieCollectionCreate) SetNote

SetNote sets the "note" field.

func (*MovieCollectionCreate) SetOwner

SetOwner sets the "owner" edge to the User entity.

func (*MovieCollectionCreate) SetOwnerID

func (mcc *MovieCollectionCreate) SetOwnerID(id int) *MovieCollectionCreate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*MovieCollectionCreate) SetShowWatched

func (mcc *MovieCollectionCreate) SetShowWatched(b bool) *MovieCollectionCreate

SetShowWatched sets the "show_watched" field.

type MovieCollectionCreateBulk

type MovieCollectionCreateBulk struct {
	// contains filtered or unexported fields
}

MovieCollectionCreateBulk is the builder for creating many MovieCollection entities in bulk.

func (*MovieCollectionCreateBulk) Exec

Exec executes the query.

func (*MovieCollectionCreateBulk) ExecX

func (mccb *MovieCollectionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionCreateBulk) Save

Save creates the MovieCollection entities in the database.

func (*MovieCollectionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type MovieCollectionDelete

type MovieCollectionDelete struct {
	// contains filtered or unexported fields
}

MovieCollectionDelete is the builder for deleting a MovieCollection entity.

func (*MovieCollectionDelete) Exec

func (mcd *MovieCollectionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MovieCollectionDelete) ExecX

func (mcd *MovieCollectionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionDelete) Where

Where appends a list predicates to the MovieCollectionDelete builder.

type MovieCollectionDeleteOne

type MovieCollectionDeleteOne struct {
	// contains filtered or unexported fields
}

MovieCollectionDeleteOne is the builder for deleting a single MovieCollection entity.

func (*MovieCollectionDeleteOne) Exec

Exec executes the deletion query.

func (*MovieCollectionDeleteOne) ExecX

func (mcdo *MovieCollectionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionDeleteOne) Where

Where appends a list predicates to the MovieCollectionDelete builder.

type MovieCollectionEdges

type MovieCollectionEdges struct {
	// Movies holds the value of the movies edge.
	Movies []*Movie `json:"movies,omitempty"`
	// Owner holds the value of the owner edge.
	Owner *User `json:"owner,omitempty"`
	// MovieCollectionShares holds the value of the movie_collection_shares edge.
	MovieCollectionShares []*MovieCollectionShare `json:"movie_collection_shares,omitempty"`
	// contains filtered or unexported fields
}

MovieCollectionEdges holds the relations/edges for other nodes in the graph.

func (MovieCollectionEdges) MovieCollectionSharesOrErr

func (e MovieCollectionEdges) MovieCollectionSharesOrErr() ([]*MovieCollectionShare, error)

MovieCollectionSharesOrErr returns the MovieCollectionShares value or an error if the edge was not loaded in eager-loading.

func (MovieCollectionEdges) MoviesOrErr

func (e MovieCollectionEdges) MoviesOrErr() ([]*Movie, error)

MoviesOrErr returns the Movies value or an error if the edge was not loaded in eager-loading.

func (MovieCollectionEdges) OwnerOrErr

func (e MovieCollectionEdges) OwnerOrErr() (*User, error)

OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MovieCollectionGroupBy

type MovieCollectionGroupBy struct {
	// contains filtered or unexported fields
}

MovieCollectionGroupBy is the group-by builder for MovieCollection entities.

func (*MovieCollectionGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*MovieCollectionGroupBy) Bool

func (s *MovieCollectionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MovieCollectionGroupBy) BoolX

func (s *MovieCollectionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MovieCollectionGroupBy) Bools

func (s *MovieCollectionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MovieCollectionGroupBy) BoolsX

func (s *MovieCollectionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MovieCollectionGroupBy) Float64

func (s *MovieCollectionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MovieCollectionGroupBy) Float64X

func (s *MovieCollectionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MovieCollectionGroupBy) Float64s

func (s *MovieCollectionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MovieCollectionGroupBy) Float64sX

func (s *MovieCollectionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MovieCollectionGroupBy) Int

func (s *MovieCollectionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MovieCollectionGroupBy) IntX

func (s *MovieCollectionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MovieCollectionGroupBy) Ints

func (s *MovieCollectionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MovieCollectionGroupBy) IntsX

func (s *MovieCollectionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MovieCollectionGroupBy) Scan

func (mcgb *MovieCollectionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MovieCollectionGroupBy) ScanX

func (s *MovieCollectionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MovieCollectionGroupBy) String

func (s *MovieCollectionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MovieCollectionGroupBy) StringX

func (s *MovieCollectionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MovieCollectionGroupBy) Strings

func (s *MovieCollectionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MovieCollectionGroupBy) StringsX

func (s *MovieCollectionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MovieCollectionMutation

type MovieCollectionMutation struct {
	// contains filtered or unexported fields
}

MovieCollectionMutation represents an operation that mutates the MovieCollection nodes in the graph.

func (*MovieCollectionMutation) AddField

func (m *MovieCollectionMutation) 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 (*MovieCollectionMutation) AddMovieCollectionShareIDs

func (m *MovieCollectionMutation) AddMovieCollectionShareIDs(ids ...int)

AddMovieCollectionShareIDs adds the "movie_collection_shares" edge to the MovieCollectionShare entity by ids.

func (*MovieCollectionMutation) AddMovieIDs

func (m *MovieCollectionMutation) AddMovieIDs(ids ...int)

AddMovieIDs adds the "movies" edge to the Movie entity by ids.

func (*MovieCollectionMutation) AddedEdges

func (m *MovieCollectionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MovieCollectionMutation) AddedField

func (m *MovieCollectionMutation) 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 (*MovieCollectionMutation) AddedFields

func (m *MovieCollectionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MovieCollectionMutation) AddedIDs

func (m *MovieCollectionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MovieCollectionMutation) ClearEdge

func (m *MovieCollectionMutation) 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 (*MovieCollectionMutation) ClearField

func (m *MovieCollectionMutation) 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 (*MovieCollectionMutation) ClearMovieCollectionShares

func (m *MovieCollectionMutation) ClearMovieCollectionShares()

ClearMovieCollectionShares clears the "movie_collection_shares" edge to the MovieCollectionShare entity.

func (*MovieCollectionMutation) ClearMovies

func (m *MovieCollectionMutation) ClearMovies()

ClearMovies clears the "movies" edge to the Movie entity.

func (*MovieCollectionMutation) ClearOwner

func (m *MovieCollectionMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*MovieCollectionMutation) ClearedEdges

func (m *MovieCollectionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MovieCollectionMutation) ClearedFields

func (m *MovieCollectionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MovieCollectionMutation) Client

func (m MovieCollectionMutation) 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 (*MovieCollectionMutation) CreatedAt

func (m *MovieCollectionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MovieCollectionMutation) EdgeCleared

func (m *MovieCollectionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MovieCollectionMutation) Field

func (m *MovieCollectionMutation) 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 (*MovieCollectionMutation) FieldCleared

func (m *MovieCollectionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MovieCollectionMutation) Fields

func (m *MovieCollectionMutation) 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 (*MovieCollectionMutation) ID

func (m *MovieCollectionMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MovieCollectionMutation) IDs

func (m *MovieCollectionMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MovieCollectionMutation) MovieCollectionSharesCleared

func (m *MovieCollectionMutation) MovieCollectionSharesCleared() bool

MovieCollectionSharesCleared reports if the "movie_collection_shares" edge to the MovieCollectionShare entity was cleared.

func (*MovieCollectionMutation) MovieCollectionSharesIDs

func (m *MovieCollectionMutation) MovieCollectionSharesIDs() (ids []int)

MovieCollectionSharesIDs returns the "movie_collection_shares" edge IDs in the mutation.

func (*MovieCollectionMutation) MoviesCleared

func (m *MovieCollectionMutation) MoviesCleared() bool

MoviesCleared reports if the "movies" edge to the Movie entity was cleared.

func (*MovieCollectionMutation) MoviesIDs

func (m *MovieCollectionMutation) MoviesIDs() (ids []int)

MoviesIDs returns the "movies" edge IDs in the mutation.

func (*MovieCollectionMutation) Name

func (m *MovieCollectionMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*MovieCollectionMutation) Note

func (m *MovieCollectionMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*MovieCollectionMutation) OldCreatedAt

func (m *MovieCollectionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the MovieCollection entity. If the MovieCollection 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 (*MovieCollectionMutation) OldField

func (m *MovieCollectionMutation) 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 (*MovieCollectionMutation) OldName

func (m *MovieCollectionMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the MovieCollection entity. If the MovieCollection 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 (*MovieCollectionMutation) OldNote

func (m *MovieCollectionMutation) OldNote(ctx context.Context) (v string, err error)

OldNote returns the old "note" field's value of the MovieCollection entity. If the MovieCollection 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 (*MovieCollectionMutation) OldShowWatched

func (m *MovieCollectionMutation) OldShowWatched(ctx context.Context) (v bool, err error)

OldShowWatched returns the old "show_watched" field's value of the MovieCollection entity. If the MovieCollection 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 (*MovieCollectionMutation) Op

func (m *MovieCollectionMutation) Op() Op

Op returns the operation name.

func (*MovieCollectionMutation) OwnerCleared

func (m *MovieCollectionMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*MovieCollectionMutation) OwnerID

func (m *MovieCollectionMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*MovieCollectionMutation) OwnerIDs

func (m *MovieCollectionMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.

func (*MovieCollectionMutation) RemoveMovieCollectionShareIDs

func (m *MovieCollectionMutation) RemoveMovieCollectionShareIDs(ids ...int)

RemoveMovieCollectionShareIDs removes the "movie_collection_shares" edge to the MovieCollectionShare entity by IDs.

func (*MovieCollectionMutation) RemoveMovieIDs

func (m *MovieCollectionMutation) RemoveMovieIDs(ids ...int)

RemoveMovieIDs removes the "movies" edge to the Movie entity by IDs.

func (*MovieCollectionMutation) RemovedEdges

func (m *MovieCollectionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MovieCollectionMutation) RemovedIDs

func (m *MovieCollectionMutation) 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 (*MovieCollectionMutation) RemovedMovieCollectionSharesIDs

func (m *MovieCollectionMutation) RemovedMovieCollectionSharesIDs() (ids []int)

RemovedMovieCollectionShares returns the removed IDs of the "movie_collection_shares" edge to the MovieCollectionShare entity.

func (*MovieCollectionMutation) RemovedMoviesIDs

func (m *MovieCollectionMutation) RemovedMoviesIDs() (ids []int)

RemovedMovies returns the removed IDs of the "movies" edge to the Movie entity.

func (*MovieCollectionMutation) ResetCreatedAt

func (m *MovieCollectionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MovieCollectionMutation) ResetEdge

func (m *MovieCollectionMutation) 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 (*MovieCollectionMutation) ResetField

func (m *MovieCollectionMutation) 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 (*MovieCollectionMutation) ResetMovieCollectionShares

func (m *MovieCollectionMutation) ResetMovieCollectionShares()

ResetMovieCollectionShares resets all changes to the "movie_collection_shares" edge.

func (*MovieCollectionMutation) ResetMovies

func (m *MovieCollectionMutation) ResetMovies()

ResetMovies resets all changes to the "movies" edge.

func (*MovieCollectionMutation) ResetName

func (m *MovieCollectionMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*MovieCollectionMutation) ResetNote

func (m *MovieCollectionMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*MovieCollectionMutation) ResetOwner

func (m *MovieCollectionMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*MovieCollectionMutation) ResetShowWatched

func (m *MovieCollectionMutation) ResetShowWatched()

ResetShowWatched resets all changes to the "show_watched" field.

func (*MovieCollectionMutation) SetCreatedAt

func (m *MovieCollectionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MovieCollectionMutation) SetField

func (m *MovieCollectionMutation) 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 (*MovieCollectionMutation) SetName

func (m *MovieCollectionMutation) SetName(s string)

SetName sets the "name" field.

func (*MovieCollectionMutation) SetNote

func (m *MovieCollectionMutation) SetNote(s string)

SetNote sets the "note" field.

func (*MovieCollectionMutation) SetOp

func (m *MovieCollectionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MovieCollectionMutation) SetOwnerID

func (m *MovieCollectionMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the User entity by id.

func (*MovieCollectionMutation) SetShowWatched

func (m *MovieCollectionMutation) SetShowWatched(b bool)

SetShowWatched sets the "show_watched" field.

func (*MovieCollectionMutation) ShowWatched

func (m *MovieCollectionMutation) ShowWatched() (r bool, exists bool)

ShowWatched returns the value of the "show_watched" field in the mutation.

func (MovieCollectionMutation) Tx

func (m MovieCollectionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MovieCollectionMutation) Type

func (m *MovieCollectionMutation) Type() string

Type returns the node type of this mutation (MovieCollection).

func (*MovieCollectionMutation) Where

Where appends a list predicates to the MovieCollectionMutation builder.

func (*MovieCollectionMutation) WhereP

func (m *MovieCollectionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MovieCollectionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MovieCollectionQuery

type MovieCollectionQuery struct {
	// contains filtered or unexported fields
}

MovieCollectionQuery is the builder for querying MovieCollection entities.

func (*MovieCollectionQuery) Aggregate

Aggregate returns a MovieCollectionSelect configured with the given aggregations.

func (*MovieCollectionQuery) All

All executes the query and returns a list of MovieCollections.

func (*MovieCollectionQuery) AllX

AllX is like All, but panics if an error occurs.

func (*MovieCollectionQuery) Clone

Clone returns a duplicate of the MovieCollectionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MovieCollectionQuery) Count

func (mcq *MovieCollectionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MovieCollectionQuery) CountX

func (mcq *MovieCollectionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MovieCollectionQuery) Exist

func (mcq *MovieCollectionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MovieCollectionQuery) ExistX

func (mcq *MovieCollectionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MovieCollectionQuery) First

First returns the first MovieCollection entity from the query. Returns a *NotFoundError when no MovieCollection was found.

func (*MovieCollectionQuery) FirstID

func (mcq *MovieCollectionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first MovieCollection ID from the query. Returns a *NotFoundError when no MovieCollection ID was found.

func (*MovieCollectionQuery) FirstIDX

func (mcq *MovieCollectionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MovieCollectionQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*MovieCollectionQuery) GroupBy

func (mcq *MovieCollectionQuery) GroupBy(field string, fields ...string) *MovieCollectionGroupBy

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.MovieCollection.Query().
	GroupBy(moviecollection.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MovieCollectionQuery) IDs

func (mcq *MovieCollectionQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of MovieCollection IDs.

func (*MovieCollectionQuery) IDsX

func (mcq *MovieCollectionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MovieCollectionQuery) Limit

func (mcq *MovieCollectionQuery) Limit(limit int) *MovieCollectionQuery

Limit the number of records to be returned by this query.

func (*MovieCollectionQuery) Offset

func (mcq *MovieCollectionQuery) Offset(offset int) *MovieCollectionQuery

Offset to start from.

func (*MovieCollectionQuery) Only

Only returns a single MovieCollection entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MovieCollection entity is found. Returns a *NotFoundError when no MovieCollection entities are found.

func (*MovieCollectionQuery) OnlyID

func (mcq *MovieCollectionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only MovieCollection ID in the query. Returns a *NotSingularError when more than one MovieCollection ID is found. Returns a *NotFoundError when no entities are found.

func (*MovieCollectionQuery) OnlyIDX

func (mcq *MovieCollectionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MovieCollectionQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*MovieCollectionQuery) Order

Order specifies how the records should be ordered.

func (*MovieCollectionQuery) QueryMovieCollectionShares

func (mcq *MovieCollectionQuery) QueryMovieCollectionShares() *MovieCollectionShareQuery

QueryMovieCollectionShares chains the current query on the "movie_collection_shares" edge.

func (*MovieCollectionQuery) QueryMovies

func (mcq *MovieCollectionQuery) QueryMovies() *MovieQuery

QueryMovies chains the current query on the "movies" edge.

func (*MovieCollectionQuery) QueryOwner

func (mcq *MovieCollectionQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*MovieCollectionQuery) Select

func (mcq *MovieCollectionQuery) Select(fields ...string) *MovieCollectionSelect

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.MovieCollection.Query().
	Select(moviecollection.FieldName).
	Scan(ctx, &v)

func (*MovieCollectionQuery) Unique

func (mcq *MovieCollectionQuery) Unique(unique bool) *MovieCollectionQuery

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 (*MovieCollectionQuery) Where

Where adds a new predicate for the MovieCollectionQuery builder.

func (*MovieCollectionQuery) WithMovieCollectionShares

func (mcq *MovieCollectionQuery) WithMovieCollectionShares(opts ...func(*MovieCollectionShareQuery)) *MovieCollectionQuery

WithMovieCollectionShares tells the query-builder to eager-load the nodes that are connected to the "movie_collection_shares" edge. The optional arguments are used to configure the query builder of the edge.

func (*MovieCollectionQuery) WithMovies

func (mcq *MovieCollectionQuery) WithMovies(opts ...func(*MovieQuery)) *MovieCollectionQuery

WithMovies tells the query-builder to eager-load the nodes that are connected to the "movies" edge. The optional arguments are used to configure the query builder of the edge.

func (*MovieCollectionQuery) WithOwner

func (mcq *MovieCollectionQuery) WithOwner(opts ...func(*UserQuery)) *MovieCollectionQuery

WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.

type MovieCollectionSelect

type MovieCollectionSelect struct {
	*MovieCollectionQuery
	// contains filtered or unexported fields
}

MovieCollectionSelect is the builder for selecting fields of MovieCollection entities.

func (*MovieCollectionSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*MovieCollectionSelect) Bool

func (s *MovieCollectionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MovieCollectionSelect) BoolX

func (s *MovieCollectionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MovieCollectionSelect) Bools

func (s *MovieCollectionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MovieCollectionSelect) BoolsX

func (s *MovieCollectionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MovieCollectionSelect) Float64

func (s *MovieCollectionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MovieCollectionSelect) Float64X

func (s *MovieCollectionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MovieCollectionSelect) Float64s

func (s *MovieCollectionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MovieCollectionSelect) Float64sX

func (s *MovieCollectionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MovieCollectionSelect) Int

func (s *MovieCollectionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MovieCollectionSelect) IntX

func (s *MovieCollectionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MovieCollectionSelect) Ints

func (s *MovieCollectionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MovieCollectionSelect) IntsX

func (s *MovieCollectionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MovieCollectionSelect) Scan

func (mcs *MovieCollectionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MovieCollectionSelect) ScanX

func (s *MovieCollectionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MovieCollectionSelect) String

func (s *MovieCollectionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MovieCollectionSelect) StringX

func (s *MovieCollectionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MovieCollectionSelect) Strings

func (s *MovieCollectionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MovieCollectionSelect) StringsX

func (s *MovieCollectionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MovieCollectionShare

type MovieCollectionShare struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CanEdit holds the value of the "can_edit" field.
	CanEdit bool `json:"can_edit,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MovieCollectionShareQuery when eager-loading is set.
	Edges MovieCollectionShareEdges `json:"edges"`
	// contains filtered or unexported fields
}

MovieCollectionShare is the model entity for the MovieCollectionShare schema.

func (*MovieCollectionShare) QueryMovieCollection

func (mcs *MovieCollectionShare) QueryMovieCollection() *MovieCollectionQuery

QueryMovieCollection queries the "movie_collection" edge of the MovieCollectionShare entity.

func (*MovieCollectionShare) QueryUser

func (mcs *MovieCollectionShare) QueryUser() *UserQuery

QueryUser queries the "user" edge of the MovieCollectionShare entity.

func (*MovieCollectionShare) String

func (mcs *MovieCollectionShare) String() string

String implements the fmt.Stringer.

func (*MovieCollectionShare) Unwrap

Unwrap unwraps the MovieCollectionShare 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 (*MovieCollectionShare) Update

Update returns a builder for updating this MovieCollectionShare. Note that you need to call MovieCollectionShare.Unwrap() before calling this method if this MovieCollectionShare was returned from a transaction, and the transaction was committed or rolled back.

func (*MovieCollectionShare) Value

func (mcs *MovieCollectionShare) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the MovieCollectionShare. This includes values selected through modifiers, order, etc.

type MovieCollectionShareClient

type MovieCollectionShareClient struct {
	// contains filtered or unexported fields
}

MovieCollectionShareClient is a client for the MovieCollectionShare schema.

func NewMovieCollectionShareClient

func NewMovieCollectionShareClient(c config) *MovieCollectionShareClient

NewMovieCollectionShareClient returns a client for the MovieCollectionShare from the given config.

func (*MovieCollectionShareClient) Create

Create returns a builder for creating a MovieCollectionShare entity.

func (*MovieCollectionShareClient) CreateBulk

CreateBulk returns a builder for creating a bulk of MovieCollectionShare entities.

func (*MovieCollectionShareClient) Delete

Delete returns a delete builder for MovieCollectionShare.

func (*MovieCollectionShareClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MovieCollectionShareClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MovieCollectionShareClient) Get

Get returns a MovieCollectionShare entity by its id.

func (*MovieCollectionShareClient) GetX

GetX is like Get, but panics if an error occurs.

func (*MovieCollectionShareClient) Hooks

func (c *MovieCollectionShareClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MovieCollectionShareClient) Intercept

func (c *MovieCollectionShareClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `moviecollectionshare.Intercept(f(g(h())))`.

func (*MovieCollectionShareClient) Interceptors

func (c *MovieCollectionShareClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MovieCollectionShareClient) Query

Query returns a query builder for MovieCollectionShare.

func (*MovieCollectionShareClient) QueryMovieCollection

QueryMovieCollection queries the movie_collection edge of a MovieCollectionShare.

func (*MovieCollectionShareClient) QueryUser

QueryUser queries the user edge of a MovieCollectionShare.

func (*MovieCollectionShareClient) Update

Update returns an update builder for MovieCollectionShare.

func (*MovieCollectionShareClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MovieCollectionShareClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*MovieCollectionShareClient) Use

func (c *MovieCollectionShareClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `moviecollectionshare.Hooks(f(g(h())))`.

type MovieCollectionShareCreate

type MovieCollectionShareCreate struct {
	// contains filtered or unexported fields
}

MovieCollectionShareCreate is the builder for creating a MovieCollectionShare entity.

func (*MovieCollectionShareCreate) Exec

Exec executes the query.

func (*MovieCollectionShareCreate) ExecX

func (mcsc *MovieCollectionShareCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionShareCreate) Mutation

Mutation returns the MovieCollectionShareMutation object of the builder.

func (*MovieCollectionShareCreate) Save

Save creates the MovieCollectionShare in the database.

func (*MovieCollectionShareCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*MovieCollectionShareCreate) SetCanEdit

SetCanEdit sets the "can_edit" field.

func (*MovieCollectionShareCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*MovieCollectionShareCreate) SetMovieCollection

SetMovieCollection sets the "movie_collection" edge to the MovieCollection entity.

func (*MovieCollectionShareCreate) SetMovieCollectionID

func (mcsc *MovieCollectionShareCreate) SetMovieCollectionID(id int) *MovieCollectionShareCreate

SetMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID.

func (*MovieCollectionShareCreate) SetNillableCanEdit

func (mcsc *MovieCollectionShareCreate) SetNillableCanEdit(b *bool) *MovieCollectionShareCreate

SetNillableCanEdit sets the "can_edit" field if the given value is not nil.

func (*MovieCollectionShareCreate) SetNillableCreatedAt

func (mcsc *MovieCollectionShareCreate) SetNillableCreatedAt(t *time.Time) *MovieCollectionShareCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MovieCollectionShareCreate) SetNillableMovieCollectionID

func (mcsc *MovieCollectionShareCreate) SetNillableMovieCollectionID(id *int) *MovieCollectionShareCreate

SetNillableMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID if the given value is not nil.

func (*MovieCollectionShareCreate) SetNillableUserID

func (mcsc *MovieCollectionShareCreate) SetNillableUserID(id *int) *MovieCollectionShareCreate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*MovieCollectionShareCreate) SetUser

SetUser sets the "user" edge to the User entity.

func (*MovieCollectionShareCreate) SetUserID

SetUserID sets the "user" edge to the User entity by ID.

type MovieCollectionShareCreateBulk

type MovieCollectionShareCreateBulk struct {
	// contains filtered or unexported fields
}

MovieCollectionShareCreateBulk is the builder for creating many MovieCollectionShare entities in bulk.

func (*MovieCollectionShareCreateBulk) Exec

Exec executes the query.

func (*MovieCollectionShareCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionShareCreateBulk) Save

Save creates the MovieCollectionShare entities in the database.

func (*MovieCollectionShareCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type MovieCollectionShareDelete

type MovieCollectionShareDelete struct {
	// contains filtered or unexported fields
}

MovieCollectionShareDelete is the builder for deleting a MovieCollectionShare entity.

func (*MovieCollectionShareDelete) Exec

func (mcsd *MovieCollectionShareDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MovieCollectionShareDelete) ExecX

func (mcsd *MovieCollectionShareDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionShareDelete) Where

Where appends a list predicates to the MovieCollectionShareDelete builder.

type MovieCollectionShareDeleteOne

type MovieCollectionShareDeleteOne struct {
	// contains filtered or unexported fields
}

MovieCollectionShareDeleteOne is the builder for deleting a single MovieCollectionShare entity.

func (*MovieCollectionShareDeleteOne) Exec

Exec executes the deletion query.

func (*MovieCollectionShareDeleteOne) ExecX

func (mcsdo *MovieCollectionShareDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionShareDeleteOne) Where

Where appends a list predicates to the MovieCollectionShareDelete builder.

type MovieCollectionShareEdges

type MovieCollectionShareEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// MovieCollection holds the value of the movie_collection edge.
	MovieCollection *MovieCollection `json:"movie_collection,omitempty"`
	// contains filtered or unexported fields
}

MovieCollectionShareEdges holds the relations/edges for other nodes in the graph.

func (MovieCollectionShareEdges) MovieCollectionOrErr

func (e MovieCollectionShareEdges) MovieCollectionOrErr() (*MovieCollection, error)

MovieCollectionOrErr returns the MovieCollection value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (MovieCollectionShareEdges) UserOrErr

func (e MovieCollectionShareEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MovieCollectionShareGroupBy

type MovieCollectionShareGroupBy struct {
	// contains filtered or unexported fields
}

MovieCollectionShareGroupBy is the group-by builder for MovieCollectionShare entities.

func (*MovieCollectionShareGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*MovieCollectionShareGroupBy) Bool

func (s *MovieCollectionShareGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareGroupBy) BoolX

func (s *MovieCollectionShareGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MovieCollectionShareGroupBy) Bools

func (s *MovieCollectionShareGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareGroupBy) BoolsX

func (s *MovieCollectionShareGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MovieCollectionShareGroupBy) Float64

func (s *MovieCollectionShareGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareGroupBy) Float64X

func (s *MovieCollectionShareGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MovieCollectionShareGroupBy) Float64s

func (s *MovieCollectionShareGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareGroupBy) Float64sX

func (s *MovieCollectionShareGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MovieCollectionShareGroupBy) Int

func (s *MovieCollectionShareGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareGroupBy) IntX

func (s *MovieCollectionShareGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MovieCollectionShareGroupBy) Ints

func (s *MovieCollectionShareGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareGroupBy) IntsX

func (s *MovieCollectionShareGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MovieCollectionShareGroupBy) Scan

func (mcsgb *MovieCollectionShareGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MovieCollectionShareGroupBy) ScanX

func (s *MovieCollectionShareGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MovieCollectionShareGroupBy) String

func (s *MovieCollectionShareGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareGroupBy) StringX

func (s *MovieCollectionShareGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MovieCollectionShareGroupBy) Strings

func (s *MovieCollectionShareGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareGroupBy) StringsX

func (s *MovieCollectionShareGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MovieCollectionShareMutation

type MovieCollectionShareMutation struct {
	// contains filtered or unexported fields
}

MovieCollectionShareMutation represents an operation that mutates the MovieCollectionShare nodes in the graph.

func (*MovieCollectionShareMutation) AddField

func (m *MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) AddedEdges

func (m *MovieCollectionShareMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MovieCollectionShareMutation) AddedField

func (m *MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) AddedFields

func (m *MovieCollectionShareMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MovieCollectionShareMutation) AddedIDs

func (m *MovieCollectionShareMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MovieCollectionShareMutation) CanEdit

func (m *MovieCollectionShareMutation) CanEdit() (r bool, exists bool)

CanEdit returns the value of the "can_edit" field in the mutation.

func (*MovieCollectionShareMutation) ClearEdge

func (m *MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) ClearField

func (m *MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) ClearMovieCollection

func (m *MovieCollectionShareMutation) ClearMovieCollection()

ClearMovieCollection clears the "movie_collection" edge to the MovieCollection entity.

func (*MovieCollectionShareMutation) ClearUser

func (m *MovieCollectionShareMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*MovieCollectionShareMutation) ClearedEdges

func (m *MovieCollectionShareMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MovieCollectionShareMutation) ClearedFields

func (m *MovieCollectionShareMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) CreatedAt

func (m *MovieCollectionShareMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MovieCollectionShareMutation) EdgeCleared

func (m *MovieCollectionShareMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MovieCollectionShareMutation) Field

func (m *MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) FieldCleared

func (m *MovieCollectionShareMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MovieCollectionShareMutation) Fields

func (m *MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) ID

func (m *MovieCollectionShareMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MovieCollectionShareMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MovieCollectionShareMutation) MovieCollectionCleared

func (m *MovieCollectionShareMutation) MovieCollectionCleared() bool

MovieCollectionCleared reports if the "movie_collection" edge to the MovieCollection entity was cleared.

func (*MovieCollectionShareMutation) MovieCollectionID

func (m *MovieCollectionShareMutation) MovieCollectionID() (id int, exists bool)

MovieCollectionID returns the "movie_collection" edge ID in the mutation.

func (*MovieCollectionShareMutation) MovieCollectionIDs

func (m *MovieCollectionShareMutation) MovieCollectionIDs() (ids []int)

MovieCollectionIDs returns the "movie_collection" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MovieCollectionID instead. It exists only for internal usage by the builders.

func (*MovieCollectionShareMutation) OldCanEdit

func (m *MovieCollectionShareMutation) OldCanEdit(ctx context.Context) (v bool, err error)

OldCanEdit returns the old "can_edit" field's value of the MovieCollectionShare entity. If the MovieCollectionShare 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 (*MovieCollectionShareMutation) OldCreatedAt

func (m *MovieCollectionShareMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the MovieCollectionShare entity. If the MovieCollectionShare 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 (*MovieCollectionShareMutation) OldField

func (m *MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) Op

Op returns the operation name.

func (*MovieCollectionShareMutation) RemovedEdges

func (m *MovieCollectionShareMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MovieCollectionShareMutation) RemovedIDs

func (m *MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) ResetCanEdit

func (m *MovieCollectionShareMutation) ResetCanEdit()

ResetCanEdit resets all changes to the "can_edit" field.

func (*MovieCollectionShareMutation) ResetCreatedAt

func (m *MovieCollectionShareMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MovieCollectionShareMutation) ResetEdge

func (m *MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) ResetField

func (m *MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) ResetMovieCollection

func (m *MovieCollectionShareMutation) ResetMovieCollection()

ResetMovieCollection resets all changes to the "movie_collection" edge.

func (*MovieCollectionShareMutation) ResetUser

func (m *MovieCollectionShareMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*MovieCollectionShareMutation) SetCanEdit

func (m *MovieCollectionShareMutation) SetCanEdit(b bool)

SetCanEdit sets the "can_edit" field.

func (*MovieCollectionShareMutation) SetCreatedAt

func (m *MovieCollectionShareMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MovieCollectionShareMutation) SetField

func (m *MovieCollectionShareMutation) 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 (*MovieCollectionShareMutation) SetMovieCollectionID

func (m *MovieCollectionShareMutation) SetMovieCollectionID(id int)

SetMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by id.

func (*MovieCollectionShareMutation) SetOp

func (m *MovieCollectionShareMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MovieCollectionShareMutation) SetUserID

func (m *MovieCollectionShareMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (MovieCollectionShareMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MovieCollectionShareMutation) Type

Type returns the node type of this mutation (MovieCollectionShare).

func (*MovieCollectionShareMutation) UserCleared

func (m *MovieCollectionShareMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*MovieCollectionShareMutation) UserID

func (m *MovieCollectionShareMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*MovieCollectionShareMutation) UserIDs

func (m *MovieCollectionShareMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*MovieCollectionShareMutation) Where

Where appends a list predicates to the MovieCollectionShareMutation builder.

func (*MovieCollectionShareMutation) WhereP

func (m *MovieCollectionShareMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MovieCollectionShareMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MovieCollectionShareQuery

type MovieCollectionShareQuery struct {
	// contains filtered or unexported fields
}

MovieCollectionShareQuery is the builder for querying MovieCollectionShare entities.

func (*MovieCollectionShareQuery) Aggregate

Aggregate returns a MovieCollectionShareSelect configured with the given aggregations.

func (*MovieCollectionShareQuery) All

All executes the query and returns a list of MovieCollectionShares.

func (*MovieCollectionShareQuery) AllX

AllX is like All, but panics if an error occurs.

func (*MovieCollectionShareQuery) Clone

Clone returns a duplicate of the MovieCollectionShareQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MovieCollectionShareQuery) Count

func (mcsq *MovieCollectionShareQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MovieCollectionShareQuery) CountX

func (mcsq *MovieCollectionShareQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MovieCollectionShareQuery) Exist

func (mcsq *MovieCollectionShareQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MovieCollectionShareQuery) ExistX

func (mcsq *MovieCollectionShareQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MovieCollectionShareQuery) First

First returns the first MovieCollectionShare entity from the query. Returns a *NotFoundError when no MovieCollectionShare was found.

func (*MovieCollectionShareQuery) FirstID

func (mcsq *MovieCollectionShareQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first MovieCollectionShare ID from the query. Returns a *NotFoundError when no MovieCollectionShare ID was found.

func (*MovieCollectionShareQuery) FirstIDX

func (mcsq *MovieCollectionShareQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MovieCollectionShareQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*MovieCollectionShareQuery) GroupBy

func (mcsq *MovieCollectionShareQuery) GroupBy(field string, fields ...string) *MovieCollectionShareGroupBy

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 {
	CanEdit bool `json:"can_edit,omitempty"`
	Count int `json:"count,omitempty"`
}

client.MovieCollectionShare.Query().
	GroupBy(moviecollectionshare.FieldCanEdit).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MovieCollectionShareQuery) IDs

func (mcsq *MovieCollectionShareQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of MovieCollectionShare IDs.

func (*MovieCollectionShareQuery) IDsX

func (mcsq *MovieCollectionShareQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MovieCollectionShareQuery) Limit

Limit the number of records to be returned by this query.

func (*MovieCollectionShareQuery) Offset

Offset to start from.

func (*MovieCollectionShareQuery) Only

Only returns a single MovieCollectionShare entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MovieCollectionShare entity is found. Returns a *NotFoundError when no MovieCollectionShare entities are found.

func (*MovieCollectionShareQuery) OnlyID

func (mcsq *MovieCollectionShareQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only MovieCollectionShare ID in the query. Returns a *NotSingularError when more than one MovieCollectionShare ID is found. Returns a *NotFoundError when no entities are found.

func (*MovieCollectionShareQuery) OnlyIDX

func (mcsq *MovieCollectionShareQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MovieCollectionShareQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*MovieCollectionShareQuery) Order

Order specifies how the records should be ordered.

func (*MovieCollectionShareQuery) QueryMovieCollection

func (mcsq *MovieCollectionShareQuery) QueryMovieCollection() *MovieCollectionQuery

QueryMovieCollection chains the current query on the "movie_collection" edge.

func (*MovieCollectionShareQuery) QueryUser

func (mcsq *MovieCollectionShareQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*MovieCollectionShareQuery) Select

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CanEdit bool `json:"can_edit,omitempty"`
}

client.MovieCollectionShare.Query().
	Select(moviecollectionshare.FieldCanEdit).
	Scan(ctx, &v)

func (*MovieCollectionShareQuery) Unique

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MovieCollectionShareQuery) Where

Where adds a new predicate for the MovieCollectionShareQuery builder.

func (*MovieCollectionShareQuery) WithMovieCollection

func (mcsq *MovieCollectionShareQuery) WithMovieCollection(opts ...func(*MovieCollectionQuery)) *MovieCollectionShareQuery

WithMovieCollection tells the query-builder to eager-load the nodes that are connected to the "movie_collection" edge. The optional arguments are used to configure the query builder of the edge.

func (*MovieCollectionShareQuery) WithUser

func (mcsq *MovieCollectionShareQuery) WithUser(opts ...func(*UserQuery)) *MovieCollectionShareQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type MovieCollectionShareSelect

type MovieCollectionShareSelect struct {
	*MovieCollectionShareQuery
	// contains filtered or unexported fields
}

MovieCollectionShareSelect is the builder for selecting fields of MovieCollectionShare entities.

func (*MovieCollectionShareSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*MovieCollectionShareSelect) Bool

func (s *MovieCollectionShareSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareSelect) BoolX

func (s *MovieCollectionShareSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MovieCollectionShareSelect) Bools

func (s *MovieCollectionShareSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareSelect) BoolsX

func (s *MovieCollectionShareSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MovieCollectionShareSelect) Float64

func (s *MovieCollectionShareSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareSelect) Float64X

func (s *MovieCollectionShareSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MovieCollectionShareSelect) Float64s

func (s *MovieCollectionShareSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareSelect) Float64sX

func (s *MovieCollectionShareSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MovieCollectionShareSelect) Int

func (s *MovieCollectionShareSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareSelect) IntX

func (s *MovieCollectionShareSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MovieCollectionShareSelect) Ints

func (s *MovieCollectionShareSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareSelect) IntsX

func (s *MovieCollectionShareSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MovieCollectionShareSelect) Scan

func (mcss *MovieCollectionShareSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MovieCollectionShareSelect) ScanX

func (s *MovieCollectionShareSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MovieCollectionShareSelect) String

func (s *MovieCollectionShareSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareSelect) StringX

func (s *MovieCollectionShareSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MovieCollectionShareSelect) Strings

func (s *MovieCollectionShareSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MovieCollectionShareSelect) StringsX

func (s *MovieCollectionShareSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MovieCollectionShareUpdate

type MovieCollectionShareUpdate struct {
	// contains filtered or unexported fields
}

MovieCollectionShareUpdate is the builder for updating MovieCollectionShare entities.

func (*MovieCollectionShareUpdate) ClearMovieCollection

func (mcsu *MovieCollectionShareUpdate) ClearMovieCollection() *MovieCollectionShareUpdate

ClearMovieCollection clears the "movie_collection" edge to the MovieCollection entity.

func (*MovieCollectionShareUpdate) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*MovieCollectionShareUpdate) Exec

Exec executes the query.

func (*MovieCollectionShareUpdate) ExecX

func (mcsu *MovieCollectionShareUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionShareUpdate) Mutation

Mutation returns the MovieCollectionShareMutation object of the builder.

func (*MovieCollectionShareUpdate) Save

func (mcsu *MovieCollectionShareUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MovieCollectionShareUpdate) SaveX

func (mcsu *MovieCollectionShareUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MovieCollectionShareUpdate) SetCanEdit

SetCanEdit sets the "can_edit" field.

func (*MovieCollectionShareUpdate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*MovieCollectionShareUpdate) SetMovieCollection

SetMovieCollection sets the "movie_collection" edge to the MovieCollection entity.

func (*MovieCollectionShareUpdate) SetMovieCollectionID

func (mcsu *MovieCollectionShareUpdate) SetMovieCollectionID(id int) *MovieCollectionShareUpdate

SetMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID.

func (*MovieCollectionShareUpdate) SetNillableCanEdit

func (mcsu *MovieCollectionShareUpdate) SetNillableCanEdit(b *bool) *MovieCollectionShareUpdate

SetNillableCanEdit sets the "can_edit" field if the given value is not nil.

func (*MovieCollectionShareUpdate) SetNillableCreatedAt

func (mcsu *MovieCollectionShareUpdate) SetNillableCreatedAt(t *time.Time) *MovieCollectionShareUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MovieCollectionShareUpdate) SetNillableMovieCollectionID

func (mcsu *MovieCollectionShareUpdate) SetNillableMovieCollectionID(id *int) *MovieCollectionShareUpdate

SetNillableMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID if the given value is not nil.

func (*MovieCollectionShareUpdate) SetNillableUserID

func (mcsu *MovieCollectionShareUpdate) SetNillableUserID(id *int) *MovieCollectionShareUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*MovieCollectionShareUpdate) SetUser

SetUser sets the "user" edge to the User entity.

func (*MovieCollectionShareUpdate) SetUserID

SetUserID sets the "user" edge to the User entity by ID.

func (*MovieCollectionShareUpdate) Where

Where appends a list predicates to the MovieCollectionShareUpdate builder.

type MovieCollectionShareUpdateOne

type MovieCollectionShareUpdateOne struct {
	// contains filtered or unexported fields
}

MovieCollectionShareUpdateOne is the builder for updating a single MovieCollectionShare entity.

func (*MovieCollectionShareUpdateOne) ClearMovieCollection

func (mcsuo *MovieCollectionShareUpdateOne) ClearMovieCollection() *MovieCollectionShareUpdateOne

ClearMovieCollection clears the "movie_collection" edge to the MovieCollection entity.

func (*MovieCollectionShareUpdateOne) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*MovieCollectionShareUpdateOne) Exec

Exec executes the query on the entity.

func (*MovieCollectionShareUpdateOne) ExecX

func (mcsuo *MovieCollectionShareUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionShareUpdateOne) Mutation

Mutation returns the MovieCollectionShareMutation object of the builder.

func (*MovieCollectionShareUpdateOne) Save

Save executes the query and returns the updated MovieCollectionShare entity.

func (*MovieCollectionShareUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*MovieCollectionShareUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MovieCollectionShareUpdateOne) SetCanEdit

SetCanEdit sets the "can_edit" field.

func (*MovieCollectionShareUpdateOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*MovieCollectionShareUpdateOne) SetMovieCollection

SetMovieCollection sets the "movie_collection" edge to the MovieCollection entity.

func (*MovieCollectionShareUpdateOne) SetMovieCollectionID

func (mcsuo *MovieCollectionShareUpdateOne) SetMovieCollectionID(id int) *MovieCollectionShareUpdateOne

SetMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID.

func (*MovieCollectionShareUpdateOne) SetNillableCanEdit

func (mcsuo *MovieCollectionShareUpdateOne) SetNillableCanEdit(b *bool) *MovieCollectionShareUpdateOne

SetNillableCanEdit sets the "can_edit" field if the given value is not nil.

func (*MovieCollectionShareUpdateOne) SetNillableCreatedAt

func (mcsuo *MovieCollectionShareUpdateOne) SetNillableCreatedAt(t *time.Time) *MovieCollectionShareUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MovieCollectionShareUpdateOne) SetNillableMovieCollectionID

func (mcsuo *MovieCollectionShareUpdateOne) SetNillableMovieCollectionID(id *int) *MovieCollectionShareUpdateOne

SetNillableMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID if the given value is not nil.

func (*MovieCollectionShareUpdateOne) SetNillableUserID

func (mcsuo *MovieCollectionShareUpdateOne) SetNillableUserID(id *int) *MovieCollectionShareUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*MovieCollectionShareUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*MovieCollectionShareUpdateOne) SetUserID

SetUserID sets the "user" edge to the User entity by ID.

func (*MovieCollectionShareUpdateOne) Where

Where appends a list predicates to the MovieCollectionShareUpdate builder.

type MovieCollectionShares

type MovieCollectionShares []*MovieCollectionShare

MovieCollectionShares is a parsable slice of MovieCollectionShare.

type MovieCollectionUpdate

type MovieCollectionUpdate struct {
	// contains filtered or unexported fields
}

MovieCollectionUpdate is the builder for updating MovieCollection entities.

func (*MovieCollectionUpdate) AddMovieCollectionShareIDs

func (mcu *MovieCollectionUpdate) AddMovieCollectionShareIDs(ids ...int) *MovieCollectionUpdate

AddMovieCollectionShareIDs adds the "movie_collection_shares" edge to the MovieCollectionShare entity by IDs.

func (*MovieCollectionUpdate) AddMovieCollectionShares

func (mcu *MovieCollectionUpdate) AddMovieCollectionShares(m ...*MovieCollectionShare) *MovieCollectionUpdate

AddMovieCollectionShares adds the "movie_collection_shares" edges to the MovieCollectionShare entity.

func (*MovieCollectionUpdate) AddMovieIDs

func (mcu *MovieCollectionUpdate) AddMovieIDs(ids ...int) *MovieCollectionUpdate

AddMovieIDs adds the "movies" edge to the Movie entity by IDs.

func (*MovieCollectionUpdate) AddMovies

func (mcu *MovieCollectionUpdate) AddMovies(m ...*Movie) *MovieCollectionUpdate

AddMovies adds the "movies" edges to the Movie entity.

func (*MovieCollectionUpdate) ClearMovieCollectionShares

func (mcu *MovieCollectionUpdate) ClearMovieCollectionShares() *MovieCollectionUpdate

ClearMovieCollectionShares clears all "movie_collection_shares" edges to the MovieCollectionShare entity.

func (*MovieCollectionUpdate) ClearMovies

func (mcu *MovieCollectionUpdate) ClearMovies() *MovieCollectionUpdate

ClearMovies clears all "movies" edges to the Movie entity.

func (*MovieCollectionUpdate) ClearOwner

func (mcu *MovieCollectionUpdate) ClearOwner() *MovieCollectionUpdate

ClearOwner clears the "owner" edge to the User entity.

func (*MovieCollectionUpdate) Exec

func (mcu *MovieCollectionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MovieCollectionUpdate) ExecX

func (mcu *MovieCollectionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionUpdate) Mutation

Mutation returns the MovieCollectionMutation object of the builder.

func (*MovieCollectionUpdate) RemoveMovieCollectionShareIDs

func (mcu *MovieCollectionUpdate) RemoveMovieCollectionShareIDs(ids ...int) *MovieCollectionUpdate

RemoveMovieCollectionShareIDs removes the "movie_collection_shares" edge to MovieCollectionShare entities by IDs.

func (*MovieCollectionUpdate) RemoveMovieCollectionShares

func (mcu *MovieCollectionUpdate) RemoveMovieCollectionShares(m ...*MovieCollectionShare) *MovieCollectionUpdate

RemoveMovieCollectionShares removes "movie_collection_shares" edges to MovieCollectionShare entities.

func (*MovieCollectionUpdate) RemoveMovieIDs

func (mcu *MovieCollectionUpdate) RemoveMovieIDs(ids ...int) *MovieCollectionUpdate

RemoveMovieIDs removes the "movies" edge to Movie entities by IDs.

func (*MovieCollectionUpdate) RemoveMovies

func (mcu *MovieCollectionUpdate) RemoveMovies(m ...*Movie) *MovieCollectionUpdate

RemoveMovies removes "movies" edges to Movie entities.

func (*MovieCollectionUpdate) Save

func (mcu *MovieCollectionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MovieCollectionUpdate) SaveX

func (mcu *MovieCollectionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MovieCollectionUpdate) SetCreatedAt

func (mcu *MovieCollectionUpdate) SetCreatedAt(t time.Time) *MovieCollectionUpdate

SetCreatedAt sets the "created_at" field.

func (*MovieCollectionUpdate) SetName

SetName sets the "name" field.

func (*MovieCollectionUpdate) SetNillableCreatedAt

func (mcu *MovieCollectionUpdate) SetNillableCreatedAt(t *time.Time) *MovieCollectionUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MovieCollectionUpdate) SetNillableName

func (mcu *MovieCollectionUpdate) SetNillableName(s *string) *MovieCollectionUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*MovieCollectionUpdate) SetNillableNote

func (mcu *MovieCollectionUpdate) SetNillableNote(s *string) *MovieCollectionUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*MovieCollectionUpdate) SetNillableOwnerID

func (mcu *MovieCollectionUpdate) SetNillableOwnerID(id *int) *MovieCollectionUpdate

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*MovieCollectionUpdate) SetNillableShowWatched

func (mcu *MovieCollectionUpdate) SetNillableShowWatched(b *bool) *MovieCollectionUpdate

SetNillableShowWatched sets the "show_watched" field if the given value is not nil.

func (*MovieCollectionUpdate) SetNote

SetNote sets the "note" field.

func (*MovieCollectionUpdate) SetOwner

SetOwner sets the "owner" edge to the User entity.

func (*MovieCollectionUpdate) SetOwnerID

func (mcu *MovieCollectionUpdate) SetOwnerID(id int) *MovieCollectionUpdate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*MovieCollectionUpdate) SetShowWatched

func (mcu *MovieCollectionUpdate) SetShowWatched(b bool) *MovieCollectionUpdate

SetShowWatched sets the "show_watched" field.

func (*MovieCollectionUpdate) Where

Where appends a list predicates to the MovieCollectionUpdate builder.

type MovieCollectionUpdateOne

type MovieCollectionUpdateOne struct {
	// contains filtered or unexported fields
}

MovieCollectionUpdateOne is the builder for updating a single MovieCollection entity.

func (*MovieCollectionUpdateOne) AddMovieCollectionShareIDs

func (mcuo *MovieCollectionUpdateOne) AddMovieCollectionShareIDs(ids ...int) *MovieCollectionUpdateOne

AddMovieCollectionShareIDs adds the "movie_collection_shares" edge to the MovieCollectionShare entity by IDs.

func (*MovieCollectionUpdateOne) AddMovieCollectionShares

func (mcuo *MovieCollectionUpdateOne) AddMovieCollectionShares(m ...*MovieCollectionShare) *MovieCollectionUpdateOne

AddMovieCollectionShares adds the "movie_collection_shares" edges to the MovieCollectionShare entity.

func (*MovieCollectionUpdateOne) AddMovieIDs

func (mcuo *MovieCollectionUpdateOne) AddMovieIDs(ids ...int) *MovieCollectionUpdateOne

AddMovieIDs adds the "movies" edge to the Movie entity by IDs.

func (*MovieCollectionUpdateOne) AddMovies

AddMovies adds the "movies" edges to the Movie entity.

func (*MovieCollectionUpdateOne) ClearMovieCollectionShares

func (mcuo *MovieCollectionUpdateOne) ClearMovieCollectionShares() *MovieCollectionUpdateOne

ClearMovieCollectionShares clears all "movie_collection_shares" edges to the MovieCollectionShare entity.

func (*MovieCollectionUpdateOne) ClearMovies

ClearMovies clears all "movies" edges to the Movie entity.

func (*MovieCollectionUpdateOne) ClearOwner

ClearOwner clears the "owner" edge to the User entity.

func (*MovieCollectionUpdateOne) Exec

Exec executes the query on the entity.

func (*MovieCollectionUpdateOne) ExecX

func (mcuo *MovieCollectionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieCollectionUpdateOne) Mutation

Mutation returns the MovieCollectionMutation object of the builder.

func (*MovieCollectionUpdateOne) RemoveMovieCollectionShareIDs

func (mcuo *MovieCollectionUpdateOne) RemoveMovieCollectionShareIDs(ids ...int) *MovieCollectionUpdateOne

RemoveMovieCollectionShareIDs removes the "movie_collection_shares" edge to MovieCollectionShare entities by IDs.

func (*MovieCollectionUpdateOne) RemoveMovieCollectionShares

func (mcuo *MovieCollectionUpdateOne) RemoveMovieCollectionShares(m ...*MovieCollectionShare) *MovieCollectionUpdateOne

RemoveMovieCollectionShares removes "movie_collection_shares" edges to MovieCollectionShare entities.

func (*MovieCollectionUpdateOne) RemoveMovieIDs

func (mcuo *MovieCollectionUpdateOne) RemoveMovieIDs(ids ...int) *MovieCollectionUpdateOne

RemoveMovieIDs removes the "movies" edge to Movie entities by IDs.

func (*MovieCollectionUpdateOne) RemoveMovies

func (mcuo *MovieCollectionUpdateOne) RemoveMovies(m ...*Movie) *MovieCollectionUpdateOne

RemoveMovies removes "movies" edges to Movie entities.

func (*MovieCollectionUpdateOne) Save

Save executes the query and returns the updated MovieCollection entity.

func (*MovieCollectionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*MovieCollectionUpdateOne) Select

func (mcuo *MovieCollectionUpdateOne) Select(field string, fields ...string) *MovieCollectionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MovieCollectionUpdateOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*MovieCollectionUpdateOne) SetName

SetName sets the "name" field.

func (*MovieCollectionUpdateOne) SetNillableCreatedAt

func (mcuo *MovieCollectionUpdateOne) SetNillableCreatedAt(t *time.Time) *MovieCollectionUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MovieCollectionUpdateOne) SetNillableName

func (mcuo *MovieCollectionUpdateOne) SetNillableName(s *string) *MovieCollectionUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*MovieCollectionUpdateOne) SetNillableNote

func (mcuo *MovieCollectionUpdateOne) SetNillableNote(s *string) *MovieCollectionUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*MovieCollectionUpdateOne) SetNillableOwnerID

func (mcuo *MovieCollectionUpdateOne) SetNillableOwnerID(id *int) *MovieCollectionUpdateOne

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*MovieCollectionUpdateOne) SetNillableShowWatched

func (mcuo *MovieCollectionUpdateOne) SetNillableShowWatched(b *bool) *MovieCollectionUpdateOne

SetNillableShowWatched sets the "show_watched" field if the given value is not nil.

func (*MovieCollectionUpdateOne) SetNote

SetNote sets the "note" field.

func (*MovieCollectionUpdateOne) SetOwner

SetOwner sets the "owner" edge to the User entity.

func (*MovieCollectionUpdateOne) SetOwnerID

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*MovieCollectionUpdateOne) SetShowWatched

func (mcuo *MovieCollectionUpdateOne) SetShowWatched(b bool) *MovieCollectionUpdateOne

SetShowWatched sets the "show_watched" field.

func (*MovieCollectionUpdateOne) Where

Where appends a list predicates to the MovieCollectionUpdate builder.

type MovieCollections

type MovieCollections []*MovieCollection

MovieCollections is a parsable slice of MovieCollection.

type MovieCreate

type MovieCreate struct {
	// contains filtered or unexported fields
}

MovieCreate is the builder for creating a Movie entity.

func (*MovieCreate) Exec

func (mc *MovieCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MovieCreate) ExecX

func (mc *MovieCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieCreate) Mutation

func (mc *MovieCreate) Mutation() *MovieMutation

Mutation returns the MovieMutation object of the builder.

func (*MovieCreate) Save

func (mc *MovieCreate) Save(ctx context.Context) (*Movie, error)

Save creates the Movie in the database.

func (*MovieCreate) SaveX

func (mc *MovieCreate) SaveX(ctx context.Context) *Movie

SaveX calls Save and panics if Save returns an error.

func (*MovieCreate) SetCreatedAt

func (mc *MovieCreate) SetCreatedAt(t time.Time) *MovieCreate

SetCreatedAt sets the "created_at" field.

func (*MovieCreate) SetMovieCollection

func (mc *MovieCreate) SetMovieCollection(m *MovieCollection) *MovieCreate

SetMovieCollection sets the "movie_collection" edge to the MovieCollection entity.

func (*MovieCreate) SetMovieCollectionID

func (mc *MovieCreate) SetMovieCollectionID(id int) *MovieCreate

SetMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID.

func (*MovieCreate) SetName

func (mc *MovieCreate) SetName(s string) *MovieCreate

SetName sets the "name" field.

func (*MovieCreate) SetNillableCreatedAt

func (mc *MovieCreate) SetNillableCreatedAt(t *time.Time) *MovieCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MovieCreate) SetNillableMovieCollectionID

func (mc *MovieCreate) SetNillableMovieCollectionID(id *int) *MovieCreate

SetNillableMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID if the given value is not nil.

func (*MovieCreate) SetNillableNote

func (mc *MovieCreate) SetNillableNote(s *string) *MovieCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*MovieCreate) SetNillableWatched

func (mc *MovieCreate) SetNillableWatched(b *bool) *MovieCreate

SetNillableWatched sets the "watched" field if the given value is not nil.

func (*MovieCreate) SetNote

func (mc *MovieCreate) SetNote(s string) *MovieCreate

SetNote sets the "note" field.

func (*MovieCreate) SetWatched

func (mc *MovieCreate) SetWatched(b bool) *MovieCreate

SetWatched sets the "watched" field.

type MovieCreateBulk

type MovieCreateBulk struct {
	// contains filtered or unexported fields
}

MovieCreateBulk is the builder for creating many Movie entities in bulk.

func (*MovieCreateBulk) Exec

func (mcb *MovieCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MovieCreateBulk) ExecX

func (mcb *MovieCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieCreateBulk) Save

func (mcb *MovieCreateBulk) Save(ctx context.Context) ([]*Movie, error)

Save creates the Movie entities in the database.

func (*MovieCreateBulk) SaveX

func (mcb *MovieCreateBulk) SaveX(ctx context.Context) []*Movie

SaveX is like Save, but panics if an error occurs.

type MovieDelete

type MovieDelete struct {
	// contains filtered or unexported fields
}

MovieDelete is the builder for deleting a Movie entity.

func (*MovieDelete) Exec

func (md *MovieDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MovieDelete) ExecX

func (md *MovieDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MovieDelete) Where

func (md *MovieDelete) Where(ps ...predicate.Movie) *MovieDelete

Where appends a list predicates to the MovieDelete builder.

type MovieDeleteOne

type MovieDeleteOne struct {
	// contains filtered or unexported fields
}

MovieDeleteOne is the builder for deleting a single Movie entity.

func (*MovieDeleteOne) Exec

func (mdo *MovieDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MovieDeleteOne) ExecX

func (mdo *MovieDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieDeleteOne) Where

func (mdo *MovieDeleteOne) Where(ps ...predicate.Movie) *MovieDeleteOne

Where appends a list predicates to the MovieDelete builder.

type MovieEdges

type MovieEdges struct {
	// MovieCollection holds the value of the movie_collection edge.
	MovieCollection *MovieCollection `json:"movie_collection,omitempty"`
	// contains filtered or unexported fields
}

MovieEdges holds the relations/edges for other nodes in the graph.

func (MovieEdges) MovieCollectionOrErr

func (e MovieEdges) MovieCollectionOrErr() (*MovieCollection, error)

MovieCollectionOrErr returns the MovieCollection value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MovieGroupBy

type MovieGroupBy struct {
	// contains filtered or unexported fields
}

MovieGroupBy is the group-by builder for Movie entities.

func (*MovieGroupBy) Aggregate

func (mgb *MovieGroupBy) Aggregate(fns ...AggregateFunc) *MovieGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MovieGroupBy) Bool

func (s *MovieGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MovieGroupBy) BoolX

func (s *MovieGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MovieGroupBy) Bools

func (s *MovieGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MovieGroupBy) BoolsX

func (s *MovieGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MovieGroupBy) Float64

func (s *MovieGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MovieGroupBy) Float64X

func (s *MovieGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MovieGroupBy) Float64s

func (s *MovieGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MovieGroupBy) Float64sX

func (s *MovieGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MovieGroupBy) Int

func (s *MovieGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MovieGroupBy) IntX

func (s *MovieGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MovieGroupBy) Ints

func (s *MovieGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MovieGroupBy) IntsX

func (s *MovieGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MovieGroupBy) Scan

func (mgb *MovieGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MovieGroupBy) ScanX

func (s *MovieGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MovieGroupBy) String

func (s *MovieGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MovieGroupBy) StringX

func (s *MovieGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MovieGroupBy) Strings

func (s *MovieGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MovieGroupBy) StringsX

func (s *MovieGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MovieMutation

type MovieMutation struct {
	// contains filtered or unexported fields
}

MovieMutation represents an operation that mutates the Movie nodes in the graph.

func (*MovieMutation) AddField

func (m *MovieMutation) 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 (*MovieMutation) AddedEdges

func (m *MovieMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MovieMutation) AddedField

func (m *MovieMutation) 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 (*MovieMutation) AddedFields

func (m *MovieMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MovieMutation) AddedIDs

func (m *MovieMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MovieMutation) ClearEdge

func (m *MovieMutation) 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 (*MovieMutation) ClearField

func (m *MovieMutation) 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 (*MovieMutation) ClearMovieCollection

func (m *MovieMutation) ClearMovieCollection()

ClearMovieCollection clears the "movie_collection" edge to the MovieCollection entity.

func (*MovieMutation) ClearedEdges

func (m *MovieMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MovieMutation) ClearedFields

func (m *MovieMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MovieMutation) Client

func (m MovieMutation) 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 (*MovieMutation) CreatedAt

func (m *MovieMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MovieMutation) EdgeCleared

func (m *MovieMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MovieMutation) Field

func (m *MovieMutation) 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 (*MovieMutation) FieldCleared

func (m *MovieMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MovieMutation) Fields

func (m *MovieMutation) 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 (*MovieMutation) ID

func (m *MovieMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MovieMutation) IDs

func (m *MovieMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MovieMutation) MovieCollectionCleared

func (m *MovieMutation) MovieCollectionCleared() bool

MovieCollectionCleared reports if the "movie_collection" edge to the MovieCollection entity was cleared.

func (*MovieMutation) MovieCollectionID

func (m *MovieMutation) MovieCollectionID() (id int, exists bool)

MovieCollectionID returns the "movie_collection" edge ID in the mutation.

func (*MovieMutation) MovieCollectionIDs

func (m *MovieMutation) MovieCollectionIDs() (ids []int)

MovieCollectionIDs returns the "movie_collection" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MovieCollectionID instead. It exists only for internal usage by the builders.

func (*MovieMutation) Name

func (m *MovieMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*MovieMutation) Note

func (m *MovieMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*MovieMutation) OldCreatedAt

func (m *MovieMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Movie entity. If the Movie 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 (*MovieMutation) OldField

func (m *MovieMutation) 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 (*MovieMutation) OldName

func (m *MovieMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Movie entity. If the Movie 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 (*MovieMutation) OldNote

func (m *MovieMutation) OldNote(ctx context.Context) (v string, err error)

OldNote returns the old "note" field's value of the Movie entity. If the Movie 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 (*MovieMutation) OldWatched

func (m *MovieMutation) OldWatched(ctx context.Context) (v bool, err error)

OldWatched returns the old "watched" field's value of the Movie entity. If the Movie 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 (*MovieMutation) Op

func (m *MovieMutation) Op() Op

Op returns the operation name.

func (*MovieMutation) RemovedEdges

func (m *MovieMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MovieMutation) RemovedIDs

func (m *MovieMutation) 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 (*MovieMutation) ResetCreatedAt

func (m *MovieMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MovieMutation) ResetEdge

func (m *MovieMutation) 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 (*MovieMutation) ResetField

func (m *MovieMutation) 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 (*MovieMutation) ResetMovieCollection

func (m *MovieMutation) ResetMovieCollection()

ResetMovieCollection resets all changes to the "movie_collection" edge.

func (*MovieMutation) ResetName

func (m *MovieMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*MovieMutation) ResetNote

func (m *MovieMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*MovieMutation) ResetWatched

func (m *MovieMutation) ResetWatched()

ResetWatched resets all changes to the "watched" field.

func (*MovieMutation) SetCreatedAt

func (m *MovieMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MovieMutation) SetField

func (m *MovieMutation) 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 (*MovieMutation) SetMovieCollectionID

func (m *MovieMutation) SetMovieCollectionID(id int)

SetMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by id.

func (*MovieMutation) SetName

func (m *MovieMutation) SetName(s string)

SetName sets the "name" field.

func (*MovieMutation) SetNote

func (m *MovieMutation) SetNote(s string)

SetNote sets the "note" field.

func (*MovieMutation) SetOp

func (m *MovieMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MovieMutation) SetWatched

func (m *MovieMutation) SetWatched(b bool)

SetWatched sets the "watched" field.

func (MovieMutation) Tx

func (m MovieMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MovieMutation) Type

func (m *MovieMutation) Type() string

Type returns the node type of this mutation (Movie).

func (*MovieMutation) Watched

func (m *MovieMutation) Watched() (r bool, exists bool)

Watched returns the value of the "watched" field in the mutation.

func (*MovieMutation) Where

func (m *MovieMutation) Where(ps ...predicate.Movie)

Where appends a list predicates to the MovieMutation builder.

func (*MovieMutation) WhereP

func (m *MovieMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MovieMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MovieQuery

type MovieQuery struct {
	// contains filtered or unexported fields
}

MovieQuery is the builder for querying Movie entities.

func (*MovieQuery) Aggregate

func (mq *MovieQuery) Aggregate(fns ...AggregateFunc) *MovieSelect

Aggregate returns a MovieSelect configured with the given aggregations.

func (*MovieQuery) All

func (mq *MovieQuery) All(ctx context.Context) ([]*Movie, error)

All executes the query and returns a list of Movies.

func (*MovieQuery) AllX

func (mq *MovieQuery) AllX(ctx context.Context) []*Movie

AllX is like All, but panics if an error occurs.

func (*MovieQuery) Clone

func (mq *MovieQuery) Clone() *MovieQuery

Clone returns a duplicate of the MovieQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MovieQuery) Count

func (mq *MovieQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MovieQuery) CountX

func (mq *MovieQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MovieQuery) Exist

func (mq *MovieQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MovieQuery) ExistX

func (mq *MovieQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MovieQuery) First

func (mq *MovieQuery) First(ctx context.Context) (*Movie, error)

First returns the first Movie entity from the query. Returns a *NotFoundError when no Movie was found.

func (*MovieQuery) FirstID

func (mq *MovieQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Movie ID from the query. Returns a *NotFoundError when no Movie ID was found.

func (*MovieQuery) FirstIDX

func (mq *MovieQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MovieQuery) FirstX

func (mq *MovieQuery) FirstX(ctx context.Context) *Movie

FirstX is like First, but panics if an error occurs.

func (*MovieQuery) GroupBy

func (mq *MovieQuery) GroupBy(field string, fields ...string) *MovieGroupBy

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.Movie.Query().
	GroupBy(movie.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MovieQuery) IDs

func (mq *MovieQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Movie IDs.

func (*MovieQuery) IDsX

func (mq *MovieQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MovieQuery) Limit

func (mq *MovieQuery) Limit(limit int) *MovieQuery

Limit the number of records to be returned by this query.

func (*MovieQuery) Offset

func (mq *MovieQuery) Offset(offset int) *MovieQuery

Offset to start from.

func (*MovieQuery) Only

func (mq *MovieQuery) Only(ctx context.Context) (*Movie, error)

Only returns a single Movie entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Movie entity is found. Returns a *NotFoundError when no Movie entities are found.

func (*MovieQuery) OnlyID

func (mq *MovieQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Movie ID in the query. Returns a *NotSingularError when more than one Movie ID is found. Returns a *NotFoundError when no entities are found.

func (*MovieQuery) OnlyIDX

func (mq *MovieQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MovieQuery) OnlyX

func (mq *MovieQuery) OnlyX(ctx context.Context) *Movie

OnlyX is like Only, but panics if an error occurs.

func (*MovieQuery) Order

func (mq *MovieQuery) Order(o ...movie.OrderOption) *MovieQuery

Order specifies how the records should be ordered.

func (*MovieQuery) QueryMovieCollection

func (mq *MovieQuery) QueryMovieCollection() *MovieCollectionQuery

QueryMovieCollection chains the current query on the "movie_collection" edge.

func (*MovieQuery) Select

func (mq *MovieQuery) Select(fields ...string) *MovieSelect

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.Movie.Query().
	Select(movie.FieldName).
	Scan(ctx, &v)

func (*MovieQuery) Unique

func (mq *MovieQuery) Unique(unique bool) *MovieQuery

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 (*MovieQuery) Where

func (mq *MovieQuery) Where(ps ...predicate.Movie) *MovieQuery

Where adds a new predicate for the MovieQuery builder.

func (*MovieQuery) WithMovieCollection

func (mq *MovieQuery) WithMovieCollection(opts ...func(*MovieCollectionQuery)) *MovieQuery

WithMovieCollection tells the query-builder to eager-load the nodes that are connected to the "movie_collection" edge. The optional arguments are used to configure the query builder of the edge.

type MovieSelect

type MovieSelect struct {
	*MovieQuery
	// contains filtered or unexported fields
}

MovieSelect is the builder for selecting fields of Movie entities.

func (*MovieSelect) Aggregate

func (ms *MovieSelect) Aggregate(fns ...AggregateFunc) *MovieSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MovieSelect) Bool

func (s *MovieSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MovieSelect) BoolX

func (s *MovieSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MovieSelect) Bools

func (s *MovieSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MovieSelect) BoolsX

func (s *MovieSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MovieSelect) Float64

func (s *MovieSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MovieSelect) Float64X

func (s *MovieSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MovieSelect) Float64s

func (s *MovieSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MovieSelect) Float64sX

func (s *MovieSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MovieSelect) Int

func (s *MovieSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MovieSelect) IntX

func (s *MovieSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MovieSelect) Ints

func (s *MovieSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MovieSelect) IntsX

func (s *MovieSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MovieSelect) Scan

func (ms *MovieSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MovieSelect) ScanX

func (s *MovieSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MovieSelect) String

func (s *MovieSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MovieSelect) StringX

func (s *MovieSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MovieSelect) Strings

func (s *MovieSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MovieSelect) StringsX

func (s *MovieSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MovieUpdate

type MovieUpdate struct {
	// contains filtered or unexported fields
}

MovieUpdate is the builder for updating Movie entities.

func (*MovieUpdate) ClearMovieCollection

func (mu *MovieUpdate) ClearMovieCollection() *MovieUpdate

ClearMovieCollection clears the "movie_collection" edge to the MovieCollection entity.

func (*MovieUpdate) Exec

func (mu *MovieUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MovieUpdate) ExecX

func (mu *MovieUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieUpdate) Mutation

func (mu *MovieUpdate) Mutation() *MovieMutation

Mutation returns the MovieMutation object of the builder.

func (*MovieUpdate) Save

func (mu *MovieUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MovieUpdate) SaveX

func (mu *MovieUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MovieUpdate) SetCreatedAt

func (mu *MovieUpdate) SetCreatedAt(t time.Time) *MovieUpdate

SetCreatedAt sets the "created_at" field.

func (*MovieUpdate) SetMovieCollection

func (mu *MovieUpdate) SetMovieCollection(m *MovieCollection) *MovieUpdate

SetMovieCollection sets the "movie_collection" edge to the MovieCollection entity.

func (*MovieUpdate) SetMovieCollectionID

func (mu *MovieUpdate) SetMovieCollectionID(id int) *MovieUpdate

SetMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID.

func (*MovieUpdate) SetName

func (mu *MovieUpdate) SetName(s string) *MovieUpdate

SetName sets the "name" field.

func (*MovieUpdate) SetNillableCreatedAt

func (mu *MovieUpdate) SetNillableCreatedAt(t *time.Time) *MovieUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MovieUpdate) SetNillableMovieCollectionID

func (mu *MovieUpdate) SetNillableMovieCollectionID(id *int) *MovieUpdate

SetNillableMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID if the given value is not nil.

func (*MovieUpdate) SetNillableNote

func (mu *MovieUpdate) SetNillableNote(s *string) *MovieUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*MovieUpdate) SetNillableWatched

func (mu *MovieUpdate) SetNillableWatched(b *bool) *MovieUpdate

SetNillableWatched sets the "watched" field if the given value is not nil.

func (*MovieUpdate) SetNote

func (mu *MovieUpdate) SetNote(s string) *MovieUpdate

SetNote sets the "note" field.

func (*MovieUpdate) SetWatched

func (mu *MovieUpdate) SetWatched(b bool) *MovieUpdate

SetWatched sets the "watched" field.

func (*MovieUpdate) Where

func (mu *MovieUpdate) Where(ps ...predicate.Movie) *MovieUpdate

Where appends a list predicates to the MovieUpdate builder.

type MovieUpdateOne

type MovieUpdateOne struct {
	// contains filtered or unexported fields
}

MovieUpdateOne is the builder for updating a single Movie entity.

func (*MovieUpdateOne) ClearMovieCollection

func (muo *MovieUpdateOne) ClearMovieCollection() *MovieUpdateOne

ClearMovieCollection clears the "movie_collection" edge to the MovieCollection entity.

func (*MovieUpdateOne) Exec

func (muo *MovieUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MovieUpdateOne) ExecX

func (muo *MovieUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieUpdateOne) Mutation

func (muo *MovieUpdateOne) Mutation() *MovieMutation

Mutation returns the MovieMutation object of the builder.

func (*MovieUpdateOne) Save

func (muo *MovieUpdateOne) Save(ctx context.Context) (*Movie, error)

Save executes the query and returns the updated Movie entity.

func (*MovieUpdateOne) SaveX

func (muo *MovieUpdateOne) SaveX(ctx context.Context) *Movie

SaveX is like Save, but panics if an error occurs.

func (*MovieUpdateOne) Select

func (muo *MovieUpdateOne) Select(field string, fields ...string) *MovieUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MovieUpdateOne) SetCreatedAt

func (muo *MovieUpdateOne) SetCreatedAt(t time.Time) *MovieUpdateOne

SetCreatedAt sets the "created_at" field.

func (*MovieUpdateOne) SetMovieCollection

func (muo *MovieUpdateOne) SetMovieCollection(m *MovieCollection) *MovieUpdateOne

SetMovieCollection sets the "movie_collection" edge to the MovieCollection entity.

func (*MovieUpdateOne) SetMovieCollectionID

func (muo *MovieUpdateOne) SetMovieCollectionID(id int) *MovieUpdateOne

SetMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID.

func (*MovieUpdateOne) SetName

func (muo *MovieUpdateOne) SetName(s string) *MovieUpdateOne

SetName sets the "name" field.

func (*MovieUpdateOne) SetNillableCreatedAt

func (muo *MovieUpdateOne) SetNillableCreatedAt(t *time.Time) *MovieUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MovieUpdateOne) SetNillableMovieCollectionID

func (muo *MovieUpdateOne) SetNillableMovieCollectionID(id *int) *MovieUpdateOne

SetNillableMovieCollectionID sets the "movie_collection" edge to the MovieCollection entity by ID if the given value is not nil.

func (*MovieUpdateOne) SetNillableNote

func (muo *MovieUpdateOne) SetNillableNote(s *string) *MovieUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*MovieUpdateOne) SetNillableWatched

func (muo *MovieUpdateOne) SetNillableWatched(b *bool) *MovieUpdateOne

SetNillableWatched sets the "watched" field if the given value is not nil.

func (*MovieUpdateOne) SetNote

func (muo *MovieUpdateOne) SetNote(s string) *MovieUpdateOne

SetNote sets the "note" field.

func (*MovieUpdateOne) SetWatched

func (muo *MovieUpdateOne) SetWatched(b bool) *MovieUpdateOne

SetWatched sets the "watched" field.

func (*MovieUpdateOne) Where

func (muo *MovieUpdateOne) Where(ps ...predicate.Movie) *MovieUpdateOne

Where appends a list predicates to the MovieUpdate builder.

type Movies

type Movies []*Movie

Movies is a parsable slice of Movie.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// AmazonList is the client for interacting with the AmazonList builders.
	AmazonList *AmazonListClient
	// AmazonOrder is the client for interacting with the AmazonOrder builders.
	AmazonOrder *AmazonOrderClient
	// AmazonShare is the client for interacting with the AmazonShare builders.
	AmazonShare *AmazonShareClient
	// Drink is the client for interacting with the Drink builders.
	Drink *DrinkClient
	// GroceryList is the client for interacting with the GroceryList builders.
	GroceryList *GroceryListClient
	// GroceryListItem is the client for interacting with the GroceryListItem builders.
	GroceryListItem *GroceryListItemClient
	// GroceryListShare is the client for interacting with the GroceryListShare builders.
	GroceryListShare *GroceryListShareClient
	// Movie is the client for interacting with the Movie builders.
	Movie *MovieClient
	// MovieCollection is the client for interacting with the MovieCollection builders.
	MovieCollection *MovieCollectionClient
	// MovieCollectionShare is the client for interacting with the MovieCollectionShare builders.
	MovieCollectionShare *MovieCollectionShareClient
	// 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 int `json:"id,omitempty"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName string `json:"display_name,omitempty"`
	// NameChanges holds the value of the "name_changes" field.
	NameChanges int8 `json:"name_changes,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Verified holds the value of the "verified" field.
	Verified bool `json:"verified,omitempty"`
	// Locked holds the value of the "locked" field.
	Locked bool `json:"locked,omitempty"`
	// LastLogin holds the value of the "last_login" field.
	LastLogin *time.Time `json:"last_login,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryAmazonLists

func (u *User) QueryAmazonLists() *AmazonListQuery

QueryAmazonLists queries the "amazon_lists" edge of the User entity.

func (*User) QueryAmazonShares

func (u *User) QueryAmazonShares() *AmazonShareQuery

QueryAmazonShares queries the "amazon_shares" edge of the User entity.

func (*User) QueryDrinks

func (u *User) QueryDrinks() *DrinkQuery

QueryDrinks queries the "drinks" edge of the User entity.

func (*User) QueryGroceryListShares

func (u *User) QueryGroceryListShares() *GroceryListShareQuery

QueryGroceryListShares queries the "grocery_list_shares" edge of the User entity.

func (*User) QueryGroceryLists

func (u *User) QueryGroceryLists() *GroceryListQuery

QueryGroceryLists queries the "grocery_lists" edge of the User entity.

func (*User) QueryMovieCollectionShares

func (u *User) QueryMovieCollectionShares() *MovieCollectionShareQuery

QueryMovieCollectionShares queries the "movie_collection_shares" edge of the User entity.

func (*User) QueryMovieCollections

func (u *User) QueryMovieCollections() *MovieCollectionQuery

QueryMovieCollections queries the "movie_collections" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

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 int) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) 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) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryAmazonLists

func (c *UserClient) QueryAmazonLists(u *User) *AmazonListQuery

QueryAmazonLists queries the amazon_lists edge of a User.

func (*UserClient) QueryAmazonShares

func (c *UserClient) QueryAmazonShares(u *User) *AmazonShareQuery

QueryAmazonShares queries the amazon_shares edge of a User.

func (*UserClient) QueryDrinks

func (c *UserClient) QueryDrinks(u *User) *DrinkQuery

QueryDrinks queries the drinks edge of a User.

func (*UserClient) QueryGroceryListShares

func (c *UserClient) QueryGroceryListShares(u *User) *GroceryListShareQuery

QueryGroceryListShares queries the grocery_list_shares edge of a User.

func (*UserClient) QueryGroceryLists

func (c *UserClient) QueryGroceryLists(u *User) *GroceryListQuery

QueryGroceryLists queries the grocery_lists edge of a User.

func (*UserClient) QueryMovieCollectionShares

func (c *UserClient) QueryMovieCollectionShares(u *User) *MovieCollectionShareQuery

QueryMovieCollectionShares queries the movie_collection_shares edge of a User.

func (*UserClient) QueryMovieCollections

func (c *UserClient) QueryMovieCollections(u *User) *MovieCollectionQuery

QueryMovieCollections queries the movie_collections edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddAmazonListIDs

func (uc *UserCreate) AddAmazonListIDs(ids ...int) *UserCreate

AddAmazonListIDs adds the "amazon_lists" edge to the AmazonList entity by IDs.

func (*UserCreate) AddAmazonLists

func (uc *UserCreate) AddAmazonLists(a ...*AmazonList) *UserCreate

AddAmazonLists adds the "amazon_lists" edges to the AmazonList entity.

func (*UserCreate) AddAmazonShareIDs

func (uc *UserCreate) AddAmazonShareIDs(ids ...int) *UserCreate

AddAmazonShareIDs adds the "amazon_shares" edge to the AmazonShare entity by IDs.

func (*UserCreate) AddAmazonShares

func (uc *UserCreate) AddAmazonShares(a ...*AmazonShare) *UserCreate

AddAmazonShares adds the "amazon_shares" edges to the AmazonShare entity.

func (*UserCreate) AddDrinkIDs

func (uc *UserCreate) AddDrinkIDs(ids ...int) *UserCreate

AddDrinkIDs adds the "drinks" edge to the Drink entity by IDs.

func (*UserCreate) AddDrinks

func (uc *UserCreate) AddDrinks(d ...*Drink) *UserCreate

AddDrinks adds the "drinks" edges to the Drink entity.

func (*UserCreate) AddGroceryListIDs

func (uc *UserCreate) AddGroceryListIDs(ids ...int) *UserCreate

AddGroceryListIDs adds the "grocery_lists" edge to the GroceryList entity by IDs.

func (*UserCreate) AddGroceryListShareIDs

func (uc *UserCreate) AddGroceryListShareIDs(ids ...int) *UserCreate

AddGroceryListShareIDs adds the "grocery_list_shares" edge to the GroceryListShare entity by IDs.

func (*UserCreate) AddGroceryListShares

func (uc *UserCreate) AddGroceryListShares(g ...*GroceryListShare) *UserCreate

AddGroceryListShares adds the "grocery_list_shares" edges to the GroceryListShare entity.

func (*UserCreate) AddGroceryLists

func (uc *UserCreate) AddGroceryLists(g ...*GroceryList) *UserCreate

AddGroceryLists adds the "grocery_lists" edges to the GroceryList entity.

func (*UserCreate) AddMovieCollectionIDs

func (uc *UserCreate) AddMovieCollectionIDs(ids ...int) *UserCreate

AddMovieCollectionIDs adds the "movie_collections" edge to the MovieCollection entity by IDs.

func (*UserCreate) AddMovieCollectionShareIDs

func (uc *UserCreate) AddMovieCollectionShareIDs(ids ...int) *UserCreate

AddMovieCollectionShareIDs adds the "movie_collection_shares" edge to the MovieCollectionShare entity by IDs.

func (*UserCreate) AddMovieCollectionShares

func (uc *UserCreate) AddMovieCollectionShares(m ...*MovieCollectionShare) *UserCreate

AddMovieCollectionShares adds the "movie_collection_shares" edges to the MovieCollectionShare entity.

func (*UserCreate) AddMovieCollections

func (uc *UserCreate) AddMovieCollections(m ...*MovieCollection) *UserCreate

AddMovieCollections adds the "movie_collections" edges to the MovieCollection entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetDisplayName

func (uc *UserCreate) SetDisplayName(s string) *UserCreate

SetDisplayName sets the "display_name" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetLastLogin

func (uc *UserCreate) SetLastLogin(t time.Time) *UserCreate

SetLastLogin sets the "last_login" field.

func (*UserCreate) SetLocked

func (uc *UserCreate) SetLocked(b bool) *UserCreate

SetLocked sets the "locked" field.

func (*UserCreate) SetNameChanges

func (uc *UserCreate) SetNameChanges(i int8) *UserCreate

SetNameChanges sets the "name_changes" 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) SetNillableLocked

func (uc *UserCreate) SetNillableLocked(b *bool) *UserCreate

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*UserCreate) SetNillableNameChanges

func (uc *UserCreate) SetNillableNameChanges(i *int8) *UserCreate

SetNillableNameChanges sets the "name_changes" field if the given value is not nil.

func (*UserCreate) SetNillableVerified

func (uc *UserCreate) SetNillableVerified(b *bool) *UserCreate

SetNillableVerified sets the "verified" field if the given value is not nil.

func (*UserCreate) SetVerified

func (uc *UserCreate) SetVerified(b bool) *UserCreate

SetVerified sets the "verified" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// AmazonShares holds the value of the amazon_shares edge.
	AmazonShares []*AmazonShare `json:"amazon_shares,omitempty"`
	// AmazonLists holds the value of the amazon_lists edge.
	AmazonLists []*AmazonList `json:"amazon_lists,omitempty"`
	// Drinks holds the value of the drinks edge.
	Drinks []*Drink `json:"drinks,omitempty"`
	// GroceryLists holds the value of the grocery_lists edge.
	GroceryLists []*GroceryList `json:"grocery_lists,omitempty"`
	// GroceryListShares holds the value of the grocery_list_shares edge.
	GroceryListShares []*GroceryListShare `json:"grocery_list_shares,omitempty"`
	// MovieCollections holds the value of the movie_collections edge.
	MovieCollections []*MovieCollection `json:"movie_collections,omitempty"`
	// MovieCollectionShares holds the value of the movie_collection_shares edge.
	MovieCollectionShares []*MovieCollectionShare `json:"movie_collection_shares,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) AmazonListsOrErr

func (e UserEdges) AmazonListsOrErr() ([]*AmazonList, error)

AmazonListsOrErr returns the AmazonLists value or an error if the edge was not loaded in eager-loading.

func (UserEdges) AmazonSharesOrErr

func (e UserEdges) AmazonSharesOrErr() ([]*AmazonShare, error)

AmazonSharesOrErr returns the AmazonShares value or an error if the edge was not loaded in eager-loading.

func (UserEdges) DrinksOrErr

func (e UserEdges) DrinksOrErr() ([]*Drink, error)

DrinksOrErr returns the Drinks value or an error if the edge was not loaded in eager-loading.

func (UserEdges) GroceryListSharesOrErr

func (e UserEdges) GroceryListSharesOrErr() ([]*GroceryListShare, error)

GroceryListSharesOrErr returns the GroceryListShares value or an error if the edge was not loaded in eager-loading.

func (UserEdges) GroceryListsOrErr

func (e UserEdges) GroceryListsOrErr() ([]*GroceryList, error)

GroceryListsOrErr returns the GroceryLists value or an error if the edge was not loaded in eager-loading.

func (UserEdges) MovieCollectionSharesOrErr

func (e UserEdges) MovieCollectionSharesOrErr() ([]*MovieCollectionShare, error)

MovieCollectionSharesOrErr returns the MovieCollectionShares value or an error if the edge was not loaded in eager-loading.

func (UserEdges) MovieCollectionsOrErr

func (e UserEdges) MovieCollectionsOrErr() ([]*MovieCollection, error)

MovieCollectionsOrErr returns the MovieCollections value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v 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) AddAmazonListIDs

func (m *UserMutation) AddAmazonListIDs(ids ...int)

AddAmazonListIDs adds the "amazon_lists" edge to the AmazonList entity by ids.

func (*UserMutation) AddAmazonShareIDs

func (m *UserMutation) AddAmazonShareIDs(ids ...int)

AddAmazonShareIDs adds the "amazon_shares" edge to the AmazonShare entity by ids.

func (*UserMutation) AddDrinkIDs

func (m *UserMutation) AddDrinkIDs(ids ...int)

AddDrinkIDs adds the "drinks" edge to the Drink entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddGroceryListIDs

func (m *UserMutation) AddGroceryListIDs(ids ...int)

AddGroceryListIDs adds the "grocery_lists" edge to the GroceryList entity by ids.

func (*UserMutation) AddGroceryListShareIDs

func (m *UserMutation) AddGroceryListShareIDs(ids ...int)

AddGroceryListShareIDs adds the "grocery_list_shares" edge to the GroceryListShare entity by ids.

func (*UserMutation) AddMovieCollectionIDs

func (m *UserMutation) AddMovieCollectionIDs(ids ...int)

AddMovieCollectionIDs adds the "movie_collections" edge to the MovieCollection entity by ids.

func (*UserMutation) AddMovieCollectionShareIDs

func (m *UserMutation) AddMovieCollectionShareIDs(ids ...int)

AddMovieCollectionShareIDs adds the "movie_collection_shares" edge to the MovieCollectionShare entity by ids.

func (*UserMutation) AddNameChanges

func (m *UserMutation) AddNameChanges(i int8)

AddNameChanges adds i to the "name_changes" field.

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) AddedNameChanges

func (m *UserMutation) AddedNameChanges() (r int8, exists bool)

AddedNameChanges returns the value that was added to the "name_changes" field in this mutation.

func (*UserMutation) AmazonListsCleared

func (m *UserMutation) AmazonListsCleared() bool

AmazonListsCleared reports if the "amazon_lists" edge to the AmazonList entity was cleared.

func (*UserMutation) AmazonListsIDs

func (m *UserMutation) AmazonListsIDs() (ids []int)

AmazonListsIDs returns the "amazon_lists" edge IDs in the mutation.

func (*UserMutation) AmazonSharesCleared

func (m *UserMutation) AmazonSharesCleared() bool

AmazonSharesCleared reports if the "amazon_shares" edge to the AmazonShare entity was cleared.

func (*UserMutation) AmazonSharesIDs

func (m *UserMutation) AmazonSharesIDs() (ids []int)

AmazonSharesIDs returns the "amazon_shares" edge IDs in the mutation.

func (*UserMutation) ClearAmazonLists

func (m *UserMutation) ClearAmazonLists()

ClearAmazonLists clears the "amazon_lists" edge to the AmazonList entity.

func (*UserMutation) ClearAmazonShares

func (m *UserMutation) ClearAmazonShares()

ClearAmazonShares clears the "amazon_shares" edge to the AmazonShare entity.

func (*UserMutation) ClearDrinks

func (m *UserMutation) ClearDrinks()

ClearDrinks clears the "drinks" edge to the Drink entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) 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) ClearGroceryListShares

func (m *UserMutation) ClearGroceryListShares()

ClearGroceryListShares clears the "grocery_list_shares" edge to the GroceryListShare entity.

func (*UserMutation) ClearGroceryLists

func (m *UserMutation) ClearGroceryLists()

ClearGroceryLists clears the "grocery_lists" edge to the GroceryList entity.

func (*UserMutation) ClearMovieCollectionShares

func (m *UserMutation) ClearMovieCollectionShares()

ClearMovieCollectionShares clears the "movie_collection_shares" edge to the MovieCollectionShare entity.

func (*UserMutation) ClearMovieCollections

func (m *UserMutation) ClearMovieCollections()

ClearMovieCollections clears the "movie_collections" edge to the MovieCollection entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) DisplayName

func (m *UserMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*UserMutation) DrinksCleared

func (m *UserMutation) DrinksCleared() bool

DrinksCleared reports if the "drinks" edge to the Drink entity was cleared.

func (*UserMutation) DrinksIDs

func (m *UserMutation) DrinksIDs() (ids []int)

DrinksIDs returns the "drinks" edge IDs 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) GroceryListSharesCleared

func (m *UserMutation) GroceryListSharesCleared() bool

GroceryListSharesCleared reports if the "grocery_list_shares" edge to the GroceryListShare entity was cleared.

func (*UserMutation) GroceryListSharesIDs

func (m *UserMutation) GroceryListSharesIDs() (ids []int)

GroceryListSharesIDs returns the "grocery_list_shares" edge IDs in the mutation.

func (*UserMutation) GroceryListsCleared

func (m *UserMutation) GroceryListsCleared() bool

GroceryListsCleared reports if the "grocery_lists" edge to the GroceryList entity was cleared.

func (*UserMutation) GroceryListsIDs

func (m *UserMutation) GroceryListsIDs() (ids []int)

GroceryListsIDs returns the "grocery_lists" edge IDs in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) LastLogin

func (m *UserMutation) LastLogin() (r time.Time, exists bool)

LastLogin returns the value of the "last_login" field in the mutation.

func (*UserMutation) Locked

func (m *UserMutation) Locked() (r bool, exists bool)

Locked returns the value of the "locked" field in the mutation.

func (*UserMutation) MovieCollectionSharesCleared

func (m *UserMutation) MovieCollectionSharesCleared() bool

MovieCollectionSharesCleared reports if the "movie_collection_shares" edge to the MovieCollectionShare entity was cleared.

func (*UserMutation) MovieCollectionSharesIDs

func (m *UserMutation) MovieCollectionSharesIDs() (ids []int)

MovieCollectionSharesIDs returns the "movie_collection_shares" edge IDs in the mutation.

func (*UserMutation) MovieCollectionsCleared

func (m *UserMutation) MovieCollectionsCleared() bool

MovieCollectionsCleared reports if the "movie_collections" edge to the MovieCollection entity was cleared.

func (*UserMutation) MovieCollectionsIDs

func (m *UserMutation) MovieCollectionsIDs() (ids []int)

MovieCollectionsIDs returns the "movie_collections" edge IDs in the mutation.

func (*UserMutation) NameChanges

func (m *UserMutation) NameChanges() (r int8, exists bool)

NameChanges returns the value of the "name_changes" field in 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) OldDisplayName

func (m *UserMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) 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) OldLastLogin

func (m *UserMutation) OldLastLogin(ctx context.Context) (v *time.Time, err error)

OldLastLogin returns the old "last_login" 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) OldLocked

func (m *UserMutation) OldLocked(ctx context.Context) (v bool, err error)

OldLocked returns the old "locked" 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) OldNameChanges

func (m *UserMutation) OldNameChanges(ctx context.Context) (v int8, err error)

OldNameChanges returns the old "name_changes" 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) OldVerified

func (m *UserMutation) OldVerified(ctx context.Context) (v bool, err error)

OldVerified returns the old "verified" 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) RemoveAmazonListIDs

func (m *UserMutation) RemoveAmazonListIDs(ids ...int)

RemoveAmazonListIDs removes the "amazon_lists" edge to the AmazonList entity by IDs.

func (*UserMutation) RemoveAmazonShareIDs

func (m *UserMutation) RemoveAmazonShareIDs(ids ...int)

RemoveAmazonShareIDs removes the "amazon_shares" edge to the AmazonShare entity by IDs.

func (*UserMutation) RemoveDrinkIDs

func (m *UserMutation) RemoveDrinkIDs(ids ...int)

RemoveDrinkIDs removes the "drinks" edge to the Drink entity by IDs.

func (*UserMutation) RemoveGroceryListIDs

func (m *UserMutation) RemoveGroceryListIDs(ids ...int)

RemoveGroceryListIDs removes the "grocery_lists" edge to the GroceryList entity by IDs.

func (*UserMutation) RemoveGroceryListShareIDs

func (m *UserMutation) RemoveGroceryListShareIDs(ids ...int)

RemoveGroceryListShareIDs removes the "grocery_list_shares" edge to the GroceryListShare entity by IDs.

func (*UserMutation) RemoveMovieCollectionIDs

func (m *UserMutation) RemoveMovieCollectionIDs(ids ...int)

RemoveMovieCollectionIDs removes the "movie_collections" edge to the MovieCollection entity by IDs.

func (*UserMutation) RemoveMovieCollectionShareIDs

func (m *UserMutation) RemoveMovieCollectionShareIDs(ids ...int)

RemoveMovieCollectionShareIDs removes the "movie_collection_shares" edge to the MovieCollectionShare entity by IDs.

func (*UserMutation) RemovedAmazonListsIDs

func (m *UserMutation) RemovedAmazonListsIDs() (ids []int)

RemovedAmazonLists returns the removed IDs of the "amazon_lists" edge to the AmazonList entity.

func (*UserMutation) RemovedAmazonSharesIDs

func (m *UserMutation) RemovedAmazonSharesIDs() (ids []int)

RemovedAmazonShares returns the removed IDs of the "amazon_shares" edge to the AmazonShare entity.

func (*UserMutation) RemovedDrinksIDs

func (m *UserMutation) RemovedDrinksIDs() (ids []int)

RemovedDrinks returns the removed IDs of the "drinks" edge to the Drink entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedGroceryListSharesIDs

func (m *UserMutation) RemovedGroceryListSharesIDs() (ids []int)

RemovedGroceryListShares returns the removed IDs of the "grocery_list_shares" edge to the GroceryListShare entity.

func (*UserMutation) RemovedGroceryListsIDs

func (m *UserMutation) RemovedGroceryListsIDs() (ids []int)

RemovedGroceryLists returns the removed IDs of the "grocery_lists" edge to the GroceryList entity.

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) RemovedMovieCollectionSharesIDs

func (m *UserMutation) RemovedMovieCollectionSharesIDs() (ids []int)

RemovedMovieCollectionShares returns the removed IDs of the "movie_collection_shares" edge to the MovieCollectionShare entity.

func (*UserMutation) RemovedMovieCollectionsIDs

func (m *UserMutation) RemovedMovieCollectionsIDs() (ids []int)

RemovedMovieCollections returns the removed IDs of the "movie_collections" edge to the MovieCollection entity.

func (*UserMutation) ResetAmazonLists

func (m *UserMutation) ResetAmazonLists()

ResetAmazonLists resets all changes to the "amazon_lists" edge.

func (*UserMutation) ResetAmazonShares

func (m *UserMutation) ResetAmazonShares()

ResetAmazonShares resets all changes to the "amazon_shares" edge.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDisplayName

func (m *UserMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*UserMutation) ResetDrinks

func (m *UserMutation) ResetDrinks()

ResetDrinks resets all changes to the "drinks" edge.

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) ResetGroceryListShares

func (m *UserMutation) ResetGroceryListShares()

ResetGroceryListShares resets all changes to the "grocery_list_shares" edge.

func (*UserMutation) ResetGroceryLists

func (m *UserMutation) ResetGroceryLists()

ResetGroceryLists resets all changes to the "grocery_lists" edge.

func (*UserMutation) ResetLastLogin

func (m *UserMutation) ResetLastLogin()

ResetLastLogin resets all changes to the "last_login" field.

func (*UserMutation) ResetLocked

func (m *UserMutation) ResetLocked()

ResetLocked resets all changes to the "locked" field.

func (*UserMutation) ResetMovieCollectionShares

func (m *UserMutation) ResetMovieCollectionShares()

ResetMovieCollectionShares resets all changes to the "movie_collection_shares" edge.

func (*UserMutation) ResetMovieCollections

func (m *UserMutation) ResetMovieCollections()

ResetMovieCollections resets all changes to the "movie_collections" edge.

func (*UserMutation) ResetNameChanges

func (m *UserMutation) ResetNameChanges()

ResetNameChanges resets all changes to the "name_changes" field.

func (*UserMutation) ResetVerified

func (m *UserMutation) ResetVerified()

ResetVerified resets all changes to the "verified" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetDisplayName

func (m *UserMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" 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) SetLastLogin

func (m *UserMutation) SetLastLogin(t time.Time)

SetLastLogin sets the "last_login" field.

func (*UserMutation) SetLocked

func (m *UserMutation) SetLocked(b bool)

SetLocked sets the "locked" field.

func (*UserMutation) SetNameChanges

func (m *UserMutation) SetNameChanges(i int8)

SetNameChanges sets the "name_changes" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetVerified

func (m *UserMutation) SetVerified(b bool)

SetVerified sets the "verified" 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) Verified

func (m *UserMutation) Verified() (r bool, exists bool)

Verified returns the value of the "verified" 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 int, 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) int

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 {
	DisplayName string `json:"display_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldDisplayName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

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 int, 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) int

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) QueryAmazonLists

func (uq *UserQuery) QueryAmazonLists() *AmazonListQuery

QueryAmazonLists chains the current query on the "amazon_lists" edge.

func (*UserQuery) QueryAmazonShares

func (uq *UserQuery) QueryAmazonShares() *AmazonShareQuery

QueryAmazonShares chains the current query on the "amazon_shares" edge.

func (*UserQuery) QueryDrinks

func (uq *UserQuery) QueryDrinks() *DrinkQuery

QueryDrinks chains the current query on the "drinks" edge.

func (*UserQuery) QueryGroceryListShares

func (uq *UserQuery) QueryGroceryListShares() *GroceryListShareQuery

QueryGroceryListShares chains the current query on the "grocery_list_shares" edge.

func (*UserQuery) QueryGroceryLists

func (uq *UserQuery) QueryGroceryLists() *GroceryListQuery

QueryGroceryLists chains the current query on the "grocery_lists" edge.

func (*UserQuery) QueryMovieCollectionShares

func (uq *UserQuery) QueryMovieCollectionShares() *MovieCollectionShareQuery

QueryMovieCollectionShares chains the current query on the "movie_collection_shares" edge.

func (*UserQuery) QueryMovieCollections

func (uq *UserQuery) QueryMovieCollections() *MovieCollectionQuery

QueryMovieCollections chains the current query on the "movie_collections" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	DisplayName string `json:"display_name,omitempty"`
}

client.User.Query().
	Select(user.FieldDisplayName).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithAmazonLists

func (uq *UserQuery) WithAmazonLists(opts ...func(*AmazonListQuery)) *UserQuery

WithAmazonLists tells the query-builder to eager-load the nodes that are connected to the "amazon_lists" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithAmazonShares

func (uq *UserQuery) WithAmazonShares(opts ...func(*AmazonShareQuery)) *UserQuery

WithAmazonShares tells the query-builder to eager-load the nodes that are connected to the "amazon_shares" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithDrinks

func (uq *UserQuery) WithDrinks(opts ...func(*DrinkQuery)) *UserQuery

WithDrinks tells the query-builder to eager-load the nodes that are connected to the "drinks" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithGroceryListShares

func (uq *UserQuery) WithGroceryListShares(opts ...func(*GroceryListShareQuery)) *UserQuery

WithGroceryListShares tells the query-builder to eager-load the nodes that are connected to the "grocery_list_shares" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithGroceryLists

func (uq *UserQuery) WithGroceryLists(opts ...func(*GroceryListQuery)) *UserQuery

WithGroceryLists tells the query-builder to eager-load the nodes that are connected to the "grocery_lists" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithMovieCollectionShares

func (uq *UserQuery) WithMovieCollectionShares(opts ...func(*MovieCollectionShareQuery)) *UserQuery

WithMovieCollectionShares tells the query-builder to eager-load the nodes that are connected to the "movie_collection_shares" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithMovieCollections

func (uq *UserQuery) WithMovieCollections(opts ...func(*MovieCollectionQuery)) *UserQuery

WithMovieCollections tells the query-builder to eager-load the nodes that are connected to the "movie_collections" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) 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) AddAmazonListIDs

func (uu *UserUpdate) AddAmazonListIDs(ids ...int) *UserUpdate

AddAmazonListIDs adds the "amazon_lists" edge to the AmazonList entity by IDs.

func (*UserUpdate) AddAmazonLists

func (uu *UserUpdate) AddAmazonLists(a ...*AmazonList) *UserUpdate

AddAmazonLists adds the "amazon_lists" edges to the AmazonList entity.

func (*UserUpdate) AddAmazonShareIDs

func (uu *UserUpdate) AddAmazonShareIDs(ids ...int) *UserUpdate

AddAmazonShareIDs adds the "amazon_shares" edge to the AmazonShare entity by IDs.

func (*UserUpdate) AddAmazonShares

func (uu *UserUpdate) AddAmazonShares(a ...*AmazonShare) *UserUpdate

AddAmazonShares adds the "amazon_shares" edges to the AmazonShare entity.

func (*UserUpdate) AddDrinkIDs

func (uu *UserUpdate) AddDrinkIDs(ids ...int) *UserUpdate

AddDrinkIDs adds the "drinks" edge to the Drink entity by IDs.

func (*UserUpdate) AddDrinks

func (uu *UserUpdate) AddDrinks(d ...*Drink) *UserUpdate

AddDrinks adds the "drinks" edges to the Drink entity.

func (*UserUpdate) AddGroceryListIDs

func (uu *UserUpdate) AddGroceryListIDs(ids ...int) *UserUpdate

AddGroceryListIDs adds the "grocery_lists" edge to the GroceryList entity by IDs.

func (*UserUpdate) AddGroceryListShareIDs

func (uu *UserUpdate) AddGroceryListShareIDs(ids ...int) *UserUpdate

AddGroceryListShareIDs adds the "grocery_list_shares" edge to the GroceryListShare entity by IDs.

func (*UserUpdate) AddGroceryListShares

func (uu *UserUpdate) AddGroceryListShares(g ...*GroceryListShare) *UserUpdate

AddGroceryListShares adds the "grocery_list_shares" edges to the GroceryListShare entity.

func (*UserUpdate) AddGroceryLists

func (uu *UserUpdate) AddGroceryLists(g ...*GroceryList) *UserUpdate

AddGroceryLists adds the "grocery_lists" edges to the GroceryList entity.

func (*UserUpdate) AddMovieCollectionIDs

func (uu *UserUpdate) AddMovieCollectionIDs(ids ...int) *UserUpdate

AddMovieCollectionIDs adds the "movie_collections" edge to the MovieCollection entity by IDs.

func (*UserUpdate) AddMovieCollectionShareIDs

func (uu *UserUpdate) AddMovieCollectionShareIDs(ids ...int) *UserUpdate

AddMovieCollectionShareIDs adds the "movie_collection_shares" edge to the MovieCollectionShare entity by IDs.

func (*UserUpdate) AddMovieCollectionShares

func (uu *UserUpdate) AddMovieCollectionShares(m ...*MovieCollectionShare) *UserUpdate

AddMovieCollectionShares adds the "movie_collection_shares" edges to the MovieCollectionShare entity.

func (*UserUpdate) AddMovieCollections

func (uu *UserUpdate) AddMovieCollections(m ...*MovieCollection) *UserUpdate

AddMovieCollections adds the "movie_collections" edges to the MovieCollection entity.

func (*UserUpdate) AddNameChanges

func (uu *UserUpdate) AddNameChanges(i int8) *UserUpdate

AddNameChanges adds i to the "name_changes" field.

func (*UserUpdate) ClearAmazonLists

func (uu *UserUpdate) ClearAmazonLists() *UserUpdate

ClearAmazonLists clears all "amazon_lists" edges to the AmazonList entity.

func (*UserUpdate) ClearAmazonShares

func (uu *UserUpdate) ClearAmazonShares() *UserUpdate

ClearAmazonShares clears all "amazon_shares" edges to the AmazonShare entity.

func (*UserUpdate) ClearDrinks

func (uu *UserUpdate) ClearDrinks() *UserUpdate

ClearDrinks clears all "drinks" edges to the Drink entity.

func (*UserUpdate) ClearGroceryListShares

func (uu *UserUpdate) ClearGroceryListShares() *UserUpdate

ClearGroceryListShares clears all "grocery_list_shares" edges to the GroceryListShare entity.

func (*UserUpdate) ClearGroceryLists

func (uu *UserUpdate) ClearGroceryLists() *UserUpdate

ClearGroceryLists clears all "grocery_lists" edges to the GroceryList entity.

func (*UserUpdate) ClearMovieCollectionShares

func (uu *UserUpdate) ClearMovieCollectionShares() *UserUpdate

ClearMovieCollectionShares clears all "movie_collection_shares" edges to the MovieCollectionShare entity.

func (*UserUpdate) ClearMovieCollections

func (uu *UserUpdate) ClearMovieCollections() *UserUpdate

ClearMovieCollections clears all "movie_collections" edges to the MovieCollection entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveAmazonListIDs

func (uu *UserUpdate) RemoveAmazonListIDs(ids ...int) *UserUpdate

RemoveAmazonListIDs removes the "amazon_lists" edge to AmazonList entities by IDs.

func (*UserUpdate) RemoveAmazonLists

func (uu *UserUpdate) RemoveAmazonLists(a ...*AmazonList) *UserUpdate

RemoveAmazonLists removes "amazon_lists" edges to AmazonList entities.

func (*UserUpdate) RemoveAmazonShareIDs

func (uu *UserUpdate) RemoveAmazonShareIDs(ids ...int) *UserUpdate

RemoveAmazonShareIDs removes the "amazon_shares" edge to AmazonShare entities by IDs.

func (*UserUpdate) RemoveAmazonShares

func (uu *UserUpdate) RemoveAmazonShares(a ...*AmazonShare) *UserUpdate

RemoveAmazonShares removes "amazon_shares" edges to AmazonShare entities.

func (*UserUpdate) RemoveDrinkIDs

func (uu *UserUpdate) RemoveDrinkIDs(ids ...int) *UserUpdate

RemoveDrinkIDs removes the "drinks" edge to Drink entities by IDs.

func (*UserUpdate) RemoveDrinks

func (uu *UserUpdate) RemoveDrinks(d ...*Drink) *UserUpdate

RemoveDrinks removes "drinks" edges to Drink entities.

func (*UserUpdate) RemoveGroceryListIDs

func (uu *UserUpdate) RemoveGroceryListIDs(ids ...int) *UserUpdate

RemoveGroceryListIDs removes the "grocery_lists" edge to GroceryList entities by IDs.

func (*UserUpdate) RemoveGroceryListShareIDs

func (uu *UserUpdate) RemoveGroceryListShareIDs(ids ...int) *UserUpdate

RemoveGroceryListShareIDs removes the "grocery_list_shares" edge to GroceryListShare entities by IDs.

func (*UserUpdate) RemoveGroceryListShares

func (uu *UserUpdate) RemoveGroceryListShares(g ...*GroceryListShare) *UserUpdate

RemoveGroceryListShares removes "grocery_list_shares" edges to GroceryListShare entities.

func (*UserUpdate) RemoveGroceryLists

func (uu *UserUpdate) RemoveGroceryLists(g ...*GroceryList) *UserUpdate

RemoveGroceryLists removes "grocery_lists" edges to GroceryList entities.

func (*UserUpdate) RemoveMovieCollectionIDs

func (uu *UserUpdate) RemoveMovieCollectionIDs(ids ...int) *UserUpdate

RemoveMovieCollectionIDs removes the "movie_collections" edge to MovieCollection entities by IDs.

func (*UserUpdate) RemoveMovieCollectionShareIDs

func (uu *UserUpdate) RemoveMovieCollectionShareIDs(ids ...int) *UserUpdate

RemoveMovieCollectionShareIDs removes the "movie_collection_shares" edge to MovieCollectionShare entities by IDs.

func (*UserUpdate) RemoveMovieCollectionShares

func (uu *UserUpdate) RemoveMovieCollectionShares(m ...*MovieCollectionShare) *UserUpdate

RemoveMovieCollectionShares removes "movie_collection_shares" edges to MovieCollectionShare entities.

func (*UserUpdate) RemoveMovieCollections

func (uu *UserUpdate) RemoveMovieCollections(m ...*MovieCollection) *UserUpdate

RemoveMovieCollections removes "movie_collections" edges to MovieCollection entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetCreatedAt

func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate

SetCreatedAt sets the "created_at" field.

func (*UserUpdate) SetDisplayName

func (uu *UserUpdate) SetDisplayName(s string) *UserUpdate

SetDisplayName sets the "display_name" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetLastLogin

func (uu *UserUpdate) SetLastLogin(t time.Time) *UserUpdate

SetLastLogin sets the "last_login" field.

func (*UserUpdate) SetLocked

func (uu *UserUpdate) SetLocked(b bool) *UserUpdate

SetLocked sets the "locked" field.

func (*UserUpdate) SetNameChanges

func (uu *UserUpdate) SetNameChanges(i int8) *UserUpdate

SetNameChanges sets the "name_changes" field.

func (*UserUpdate) SetNillableCreatedAt

func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserUpdate) SetNillableLocked

func (uu *UserUpdate) SetNillableLocked(b *bool) *UserUpdate

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*UserUpdate) SetNillableNameChanges

func (uu *UserUpdate) SetNillableNameChanges(i *int8) *UserUpdate

SetNillableNameChanges sets the "name_changes" field if the given value is not nil.

func (*UserUpdate) SetNillableVerified

func (uu *UserUpdate) SetNillableVerified(b *bool) *UserUpdate

SetNillableVerified sets the "verified" field if the given value is not nil.

func (*UserUpdate) SetVerified

func (uu *UserUpdate) SetVerified(b bool) *UserUpdate

SetVerified sets the "verified" 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) AddAmazonListIDs

func (uuo *UserUpdateOne) AddAmazonListIDs(ids ...int) *UserUpdateOne

AddAmazonListIDs adds the "amazon_lists" edge to the AmazonList entity by IDs.

func (*UserUpdateOne) AddAmazonLists

func (uuo *UserUpdateOne) AddAmazonLists(a ...*AmazonList) *UserUpdateOne

AddAmazonLists adds the "amazon_lists" edges to the AmazonList entity.

func (*UserUpdateOne) AddAmazonShareIDs

func (uuo *UserUpdateOne) AddAmazonShareIDs(ids ...int) *UserUpdateOne

AddAmazonShareIDs adds the "amazon_shares" edge to the AmazonShare entity by IDs.

func (*UserUpdateOne) AddAmazonShares

func (uuo *UserUpdateOne) AddAmazonShares(a ...*AmazonShare) *UserUpdateOne

AddAmazonShares adds the "amazon_shares" edges to the AmazonShare entity.

func (*UserUpdateOne) AddDrinkIDs

func (uuo *UserUpdateOne) AddDrinkIDs(ids ...int) *UserUpdateOne

AddDrinkIDs adds the "drinks" edge to the Drink entity by IDs.

func (*UserUpdateOne) AddDrinks

func (uuo *UserUpdateOne) AddDrinks(d ...*Drink) *UserUpdateOne

AddDrinks adds the "drinks" edges to the Drink entity.

func (*UserUpdateOne) AddGroceryListIDs

func (uuo *UserUpdateOne) AddGroceryListIDs(ids ...int) *UserUpdateOne

AddGroceryListIDs adds the "grocery_lists" edge to the GroceryList entity by IDs.

func (*UserUpdateOne) AddGroceryListShareIDs

func (uuo *UserUpdateOne) AddGroceryListShareIDs(ids ...int) *UserUpdateOne

AddGroceryListShareIDs adds the "grocery_list_shares" edge to the GroceryListShare entity by IDs.

func (*UserUpdateOne) AddGroceryListShares

func (uuo *UserUpdateOne) AddGroceryListShares(g ...*GroceryListShare) *UserUpdateOne

AddGroceryListShares adds the "grocery_list_shares" edges to the GroceryListShare entity.

func (*UserUpdateOne) AddGroceryLists

func (uuo *UserUpdateOne) AddGroceryLists(g ...*GroceryList) *UserUpdateOne

AddGroceryLists adds the "grocery_lists" edges to the GroceryList entity.

func (*UserUpdateOne) AddMovieCollectionIDs

func (uuo *UserUpdateOne) AddMovieCollectionIDs(ids ...int) *UserUpdateOne

AddMovieCollectionIDs adds the "movie_collections" edge to the MovieCollection entity by IDs.

func (*UserUpdateOne) AddMovieCollectionShareIDs

func (uuo *UserUpdateOne) AddMovieCollectionShareIDs(ids ...int) *UserUpdateOne

AddMovieCollectionShareIDs adds the "movie_collection_shares" edge to the MovieCollectionShare entity by IDs.

func (*UserUpdateOne) AddMovieCollectionShares

func (uuo *UserUpdateOne) AddMovieCollectionShares(m ...*MovieCollectionShare) *UserUpdateOne

AddMovieCollectionShares adds the "movie_collection_shares" edges to the MovieCollectionShare entity.

func (*UserUpdateOne) AddMovieCollections

func (uuo *UserUpdateOne) AddMovieCollections(m ...*MovieCollection) *UserUpdateOne

AddMovieCollections adds the "movie_collections" edges to the MovieCollection entity.

func (*UserUpdateOne) AddNameChanges

func (uuo *UserUpdateOne) AddNameChanges(i int8) *UserUpdateOne

AddNameChanges adds i to the "name_changes" field.

func (*UserUpdateOne) ClearAmazonLists

func (uuo *UserUpdateOne) ClearAmazonLists() *UserUpdateOne

ClearAmazonLists clears all "amazon_lists" edges to the AmazonList entity.

func (*UserUpdateOne) ClearAmazonShares

func (uuo *UserUpdateOne) ClearAmazonShares() *UserUpdateOne

ClearAmazonShares clears all "amazon_shares" edges to the AmazonShare entity.

func (*UserUpdateOne) ClearDrinks

func (uuo *UserUpdateOne) ClearDrinks() *UserUpdateOne

ClearDrinks clears all "drinks" edges to the Drink entity.

func (*UserUpdateOne) ClearGroceryListShares

func (uuo *UserUpdateOne) ClearGroceryListShares() *UserUpdateOne

ClearGroceryListShares clears all "grocery_list_shares" edges to the GroceryListShare entity.

func (*UserUpdateOne) ClearGroceryLists

func (uuo *UserUpdateOne) ClearGroceryLists() *UserUpdateOne

ClearGroceryLists clears all "grocery_lists" edges to the GroceryList entity.

func (*UserUpdateOne) ClearMovieCollectionShares

func (uuo *UserUpdateOne) ClearMovieCollectionShares() *UserUpdateOne

ClearMovieCollectionShares clears all "movie_collection_shares" edges to the MovieCollectionShare entity.

func (*UserUpdateOne) ClearMovieCollections

func (uuo *UserUpdateOne) ClearMovieCollections() *UserUpdateOne

ClearMovieCollections clears all "movie_collections" edges to the MovieCollection 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) RemoveAmazonListIDs

func (uuo *UserUpdateOne) RemoveAmazonListIDs(ids ...int) *UserUpdateOne

RemoveAmazonListIDs removes the "amazon_lists" edge to AmazonList entities by IDs.

func (*UserUpdateOne) RemoveAmazonLists

func (uuo *UserUpdateOne) RemoveAmazonLists(a ...*AmazonList) *UserUpdateOne

RemoveAmazonLists removes "amazon_lists" edges to AmazonList entities.

func (*UserUpdateOne) RemoveAmazonShareIDs

func (uuo *UserUpdateOne) RemoveAmazonShareIDs(ids ...int) *UserUpdateOne

RemoveAmazonShareIDs removes the "amazon_shares" edge to AmazonShare entities by IDs.

func (*UserUpdateOne) RemoveAmazonShares

func (uuo *UserUpdateOne) RemoveAmazonShares(a ...*AmazonShare) *UserUpdateOne

RemoveAmazonShares removes "amazon_shares" edges to AmazonShare entities.

func (*UserUpdateOne) RemoveDrinkIDs

func (uuo *UserUpdateOne) RemoveDrinkIDs(ids ...int) *UserUpdateOne

RemoveDrinkIDs removes the "drinks" edge to Drink entities by IDs.

func (*UserUpdateOne) RemoveDrinks

func (uuo *UserUpdateOne) RemoveDrinks(d ...*Drink) *UserUpdateOne

RemoveDrinks removes "drinks" edges to Drink entities.

func (*UserUpdateOne) RemoveGroceryListIDs

func (uuo *UserUpdateOne) RemoveGroceryListIDs(ids ...int) *UserUpdateOne

RemoveGroceryListIDs removes the "grocery_lists" edge to GroceryList entities by IDs.

func (*UserUpdateOne) RemoveGroceryListShareIDs

func (uuo *UserUpdateOne) RemoveGroceryListShareIDs(ids ...int) *UserUpdateOne

RemoveGroceryListShareIDs removes the "grocery_list_shares" edge to GroceryListShare entities by IDs.

func (*UserUpdateOne) RemoveGroceryListShares

func (uuo *UserUpdateOne) RemoveGroceryListShares(g ...*GroceryListShare) *UserUpdateOne

RemoveGroceryListShares removes "grocery_list_shares" edges to GroceryListShare entities.

func (*UserUpdateOne) RemoveGroceryLists

func (uuo *UserUpdateOne) RemoveGroceryLists(g ...*GroceryList) *UserUpdateOne

RemoveGroceryLists removes "grocery_lists" edges to GroceryList entities.

func (*UserUpdateOne) RemoveMovieCollectionIDs

func (uuo *UserUpdateOne) RemoveMovieCollectionIDs(ids ...int) *UserUpdateOne

RemoveMovieCollectionIDs removes the "movie_collections" edge to MovieCollection entities by IDs.

func (*UserUpdateOne) RemoveMovieCollectionShareIDs

func (uuo *UserUpdateOne) RemoveMovieCollectionShareIDs(ids ...int) *UserUpdateOne

RemoveMovieCollectionShareIDs removes the "movie_collection_shares" edge to MovieCollectionShare entities by IDs.

func (*UserUpdateOne) RemoveMovieCollectionShares

func (uuo *UserUpdateOne) RemoveMovieCollectionShares(m ...*MovieCollectionShare) *UserUpdateOne

RemoveMovieCollectionShares removes "movie_collection_shares" edges to MovieCollectionShare entities.

func (*UserUpdateOne) RemoveMovieCollections

func (uuo *UserUpdateOne) RemoveMovieCollections(m ...*MovieCollection) *UserUpdateOne

RemoveMovieCollections removes "movie_collections" edges to MovieCollection entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetCreatedAt

func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne

SetCreatedAt sets the "created_at" field.

func (*UserUpdateOne) SetDisplayName

func (uuo *UserUpdateOne) SetDisplayName(s string) *UserUpdateOne

SetDisplayName sets the "display_name" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetLastLogin

func (uuo *UserUpdateOne) SetLastLogin(t time.Time) *UserUpdateOne

SetLastLogin sets the "last_login" field.

func (*UserUpdateOne) SetLocked

func (uuo *UserUpdateOne) SetLocked(b bool) *UserUpdateOne

SetLocked sets the "locked" field.

func (*UserUpdateOne) SetNameChanges

func (uuo *UserUpdateOne) SetNameChanges(i int8) *UserUpdateOne

SetNameChanges sets the "name_changes" field.

func (*UserUpdateOne) SetNillableCreatedAt

func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLocked

func (uuo *UserUpdateOne) SetNillableLocked(b *bool) *UserUpdateOne

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*UserUpdateOne) SetNillableNameChanges

func (uuo *UserUpdateOne) SetNillableNameChanges(i *int8) *UserUpdateOne

SetNillableNameChanges sets the "name_changes" field if the given value is not nil.

func (*UserUpdateOne) SetNillableVerified

func (uuo *UserUpdateOne) SetNillableVerified(b *bool) *UserUpdateOne

SetNillableVerified sets the "verified" field if the given value is not nil.

func (*UserUpdateOne) SetVerified

func (uuo *UserUpdateOne) SetVerified(b bool) *UserUpdateOne

SetVerified sets the "verified" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

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
proto
entpb
Code generated by protoc-gen-entgrpc.
Code generated by protoc-gen-entgrpc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL