Documentation
¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type Address
- type AddressClient
- func (c *AddressClient) Create() *AddressCreate
- func (c *AddressClient) CreateBulk(builders ...*AddressCreate) *AddressCreateBulk
- func (c *AddressClient) Delete() *AddressDelete
- func (c *AddressClient) DeleteOne(a *Address) *AddressDeleteOne
- func (c *AddressClient) DeleteOneID(id int64) *AddressDeleteOne
- func (c *AddressClient) Get(ctx context.Context, id int64) (*Address, error)
- func (c *AddressClient) GetX(ctx context.Context, id int64) *Address
- func (c *AddressClient) Hooks() []Hook
- func (c *AddressClient) Intercept(interceptors ...Interceptor)
- func (c *AddressClient) Interceptors() []Interceptor
- func (c *AddressClient) MapCreateBulk(slice any, setFunc func(*AddressCreate, int)) *AddressCreateBulk
- func (c *AddressClient) Query() *AddressQuery
- func (c *AddressClient) QueryUsers(a *Address) *UserQuery
- func (c *AddressClient) Update() *AddressUpdate
- func (c *AddressClient) UpdateOne(a *Address) *AddressUpdateOne
- func (c *AddressClient) UpdateOneID(id int64) *AddressUpdateOne
- func (c *AddressClient) Use(hooks ...Hook)
- type AddressCreate
- func (ac *AddressCreate) Exec(ctx context.Context) error
- func (ac *AddressCreate) ExecX(ctx context.Context)
- func (ac *AddressCreate) Mutation() *AddressMutation
- func (ac *AddressCreate) OnConflict(opts ...sql.ConflictOption) *AddressUpsertOne
- func (ac *AddressCreate) OnConflictColumns(columns ...string) *AddressUpsertOne
- func (ac *AddressCreate) Save(ctx context.Context) (*Address, error)
- func (ac *AddressCreate) SaveX(ctx context.Context) *Address
- func (ac *AddressCreate) SetCity(s string) *AddressCreate
- func (ac *AddressCreate) SetCountry(s string) *AddressCreate
- func (ac *AddressCreate) SetCreatedAt(t time.Time) *AddressCreate
- func (ac *AddressCreate) SetFlat(i int) *AddressCreate
- func (ac *AddressCreate) SetHouse(i int) *AddressCreate
- func (ac *AddressCreate) SetLetter(s string) *AddressCreate
- func (ac *AddressCreate) SetNillableCreatedAt(t *time.Time) *AddressCreate
- func (ac *AddressCreate) SetNillableFlat(i *int) *AddressCreate
- func (ac *AddressCreate) SetNillableLetter(s *string) *AddressCreate
- func (ac *AddressCreate) SetNillableUpdatedAt(t *time.Time) *AddressCreate
- func (ac *AddressCreate) SetPostcode(i int) *AddressCreate
- func (ac *AddressCreate) SetStreet(s string) *AddressCreate
- func (ac *AddressCreate) SetUpdatedAt(t time.Time) *AddressCreate
- func (ac *AddressCreate) SetUserID(i int64) *AddressCreate
- func (ac *AddressCreate) SetUsers(u *User) *AddressCreate
- func (ac *AddressCreate) SetUsersID(id int64) *AddressCreate
- type AddressCreateBulk
- func (acb *AddressCreateBulk) Exec(ctx context.Context) error
- func (acb *AddressCreateBulk) ExecX(ctx context.Context)
- func (acb *AddressCreateBulk) OnConflict(opts ...sql.ConflictOption) *AddressUpsertBulk
- func (acb *AddressCreateBulk) OnConflictColumns(columns ...string) *AddressUpsertBulk
- func (acb *AddressCreateBulk) Save(ctx context.Context) ([]*Address, error)
- func (acb *AddressCreateBulk) SaveX(ctx context.Context) []*Address
- type AddressDelete
- type AddressDeleteOne
- type AddressEdges
- type AddressGroupBy
- func (agb *AddressGroupBy) Aggregate(fns ...AggregateFunc) *AddressGroupBy
- func (s *AddressGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AddressGroupBy) BoolX(ctx context.Context) bool
- func (s *AddressGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AddressGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AddressGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AddressGroupBy) Float64X(ctx context.Context) float64
- func (s *AddressGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AddressGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AddressGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AddressGroupBy) IntX(ctx context.Context) int
- func (s *AddressGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AddressGroupBy) IntsX(ctx context.Context) []int
- func (agb *AddressGroupBy) Scan(ctx context.Context, v any) error
- func (s *AddressGroupBy) ScanX(ctx context.Context, v any)
- func (s *AddressGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AddressGroupBy) StringX(ctx context.Context) string
- func (s *AddressGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AddressGroupBy) StringsX(ctx context.Context) []string
- type AddressMutation
- func (m *AddressMutation) AddField(name string, value ent.Value) error
- func (m *AddressMutation) AddFlat(i int)
- func (m *AddressMutation) AddHouse(i int)
- func (m *AddressMutation) AddPostcode(i int)
- func (m *AddressMutation) AddedEdges() []string
- func (m *AddressMutation) AddedField(name string) (ent.Value, bool)
- func (m *AddressMutation) AddedFields() []string
- func (m *AddressMutation) AddedFlat() (r int, exists bool)
- func (m *AddressMutation) AddedHouse() (r int, exists bool)
- func (m *AddressMutation) AddedIDs(name string) []ent.Value
- func (m *AddressMutation) AddedPostcode() (r int, exists bool)
- func (m *AddressMutation) City() (r string, exists bool)
- func (m *AddressMutation) ClearEdge(name string) error
- func (m *AddressMutation) ClearField(name string) error
- func (m *AddressMutation) ClearFlat()
- func (m *AddressMutation) ClearLetter()
- func (m *AddressMutation) ClearUsers()
- func (m *AddressMutation) ClearedEdges() []string
- func (m *AddressMutation) ClearedFields() []string
- func (m AddressMutation) Client() *Client
- func (m *AddressMutation) Country() (r string, exists bool)
- func (m *AddressMutation) CreatedAt() (r time.Time, exists bool)
- func (m *AddressMutation) EdgeCleared(name string) bool
- func (m *AddressMutation) Field(name string) (ent.Value, bool)
- func (m *AddressMutation) FieldCleared(name string) bool
- func (m *AddressMutation) Fields() []string
- func (m *AddressMutation) Flat() (r int, exists bool)
- func (m *AddressMutation) FlatCleared() bool
- func (m *AddressMutation) House() (r int, exists bool)
- func (m *AddressMutation) ID() (id int64, exists bool)
- func (m *AddressMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *AddressMutation) Letter() (r string, exists bool)
- func (m *AddressMutation) LetterCleared() bool
- func (m *AddressMutation) OldCity(ctx context.Context) (v string, err error)
- func (m *AddressMutation) OldCountry(ctx context.Context) (v string, err error)
- func (m *AddressMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *AddressMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AddressMutation) OldFlat(ctx context.Context) (v int, err error)
- func (m *AddressMutation) OldHouse(ctx context.Context) (v int, err error)
- func (m *AddressMutation) OldLetter(ctx context.Context) (v string, err error)
- func (m *AddressMutation) OldPostcode(ctx context.Context) (v int, err error)
- func (m *AddressMutation) OldStreet(ctx context.Context) (v string, err error)
- func (m *AddressMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *AddressMutation) OldUserID(ctx context.Context) (v int64, err error)
- func (m *AddressMutation) Op() Op
- func (m *AddressMutation) Postcode() (r int, exists bool)
- func (m *AddressMutation) RemovedEdges() []string
- func (m *AddressMutation) RemovedIDs(name string) []ent.Value
- func (m *AddressMutation) ResetCity()
- func (m *AddressMutation) ResetCountry()
- func (m *AddressMutation) ResetCreatedAt()
- func (m *AddressMutation) ResetEdge(name string) error
- func (m *AddressMutation) ResetField(name string) error
- func (m *AddressMutation) ResetFlat()
- func (m *AddressMutation) ResetHouse()
- func (m *AddressMutation) ResetLetter()
- func (m *AddressMutation) ResetPostcode()
- func (m *AddressMutation) ResetStreet()
- func (m *AddressMutation) ResetUpdatedAt()
- func (m *AddressMutation) ResetUserID()
- func (m *AddressMutation) ResetUsers()
- func (m *AddressMutation) SetCity(s string)
- func (m *AddressMutation) SetCountry(s string)
- func (m *AddressMutation) SetCreatedAt(t time.Time)
- func (m *AddressMutation) SetField(name string, value ent.Value) error
- func (m *AddressMutation) SetFlat(i int)
- func (m *AddressMutation) SetHouse(i int)
- func (m *AddressMutation) SetLetter(s string)
- func (m *AddressMutation) SetOp(op Op)
- func (m *AddressMutation) SetPostcode(i int)
- func (m *AddressMutation) SetStreet(s string)
- func (m *AddressMutation) SetUpdatedAt(t time.Time)
- func (m *AddressMutation) SetUserID(i int64)
- func (m *AddressMutation) SetUsersID(id int64)
- func (m *AddressMutation) Street() (r string, exists bool)
- func (m AddressMutation) Tx() (*Tx, error)
- func (m *AddressMutation) Type() string
- func (m *AddressMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *AddressMutation) UserID() (r int64, exists bool)
- func (m *AddressMutation) UsersCleared() bool
- func (m *AddressMutation) UsersID() (id int64, exists bool)
- func (m *AddressMutation) UsersIDs() (ids []int64)
- func (m *AddressMutation) Where(ps ...predicate.Address)
- func (m *AddressMutation) WhereP(ps ...func(*sql.Selector))
- type AddressQuery
- func (aq *AddressQuery) Aggregate(fns ...AggregateFunc) *AddressSelect
- func (aq *AddressQuery) All(ctx context.Context) ([]*Address, error)
- func (aq *AddressQuery) AllX(ctx context.Context) []*Address
- func (aq *AddressQuery) Clone() *AddressQuery
- func (aq *AddressQuery) Count(ctx context.Context) (int, error)
- func (aq *AddressQuery) CountX(ctx context.Context) int
- func (aq *AddressQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AddressQuery) ExistX(ctx context.Context) bool
- func (aq *AddressQuery) First(ctx context.Context) (*Address, error)
- func (aq *AddressQuery) FirstID(ctx context.Context) (id int64, err error)
- func (aq *AddressQuery) FirstIDX(ctx context.Context) int64
- func (aq *AddressQuery) FirstX(ctx context.Context) *Address
- func (aq *AddressQuery) GroupBy(field string, fields ...string) *AddressGroupBy
- func (aq *AddressQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (aq *AddressQuery) IDsX(ctx context.Context) []int64
- func (aq *AddressQuery) Limit(limit int) *AddressQuery
- func (aq *AddressQuery) Offset(offset int) *AddressQuery
- func (aq *AddressQuery) Only(ctx context.Context) (*Address, error)
- func (aq *AddressQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (aq *AddressQuery) OnlyIDX(ctx context.Context) int64
- func (aq *AddressQuery) OnlyX(ctx context.Context) *Address
- func (aq *AddressQuery) Order(o ...address.OrderOption) *AddressQuery
- func (aq *AddressQuery) QueryUsers() *UserQuery
- func (aq *AddressQuery) Select(fields ...string) *AddressSelect
- func (aq *AddressQuery) Unique(unique bool) *AddressQuery
- func (aq *AddressQuery) Where(ps ...predicate.Address) *AddressQuery
- func (aq *AddressQuery) WithUsers(opts ...func(*UserQuery)) *AddressQuery
- type AddressSelect
- func (as *AddressSelect) Aggregate(fns ...AggregateFunc) *AddressSelect
- func (s *AddressSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AddressSelect) BoolX(ctx context.Context) bool
- func (s *AddressSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AddressSelect) BoolsX(ctx context.Context) []bool
- func (s *AddressSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AddressSelect) Float64X(ctx context.Context) float64
- func (s *AddressSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AddressSelect) Float64sX(ctx context.Context) []float64
- func (s *AddressSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AddressSelect) IntX(ctx context.Context) int
- func (s *AddressSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AddressSelect) IntsX(ctx context.Context) []int
- func (as *AddressSelect) Scan(ctx context.Context, v any) error
- func (s *AddressSelect) ScanX(ctx context.Context, v any)
- func (s *AddressSelect) String(ctx context.Context) (_ string, err error)
- func (s *AddressSelect) StringX(ctx context.Context) string
- func (s *AddressSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AddressSelect) StringsX(ctx context.Context) []string
- type AddressUpdate
- func (au *AddressUpdate) AddFlat(i int) *AddressUpdate
- func (au *AddressUpdate) AddHouse(i int) *AddressUpdate
- func (au *AddressUpdate) AddPostcode(i int) *AddressUpdate
- func (au *AddressUpdate) ClearFlat() *AddressUpdate
- func (au *AddressUpdate) ClearLetter() *AddressUpdate
- func (au *AddressUpdate) ClearUsers() *AddressUpdate
- func (au *AddressUpdate) Exec(ctx context.Context) error
- func (au *AddressUpdate) ExecX(ctx context.Context)
- func (au *AddressUpdate) Mutation() *AddressMutation
- func (au *AddressUpdate) Save(ctx context.Context) (int, error)
- func (au *AddressUpdate) SaveX(ctx context.Context) int
- func (au *AddressUpdate) SetCity(s string) *AddressUpdate
- func (au *AddressUpdate) SetCountry(s string) *AddressUpdate
- func (au *AddressUpdate) SetFlat(i int) *AddressUpdate
- func (au *AddressUpdate) SetHouse(i int) *AddressUpdate
- func (au *AddressUpdate) SetLetter(s string) *AddressUpdate
- func (au *AddressUpdate) SetNillableCity(s *string) *AddressUpdate
- func (au *AddressUpdate) SetNillableCountry(s *string) *AddressUpdate
- func (au *AddressUpdate) SetNillableFlat(i *int) *AddressUpdate
- func (au *AddressUpdate) SetNillableHouse(i *int) *AddressUpdate
- func (au *AddressUpdate) SetNillableLetter(s *string) *AddressUpdate
- func (au *AddressUpdate) SetNillablePostcode(i *int) *AddressUpdate
- func (au *AddressUpdate) SetNillableStreet(s *string) *AddressUpdate
- func (au *AddressUpdate) SetNillableUserID(i *int64) *AddressUpdate
- func (au *AddressUpdate) SetPostcode(i int) *AddressUpdate
- func (au *AddressUpdate) SetStreet(s string) *AddressUpdate
- func (au *AddressUpdate) SetUpdatedAt(t time.Time) *AddressUpdate
- func (au *AddressUpdate) SetUserID(i int64) *AddressUpdate
- func (au *AddressUpdate) SetUsers(u *User) *AddressUpdate
- func (au *AddressUpdate) SetUsersID(id int64) *AddressUpdate
- func (au *AddressUpdate) Where(ps ...predicate.Address) *AddressUpdate
- type AddressUpdateOne
- func (auo *AddressUpdateOne) AddFlat(i int) *AddressUpdateOne
- func (auo *AddressUpdateOne) AddHouse(i int) *AddressUpdateOne
- func (auo *AddressUpdateOne) AddPostcode(i int) *AddressUpdateOne
- func (auo *AddressUpdateOne) ClearFlat() *AddressUpdateOne
- func (auo *AddressUpdateOne) ClearLetter() *AddressUpdateOne
- func (auo *AddressUpdateOne) ClearUsers() *AddressUpdateOne
- func (auo *AddressUpdateOne) Exec(ctx context.Context) error
- func (auo *AddressUpdateOne) ExecX(ctx context.Context)
- func (auo *AddressUpdateOne) Mutation() *AddressMutation
- func (auo *AddressUpdateOne) Save(ctx context.Context) (*Address, error)
- func (auo *AddressUpdateOne) SaveX(ctx context.Context) *Address
- func (auo *AddressUpdateOne) Select(field string, fields ...string) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetCity(s string) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetCountry(s string) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetFlat(i int) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetHouse(i int) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetLetter(s string) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetNillableCity(s *string) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetNillableCountry(s *string) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetNillableFlat(i *int) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetNillableHouse(i *int) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetNillableLetter(s *string) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetNillablePostcode(i *int) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetNillableStreet(s *string) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetNillableUserID(i *int64) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetPostcode(i int) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetStreet(s string) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetUpdatedAt(t time.Time) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetUserID(i int64) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetUsers(u *User) *AddressUpdateOne
- func (auo *AddressUpdateOne) SetUsersID(id int64) *AddressUpdateOne
- func (auo *AddressUpdateOne) Where(ps ...predicate.Address) *AddressUpdateOne
- type AddressUpsert
- func (u *AddressUpsert) AddFlat(v int) *AddressUpsert
- func (u *AddressUpsert) AddHouse(v int) *AddressUpsert
- func (u *AddressUpsert) AddPostcode(v int) *AddressUpsert
- func (u *AddressUpsert) ClearFlat() *AddressUpsert
- func (u *AddressUpsert) ClearLetter() *AddressUpsert
- func (u *AddressUpsert) SetCity(v string) *AddressUpsert
- func (u *AddressUpsert) SetCountry(v string) *AddressUpsert
- func (u *AddressUpsert) SetFlat(v int) *AddressUpsert
- func (u *AddressUpsert) SetHouse(v int) *AddressUpsert
- func (u *AddressUpsert) SetLetter(v string) *AddressUpsert
- func (u *AddressUpsert) SetPostcode(v int) *AddressUpsert
- func (u *AddressUpsert) SetStreet(v string) *AddressUpsert
- func (u *AddressUpsert) SetUpdatedAt(v time.Time) *AddressUpsert
- func (u *AddressUpsert) SetUserID(v int64) *AddressUpsert
- func (u *AddressUpsert) UpdateCity() *AddressUpsert
- func (u *AddressUpsert) UpdateCountry() *AddressUpsert
- func (u *AddressUpsert) UpdateFlat() *AddressUpsert
- func (u *AddressUpsert) UpdateHouse() *AddressUpsert
- func (u *AddressUpsert) UpdateLetter() *AddressUpsert
- func (u *AddressUpsert) UpdatePostcode() *AddressUpsert
- func (u *AddressUpsert) UpdateStreet() *AddressUpsert
- func (u *AddressUpsert) UpdateUpdatedAt() *AddressUpsert
- func (u *AddressUpsert) UpdateUserID() *AddressUpsert
- type AddressUpsertBulk
- func (u *AddressUpsertBulk) AddFlat(v int) *AddressUpsertBulk
- func (u *AddressUpsertBulk) AddHouse(v int) *AddressUpsertBulk
- func (u *AddressUpsertBulk) AddPostcode(v int) *AddressUpsertBulk
- func (u *AddressUpsertBulk) ClearFlat() *AddressUpsertBulk
- func (u *AddressUpsertBulk) ClearLetter() *AddressUpsertBulk
- func (u *AddressUpsertBulk) DoNothing() *AddressUpsertBulk
- func (u *AddressUpsertBulk) Exec(ctx context.Context) error
- func (u *AddressUpsertBulk) ExecX(ctx context.Context)
- func (u *AddressUpsertBulk) Ignore() *AddressUpsertBulk
- func (u *AddressUpsertBulk) SetCity(v string) *AddressUpsertBulk
- func (u *AddressUpsertBulk) SetCountry(v string) *AddressUpsertBulk
- func (u *AddressUpsertBulk) SetFlat(v int) *AddressUpsertBulk
- func (u *AddressUpsertBulk) SetHouse(v int) *AddressUpsertBulk
- func (u *AddressUpsertBulk) SetLetter(v string) *AddressUpsertBulk
- func (u *AddressUpsertBulk) SetPostcode(v int) *AddressUpsertBulk
- func (u *AddressUpsertBulk) SetStreet(v string) *AddressUpsertBulk
- func (u *AddressUpsertBulk) SetUpdatedAt(v time.Time) *AddressUpsertBulk
- func (u *AddressUpsertBulk) SetUserID(v int64) *AddressUpsertBulk
- func (u *AddressUpsertBulk) Update(set func(*AddressUpsert)) *AddressUpsertBulk
- func (u *AddressUpsertBulk) UpdateCity() *AddressUpsertBulk
- func (u *AddressUpsertBulk) UpdateCountry() *AddressUpsertBulk
- func (u *AddressUpsertBulk) UpdateFlat() *AddressUpsertBulk
- func (u *AddressUpsertBulk) UpdateHouse() *AddressUpsertBulk
- func (u *AddressUpsertBulk) UpdateLetter() *AddressUpsertBulk
- func (u *AddressUpsertBulk) UpdateNewValues() *AddressUpsertBulk
- func (u *AddressUpsertBulk) UpdatePostcode() *AddressUpsertBulk
- func (u *AddressUpsertBulk) UpdateStreet() *AddressUpsertBulk
- func (u *AddressUpsertBulk) UpdateUpdatedAt() *AddressUpsertBulk
- func (u *AddressUpsertBulk) UpdateUserID() *AddressUpsertBulk
- type AddressUpsertOne
- func (u *AddressUpsertOne) AddFlat(v int) *AddressUpsertOne
- func (u *AddressUpsertOne) AddHouse(v int) *AddressUpsertOne
- func (u *AddressUpsertOne) AddPostcode(v int) *AddressUpsertOne
- func (u *AddressUpsertOne) ClearFlat() *AddressUpsertOne
- func (u *AddressUpsertOne) ClearLetter() *AddressUpsertOne
- func (u *AddressUpsertOne) DoNothing() *AddressUpsertOne
- func (u *AddressUpsertOne) Exec(ctx context.Context) error
- func (u *AddressUpsertOne) ExecX(ctx context.Context)
- func (u *AddressUpsertOne) ID(ctx context.Context) (id int64, err error)
- func (u *AddressUpsertOne) IDX(ctx context.Context) int64
- func (u *AddressUpsertOne) Ignore() *AddressUpsertOne
- func (u *AddressUpsertOne) SetCity(v string) *AddressUpsertOne
- func (u *AddressUpsertOne) SetCountry(v string) *AddressUpsertOne
- func (u *AddressUpsertOne) SetFlat(v int) *AddressUpsertOne
- func (u *AddressUpsertOne) SetHouse(v int) *AddressUpsertOne
- func (u *AddressUpsertOne) SetLetter(v string) *AddressUpsertOne
- func (u *AddressUpsertOne) SetPostcode(v int) *AddressUpsertOne
- func (u *AddressUpsertOne) SetStreet(v string) *AddressUpsertOne
- func (u *AddressUpsertOne) SetUpdatedAt(v time.Time) *AddressUpsertOne
- func (u *AddressUpsertOne) SetUserID(v int64) *AddressUpsertOne
- func (u *AddressUpsertOne) Update(set func(*AddressUpsert)) *AddressUpsertOne
- func (u *AddressUpsertOne) UpdateCity() *AddressUpsertOne
- func (u *AddressUpsertOne) UpdateCountry() *AddressUpsertOne
- func (u *AddressUpsertOne) UpdateFlat() *AddressUpsertOne
- func (u *AddressUpsertOne) UpdateHouse() *AddressUpsertOne
- func (u *AddressUpsertOne) UpdateLetter() *AddressUpsertOne
- func (u *AddressUpsertOne) UpdateNewValues() *AddressUpsertOne
- func (u *AddressUpsertOne) UpdatePostcode() *AddressUpsertOne
- func (u *AddressUpsertOne) UpdateStreet() *AddressUpsertOne
- func (u *AddressUpsertOne) UpdateUpdatedAt() *AddressUpsertOne
- func (u *AddressUpsertOne) UpdateUserID() *AddressUpsertOne
- type Addresses
- type AggregateFunc
- type Cart
- type CartClient
- func (c *CartClient) Create() *CartCreate
- func (c *CartClient) CreateBulk(builders ...*CartCreate) *CartCreateBulk
- func (c *CartClient) Delete() *CartDelete
- func (c *CartClient) DeleteOne(ca *Cart) *CartDeleteOne
- func (c *CartClient) DeleteOneID(id int64) *CartDeleteOne
- func (c *CartClient) Get(ctx context.Context, id int64) (*Cart, error)
- func (c *CartClient) GetX(ctx context.Context, id int64) *Cart
- func (c *CartClient) Hooks() []Hook
- func (c *CartClient) Intercept(interceptors ...Interceptor)
- func (c *CartClient) Interceptors() []Interceptor
- func (c *CartClient) MapCreateBulk(slice any, setFunc func(*CartCreate, int)) *CartCreateBulk
- func (c *CartClient) Query() *CartQuery
- func (c *CartClient) QueryProducts(ca *Cart) *ProductQuery
- func (c *CartClient) QueryUsers(ca *Cart) *UserQuery
- func (c *CartClient) Update() *CartUpdate
- func (c *CartClient) UpdateOne(ca *Cart) *CartUpdateOne
- func (c *CartClient) UpdateOneID(id int64) *CartUpdateOne
- func (c *CartClient) Use(hooks ...Hook)
- type CartCreate
- func (cc *CartCreate) Exec(ctx context.Context) error
- func (cc *CartCreate) ExecX(ctx context.Context)
- func (cc *CartCreate) Mutation() *CartMutation
- func (cc *CartCreate) OnConflict(opts ...sql.ConflictOption) *CartUpsertOne
- func (cc *CartCreate) OnConflictColumns(columns ...string) *CartUpsertOne
- func (cc *CartCreate) Save(ctx context.Context) (*Cart, error)
- func (cc *CartCreate) SaveX(ctx context.Context) *Cart
- func (cc *CartCreate) SetAmount(i int64) *CartCreate
- func (cc *CartCreate) SetCreatedAt(t time.Time) *CartCreate
- func (cc *CartCreate) SetNillableCreatedAt(t *time.Time) *CartCreate
- func (cc *CartCreate) SetNillableUpdatedAt(t *time.Time) *CartCreate
- func (cc *CartCreate) SetProductID(i int64) *CartCreate
- func (cc *CartCreate) SetProducts(p *Product) *CartCreate
- func (cc *CartCreate) SetProductsID(id int64) *CartCreate
- func (cc *CartCreate) SetUpdatedAt(t time.Time) *CartCreate
- func (cc *CartCreate) SetUserID(i int64) *CartCreate
- func (cc *CartCreate) SetUsers(u *User) *CartCreate
- func (cc *CartCreate) SetUsersID(id int64) *CartCreate
- type CartCreateBulk
- func (ccb *CartCreateBulk) Exec(ctx context.Context) error
- func (ccb *CartCreateBulk) ExecX(ctx context.Context)
- func (ccb *CartCreateBulk) OnConflict(opts ...sql.ConflictOption) *CartUpsertBulk
- func (ccb *CartCreateBulk) OnConflictColumns(columns ...string) *CartUpsertBulk
- func (ccb *CartCreateBulk) Save(ctx context.Context) ([]*Cart, error)
- func (ccb *CartCreateBulk) SaveX(ctx context.Context) []*Cart
- type CartDelete
- type CartDeleteOne
- type CartEdges
- type CartGroupBy
- func (cgb *CartGroupBy) Aggregate(fns ...AggregateFunc) *CartGroupBy
- func (s *CartGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CartGroupBy) BoolX(ctx context.Context) bool
- func (s *CartGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CartGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CartGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CartGroupBy) Float64X(ctx context.Context) float64
- func (s *CartGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CartGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CartGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CartGroupBy) IntX(ctx context.Context) int
- func (s *CartGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CartGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CartGroupBy) Scan(ctx context.Context, v any) error
- func (s *CartGroupBy) ScanX(ctx context.Context, v any)
- func (s *CartGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CartGroupBy) StringX(ctx context.Context) string
- func (s *CartGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CartGroupBy) StringsX(ctx context.Context) []string
- type CartMutation
- func (m *CartMutation) AddAmount(i int64)
- func (m *CartMutation) AddField(name string, value ent.Value) error
- func (m *CartMutation) AddedAmount() (r int64, exists bool)
- func (m *CartMutation) AddedEdges() []string
- func (m *CartMutation) AddedField(name string) (ent.Value, bool)
- func (m *CartMutation) AddedFields() []string
- func (m *CartMutation) AddedIDs(name string) []ent.Value
- func (m *CartMutation) Amount() (r int64, exists bool)
- func (m *CartMutation) ClearEdge(name string) error
- func (m *CartMutation) ClearField(name string) error
- func (m *CartMutation) ClearProducts()
- func (m *CartMutation) ClearUsers()
- func (m *CartMutation) ClearedEdges() []string
- func (m *CartMutation) ClearedFields() []string
- func (m CartMutation) Client() *Client
- func (m *CartMutation) CreatedAt() (r time.Time, exists bool)
- func (m *CartMutation) EdgeCleared(name string) bool
- func (m *CartMutation) Field(name string) (ent.Value, bool)
- func (m *CartMutation) FieldCleared(name string) bool
- func (m *CartMutation) Fields() []string
- func (m *CartMutation) ID() (id int64, exists bool)
- func (m *CartMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *CartMutation) OldAmount(ctx context.Context) (v int64, err error)
- func (m *CartMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CartMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CartMutation) OldProductID(ctx context.Context) (v int64, err error)
- func (m *CartMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CartMutation) OldUserID(ctx context.Context) (v int64, err error)
- func (m *CartMutation) Op() Op
- func (m *CartMutation) ProductID() (r int64, exists bool)
- func (m *CartMutation) ProductsCleared() bool
- func (m *CartMutation) ProductsID() (id int64, exists bool)
- func (m *CartMutation) ProductsIDs() (ids []int64)
- func (m *CartMutation) RemovedEdges() []string
- func (m *CartMutation) RemovedIDs(name string) []ent.Value
- func (m *CartMutation) ResetAmount()
- func (m *CartMutation) ResetCreatedAt()
- func (m *CartMutation) ResetEdge(name string) error
- func (m *CartMutation) ResetField(name string) error
- func (m *CartMutation) ResetProductID()
- func (m *CartMutation) ResetProducts()
- func (m *CartMutation) ResetUpdatedAt()
- func (m *CartMutation) ResetUserID()
- func (m *CartMutation) ResetUsers()
- func (m *CartMutation) SetAmount(i int64)
- func (m *CartMutation) SetCreatedAt(t time.Time)
- func (m *CartMutation) SetField(name string, value ent.Value) error
- func (m *CartMutation) SetOp(op Op)
- func (m *CartMutation) SetProductID(i int64)
- func (m *CartMutation) SetProductsID(id int64)
- func (m *CartMutation) SetUpdatedAt(t time.Time)
- func (m *CartMutation) SetUserID(i int64)
- func (m *CartMutation) SetUsersID(id int64)
- func (m CartMutation) Tx() (*Tx, error)
- func (m *CartMutation) Type() string
- func (m *CartMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *CartMutation) UserID() (r int64, exists bool)
- func (m *CartMutation) UsersCleared() bool
- func (m *CartMutation) UsersID() (id int64, exists bool)
- func (m *CartMutation) UsersIDs() (ids []int64)
- func (m *CartMutation) Where(ps ...predicate.Cart)
- func (m *CartMutation) WhereP(ps ...func(*sql.Selector))
- type CartQuery
- func (cq *CartQuery) Aggregate(fns ...AggregateFunc) *CartSelect
- func (cq *CartQuery) All(ctx context.Context) ([]*Cart, error)
- func (cq *CartQuery) AllX(ctx context.Context) []*Cart
- func (cq *CartQuery) Clone() *CartQuery
- func (cq *CartQuery) Count(ctx context.Context) (int, error)
- func (cq *CartQuery) CountX(ctx context.Context) int
- func (cq *CartQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CartQuery) ExistX(ctx context.Context) bool
- func (cq *CartQuery) First(ctx context.Context) (*Cart, error)
- func (cq *CartQuery) FirstID(ctx context.Context) (id int64, err error)
- func (cq *CartQuery) FirstIDX(ctx context.Context) int64
- func (cq *CartQuery) FirstX(ctx context.Context) *Cart
- func (cq *CartQuery) GroupBy(field string, fields ...string) *CartGroupBy
- func (cq *CartQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (cq *CartQuery) IDsX(ctx context.Context) []int64
- func (cq *CartQuery) Limit(limit int) *CartQuery
- func (cq *CartQuery) Offset(offset int) *CartQuery
- func (cq *CartQuery) Only(ctx context.Context) (*Cart, error)
- func (cq *CartQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (cq *CartQuery) OnlyIDX(ctx context.Context) int64
- func (cq *CartQuery) OnlyX(ctx context.Context) *Cart
- func (cq *CartQuery) Order(o ...cart.OrderOption) *CartQuery
- func (cq *CartQuery) QueryProducts() *ProductQuery
- func (cq *CartQuery) QueryUsers() *UserQuery
- func (cq *CartQuery) Select(fields ...string) *CartSelect
- func (cq *CartQuery) Unique(unique bool) *CartQuery
- func (cq *CartQuery) Where(ps ...predicate.Cart) *CartQuery
- func (cq *CartQuery) WithProducts(opts ...func(*ProductQuery)) *CartQuery
- func (cq *CartQuery) WithUsers(opts ...func(*UserQuery)) *CartQuery
- type CartSelect
- func (cs *CartSelect) Aggregate(fns ...AggregateFunc) *CartSelect
- func (s *CartSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CartSelect) BoolX(ctx context.Context) bool
- func (s *CartSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CartSelect) BoolsX(ctx context.Context) []bool
- func (s *CartSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CartSelect) Float64X(ctx context.Context) float64
- func (s *CartSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CartSelect) Float64sX(ctx context.Context) []float64
- func (s *CartSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CartSelect) IntX(ctx context.Context) int
- func (s *CartSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CartSelect) IntsX(ctx context.Context) []int
- func (cs *CartSelect) Scan(ctx context.Context, v any) error
- func (s *CartSelect) ScanX(ctx context.Context, v any)
- func (s *CartSelect) String(ctx context.Context) (_ string, err error)
- func (s *CartSelect) StringX(ctx context.Context) string
- func (s *CartSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CartSelect) StringsX(ctx context.Context) []string
- type CartUpdate
- func (cu *CartUpdate) AddAmount(i int64) *CartUpdate
- func (cu *CartUpdate) ClearProducts() *CartUpdate
- func (cu *CartUpdate) ClearUsers() *CartUpdate
- func (cu *CartUpdate) Exec(ctx context.Context) error
- func (cu *CartUpdate) ExecX(ctx context.Context)
- func (cu *CartUpdate) Mutation() *CartMutation
- func (cu *CartUpdate) Save(ctx context.Context) (int, error)
- func (cu *CartUpdate) SaveX(ctx context.Context) int
- func (cu *CartUpdate) SetAmount(i int64) *CartUpdate
- func (cu *CartUpdate) SetNillableAmount(i *int64) *CartUpdate
- func (cu *CartUpdate) SetNillableProductID(i *int64) *CartUpdate
- func (cu *CartUpdate) SetNillableUserID(i *int64) *CartUpdate
- func (cu *CartUpdate) SetProductID(i int64) *CartUpdate
- func (cu *CartUpdate) SetProducts(p *Product) *CartUpdate
- func (cu *CartUpdate) SetProductsID(id int64) *CartUpdate
- func (cu *CartUpdate) SetUpdatedAt(t time.Time) *CartUpdate
- func (cu *CartUpdate) SetUserID(i int64) *CartUpdate
- func (cu *CartUpdate) SetUsers(u *User) *CartUpdate
- func (cu *CartUpdate) SetUsersID(id int64) *CartUpdate
- func (cu *CartUpdate) Where(ps ...predicate.Cart) *CartUpdate
- type CartUpdateOne
- func (cuo *CartUpdateOne) AddAmount(i int64) *CartUpdateOne
- func (cuo *CartUpdateOne) ClearProducts() *CartUpdateOne
- func (cuo *CartUpdateOne) ClearUsers() *CartUpdateOne
- func (cuo *CartUpdateOne) Exec(ctx context.Context) error
- func (cuo *CartUpdateOne) ExecX(ctx context.Context)
- func (cuo *CartUpdateOne) Mutation() *CartMutation
- func (cuo *CartUpdateOne) Save(ctx context.Context) (*Cart, error)
- func (cuo *CartUpdateOne) SaveX(ctx context.Context) *Cart
- func (cuo *CartUpdateOne) Select(field string, fields ...string) *CartUpdateOne
- func (cuo *CartUpdateOne) SetAmount(i int64) *CartUpdateOne
- func (cuo *CartUpdateOne) SetNillableAmount(i *int64) *CartUpdateOne
- func (cuo *CartUpdateOne) SetNillableProductID(i *int64) *CartUpdateOne
- func (cuo *CartUpdateOne) SetNillableUserID(i *int64) *CartUpdateOne
- func (cuo *CartUpdateOne) SetProductID(i int64) *CartUpdateOne
- func (cuo *CartUpdateOne) SetProducts(p *Product) *CartUpdateOne
- func (cuo *CartUpdateOne) SetProductsID(id int64) *CartUpdateOne
- func (cuo *CartUpdateOne) SetUpdatedAt(t time.Time) *CartUpdateOne
- func (cuo *CartUpdateOne) SetUserID(i int64) *CartUpdateOne
- func (cuo *CartUpdateOne) SetUsers(u *User) *CartUpdateOne
- func (cuo *CartUpdateOne) SetUsersID(id int64) *CartUpdateOne
- func (cuo *CartUpdateOne) Where(ps ...predicate.Cart) *CartUpdateOne
- type CartUpsert
- func (u *CartUpsert) AddAmount(v int64) *CartUpsert
- func (u *CartUpsert) SetAmount(v int64) *CartUpsert
- func (u *CartUpsert) SetProductID(v int64) *CartUpsert
- func (u *CartUpsert) SetUpdatedAt(v time.Time) *CartUpsert
- func (u *CartUpsert) SetUserID(v int64) *CartUpsert
- func (u *CartUpsert) UpdateAmount() *CartUpsert
- func (u *CartUpsert) UpdateProductID() *CartUpsert
- func (u *CartUpsert) UpdateUpdatedAt() *CartUpsert
- func (u *CartUpsert) UpdateUserID() *CartUpsert
- type CartUpsertBulk
- func (u *CartUpsertBulk) AddAmount(v int64) *CartUpsertBulk
- func (u *CartUpsertBulk) DoNothing() *CartUpsertBulk
- func (u *CartUpsertBulk) Exec(ctx context.Context) error
- func (u *CartUpsertBulk) ExecX(ctx context.Context)
- func (u *CartUpsertBulk) Ignore() *CartUpsertBulk
- func (u *CartUpsertBulk) SetAmount(v int64) *CartUpsertBulk
- func (u *CartUpsertBulk) SetProductID(v int64) *CartUpsertBulk
- func (u *CartUpsertBulk) SetUpdatedAt(v time.Time) *CartUpsertBulk
- func (u *CartUpsertBulk) SetUserID(v int64) *CartUpsertBulk
- func (u *CartUpsertBulk) Update(set func(*CartUpsert)) *CartUpsertBulk
- func (u *CartUpsertBulk) UpdateAmount() *CartUpsertBulk
- func (u *CartUpsertBulk) UpdateNewValues() *CartUpsertBulk
- func (u *CartUpsertBulk) UpdateProductID() *CartUpsertBulk
- func (u *CartUpsertBulk) UpdateUpdatedAt() *CartUpsertBulk
- func (u *CartUpsertBulk) UpdateUserID() *CartUpsertBulk
- type CartUpsertOne
- func (u *CartUpsertOne) AddAmount(v int64) *CartUpsertOne
- func (u *CartUpsertOne) DoNothing() *CartUpsertOne
- func (u *CartUpsertOne) Exec(ctx context.Context) error
- func (u *CartUpsertOne) ExecX(ctx context.Context)
- func (u *CartUpsertOne) ID(ctx context.Context) (id int64, err error)
- func (u *CartUpsertOne) IDX(ctx context.Context) int64
- func (u *CartUpsertOne) Ignore() *CartUpsertOne
- func (u *CartUpsertOne) SetAmount(v int64) *CartUpsertOne
- func (u *CartUpsertOne) SetProductID(v int64) *CartUpsertOne
- func (u *CartUpsertOne) SetUpdatedAt(v time.Time) *CartUpsertOne
- func (u *CartUpsertOne) SetUserID(v int64) *CartUpsertOne
- func (u *CartUpsertOne) Update(set func(*CartUpsert)) *CartUpsertOne
- func (u *CartUpsertOne) UpdateAmount() *CartUpsertOne
- func (u *CartUpsertOne) UpdateNewValues() *CartUpsertOne
- func (u *CartUpsertOne) UpdateProductID() *CartUpsertOne
- func (u *CartUpsertOne) UpdateUpdatedAt() *CartUpsertOne
- func (u *CartUpsertOne) UpdateUserID() *CartUpsertOne
- type Carts
- type Categories
- type Category
- type CategoryClient
- func (c *CategoryClient) Create() *CategoryCreate
- func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk
- func (c *CategoryClient) Delete() *CategoryDelete
- func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne
- func (c *CategoryClient) DeleteOneID(id int64) *CategoryDeleteOne
- func (c *CategoryClient) Get(ctx context.Context, id int64) (*Category, error)
- func (c *CategoryClient) GetX(ctx context.Context, id int64) *Category
- func (c *CategoryClient) Hooks() []Hook
- func (c *CategoryClient) Intercept(interceptors ...Interceptor)
- func (c *CategoryClient) Interceptors() []Interceptor
- func (c *CategoryClient) MapCreateBulk(slice any, setFunc func(*CategoryCreate, int)) *CategoryCreateBulk
- func (c *CategoryClient) Query() *CategoryQuery
- func (c *CategoryClient) QueryProducts(ca *Category) *ProductQuery
- func (c *CategoryClient) Update() *CategoryUpdate
- func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne
- func (c *CategoryClient) UpdateOneID(id int64) *CategoryUpdateOne
- func (c *CategoryClient) Use(hooks ...Hook)
- type CategoryCreate
- func (cc *CategoryCreate) AddProductIDs(ids ...int64) *CategoryCreate
- func (cc *CategoryCreate) AddProducts(p ...*Product) *CategoryCreate
- func (cc *CategoryCreate) Exec(ctx context.Context) error
- func (cc *CategoryCreate) ExecX(ctx context.Context)
- func (cc *CategoryCreate) Mutation() *CategoryMutation
- func (cc *CategoryCreate) OnConflict(opts ...sql.ConflictOption) *CategoryUpsertOne
- func (cc *CategoryCreate) OnConflictColumns(columns ...string) *CategoryUpsertOne
- func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)
- func (cc *CategoryCreate) SaveX(ctx context.Context) *Category
- func (cc *CategoryCreate) SetCreatedAt(t time.Time) *CategoryCreate
- func (cc *CategoryCreate) SetName(s string) *CategoryCreate
- func (cc *CategoryCreate) SetNillableCreatedAt(t *time.Time) *CategoryCreate
- func (cc *CategoryCreate) SetNillableUpdatedAt(t *time.Time) *CategoryCreate
- func (cc *CategoryCreate) SetUpdatedAt(t time.Time) *CategoryCreate
- type CategoryCreateBulk
- func (ccb *CategoryCreateBulk) Exec(ctx context.Context) error
- func (ccb *CategoryCreateBulk) ExecX(ctx context.Context)
- func (ccb *CategoryCreateBulk) OnConflict(opts ...sql.ConflictOption) *CategoryUpsertBulk
- func (ccb *CategoryCreateBulk) OnConflictColumns(columns ...string) *CategoryUpsertBulk
- func (ccb *CategoryCreateBulk) Save(ctx context.Context) ([]*Category, error)
- func (ccb *CategoryCreateBulk) SaveX(ctx context.Context) []*Category
- type CategoryDelete
- type CategoryDeleteOne
- type CategoryEdges
- type CategoryGroupBy
- func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy
- func (s *CategoryGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CategoryGroupBy) BoolX(ctx context.Context) bool
- func (s *CategoryGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CategoryGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CategoryGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CategoryGroupBy) Float64X(ctx context.Context) float64
- func (s *CategoryGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CategoryGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CategoryGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CategoryGroupBy) IntX(ctx context.Context) int
- func (s *CategoryGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CategoryGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CategoryGroupBy) Scan(ctx context.Context, v any) error
- func (s *CategoryGroupBy) ScanX(ctx context.Context, v any)
- func (s *CategoryGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CategoryGroupBy) StringX(ctx context.Context) string
- func (s *CategoryGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CategoryGroupBy) StringsX(ctx context.Context) []string
- type CategoryMutation
- func (m *CategoryMutation) AddField(name string, value ent.Value) error
- func (m *CategoryMutation) AddProductIDs(ids ...int64)
- func (m *CategoryMutation) AddedEdges() []string
- func (m *CategoryMutation) AddedField(name string) (ent.Value, bool)
- func (m *CategoryMutation) AddedFields() []string
- func (m *CategoryMutation) AddedIDs(name string) []ent.Value
- func (m *CategoryMutation) ClearEdge(name string) error
- func (m *CategoryMutation) ClearField(name string) error
- func (m *CategoryMutation) ClearProducts()
- func (m *CategoryMutation) ClearedEdges() []string
- func (m *CategoryMutation) ClearedFields() []string
- func (m CategoryMutation) Client() *Client
- func (m *CategoryMutation) CreatedAt() (r time.Time, exists bool)
- func (m *CategoryMutation) EdgeCleared(name string) bool
- func (m *CategoryMutation) Field(name string) (ent.Value, bool)
- func (m *CategoryMutation) FieldCleared(name string) bool
- func (m *CategoryMutation) Fields() []string
- func (m *CategoryMutation) ID() (id int64, exists bool)
- func (m *CategoryMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *CategoryMutation) Name() (r string, exists bool)
- func (m *CategoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CategoryMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CategoryMutation) OldName(ctx context.Context) (v string, err error)
- func (m *CategoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CategoryMutation) Op() Op
- func (m *CategoryMutation) ProductsCleared() bool
- func (m *CategoryMutation) ProductsIDs() (ids []int64)
- func (m *CategoryMutation) RemoveProductIDs(ids ...int64)
- func (m *CategoryMutation) RemovedEdges() []string
- func (m *CategoryMutation) RemovedIDs(name string) []ent.Value
- func (m *CategoryMutation) RemovedProductsIDs() (ids []int64)
- func (m *CategoryMutation) ResetCreatedAt()
- func (m *CategoryMutation) ResetEdge(name string) error
- func (m *CategoryMutation) ResetField(name string) error
- func (m *CategoryMutation) ResetName()
- func (m *CategoryMutation) ResetProducts()
- func (m *CategoryMutation) ResetUpdatedAt()
- func (m *CategoryMutation) SetCreatedAt(t time.Time)
- func (m *CategoryMutation) SetField(name string, value ent.Value) error
- func (m *CategoryMutation) SetName(s string)
- func (m *CategoryMutation) SetOp(op Op)
- func (m *CategoryMutation) SetUpdatedAt(t time.Time)
- func (m CategoryMutation) Tx() (*Tx, error)
- func (m *CategoryMutation) Type() string
- func (m *CategoryMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *CategoryMutation) Where(ps ...predicate.Category)
- func (m *CategoryMutation) WhereP(ps ...func(*sql.Selector))
- type CategoryQuery
- func (cq *CategoryQuery) Aggregate(fns ...AggregateFunc) *CategorySelect
- func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)
- func (cq *CategoryQuery) AllX(ctx context.Context) []*Category
- func (cq *CategoryQuery) Clone() *CategoryQuery
- func (cq *CategoryQuery) Count(ctx context.Context) (int, error)
- func (cq *CategoryQuery) CountX(ctx context.Context) int
- func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CategoryQuery) ExistX(ctx context.Context) bool
- func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)
- func (cq *CategoryQuery) FirstID(ctx context.Context) (id int64, err error)
- func (cq *CategoryQuery) FirstIDX(ctx context.Context) int64
- func (cq *CategoryQuery) FirstX(ctx context.Context) *Category
- func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy
- func (cq *CategoryQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (cq *CategoryQuery) IDsX(ctx context.Context) []int64
- func (cq *CategoryQuery) Limit(limit int) *CategoryQuery
- func (cq *CategoryQuery) Offset(offset int) *CategoryQuery
- func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)
- func (cq *CategoryQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (cq *CategoryQuery) OnlyIDX(ctx context.Context) int64
- func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category
- func (cq *CategoryQuery) Order(o ...category.OrderOption) *CategoryQuery
- func (cq *CategoryQuery) QueryProducts() *ProductQuery
- func (cq *CategoryQuery) Select(fields ...string) *CategorySelect
- func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery
- func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery
- func (cq *CategoryQuery) WithProducts(opts ...func(*ProductQuery)) *CategoryQuery
- type CategorySelect
- func (cs *CategorySelect) Aggregate(fns ...AggregateFunc) *CategorySelect
- func (s *CategorySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CategorySelect) BoolX(ctx context.Context) bool
- func (s *CategorySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CategorySelect) BoolsX(ctx context.Context) []bool
- func (s *CategorySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CategorySelect) Float64X(ctx context.Context) float64
- func (s *CategorySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CategorySelect) Float64sX(ctx context.Context) []float64
- func (s *CategorySelect) Int(ctx context.Context) (_ int, err error)
- func (s *CategorySelect) IntX(ctx context.Context) int
- func (s *CategorySelect) Ints(ctx context.Context) ([]int, error)
- func (s *CategorySelect) IntsX(ctx context.Context) []int
- func (cs *CategorySelect) Scan(ctx context.Context, v any) error
- func (s *CategorySelect) ScanX(ctx context.Context, v any)
- func (s *CategorySelect) String(ctx context.Context) (_ string, err error)
- func (s *CategorySelect) StringX(ctx context.Context) string
- func (s *CategorySelect) Strings(ctx context.Context) ([]string, error)
- func (s *CategorySelect) StringsX(ctx context.Context) []string
- type CategoryUpdate
- func (cu *CategoryUpdate) AddProductIDs(ids ...int64) *CategoryUpdate
- func (cu *CategoryUpdate) AddProducts(p ...*Product) *CategoryUpdate
- func (cu *CategoryUpdate) ClearProducts() *CategoryUpdate
- func (cu *CategoryUpdate) Exec(ctx context.Context) error
- func (cu *CategoryUpdate) ExecX(ctx context.Context)
- func (cu *CategoryUpdate) Mutation() *CategoryMutation
- func (cu *CategoryUpdate) RemoveProductIDs(ids ...int64) *CategoryUpdate
- func (cu *CategoryUpdate) RemoveProducts(p ...*Product) *CategoryUpdate
- func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)
- func (cu *CategoryUpdate) SaveX(ctx context.Context) int
- func (cu *CategoryUpdate) SetName(s string) *CategoryUpdate
- func (cu *CategoryUpdate) SetNillableName(s *string) *CategoryUpdate
- func (cu *CategoryUpdate) SetUpdatedAt(t time.Time) *CategoryUpdate
- func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate
- type CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddProductIDs(ids ...int64) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddProducts(p ...*Product) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearProducts() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error
- func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)
- func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation
- func (cuo *CategoryUpdateOne) RemoveProductIDs(ids ...int64) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) RemoveProducts(p ...*Product) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)
- func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category
- func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetName(s string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetNillableName(s *string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetUpdatedAt(t time.Time) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Where(ps ...predicate.Category) *CategoryUpdateOne
- type CategoryUpsert
- type CategoryUpsertBulk
- func (u *CategoryUpsertBulk) DoNothing() *CategoryUpsertBulk
- func (u *CategoryUpsertBulk) Exec(ctx context.Context) error
- func (u *CategoryUpsertBulk) ExecX(ctx context.Context)
- func (u *CategoryUpsertBulk) Ignore() *CategoryUpsertBulk
- func (u *CategoryUpsertBulk) SetName(v string) *CategoryUpsertBulk
- func (u *CategoryUpsertBulk) SetUpdatedAt(v time.Time) *CategoryUpsertBulk
- func (u *CategoryUpsertBulk) Update(set func(*CategoryUpsert)) *CategoryUpsertBulk
- func (u *CategoryUpsertBulk) UpdateName() *CategoryUpsertBulk
- func (u *CategoryUpsertBulk) UpdateNewValues() *CategoryUpsertBulk
- func (u *CategoryUpsertBulk) UpdateUpdatedAt() *CategoryUpsertBulk
- type CategoryUpsertOne
- func (u *CategoryUpsertOne) DoNothing() *CategoryUpsertOne
- func (u *CategoryUpsertOne) Exec(ctx context.Context) error
- func (u *CategoryUpsertOne) ExecX(ctx context.Context)
- func (u *CategoryUpsertOne) ID(ctx context.Context) (id int64, err error)
- func (u *CategoryUpsertOne) IDX(ctx context.Context) int64
- func (u *CategoryUpsertOne) Ignore() *CategoryUpsertOne
- func (u *CategoryUpsertOne) SetName(v string) *CategoryUpsertOne
- func (u *CategoryUpsertOne) SetUpdatedAt(v time.Time) *CategoryUpsertOne
- func (u *CategoryUpsertOne) Update(set func(*CategoryUpsert)) *CategoryUpsertOne
- func (u *CategoryUpsertOne) UpdateName() *CategoryUpsertOne
- func (u *CategoryUpsertOne) UpdateNewValues() *CategoryUpsertOne
- func (u *CategoryUpsertOne) UpdateUpdatedAt() *CategoryUpsertOne
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type Order
- type OrderClient
- func (c *OrderClient) Create() *OrderCreate
- func (c *OrderClient) CreateBulk(builders ...*OrderCreate) *OrderCreateBulk
- func (c *OrderClient) Delete() *OrderDelete
- func (c *OrderClient) DeleteOne(o *Order) *OrderDeleteOne
- func (c *OrderClient) DeleteOneID(id int64) *OrderDeleteOne
- func (c *OrderClient) Get(ctx context.Context, id int64) (*Order, error)
- func (c *OrderClient) GetX(ctx context.Context, id int64) *Order
- func (c *OrderClient) Hooks() []Hook
- func (c *OrderClient) Intercept(interceptors ...Interceptor)
- func (c *OrderClient) Interceptors() []Interceptor
- func (c *OrderClient) MapCreateBulk(slice any, setFunc func(*OrderCreate, int)) *OrderCreateBulk
- func (c *OrderClient) Query() *OrderQuery
- func (c *OrderClient) QueryOrderProducts(o *Order) *OrderProductQuery
- func (c *OrderClient) QueryUsers(o *Order) *UserQuery
- func (c *OrderClient) Update() *OrderUpdate
- func (c *OrderClient) UpdateOne(o *Order) *OrderUpdateOne
- func (c *OrderClient) UpdateOneID(id int64) *OrderUpdateOne
- func (c *OrderClient) Use(hooks ...Hook)
- type OrderCreate
- func (oc *OrderCreate) AddOrderProductIDs(ids ...int64) *OrderCreate
- func (oc *OrderCreate) AddOrderProducts(o ...*OrderProduct) *OrderCreate
- func (oc *OrderCreate) Exec(ctx context.Context) error
- func (oc *OrderCreate) ExecX(ctx context.Context)
- func (oc *OrderCreate) Mutation() *OrderMutation
- func (oc *OrderCreate) OnConflict(opts ...sql.ConflictOption) *OrderUpsertOne
- func (oc *OrderCreate) OnConflictColumns(columns ...string) *OrderUpsertOne
- func (oc *OrderCreate) Save(ctx context.Context) (*Order, error)
- func (oc *OrderCreate) SaveX(ctx context.Context) *Order
- func (oc *OrderCreate) SetCreatedAt(t time.Time) *OrderCreate
- func (oc *OrderCreate) SetNillableCreatedAt(t *time.Time) *OrderCreate
- func (oc *OrderCreate) SetNillableStatus(o *order.Status) *OrderCreate
- func (oc *OrderCreate) SetNillableUpdatedAt(t *time.Time) *OrderCreate
- func (oc *OrderCreate) SetStatus(o order.Status) *OrderCreate
- func (oc *OrderCreate) SetUpdatedAt(t time.Time) *OrderCreate
- func (oc *OrderCreate) SetUserID(i int64) *OrderCreate
- func (oc *OrderCreate) SetUsers(u *User) *OrderCreate
- func (oc *OrderCreate) SetUsersID(id int64) *OrderCreate
- type OrderCreateBulk
- func (ocb *OrderCreateBulk) Exec(ctx context.Context) error
- func (ocb *OrderCreateBulk) ExecX(ctx context.Context)
- func (ocb *OrderCreateBulk) OnConflict(opts ...sql.ConflictOption) *OrderUpsertBulk
- func (ocb *OrderCreateBulk) OnConflictColumns(columns ...string) *OrderUpsertBulk
- func (ocb *OrderCreateBulk) Save(ctx context.Context) ([]*Order, error)
- func (ocb *OrderCreateBulk) SaveX(ctx context.Context) []*Order
- type OrderDelete
- type OrderDeleteOne
- type OrderEdges
- type OrderFunc
- type OrderGroupBy
- func (ogb *OrderGroupBy) Aggregate(fns ...AggregateFunc) *OrderGroupBy
- func (s *OrderGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrderGroupBy) BoolX(ctx context.Context) bool
- func (s *OrderGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *OrderGroupBy) BoolsX(ctx context.Context) []bool
- func (s *OrderGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrderGroupBy) Float64X(ctx context.Context) float64
- func (s *OrderGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrderGroupBy) Float64sX(ctx context.Context) []float64
- func (s *OrderGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *OrderGroupBy) IntX(ctx context.Context) int
- func (s *OrderGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *OrderGroupBy) IntsX(ctx context.Context) []int
- func (ogb *OrderGroupBy) Scan(ctx context.Context, v any) error
- func (s *OrderGroupBy) ScanX(ctx context.Context, v any)
- func (s *OrderGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *OrderGroupBy) StringX(ctx context.Context) string
- func (s *OrderGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *OrderGroupBy) StringsX(ctx context.Context) []string
- type OrderMutation
- func (m *OrderMutation) AddField(name string, value ent.Value) error
- func (m *OrderMutation) AddOrderProductIDs(ids ...int64)
- func (m *OrderMutation) AddedEdges() []string
- func (m *OrderMutation) AddedField(name string) (ent.Value, bool)
- func (m *OrderMutation) AddedFields() []string
- func (m *OrderMutation) AddedIDs(name string) []ent.Value
- func (m *OrderMutation) ClearEdge(name string) error
- func (m *OrderMutation) ClearField(name string) error
- func (m *OrderMutation) ClearOrderProducts()
- func (m *OrderMutation) ClearUsers()
- func (m *OrderMutation) ClearedEdges() []string
- func (m *OrderMutation) ClearedFields() []string
- func (m OrderMutation) Client() *Client
- func (m *OrderMutation) CreatedAt() (r time.Time, exists bool)
- func (m *OrderMutation) EdgeCleared(name string) bool
- func (m *OrderMutation) Field(name string) (ent.Value, bool)
- func (m *OrderMutation) FieldCleared(name string) bool
- func (m *OrderMutation) Fields() []string
- func (m *OrderMutation) ID() (id int64, exists bool)
- func (m *OrderMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *OrderMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *OrderMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *OrderMutation) OldStatus(ctx context.Context) (v order.Status, err error)
- func (m *OrderMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *OrderMutation) OldUserID(ctx context.Context) (v int64, err error)
- func (m *OrderMutation) Op() Op
- func (m *OrderMutation) OrderProductsCleared() bool
- func (m *OrderMutation) OrderProductsIDs() (ids []int64)
- func (m *OrderMutation) RemoveOrderProductIDs(ids ...int64)
- func (m *OrderMutation) RemovedEdges() []string
- func (m *OrderMutation) RemovedIDs(name string) []ent.Value
- func (m *OrderMutation) RemovedOrderProductsIDs() (ids []int64)
- func (m *OrderMutation) ResetCreatedAt()
- func (m *OrderMutation) ResetEdge(name string) error
- func (m *OrderMutation) ResetField(name string) error
- func (m *OrderMutation) ResetOrderProducts()
- func (m *OrderMutation) ResetStatus()
- func (m *OrderMutation) ResetUpdatedAt()
- func (m *OrderMutation) ResetUserID()
- func (m *OrderMutation) ResetUsers()
- func (m *OrderMutation) SetCreatedAt(t time.Time)
- func (m *OrderMutation) SetField(name string, value ent.Value) error
- func (m *OrderMutation) SetOp(op Op)
- func (m *OrderMutation) SetStatus(o order.Status)
- func (m *OrderMutation) SetUpdatedAt(t time.Time)
- func (m *OrderMutation) SetUserID(i int64)
- func (m *OrderMutation) SetUsersID(id int64)
- func (m *OrderMutation) Status() (r order.Status, exists bool)
- func (m OrderMutation) Tx() (*Tx, error)
- func (m *OrderMutation) Type() string
- func (m *OrderMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *OrderMutation) UserID() (r int64, exists bool)
- func (m *OrderMutation) UsersCleared() bool
- func (m *OrderMutation) UsersID() (id int64, exists bool)
- func (m *OrderMutation) UsersIDs() (ids []int64)
- func (m *OrderMutation) Where(ps ...predicate.Order)
- func (m *OrderMutation) WhereP(ps ...func(*sql.Selector))
- type OrderProduct
- func (op *OrderProduct) QueryOrders() *OrderQuery
- func (op *OrderProduct) QueryProducts() *ProductQuery
- func (op *OrderProduct) String() string
- func (op *OrderProduct) Unwrap() *OrderProduct
- func (op *OrderProduct) Update() *OrderProductUpdateOne
- func (op *OrderProduct) Value(name string) (ent.Value, error)
- type OrderProductClient
- func (c *OrderProductClient) Create() *OrderProductCreate
- func (c *OrderProductClient) CreateBulk(builders ...*OrderProductCreate) *OrderProductCreateBulk
- func (c *OrderProductClient) Delete() *OrderProductDelete
- func (c *OrderProductClient) DeleteOne(op *OrderProduct) *OrderProductDeleteOne
- func (c *OrderProductClient) DeleteOneID(id int64) *OrderProductDeleteOne
- func (c *OrderProductClient) Get(ctx context.Context, id int64) (*OrderProduct, error)
- func (c *OrderProductClient) GetX(ctx context.Context, id int64) *OrderProduct
- func (c *OrderProductClient) Hooks() []Hook
- func (c *OrderProductClient) Intercept(interceptors ...Interceptor)
- func (c *OrderProductClient) Interceptors() []Interceptor
- func (c *OrderProductClient) MapCreateBulk(slice any, setFunc func(*OrderProductCreate, int)) *OrderProductCreateBulk
- func (c *OrderProductClient) Query() *OrderProductQuery
- func (c *OrderProductClient) QueryOrders(op *OrderProduct) *OrderQuery
- func (c *OrderProductClient) QueryProducts(op *OrderProduct) *ProductQuery
- func (c *OrderProductClient) Update() *OrderProductUpdate
- func (c *OrderProductClient) UpdateOne(op *OrderProduct) *OrderProductUpdateOne
- func (c *OrderProductClient) UpdateOneID(id int64) *OrderProductUpdateOne
- func (c *OrderProductClient) Use(hooks ...Hook)
- type OrderProductCreate
- func (opc *OrderProductCreate) Exec(ctx context.Context) error
- func (opc *OrderProductCreate) ExecX(ctx context.Context)
- func (opc *OrderProductCreate) Mutation() *OrderProductMutation
- func (opc *OrderProductCreate) OnConflict(opts ...sql.ConflictOption) *OrderProductUpsertOne
- func (opc *OrderProductCreate) OnConflictColumns(columns ...string) *OrderProductUpsertOne
- func (opc *OrderProductCreate) Save(ctx context.Context) (*OrderProduct, error)
- func (opc *OrderProductCreate) SaveX(ctx context.Context) *OrderProduct
- func (opc *OrderProductCreate) SetAmount(i int64) *OrderProductCreate
- func (opc *OrderProductCreate) SetCreatedAt(t time.Time) *OrderProductCreate
- func (opc *OrderProductCreate) SetNillableAmount(i *int64) *OrderProductCreate
- func (opc *OrderProductCreate) SetNillableCreatedAt(t *time.Time) *OrderProductCreate
- func (opc *OrderProductCreate) SetNillableUpdatedAt(t *time.Time) *OrderProductCreate
- func (opc *OrderProductCreate) SetOrderID(i int64) *OrderProductCreate
- func (opc *OrderProductCreate) SetOrders(o *Order) *OrderProductCreate
- func (opc *OrderProductCreate) SetOrdersID(id int64) *OrderProductCreate
- func (opc *OrderProductCreate) SetPrice(i int64) *OrderProductCreate
- func (opc *OrderProductCreate) SetProductID(i int64) *OrderProductCreate
- func (opc *OrderProductCreate) SetProducts(p *Product) *OrderProductCreate
- func (opc *OrderProductCreate) SetProductsID(id int64) *OrderProductCreate
- func (opc *OrderProductCreate) SetUpdatedAt(t time.Time) *OrderProductCreate
- type OrderProductCreateBulk
- func (opcb *OrderProductCreateBulk) Exec(ctx context.Context) error
- func (opcb *OrderProductCreateBulk) ExecX(ctx context.Context)
- func (opcb *OrderProductCreateBulk) OnConflict(opts ...sql.ConflictOption) *OrderProductUpsertBulk
- func (opcb *OrderProductCreateBulk) OnConflictColumns(columns ...string) *OrderProductUpsertBulk
- func (opcb *OrderProductCreateBulk) Save(ctx context.Context) ([]*OrderProduct, error)
- func (opcb *OrderProductCreateBulk) SaveX(ctx context.Context) []*OrderProduct
- type OrderProductDelete
- type OrderProductDeleteOne
- type OrderProductEdges
- type OrderProductGroupBy
- func (opgb *OrderProductGroupBy) Aggregate(fns ...AggregateFunc) *OrderProductGroupBy
- func (s *OrderProductGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrderProductGroupBy) BoolX(ctx context.Context) bool
- func (s *OrderProductGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *OrderProductGroupBy) BoolsX(ctx context.Context) []bool
- func (s *OrderProductGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrderProductGroupBy) Float64X(ctx context.Context) float64
- func (s *OrderProductGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrderProductGroupBy) Float64sX(ctx context.Context) []float64
- func (s *OrderProductGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *OrderProductGroupBy) IntX(ctx context.Context) int
- func (s *OrderProductGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *OrderProductGroupBy) IntsX(ctx context.Context) []int
- func (opgb *OrderProductGroupBy) Scan(ctx context.Context, v any) error
- func (s *OrderProductGroupBy) ScanX(ctx context.Context, v any)
- func (s *OrderProductGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *OrderProductGroupBy) StringX(ctx context.Context) string
- func (s *OrderProductGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *OrderProductGroupBy) StringsX(ctx context.Context) []string
- type OrderProductMutation
- func (m *OrderProductMutation) AddAmount(i int64)
- func (m *OrderProductMutation) AddField(name string, value ent.Value) error
- func (m *OrderProductMutation) AddPrice(i int64)
- func (m *OrderProductMutation) AddedAmount() (r int64, exists bool)
- func (m *OrderProductMutation) AddedEdges() []string
- func (m *OrderProductMutation) AddedField(name string) (ent.Value, bool)
- func (m *OrderProductMutation) AddedFields() []string
- func (m *OrderProductMutation) AddedIDs(name string) []ent.Value
- func (m *OrderProductMutation) AddedPrice() (r int64, exists bool)
- func (m *OrderProductMutation) Amount() (r int64, exists bool)
- func (m *OrderProductMutation) ClearEdge(name string) error
- func (m *OrderProductMutation) ClearField(name string) error
- func (m *OrderProductMutation) ClearOrders()
- func (m *OrderProductMutation) ClearProducts()
- func (m *OrderProductMutation) ClearedEdges() []string
- func (m *OrderProductMutation) ClearedFields() []string
- func (m OrderProductMutation) Client() *Client
- func (m *OrderProductMutation) CreatedAt() (r time.Time, exists bool)
- func (m *OrderProductMutation) EdgeCleared(name string) bool
- func (m *OrderProductMutation) Field(name string) (ent.Value, bool)
- func (m *OrderProductMutation) FieldCleared(name string) bool
- func (m *OrderProductMutation) Fields() []string
- func (m *OrderProductMutation) ID() (id int64, exists bool)
- func (m *OrderProductMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *OrderProductMutation) OldAmount(ctx context.Context) (v int64, err error)
- func (m *OrderProductMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *OrderProductMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *OrderProductMutation) OldOrderID(ctx context.Context) (v int64, err error)
- func (m *OrderProductMutation) OldPrice(ctx context.Context) (v int64, err error)
- func (m *OrderProductMutation) OldProductID(ctx context.Context) (v int64, err error)
- func (m *OrderProductMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *OrderProductMutation) Op() Op
- func (m *OrderProductMutation) OrderID() (r int64, exists bool)
- func (m *OrderProductMutation) OrdersCleared() bool
- func (m *OrderProductMutation) OrdersID() (id int64, exists bool)
- func (m *OrderProductMutation) OrdersIDs() (ids []int64)
- func (m *OrderProductMutation) Price() (r int64, exists bool)
- func (m *OrderProductMutation) ProductID() (r int64, exists bool)
- func (m *OrderProductMutation) ProductsCleared() bool
- func (m *OrderProductMutation) ProductsID() (id int64, exists bool)
- func (m *OrderProductMutation) ProductsIDs() (ids []int64)
- func (m *OrderProductMutation) RemovedEdges() []string
- func (m *OrderProductMutation) RemovedIDs(name string) []ent.Value
- func (m *OrderProductMutation) ResetAmount()
- func (m *OrderProductMutation) ResetCreatedAt()
- func (m *OrderProductMutation) ResetEdge(name string) error
- func (m *OrderProductMutation) ResetField(name string) error
- func (m *OrderProductMutation) ResetOrderID()
- func (m *OrderProductMutation) ResetOrders()
- func (m *OrderProductMutation) ResetPrice()
- func (m *OrderProductMutation) ResetProductID()
- func (m *OrderProductMutation) ResetProducts()
- func (m *OrderProductMutation) ResetUpdatedAt()
- func (m *OrderProductMutation) SetAmount(i int64)
- func (m *OrderProductMutation) SetCreatedAt(t time.Time)
- func (m *OrderProductMutation) SetField(name string, value ent.Value) error
- func (m *OrderProductMutation) SetOp(op Op)
- func (m *OrderProductMutation) SetOrderID(i int64)
- func (m *OrderProductMutation) SetOrdersID(id int64)
- func (m *OrderProductMutation) SetPrice(i int64)
- func (m *OrderProductMutation) SetProductID(i int64)
- func (m *OrderProductMutation) SetProductsID(id int64)
- func (m *OrderProductMutation) SetUpdatedAt(t time.Time)
- func (m OrderProductMutation) Tx() (*Tx, error)
- func (m *OrderProductMutation) Type() string
- func (m *OrderProductMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *OrderProductMutation) Where(ps ...predicate.OrderProduct)
- func (m *OrderProductMutation) WhereP(ps ...func(*sql.Selector))
- type OrderProductQuery
- func (opq *OrderProductQuery) Aggregate(fns ...AggregateFunc) *OrderProductSelect
- func (opq *OrderProductQuery) All(ctx context.Context) ([]*OrderProduct, error)
- func (opq *OrderProductQuery) AllX(ctx context.Context) []*OrderProduct
- func (opq *OrderProductQuery) Clone() *OrderProductQuery
- func (opq *OrderProductQuery) Count(ctx context.Context) (int, error)
- func (opq *OrderProductQuery) CountX(ctx context.Context) int
- func (opq *OrderProductQuery) Exist(ctx context.Context) (bool, error)
- func (opq *OrderProductQuery) ExistX(ctx context.Context) bool
- func (opq *OrderProductQuery) First(ctx context.Context) (*OrderProduct, error)
- func (opq *OrderProductQuery) FirstID(ctx context.Context) (id int64, err error)
- func (opq *OrderProductQuery) FirstIDX(ctx context.Context) int64
- func (opq *OrderProductQuery) FirstX(ctx context.Context) *OrderProduct
- func (opq *OrderProductQuery) GroupBy(field string, fields ...string) *OrderProductGroupBy
- func (opq *OrderProductQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (opq *OrderProductQuery) IDsX(ctx context.Context) []int64
- func (opq *OrderProductQuery) Limit(limit int) *OrderProductQuery
- func (opq *OrderProductQuery) Offset(offset int) *OrderProductQuery
- func (opq *OrderProductQuery) Only(ctx context.Context) (*OrderProduct, error)
- func (opq *OrderProductQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (opq *OrderProductQuery) OnlyIDX(ctx context.Context) int64
- func (opq *OrderProductQuery) OnlyX(ctx context.Context) *OrderProduct
- func (opq *OrderProductQuery) Order(o ...orderproduct.OrderOption) *OrderProductQuery
- func (opq *OrderProductQuery) QueryOrders() *OrderQuery
- func (opq *OrderProductQuery) QueryProducts() *ProductQuery
- func (opq *OrderProductQuery) Select(fields ...string) *OrderProductSelect
- func (opq *OrderProductQuery) Unique(unique bool) *OrderProductQuery
- func (opq *OrderProductQuery) Where(ps ...predicate.OrderProduct) *OrderProductQuery
- func (opq *OrderProductQuery) WithOrders(opts ...func(*OrderQuery)) *OrderProductQuery
- func (opq *OrderProductQuery) WithProducts(opts ...func(*ProductQuery)) *OrderProductQuery
- type OrderProductSelect
- func (ops *OrderProductSelect) Aggregate(fns ...AggregateFunc) *OrderProductSelect
- func (s *OrderProductSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrderProductSelect) BoolX(ctx context.Context) bool
- func (s *OrderProductSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *OrderProductSelect) BoolsX(ctx context.Context) []bool
- func (s *OrderProductSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrderProductSelect) Float64X(ctx context.Context) float64
- func (s *OrderProductSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrderProductSelect) Float64sX(ctx context.Context) []float64
- func (s *OrderProductSelect) Int(ctx context.Context) (_ int, err error)
- func (s *OrderProductSelect) IntX(ctx context.Context) int
- func (s *OrderProductSelect) Ints(ctx context.Context) ([]int, error)
- func (s *OrderProductSelect) IntsX(ctx context.Context) []int
- func (ops *OrderProductSelect) Scan(ctx context.Context, v any) error
- func (s *OrderProductSelect) ScanX(ctx context.Context, v any)
- func (s *OrderProductSelect) String(ctx context.Context) (_ string, err error)
- func (s *OrderProductSelect) StringX(ctx context.Context) string
- func (s *OrderProductSelect) Strings(ctx context.Context) ([]string, error)
- func (s *OrderProductSelect) StringsX(ctx context.Context) []string
- type OrderProductUpdate
- func (opu *OrderProductUpdate) AddAmount(i int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) AddPrice(i int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) ClearOrders() *OrderProductUpdate
- func (opu *OrderProductUpdate) ClearProducts() *OrderProductUpdate
- func (opu *OrderProductUpdate) Exec(ctx context.Context) error
- func (opu *OrderProductUpdate) ExecX(ctx context.Context)
- func (opu *OrderProductUpdate) Mutation() *OrderProductMutation
- func (opu *OrderProductUpdate) Save(ctx context.Context) (int, error)
- func (opu *OrderProductUpdate) SaveX(ctx context.Context) int
- func (opu *OrderProductUpdate) SetAmount(i int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetNillableAmount(i *int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetNillableOrderID(i *int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetNillablePrice(i *int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetNillableProductID(i *int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetOrderID(i int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetOrders(o *Order) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetOrdersID(id int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetPrice(i int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetProductID(i int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetProducts(p *Product) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetProductsID(id int64) *OrderProductUpdate
- func (opu *OrderProductUpdate) SetUpdatedAt(t time.Time) *OrderProductUpdate
- func (opu *OrderProductUpdate) Where(ps ...predicate.OrderProduct) *OrderProductUpdate
- type OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) AddAmount(i int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) AddPrice(i int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) ClearOrders() *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) ClearProducts() *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) Exec(ctx context.Context) error
- func (opuo *OrderProductUpdateOne) ExecX(ctx context.Context)
- func (opuo *OrderProductUpdateOne) Mutation() *OrderProductMutation
- func (opuo *OrderProductUpdateOne) Save(ctx context.Context) (*OrderProduct, error)
- func (opuo *OrderProductUpdateOne) SaveX(ctx context.Context) *OrderProduct
- func (opuo *OrderProductUpdateOne) Select(field string, fields ...string) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetAmount(i int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetNillableAmount(i *int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetNillableOrderID(i *int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetNillablePrice(i *int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetNillableProductID(i *int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetOrderID(i int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetOrders(o *Order) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetOrdersID(id int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetPrice(i int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetProductID(i int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetProducts(p *Product) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetProductsID(id int64) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) SetUpdatedAt(t time.Time) *OrderProductUpdateOne
- func (opuo *OrderProductUpdateOne) Where(ps ...predicate.OrderProduct) *OrderProductUpdateOne
- type OrderProductUpsert
- func (u *OrderProductUpsert) AddAmount(v int64) *OrderProductUpsert
- func (u *OrderProductUpsert) AddPrice(v int64) *OrderProductUpsert
- func (u *OrderProductUpsert) SetAmount(v int64) *OrderProductUpsert
- func (u *OrderProductUpsert) SetOrderID(v int64) *OrderProductUpsert
- func (u *OrderProductUpsert) SetPrice(v int64) *OrderProductUpsert
- func (u *OrderProductUpsert) SetProductID(v int64) *OrderProductUpsert
- func (u *OrderProductUpsert) SetUpdatedAt(v time.Time) *OrderProductUpsert
- func (u *OrderProductUpsert) UpdateAmount() *OrderProductUpsert
- func (u *OrderProductUpsert) UpdateOrderID() *OrderProductUpsert
- func (u *OrderProductUpsert) UpdatePrice() *OrderProductUpsert
- func (u *OrderProductUpsert) UpdateProductID() *OrderProductUpsert
- func (u *OrderProductUpsert) UpdateUpdatedAt() *OrderProductUpsert
- type OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) AddAmount(v int64) *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) AddPrice(v int64) *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) DoNothing() *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) Exec(ctx context.Context) error
- func (u *OrderProductUpsertBulk) ExecX(ctx context.Context)
- func (u *OrderProductUpsertBulk) Ignore() *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) SetAmount(v int64) *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) SetOrderID(v int64) *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) SetPrice(v int64) *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) SetProductID(v int64) *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) SetUpdatedAt(v time.Time) *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) Update(set func(*OrderProductUpsert)) *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) UpdateAmount() *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) UpdateNewValues() *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) UpdateOrderID() *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) UpdatePrice() *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) UpdateProductID() *OrderProductUpsertBulk
- func (u *OrderProductUpsertBulk) UpdateUpdatedAt() *OrderProductUpsertBulk
- type OrderProductUpsertOne
- func (u *OrderProductUpsertOne) AddAmount(v int64) *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) AddPrice(v int64) *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) DoNothing() *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) Exec(ctx context.Context) error
- func (u *OrderProductUpsertOne) ExecX(ctx context.Context)
- func (u *OrderProductUpsertOne) ID(ctx context.Context) (id int64, err error)
- func (u *OrderProductUpsertOne) IDX(ctx context.Context) int64
- func (u *OrderProductUpsertOne) Ignore() *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) SetAmount(v int64) *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) SetOrderID(v int64) *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) SetPrice(v int64) *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) SetProductID(v int64) *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) SetUpdatedAt(v time.Time) *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) Update(set func(*OrderProductUpsert)) *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) UpdateAmount() *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) UpdateNewValues() *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) UpdateOrderID() *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) UpdatePrice() *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) UpdateProductID() *OrderProductUpsertOne
- func (u *OrderProductUpsertOne) UpdateUpdatedAt() *OrderProductUpsertOne
- type OrderProducts
- type OrderQuery
- func (oq *OrderQuery) Aggregate(fns ...AggregateFunc) *OrderSelect
- func (oq *OrderQuery) All(ctx context.Context) ([]*Order, error)
- func (oq *OrderQuery) AllX(ctx context.Context) []*Order
- func (oq *OrderQuery) Clone() *OrderQuery
- func (oq *OrderQuery) Count(ctx context.Context) (int, error)
- func (oq *OrderQuery) CountX(ctx context.Context) int
- func (oq *OrderQuery) Exist(ctx context.Context) (bool, error)
- func (oq *OrderQuery) ExistX(ctx context.Context) bool
- func (oq *OrderQuery) First(ctx context.Context) (*Order, error)
- func (oq *OrderQuery) FirstID(ctx context.Context) (id int64, err error)
- func (oq *OrderQuery) FirstIDX(ctx context.Context) int64
- func (oq *OrderQuery) FirstX(ctx context.Context) *Order
- func (oq *OrderQuery) GroupBy(field string, fields ...string) *OrderGroupBy
- func (oq *OrderQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (oq *OrderQuery) IDsX(ctx context.Context) []int64
- func (oq *OrderQuery) Limit(limit int) *OrderQuery
- func (oq *OrderQuery) Offset(offset int) *OrderQuery
- func (oq *OrderQuery) Only(ctx context.Context) (*Order, error)
- func (oq *OrderQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (oq *OrderQuery) OnlyIDX(ctx context.Context) int64
- func (oq *OrderQuery) OnlyX(ctx context.Context) *Order
- func (oq *OrderQuery) Order(o ...order.OrderOption) *OrderQuery
- func (oq *OrderQuery) QueryOrderProducts() *OrderProductQuery
- func (oq *OrderQuery) QueryUsers() *UserQuery
- func (oq *OrderQuery) Select(fields ...string) *OrderSelect
- func (oq *OrderQuery) Unique(unique bool) *OrderQuery
- func (oq *OrderQuery) Where(ps ...predicate.Order) *OrderQuery
- func (oq *OrderQuery) WithOrderProducts(opts ...func(*OrderProductQuery)) *OrderQuery
- func (oq *OrderQuery) WithUsers(opts ...func(*UserQuery)) *OrderQuery
- type OrderSelect
- func (os *OrderSelect) Aggregate(fns ...AggregateFunc) *OrderSelect
- func (s *OrderSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrderSelect) BoolX(ctx context.Context) bool
- func (s *OrderSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *OrderSelect) BoolsX(ctx context.Context) []bool
- func (s *OrderSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrderSelect) Float64X(ctx context.Context) float64
- func (s *OrderSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrderSelect) Float64sX(ctx context.Context) []float64
- func (s *OrderSelect) Int(ctx context.Context) (_ int, err error)
- func (s *OrderSelect) IntX(ctx context.Context) int
- func (s *OrderSelect) Ints(ctx context.Context) ([]int, error)
- func (s *OrderSelect) IntsX(ctx context.Context) []int
- func (os *OrderSelect) Scan(ctx context.Context, v any) error
- func (s *OrderSelect) ScanX(ctx context.Context, v any)
- func (s *OrderSelect) String(ctx context.Context) (_ string, err error)
- func (s *OrderSelect) StringX(ctx context.Context) string
- func (s *OrderSelect) Strings(ctx context.Context) ([]string, error)
- func (s *OrderSelect) StringsX(ctx context.Context) []string
- type OrderUpdate
- func (ou *OrderUpdate) AddOrderProductIDs(ids ...int64) *OrderUpdate
- func (ou *OrderUpdate) AddOrderProducts(o ...*OrderProduct) *OrderUpdate
- func (ou *OrderUpdate) ClearOrderProducts() *OrderUpdate
- func (ou *OrderUpdate) ClearUsers() *OrderUpdate
- func (ou *OrderUpdate) Exec(ctx context.Context) error
- func (ou *OrderUpdate) ExecX(ctx context.Context)
- func (ou *OrderUpdate) Mutation() *OrderMutation
- func (ou *OrderUpdate) RemoveOrderProductIDs(ids ...int64) *OrderUpdate
- func (ou *OrderUpdate) RemoveOrderProducts(o ...*OrderProduct) *OrderUpdate
- func (ou *OrderUpdate) Save(ctx context.Context) (int, error)
- func (ou *OrderUpdate) SaveX(ctx context.Context) int
- func (ou *OrderUpdate) SetNillableStatus(o *order.Status) *OrderUpdate
- func (ou *OrderUpdate) SetNillableUserID(i *int64) *OrderUpdate
- func (ou *OrderUpdate) SetStatus(o order.Status) *OrderUpdate
- func (ou *OrderUpdate) SetUpdatedAt(t time.Time) *OrderUpdate
- func (ou *OrderUpdate) SetUserID(i int64) *OrderUpdate
- func (ou *OrderUpdate) SetUsers(u *User) *OrderUpdate
- func (ou *OrderUpdate) SetUsersID(id int64) *OrderUpdate
- func (ou *OrderUpdate) Where(ps ...predicate.Order) *OrderUpdate
- type OrderUpdateOne
- func (ouo *OrderUpdateOne) AddOrderProductIDs(ids ...int64) *OrderUpdateOne
- func (ouo *OrderUpdateOne) AddOrderProducts(o ...*OrderProduct) *OrderUpdateOne
- func (ouo *OrderUpdateOne) ClearOrderProducts() *OrderUpdateOne
- func (ouo *OrderUpdateOne) ClearUsers() *OrderUpdateOne
- func (ouo *OrderUpdateOne) Exec(ctx context.Context) error
- func (ouo *OrderUpdateOne) ExecX(ctx context.Context)
- func (ouo *OrderUpdateOne) Mutation() *OrderMutation
- func (ouo *OrderUpdateOne) RemoveOrderProductIDs(ids ...int64) *OrderUpdateOne
- func (ouo *OrderUpdateOne) RemoveOrderProducts(o ...*OrderProduct) *OrderUpdateOne
- func (ouo *OrderUpdateOne) Save(ctx context.Context) (*Order, error)
- func (ouo *OrderUpdateOne) SaveX(ctx context.Context) *Order
- func (ouo *OrderUpdateOne) Select(field string, fields ...string) *OrderUpdateOne
- func (ouo *OrderUpdateOne) SetNillableStatus(o *order.Status) *OrderUpdateOne
- func (ouo *OrderUpdateOne) SetNillableUserID(i *int64) *OrderUpdateOne
- func (ouo *OrderUpdateOne) SetStatus(o order.Status) *OrderUpdateOne
- func (ouo *OrderUpdateOne) SetUpdatedAt(t time.Time) *OrderUpdateOne
- func (ouo *OrderUpdateOne) SetUserID(i int64) *OrderUpdateOne
- func (ouo *OrderUpdateOne) SetUsers(u *User) *OrderUpdateOne
- func (ouo *OrderUpdateOne) SetUsersID(id int64) *OrderUpdateOne
- func (ouo *OrderUpdateOne) Where(ps ...predicate.Order) *OrderUpdateOne
- type OrderUpsert
- func (u *OrderUpsert) SetStatus(v order.Status) *OrderUpsert
- func (u *OrderUpsert) SetUpdatedAt(v time.Time) *OrderUpsert
- func (u *OrderUpsert) SetUserID(v int64) *OrderUpsert
- func (u *OrderUpsert) UpdateStatus() *OrderUpsert
- func (u *OrderUpsert) UpdateUpdatedAt() *OrderUpsert
- func (u *OrderUpsert) UpdateUserID() *OrderUpsert
- type OrderUpsertBulk
- func (u *OrderUpsertBulk) DoNothing() *OrderUpsertBulk
- func (u *OrderUpsertBulk) Exec(ctx context.Context) error
- func (u *OrderUpsertBulk) ExecX(ctx context.Context)
- func (u *OrderUpsertBulk) Ignore() *OrderUpsertBulk
- func (u *OrderUpsertBulk) SetStatus(v order.Status) *OrderUpsertBulk
- func (u *OrderUpsertBulk) SetUpdatedAt(v time.Time) *OrderUpsertBulk
- func (u *OrderUpsertBulk) SetUserID(v int64) *OrderUpsertBulk
- func (u *OrderUpsertBulk) Update(set func(*OrderUpsert)) *OrderUpsertBulk
- func (u *OrderUpsertBulk) UpdateNewValues() *OrderUpsertBulk
- func (u *OrderUpsertBulk) UpdateStatus() *OrderUpsertBulk
- func (u *OrderUpsertBulk) UpdateUpdatedAt() *OrderUpsertBulk
- func (u *OrderUpsertBulk) UpdateUserID() *OrderUpsertBulk
- type OrderUpsertOne
- func (u *OrderUpsertOne) DoNothing() *OrderUpsertOne
- func (u *OrderUpsertOne) Exec(ctx context.Context) error
- func (u *OrderUpsertOne) ExecX(ctx context.Context)
- func (u *OrderUpsertOne) ID(ctx context.Context) (id int64, err error)
- func (u *OrderUpsertOne) IDX(ctx context.Context) int64
- func (u *OrderUpsertOne) Ignore() *OrderUpsertOne
- func (u *OrderUpsertOne) SetStatus(v order.Status) *OrderUpsertOne
- func (u *OrderUpsertOne) SetUpdatedAt(v time.Time) *OrderUpsertOne
- func (u *OrderUpsertOne) SetUserID(v int64) *OrderUpsertOne
- func (u *OrderUpsertOne) Update(set func(*OrderUpsert)) *OrderUpsertOne
- func (u *OrderUpsertOne) UpdateNewValues() *OrderUpsertOne
- func (u *OrderUpsertOne) UpdateStatus() *OrderUpsertOne
- func (u *OrderUpsertOne) UpdateUpdatedAt() *OrderUpsertOne
- func (u *OrderUpsertOne) UpdateUserID() *OrderUpsertOne
- type Orders
- type Policy
- type Product
- func (pr *Product) QueryCarts() *CartQuery
- func (pr *Product) QueryCategories() *CategoryQuery
- func (pr *Product) QueryOrderProducts() *OrderProductQuery
- func (pr *Product) QueryProductImages() *ProductImageQuery
- func (pr *Product) String() string
- func (pr *Product) Unwrap() *Product
- func (pr *Product) Update() *ProductUpdateOne
- func (pr *Product) Value(name string) (ent.Value, error)
- type ProductClient
- func (c *ProductClient) Create() *ProductCreate
- func (c *ProductClient) CreateBulk(builders ...*ProductCreate) *ProductCreateBulk
- func (c *ProductClient) Delete() *ProductDelete
- func (c *ProductClient) DeleteOne(pr *Product) *ProductDeleteOne
- func (c *ProductClient) DeleteOneID(id int64) *ProductDeleteOne
- func (c *ProductClient) Get(ctx context.Context, id int64) (*Product, error)
- func (c *ProductClient) GetX(ctx context.Context, id int64) *Product
- func (c *ProductClient) Hooks() []Hook
- func (c *ProductClient) Intercept(interceptors ...Interceptor)
- func (c *ProductClient) Interceptors() []Interceptor
- func (c *ProductClient) MapCreateBulk(slice any, setFunc func(*ProductCreate, int)) *ProductCreateBulk
- func (c *ProductClient) Query() *ProductQuery
- func (c *ProductClient) QueryCarts(pr *Product) *CartQuery
- func (c *ProductClient) QueryCategories(pr *Product) *CategoryQuery
- func (c *ProductClient) QueryOrderProducts(pr *Product) *OrderProductQuery
- func (c *ProductClient) QueryProductImages(pr *Product) *ProductImageQuery
- func (c *ProductClient) Update() *ProductUpdate
- func (c *ProductClient) UpdateOne(pr *Product) *ProductUpdateOne
- func (c *ProductClient) UpdateOneID(id int64) *ProductUpdateOne
- func (c *ProductClient) Use(hooks ...Hook)
- type ProductCreate
- func (pc *ProductCreate) AddCartIDs(ids ...int64) *ProductCreate
- func (pc *ProductCreate) AddCarts(c ...*Cart) *ProductCreate
- func (pc *ProductCreate) AddOrderProductIDs(ids ...int64) *ProductCreate
- func (pc *ProductCreate) AddOrderProducts(o ...*OrderProduct) *ProductCreate
- func (pc *ProductCreate) AddProductImageIDs(ids ...int64) *ProductCreate
- func (pc *ProductCreate) AddProductImages(p ...*ProductImage) *ProductCreate
- func (pc *ProductCreate) Exec(ctx context.Context) error
- func (pc *ProductCreate) ExecX(ctx context.Context)
- func (pc *ProductCreate) Mutation() *ProductMutation
- func (pc *ProductCreate) OnConflict(opts ...sql.ConflictOption) *ProductUpsertOne
- func (pc *ProductCreate) OnConflictColumns(columns ...string) *ProductUpsertOne
- func (pc *ProductCreate) Save(ctx context.Context) (*Product, error)
- func (pc *ProductCreate) SaveX(ctx context.Context) *Product
- func (pc *ProductCreate) SetAmount(i int64) *ProductCreate
- func (pc *ProductCreate) SetCategories(c *Category) *ProductCreate
- func (pc *ProductCreate) SetCategoriesID(id int64) *ProductCreate
- func (pc *ProductCreate) SetCategoryID(i int64) *ProductCreate
- func (pc *ProductCreate) SetCreatedAt(t time.Time) *ProductCreate
- func (pc *ProductCreate) SetDescription(s string) *ProductCreate
- func (pc *ProductCreate) SetName(s string) *ProductCreate
- func (pc *ProductCreate) SetNillableAmount(i *int64) *ProductCreate
- func (pc *ProductCreate) SetNillableCreatedAt(t *time.Time) *ProductCreate
- func (pc *ProductCreate) SetNillableDescription(s *string) *ProductCreate
- func (pc *ProductCreate) SetNillableUpdatedAt(t *time.Time) *ProductCreate
- func (pc *ProductCreate) SetPrice(i int64) *ProductCreate
- func (pc *ProductCreate) SetUpdatedAt(t time.Time) *ProductCreate
- type ProductCreateBulk
- func (pcb *ProductCreateBulk) Exec(ctx context.Context) error
- func (pcb *ProductCreateBulk) ExecX(ctx context.Context)
- func (pcb *ProductCreateBulk) OnConflict(opts ...sql.ConflictOption) *ProductUpsertBulk
- func (pcb *ProductCreateBulk) OnConflictColumns(columns ...string) *ProductUpsertBulk
- func (pcb *ProductCreateBulk) Save(ctx context.Context) ([]*Product, error)
- func (pcb *ProductCreateBulk) SaveX(ctx context.Context) []*Product
- type ProductDelete
- type ProductDeleteOne
- type ProductEdges
- type ProductGroupBy
- func (pgb *ProductGroupBy) Aggregate(fns ...AggregateFunc) *ProductGroupBy
- func (s *ProductGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProductGroupBy) BoolX(ctx context.Context) bool
- func (s *ProductGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ProductGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ProductGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProductGroupBy) Float64X(ctx context.Context) float64
- func (s *ProductGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProductGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ProductGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ProductGroupBy) IntX(ctx context.Context) int
- func (s *ProductGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ProductGroupBy) IntsX(ctx context.Context) []int
- func (pgb *ProductGroupBy) Scan(ctx context.Context, v any) error
- func (s *ProductGroupBy) ScanX(ctx context.Context, v any)
- func (s *ProductGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ProductGroupBy) StringX(ctx context.Context) string
- func (s *ProductGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ProductGroupBy) StringsX(ctx context.Context) []string
- type ProductImage
- type ProductImageClient
- func (c *ProductImageClient) Create() *ProductImageCreate
- func (c *ProductImageClient) CreateBulk(builders ...*ProductImageCreate) *ProductImageCreateBulk
- func (c *ProductImageClient) Delete() *ProductImageDelete
- func (c *ProductImageClient) DeleteOne(pi *ProductImage) *ProductImageDeleteOne
- func (c *ProductImageClient) DeleteOneID(id int64) *ProductImageDeleteOne
- func (c *ProductImageClient) Get(ctx context.Context, id int64) (*ProductImage, error)
- func (c *ProductImageClient) GetX(ctx context.Context, id int64) *ProductImage
- func (c *ProductImageClient) Hooks() []Hook
- func (c *ProductImageClient) Intercept(interceptors ...Interceptor)
- func (c *ProductImageClient) Interceptors() []Interceptor
- func (c *ProductImageClient) MapCreateBulk(slice any, setFunc func(*ProductImageCreate, int)) *ProductImageCreateBulk
- func (c *ProductImageClient) Query() *ProductImageQuery
- func (c *ProductImageClient) QueryProducts(pi *ProductImage) *ProductQuery
- func (c *ProductImageClient) Update() *ProductImageUpdate
- func (c *ProductImageClient) UpdateOne(pi *ProductImage) *ProductImageUpdateOne
- func (c *ProductImageClient) UpdateOneID(id int64) *ProductImageUpdateOne
- func (c *ProductImageClient) Use(hooks ...Hook)
- type ProductImageCreate
- func (pic *ProductImageCreate) Exec(ctx context.Context) error
- func (pic *ProductImageCreate) ExecX(ctx context.Context)
- func (pic *ProductImageCreate) Mutation() *ProductImageMutation
- func (pic *ProductImageCreate) OnConflict(opts ...sql.ConflictOption) *ProductImageUpsertOne
- func (pic *ProductImageCreate) OnConflictColumns(columns ...string) *ProductImageUpsertOne
- func (pic *ProductImageCreate) Save(ctx context.Context) (*ProductImage, error)
- func (pic *ProductImageCreate) SaveX(ctx context.Context) *ProductImage
- func (pic *ProductImageCreate) SetCreatedAt(t time.Time) *ProductImageCreate
- func (pic *ProductImageCreate) SetName(s string) *ProductImageCreate
- func (pic *ProductImageCreate) SetNillableCreatedAt(t *time.Time) *ProductImageCreate
- func (pic *ProductImageCreate) SetNillableUpdatedAt(t *time.Time) *ProductImageCreate
- func (pic *ProductImageCreate) SetProductID(i int64) *ProductImageCreate
- func (pic *ProductImageCreate) SetProducts(p *Product) *ProductImageCreate
- func (pic *ProductImageCreate) SetProductsID(id int64) *ProductImageCreate
- func (pic *ProductImageCreate) SetUpdatedAt(t time.Time) *ProductImageCreate
- type ProductImageCreateBulk
- func (picb *ProductImageCreateBulk) Exec(ctx context.Context) error
- func (picb *ProductImageCreateBulk) ExecX(ctx context.Context)
- func (picb *ProductImageCreateBulk) OnConflict(opts ...sql.ConflictOption) *ProductImageUpsertBulk
- func (picb *ProductImageCreateBulk) OnConflictColumns(columns ...string) *ProductImageUpsertBulk
- func (picb *ProductImageCreateBulk) Save(ctx context.Context) ([]*ProductImage, error)
- func (picb *ProductImageCreateBulk) SaveX(ctx context.Context) []*ProductImage
- type ProductImageDelete
- type ProductImageDeleteOne
- type ProductImageEdges
- type ProductImageGroupBy
- func (pigb *ProductImageGroupBy) Aggregate(fns ...AggregateFunc) *ProductImageGroupBy
- func (s *ProductImageGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProductImageGroupBy) BoolX(ctx context.Context) bool
- func (s *ProductImageGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ProductImageGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ProductImageGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProductImageGroupBy) Float64X(ctx context.Context) float64
- func (s *ProductImageGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProductImageGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ProductImageGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ProductImageGroupBy) IntX(ctx context.Context) int
- func (s *ProductImageGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ProductImageGroupBy) IntsX(ctx context.Context) []int
- func (pigb *ProductImageGroupBy) Scan(ctx context.Context, v any) error
- func (s *ProductImageGroupBy) ScanX(ctx context.Context, v any)
- func (s *ProductImageGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ProductImageGroupBy) StringX(ctx context.Context) string
- func (s *ProductImageGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ProductImageGroupBy) StringsX(ctx context.Context) []string
- type ProductImageMutation
- func (m *ProductImageMutation) AddField(name string, value ent.Value) error
- func (m *ProductImageMutation) AddedEdges() []string
- func (m *ProductImageMutation) AddedField(name string) (ent.Value, bool)
- func (m *ProductImageMutation) AddedFields() []string
- func (m *ProductImageMutation) AddedIDs(name string) []ent.Value
- func (m *ProductImageMutation) ClearEdge(name string) error
- func (m *ProductImageMutation) ClearField(name string) error
- func (m *ProductImageMutation) ClearProducts()
- func (m *ProductImageMutation) ClearedEdges() []string
- func (m *ProductImageMutation) ClearedFields() []string
- func (m ProductImageMutation) Client() *Client
- func (m *ProductImageMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ProductImageMutation) EdgeCleared(name string) bool
- func (m *ProductImageMutation) Field(name string) (ent.Value, bool)
- func (m *ProductImageMutation) FieldCleared(name string) bool
- func (m *ProductImageMutation) Fields() []string
- func (m *ProductImageMutation) ID() (id int64, exists bool)
- func (m *ProductImageMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *ProductImageMutation) Name() (r string, exists bool)
- func (m *ProductImageMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProductImageMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ProductImageMutation) OldName(ctx context.Context) (v string, err error)
- func (m *ProductImageMutation) OldProductID(ctx context.Context) (v int64, err error)
- func (m *ProductImageMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProductImageMutation) Op() Op
- func (m *ProductImageMutation) ProductID() (r int64, exists bool)
- func (m *ProductImageMutation) ProductsCleared() bool
- func (m *ProductImageMutation) ProductsID() (id int64, exists bool)
- func (m *ProductImageMutation) ProductsIDs() (ids []int64)
- func (m *ProductImageMutation) RemovedEdges() []string
- func (m *ProductImageMutation) RemovedIDs(name string) []ent.Value
- func (m *ProductImageMutation) ResetCreatedAt()
- func (m *ProductImageMutation) ResetEdge(name string) error
- func (m *ProductImageMutation) ResetField(name string) error
- func (m *ProductImageMutation) ResetName()
- func (m *ProductImageMutation) ResetProductID()
- func (m *ProductImageMutation) ResetProducts()
- func (m *ProductImageMutation) ResetUpdatedAt()
- func (m *ProductImageMutation) SetCreatedAt(t time.Time)
- func (m *ProductImageMutation) SetField(name string, value ent.Value) error
- func (m *ProductImageMutation) SetName(s string)
- func (m *ProductImageMutation) SetOp(op Op)
- func (m *ProductImageMutation) SetProductID(i int64)
- func (m *ProductImageMutation) SetProductsID(id int64)
- func (m *ProductImageMutation) SetUpdatedAt(t time.Time)
- func (m ProductImageMutation) Tx() (*Tx, error)
- func (m *ProductImageMutation) Type() string
- func (m *ProductImageMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *ProductImageMutation) Where(ps ...predicate.ProductImage)
- func (m *ProductImageMutation) WhereP(ps ...func(*sql.Selector))
- type ProductImageQuery
- func (piq *ProductImageQuery) Aggregate(fns ...AggregateFunc) *ProductImageSelect
- func (piq *ProductImageQuery) All(ctx context.Context) ([]*ProductImage, error)
- func (piq *ProductImageQuery) AllX(ctx context.Context) []*ProductImage
- func (piq *ProductImageQuery) Clone() *ProductImageQuery
- func (piq *ProductImageQuery) Count(ctx context.Context) (int, error)
- func (piq *ProductImageQuery) CountX(ctx context.Context) int
- func (piq *ProductImageQuery) Exist(ctx context.Context) (bool, error)
- func (piq *ProductImageQuery) ExistX(ctx context.Context) bool
- func (piq *ProductImageQuery) First(ctx context.Context) (*ProductImage, error)
- func (piq *ProductImageQuery) FirstID(ctx context.Context) (id int64, err error)
- func (piq *ProductImageQuery) FirstIDX(ctx context.Context) int64
- func (piq *ProductImageQuery) FirstX(ctx context.Context) *ProductImage
- func (piq *ProductImageQuery) GroupBy(field string, fields ...string) *ProductImageGroupBy
- func (piq *ProductImageQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (piq *ProductImageQuery) IDsX(ctx context.Context) []int64
- func (piq *ProductImageQuery) Limit(limit int) *ProductImageQuery
- func (piq *ProductImageQuery) Offset(offset int) *ProductImageQuery
- func (piq *ProductImageQuery) Only(ctx context.Context) (*ProductImage, error)
- func (piq *ProductImageQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (piq *ProductImageQuery) OnlyIDX(ctx context.Context) int64
- func (piq *ProductImageQuery) OnlyX(ctx context.Context) *ProductImage
- func (piq *ProductImageQuery) Order(o ...productimage.OrderOption) *ProductImageQuery
- func (piq *ProductImageQuery) QueryProducts() *ProductQuery
- func (piq *ProductImageQuery) Select(fields ...string) *ProductImageSelect
- func (piq *ProductImageQuery) Unique(unique bool) *ProductImageQuery
- func (piq *ProductImageQuery) Where(ps ...predicate.ProductImage) *ProductImageQuery
- func (piq *ProductImageQuery) WithProducts(opts ...func(*ProductQuery)) *ProductImageQuery
- type ProductImageSelect
- func (pis *ProductImageSelect) Aggregate(fns ...AggregateFunc) *ProductImageSelect
- func (s *ProductImageSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProductImageSelect) BoolX(ctx context.Context) bool
- func (s *ProductImageSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ProductImageSelect) BoolsX(ctx context.Context) []bool
- func (s *ProductImageSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProductImageSelect) Float64X(ctx context.Context) float64
- func (s *ProductImageSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProductImageSelect) Float64sX(ctx context.Context) []float64
- func (s *ProductImageSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ProductImageSelect) IntX(ctx context.Context) int
- func (s *ProductImageSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ProductImageSelect) IntsX(ctx context.Context) []int
- func (pis *ProductImageSelect) Scan(ctx context.Context, v any) error
- func (s *ProductImageSelect) ScanX(ctx context.Context, v any)
- func (s *ProductImageSelect) String(ctx context.Context) (_ string, err error)
- func (s *ProductImageSelect) StringX(ctx context.Context) string
- func (s *ProductImageSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ProductImageSelect) StringsX(ctx context.Context) []string
- type ProductImageUpdate
- func (piu *ProductImageUpdate) ClearProducts() *ProductImageUpdate
- func (piu *ProductImageUpdate) Exec(ctx context.Context) error
- func (piu *ProductImageUpdate) ExecX(ctx context.Context)
- func (piu *ProductImageUpdate) Mutation() *ProductImageMutation
- func (piu *ProductImageUpdate) Save(ctx context.Context) (int, error)
- func (piu *ProductImageUpdate) SaveX(ctx context.Context) int
- func (piu *ProductImageUpdate) SetName(s string) *ProductImageUpdate
- func (piu *ProductImageUpdate) SetNillableName(s *string) *ProductImageUpdate
- func (piu *ProductImageUpdate) SetNillableProductID(i *int64) *ProductImageUpdate
- func (piu *ProductImageUpdate) SetProductID(i int64) *ProductImageUpdate
- func (piu *ProductImageUpdate) SetProducts(p *Product) *ProductImageUpdate
- func (piu *ProductImageUpdate) SetProductsID(id int64) *ProductImageUpdate
- func (piu *ProductImageUpdate) SetUpdatedAt(t time.Time) *ProductImageUpdate
- func (piu *ProductImageUpdate) Where(ps ...predicate.ProductImage) *ProductImageUpdate
- type ProductImageUpdateOne
- func (piuo *ProductImageUpdateOne) ClearProducts() *ProductImageUpdateOne
- func (piuo *ProductImageUpdateOne) Exec(ctx context.Context) error
- func (piuo *ProductImageUpdateOne) ExecX(ctx context.Context)
- func (piuo *ProductImageUpdateOne) Mutation() *ProductImageMutation
- func (piuo *ProductImageUpdateOne) Save(ctx context.Context) (*ProductImage, error)
- func (piuo *ProductImageUpdateOne) SaveX(ctx context.Context) *ProductImage
- func (piuo *ProductImageUpdateOne) Select(field string, fields ...string) *ProductImageUpdateOne
- func (piuo *ProductImageUpdateOne) SetName(s string) *ProductImageUpdateOne
- func (piuo *ProductImageUpdateOne) SetNillableName(s *string) *ProductImageUpdateOne
- func (piuo *ProductImageUpdateOne) SetNillableProductID(i *int64) *ProductImageUpdateOne
- func (piuo *ProductImageUpdateOne) SetProductID(i int64) *ProductImageUpdateOne
- func (piuo *ProductImageUpdateOne) SetProducts(p *Product) *ProductImageUpdateOne
- func (piuo *ProductImageUpdateOne) SetProductsID(id int64) *ProductImageUpdateOne
- func (piuo *ProductImageUpdateOne) SetUpdatedAt(t time.Time) *ProductImageUpdateOne
- func (piuo *ProductImageUpdateOne) Where(ps ...predicate.ProductImage) *ProductImageUpdateOne
- type ProductImageUpsert
- func (u *ProductImageUpsert) SetName(v string) *ProductImageUpsert
- func (u *ProductImageUpsert) SetProductID(v int64) *ProductImageUpsert
- func (u *ProductImageUpsert) SetUpdatedAt(v time.Time) *ProductImageUpsert
- func (u *ProductImageUpsert) UpdateName() *ProductImageUpsert
- func (u *ProductImageUpsert) UpdateProductID() *ProductImageUpsert
- func (u *ProductImageUpsert) UpdateUpdatedAt() *ProductImageUpsert
- type ProductImageUpsertBulk
- func (u *ProductImageUpsertBulk) DoNothing() *ProductImageUpsertBulk
- func (u *ProductImageUpsertBulk) Exec(ctx context.Context) error
- func (u *ProductImageUpsertBulk) ExecX(ctx context.Context)
- func (u *ProductImageUpsertBulk) Ignore() *ProductImageUpsertBulk
- func (u *ProductImageUpsertBulk) SetName(v string) *ProductImageUpsertBulk
- func (u *ProductImageUpsertBulk) SetProductID(v int64) *ProductImageUpsertBulk
- func (u *ProductImageUpsertBulk) SetUpdatedAt(v time.Time) *ProductImageUpsertBulk
- func (u *ProductImageUpsertBulk) Update(set func(*ProductImageUpsert)) *ProductImageUpsertBulk
- func (u *ProductImageUpsertBulk) UpdateName() *ProductImageUpsertBulk
- func (u *ProductImageUpsertBulk) UpdateNewValues() *ProductImageUpsertBulk
- func (u *ProductImageUpsertBulk) UpdateProductID() *ProductImageUpsertBulk
- func (u *ProductImageUpsertBulk) UpdateUpdatedAt() *ProductImageUpsertBulk
- type ProductImageUpsertOne
- func (u *ProductImageUpsertOne) DoNothing() *ProductImageUpsertOne
- func (u *ProductImageUpsertOne) Exec(ctx context.Context) error
- func (u *ProductImageUpsertOne) ExecX(ctx context.Context)
- func (u *ProductImageUpsertOne) ID(ctx context.Context) (id int64, err error)
- func (u *ProductImageUpsertOne) IDX(ctx context.Context) int64
- func (u *ProductImageUpsertOne) Ignore() *ProductImageUpsertOne
- func (u *ProductImageUpsertOne) SetName(v string) *ProductImageUpsertOne
- func (u *ProductImageUpsertOne) SetProductID(v int64) *ProductImageUpsertOne
- func (u *ProductImageUpsertOne) SetUpdatedAt(v time.Time) *ProductImageUpsertOne
- func (u *ProductImageUpsertOne) Update(set func(*ProductImageUpsert)) *ProductImageUpsertOne
- func (u *ProductImageUpsertOne) UpdateName() *ProductImageUpsertOne
- func (u *ProductImageUpsertOne) UpdateNewValues() *ProductImageUpsertOne
- func (u *ProductImageUpsertOne) UpdateProductID() *ProductImageUpsertOne
- func (u *ProductImageUpsertOne) UpdateUpdatedAt() *ProductImageUpsertOne
- type ProductImages
- type ProductMutation
- func (m *ProductMutation) AddAmount(i int64)
- func (m *ProductMutation) AddCartIDs(ids ...int64)
- func (m *ProductMutation) AddField(name string, value ent.Value) error
- func (m *ProductMutation) AddOrderProductIDs(ids ...int64)
- func (m *ProductMutation) AddPrice(i int64)
- func (m *ProductMutation) AddProductImageIDs(ids ...int64)
- func (m *ProductMutation) AddedAmount() (r int64, exists bool)
- func (m *ProductMutation) AddedEdges() []string
- func (m *ProductMutation) AddedField(name string) (ent.Value, bool)
- func (m *ProductMutation) AddedFields() []string
- func (m *ProductMutation) AddedIDs(name string) []ent.Value
- func (m *ProductMutation) AddedPrice() (r int64, exists bool)
- func (m *ProductMutation) Amount() (r int64, exists bool)
- func (m *ProductMutation) CartsCleared() bool
- func (m *ProductMutation) CartsIDs() (ids []int64)
- func (m *ProductMutation) CategoriesCleared() bool
- func (m *ProductMutation) CategoriesID() (id int64, exists bool)
- func (m *ProductMutation) CategoriesIDs() (ids []int64)
- func (m *ProductMutation) CategoryID() (r int64, exists bool)
- func (m *ProductMutation) ClearCarts()
- func (m *ProductMutation) ClearCategories()
- func (m *ProductMutation) ClearDescription()
- func (m *ProductMutation) ClearEdge(name string) error
- func (m *ProductMutation) ClearField(name string) error
- func (m *ProductMutation) ClearOrderProducts()
- func (m *ProductMutation) ClearProductImages()
- func (m *ProductMutation) ClearedEdges() []string
- func (m *ProductMutation) ClearedFields() []string
- func (m ProductMutation) Client() *Client
- func (m *ProductMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ProductMutation) Description() (r string, exists bool)
- func (m *ProductMutation) DescriptionCleared() bool
- func (m *ProductMutation) EdgeCleared(name string) bool
- func (m *ProductMutation) Field(name string) (ent.Value, bool)
- func (m *ProductMutation) FieldCleared(name string) bool
- func (m *ProductMutation) Fields() []string
- func (m *ProductMutation) ID() (id int64, exists bool)
- func (m *ProductMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *ProductMutation) Name() (r string, exists bool)
- func (m *ProductMutation) OldAmount(ctx context.Context) (v int64, err error)
- func (m *ProductMutation) OldCategoryID(ctx context.Context) (v int64, err error)
- func (m *ProductMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProductMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *ProductMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ProductMutation) OldName(ctx context.Context) (v string, err error)
- func (m *ProductMutation) OldPrice(ctx context.Context) (v int64, err error)
- func (m *ProductMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProductMutation) Op() Op
- func (m *ProductMutation) OrderProductsCleared() bool
- func (m *ProductMutation) OrderProductsIDs() (ids []int64)
- func (m *ProductMutation) Price() (r int64, exists bool)
- func (m *ProductMutation) ProductImagesCleared() bool
- func (m *ProductMutation) ProductImagesIDs() (ids []int64)
- func (m *ProductMutation) RemoveCartIDs(ids ...int64)
- func (m *ProductMutation) RemoveOrderProductIDs(ids ...int64)
- func (m *ProductMutation) RemoveProductImageIDs(ids ...int64)
- func (m *ProductMutation) RemovedCartsIDs() (ids []int64)
- func (m *ProductMutation) RemovedEdges() []string
- func (m *ProductMutation) RemovedIDs(name string) []ent.Value
- func (m *ProductMutation) RemovedOrderProductsIDs() (ids []int64)
- func (m *ProductMutation) RemovedProductImagesIDs() (ids []int64)
- func (m *ProductMutation) ResetAmount()
- func (m *ProductMutation) ResetCarts()
- func (m *ProductMutation) ResetCategories()
- func (m *ProductMutation) ResetCategoryID()
- func (m *ProductMutation) ResetCreatedAt()
- func (m *ProductMutation) ResetDescription()
- func (m *ProductMutation) ResetEdge(name string) error
- func (m *ProductMutation) ResetField(name string) error
- func (m *ProductMutation) ResetName()
- func (m *ProductMutation) ResetOrderProducts()
- func (m *ProductMutation) ResetPrice()
- func (m *ProductMutation) ResetProductImages()
- func (m *ProductMutation) ResetUpdatedAt()
- func (m *ProductMutation) SetAmount(i int64)
- func (m *ProductMutation) SetCategoriesID(id int64)
- func (m *ProductMutation) SetCategoryID(i int64)
- func (m *ProductMutation) SetCreatedAt(t time.Time)
- func (m *ProductMutation) SetDescription(s string)
- func (m *ProductMutation) SetField(name string, value ent.Value) error
- func (m *ProductMutation) SetName(s string)
- func (m *ProductMutation) SetOp(op Op)
- func (m *ProductMutation) SetPrice(i int64)
- func (m *ProductMutation) SetUpdatedAt(t time.Time)
- func (m ProductMutation) Tx() (*Tx, error)
- func (m *ProductMutation) Type() string
- func (m *ProductMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *ProductMutation) Where(ps ...predicate.Product)
- func (m *ProductMutation) WhereP(ps ...func(*sql.Selector))
- type ProductQuery
- func (pq *ProductQuery) Aggregate(fns ...AggregateFunc) *ProductSelect
- func (pq *ProductQuery) All(ctx context.Context) ([]*Product, error)
- func (pq *ProductQuery) AllX(ctx context.Context) []*Product
- func (pq *ProductQuery) Clone() *ProductQuery
- func (pq *ProductQuery) Count(ctx context.Context) (int, error)
- func (pq *ProductQuery) CountX(ctx context.Context) int
- func (pq *ProductQuery) Exist(ctx context.Context) (bool, error)
- func (pq *ProductQuery) ExistX(ctx context.Context) bool
- func (pq *ProductQuery) First(ctx context.Context) (*Product, error)
- func (pq *ProductQuery) FirstID(ctx context.Context) (id int64, err error)
- func (pq *ProductQuery) FirstIDX(ctx context.Context) int64
- func (pq *ProductQuery) FirstX(ctx context.Context) *Product
- func (pq *ProductQuery) GroupBy(field string, fields ...string) *ProductGroupBy
- func (pq *ProductQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (pq *ProductQuery) IDsX(ctx context.Context) []int64
- func (pq *ProductQuery) Limit(limit int) *ProductQuery
- func (pq *ProductQuery) Offset(offset int) *ProductQuery
- func (pq *ProductQuery) Only(ctx context.Context) (*Product, error)
- func (pq *ProductQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (pq *ProductQuery) OnlyIDX(ctx context.Context) int64
- func (pq *ProductQuery) OnlyX(ctx context.Context) *Product
- func (pq *ProductQuery) Order(o ...product.OrderOption) *ProductQuery
- func (pq *ProductQuery) QueryCarts() *CartQuery
- func (pq *ProductQuery) QueryCategories() *CategoryQuery
- func (pq *ProductQuery) QueryOrderProducts() *OrderProductQuery
- func (pq *ProductQuery) QueryProductImages() *ProductImageQuery
- func (pq *ProductQuery) Select(fields ...string) *ProductSelect
- func (pq *ProductQuery) Unique(unique bool) *ProductQuery
- func (pq *ProductQuery) Where(ps ...predicate.Product) *ProductQuery
- func (pq *ProductQuery) WithCarts(opts ...func(*CartQuery)) *ProductQuery
- func (pq *ProductQuery) WithCategories(opts ...func(*CategoryQuery)) *ProductQuery
- func (pq *ProductQuery) WithOrderProducts(opts ...func(*OrderProductQuery)) *ProductQuery
- func (pq *ProductQuery) WithProductImages(opts ...func(*ProductImageQuery)) *ProductQuery
- type ProductSelect
- func (ps *ProductSelect) Aggregate(fns ...AggregateFunc) *ProductSelect
- func (s *ProductSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProductSelect) BoolX(ctx context.Context) bool
- func (s *ProductSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ProductSelect) BoolsX(ctx context.Context) []bool
- func (s *ProductSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProductSelect) Float64X(ctx context.Context) float64
- func (s *ProductSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProductSelect) Float64sX(ctx context.Context) []float64
- func (s *ProductSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ProductSelect) IntX(ctx context.Context) int
- func (s *ProductSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ProductSelect) IntsX(ctx context.Context) []int
- func (ps *ProductSelect) Scan(ctx context.Context, v any) error
- func (s *ProductSelect) ScanX(ctx context.Context, v any)
- func (s *ProductSelect) String(ctx context.Context) (_ string, err error)
- func (s *ProductSelect) StringX(ctx context.Context) string
- func (s *ProductSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ProductSelect) StringsX(ctx context.Context) []string
- type ProductUpdate
- func (pu *ProductUpdate) AddAmount(i int64) *ProductUpdate
- func (pu *ProductUpdate) AddCartIDs(ids ...int64) *ProductUpdate
- func (pu *ProductUpdate) AddCarts(c ...*Cart) *ProductUpdate
- func (pu *ProductUpdate) AddOrderProductIDs(ids ...int64) *ProductUpdate
- func (pu *ProductUpdate) AddOrderProducts(o ...*OrderProduct) *ProductUpdate
- func (pu *ProductUpdate) AddPrice(i int64) *ProductUpdate
- func (pu *ProductUpdate) AddProductImageIDs(ids ...int64) *ProductUpdate
- func (pu *ProductUpdate) AddProductImages(p ...*ProductImage) *ProductUpdate
- func (pu *ProductUpdate) ClearCarts() *ProductUpdate
- func (pu *ProductUpdate) ClearCategories() *ProductUpdate
- func (pu *ProductUpdate) ClearDescription() *ProductUpdate
- func (pu *ProductUpdate) ClearOrderProducts() *ProductUpdate
- func (pu *ProductUpdate) ClearProductImages() *ProductUpdate
- func (pu *ProductUpdate) Exec(ctx context.Context) error
- func (pu *ProductUpdate) ExecX(ctx context.Context)
- func (pu *ProductUpdate) Mutation() *ProductMutation
- func (pu *ProductUpdate) RemoveCartIDs(ids ...int64) *ProductUpdate
- func (pu *ProductUpdate) RemoveCarts(c ...*Cart) *ProductUpdate
- func (pu *ProductUpdate) RemoveOrderProductIDs(ids ...int64) *ProductUpdate
- func (pu *ProductUpdate) RemoveOrderProducts(o ...*OrderProduct) *ProductUpdate
- func (pu *ProductUpdate) RemoveProductImageIDs(ids ...int64) *ProductUpdate
- func (pu *ProductUpdate) RemoveProductImages(p ...*ProductImage) *ProductUpdate
- func (pu *ProductUpdate) Save(ctx context.Context) (int, error)
- func (pu *ProductUpdate) SaveX(ctx context.Context) int
- func (pu *ProductUpdate) SetAmount(i int64) *ProductUpdate
- func (pu *ProductUpdate) SetCategories(c *Category) *ProductUpdate
- func (pu *ProductUpdate) SetCategoriesID(id int64) *ProductUpdate
- func (pu *ProductUpdate) SetCategoryID(i int64) *ProductUpdate
- func (pu *ProductUpdate) SetDescription(s string) *ProductUpdate
- func (pu *ProductUpdate) SetName(s string) *ProductUpdate
- func (pu *ProductUpdate) SetNillableAmount(i *int64) *ProductUpdate
- func (pu *ProductUpdate) SetNillableCategoryID(i *int64) *ProductUpdate
- func (pu *ProductUpdate) SetNillableDescription(s *string) *ProductUpdate
- func (pu *ProductUpdate) SetNillableName(s *string) *ProductUpdate
- func (pu *ProductUpdate) SetNillablePrice(i *int64) *ProductUpdate
- func (pu *ProductUpdate) SetPrice(i int64) *ProductUpdate
- func (pu *ProductUpdate) SetUpdatedAt(t time.Time) *ProductUpdate
- func (pu *ProductUpdate) Where(ps ...predicate.Product) *ProductUpdate
- type ProductUpdateOne
- func (puo *ProductUpdateOne) AddAmount(i int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) AddCartIDs(ids ...int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) AddCarts(c ...*Cart) *ProductUpdateOne
- func (puo *ProductUpdateOne) AddOrderProductIDs(ids ...int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) AddOrderProducts(o ...*OrderProduct) *ProductUpdateOne
- func (puo *ProductUpdateOne) AddPrice(i int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) AddProductImageIDs(ids ...int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) AddProductImages(p ...*ProductImage) *ProductUpdateOne
- func (puo *ProductUpdateOne) ClearCarts() *ProductUpdateOne
- func (puo *ProductUpdateOne) ClearCategories() *ProductUpdateOne
- func (puo *ProductUpdateOne) ClearDescription() *ProductUpdateOne
- func (puo *ProductUpdateOne) ClearOrderProducts() *ProductUpdateOne
- func (puo *ProductUpdateOne) ClearProductImages() *ProductUpdateOne
- func (puo *ProductUpdateOne) Exec(ctx context.Context) error
- func (puo *ProductUpdateOne) ExecX(ctx context.Context)
- func (puo *ProductUpdateOne) Mutation() *ProductMutation
- func (puo *ProductUpdateOne) RemoveCartIDs(ids ...int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) RemoveCarts(c ...*Cart) *ProductUpdateOne
- func (puo *ProductUpdateOne) RemoveOrderProductIDs(ids ...int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) RemoveOrderProducts(o ...*OrderProduct) *ProductUpdateOne
- func (puo *ProductUpdateOne) RemoveProductImageIDs(ids ...int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) RemoveProductImages(p ...*ProductImage) *ProductUpdateOne
- func (puo *ProductUpdateOne) Save(ctx context.Context) (*Product, error)
- func (puo *ProductUpdateOne) SaveX(ctx context.Context) *Product
- func (puo *ProductUpdateOne) Select(field string, fields ...string) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetAmount(i int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetCategories(c *Category) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetCategoriesID(id int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetCategoryID(i int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetDescription(s string) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetName(s string) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetNillableAmount(i *int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetNillableCategoryID(i *int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetNillableDescription(s *string) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetNillableName(s *string) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetNillablePrice(i *int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetPrice(i int64) *ProductUpdateOne
- func (puo *ProductUpdateOne) SetUpdatedAt(t time.Time) *ProductUpdateOne
- func (puo *ProductUpdateOne) Where(ps ...predicate.Product) *ProductUpdateOne
- type ProductUpsert
- func (u *ProductUpsert) AddAmount(v int64) *ProductUpsert
- func (u *ProductUpsert) AddPrice(v int64) *ProductUpsert
- func (u *ProductUpsert) ClearDescription() *ProductUpsert
- func (u *ProductUpsert) SetAmount(v int64) *ProductUpsert
- func (u *ProductUpsert) SetCategoryID(v int64) *ProductUpsert
- func (u *ProductUpsert) SetDescription(v string) *ProductUpsert
- func (u *ProductUpsert) SetName(v string) *ProductUpsert
- func (u *ProductUpsert) SetPrice(v int64) *ProductUpsert
- func (u *ProductUpsert) SetUpdatedAt(v time.Time) *ProductUpsert
- func (u *ProductUpsert) UpdateAmount() *ProductUpsert
- func (u *ProductUpsert) UpdateCategoryID() *ProductUpsert
- func (u *ProductUpsert) UpdateDescription() *ProductUpsert
- func (u *ProductUpsert) UpdateName() *ProductUpsert
- func (u *ProductUpsert) UpdatePrice() *ProductUpsert
- func (u *ProductUpsert) UpdateUpdatedAt() *ProductUpsert
- type ProductUpsertBulk
- func (u *ProductUpsertBulk) AddAmount(v int64) *ProductUpsertBulk
- func (u *ProductUpsertBulk) AddPrice(v int64) *ProductUpsertBulk
- func (u *ProductUpsertBulk) ClearDescription() *ProductUpsertBulk
- func (u *ProductUpsertBulk) DoNothing() *ProductUpsertBulk
- func (u *ProductUpsertBulk) Exec(ctx context.Context) error
- func (u *ProductUpsertBulk) ExecX(ctx context.Context)
- func (u *ProductUpsertBulk) Ignore() *ProductUpsertBulk
- func (u *ProductUpsertBulk) SetAmount(v int64) *ProductUpsertBulk
- func (u *ProductUpsertBulk) SetCategoryID(v int64) *ProductUpsertBulk
- func (u *ProductUpsertBulk) SetDescription(v string) *ProductUpsertBulk
- func (u *ProductUpsertBulk) SetName(v string) *ProductUpsertBulk
- func (u *ProductUpsertBulk) SetPrice(v int64) *ProductUpsertBulk
- func (u *ProductUpsertBulk) SetUpdatedAt(v time.Time) *ProductUpsertBulk
- func (u *ProductUpsertBulk) Update(set func(*ProductUpsert)) *ProductUpsertBulk
- func (u *ProductUpsertBulk) UpdateAmount() *ProductUpsertBulk
- func (u *ProductUpsertBulk) UpdateCategoryID() *ProductUpsertBulk
- func (u *ProductUpsertBulk) UpdateDescription() *ProductUpsertBulk
- func (u *ProductUpsertBulk) UpdateName() *ProductUpsertBulk
- func (u *ProductUpsertBulk) UpdateNewValues() *ProductUpsertBulk
- func (u *ProductUpsertBulk) UpdatePrice() *ProductUpsertBulk
- func (u *ProductUpsertBulk) UpdateUpdatedAt() *ProductUpsertBulk
- type ProductUpsertOne
- func (u *ProductUpsertOne) AddAmount(v int64) *ProductUpsertOne
- func (u *ProductUpsertOne) AddPrice(v int64) *ProductUpsertOne
- func (u *ProductUpsertOne) ClearDescription() *ProductUpsertOne
- func (u *ProductUpsertOne) DoNothing() *ProductUpsertOne
- func (u *ProductUpsertOne) Exec(ctx context.Context) error
- func (u *ProductUpsertOne) ExecX(ctx context.Context)
- func (u *ProductUpsertOne) ID(ctx context.Context) (id int64, err error)
- func (u *ProductUpsertOne) IDX(ctx context.Context) int64
- func (u *ProductUpsertOne) Ignore() *ProductUpsertOne
- func (u *ProductUpsertOne) SetAmount(v int64) *ProductUpsertOne
- func (u *ProductUpsertOne) SetCategoryID(v int64) *ProductUpsertOne
- func (u *ProductUpsertOne) SetDescription(v string) *ProductUpsertOne
- func (u *ProductUpsertOne) SetName(v string) *ProductUpsertOne
- func (u *ProductUpsertOne) SetPrice(v int64) *ProductUpsertOne
- func (u *ProductUpsertOne) SetUpdatedAt(v time.Time) *ProductUpsertOne
- func (u *ProductUpsertOne) Update(set func(*ProductUpsert)) *ProductUpsertOne
- func (u *ProductUpsertOne) UpdateAmount() *ProductUpsertOne
- func (u *ProductUpsertOne) UpdateCategoryID() *ProductUpsertOne
- func (u *ProductUpsertOne) UpdateDescription() *ProductUpsertOne
- func (u *ProductUpsertOne) UpdateName() *ProductUpsertOne
- func (u *ProductUpsertOne) UpdateNewValues() *ProductUpsertOne
- func (u *ProductUpsertOne) UpdatePrice() *ProductUpsertOne
- func (u *ProductUpsertOne) UpdateUpdatedAt() *ProductUpsertOne
- type Products
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int64) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int64) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int64) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryAddresses(u *User) *AddressQuery
- func (c *UserClient) QueryCarts(u *User) *CartQuery
- func (c *UserClient) QueryOrders(u *User) *OrderQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int64) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddAddressIDs(ids ...int64) *UserCreate
- func (uc *UserCreate) AddAddresses(a ...*Address) *UserCreate
- func (uc *UserCreate) AddCartIDs(ids ...int64) *UserCreate
- func (uc *UserCreate) AddCarts(c ...*Cart) *UserCreate
- func (uc *UserCreate) AddOrderIDs(ids ...int64) *UserCreate
- func (uc *UserCreate) AddOrders(o ...*Order) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne
- func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetName(s string) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableRole(u *user.Role) *UserCreate
- func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetPassword(s string) *UserCreate
- func (uc *UserCreate) SetPhone(s string) *UserCreate
- func (uc *UserCreate) SetRole(u user.Role) *UserCreate
- func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
- type UserCreateBulk
- func (ucb *UserCreateBulk) Exec(ctx context.Context) error
- func (ucb *UserCreateBulk) ExecX(ctx context.Context)
- func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk
- func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk
- func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)
- func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddAddressIDs(ids ...int64)
- func (m *UserMutation) AddCartIDs(ids ...int64)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddOrderIDs(ids ...int64)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) AddressesCleared() bool
- func (m *UserMutation) AddressesIDs() (ids []int64)
- func (m *UserMutation) CartsCleared() bool
- func (m *UserMutation) CartsIDs() (ids []int64)
- func (m *UserMutation) ClearAddresses()
- func (m *UserMutation) ClearCarts()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearOrders()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int64, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *UserMutation) Name() (r string, exists bool)
- func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPhone(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldRole(ctx context.Context) (v user.Role, err error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) OrdersCleared() bool
- func (m *UserMutation) OrdersIDs() (ids []int64)
- func (m *UserMutation) Password() (r string, exists bool)
- func (m *UserMutation) Phone() (r string, exists bool)
- func (m *UserMutation) RemoveAddressIDs(ids ...int64)
- func (m *UserMutation) RemoveCartIDs(ids ...int64)
- func (m *UserMutation) RemoveOrderIDs(ids ...int64)
- func (m *UserMutation) RemovedAddressesIDs() (ids []int64)
- func (m *UserMutation) RemovedCartsIDs() (ids []int64)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedOrdersIDs() (ids []int64)
- func (m *UserMutation) ResetAddresses()
- func (m *UserMutation) ResetCarts()
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetName()
- func (m *UserMutation) ResetOrders()
- func (m *UserMutation) ResetPassword()
- func (m *UserMutation) ResetPhone()
- func (m *UserMutation) ResetRole()
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) Role() (r user.Role, exists bool)
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetName(s string)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetPassword(s string)
- func (m *UserMutation) SetPhone(s string)
- func (m *UserMutation) SetRole(u user.Role)
- func (m *UserMutation) SetUpdatedAt(t time.Time)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int64, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int64
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int64
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int64
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (uq *UserQuery) QueryAddresses() *AddressQuery
- func (uq *UserQuery) QueryCarts() *CartQuery
- func (uq *UserQuery) QueryOrders() *OrderQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithAddresses(opts ...func(*AddressQuery)) *UserQuery
- func (uq *UserQuery) WithCarts(opts ...func(*CartQuery)) *UserQuery
- func (uq *UserQuery) WithOrders(opts ...func(*OrderQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddAddressIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) AddAddresses(a ...*Address) *UserUpdate
- func (uu *UserUpdate) AddCartIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) AddCarts(c ...*Cart) *UserUpdate
- func (uu *UserUpdate) AddOrderIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) AddOrders(o ...*Order) *UserUpdate
- func (uu *UserUpdate) ClearAddresses() *UserUpdate
- func (uu *UserUpdate) ClearCarts() *UserUpdate
- func (uu *UserUpdate) ClearOrders() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveAddressIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) RemoveAddresses(a ...*Address) *UserUpdate
- func (uu *UserUpdate) RemoveCartIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) RemoveCarts(c ...*Cart) *UserUpdate
- func (uu *UserUpdate) RemoveOrderIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) RemoveOrders(o ...*Order) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillablePhone(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableRole(u *user.Role) *UserUpdate
- func (uu *UserUpdate) SetPassword(s string) *UserUpdate
- func (uu *UserUpdate) SetPhone(s string) *UserUpdate
- func (uu *UserUpdate) SetRole(u user.Role) *UserUpdate
- func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddAddressIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) AddAddresses(a ...*Address) *UserUpdateOne
- func (uuo *UserUpdateOne) AddCartIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) AddCarts(c ...*Cart) *UserUpdateOne
- func (uuo *UserUpdateOne) AddOrderIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) AddOrders(o ...*Order) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearAddresses() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearCarts() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearOrders() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveAddressIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveAddresses(a ...*Address) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveCartIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveCarts(c ...*Cart) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveOrderIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveOrders(o ...*Order) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePhone(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableRole(u *user.Role) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetRole(u user.Role) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type UserUpsert
- func (u *UserUpsert) SetEmail(v string) *UserUpsert
- func (u *UserUpsert) SetName(v string) *UserUpsert
- func (u *UserUpsert) SetPassword(v string) *UserUpsert
- func (u *UserUpsert) SetPhone(v string) *UserUpsert
- func (u *UserUpsert) SetRole(v user.Role) *UserUpsert
- func (u *UserUpsert) SetUpdatedAt(v time.Time) *UserUpsert
- func (u *UserUpsert) UpdateEmail() *UserUpsert
- func (u *UserUpsert) UpdateName() *UserUpsert
- func (u *UserUpsert) UpdatePassword() *UserUpsert
- func (u *UserUpsert) UpdatePhone() *UserUpsert
- func (u *UserUpsert) UpdateRole() *UserUpsert
- func (u *UserUpsert) UpdateUpdatedAt() *UserUpsert
- type UserUpsertBulk
- func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk
- func (u *UserUpsertBulk) Exec(ctx context.Context) error
- func (u *UserUpsertBulk) ExecX(ctx context.Context)
- func (u *UserUpsertBulk) Ignore() *UserUpsertBulk
- func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk
- func (u *UserUpsertBulk) SetName(v string) *UserUpsertBulk
- func (u *UserUpsertBulk) SetPassword(v string) *UserUpsertBulk
- func (u *UserUpsertBulk) SetPhone(v string) *UserUpsertBulk
- func (u *UserUpsertBulk) SetRole(v user.Role) *UserUpsertBulk
- func (u *UserUpsertBulk) SetUpdatedAt(v time.Time) *UserUpsertBulk
- func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateName() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdatePassword() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdatePhone() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateRole() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateUpdatedAt() *UserUpsertBulk
- type UserUpsertOne
- func (u *UserUpsertOne) DoNothing() *UserUpsertOne
- func (u *UserUpsertOne) Exec(ctx context.Context) error
- func (u *UserUpsertOne) ExecX(ctx context.Context)
- func (u *UserUpsertOne) ID(ctx context.Context) (id int64, err error)
- func (u *UserUpsertOne) IDX(ctx context.Context) int64
- func (u *UserUpsertOne) Ignore() *UserUpsertOne
- func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne
- func (u *UserUpsertOne) SetName(v string) *UserUpsertOne
- func (u *UserUpsertOne) SetPassword(v string) *UserUpsertOne
- func (u *UserUpsertOne) SetPhone(v string) *UserUpsertOne
- func (u *UserUpsertOne) SetRole(v user.Role) *UserUpsertOne
- func (u *UserUpsertOne) SetUpdatedAt(v time.Time) *UserUpsertOne
- func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne
- func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne
- func (u *UserUpsertOne) UpdateName() *UserUpsertOne
- func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne
- func (u *UserUpsertOne) UpdatePassword() *UserUpsertOne
- func (u *UserUpsertOne) UpdatePhone() *UserUpsertOne
- func (u *UserUpsertOne) UpdateRole() *UserUpsertOne
- func (u *UserUpsertOne) UpdateUpdatedAt() *UserUpsertOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeAddress = "Address" TypeCart = "Cart" TypeCategory = "Category" TypeOrder = "Order" TypeOrderProduct = "OrderProduct" TypeProduct = "Product" TypeProductImage = "ProductImage" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
var Migrations embed.FS
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type Address ¶
type Address struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // UserID holds the value of the "user_id" field. UserID int64 `json:"user_id,omitempty"` // City holds the value of the "city" field. City string `json:"city,omitempty"` // Country holds the value of the "country" field. Country string `json:"country,omitempty"` // Flat holds the value of the "flat" field. Flat int `json:"flat,omitempty"` // House holds the value of the "house" field. House int `json:"house,omitempty"` // Letter holds the value of the "letter" field. Letter string `json:"letter,omitempty"` // Postcode holds the value of the "postcode" field. Postcode int `json:"postcode,omitempty"` // Street holds the value of the "street" field. Street string `json:"street,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the AddressQuery when eager-loading is set. Edges AddressEdges `json:"edges"` // contains filtered or unexported fields }
Address is the model entity for the Address schema.
func (*Address) QueryUsers ¶
QueryUsers queries the "users" edge of the Address entity.
func (*Address) Unwrap ¶
Unwrap unwraps the Address 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 (*Address) Update ¶
func (a *Address) Update() *AddressUpdateOne
Update returns a builder for updating this Address. Note that you need to call Address.Unwrap() before calling this method if this Address was returned from a transaction, and the transaction was committed or rolled back.
type AddressClient ¶
type AddressClient struct {
// contains filtered or unexported fields
}
AddressClient is a client for the Address schema.
func NewAddressClient ¶
func NewAddressClient(c config) *AddressClient
NewAddressClient returns a client for the Address from the given config.
func (*AddressClient) Create ¶
func (c *AddressClient) Create() *AddressCreate
Create returns a builder for creating a Address entity.
func (*AddressClient) CreateBulk ¶
func (c *AddressClient) CreateBulk(builders ...*AddressCreate) *AddressCreateBulk
CreateBulk returns a builder for creating a bulk of Address entities.
func (*AddressClient) Delete ¶
func (c *AddressClient) Delete() *AddressDelete
Delete returns a delete builder for Address.
func (*AddressClient) DeleteOne ¶
func (c *AddressClient) DeleteOne(a *Address) *AddressDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AddressClient) DeleteOneID ¶
func (c *AddressClient) DeleteOneID(id int64) *AddressDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AddressClient) GetX ¶
func (c *AddressClient) GetX(ctx context.Context, id int64) *Address
GetX is like Get, but panics if an error occurs.
func (*AddressClient) Hooks ¶
func (c *AddressClient) Hooks() []Hook
Hooks returns the client hooks.
func (*AddressClient) Intercept ¶
func (c *AddressClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `address.Intercept(f(g(h())))`.
func (*AddressClient) Interceptors ¶
func (c *AddressClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*AddressClient) MapCreateBulk ¶
func (c *AddressClient) MapCreateBulk(slice any, setFunc func(*AddressCreate, int)) *AddressCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*AddressClient) Query ¶
func (c *AddressClient) Query() *AddressQuery
Query returns a query builder for Address.
func (*AddressClient) QueryUsers ¶
func (c *AddressClient) QueryUsers(a *Address) *UserQuery
QueryUsers queries the users edge of a Address.
func (*AddressClient) Update ¶
func (c *AddressClient) Update() *AddressUpdate
Update returns an update builder for Address.
func (*AddressClient) UpdateOne ¶
func (c *AddressClient) UpdateOne(a *Address) *AddressUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AddressClient) UpdateOneID ¶
func (c *AddressClient) UpdateOneID(id int64) *AddressUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AddressClient) Use ¶
func (c *AddressClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `address.Hooks(f(g(h())))`.
type AddressCreate ¶
type AddressCreate struct {
// contains filtered or unexported fields
}
AddressCreate is the builder for creating a Address entity.
func (*AddressCreate) Exec ¶
func (ac *AddressCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AddressCreate) ExecX ¶
func (ac *AddressCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AddressCreate) Mutation ¶
func (ac *AddressCreate) Mutation() *AddressMutation
Mutation returns the AddressMutation object of the builder.
func (*AddressCreate) OnConflict ¶
func (ac *AddressCreate) OnConflict(opts ...sql.ConflictOption) *AddressUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Address.Create(). SetCreatedAt(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.AddressUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*AddressCreate) OnConflictColumns ¶
func (ac *AddressCreate) OnConflictColumns(columns ...string) *AddressUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Address.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*AddressCreate) Save ¶
func (ac *AddressCreate) Save(ctx context.Context) (*Address, error)
Save creates the Address in the database.
func (*AddressCreate) SaveX ¶
func (ac *AddressCreate) SaveX(ctx context.Context) *Address
SaveX calls Save and panics if Save returns an error.
func (*AddressCreate) SetCity ¶
func (ac *AddressCreate) SetCity(s string) *AddressCreate
SetCity sets the "city" field.
func (*AddressCreate) SetCountry ¶
func (ac *AddressCreate) SetCountry(s string) *AddressCreate
SetCountry sets the "country" field.
func (*AddressCreate) SetCreatedAt ¶
func (ac *AddressCreate) SetCreatedAt(t time.Time) *AddressCreate
SetCreatedAt sets the "created_at" field.
func (*AddressCreate) SetFlat ¶
func (ac *AddressCreate) SetFlat(i int) *AddressCreate
SetFlat sets the "flat" field.
func (*AddressCreate) SetHouse ¶
func (ac *AddressCreate) SetHouse(i int) *AddressCreate
SetHouse sets the "house" field.
func (*AddressCreate) SetLetter ¶
func (ac *AddressCreate) SetLetter(s string) *AddressCreate
SetLetter sets the "letter" field.
func (*AddressCreate) SetNillableCreatedAt ¶
func (ac *AddressCreate) SetNillableCreatedAt(t *time.Time) *AddressCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AddressCreate) SetNillableFlat ¶
func (ac *AddressCreate) SetNillableFlat(i *int) *AddressCreate
SetNillableFlat sets the "flat" field if the given value is not nil.
func (*AddressCreate) SetNillableLetter ¶
func (ac *AddressCreate) SetNillableLetter(s *string) *AddressCreate
SetNillableLetter sets the "letter" field if the given value is not nil.
func (*AddressCreate) SetNillableUpdatedAt ¶
func (ac *AddressCreate) SetNillableUpdatedAt(t *time.Time) *AddressCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*AddressCreate) SetPostcode ¶
func (ac *AddressCreate) SetPostcode(i int) *AddressCreate
SetPostcode sets the "postcode" field.
func (*AddressCreate) SetStreet ¶
func (ac *AddressCreate) SetStreet(s string) *AddressCreate
SetStreet sets the "street" field.
func (*AddressCreate) SetUpdatedAt ¶
func (ac *AddressCreate) SetUpdatedAt(t time.Time) *AddressCreate
SetUpdatedAt sets the "updated_at" field.
func (*AddressCreate) SetUserID ¶
func (ac *AddressCreate) SetUserID(i int64) *AddressCreate
SetUserID sets the "user_id" field.
func (*AddressCreate) SetUsers ¶
func (ac *AddressCreate) SetUsers(u *User) *AddressCreate
SetUsers sets the "users" edge to the User entity.
func (*AddressCreate) SetUsersID ¶
func (ac *AddressCreate) SetUsersID(id int64) *AddressCreate
SetUsersID sets the "users" edge to the User entity by ID.
type AddressCreateBulk ¶
type AddressCreateBulk struct {
// contains filtered or unexported fields
}
AddressCreateBulk is the builder for creating many Address entities in bulk.
func (*AddressCreateBulk) Exec ¶
func (acb *AddressCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AddressCreateBulk) ExecX ¶
func (acb *AddressCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AddressCreateBulk) OnConflict ¶
func (acb *AddressCreateBulk) OnConflict(opts ...sql.ConflictOption) *AddressUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Address.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.AddressUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*AddressCreateBulk) OnConflictColumns ¶
func (acb *AddressCreateBulk) OnConflictColumns(columns ...string) *AddressUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Address.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type AddressDelete ¶
type AddressDelete struct {
// contains filtered or unexported fields
}
AddressDelete is the builder for deleting a Address entity.
func (*AddressDelete) Exec ¶
func (ad *AddressDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AddressDelete) ExecX ¶
func (ad *AddressDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AddressDelete) Where ¶
func (ad *AddressDelete) Where(ps ...predicate.Address) *AddressDelete
Where appends a list predicates to the AddressDelete builder.
type AddressDeleteOne ¶
type AddressDeleteOne struct {
// contains filtered or unexported fields
}
AddressDeleteOne is the builder for deleting a single Address entity.
func (*AddressDeleteOne) Exec ¶
func (ado *AddressDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AddressDeleteOne) ExecX ¶
func (ado *AddressDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AddressDeleteOne) Where ¶
func (ado *AddressDeleteOne) Where(ps ...predicate.Address) *AddressDeleteOne
Where appends a list predicates to the AddressDelete builder.
type AddressEdges ¶
type AddressEdges struct { // Users holds the value of the users edge. Users *User `json:"users,omitempty"` // contains filtered or unexported fields }
AddressEdges holds the relations/edges for other nodes in the graph.
func (AddressEdges) UsersOrErr ¶
func (e AddressEdges) UsersOrErr() (*User, error)
UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type AddressGroupBy ¶
type AddressGroupBy struct {
// contains filtered or unexported fields
}
AddressGroupBy is the group-by builder for Address entities.
func (*AddressGroupBy) Aggregate ¶
func (agb *AddressGroupBy) Aggregate(fns ...AggregateFunc) *AddressGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AddressGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AddressGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AddressGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AddressGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AddressGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AddressGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AddressGroupBy) Scan ¶
func (agb *AddressGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AddressGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AddressMutation ¶
type AddressMutation struct {
// contains filtered or unexported fields
}
AddressMutation represents an operation that mutates the Address nodes in the graph.
func (*AddressMutation) AddField ¶
func (m *AddressMutation) 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 (*AddressMutation) AddFlat ¶
func (m *AddressMutation) AddFlat(i int)
AddFlat adds i to the "flat" field.
func (*AddressMutation) AddHouse ¶
func (m *AddressMutation) AddHouse(i int)
AddHouse adds i to the "house" field.
func (*AddressMutation) AddPostcode ¶
func (m *AddressMutation) AddPostcode(i int)
AddPostcode adds i to the "postcode" field.
func (*AddressMutation) AddedEdges ¶
func (m *AddressMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AddressMutation) AddedField ¶
func (m *AddressMutation) 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 (*AddressMutation) AddedFields ¶
func (m *AddressMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AddressMutation) AddedFlat ¶
func (m *AddressMutation) AddedFlat() (r int, exists bool)
AddedFlat returns the value that was added to the "flat" field in this mutation.
func (*AddressMutation) AddedHouse ¶
func (m *AddressMutation) AddedHouse() (r int, exists bool)
AddedHouse returns the value that was added to the "house" field in this mutation.
func (*AddressMutation) AddedIDs ¶
func (m *AddressMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AddressMutation) AddedPostcode ¶
func (m *AddressMutation) AddedPostcode() (r int, exists bool)
AddedPostcode returns the value that was added to the "postcode" field in this mutation.
func (*AddressMutation) City ¶
func (m *AddressMutation) City() (r string, exists bool)
City returns the value of the "city" field in the mutation.
func (*AddressMutation) ClearEdge ¶
func (m *AddressMutation) 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 (*AddressMutation) ClearField ¶
func (m *AddressMutation) 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 (*AddressMutation) ClearFlat ¶
func (m *AddressMutation) ClearFlat()
ClearFlat clears the value of the "flat" field.
func (*AddressMutation) ClearLetter ¶
func (m *AddressMutation) ClearLetter()
ClearLetter clears the value of the "letter" field.
func (*AddressMutation) ClearUsers ¶
func (m *AddressMutation) ClearUsers()
ClearUsers clears the "users" edge to the User entity.
func (*AddressMutation) ClearedEdges ¶
func (m *AddressMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AddressMutation) ClearedFields ¶
func (m *AddressMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AddressMutation) Client ¶
func (m AddressMutation) 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 (*AddressMutation) Country ¶
func (m *AddressMutation) Country() (r string, exists bool)
Country returns the value of the "country" field in the mutation.
func (*AddressMutation) CreatedAt ¶
func (m *AddressMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*AddressMutation) EdgeCleared ¶
func (m *AddressMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AddressMutation) Field ¶
func (m *AddressMutation) 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 (*AddressMutation) FieldCleared ¶
func (m *AddressMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AddressMutation) Fields ¶
func (m *AddressMutation) 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 (*AddressMutation) Flat ¶
func (m *AddressMutation) Flat() (r int, exists bool)
Flat returns the value of the "flat" field in the mutation.
func (*AddressMutation) FlatCleared ¶
func (m *AddressMutation) FlatCleared() bool
FlatCleared returns if the "flat" field was cleared in this mutation.
func (*AddressMutation) House ¶
func (m *AddressMutation) House() (r int, exists bool)
House returns the value of the "house" field in the mutation.
func (*AddressMutation) ID ¶
func (m *AddressMutation) ID() (id int64, 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 (*AddressMutation) IDs ¶
func (m *AddressMutation) IDs(ctx context.Context) ([]int64, 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 (*AddressMutation) Letter ¶
func (m *AddressMutation) Letter() (r string, exists bool)
Letter returns the value of the "letter" field in the mutation.
func (*AddressMutation) LetterCleared ¶
func (m *AddressMutation) LetterCleared() bool
LetterCleared returns if the "letter" field was cleared in this mutation.
func (*AddressMutation) OldCity ¶
func (m *AddressMutation) OldCity(ctx context.Context) (v string, err error)
OldCity returns the old "city" field's value of the Address entity. If the Address 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 (*AddressMutation) OldCountry ¶
func (m *AddressMutation) OldCountry(ctx context.Context) (v string, err error)
OldCountry returns the old "country" field's value of the Address entity. If the Address 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 (*AddressMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Address entity. If the Address 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 (*AddressMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*AddressMutation) OldFlat ¶
func (m *AddressMutation) OldFlat(ctx context.Context) (v int, err error)
OldFlat returns the old "flat" field's value of the Address entity. If the Address 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 (*AddressMutation) OldHouse ¶
func (m *AddressMutation) OldHouse(ctx context.Context) (v int, err error)
OldHouse returns the old "house" field's value of the Address entity. If the Address 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 (*AddressMutation) OldLetter ¶
func (m *AddressMutation) OldLetter(ctx context.Context) (v string, err error)
OldLetter returns the old "letter" field's value of the Address entity. If the Address 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 (*AddressMutation) OldPostcode ¶
func (m *AddressMutation) OldPostcode(ctx context.Context) (v int, err error)
OldPostcode returns the old "postcode" field's value of the Address entity. If the Address 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 (*AddressMutation) OldStreet ¶
func (m *AddressMutation) OldStreet(ctx context.Context) (v string, err error)
OldStreet returns the old "street" field's value of the Address entity. If the Address 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 (*AddressMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Address entity. If the Address 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 (*AddressMutation) OldUserID ¶
func (m *AddressMutation) OldUserID(ctx context.Context) (v int64, err error)
OldUserID returns the old "user_id" field's value of the Address entity. If the Address 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 (*AddressMutation) Postcode ¶
func (m *AddressMutation) Postcode() (r int, exists bool)
Postcode returns the value of the "postcode" field in the mutation.
func (*AddressMutation) RemovedEdges ¶
func (m *AddressMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AddressMutation) RemovedIDs ¶
func (m *AddressMutation) 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 (*AddressMutation) ResetCity ¶
func (m *AddressMutation) ResetCity()
ResetCity resets all changes to the "city" field.
func (*AddressMutation) ResetCountry ¶
func (m *AddressMutation) ResetCountry()
ResetCountry resets all changes to the "country" field.
func (*AddressMutation) ResetCreatedAt ¶
func (m *AddressMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*AddressMutation) ResetEdge ¶
func (m *AddressMutation) 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 (*AddressMutation) ResetField ¶
func (m *AddressMutation) 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 (*AddressMutation) ResetFlat ¶
func (m *AddressMutation) ResetFlat()
ResetFlat resets all changes to the "flat" field.
func (*AddressMutation) ResetHouse ¶
func (m *AddressMutation) ResetHouse()
ResetHouse resets all changes to the "house" field.
func (*AddressMutation) ResetLetter ¶
func (m *AddressMutation) ResetLetter()
ResetLetter resets all changes to the "letter" field.
func (*AddressMutation) ResetPostcode ¶
func (m *AddressMutation) ResetPostcode()
ResetPostcode resets all changes to the "postcode" field.
func (*AddressMutation) ResetStreet ¶
func (m *AddressMutation) ResetStreet()
ResetStreet resets all changes to the "street" field.
func (*AddressMutation) ResetUpdatedAt ¶
func (m *AddressMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*AddressMutation) ResetUserID ¶
func (m *AddressMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*AddressMutation) ResetUsers ¶
func (m *AddressMutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*AddressMutation) SetCity ¶
func (m *AddressMutation) SetCity(s string)
SetCity sets the "city" field.
func (*AddressMutation) SetCountry ¶
func (m *AddressMutation) SetCountry(s string)
SetCountry sets the "country" field.
func (*AddressMutation) SetCreatedAt ¶
func (m *AddressMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*AddressMutation) SetField ¶
func (m *AddressMutation) 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 (*AddressMutation) SetFlat ¶
func (m *AddressMutation) SetFlat(i int)
SetFlat sets the "flat" field.
func (*AddressMutation) SetHouse ¶
func (m *AddressMutation) SetHouse(i int)
SetHouse sets the "house" field.
func (*AddressMutation) SetLetter ¶
func (m *AddressMutation) SetLetter(s string)
SetLetter sets the "letter" field.
func (*AddressMutation) SetOp ¶
func (m *AddressMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*AddressMutation) SetPostcode ¶
func (m *AddressMutation) SetPostcode(i int)
SetPostcode sets the "postcode" field.
func (*AddressMutation) SetStreet ¶
func (m *AddressMutation) SetStreet(s string)
SetStreet sets the "street" field.
func (*AddressMutation) SetUpdatedAt ¶
func (m *AddressMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*AddressMutation) SetUserID ¶
func (m *AddressMutation) SetUserID(i int64)
SetUserID sets the "user_id" field.
func (*AddressMutation) SetUsersID ¶
func (m *AddressMutation) SetUsersID(id int64)
SetUsersID sets the "users" edge to the User entity by id.
func (*AddressMutation) Street ¶
func (m *AddressMutation) Street() (r string, exists bool)
Street returns the value of the "street" field in the mutation.
func (AddressMutation) Tx ¶
func (m AddressMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AddressMutation) Type ¶
func (m *AddressMutation) Type() string
Type returns the node type of this mutation (Address).
func (*AddressMutation) UpdatedAt ¶
func (m *AddressMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*AddressMutation) UserID ¶
func (m *AddressMutation) UserID() (r int64, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*AddressMutation) UsersCleared ¶
func (m *AddressMutation) UsersCleared() bool
UsersCleared reports if the "users" edge to the User entity was cleared.
func (*AddressMutation) UsersID ¶
func (m *AddressMutation) UsersID() (id int64, exists bool)
UsersID returns the "users" edge ID in the mutation.
func (*AddressMutation) UsersIDs ¶
func (m *AddressMutation) UsersIDs() (ids []int64)
UsersIDs returns the "users" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UsersID instead. It exists only for internal usage by the builders.
func (*AddressMutation) Where ¶
func (m *AddressMutation) Where(ps ...predicate.Address)
Where appends a list predicates to the AddressMutation builder.
func (*AddressMutation) WhereP ¶
func (m *AddressMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the AddressMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type AddressQuery ¶
type AddressQuery struct {
// contains filtered or unexported fields
}
AddressQuery is the builder for querying Address entities.
func (*AddressQuery) Aggregate ¶
func (aq *AddressQuery) Aggregate(fns ...AggregateFunc) *AddressSelect
Aggregate returns a AddressSelect configured with the given aggregations.
func (*AddressQuery) All ¶
func (aq *AddressQuery) All(ctx context.Context) ([]*Address, error)
All executes the query and returns a list of Addresses.
func (*AddressQuery) AllX ¶
func (aq *AddressQuery) AllX(ctx context.Context) []*Address
AllX is like All, but panics if an error occurs.
func (*AddressQuery) Clone ¶
func (aq *AddressQuery) Clone() *AddressQuery
Clone returns a duplicate of the AddressQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AddressQuery) Count ¶
func (aq *AddressQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AddressQuery) CountX ¶
func (aq *AddressQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AddressQuery) Exist ¶
func (aq *AddressQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AddressQuery) ExistX ¶
func (aq *AddressQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AddressQuery) First ¶
func (aq *AddressQuery) First(ctx context.Context) (*Address, error)
First returns the first Address entity from the query. Returns a *NotFoundError when no Address was found.
func (*AddressQuery) FirstID ¶
func (aq *AddressQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first Address ID from the query. Returns a *NotFoundError when no Address ID was found.
func (*AddressQuery) FirstIDX ¶
func (aq *AddressQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*AddressQuery) FirstX ¶
func (aq *AddressQuery) FirstX(ctx context.Context) *Address
FirstX is like First, but panics if an error occurs.
func (*AddressQuery) GroupBy ¶
func (aq *AddressQuery) GroupBy(field string, fields ...string) *AddressGroupBy
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.Address.Query(). GroupBy(address.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*AddressQuery) IDs ¶
func (aq *AddressQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of Address IDs.
func (*AddressQuery) IDsX ¶
func (aq *AddressQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*AddressQuery) Limit ¶
func (aq *AddressQuery) Limit(limit int) *AddressQuery
Limit the number of records to be returned by this query.
func (*AddressQuery) Offset ¶
func (aq *AddressQuery) Offset(offset int) *AddressQuery
Offset to start from.
func (*AddressQuery) Only ¶
func (aq *AddressQuery) Only(ctx context.Context) (*Address, error)
Only returns a single Address entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Address entity is found. Returns a *NotFoundError when no Address entities are found.
func (*AddressQuery) OnlyID ¶
func (aq *AddressQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only Address ID in the query. Returns a *NotSingularError when more than one Address ID is found. Returns a *NotFoundError when no entities are found.
func (*AddressQuery) OnlyIDX ¶
func (aq *AddressQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AddressQuery) OnlyX ¶
func (aq *AddressQuery) OnlyX(ctx context.Context) *Address
OnlyX is like Only, but panics if an error occurs.
func (*AddressQuery) Order ¶
func (aq *AddressQuery) Order(o ...address.OrderOption) *AddressQuery
Order specifies how the records should be ordered.
func (*AddressQuery) QueryUsers ¶
func (aq *AddressQuery) QueryUsers() *UserQuery
QueryUsers chains the current query on the "users" edge.
func (*AddressQuery) Select ¶
func (aq *AddressQuery) Select(fields ...string) *AddressSelect
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.Address.Query(). Select(address.FieldCreatedAt). Scan(ctx, &v)
func (*AddressQuery) Unique ¶
func (aq *AddressQuery) Unique(unique bool) *AddressQuery
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 (*AddressQuery) Where ¶
func (aq *AddressQuery) Where(ps ...predicate.Address) *AddressQuery
Where adds a new predicate for the AddressQuery builder.
func (*AddressQuery) WithUsers ¶
func (aq *AddressQuery) WithUsers(opts ...func(*UserQuery)) *AddressQuery
WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.
type AddressSelect ¶
type AddressSelect struct { *AddressQuery // contains filtered or unexported fields }
AddressSelect is the builder for selecting fields of Address entities.
func (*AddressSelect) Aggregate ¶
func (as *AddressSelect) Aggregate(fns ...AggregateFunc) *AddressSelect
Aggregate adds the given aggregation functions to the selector query.
func (*AddressSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AddressSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AddressSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AddressSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AddressSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AddressSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AddressSelect) Scan ¶
func (as *AddressSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AddressSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AddressUpdate ¶
type AddressUpdate struct {
// contains filtered or unexported fields
}
AddressUpdate is the builder for updating Address entities.
func (*AddressUpdate) AddFlat ¶
func (au *AddressUpdate) AddFlat(i int) *AddressUpdate
AddFlat adds i to the "flat" field.
func (*AddressUpdate) AddHouse ¶
func (au *AddressUpdate) AddHouse(i int) *AddressUpdate
AddHouse adds i to the "house" field.
func (*AddressUpdate) AddPostcode ¶
func (au *AddressUpdate) AddPostcode(i int) *AddressUpdate
AddPostcode adds i to the "postcode" field.
func (*AddressUpdate) ClearFlat ¶
func (au *AddressUpdate) ClearFlat() *AddressUpdate
ClearFlat clears the value of the "flat" field.
func (*AddressUpdate) ClearLetter ¶
func (au *AddressUpdate) ClearLetter() *AddressUpdate
ClearLetter clears the value of the "letter" field.
func (*AddressUpdate) ClearUsers ¶
func (au *AddressUpdate) ClearUsers() *AddressUpdate
ClearUsers clears the "users" edge to the User entity.
func (*AddressUpdate) Exec ¶
func (au *AddressUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AddressUpdate) ExecX ¶
func (au *AddressUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AddressUpdate) Mutation ¶
func (au *AddressUpdate) Mutation() *AddressMutation
Mutation returns the AddressMutation object of the builder.
func (*AddressUpdate) Save ¶
func (au *AddressUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AddressUpdate) SaveX ¶
func (au *AddressUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AddressUpdate) SetCity ¶
func (au *AddressUpdate) SetCity(s string) *AddressUpdate
SetCity sets the "city" field.
func (*AddressUpdate) SetCountry ¶
func (au *AddressUpdate) SetCountry(s string) *AddressUpdate
SetCountry sets the "country" field.
func (*AddressUpdate) SetFlat ¶
func (au *AddressUpdate) SetFlat(i int) *AddressUpdate
SetFlat sets the "flat" field.
func (*AddressUpdate) SetHouse ¶
func (au *AddressUpdate) SetHouse(i int) *AddressUpdate
SetHouse sets the "house" field.
func (*AddressUpdate) SetLetter ¶
func (au *AddressUpdate) SetLetter(s string) *AddressUpdate
SetLetter sets the "letter" field.
func (*AddressUpdate) SetNillableCity ¶
func (au *AddressUpdate) SetNillableCity(s *string) *AddressUpdate
SetNillableCity sets the "city" field if the given value is not nil.
func (*AddressUpdate) SetNillableCountry ¶
func (au *AddressUpdate) SetNillableCountry(s *string) *AddressUpdate
SetNillableCountry sets the "country" field if the given value is not nil.
func (*AddressUpdate) SetNillableFlat ¶
func (au *AddressUpdate) SetNillableFlat(i *int) *AddressUpdate
SetNillableFlat sets the "flat" field if the given value is not nil.
func (*AddressUpdate) SetNillableHouse ¶
func (au *AddressUpdate) SetNillableHouse(i *int) *AddressUpdate
SetNillableHouse sets the "house" field if the given value is not nil.
func (*AddressUpdate) SetNillableLetter ¶
func (au *AddressUpdate) SetNillableLetter(s *string) *AddressUpdate
SetNillableLetter sets the "letter" field if the given value is not nil.
func (*AddressUpdate) SetNillablePostcode ¶
func (au *AddressUpdate) SetNillablePostcode(i *int) *AddressUpdate
SetNillablePostcode sets the "postcode" field if the given value is not nil.
func (*AddressUpdate) SetNillableStreet ¶
func (au *AddressUpdate) SetNillableStreet(s *string) *AddressUpdate
SetNillableStreet sets the "street" field if the given value is not nil.
func (*AddressUpdate) SetNillableUserID ¶
func (au *AddressUpdate) SetNillableUserID(i *int64) *AddressUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*AddressUpdate) SetPostcode ¶
func (au *AddressUpdate) SetPostcode(i int) *AddressUpdate
SetPostcode sets the "postcode" field.
func (*AddressUpdate) SetStreet ¶
func (au *AddressUpdate) SetStreet(s string) *AddressUpdate
SetStreet sets the "street" field.
func (*AddressUpdate) SetUpdatedAt ¶
func (au *AddressUpdate) SetUpdatedAt(t time.Time) *AddressUpdate
SetUpdatedAt sets the "updated_at" field.
func (*AddressUpdate) SetUserID ¶
func (au *AddressUpdate) SetUserID(i int64) *AddressUpdate
SetUserID sets the "user_id" field.
func (*AddressUpdate) SetUsers ¶
func (au *AddressUpdate) SetUsers(u *User) *AddressUpdate
SetUsers sets the "users" edge to the User entity.
func (*AddressUpdate) SetUsersID ¶
func (au *AddressUpdate) SetUsersID(id int64) *AddressUpdate
SetUsersID sets the "users" edge to the User entity by ID.
func (*AddressUpdate) Where ¶
func (au *AddressUpdate) Where(ps ...predicate.Address) *AddressUpdate
Where appends a list predicates to the AddressUpdate builder.
type AddressUpdateOne ¶
type AddressUpdateOne struct {
// contains filtered or unexported fields
}
AddressUpdateOne is the builder for updating a single Address entity.
func (*AddressUpdateOne) AddFlat ¶
func (auo *AddressUpdateOne) AddFlat(i int) *AddressUpdateOne
AddFlat adds i to the "flat" field.
func (*AddressUpdateOne) AddHouse ¶
func (auo *AddressUpdateOne) AddHouse(i int) *AddressUpdateOne
AddHouse adds i to the "house" field.
func (*AddressUpdateOne) AddPostcode ¶
func (auo *AddressUpdateOne) AddPostcode(i int) *AddressUpdateOne
AddPostcode adds i to the "postcode" field.
func (*AddressUpdateOne) ClearFlat ¶
func (auo *AddressUpdateOne) ClearFlat() *AddressUpdateOne
ClearFlat clears the value of the "flat" field.
func (*AddressUpdateOne) ClearLetter ¶
func (auo *AddressUpdateOne) ClearLetter() *AddressUpdateOne
ClearLetter clears the value of the "letter" field.
func (*AddressUpdateOne) ClearUsers ¶
func (auo *AddressUpdateOne) ClearUsers() *AddressUpdateOne
ClearUsers clears the "users" edge to the User entity.
func (*AddressUpdateOne) Exec ¶
func (auo *AddressUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AddressUpdateOne) ExecX ¶
func (auo *AddressUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AddressUpdateOne) Mutation ¶
func (auo *AddressUpdateOne) Mutation() *AddressMutation
Mutation returns the AddressMutation object of the builder.
func (*AddressUpdateOne) Save ¶
func (auo *AddressUpdateOne) Save(ctx context.Context) (*Address, error)
Save executes the query and returns the updated Address entity.
func (*AddressUpdateOne) SaveX ¶
func (auo *AddressUpdateOne) SaveX(ctx context.Context) *Address
SaveX is like Save, but panics if an error occurs.
func (*AddressUpdateOne) Select ¶
func (auo *AddressUpdateOne) Select(field string, fields ...string) *AddressUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AddressUpdateOne) SetCity ¶
func (auo *AddressUpdateOne) SetCity(s string) *AddressUpdateOne
SetCity sets the "city" field.
func (*AddressUpdateOne) SetCountry ¶
func (auo *AddressUpdateOne) SetCountry(s string) *AddressUpdateOne
SetCountry sets the "country" field.
func (*AddressUpdateOne) SetFlat ¶
func (auo *AddressUpdateOne) SetFlat(i int) *AddressUpdateOne
SetFlat sets the "flat" field.
func (*AddressUpdateOne) SetHouse ¶
func (auo *AddressUpdateOne) SetHouse(i int) *AddressUpdateOne
SetHouse sets the "house" field.
func (*AddressUpdateOne) SetLetter ¶
func (auo *AddressUpdateOne) SetLetter(s string) *AddressUpdateOne
SetLetter sets the "letter" field.
func (*AddressUpdateOne) SetNillableCity ¶
func (auo *AddressUpdateOne) SetNillableCity(s *string) *AddressUpdateOne
SetNillableCity sets the "city" field if the given value is not nil.
func (*AddressUpdateOne) SetNillableCountry ¶
func (auo *AddressUpdateOne) SetNillableCountry(s *string) *AddressUpdateOne
SetNillableCountry sets the "country" field if the given value is not nil.
func (*AddressUpdateOne) SetNillableFlat ¶
func (auo *AddressUpdateOne) SetNillableFlat(i *int) *AddressUpdateOne
SetNillableFlat sets the "flat" field if the given value is not nil.
func (*AddressUpdateOne) SetNillableHouse ¶
func (auo *AddressUpdateOne) SetNillableHouse(i *int) *AddressUpdateOne
SetNillableHouse sets the "house" field if the given value is not nil.
func (*AddressUpdateOne) SetNillableLetter ¶
func (auo *AddressUpdateOne) SetNillableLetter(s *string) *AddressUpdateOne
SetNillableLetter sets the "letter" field if the given value is not nil.
func (*AddressUpdateOne) SetNillablePostcode ¶
func (auo *AddressUpdateOne) SetNillablePostcode(i *int) *AddressUpdateOne
SetNillablePostcode sets the "postcode" field if the given value is not nil.
func (*AddressUpdateOne) SetNillableStreet ¶
func (auo *AddressUpdateOne) SetNillableStreet(s *string) *AddressUpdateOne
SetNillableStreet sets the "street" field if the given value is not nil.
func (*AddressUpdateOne) SetNillableUserID ¶
func (auo *AddressUpdateOne) SetNillableUserID(i *int64) *AddressUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*AddressUpdateOne) SetPostcode ¶
func (auo *AddressUpdateOne) SetPostcode(i int) *AddressUpdateOne
SetPostcode sets the "postcode" field.
func (*AddressUpdateOne) SetStreet ¶
func (auo *AddressUpdateOne) SetStreet(s string) *AddressUpdateOne
SetStreet sets the "street" field.
func (*AddressUpdateOne) SetUpdatedAt ¶
func (auo *AddressUpdateOne) SetUpdatedAt(t time.Time) *AddressUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*AddressUpdateOne) SetUserID ¶
func (auo *AddressUpdateOne) SetUserID(i int64) *AddressUpdateOne
SetUserID sets the "user_id" field.
func (*AddressUpdateOne) SetUsers ¶
func (auo *AddressUpdateOne) SetUsers(u *User) *AddressUpdateOne
SetUsers sets the "users" edge to the User entity.
func (*AddressUpdateOne) SetUsersID ¶
func (auo *AddressUpdateOne) SetUsersID(id int64) *AddressUpdateOne
SetUsersID sets the "users" edge to the User entity by ID.
func (*AddressUpdateOne) Where ¶
func (auo *AddressUpdateOne) Where(ps ...predicate.Address) *AddressUpdateOne
Where appends a list predicates to the AddressUpdate builder.
type AddressUpsert ¶
AddressUpsert is the "OnConflict" setter.
func (*AddressUpsert) AddFlat ¶
func (u *AddressUpsert) AddFlat(v int) *AddressUpsert
AddFlat adds v to the "flat" field.
func (*AddressUpsert) AddHouse ¶
func (u *AddressUpsert) AddHouse(v int) *AddressUpsert
AddHouse adds v to the "house" field.
func (*AddressUpsert) AddPostcode ¶
func (u *AddressUpsert) AddPostcode(v int) *AddressUpsert
AddPostcode adds v to the "postcode" field.
func (*AddressUpsert) ClearFlat ¶
func (u *AddressUpsert) ClearFlat() *AddressUpsert
ClearFlat clears the value of the "flat" field.
func (*AddressUpsert) ClearLetter ¶
func (u *AddressUpsert) ClearLetter() *AddressUpsert
ClearLetter clears the value of the "letter" field.
func (*AddressUpsert) SetCity ¶
func (u *AddressUpsert) SetCity(v string) *AddressUpsert
SetCity sets the "city" field.
func (*AddressUpsert) SetCountry ¶
func (u *AddressUpsert) SetCountry(v string) *AddressUpsert
SetCountry sets the "country" field.
func (*AddressUpsert) SetFlat ¶
func (u *AddressUpsert) SetFlat(v int) *AddressUpsert
SetFlat sets the "flat" field.
func (*AddressUpsert) SetHouse ¶
func (u *AddressUpsert) SetHouse(v int) *AddressUpsert
SetHouse sets the "house" field.
func (*AddressUpsert) SetLetter ¶
func (u *AddressUpsert) SetLetter(v string) *AddressUpsert
SetLetter sets the "letter" field.
func (*AddressUpsert) SetPostcode ¶
func (u *AddressUpsert) SetPostcode(v int) *AddressUpsert
SetPostcode sets the "postcode" field.
func (*AddressUpsert) SetStreet ¶
func (u *AddressUpsert) SetStreet(v string) *AddressUpsert
SetStreet sets the "street" field.
func (*AddressUpsert) SetUpdatedAt ¶
func (u *AddressUpsert) SetUpdatedAt(v time.Time) *AddressUpsert
SetUpdatedAt sets the "updated_at" field.
func (*AddressUpsert) SetUserID ¶
func (u *AddressUpsert) SetUserID(v int64) *AddressUpsert
SetUserID sets the "user_id" field.
func (*AddressUpsert) UpdateCity ¶
func (u *AddressUpsert) UpdateCity() *AddressUpsert
UpdateCity sets the "city" field to the value that was provided on create.
func (*AddressUpsert) UpdateCountry ¶
func (u *AddressUpsert) UpdateCountry() *AddressUpsert
UpdateCountry sets the "country" field to the value that was provided on create.
func (*AddressUpsert) UpdateFlat ¶
func (u *AddressUpsert) UpdateFlat() *AddressUpsert
UpdateFlat sets the "flat" field to the value that was provided on create.
func (*AddressUpsert) UpdateHouse ¶
func (u *AddressUpsert) UpdateHouse() *AddressUpsert
UpdateHouse sets the "house" field to the value that was provided on create.
func (*AddressUpsert) UpdateLetter ¶
func (u *AddressUpsert) UpdateLetter() *AddressUpsert
UpdateLetter sets the "letter" field to the value that was provided on create.
func (*AddressUpsert) UpdatePostcode ¶
func (u *AddressUpsert) UpdatePostcode() *AddressUpsert
UpdatePostcode sets the "postcode" field to the value that was provided on create.
func (*AddressUpsert) UpdateStreet ¶
func (u *AddressUpsert) UpdateStreet() *AddressUpsert
UpdateStreet sets the "street" field to the value that was provided on create.
func (*AddressUpsert) UpdateUpdatedAt ¶
func (u *AddressUpsert) UpdateUpdatedAt() *AddressUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*AddressUpsert) UpdateUserID ¶
func (u *AddressUpsert) UpdateUserID() *AddressUpsert
UpdateUserID sets the "user_id" field to the value that was provided on create.
type AddressUpsertBulk ¶
type AddressUpsertBulk struct {
// contains filtered or unexported fields
}
AddressUpsertBulk is the builder for "upsert"-ing a bulk of Address nodes.
func (*AddressUpsertBulk) AddFlat ¶
func (u *AddressUpsertBulk) AddFlat(v int) *AddressUpsertBulk
AddFlat adds v to the "flat" field.
func (*AddressUpsertBulk) AddHouse ¶
func (u *AddressUpsertBulk) AddHouse(v int) *AddressUpsertBulk
AddHouse adds v to the "house" field.
func (*AddressUpsertBulk) AddPostcode ¶
func (u *AddressUpsertBulk) AddPostcode(v int) *AddressUpsertBulk
AddPostcode adds v to the "postcode" field.
func (*AddressUpsertBulk) ClearFlat ¶
func (u *AddressUpsertBulk) ClearFlat() *AddressUpsertBulk
ClearFlat clears the value of the "flat" field.
func (*AddressUpsertBulk) ClearLetter ¶
func (u *AddressUpsertBulk) ClearLetter() *AddressUpsertBulk
ClearLetter clears the value of the "letter" field.
func (*AddressUpsertBulk) DoNothing ¶
func (u *AddressUpsertBulk) DoNothing() *AddressUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*AddressUpsertBulk) Exec ¶
func (u *AddressUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AddressUpsertBulk) ExecX ¶
func (u *AddressUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AddressUpsertBulk) Ignore ¶
func (u *AddressUpsertBulk) Ignore() *AddressUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Address.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*AddressUpsertBulk) SetCity ¶
func (u *AddressUpsertBulk) SetCity(v string) *AddressUpsertBulk
SetCity sets the "city" field.
func (*AddressUpsertBulk) SetCountry ¶
func (u *AddressUpsertBulk) SetCountry(v string) *AddressUpsertBulk
SetCountry sets the "country" field.
func (*AddressUpsertBulk) SetFlat ¶
func (u *AddressUpsertBulk) SetFlat(v int) *AddressUpsertBulk
SetFlat sets the "flat" field.
func (*AddressUpsertBulk) SetHouse ¶
func (u *AddressUpsertBulk) SetHouse(v int) *AddressUpsertBulk
SetHouse sets the "house" field.
func (*AddressUpsertBulk) SetLetter ¶
func (u *AddressUpsertBulk) SetLetter(v string) *AddressUpsertBulk
SetLetter sets the "letter" field.
func (*AddressUpsertBulk) SetPostcode ¶
func (u *AddressUpsertBulk) SetPostcode(v int) *AddressUpsertBulk
SetPostcode sets the "postcode" field.
func (*AddressUpsertBulk) SetStreet ¶
func (u *AddressUpsertBulk) SetStreet(v string) *AddressUpsertBulk
SetStreet sets the "street" field.
func (*AddressUpsertBulk) SetUpdatedAt ¶
func (u *AddressUpsertBulk) SetUpdatedAt(v time.Time) *AddressUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*AddressUpsertBulk) SetUserID ¶
func (u *AddressUpsertBulk) SetUserID(v int64) *AddressUpsertBulk
SetUserID sets the "user_id" field.
func (*AddressUpsertBulk) Update ¶
func (u *AddressUpsertBulk) Update(set func(*AddressUpsert)) *AddressUpsertBulk
Update allows overriding fields `UPDATE` values. See the AddressCreateBulk.OnConflict documentation for more info.
func (*AddressUpsertBulk) UpdateCity ¶
func (u *AddressUpsertBulk) UpdateCity() *AddressUpsertBulk
UpdateCity sets the "city" field to the value that was provided on create.
func (*AddressUpsertBulk) UpdateCountry ¶
func (u *AddressUpsertBulk) UpdateCountry() *AddressUpsertBulk
UpdateCountry sets the "country" field to the value that was provided on create.
func (*AddressUpsertBulk) UpdateFlat ¶
func (u *AddressUpsertBulk) UpdateFlat() *AddressUpsertBulk
UpdateFlat sets the "flat" field to the value that was provided on create.
func (*AddressUpsertBulk) UpdateHouse ¶
func (u *AddressUpsertBulk) UpdateHouse() *AddressUpsertBulk
UpdateHouse sets the "house" field to the value that was provided on create.
func (*AddressUpsertBulk) UpdateLetter ¶
func (u *AddressUpsertBulk) UpdateLetter() *AddressUpsertBulk
UpdateLetter sets the "letter" field to the value that was provided on create.
func (*AddressUpsertBulk) UpdateNewValues ¶
func (u *AddressUpsertBulk) UpdateNewValues() *AddressUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Address.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*AddressUpsertBulk) UpdatePostcode ¶
func (u *AddressUpsertBulk) UpdatePostcode() *AddressUpsertBulk
UpdatePostcode sets the "postcode" field to the value that was provided on create.
func (*AddressUpsertBulk) UpdateStreet ¶
func (u *AddressUpsertBulk) UpdateStreet() *AddressUpsertBulk
UpdateStreet sets the "street" field to the value that was provided on create.
func (*AddressUpsertBulk) UpdateUpdatedAt ¶
func (u *AddressUpsertBulk) UpdateUpdatedAt() *AddressUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*AddressUpsertBulk) UpdateUserID ¶
func (u *AddressUpsertBulk) UpdateUserID() *AddressUpsertBulk
UpdateUserID sets the "user_id" field to the value that was provided on create.
type AddressUpsertOne ¶
type AddressUpsertOne struct {
// contains filtered or unexported fields
}
AddressUpsertOne is the builder for "upsert"-ing
one Address node.
func (*AddressUpsertOne) AddFlat ¶
func (u *AddressUpsertOne) AddFlat(v int) *AddressUpsertOne
AddFlat adds v to the "flat" field.
func (*AddressUpsertOne) AddHouse ¶
func (u *AddressUpsertOne) AddHouse(v int) *AddressUpsertOne
AddHouse adds v to the "house" field.
func (*AddressUpsertOne) AddPostcode ¶
func (u *AddressUpsertOne) AddPostcode(v int) *AddressUpsertOne
AddPostcode adds v to the "postcode" field.
func (*AddressUpsertOne) ClearFlat ¶
func (u *AddressUpsertOne) ClearFlat() *AddressUpsertOne
ClearFlat clears the value of the "flat" field.
func (*AddressUpsertOne) ClearLetter ¶
func (u *AddressUpsertOne) ClearLetter() *AddressUpsertOne
ClearLetter clears the value of the "letter" field.
func (*AddressUpsertOne) DoNothing ¶
func (u *AddressUpsertOne) DoNothing() *AddressUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*AddressUpsertOne) Exec ¶
func (u *AddressUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*AddressUpsertOne) ExecX ¶
func (u *AddressUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AddressUpsertOne) ID ¶
func (u *AddressUpsertOne) ID(ctx context.Context) (id int64, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*AddressUpsertOne) IDX ¶
func (u *AddressUpsertOne) IDX(ctx context.Context) int64
IDX is like ID, but panics if an error occurs.
func (*AddressUpsertOne) Ignore ¶
func (u *AddressUpsertOne) Ignore() *AddressUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Address.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*AddressUpsertOne) SetCity ¶
func (u *AddressUpsertOne) SetCity(v string) *AddressUpsertOne
SetCity sets the "city" field.
func (*AddressUpsertOne) SetCountry ¶
func (u *AddressUpsertOne) SetCountry(v string) *AddressUpsertOne
SetCountry sets the "country" field.
func (*AddressUpsertOne) SetFlat ¶
func (u *AddressUpsertOne) SetFlat(v int) *AddressUpsertOne
SetFlat sets the "flat" field.
func (*AddressUpsertOne) SetHouse ¶
func (u *AddressUpsertOne) SetHouse(v int) *AddressUpsertOne
SetHouse sets the "house" field.
func (*AddressUpsertOne) SetLetter ¶
func (u *AddressUpsertOne) SetLetter(v string) *AddressUpsertOne
SetLetter sets the "letter" field.
func (*AddressUpsertOne) SetPostcode ¶
func (u *AddressUpsertOne) SetPostcode(v int) *AddressUpsertOne
SetPostcode sets the "postcode" field.
func (*AddressUpsertOne) SetStreet ¶
func (u *AddressUpsertOne) SetStreet(v string) *AddressUpsertOne
SetStreet sets the "street" field.
func (*AddressUpsertOne) SetUpdatedAt ¶
func (u *AddressUpsertOne) SetUpdatedAt(v time.Time) *AddressUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*AddressUpsertOne) SetUserID ¶
func (u *AddressUpsertOne) SetUserID(v int64) *AddressUpsertOne
SetUserID sets the "user_id" field.
func (*AddressUpsertOne) Update ¶
func (u *AddressUpsertOne) Update(set func(*AddressUpsert)) *AddressUpsertOne
Update allows overriding fields `UPDATE` values. See the AddressCreate.OnConflict documentation for more info.
func (*AddressUpsertOne) UpdateCity ¶
func (u *AddressUpsertOne) UpdateCity() *AddressUpsertOne
UpdateCity sets the "city" field to the value that was provided on create.
func (*AddressUpsertOne) UpdateCountry ¶
func (u *AddressUpsertOne) UpdateCountry() *AddressUpsertOne
UpdateCountry sets the "country" field to the value that was provided on create.
func (*AddressUpsertOne) UpdateFlat ¶
func (u *AddressUpsertOne) UpdateFlat() *AddressUpsertOne
UpdateFlat sets the "flat" field to the value that was provided on create.
func (*AddressUpsertOne) UpdateHouse ¶
func (u *AddressUpsertOne) UpdateHouse() *AddressUpsertOne
UpdateHouse sets the "house" field to the value that was provided on create.
func (*AddressUpsertOne) UpdateLetter ¶
func (u *AddressUpsertOne) UpdateLetter() *AddressUpsertOne
UpdateLetter sets the "letter" field to the value that was provided on create.
func (*AddressUpsertOne) UpdateNewValues ¶
func (u *AddressUpsertOne) UpdateNewValues() *AddressUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Address.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*AddressUpsertOne) UpdatePostcode ¶
func (u *AddressUpsertOne) UpdatePostcode() *AddressUpsertOne
UpdatePostcode sets the "postcode" field to the value that was provided on create.
func (*AddressUpsertOne) UpdateStreet ¶
func (u *AddressUpsertOne) UpdateStreet() *AddressUpsertOne
UpdateStreet sets the "street" field to the value that was provided on create.
func (*AddressUpsertOne) UpdateUpdatedAt ¶
func (u *AddressUpsertOne) UpdateUpdatedAt() *AddressUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*AddressUpsertOne) UpdateUserID ¶
func (u *AddressUpsertOne) UpdateUserID() *AddressUpsertOne
UpdateUserID sets the "user_id" field to the value that was provided on create.
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Cart ¶
type Cart struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // UserID holds the value of the "user_id" field. UserID int64 `json:"user_id,omitempty"` // ProductID holds the value of the "product_id" field. ProductID int64 `json:"product_id,omitempty"` // Amount holds the value of the "amount" field. Amount int64 `json:"amount,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CartQuery when eager-loading is set. Edges CartEdges `json:"edges"` // contains filtered or unexported fields }
Cart is the model entity for the Cart schema.
func (*Cart) QueryProducts ¶
func (c *Cart) QueryProducts() *ProductQuery
QueryProducts queries the "products" edge of the Cart entity.
func (*Cart) QueryUsers ¶
QueryUsers queries the "users" edge of the Cart entity.
func (*Cart) Unwrap ¶
Unwrap unwraps the Cart 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 (*Cart) Update ¶
func (c *Cart) Update() *CartUpdateOne
Update returns a builder for updating this Cart. Note that you need to call Cart.Unwrap() before calling this method if this Cart was returned from a transaction, and the transaction was committed or rolled back.
type CartClient ¶
type CartClient struct {
// contains filtered or unexported fields
}
CartClient is a client for the Cart schema.
func NewCartClient ¶
func NewCartClient(c config) *CartClient
NewCartClient returns a client for the Cart from the given config.
func (*CartClient) Create ¶
func (c *CartClient) Create() *CartCreate
Create returns a builder for creating a Cart entity.
func (*CartClient) CreateBulk ¶
func (c *CartClient) CreateBulk(builders ...*CartCreate) *CartCreateBulk
CreateBulk returns a builder for creating a bulk of Cart entities.
func (*CartClient) Delete ¶
func (c *CartClient) Delete() *CartDelete
Delete returns a delete builder for Cart.
func (*CartClient) DeleteOne ¶
func (c *CartClient) DeleteOne(ca *Cart) *CartDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CartClient) DeleteOneID ¶
func (c *CartClient) DeleteOneID(id int64) *CartDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CartClient) GetX ¶
func (c *CartClient) GetX(ctx context.Context, id int64) *Cart
GetX is like Get, but panics if an error occurs.
func (*CartClient) Intercept ¶
func (c *CartClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `cart.Intercept(f(g(h())))`.
func (*CartClient) Interceptors ¶
func (c *CartClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CartClient) MapCreateBulk ¶
func (c *CartClient) MapCreateBulk(slice any, setFunc func(*CartCreate, int)) *CartCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*CartClient) Query ¶
func (c *CartClient) Query() *CartQuery
Query returns a query builder for Cart.
func (*CartClient) QueryProducts ¶
func (c *CartClient) QueryProducts(ca *Cart) *ProductQuery
QueryProducts queries the products edge of a Cart.
func (*CartClient) QueryUsers ¶
func (c *CartClient) QueryUsers(ca *Cart) *UserQuery
QueryUsers queries the users edge of a Cart.
func (*CartClient) Update ¶
func (c *CartClient) Update() *CartUpdate
Update returns an update builder for Cart.
func (*CartClient) UpdateOne ¶
func (c *CartClient) UpdateOne(ca *Cart) *CartUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CartClient) UpdateOneID ¶
func (c *CartClient) UpdateOneID(id int64) *CartUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CartClient) Use ¶
func (c *CartClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `cart.Hooks(f(g(h())))`.
type CartCreate ¶
type CartCreate struct {
// contains filtered or unexported fields
}
CartCreate is the builder for creating a Cart entity.
func (*CartCreate) Exec ¶
func (cc *CartCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CartCreate) ExecX ¶
func (cc *CartCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CartCreate) Mutation ¶
func (cc *CartCreate) Mutation() *CartMutation
Mutation returns the CartMutation object of the builder.
func (*CartCreate) OnConflict ¶
func (cc *CartCreate) OnConflict(opts ...sql.ConflictOption) *CartUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Cart.Create(). SetCreatedAt(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.CartUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*CartCreate) OnConflictColumns ¶
func (cc *CartCreate) OnConflictColumns(columns ...string) *CartUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Cart.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*CartCreate) Save ¶
func (cc *CartCreate) Save(ctx context.Context) (*Cart, error)
Save creates the Cart in the database.
func (*CartCreate) SaveX ¶
func (cc *CartCreate) SaveX(ctx context.Context) *Cart
SaveX calls Save and panics if Save returns an error.
func (*CartCreate) SetAmount ¶
func (cc *CartCreate) SetAmount(i int64) *CartCreate
SetAmount sets the "amount" field.
func (*CartCreate) SetCreatedAt ¶
func (cc *CartCreate) SetCreatedAt(t time.Time) *CartCreate
SetCreatedAt sets the "created_at" field.
func (*CartCreate) SetNillableCreatedAt ¶
func (cc *CartCreate) SetNillableCreatedAt(t *time.Time) *CartCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*CartCreate) SetNillableUpdatedAt ¶
func (cc *CartCreate) SetNillableUpdatedAt(t *time.Time) *CartCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*CartCreate) SetProductID ¶
func (cc *CartCreate) SetProductID(i int64) *CartCreate
SetProductID sets the "product_id" field.
func (*CartCreate) SetProducts ¶
func (cc *CartCreate) SetProducts(p *Product) *CartCreate
SetProducts sets the "products" edge to the Product entity.
func (*CartCreate) SetProductsID ¶
func (cc *CartCreate) SetProductsID(id int64) *CartCreate
SetProductsID sets the "products" edge to the Product entity by ID.
func (*CartCreate) SetUpdatedAt ¶
func (cc *CartCreate) SetUpdatedAt(t time.Time) *CartCreate
SetUpdatedAt sets the "updated_at" field.
func (*CartCreate) SetUserID ¶
func (cc *CartCreate) SetUserID(i int64) *CartCreate
SetUserID sets the "user_id" field.
func (*CartCreate) SetUsers ¶
func (cc *CartCreate) SetUsers(u *User) *CartCreate
SetUsers sets the "users" edge to the User entity.
func (*CartCreate) SetUsersID ¶
func (cc *CartCreate) SetUsersID(id int64) *CartCreate
SetUsersID sets the "users" edge to the User entity by ID.
type CartCreateBulk ¶
type CartCreateBulk struct {
// contains filtered or unexported fields
}
CartCreateBulk is the builder for creating many Cart entities in bulk.
func (*CartCreateBulk) Exec ¶
func (ccb *CartCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CartCreateBulk) ExecX ¶
func (ccb *CartCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CartCreateBulk) OnConflict ¶
func (ccb *CartCreateBulk) OnConflict(opts ...sql.ConflictOption) *CartUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Cart.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.CartUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*CartCreateBulk) OnConflictColumns ¶
func (ccb *CartCreateBulk) OnConflictColumns(columns ...string) *CartUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Cart.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type CartDelete ¶
type CartDelete struct {
// contains filtered or unexported fields
}
CartDelete is the builder for deleting a Cart entity.
func (*CartDelete) Exec ¶
func (cd *CartDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CartDelete) ExecX ¶
func (cd *CartDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CartDelete) Where ¶
func (cd *CartDelete) Where(ps ...predicate.Cart) *CartDelete
Where appends a list predicates to the CartDelete builder.
type CartDeleteOne ¶
type CartDeleteOne struct {
// contains filtered or unexported fields
}
CartDeleteOne is the builder for deleting a single Cart entity.
func (*CartDeleteOne) Exec ¶
func (cdo *CartDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CartDeleteOne) ExecX ¶
func (cdo *CartDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CartDeleteOne) Where ¶
func (cdo *CartDeleteOne) Where(ps ...predicate.Cart) *CartDeleteOne
Where appends a list predicates to the CartDelete builder.
type CartEdges ¶
type CartEdges struct { // Users holds the value of the users edge. Users *User `json:"users,omitempty"` // Products holds the value of the products edge. Products *Product `json:"products,omitempty"` // contains filtered or unexported fields }
CartEdges holds the relations/edges for other nodes in the graph.
func (CartEdges) ProductsOrErr ¶
ProductsOrErr returns the Products value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (CartEdges) UsersOrErr ¶
UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type CartGroupBy ¶
type CartGroupBy struct {
// contains filtered or unexported fields
}
CartGroupBy is the group-by builder for Cart entities.
func (*CartGroupBy) Aggregate ¶
func (cgb *CartGroupBy) Aggregate(fns ...AggregateFunc) *CartGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CartGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CartGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CartGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CartGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CartGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CartGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CartGroupBy) Scan ¶
func (cgb *CartGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CartGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CartMutation ¶
type CartMutation struct {
// contains filtered or unexported fields
}
CartMutation represents an operation that mutates the Cart nodes in the graph.
func (*CartMutation) AddAmount ¶
func (m *CartMutation) AddAmount(i int64)
AddAmount adds i to the "amount" field.
func (*CartMutation) AddField ¶
func (m *CartMutation) 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 (*CartMutation) AddedAmount ¶
func (m *CartMutation) AddedAmount() (r int64, exists bool)
AddedAmount returns the value that was added to the "amount" field in this mutation.
func (*CartMutation) AddedEdges ¶
func (m *CartMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CartMutation) AddedField ¶
func (m *CartMutation) 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 (*CartMutation) AddedFields ¶
func (m *CartMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CartMutation) AddedIDs ¶
func (m *CartMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CartMutation) Amount ¶
func (m *CartMutation) Amount() (r int64, exists bool)
Amount returns the value of the "amount" field in the mutation.
func (*CartMutation) ClearEdge ¶
func (m *CartMutation) 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 (*CartMutation) ClearField ¶
func (m *CartMutation) 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 (*CartMutation) ClearProducts ¶
func (m *CartMutation) ClearProducts()
ClearProducts clears the "products" edge to the Product entity.
func (*CartMutation) ClearUsers ¶
func (m *CartMutation) ClearUsers()
ClearUsers clears the "users" edge to the User entity.
func (*CartMutation) ClearedEdges ¶
func (m *CartMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CartMutation) ClearedFields ¶
func (m *CartMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CartMutation) Client ¶
func (m CartMutation) 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 (*CartMutation) CreatedAt ¶
func (m *CartMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*CartMutation) EdgeCleared ¶
func (m *CartMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CartMutation) Field ¶
func (m *CartMutation) 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 (*CartMutation) FieldCleared ¶
func (m *CartMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CartMutation) Fields ¶
func (m *CartMutation) 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 (*CartMutation) ID ¶
func (m *CartMutation) ID() (id int64, 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 (*CartMutation) IDs ¶
func (m *CartMutation) IDs(ctx context.Context) ([]int64, 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 (*CartMutation) OldAmount ¶
func (m *CartMutation) OldAmount(ctx context.Context) (v int64, err error)
OldAmount returns the old "amount" field's value of the Cart entity. If the Cart 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 (*CartMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Cart entity. If the Cart 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 (*CartMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*CartMutation) OldProductID ¶
func (m *CartMutation) OldProductID(ctx context.Context) (v int64, err error)
OldProductID returns the old "product_id" field's value of the Cart entity. If the Cart 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 (*CartMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Cart entity. If the Cart 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 (*CartMutation) OldUserID ¶
func (m *CartMutation) OldUserID(ctx context.Context) (v int64, err error)
OldUserID returns the old "user_id" field's value of the Cart entity. If the Cart 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 (*CartMutation) ProductID ¶
func (m *CartMutation) ProductID() (r int64, exists bool)
ProductID returns the value of the "product_id" field in the mutation.
func (*CartMutation) ProductsCleared ¶
func (m *CartMutation) ProductsCleared() bool
ProductsCleared reports if the "products" edge to the Product entity was cleared.
func (*CartMutation) ProductsID ¶
func (m *CartMutation) ProductsID() (id int64, exists bool)
ProductsID returns the "products" edge ID in the mutation.
func (*CartMutation) ProductsIDs ¶
func (m *CartMutation) ProductsIDs() (ids []int64)
ProductsIDs returns the "products" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductsID instead. It exists only for internal usage by the builders.
func (*CartMutation) RemovedEdges ¶
func (m *CartMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CartMutation) RemovedIDs ¶
func (m *CartMutation) 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 (*CartMutation) ResetAmount ¶
func (m *CartMutation) ResetAmount()
ResetAmount resets all changes to the "amount" field.
func (*CartMutation) ResetCreatedAt ¶
func (m *CartMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*CartMutation) ResetEdge ¶
func (m *CartMutation) 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 (*CartMutation) ResetField ¶
func (m *CartMutation) 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 (*CartMutation) ResetProductID ¶
func (m *CartMutation) ResetProductID()
ResetProductID resets all changes to the "product_id" field.
func (*CartMutation) ResetProducts ¶
func (m *CartMutation) ResetProducts()
ResetProducts resets all changes to the "products" edge.
func (*CartMutation) ResetUpdatedAt ¶
func (m *CartMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*CartMutation) ResetUserID ¶
func (m *CartMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*CartMutation) ResetUsers ¶
func (m *CartMutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*CartMutation) SetAmount ¶
func (m *CartMutation) SetAmount(i int64)
SetAmount sets the "amount" field.
func (*CartMutation) SetCreatedAt ¶
func (m *CartMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*CartMutation) SetField ¶
func (m *CartMutation) 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 (*CartMutation) SetOp ¶
func (m *CartMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CartMutation) SetProductID ¶
func (m *CartMutation) SetProductID(i int64)
SetProductID sets the "product_id" field.
func (*CartMutation) SetProductsID ¶
func (m *CartMutation) SetProductsID(id int64)
SetProductsID sets the "products" edge to the Product entity by id.
func (*CartMutation) SetUpdatedAt ¶
func (m *CartMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*CartMutation) SetUserID ¶
func (m *CartMutation) SetUserID(i int64)
SetUserID sets the "user_id" field.
func (*CartMutation) SetUsersID ¶
func (m *CartMutation) SetUsersID(id int64)
SetUsersID sets the "users" edge to the User entity by id.
func (CartMutation) Tx ¶
func (m CartMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CartMutation) Type ¶
func (m *CartMutation) Type() string
Type returns the node type of this mutation (Cart).
func (*CartMutation) UpdatedAt ¶
func (m *CartMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*CartMutation) UserID ¶
func (m *CartMutation) UserID() (r int64, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*CartMutation) UsersCleared ¶
func (m *CartMutation) UsersCleared() bool
UsersCleared reports if the "users" edge to the User entity was cleared.
func (*CartMutation) UsersID ¶
func (m *CartMutation) UsersID() (id int64, exists bool)
UsersID returns the "users" edge ID in the mutation.
func (*CartMutation) UsersIDs ¶
func (m *CartMutation) UsersIDs() (ids []int64)
UsersIDs returns the "users" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UsersID instead. It exists only for internal usage by the builders.
func (*CartMutation) Where ¶
func (m *CartMutation) Where(ps ...predicate.Cart)
Where appends a list predicates to the CartMutation builder.
func (*CartMutation) WhereP ¶
func (m *CartMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CartMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CartQuery ¶
type CartQuery struct {
// contains filtered or unexported fields
}
CartQuery is the builder for querying Cart entities.
func (*CartQuery) Aggregate ¶
func (cq *CartQuery) Aggregate(fns ...AggregateFunc) *CartSelect
Aggregate returns a CartSelect configured with the given aggregations.
func (*CartQuery) Clone ¶
Clone returns a duplicate of the CartQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CartQuery) First ¶
First returns the first Cart entity from the query. Returns a *NotFoundError when no Cart was found.
func (*CartQuery) FirstID ¶
FirstID returns the first Cart ID from the query. Returns a *NotFoundError when no Cart ID was found.
func (*CartQuery) GroupBy ¶
func (cq *CartQuery) GroupBy(field string, fields ...string) *CartGroupBy
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.Cart.Query(). GroupBy(cart.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CartQuery) Only ¶
Only returns a single Cart entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Cart entity is found. Returns a *NotFoundError when no Cart entities are found.
func (*CartQuery) OnlyID ¶
OnlyID is like Only, but returns the only Cart ID in the query. Returns a *NotSingularError when more than one Cart ID is found. Returns a *NotFoundError when no entities are found.
func (*CartQuery) Order ¶
func (cq *CartQuery) Order(o ...cart.OrderOption) *CartQuery
Order specifies how the records should be ordered.
func (*CartQuery) QueryProducts ¶
func (cq *CartQuery) QueryProducts() *ProductQuery
QueryProducts chains the current query on the "products" edge.
func (*CartQuery) QueryUsers ¶
QueryUsers chains the current query on the "users" edge.
func (*CartQuery) Select ¶
func (cq *CartQuery) Select(fields ...string) *CartSelect
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.Cart.Query(). Select(cart.FieldCreatedAt). Scan(ctx, &v)
func (*CartQuery) 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 (*CartQuery) WithProducts ¶
func (cq *CartQuery) WithProducts(opts ...func(*ProductQuery)) *CartQuery
WithProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge. The optional arguments are used to configure the query builder of the edge.
type CartSelect ¶
type CartSelect struct { *CartQuery // contains filtered or unexported fields }
CartSelect is the builder for selecting fields of Cart entities.
func (*CartSelect) Aggregate ¶
func (cs *CartSelect) Aggregate(fns ...AggregateFunc) *CartSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CartSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CartSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CartSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CartSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CartSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CartSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CartSelect) Scan ¶
func (cs *CartSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CartSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CartUpdate ¶
type CartUpdate struct {
// contains filtered or unexported fields
}
CartUpdate is the builder for updating Cart entities.
func (*CartUpdate) AddAmount ¶
func (cu *CartUpdate) AddAmount(i int64) *CartUpdate
AddAmount adds i to the "amount" field.
func (*CartUpdate) ClearProducts ¶
func (cu *CartUpdate) ClearProducts() *CartUpdate
ClearProducts clears the "products" edge to the Product entity.
func (*CartUpdate) ClearUsers ¶
func (cu *CartUpdate) ClearUsers() *CartUpdate
ClearUsers clears the "users" edge to the User entity.
func (*CartUpdate) Exec ¶
func (cu *CartUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CartUpdate) ExecX ¶
func (cu *CartUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CartUpdate) Mutation ¶
func (cu *CartUpdate) Mutation() *CartMutation
Mutation returns the CartMutation object of the builder.
func (*CartUpdate) Save ¶
func (cu *CartUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CartUpdate) SaveX ¶
func (cu *CartUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CartUpdate) SetAmount ¶
func (cu *CartUpdate) SetAmount(i int64) *CartUpdate
SetAmount sets the "amount" field.
func (*CartUpdate) SetNillableAmount ¶
func (cu *CartUpdate) SetNillableAmount(i *int64) *CartUpdate
SetNillableAmount sets the "amount" field if the given value is not nil.
func (*CartUpdate) SetNillableProductID ¶
func (cu *CartUpdate) SetNillableProductID(i *int64) *CartUpdate
SetNillableProductID sets the "product_id" field if the given value is not nil.
func (*CartUpdate) SetNillableUserID ¶
func (cu *CartUpdate) SetNillableUserID(i *int64) *CartUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*CartUpdate) SetProductID ¶
func (cu *CartUpdate) SetProductID(i int64) *CartUpdate
SetProductID sets the "product_id" field.
func (*CartUpdate) SetProducts ¶
func (cu *CartUpdate) SetProducts(p *Product) *CartUpdate
SetProducts sets the "products" edge to the Product entity.
func (*CartUpdate) SetProductsID ¶
func (cu *CartUpdate) SetProductsID(id int64) *CartUpdate
SetProductsID sets the "products" edge to the Product entity by ID.
func (*CartUpdate) SetUpdatedAt ¶
func (cu *CartUpdate) SetUpdatedAt(t time.Time) *CartUpdate
SetUpdatedAt sets the "updated_at" field.
func (*CartUpdate) SetUserID ¶
func (cu *CartUpdate) SetUserID(i int64) *CartUpdate
SetUserID sets the "user_id" field.
func (*CartUpdate) SetUsers ¶
func (cu *CartUpdate) SetUsers(u *User) *CartUpdate
SetUsers sets the "users" edge to the User entity.
func (*CartUpdate) SetUsersID ¶
func (cu *CartUpdate) SetUsersID(id int64) *CartUpdate
SetUsersID sets the "users" edge to the User entity by ID.
func (*CartUpdate) Where ¶
func (cu *CartUpdate) Where(ps ...predicate.Cart) *CartUpdate
Where appends a list predicates to the CartUpdate builder.
type CartUpdateOne ¶
type CartUpdateOne struct {
// contains filtered or unexported fields
}
CartUpdateOne is the builder for updating a single Cart entity.
func (*CartUpdateOne) AddAmount ¶
func (cuo *CartUpdateOne) AddAmount(i int64) *CartUpdateOne
AddAmount adds i to the "amount" field.
func (*CartUpdateOne) ClearProducts ¶
func (cuo *CartUpdateOne) ClearProducts() *CartUpdateOne
ClearProducts clears the "products" edge to the Product entity.
func (*CartUpdateOne) ClearUsers ¶
func (cuo *CartUpdateOne) ClearUsers() *CartUpdateOne
ClearUsers clears the "users" edge to the User entity.
func (*CartUpdateOne) Exec ¶
func (cuo *CartUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CartUpdateOne) ExecX ¶
func (cuo *CartUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CartUpdateOne) Mutation ¶
func (cuo *CartUpdateOne) Mutation() *CartMutation
Mutation returns the CartMutation object of the builder.
func (*CartUpdateOne) Save ¶
func (cuo *CartUpdateOne) Save(ctx context.Context) (*Cart, error)
Save executes the query and returns the updated Cart entity.
func (*CartUpdateOne) SaveX ¶
func (cuo *CartUpdateOne) SaveX(ctx context.Context) *Cart
SaveX is like Save, but panics if an error occurs.
func (*CartUpdateOne) Select ¶
func (cuo *CartUpdateOne) Select(field string, fields ...string) *CartUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CartUpdateOne) SetAmount ¶
func (cuo *CartUpdateOne) SetAmount(i int64) *CartUpdateOne
SetAmount sets the "amount" field.
func (*CartUpdateOne) SetNillableAmount ¶
func (cuo *CartUpdateOne) SetNillableAmount(i *int64) *CartUpdateOne
SetNillableAmount sets the "amount" field if the given value is not nil.
func (*CartUpdateOne) SetNillableProductID ¶
func (cuo *CartUpdateOne) SetNillableProductID(i *int64) *CartUpdateOne
SetNillableProductID sets the "product_id" field if the given value is not nil.
func (*CartUpdateOne) SetNillableUserID ¶
func (cuo *CartUpdateOne) SetNillableUserID(i *int64) *CartUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*CartUpdateOne) SetProductID ¶
func (cuo *CartUpdateOne) SetProductID(i int64) *CartUpdateOne
SetProductID sets the "product_id" field.
func (*CartUpdateOne) SetProducts ¶
func (cuo *CartUpdateOne) SetProducts(p *Product) *CartUpdateOne
SetProducts sets the "products" edge to the Product entity.
func (*CartUpdateOne) SetProductsID ¶
func (cuo *CartUpdateOne) SetProductsID(id int64) *CartUpdateOne
SetProductsID sets the "products" edge to the Product entity by ID.
func (*CartUpdateOne) SetUpdatedAt ¶
func (cuo *CartUpdateOne) SetUpdatedAt(t time.Time) *CartUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*CartUpdateOne) SetUserID ¶
func (cuo *CartUpdateOne) SetUserID(i int64) *CartUpdateOne
SetUserID sets the "user_id" field.
func (*CartUpdateOne) SetUsers ¶
func (cuo *CartUpdateOne) SetUsers(u *User) *CartUpdateOne
SetUsers sets the "users" edge to the User entity.
func (*CartUpdateOne) SetUsersID ¶
func (cuo *CartUpdateOne) SetUsersID(id int64) *CartUpdateOne
SetUsersID sets the "users" edge to the User entity by ID.
func (*CartUpdateOne) Where ¶
func (cuo *CartUpdateOne) Where(ps ...predicate.Cart) *CartUpdateOne
Where appends a list predicates to the CartUpdate builder.
type CartUpsert ¶
CartUpsert is the "OnConflict" setter.
func (*CartUpsert) AddAmount ¶
func (u *CartUpsert) AddAmount(v int64) *CartUpsert
AddAmount adds v to the "amount" field.
func (*CartUpsert) SetAmount ¶
func (u *CartUpsert) SetAmount(v int64) *CartUpsert
SetAmount sets the "amount" field.
func (*CartUpsert) SetProductID ¶
func (u *CartUpsert) SetProductID(v int64) *CartUpsert
SetProductID sets the "product_id" field.
func (*CartUpsert) SetUpdatedAt ¶
func (u *CartUpsert) SetUpdatedAt(v time.Time) *CartUpsert
SetUpdatedAt sets the "updated_at" field.
func (*CartUpsert) SetUserID ¶
func (u *CartUpsert) SetUserID(v int64) *CartUpsert
SetUserID sets the "user_id" field.
func (*CartUpsert) UpdateAmount ¶
func (u *CartUpsert) UpdateAmount() *CartUpsert
UpdateAmount sets the "amount" field to the value that was provided on create.
func (*CartUpsert) UpdateProductID ¶
func (u *CartUpsert) UpdateProductID() *CartUpsert
UpdateProductID sets the "product_id" field to the value that was provided on create.
func (*CartUpsert) UpdateUpdatedAt ¶
func (u *CartUpsert) UpdateUpdatedAt() *CartUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*CartUpsert) UpdateUserID ¶
func (u *CartUpsert) UpdateUserID() *CartUpsert
UpdateUserID sets the "user_id" field to the value that was provided on create.
type CartUpsertBulk ¶
type CartUpsertBulk struct {
// contains filtered or unexported fields
}
CartUpsertBulk is the builder for "upsert"-ing a bulk of Cart nodes.
func (*CartUpsertBulk) AddAmount ¶
func (u *CartUpsertBulk) AddAmount(v int64) *CartUpsertBulk
AddAmount adds v to the "amount" field.
func (*CartUpsertBulk) DoNothing ¶
func (u *CartUpsertBulk) DoNothing() *CartUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*CartUpsertBulk) Exec ¶
func (u *CartUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CartUpsertBulk) ExecX ¶
func (u *CartUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CartUpsertBulk) Ignore ¶
func (u *CartUpsertBulk) Ignore() *CartUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Cart.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*CartUpsertBulk) SetAmount ¶
func (u *CartUpsertBulk) SetAmount(v int64) *CartUpsertBulk
SetAmount sets the "amount" field.
func (*CartUpsertBulk) SetProductID ¶
func (u *CartUpsertBulk) SetProductID(v int64) *CartUpsertBulk
SetProductID sets the "product_id" field.
func (*CartUpsertBulk) SetUpdatedAt ¶
func (u *CartUpsertBulk) SetUpdatedAt(v time.Time) *CartUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*CartUpsertBulk) SetUserID ¶
func (u *CartUpsertBulk) SetUserID(v int64) *CartUpsertBulk
SetUserID sets the "user_id" field.
func (*CartUpsertBulk) Update ¶
func (u *CartUpsertBulk) Update(set func(*CartUpsert)) *CartUpsertBulk
Update allows overriding fields `UPDATE` values. See the CartCreateBulk.OnConflict documentation for more info.
func (*CartUpsertBulk) UpdateAmount ¶
func (u *CartUpsertBulk) UpdateAmount() *CartUpsertBulk
UpdateAmount sets the "amount" field to the value that was provided on create.
func (*CartUpsertBulk) UpdateNewValues ¶
func (u *CartUpsertBulk) UpdateNewValues() *CartUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Cart.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*CartUpsertBulk) UpdateProductID ¶
func (u *CartUpsertBulk) UpdateProductID() *CartUpsertBulk
UpdateProductID sets the "product_id" field to the value that was provided on create.
func (*CartUpsertBulk) UpdateUpdatedAt ¶
func (u *CartUpsertBulk) UpdateUpdatedAt() *CartUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*CartUpsertBulk) UpdateUserID ¶
func (u *CartUpsertBulk) UpdateUserID() *CartUpsertBulk
UpdateUserID sets the "user_id" field to the value that was provided on create.
type CartUpsertOne ¶
type CartUpsertOne struct {
// contains filtered or unexported fields
}
CartUpsertOne is the builder for "upsert"-ing
one Cart node.
func (*CartUpsertOne) AddAmount ¶
func (u *CartUpsertOne) AddAmount(v int64) *CartUpsertOne
AddAmount adds v to the "amount" field.
func (*CartUpsertOne) DoNothing ¶
func (u *CartUpsertOne) DoNothing() *CartUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*CartUpsertOne) Exec ¶
func (u *CartUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*CartUpsertOne) ExecX ¶
func (u *CartUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CartUpsertOne) ID ¶
func (u *CartUpsertOne) ID(ctx context.Context) (id int64, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*CartUpsertOne) IDX ¶
func (u *CartUpsertOne) IDX(ctx context.Context) int64
IDX is like ID, but panics if an error occurs.
func (*CartUpsertOne) Ignore ¶
func (u *CartUpsertOne) Ignore() *CartUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Cart.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*CartUpsertOne) SetAmount ¶
func (u *CartUpsertOne) SetAmount(v int64) *CartUpsertOne
SetAmount sets the "amount" field.
func (*CartUpsertOne) SetProductID ¶
func (u *CartUpsertOne) SetProductID(v int64) *CartUpsertOne
SetProductID sets the "product_id" field.
func (*CartUpsertOne) SetUpdatedAt ¶
func (u *CartUpsertOne) SetUpdatedAt(v time.Time) *CartUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*CartUpsertOne) SetUserID ¶
func (u *CartUpsertOne) SetUserID(v int64) *CartUpsertOne
SetUserID sets the "user_id" field.
func (*CartUpsertOne) Update ¶
func (u *CartUpsertOne) Update(set func(*CartUpsert)) *CartUpsertOne
Update allows overriding fields `UPDATE` values. See the CartCreate.OnConflict documentation for more info.
func (*CartUpsertOne) UpdateAmount ¶
func (u *CartUpsertOne) UpdateAmount() *CartUpsertOne
UpdateAmount sets the "amount" field to the value that was provided on create.
func (*CartUpsertOne) UpdateNewValues ¶
func (u *CartUpsertOne) UpdateNewValues() *CartUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Cart.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*CartUpsertOne) UpdateProductID ¶
func (u *CartUpsertOne) UpdateProductID() *CartUpsertOne
UpdateProductID sets the "product_id" field to the value that was provided on create.
func (*CartUpsertOne) UpdateUpdatedAt ¶
func (u *CartUpsertOne) UpdateUpdatedAt() *CartUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*CartUpsertOne) UpdateUserID ¶
func (u *CartUpsertOne) UpdateUserID() *CartUpsertOne
UpdateUserID sets the "user_id" field to the value that was provided on create.
type Category ¶
type Category struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CategoryQuery when eager-loading is set. Edges CategoryEdges `json:"edges"` // contains filtered or unexported fields }
Category is the model entity for the Category schema.
func (*Category) QueryProducts ¶
func (c *Category) QueryProducts() *ProductQuery
QueryProducts queries the "products" edge of the Category entity.
func (*Category) Unwrap ¶
Unwrap unwraps the Category entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Category) Update ¶
func (c *Category) Update() *CategoryUpdateOne
Update returns a builder for updating this Category. Note that you need to call Category.Unwrap() before calling this method if this Category was returned from a transaction, and the transaction was committed or rolled back.
type CategoryClient ¶
type CategoryClient struct {
// contains filtered or unexported fields
}
CategoryClient is a client for the Category schema.
func NewCategoryClient ¶
func NewCategoryClient(c config) *CategoryClient
NewCategoryClient returns a client for the Category from the given config.
func (*CategoryClient) Create ¶
func (c *CategoryClient) Create() *CategoryCreate
Create returns a builder for creating a Category entity.
func (*CategoryClient) CreateBulk ¶
func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk
CreateBulk returns a builder for creating a bulk of Category entities.
func (*CategoryClient) Delete ¶
func (c *CategoryClient) Delete() *CategoryDelete
Delete returns a delete builder for Category.
func (*CategoryClient) DeleteOne ¶
func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CategoryClient) DeleteOneID ¶
func (c *CategoryClient) DeleteOneID(id int64) *CategoryDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CategoryClient) GetX ¶
func (c *CategoryClient) GetX(ctx context.Context, id int64) *Category
GetX is like Get, but panics if an error occurs.
func (*CategoryClient) Hooks ¶
func (c *CategoryClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CategoryClient) Intercept ¶
func (c *CategoryClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `category.Intercept(f(g(h())))`.
func (*CategoryClient) Interceptors ¶
func (c *CategoryClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CategoryClient) MapCreateBulk ¶
func (c *CategoryClient) MapCreateBulk(slice any, setFunc func(*CategoryCreate, int)) *CategoryCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*CategoryClient) Query ¶
func (c *CategoryClient) Query() *CategoryQuery
Query returns a query builder for Category.
func (*CategoryClient) QueryProducts ¶
func (c *CategoryClient) QueryProducts(ca *Category) *ProductQuery
QueryProducts queries the products edge of a Category.
func (*CategoryClient) Update ¶
func (c *CategoryClient) Update() *CategoryUpdate
Update returns an update builder for Category.
func (*CategoryClient) UpdateOne ¶
func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CategoryClient) UpdateOneID ¶
func (c *CategoryClient) UpdateOneID(id int64) *CategoryUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CategoryClient) Use ¶
func (c *CategoryClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `category.Hooks(f(g(h())))`.
type CategoryCreate ¶
type CategoryCreate struct {
// contains filtered or unexported fields
}
CategoryCreate is the builder for creating a Category entity.
func (*CategoryCreate) AddProductIDs ¶
func (cc *CategoryCreate) AddProductIDs(ids ...int64) *CategoryCreate
AddProductIDs adds the "products" edge to the Product entity by IDs.
func (*CategoryCreate) AddProducts ¶
func (cc *CategoryCreate) AddProducts(p ...*Product) *CategoryCreate
AddProducts adds the "products" edges to the Product entity.
func (*CategoryCreate) Exec ¶
func (cc *CategoryCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryCreate) ExecX ¶
func (cc *CategoryCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryCreate) Mutation ¶
func (cc *CategoryCreate) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryCreate) OnConflict ¶
func (cc *CategoryCreate) OnConflict(opts ...sql.ConflictOption) *CategoryUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Category.Create(). SetCreatedAt(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.CategoryUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*CategoryCreate) OnConflictColumns ¶
func (cc *CategoryCreate) OnConflictColumns(columns ...string) *CategoryUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Category.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*CategoryCreate) Save ¶
func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)
Save creates the Category in the database.
func (*CategoryCreate) SaveX ¶
func (cc *CategoryCreate) SaveX(ctx context.Context) *Category
SaveX calls Save and panics if Save returns an error.
func (*CategoryCreate) SetCreatedAt ¶
func (cc *CategoryCreate) SetCreatedAt(t time.Time) *CategoryCreate
SetCreatedAt sets the "created_at" field.
func (*CategoryCreate) SetName ¶
func (cc *CategoryCreate) SetName(s string) *CategoryCreate
SetName sets the "name" field.
func (*CategoryCreate) SetNillableCreatedAt ¶
func (cc *CategoryCreate) SetNillableCreatedAt(t *time.Time) *CategoryCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*CategoryCreate) SetNillableUpdatedAt ¶
func (cc *CategoryCreate) SetNillableUpdatedAt(t *time.Time) *CategoryCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*CategoryCreate) SetUpdatedAt ¶
func (cc *CategoryCreate) SetUpdatedAt(t time.Time) *CategoryCreate
SetUpdatedAt sets the "updated_at" field.
type CategoryCreateBulk ¶
type CategoryCreateBulk struct {
// contains filtered or unexported fields
}
CategoryCreateBulk is the builder for creating many Category entities in bulk.
func (*CategoryCreateBulk) Exec ¶
func (ccb *CategoryCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryCreateBulk) ExecX ¶
func (ccb *CategoryCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryCreateBulk) OnConflict ¶
func (ccb *CategoryCreateBulk) OnConflict(opts ...sql.ConflictOption) *CategoryUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Category.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.CategoryUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*CategoryCreateBulk) OnConflictColumns ¶
func (ccb *CategoryCreateBulk) OnConflictColumns(columns ...string) *CategoryUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Category.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type CategoryDelete ¶
type CategoryDelete struct {
// contains filtered or unexported fields
}
CategoryDelete is the builder for deleting a Category entity.
func (*CategoryDelete) Exec ¶
func (cd *CategoryDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CategoryDelete) ExecX ¶
func (cd *CategoryDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CategoryDelete) Where ¶
func (cd *CategoryDelete) Where(ps ...predicate.Category) *CategoryDelete
Where appends a list predicates to the CategoryDelete builder.
type CategoryDeleteOne ¶
type CategoryDeleteOne struct {
// contains filtered or unexported fields
}
CategoryDeleteOne is the builder for deleting a single Category entity.
func (*CategoryDeleteOne) Exec ¶
func (cdo *CategoryDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CategoryDeleteOne) ExecX ¶
func (cdo *CategoryDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryDeleteOne) Where ¶
func (cdo *CategoryDeleteOne) Where(ps ...predicate.Category) *CategoryDeleteOne
Where appends a list predicates to the CategoryDelete builder.
type CategoryEdges ¶
type CategoryEdges struct { // Products holds the value of the products edge. Products []*Product `json:"products,omitempty"` // contains filtered or unexported fields }
CategoryEdges holds the relations/edges for other nodes in the graph.
func (CategoryEdges) ProductsOrErr ¶
func (e CategoryEdges) ProductsOrErr() ([]*Product, error)
ProductsOrErr returns the Products value or an error if the edge was not loaded in eager-loading.
type CategoryGroupBy ¶
type CategoryGroupBy struct {
// contains filtered or unexported fields
}
CategoryGroupBy is the group-by builder for Category entities.
func (*CategoryGroupBy) Aggregate ¶
func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CategoryGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Scan ¶
func (cgb *CategoryGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CategoryGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CategoryMutation ¶
type CategoryMutation struct {
// contains filtered or unexported fields
}
CategoryMutation represents an operation that mutates the Category nodes in the graph.
func (*CategoryMutation) AddField ¶
func (m *CategoryMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*CategoryMutation) AddProductIDs ¶
func (m *CategoryMutation) AddProductIDs(ids ...int64)
AddProductIDs adds the "products" edge to the Product entity by ids.
func (*CategoryMutation) AddedEdges ¶
func (m *CategoryMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CategoryMutation) AddedField ¶
func (m *CategoryMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*CategoryMutation) AddedFields ¶
func (m *CategoryMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CategoryMutation) AddedIDs ¶
func (m *CategoryMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CategoryMutation) ClearEdge ¶
func (m *CategoryMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*CategoryMutation) ClearField ¶
func (m *CategoryMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*CategoryMutation) ClearProducts ¶
func (m *CategoryMutation) ClearProducts()
ClearProducts clears the "products" edge to the Product entity.
func (*CategoryMutation) ClearedEdges ¶
func (m *CategoryMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CategoryMutation) ClearedFields ¶
func (m *CategoryMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CategoryMutation) Client ¶
func (m CategoryMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*CategoryMutation) CreatedAt ¶
func (m *CategoryMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*CategoryMutation) EdgeCleared ¶
func (m *CategoryMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CategoryMutation) Field ¶
func (m *CategoryMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*CategoryMutation) FieldCleared ¶
func (m *CategoryMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CategoryMutation) Fields ¶
func (m *CategoryMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*CategoryMutation) ID ¶
func (m *CategoryMutation) ID() (id int64, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CategoryMutation) IDs ¶
func (m *CategoryMutation) IDs(ctx context.Context) ([]int64, 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 (*CategoryMutation) Name ¶
func (m *CategoryMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*CategoryMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*CategoryMutation) OldName ¶
func (m *CategoryMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CategoryMutation) ProductsCleared ¶
func (m *CategoryMutation) ProductsCleared() bool
ProductsCleared reports if the "products" edge to the Product entity was cleared.
func (*CategoryMutation) ProductsIDs ¶
func (m *CategoryMutation) ProductsIDs() (ids []int64)
ProductsIDs returns the "products" edge IDs in the mutation.
func (*CategoryMutation) RemoveProductIDs ¶
func (m *CategoryMutation) RemoveProductIDs(ids ...int64)
RemoveProductIDs removes the "products" edge to the Product entity by IDs.
func (*CategoryMutation) RemovedEdges ¶
func (m *CategoryMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CategoryMutation) RemovedIDs ¶
func (m *CategoryMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*CategoryMutation) RemovedProductsIDs ¶
func (m *CategoryMutation) RemovedProductsIDs() (ids []int64)
RemovedProducts returns the removed IDs of the "products" edge to the Product entity.
func (*CategoryMutation) ResetCreatedAt ¶
func (m *CategoryMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*CategoryMutation) ResetEdge ¶
func (m *CategoryMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*CategoryMutation) ResetField ¶
func (m *CategoryMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*CategoryMutation) ResetName ¶
func (m *CategoryMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*CategoryMutation) ResetProducts ¶
func (m *CategoryMutation) ResetProducts()
ResetProducts resets all changes to the "products" edge.
func (*CategoryMutation) ResetUpdatedAt ¶
func (m *CategoryMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*CategoryMutation) SetCreatedAt ¶
func (m *CategoryMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*CategoryMutation) SetField ¶
func (m *CategoryMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*CategoryMutation) SetName ¶
func (m *CategoryMutation) SetName(s string)
SetName sets the "name" field.
func (*CategoryMutation) SetOp ¶
func (m *CategoryMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CategoryMutation) SetUpdatedAt ¶
func (m *CategoryMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (CategoryMutation) Tx ¶
func (m CategoryMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CategoryMutation) Type ¶
func (m *CategoryMutation) Type() string
Type returns the node type of this mutation (Category).
func (*CategoryMutation) UpdatedAt ¶
func (m *CategoryMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*CategoryMutation) Where ¶
func (m *CategoryMutation) Where(ps ...predicate.Category)
Where appends a list predicates to the CategoryMutation builder.
func (*CategoryMutation) WhereP ¶
func (m *CategoryMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CategoryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CategoryQuery ¶
type CategoryQuery struct {
// contains filtered or unexported fields
}
CategoryQuery is the builder for querying Category entities.
func (*CategoryQuery) Aggregate ¶
func (cq *CategoryQuery) Aggregate(fns ...AggregateFunc) *CategorySelect
Aggregate returns a CategorySelect configured with the given aggregations.
func (*CategoryQuery) All ¶
func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)
All executes the query and returns a list of Categories.
func (*CategoryQuery) AllX ¶
func (cq *CategoryQuery) AllX(ctx context.Context) []*Category
AllX is like All, but panics if an error occurs.
func (*CategoryQuery) Clone ¶
func (cq *CategoryQuery) Clone() *CategoryQuery
Clone returns a duplicate of the CategoryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CategoryQuery) Count ¶
func (cq *CategoryQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CategoryQuery) CountX ¶
func (cq *CategoryQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CategoryQuery) Exist ¶
func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CategoryQuery) ExistX ¶
func (cq *CategoryQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CategoryQuery) First ¶
func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)
First returns the first Category entity from the query. Returns a *NotFoundError when no Category was found.
func (*CategoryQuery) FirstID ¶
func (cq *CategoryQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first Category ID from the query. Returns a *NotFoundError when no Category ID was found.
func (*CategoryQuery) FirstIDX ¶
func (cq *CategoryQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*CategoryQuery) FirstX ¶
func (cq *CategoryQuery) FirstX(ctx context.Context) *Category
FirstX is like First, but panics if an error occurs.
func (*CategoryQuery) GroupBy ¶
func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Category.Query(). GroupBy(category.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CategoryQuery) IDs ¶
func (cq *CategoryQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of Category IDs.
func (*CategoryQuery) IDsX ¶
func (cq *CategoryQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*CategoryQuery) Limit ¶
func (cq *CategoryQuery) Limit(limit int) *CategoryQuery
Limit the number of records to be returned by this query.
func (*CategoryQuery) Offset ¶
func (cq *CategoryQuery) Offset(offset int) *CategoryQuery
Offset to start from.
func (*CategoryQuery) Only ¶
func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)
Only returns a single Category entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Category entity is found. Returns a *NotFoundError when no Category entities are found.
func (*CategoryQuery) OnlyID ¶
func (cq *CategoryQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only Category ID in the query. Returns a *NotSingularError when more than one Category ID is found. Returns a *NotFoundError when no entities are found.
func (*CategoryQuery) OnlyIDX ¶
func (cq *CategoryQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CategoryQuery) OnlyX ¶
func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category
OnlyX is like Only, but panics if an error occurs.
func (*CategoryQuery) Order ¶
func (cq *CategoryQuery) Order(o ...category.OrderOption) *CategoryQuery
Order specifies how the records should be ordered.
func (*CategoryQuery) QueryProducts ¶
func (cq *CategoryQuery) QueryProducts() *ProductQuery
QueryProducts chains the current query on the "products" edge.
func (*CategoryQuery) Select ¶
func (cq *CategoryQuery) Select(fields ...string) *CategorySelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.Category.Query(). Select(category.FieldCreatedAt). Scan(ctx, &v)
func (*CategoryQuery) Unique ¶
func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*CategoryQuery) Where ¶
func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery
Where adds a new predicate for the CategoryQuery builder.
func (*CategoryQuery) WithProducts ¶
func (cq *CategoryQuery) WithProducts(opts ...func(*ProductQuery)) *CategoryQuery
WithProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge. The optional arguments are used to configure the query builder of the edge.
type CategorySelect ¶
type CategorySelect struct { *CategoryQuery // contains filtered or unexported fields }
CategorySelect is the builder for selecting fields of Category entities.
func (*CategorySelect) Aggregate ¶
func (cs *CategorySelect) Aggregate(fns ...AggregateFunc) *CategorySelect
Aggregate adds the given aggregation functions to the selector query.
func (*CategorySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Scan ¶
func (cs *CategorySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CategorySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CategoryUpdate ¶
type CategoryUpdate struct {
// contains filtered or unexported fields
}
CategoryUpdate is the builder for updating Category entities.
func (*CategoryUpdate) AddProductIDs ¶
func (cu *CategoryUpdate) AddProductIDs(ids ...int64) *CategoryUpdate
AddProductIDs adds the "products" edge to the Product entity by IDs.
func (*CategoryUpdate) AddProducts ¶
func (cu *CategoryUpdate) AddProducts(p ...*Product) *CategoryUpdate
AddProducts adds the "products" edges to the Product entity.
func (*CategoryUpdate) ClearProducts ¶
func (cu *CategoryUpdate) ClearProducts() *CategoryUpdate
ClearProducts clears all "products" edges to the Product entity.
func (*CategoryUpdate) Exec ¶
func (cu *CategoryUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryUpdate) ExecX ¶
func (cu *CategoryUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryUpdate) Mutation ¶
func (cu *CategoryUpdate) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryUpdate) RemoveProductIDs ¶
func (cu *CategoryUpdate) RemoveProductIDs(ids ...int64) *CategoryUpdate
RemoveProductIDs removes the "products" edge to Product entities by IDs.
func (*CategoryUpdate) RemoveProducts ¶
func (cu *CategoryUpdate) RemoveProducts(p ...*Product) *CategoryUpdate
RemoveProducts removes "products" edges to Product entities.
func (*CategoryUpdate) Save ¶
func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CategoryUpdate) SaveX ¶
func (cu *CategoryUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CategoryUpdate) SetName ¶
func (cu *CategoryUpdate) SetName(s string) *CategoryUpdate
SetName sets the "name" field.
func (*CategoryUpdate) SetNillableName ¶
func (cu *CategoryUpdate) SetNillableName(s *string) *CategoryUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*CategoryUpdate) SetUpdatedAt ¶
func (cu *CategoryUpdate) SetUpdatedAt(t time.Time) *CategoryUpdate
SetUpdatedAt sets the "updated_at" field.
func (*CategoryUpdate) Where ¶
func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate
Where appends a list predicates to the CategoryUpdate builder.
type CategoryUpdateOne ¶
type CategoryUpdateOne struct {
// contains filtered or unexported fields
}
CategoryUpdateOne is the builder for updating a single Category entity.
func (*CategoryUpdateOne) AddProductIDs ¶
func (cuo *CategoryUpdateOne) AddProductIDs(ids ...int64) *CategoryUpdateOne
AddProductIDs adds the "products" edge to the Product entity by IDs.
func (*CategoryUpdateOne) AddProducts ¶
func (cuo *CategoryUpdateOne) AddProducts(p ...*Product) *CategoryUpdateOne
AddProducts adds the "products" edges to the Product entity.
func (*CategoryUpdateOne) ClearProducts ¶
func (cuo *CategoryUpdateOne) ClearProducts() *CategoryUpdateOne
ClearProducts clears all "products" edges to the Product entity.
func (*CategoryUpdateOne) Exec ¶
func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CategoryUpdateOne) ExecX ¶
func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryUpdateOne) Mutation ¶
func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
func (*CategoryUpdateOne) RemoveProductIDs ¶
func (cuo *CategoryUpdateOne) RemoveProductIDs(ids ...int64) *CategoryUpdateOne
RemoveProductIDs removes the "products" edge to Product entities by IDs.
func (*CategoryUpdateOne) RemoveProducts ¶
func (cuo *CategoryUpdateOne) RemoveProducts(p ...*Product) *CategoryUpdateOne
RemoveProducts removes "products" edges to Product entities.
func (*CategoryUpdateOne) Save ¶
func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)
Save executes the query and returns the updated Category entity.
func (*CategoryUpdateOne) SaveX ¶
func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category
SaveX is like Save, but panics if an error occurs.
func (*CategoryUpdateOne) Select ¶
func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CategoryUpdateOne) SetName ¶
func (cuo *CategoryUpdateOne) SetName(s string) *CategoryUpdateOne
SetName sets the "name" field.
func (*CategoryUpdateOne) SetNillableName ¶
func (cuo *CategoryUpdateOne) SetNillableName(s *string) *CategoryUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*CategoryUpdateOne) SetUpdatedAt ¶
func (cuo *CategoryUpdateOne) SetUpdatedAt(t time.Time) *CategoryUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*CategoryUpdateOne) Where ¶
func (cuo *CategoryUpdateOne) Where(ps ...predicate.Category) *CategoryUpdateOne
Where appends a list predicates to the CategoryUpdate builder.
type CategoryUpsert ¶
CategoryUpsert is the "OnConflict" setter.
func (*CategoryUpsert) SetName ¶
func (u *CategoryUpsert) SetName(v string) *CategoryUpsert
SetName sets the "name" field.
func (*CategoryUpsert) SetUpdatedAt ¶
func (u *CategoryUpsert) SetUpdatedAt(v time.Time) *CategoryUpsert
SetUpdatedAt sets the "updated_at" field.
func (*CategoryUpsert) UpdateName ¶
func (u *CategoryUpsert) UpdateName() *CategoryUpsert
UpdateName sets the "name" field to the value that was provided on create.
func (*CategoryUpsert) UpdateUpdatedAt ¶
func (u *CategoryUpsert) UpdateUpdatedAt() *CategoryUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type CategoryUpsertBulk ¶
type CategoryUpsertBulk struct {
// contains filtered or unexported fields
}
CategoryUpsertBulk is the builder for "upsert"-ing a bulk of Category nodes.
func (*CategoryUpsertBulk) DoNothing ¶
func (u *CategoryUpsertBulk) DoNothing() *CategoryUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*CategoryUpsertBulk) Exec ¶
func (u *CategoryUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryUpsertBulk) ExecX ¶
func (u *CategoryUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryUpsertBulk) Ignore ¶
func (u *CategoryUpsertBulk) Ignore() *CategoryUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Category.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*CategoryUpsertBulk) SetName ¶
func (u *CategoryUpsertBulk) SetName(v string) *CategoryUpsertBulk
SetName sets the "name" field.
func (*CategoryUpsertBulk) SetUpdatedAt ¶
func (u *CategoryUpsertBulk) SetUpdatedAt(v time.Time) *CategoryUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*CategoryUpsertBulk) Update ¶
func (u *CategoryUpsertBulk) Update(set func(*CategoryUpsert)) *CategoryUpsertBulk
Update allows overriding fields `UPDATE` values. See the CategoryCreateBulk.OnConflict documentation for more info.
func (*CategoryUpsertBulk) UpdateName ¶
func (u *CategoryUpsertBulk) UpdateName() *CategoryUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*CategoryUpsertBulk) UpdateNewValues ¶
func (u *CategoryUpsertBulk) UpdateNewValues() *CategoryUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Category.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*CategoryUpsertBulk) UpdateUpdatedAt ¶
func (u *CategoryUpsertBulk) UpdateUpdatedAt() *CategoryUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type CategoryUpsertOne ¶
type CategoryUpsertOne struct {
// contains filtered or unexported fields
}
CategoryUpsertOne is the builder for "upsert"-ing
one Category node.
func (*CategoryUpsertOne) DoNothing ¶
func (u *CategoryUpsertOne) DoNothing() *CategoryUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*CategoryUpsertOne) Exec ¶
func (u *CategoryUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoryUpsertOne) ExecX ¶
func (u *CategoryUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoryUpsertOne) ID ¶
func (u *CategoryUpsertOne) ID(ctx context.Context) (id int64, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*CategoryUpsertOne) IDX ¶
func (u *CategoryUpsertOne) IDX(ctx context.Context) int64
IDX is like ID, but panics if an error occurs.
func (*CategoryUpsertOne) Ignore ¶
func (u *CategoryUpsertOne) Ignore() *CategoryUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Category.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*CategoryUpsertOne) SetName ¶
func (u *CategoryUpsertOne) SetName(v string) *CategoryUpsertOne
SetName sets the "name" field.
func (*CategoryUpsertOne) SetUpdatedAt ¶
func (u *CategoryUpsertOne) SetUpdatedAt(v time.Time) *CategoryUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*CategoryUpsertOne) Update ¶
func (u *CategoryUpsertOne) Update(set func(*CategoryUpsert)) *CategoryUpsertOne
Update allows overriding fields `UPDATE` values. See the CategoryCreate.OnConflict documentation for more info.
func (*CategoryUpsertOne) UpdateName ¶
func (u *CategoryUpsertOne) UpdateName() *CategoryUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*CategoryUpsertOne) UpdateNewValues ¶
func (u *CategoryUpsertOne) UpdateNewValues() *CategoryUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Category.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*CategoryUpsertOne) UpdateUpdatedAt ¶
func (u *CategoryUpsertOne) UpdateUpdatedAt() *CategoryUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Address is the client for interacting with the Address builders. Address *AddressClient // Cart is the client for interacting with the Cart builders. Cart *CartClient // Category is the client for interacting with the Category builders. Category *CategoryClient // Order is the client for interacting with the Order builders. Order *OrderClient // OrderProduct is the client for interacting with the OrderProduct builders. OrderProduct *OrderProductClient // Product is the client for interacting with the Product builders. Product *ProductClient // ProductImage is the client for interacting with the ProductImage builders. ProductImage *ProductImageClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Address. 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(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(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 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 InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type 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 Order ¶
type Order struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // UserID holds the value of the "user_id" field. UserID int64 `json:"user_id,omitempty"` // Status holds the value of the "status" field. Status order.Status `json:"status,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the OrderQuery when eager-loading is set. Edges OrderEdges `json:"edges"` // contains filtered or unexported fields }
Order is the model entity for the Order schema.
func (*Order) QueryOrderProducts ¶
func (o *Order) QueryOrderProducts() *OrderProductQuery
QueryOrderProducts queries the "order_products" edge of the Order entity.
func (*Order) QueryUsers ¶
QueryUsers queries the "users" edge of the Order entity.
func (*Order) Unwrap ¶
Unwrap unwraps the Order 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 (*Order) Update ¶
func (o *Order) Update() *OrderUpdateOne
Update returns a builder for updating this Order. Note that you need to call Order.Unwrap() before calling this method if this Order was returned from a transaction, and the transaction was committed or rolled back.
type OrderClient ¶
type OrderClient struct {
// contains filtered or unexported fields
}
OrderClient is a client for the Order schema.
func NewOrderClient ¶
func NewOrderClient(c config) *OrderClient
NewOrderClient returns a client for the Order from the given config.
func (*OrderClient) Create ¶
func (c *OrderClient) Create() *OrderCreate
Create returns a builder for creating a Order entity.
func (*OrderClient) CreateBulk ¶
func (c *OrderClient) CreateBulk(builders ...*OrderCreate) *OrderCreateBulk
CreateBulk returns a builder for creating a bulk of Order entities.
func (*OrderClient) Delete ¶
func (c *OrderClient) Delete() *OrderDelete
Delete returns a delete builder for Order.
func (*OrderClient) DeleteOne ¶
func (c *OrderClient) DeleteOne(o *Order) *OrderDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*OrderClient) DeleteOneID ¶
func (c *OrderClient) DeleteOneID(id int64) *OrderDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*OrderClient) GetX ¶
func (c *OrderClient) GetX(ctx context.Context, id int64) *Order
GetX is like Get, but panics if an error occurs.
func (*OrderClient) Intercept ¶
func (c *OrderClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `order.Intercept(f(g(h())))`.
func (*OrderClient) Interceptors ¶
func (c *OrderClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*OrderClient) MapCreateBulk ¶
func (c *OrderClient) MapCreateBulk(slice any, setFunc func(*OrderCreate, int)) *OrderCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*OrderClient) Query ¶
func (c *OrderClient) Query() *OrderQuery
Query returns a query builder for Order.
func (*OrderClient) QueryOrderProducts ¶
func (c *OrderClient) QueryOrderProducts(o *Order) *OrderProductQuery
QueryOrderProducts queries the order_products edge of a Order.
func (*OrderClient) QueryUsers ¶
func (c *OrderClient) QueryUsers(o *Order) *UserQuery
QueryUsers queries the users edge of a Order.
func (*OrderClient) Update ¶
func (c *OrderClient) Update() *OrderUpdate
Update returns an update builder for Order.
func (*OrderClient) UpdateOne ¶
func (c *OrderClient) UpdateOne(o *Order) *OrderUpdateOne
UpdateOne returns an update builder for the given entity.
func (*OrderClient) UpdateOneID ¶
func (c *OrderClient) UpdateOneID(id int64) *OrderUpdateOne
UpdateOneID returns an update builder for the given id.
func (*OrderClient) Use ¶
func (c *OrderClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `order.Hooks(f(g(h())))`.
type OrderCreate ¶
type OrderCreate struct {
// contains filtered or unexported fields
}
OrderCreate is the builder for creating a Order entity.
func (*OrderCreate) AddOrderProductIDs ¶
func (oc *OrderCreate) AddOrderProductIDs(ids ...int64) *OrderCreate
AddOrderProductIDs adds the "order_products" edge to the OrderProduct entity by IDs.
func (*OrderCreate) AddOrderProducts ¶
func (oc *OrderCreate) AddOrderProducts(o ...*OrderProduct) *OrderCreate
AddOrderProducts adds the "order_products" edges to the OrderProduct entity.
func (*OrderCreate) Exec ¶
func (oc *OrderCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*OrderCreate) ExecX ¶
func (oc *OrderCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderCreate) Mutation ¶
func (oc *OrderCreate) Mutation() *OrderMutation
Mutation returns the OrderMutation object of the builder.
func (*OrderCreate) OnConflict ¶
func (oc *OrderCreate) OnConflict(opts ...sql.ConflictOption) *OrderUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Order.Create(). SetCreatedAt(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.OrderUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*OrderCreate) OnConflictColumns ¶
func (oc *OrderCreate) OnConflictColumns(columns ...string) *OrderUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Order.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*OrderCreate) Save ¶
func (oc *OrderCreate) Save(ctx context.Context) (*Order, error)
Save creates the Order in the database.
func (*OrderCreate) SaveX ¶
func (oc *OrderCreate) SaveX(ctx context.Context) *Order
SaveX calls Save and panics if Save returns an error.
func (*OrderCreate) SetCreatedAt ¶
func (oc *OrderCreate) SetCreatedAt(t time.Time) *OrderCreate
SetCreatedAt sets the "created_at" field.
func (*OrderCreate) SetNillableCreatedAt ¶
func (oc *OrderCreate) SetNillableCreatedAt(t *time.Time) *OrderCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*OrderCreate) SetNillableStatus ¶
func (oc *OrderCreate) SetNillableStatus(o *order.Status) *OrderCreate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*OrderCreate) SetNillableUpdatedAt ¶
func (oc *OrderCreate) SetNillableUpdatedAt(t *time.Time) *OrderCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*OrderCreate) SetStatus ¶
func (oc *OrderCreate) SetStatus(o order.Status) *OrderCreate
SetStatus sets the "status" field.
func (*OrderCreate) SetUpdatedAt ¶
func (oc *OrderCreate) SetUpdatedAt(t time.Time) *OrderCreate
SetUpdatedAt sets the "updated_at" field.
func (*OrderCreate) SetUserID ¶
func (oc *OrderCreate) SetUserID(i int64) *OrderCreate
SetUserID sets the "user_id" field.
func (*OrderCreate) SetUsers ¶
func (oc *OrderCreate) SetUsers(u *User) *OrderCreate
SetUsers sets the "users" edge to the User entity.
func (*OrderCreate) SetUsersID ¶
func (oc *OrderCreate) SetUsersID(id int64) *OrderCreate
SetUsersID sets the "users" edge to the User entity by ID.
type OrderCreateBulk ¶
type OrderCreateBulk struct {
// contains filtered or unexported fields
}
OrderCreateBulk is the builder for creating many Order entities in bulk.
func (*OrderCreateBulk) Exec ¶
func (ocb *OrderCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*OrderCreateBulk) ExecX ¶
func (ocb *OrderCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderCreateBulk) OnConflict ¶
func (ocb *OrderCreateBulk) OnConflict(opts ...sql.ConflictOption) *OrderUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Order.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.OrderUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*OrderCreateBulk) OnConflictColumns ¶
func (ocb *OrderCreateBulk) OnConflictColumns(columns ...string) *OrderUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Order.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type OrderDelete ¶
type OrderDelete struct {
// contains filtered or unexported fields
}
OrderDelete is the builder for deleting a Order entity.
func (*OrderDelete) Exec ¶
func (od *OrderDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*OrderDelete) ExecX ¶
func (od *OrderDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*OrderDelete) Where ¶
func (od *OrderDelete) Where(ps ...predicate.Order) *OrderDelete
Where appends a list predicates to the OrderDelete builder.
type OrderDeleteOne ¶
type OrderDeleteOne struct {
// contains filtered or unexported fields
}
OrderDeleteOne is the builder for deleting a single Order entity.
func (*OrderDeleteOne) Exec ¶
func (odo *OrderDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*OrderDeleteOne) ExecX ¶
func (odo *OrderDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderDeleteOne) Where ¶
func (odo *OrderDeleteOne) Where(ps ...predicate.Order) *OrderDeleteOne
Where appends a list predicates to the OrderDelete builder.
type OrderEdges ¶
type OrderEdges struct { // Users holds the value of the users edge. Users *User `json:"users,omitempty"` // OrderProducts holds the value of the order_products edge. OrderProducts []*OrderProduct `json:"order_products,omitempty"` // contains filtered or unexported fields }
OrderEdges holds the relations/edges for other nodes in the graph.
func (OrderEdges) OrderProductsOrErr ¶
func (e OrderEdges) OrderProductsOrErr() ([]*OrderProduct, error)
OrderProductsOrErr returns the OrderProducts value or an error if the edge was not loaded in eager-loading.
func (OrderEdges) UsersOrErr ¶
func (e OrderEdges) UsersOrErr() (*User, error)
UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type OrderGroupBy ¶
type OrderGroupBy struct {
// contains filtered or unexported fields
}
OrderGroupBy is the group-by builder for Order entities.
func (*OrderGroupBy) Aggregate ¶
func (ogb *OrderGroupBy) Aggregate(fns ...AggregateFunc) *OrderGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*OrderGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrderGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrderGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrderGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrderGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrderGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrderGroupBy) Scan ¶
func (ogb *OrderGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OrderGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrderMutation ¶
type OrderMutation struct {
// contains filtered or unexported fields
}
OrderMutation represents an operation that mutates the Order nodes in the graph.
func (*OrderMutation) AddField ¶
func (m *OrderMutation) 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 (*OrderMutation) AddOrderProductIDs ¶
func (m *OrderMutation) AddOrderProductIDs(ids ...int64)
AddOrderProductIDs adds the "order_products" edge to the OrderProduct entity by ids.
func (*OrderMutation) AddedEdges ¶
func (m *OrderMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*OrderMutation) AddedField ¶
func (m *OrderMutation) 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 (*OrderMutation) AddedFields ¶
func (m *OrderMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*OrderMutation) AddedIDs ¶
func (m *OrderMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*OrderMutation) ClearEdge ¶
func (m *OrderMutation) 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 (*OrderMutation) ClearField ¶
func (m *OrderMutation) 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 (*OrderMutation) ClearOrderProducts ¶
func (m *OrderMutation) ClearOrderProducts()
ClearOrderProducts clears the "order_products" edge to the OrderProduct entity.
func (*OrderMutation) ClearUsers ¶
func (m *OrderMutation) ClearUsers()
ClearUsers clears the "users" edge to the User entity.
func (*OrderMutation) ClearedEdges ¶
func (m *OrderMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*OrderMutation) ClearedFields ¶
func (m *OrderMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (OrderMutation) Client ¶
func (m OrderMutation) 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 (*OrderMutation) CreatedAt ¶
func (m *OrderMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*OrderMutation) EdgeCleared ¶
func (m *OrderMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*OrderMutation) Field ¶
func (m *OrderMutation) 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 (*OrderMutation) FieldCleared ¶
func (m *OrderMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*OrderMutation) Fields ¶
func (m *OrderMutation) 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 (*OrderMutation) ID ¶
func (m *OrderMutation) ID() (id int64, 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 (*OrderMutation) IDs ¶
func (m *OrderMutation) IDs(ctx context.Context) ([]int64, 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 (*OrderMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Order entity. If the Order 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 (*OrderMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*OrderMutation) OldStatus ¶
OldStatus returns the old "status" field's value of the Order entity. If the Order 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 (*OrderMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Order entity. If the Order 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 (*OrderMutation) OldUserID ¶
func (m *OrderMutation) OldUserID(ctx context.Context) (v int64, err error)
OldUserID returns the old "user_id" field's value of the Order entity. If the Order 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 (*OrderMutation) OrderProductsCleared ¶
func (m *OrderMutation) OrderProductsCleared() bool
OrderProductsCleared reports if the "order_products" edge to the OrderProduct entity was cleared.
func (*OrderMutation) OrderProductsIDs ¶
func (m *OrderMutation) OrderProductsIDs() (ids []int64)
OrderProductsIDs returns the "order_products" edge IDs in the mutation.
func (*OrderMutation) RemoveOrderProductIDs ¶
func (m *OrderMutation) RemoveOrderProductIDs(ids ...int64)
RemoveOrderProductIDs removes the "order_products" edge to the OrderProduct entity by IDs.
func (*OrderMutation) RemovedEdges ¶
func (m *OrderMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*OrderMutation) RemovedIDs ¶
func (m *OrderMutation) 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 (*OrderMutation) RemovedOrderProductsIDs ¶
func (m *OrderMutation) RemovedOrderProductsIDs() (ids []int64)
RemovedOrderProducts returns the removed IDs of the "order_products" edge to the OrderProduct entity.
func (*OrderMutation) ResetCreatedAt ¶
func (m *OrderMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*OrderMutation) ResetEdge ¶
func (m *OrderMutation) 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 (*OrderMutation) ResetField ¶
func (m *OrderMutation) 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 (*OrderMutation) ResetOrderProducts ¶
func (m *OrderMutation) ResetOrderProducts()
ResetOrderProducts resets all changes to the "order_products" edge.
func (*OrderMutation) ResetStatus ¶
func (m *OrderMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*OrderMutation) ResetUpdatedAt ¶
func (m *OrderMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*OrderMutation) ResetUserID ¶
func (m *OrderMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*OrderMutation) ResetUsers ¶
func (m *OrderMutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*OrderMutation) SetCreatedAt ¶
func (m *OrderMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*OrderMutation) SetField ¶
func (m *OrderMutation) 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 (*OrderMutation) SetOp ¶
func (m *OrderMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*OrderMutation) SetStatus ¶
func (m *OrderMutation) SetStatus(o order.Status)
SetStatus sets the "status" field.
func (*OrderMutation) SetUpdatedAt ¶
func (m *OrderMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*OrderMutation) SetUserID ¶
func (m *OrderMutation) SetUserID(i int64)
SetUserID sets the "user_id" field.
func (*OrderMutation) SetUsersID ¶
func (m *OrderMutation) SetUsersID(id int64)
SetUsersID sets the "users" edge to the User entity by id.
func (*OrderMutation) Status ¶
func (m *OrderMutation) Status() (r order.Status, exists bool)
Status returns the value of the "status" field in the mutation.
func (OrderMutation) Tx ¶
func (m OrderMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*OrderMutation) Type ¶
func (m *OrderMutation) Type() string
Type returns the node type of this mutation (Order).
func (*OrderMutation) UpdatedAt ¶
func (m *OrderMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*OrderMutation) UserID ¶
func (m *OrderMutation) UserID() (r int64, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*OrderMutation) UsersCleared ¶
func (m *OrderMutation) UsersCleared() bool
UsersCleared reports if the "users" edge to the User entity was cleared.
func (*OrderMutation) UsersID ¶
func (m *OrderMutation) UsersID() (id int64, exists bool)
UsersID returns the "users" edge ID in the mutation.
func (*OrderMutation) UsersIDs ¶
func (m *OrderMutation) UsersIDs() (ids []int64)
UsersIDs returns the "users" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UsersID instead. It exists only for internal usage by the builders.
func (*OrderMutation) Where ¶
func (m *OrderMutation) Where(ps ...predicate.Order)
Where appends a list predicates to the OrderMutation builder.
func (*OrderMutation) WhereP ¶
func (m *OrderMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the OrderMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type OrderProduct ¶
type OrderProduct struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // OrderID holds the value of the "order_id" field. OrderID int64 `json:"order_id,omitempty"` // ProductID holds the value of the "product_id" field. ProductID int64 `json:"product_id,omitempty"` // Amount holds the value of the "amount" field. Amount int64 `json:"amount,omitempty"` // Price holds the value of the "price" field. Price int64 `json:"price,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the OrderProductQuery when eager-loading is set. Edges OrderProductEdges `json:"edges"` // contains filtered or unexported fields }
OrderProduct is the model entity for the OrderProduct schema.
func (*OrderProduct) QueryOrders ¶
func (op *OrderProduct) QueryOrders() *OrderQuery
QueryOrders queries the "orders" edge of the OrderProduct entity.
func (*OrderProduct) QueryProducts ¶
func (op *OrderProduct) QueryProducts() *ProductQuery
QueryProducts queries the "products" edge of the OrderProduct entity.
func (*OrderProduct) String ¶
func (op *OrderProduct) String() string
String implements the fmt.Stringer.
func (*OrderProduct) Unwrap ¶
func (op *OrderProduct) Unwrap() *OrderProduct
Unwrap unwraps the OrderProduct 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 (*OrderProduct) Update ¶
func (op *OrderProduct) Update() *OrderProductUpdateOne
Update returns a builder for updating this OrderProduct. Note that you need to call OrderProduct.Unwrap() before calling this method if this OrderProduct was returned from a transaction, and the transaction was committed or rolled back.
type OrderProductClient ¶
type OrderProductClient struct {
// contains filtered or unexported fields
}
OrderProductClient is a client for the OrderProduct schema.
func NewOrderProductClient ¶
func NewOrderProductClient(c config) *OrderProductClient
NewOrderProductClient returns a client for the OrderProduct from the given config.
func (*OrderProductClient) Create ¶
func (c *OrderProductClient) Create() *OrderProductCreate
Create returns a builder for creating a OrderProduct entity.
func (*OrderProductClient) CreateBulk ¶
func (c *OrderProductClient) CreateBulk(builders ...*OrderProductCreate) *OrderProductCreateBulk
CreateBulk returns a builder for creating a bulk of OrderProduct entities.
func (*OrderProductClient) Delete ¶
func (c *OrderProductClient) Delete() *OrderProductDelete
Delete returns a delete builder for OrderProduct.
func (*OrderProductClient) DeleteOne ¶
func (c *OrderProductClient) DeleteOne(op *OrderProduct) *OrderProductDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*OrderProductClient) DeleteOneID ¶
func (c *OrderProductClient) DeleteOneID(id int64) *OrderProductDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*OrderProductClient) Get ¶
func (c *OrderProductClient) Get(ctx context.Context, id int64) (*OrderProduct, error)
Get returns a OrderProduct entity by its id.
func (*OrderProductClient) GetX ¶
func (c *OrderProductClient) GetX(ctx context.Context, id int64) *OrderProduct
GetX is like Get, but panics if an error occurs.
func (*OrderProductClient) Hooks ¶
func (c *OrderProductClient) Hooks() []Hook
Hooks returns the client hooks.
func (*OrderProductClient) Intercept ¶
func (c *OrderProductClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `orderproduct.Intercept(f(g(h())))`.
func (*OrderProductClient) Interceptors ¶
func (c *OrderProductClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*OrderProductClient) MapCreateBulk ¶
func (c *OrderProductClient) MapCreateBulk(slice any, setFunc func(*OrderProductCreate, int)) *OrderProductCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*OrderProductClient) Query ¶
func (c *OrderProductClient) Query() *OrderProductQuery
Query returns a query builder for OrderProduct.
func (*OrderProductClient) QueryOrders ¶
func (c *OrderProductClient) QueryOrders(op *OrderProduct) *OrderQuery
QueryOrders queries the orders edge of a OrderProduct.
func (*OrderProductClient) QueryProducts ¶
func (c *OrderProductClient) QueryProducts(op *OrderProduct) *ProductQuery
QueryProducts queries the products edge of a OrderProduct.
func (*OrderProductClient) Update ¶
func (c *OrderProductClient) Update() *OrderProductUpdate
Update returns an update builder for OrderProduct.
func (*OrderProductClient) UpdateOne ¶
func (c *OrderProductClient) UpdateOne(op *OrderProduct) *OrderProductUpdateOne
UpdateOne returns an update builder for the given entity.
func (*OrderProductClient) UpdateOneID ¶
func (c *OrderProductClient) UpdateOneID(id int64) *OrderProductUpdateOne
UpdateOneID returns an update builder for the given id.
func (*OrderProductClient) Use ¶
func (c *OrderProductClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `orderproduct.Hooks(f(g(h())))`.
type OrderProductCreate ¶
type OrderProductCreate struct {
// contains filtered or unexported fields
}
OrderProductCreate is the builder for creating a OrderProduct entity.
func (*OrderProductCreate) Exec ¶
func (opc *OrderProductCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*OrderProductCreate) ExecX ¶
func (opc *OrderProductCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderProductCreate) Mutation ¶
func (opc *OrderProductCreate) Mutation() *OrderProductMutation
Mutation returns the OrderProductMutation object of the builder.
func (*OrderProductCreate) OnConflict ¶
func (opc *OrderProductCreate) OnConflict(opts ...sql.ConflictOption) *OrderProductUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.OrderProduct.Create(). SetCreatedAt(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.OrderProductUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*OrderProductCreate) OnConflictColumns ¶
func (opc *OrderProductCreate) OnConflictColumns(columns ...string) *OrderProductUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.OrderProduct.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*OrderProductCreate) Save ¶
func (opc *OrderProductCreate) Save(ctx context.Context) (*OrderProduct, error)
Save creates the OrderProduct in the database.
func (*OrderProductCreate) SaveX ¶
func (opc *OrderProductCreate) SaveX(ctx context.Context) *OrderProduct
SaveX calls Save and panics if Save returns an error.
func (*OrderProductCreate) SetAmount ¶
func (opc *OrderProductCreate) SetAmount(i int64) *OrderProductCreate
SetAmount sets the "amount" field.
func (*OrderProductCreate) SetCreatedAt ¶
func (opc *OrderProductCreate) SetCreatedAt(t time.Time) *OrderProductCreate
SetCreatedAt sets the "created_at" field.
func (*OrderProductCreate) SetNillableAmount ¶
func (opc *OrderProductCreate) SetNillableAmount(i *int64) *OrderProductCreate
SetNillableAmount sets the "amount" field if the given value is not nil.
func (*OrderProductCreate) SetNillableCreatedAt ¶
func (opc *OrderProductCreate) SetNillableCreatedAt(t *time.Time) *OrderProductCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*OrderProductCreate) SetNillableUpdatedAt ¶
func (opc *OrderProductCreate) SetNillableUpdatedAt(t *time.Time) *OrderProductCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*OrderProductCreate) SetOrderID ¶
func (opc *OrderProductCreate) SetOrderID(i int64) *OrderProductCreate
SetOrderID sets the "order_id" field.
func (*OrderProductCreate) SetOrders ¶
func (opc *OrderProductCreate) SetOrders(o *Order) *OrderProductCreate
SetOrders sets the "orders" edge to the Order entity.
func (*OrderProductCreate) SetOrdersID ¶
func (opc *OrderProductCreate) SetOrdersID(id int64) *OrderProductCreate
SetOrdersID sets the "orders" edge to the Order entity by ID.
func (*OrderProductCreate) SetPrice ¶
func (opc *OrderProductCreate) SetPrice(i int64) *OrderProductCreate
SetPrice sets the "price" field.
func (*OrderProductCreate) SetProductID ¶
func (opc *OrderProductCreate) SetProductID(i int64) *OrderProductCreate
SetProductID sets the "product_id" field.
func (*OrderProductCreate) SetProducts ¶
func (opc *OrderProductCreate) SetProducts(p *Product) *OrderProductCreate
SetProducts sets the "products" edge to the Product entity.
func (*OrderProductCreate) SetProductsID ¶
func (opc *OrderProductCreate) SetProductsID(id int64) *OrderProductCreate
SetProductsID sets the "products" edge to the Product entity by ID.
func (*OrderProductCreate) SetUpdatedAt ¶
func (opc *OrderProductCreate) SetUpdatedAt(t time.Time) *OrderProductCreate
SetUpdatedAt sets the "updated_at" field.
type OrderProductCreateBulk ¶
type OrderProductCreateBulk struct {
// contains filtered or unexported fields
}
OrderProductCreateBulk is the builder for creating many OrderProduct entities in bulk.
func (*OrderProductCreateBulk) Exec ¶
func (opcb *OrderProductCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*OrderProductCreateBulk) ExecX ¶
func (opcb *OrderProductCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderProductCreateBulk) OnConflict ¶
func (opcb *OrderProductCreateBulk) OnConflict(opts ...sql.ConflictOption) *OrderProductUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.OrderProduct.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.OrderProductUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*OrderProductCreateBulk) OnConflictColumns ¶
func (opcb *OrderProductCreateBulk) OnConflictColumns(columns ...string) *OrderProductUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.OrderProduct.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*OrderProductCreateBulk) Save ¶
func (opcb *OrderProductCreateBulk) Save(ctx context.Context) ([]*OrderProduct, error)
Save creates the OrderProduct entities in the database.
func (*OrderProductCreateBulk) SaveX ¶
func (opcb *OrderProductCreateBulk) SaveX(ctx context.Context) []*OrderProduct
SaveX is like Save, but panics if an error occurs.
type OrderProductDelete ¶
type OrderProductDelete struct {
// contains filtered or unexported fields
}
OrderProductDelete is the builder for deleting a OrderProduct entity.
func (*OrderProductDelete) Exec ¶
func (opd *OrderProductDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*OrderProductDelete) ExecX ¶
func (opd *OrderProductDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*OrderProductDelete) Where ¶
func (opd *OrderProductDelete) Where(ps ...predicate.OrderProduct) *OrderProductDelete
Where appends a list predicates to the OrderProductDelete builder.
type OrderProductDeleteOne ¶
type OrderProductDeleteOne struct {
// contains filtered or unexported fields
}
OrderProductDeleteOne is the builder for deleting a single OrderProduct entity.
func (*OrderProductDeleteOne) Exec ¶
func (opdo *OrderProductDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*OrderProductDeleteOne) ExecX ¶
func (opdo *OrderProductDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderProductDeleteOne) Where ¶
func (opdo *OrderProductDeleteOne) Where(ps ...predicate.OrderProduct) *OrderProductDeleteOne
Where appends a list predicates to the OrderProductDelete builder.
type OrderProductEdges ¶
type OrderProductEdges struct { // Orders holds the value of the orders edge. Orders *Order `json:"orders,omitempty"` // Products holds the value of the products edge. Products *Product `json:"products,omitempty"` // contains filtered or unexported fields }
OrderProductEdges holds the relations/edges for other nodes in the graph.
func (OrderProductEdges) OrdersOrErr ¶
func (e OrderProductEdges) OrdersOrErr() (*Order, error)
OrdersOrErr returns the Orders value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (OrderProductEdges) ProductsOrErr ¶
func (e OrderProductEdges) ProductsOrErr() (*Product, error)
ProductsOrErr returns the Products value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type OrderProductGroupBy ¶
type OrderProductGroupBy struct {
// contains filtered or unexported fields
}
OrderProductGroupBy is the group-by builder for OrderProduct entities.
func (*OrderProductGroupBy) Aggregate ¶
func (opgb *OrderProductGroupBy) Aggregate(fns ...AggregateFunc) *OrderProductGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*OrderProductGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrderProductGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrderProductGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrderProductGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrderProductGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrderProductGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrderProductGroupBy) Scan ¶
func (opgb *OrderProductGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OrderProductGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrderProductMutation ¶
type OrderProductMutation struct {
// contains filtered or unexported fields
}
OrderProductMutation represents an operation that mutates the OrderProduct nodes in the graph.
func (*OrderProductMutation) AddAmount ¶
func (m *OrderProductMutation) AddAmount(i int64)
AddAmount adds i to the "amount" field.
func (*OrderProductMutation) AddField ¶
func (m *OrderProductMutation) 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 (*OrderProductMutation) AddPrice ¶
func (m *OrderProductMutation) AddPrice(i int64)
AddPrice adds i to the "price" field.
func (*OrderProductMutation) AddedAmount ¶
func (m *OrderProductMutation) AddedAmount() (r int64, exists bool)
AddedAmount returns the value that was added to the "amount" field in this mutation.
func (*OrderProductMutation) AddedEdges ¶
func (m *OrderProductMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*OrderProductMutation) AddedField ¶
func (m *OrderProductMutation) 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 (*OrderProductMutation) AddedFields ¶
func (m *OrderProductMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*OrderProductMutation) AddedIDs ¶
func (m *OrderProductMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*OrderProductMutation) AddedPrice ¶
func (m *OrderProductMutation) AddedPrice() (r int64, exists bool)
AddedPrice returns the value that was added to the "price" field in this mutation.
func (*OrderProductMutation) Amount ¶
func (m *OrderProductMutation) Amount() (r int64, exists bool)
Amount returns the value of the "amount" field in the mutation.
func (*OrderProductMutation) ClearEdge ¶
func (m *OrderProductMutation) 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 (*OrderProductMutation) ClearField ¶
func (m *OrderProductMutation) 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 (*OrderProductMutation) ClearOrders ¶
func (m *OrderProductMutation) ClearOrders()
ClearOrders clears the "orders" edge to the Order entity.
func (*OrderProductMutation) ClearProducts ¶
func (m *OrderProductMutation) ClearProducts()
ClearProducts clears the "products" edge to the Product entity.
func (*OrderProductMutation) ClearedEdges ¶
func (m *OrderProductMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*OrderProductMutation) ClearedFields ¶
func (m *OrderProductMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (OrderProductMutation) Client ¶
func (m OrderProductMutation) 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 (*OrderProductMutation) CreatedAt ¶
func (m *OrderProductMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*OrderProductMutation) EdgeCleared ¶
func (m *OrderProductMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*OrderProductMutation) Field ¶
func (m *OrderProductMutation) 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 (*OrderProductMutation) FieldCleared ¶
func (m *OrderProductMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*OrderProductMutation) Fields ¶
func (m *OrderProductMutation) 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 (*OrderProductMutation) ID ¶
func (m *OrderProductMutation) ID() (id int64, 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 (*OrderProductMutation) IDs ¶
func (m *OrderProductMutation) IDs(ctx context.Context) ([]int64, 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 (*OrderProductMutation) OldAmount ¶
func (m *OrderProductMutation) OldAmount(ctx context.Context) (v int64, err error)
OldAmount returns the old "amount" field's value of the OrderProduct entity. If the OrderProduct 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 (*OrderProductMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the OrderProduct entity. If the OrderProduct 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 (*OrderProductMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*OrderProductMutation) OldOrderID ¶
func (m *OrderProductMutation) OldOrderID(ctx context.Context) (v int64, err error)
OldOrderID returns the old "order_id" field's value of the OrderProduct entity. If the OrderProduct 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 (*OrderProductMutation) OldPrice ¶
func (m *OrderProductMutation) OldPrice(ctx context.Context) (v int64, err error)
OldPrice returns the old "price" field's value of the OrderProduct entity. If the OrderProduct 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 (*OrderProductMutation) OldProductID ¶
func (m *OrderProductMutation) OldProductID(ctx context.Context) (v int64, err error)
OldProductID returns the old "product_id" field's value of the OrderProduct entity. If the OrderProduct 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 (*OrderProductMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the OrderProduct entity. If the OrderProduct 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 (*OrderProductMutation) Op ¶
func (m *OrderProductMutation) Op() Op
Op returns the operation name.
func (*OrderProductMutation) OrderID ¶
func (m *OrderProductMutation) OrderID() (r int64, exists bool)
OrderID returns the value of the "order_id" field in the mutation.
func (*OrderProductMutation) OrdersCleared ¶
func (m *OrderProductMutation) OrdersCleared() bool
OrdersCleared reports if the "orders" edge to the Order entity was cleared.
func (*OrderProductMutation) OrdersID ¶
func (m *OrderProductMutation) OrdersID() (id int64, exists bool)
OrdersID returns the "orders" edge ID in the mutation.
func (*OrderProductMutation) OrdersIDs ¶
func (m *OrderProductMutation) OrdersIDs() (ids []int64)
OrdersIDs returns the "orders" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrdersID instead. It exists only for internal usage by the builders.
func (*OrderProductMutation) Price ¶
func (m *OrderProductMutation) Price() (r int64, exists bool)
Price returns the value of the "price" field in the mutation.
func (*OrderProductMutation) ProductID ¶
func (m *OrderProductMutation) ProductID() (r int64, exists bool)
ProductID returns the value of the "product_id" field in the mutation.
func (*OrderProductMutation) ProductsCleared ¶
func (m *OrderProductMutation) ProductsCleared() bool
ProductsCleared reports if the "products" edge to the Product entity was cleared.
func (*OrderProductMutation) ProductsID ¶
func (m *OrderProductMutation) ProductsID() (id int64, exists bool)
ProductsID returns the "products" edge ID in the mutation.
func (*OrderProductMutation) ProductsIDs ¶
func (m *OrderProductMutation) ProductsIDs() (ids []int64)
ProductsIDs returns the "products" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductsID instead. It exists only for internal usage by the builders.
func (*OrderProductMutation) RemovedEdges ¶
func (m *OrderProductMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*OrderProductMutation) RemovedIDs ¶
func (m *OrderProductMutation) 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 (*OrderProductMutation) ResetAmount ¶
func (m *OrderProductMutation) ResetAmount()
ResetAmount resets all changes to the "amount" field.
func (*OrderProductMutation) ResetCreatedAt ¶
func (m *OrderProductMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*OrderProductMutation) ResetEdge ¶
func (m *OrderProductMutation) 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 (*OrderProductMutation) ResetField ¶
func (m *OrderProductMutation) 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 (*OrderProductMutation) ResetOrderID ¶
func (m *OrderProductMutation) ResetOrderID()
ResetOrderID resets all changes to the "order_id" field.
func (*OrderProductMutation) ResetOrders ¶
func (m *OrderProductMutation) ResetOrders()
ResetOrders resets all changes to the "orders" edge.
func (*OrderProductMutation) ResetPrice ¶
func (m *OrderProductMutation) ResetPrice()
ResetPrice resets all changes to the "price" field.
func (*OrderProductMutation) ResetProductID ¶
func (m *OrderProductMutation) ResetProductID()
ResetProductID resets all changes to the "product_id" field.
func (*OrderProductMutation) ResetProducts ¶
func (m *OrderProductMutation) ResetProducts()
ResetProducts resets all changes to the "products" edge.
func (*OrderProductMutation) ResetUpdatedAt ¶
func (m *OrderProductMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*OrderProductMutation) SetAmount ¶
func (m *OrderProductMutation) SetAmount(i int64)
SetAmount sets the "amount" field.
func (*OrderProductMutation) SetCreatedAt ¶
func (m *OrderProductMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*OrderProductMutation) SetField ¶
func (m *OrderProductMutation) 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 (*OrderProductMutation) SetOp ¶
func (m *OrderProductMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*OrderProductMutation) SetOrderID ¶
func (m *OrderProductMutation) SetOrderID(i int64)
SetOrderID sets the "order_id" field.
func (*OrderProductMutation) SetOrdersID ¶
func (m *OrderProductMutation) SetOrdersID(id int64)
SetOrdersID sets the "orders" edge to the Order entity by id.
func (*OrderProductMutation) SetPrice ¶
func (m *OrderProductMutation) SetPrice(i int64)
SetPrice sets the "price" field.
func (*OrderProductMutation) SetProductID ¶
func (m *OrderProductMutation) SetProductID(i int64)
SetProductID sets the "product_id" field.
func (*OrderProductMutation) SetProductsID ¶
func (m *OrderProductMutation) SetProductsID(id int64)
SetProductsID sets the "products" edge to the Product entity by id.
func (*OrderProductMutation) SetUpdatedAt ¶
func (m *OrderProductMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (OrderProductMutation) Tx ¶
func (m OrderProductMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*OrderProductMutation) Type ¶
func (m *OrderProductMutation) Type() string
Type returns the node type of this mutation (OrderProduct).
func (*OrderProductMutation) UpdatedAt ¶
func (m *OrderProductMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*OrderProductMutation) Where ¶
func (m *OrderProductMutation) Where(ps ...predicate.OrderProduct)
Where appends a list predicates to the OrderProductMutation builder.
func (*OrderProductMutation) WhereP ¶
func (m *OrderProductMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the OrderProductMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type OrderProductQuery ¶
type OrderProductQuery struct {
// contains filtered or unexported fields
}
OrderProductQuery is the builder for querying OrderProduct entities.
func (*OrderProductQuery) Aggregate ¶
func (opq *OrderProductQuery) Aggregate(fns ...AggregateFunc) *OrderProductSelect
Aggregate returns a OrderProductSelect configured with the given aggregations.
func (*OrderProductQuery) All ¶
func (opq *OrderProductQuery) All(ctx context.Context) ([]*OrderProduct, error)
All executes the query and returns a list of OrderProducts.
func (*OrderProductQuery) AllX ¶
func (opq *OrderProductQuery) AllX(ctx context.Context) []*OrderProduct
AllX is like All, but panics if an error occurs.
func (*OrderProductQuery) Clone ¶
func (opq *OrderProductQuery) Clone() *OrderProductQuery
Clone returns a duplicate of the OrderProductQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*OrderProductQuery) Count ¶
func (opq *OrderProductQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*OrderProductQuery) CountX ¶
func (opq *OrderProductQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*OrderProductQuery) Exist ¶
func (opq *OrderProductQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*OrderProductQuery) ExistX ¶
func (opq *OrderProductQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*OrderProductQuery) First ¶
func (opq *OrderProductQuery) First(ctx context.Context) (*OrderProduct, error)
First returns the first OrderProduct entity from the query. Returns a *NotFoundError when no OrderProduct was found.
func (*OrderProductQuery) FirstID ¶
func (opq *OrderProductQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first OrderProduct ID from the query. Returns a *NotFoundError when no OrderProduct ID was found.
func (*OrderProductQuery) FirstIDX ¶
func (opq *OrderProductQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*OrderProductQuery) FirstX ¶
func (opq *OrderProductQuery) FirstX(ctx context.Context) *OrderProduct
FirstX is like First, but panics if an error occurs.
func (*OrderProductQuery) GroupBy ¶
func (opq *OrderProductQuery) GroupBy(field string, fields ...string) *OrderProductGroupBy
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.OrderProduct.Query(). GroupBy(orderproduct.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*OrderProductQuery) IDs ¶
func (opq *OrderProductQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of OrderProduct IDs.
func (*OrderProductQuery) IDsX ¶
func (opq *OrderProductQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*OrderProductQuery) Limit ¶
func (opq *OrderProductQuery) Limit(limit int) *OrderProductQuery
Limit the number of records to be returned by this query.
func (*OrderProductQuery) Offset ¶
func (opq *OrderProductQuery) Offset(offset int) *OrderProductQuery
Offset to start from.
func (*OrderProductQuery) Only ¶
func (opq *OrderProductQuery) Only(ctx context.Context) (*OrderProduct, error)
Only returns a single OrderProduct entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OrderProduct entity is found. Returns a *NotFoundError when no OrderProduct entities are found.
func (*OrderProductQuery) OnlyID ¶
func (opq *OrderProductQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only OrderProduct ID in the query. Returns a *NotSingularError when more than one OrderProduct ID is found. Returns a *NotFoundError when no entities are found.
func (*OrderProductQuery) OnlyIDX ¶
func (opq *OrderProductQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*OrderProductQuery) OnlyX ¶
func (opq *OrderProductQuery) OnlyX(ctx context.Context) *OrderProduct
OnlyX is like Only, but panics if an error occurs.
func (*OrderProductQuery) Order ¶
func (opq *OrderProductQuery) Order(o ...orderproduct.OrderOption) *OrderProductQuery
Order specifies how the records should be ordered.
func (*OrderProductQuery) QueryOrders ¶
func (opq *OrderProductQuery) QueryOrders() *OrderQuery
QueryOrders chains the current query on the "orders" edge.
func (*OrderProductQuery) QueryProducts ¶
func (opq *OrderProductQuery) QueryProducts() *ProductQuery
QueryProducts chains the current query on the "products" edge.
func (*OrderProductQuery) Select ¶
func (opq *OrderProductQuery) Select(fields ...string) *OrderProductSelect
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.OrderProduct.Query(). Select(orderproduct.FieldCreatedAt). Scan(ctx, &v)
func (*OrderProductQuery) Unique ¶
func (opq *OrderProductQuery) Unique(unique bool) *OrderProductQuery
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 (*OrderProductQuery) Where ¶
func (opq *OrderProductQuery) Where(ps ...predicate.OrderProduct) *OrderProductQuery
Where adds a new predicate for the OrderProductQuery builder.
func (*OrderProductQuery) WithOrders ¶
func (opq *OrderProductQuery) WithOrders(opts ...func(*OrderQuery)) *OrderProductQuery
WithOrders tells the query-builder to eager-load the nodes that are connected to the "orders" edge. The optional arguments are used to configure the query builder of the edge.
func (*OrderProductQuery) WithProducts ¶
func (opq *OrderProductQuery) WithProducts(opts ...func(*ProductQuery)) *OrderProductQuery
WithProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge. The optional arguments are used to configure the query builder of the edge.
type OrderProductSelect ¶
type OrderProductSelect struct { *OrderProductQuery // contains filtered or unexported fields }
OrderProductSelect is the builder for selecting fields of OrderProduct entities.
func (*OrderProductSelect) Aggregate ¶
func (ops *OrderProductSelect) Aggregate(fns ...AggregateFunc) *OrderProductSelect
Aggregate adds the given aggregation functions to the selector query.
func (*OrderProductSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrderProductSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrderProductSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrderProductSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrderProductSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrderProductSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrderProductSelect) Scan ¶
func (ops *OrderProductSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OrderProductSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrderProductUpdate ¶
type OrderProductUpdate struct {
// contains filtered or unexported fields
}
OrderProductUpdate is the builder for updating OrderProduct entities.
func (*OrderProductUpdate) AddAmount ¶
func (opu *OrderProductUpdate) AddAmount(i int64) *OrderProductUpdate
AddAmount adds i to the "amount" field.
func (*OrderProductUpdate) AddPrice ¶
func (opu *OrderProductUpdate) AddPrice(i int64) *OrderProductUpdate
AddPrice adds i to the "price" field.
func (*OrderProductUpdate) ClearOrders ¶
func (opu *OrderProductUpdate) ClearOrders() *OrderProductUpdate
ClearOrders clears the "orders" edge to the Order entity.
func (*OrderProductUpdate) ClearProducts ¶
func (opu *OrderProductUpdate) ClearProducts() *OrderProductUpdate
ClearProducts clears the "products" edge to the Product entity.
func (*OrderProductUpdate) Exec ¶
func (opu *OrderProductUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*OrderProductUpdate) ExecX ¶
func (opu *OrderProductUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderProductUpdate) Mutation ¶
func (opu *OrderProductUpdate) Mutation() *OrderProductMutation
Mutation returns the OrderProductMutation object of the builder.
func (*OrderProductUpdate) Save ¶
func (opu *OrderProductUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*OrderProductUpdate) SaveX ¶
func (opu *OrderProductUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*OrderProductUpdate) SetAmount ¶
func (opu *OrderProductUpdate) SetAmount(i int64) *OrderProductUpdate
SetAmount sets the "amount" field.
func (*OrderProductUpdate) SetNillableAmount ¶
func (opu *OrderProductUpdate) SetNillableAmount(i *int64) *OrderProductUpdate
SetNillableAmount sets the "amount" field if the given value is not nil.
func (*OrderProductUpdate) SetNillableOrderID ¶
func (opu *OrderProductUpdate) SetNillableOrderID(i *int64) *OrderProductUpdate
SetNillableOrderID sets the "order_id" field if the given value is not nil.
func (*OrderProductUpdate) SetNillablePrice ¶
func (opu *OrderProductUpdate) SetNillablePrice(i *int64) *OrderProductUpdate
SetNillablePrice sets the "price" field if the given value is not nil.
func (*OrderProductUpdate) SetNillableProductID ¶
func (opu *OrderProductUpdate) SetNillableProductID(i *int64) *OrderProductUpdate
SetNillableProductID sets the "product_id" field if the given value is not nil.
func (*OrderProductUpdate) SetOrderID ¶
func (opu *OrderProductUpdate) SetOrderID(i int64) *OrderProductUpdate
SetOrderID sets the "order_id" field.
func (*OrderProductUpdate) SetOrders ¶
func (opu *OrderProductUpdate) SetOrders(o *Order) *OrderProductUpdate
SetOrders sets the "orders" edge to the Order entity.
func (*OrderProductUpdate) SetOrdersID ¶
func (opu *OrderProductUpdate) SetOrdersID(id int64) *OrderProductUpdate
SetOrdersID sets the "orders" edge to the Order entity by ID.
func (*OrderProductUpdate) SetPrice ¶
func (opu *OrderProductUpdate) SetPrice(i int64) *OrderProductUpdate
SetPrice sets the "price" field.
func (*OrderProductUpdate) SetProductID ¶
func (opu *OrderProductUpdate) SetProductID(i int64) *OrderProductUpdate
SetProductID sets the "product_id" field.
func (*OrderProductUpdate) SetProducts ¶
func (opu *OrderProductUpdate) SetProducts(p *Product) *OrderProductUpdate
SetProducts sets the "products" edge to the Product entity.
func (*OrderProductUpdate) SetProductsID ¶
func (opu *OrderProductUpdate) SetProductsID(id int64) *OrderProductUpdate
SetProductsID sets the "products" edge to the Product entity by ID.
func (*OrderProductUpdate) SetUpdatedAt ¶
func (opu *OrderProductUpdate) SetUpdatedAt(t time.Time) *OrderProductUpdate
SetUpdatedAt sets the "updated_at" field.
func (*OrderProductUpdate) Where ¶
func (opu *OrderProductUpdate) Where(ps ...predicate.OrderProduct) *OrderProductUpdate
Where appends a list predicates to the OrderProductUpdate builder.
type OrderProductUpdateOne ¶
type OrderProductUpdateOne struct {
// contains filtered or unexported fields
}
OrderProductUpdateOne is the builder for updating a single OrderProduct entity.
func (*OrderProductUpdateOne) AddAmount ¶
func (opuo *OrderProductUpdateOne) AddAmount(i int64) *OrderProductUpdateOne
AddAmount adds i to the "amount" field.
func (*OrderProductUpdateOne) AddPrice ¶
func (opuo *OrderProductUpdateOne) AddPrice(i int64) *OrderProductUpdateOne
AddPrice adds i to the "price" field.
func (*OrderProductUpdateOne) ClearOrders ¶
func (opuo *OrderProductUpdateOne) ClearOrders() *OrderProductUpdateOne
ClearOrders clears the "orders" edge to the Order entity.
func (*OrderProductUpdateOne) ClearProducts ¶
func (opuo *OrderProductUpdateOne) ClearProducts() *OrderProductUpdateOne
ClearProducts clears the "products" edge to the Product entity.
func (*OrderProductUpdateOne) Exec ¶
func (opuo *OrderProductUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*OrderProductUpdateOne) ExecX ¶
func (opuo *OrderProductUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderProductUpdateOne) Mutation ¶
func (opuo *OrderProductUpdateOne) Mutation() *OrderProductMutation
Mutation returns the OrderProductMutation object of the builder.
func (*OrderProductUpdateOne) Save ¶
func (opuo *OrderProductUpdateOne) Save(ctx context.Context) (*OrderProduct, error)
Save executes the query and returns the updated OrderProduct entity.
func (*OrderProductUpdateOne) SaveX ¶
func (opuo *OrderProductUpdateOne) SaveX(ctx context.Context) *OrderProduct
SaveX is like Save, but panics if an error occurs.
func (*OrderProductUpdateOne) Select ¶
func (opuo *OrderProductUpdateOne) Select(field string, fields ...string) *OrderProductUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*OrderProductUpdateOne) SetAmount ¶
func (opuo *OrderProductUpdateOne) SetAmount(i int64) *OrderProductUpdateOne
SetAmount sets the "amount" field.
func (*OrderProductUpdateOne) SetNillableAmount ¶
func (opuo *OrderProductUpdateOne) SetNillableAmount(i *int64) *OrderProductUpdateOne
SetNillableAmount sets the "amount" field if the given value is not nil.
func (*OrderProductUpdateOne) SetNillableOrderID ¶
func (opuo *OrderProductUpdateOne) SetNillableOrderID(i *int64) *OrderProductUpdateOne
SetNillableOrderID sets the "order_id" field if the given value is not nil.
func (*OrderProductUpdateOne) SetNillablePrice ¶
func (opuo *OrderProductUpdateOne) SetNillablePrice(i *int64) *OrderProductUpdateOne
SetNillablePrice sets the "price" field if the given value is not nil.
func (*OrderProductUpdateOne) SetNillableProductID ¶
func (opuo *OrderProductUpdateOne) SetNillableProductID(i *int64) *OrderProductUpdateOne
SetNillableProductID sets the "product_id" field if the given value is not nil.
func (*OrderProductUpdateOne) SetOrderID ¶
func (opuo *OrderProductUpdateOne) SetOrderID(i int64) *OrderProductUpdateOne
SetOrderID sets the "order_id" field.
func (*OrderProductUpdateOne) SetOrders ¶
func (opuo *OrderProductUpdateOne) SetOrders(o *Order) *OrderProductUpdateOne
SetOrders sets the "orders" edge to the Order entity.
func (*OrderProductUpdateOne) SetOrdersID ¶
func (opuo *OrderProductUpdateOne) SetOrdersID(id int64) *OrderProductUpdateOne
SetOrdersID sets the "orders" edge to the Order entity by ID.
func (*OrderProductUpdateOne) SetPrice ¶
func (opuo *OrderProductUpdateOne) SetPrice(i int64) *OrderProductUpdateOne
SetPrice sets the "price" field.
func (*OrderProductUpdateOne) SetProductID ¶
func (opuo *OrderProductUpdateOne) SetProductID(i int64) *OrderProductUpdateOne
SetProductID sets the "product_id" field.
func (*OrderProductUpdateOne) SetProducts ¶
func (opuo *OrderProductUpdateOne) SetProducts(p *Product) *OrderProductUpdateOne
SetProducts sets the "products" edge to the Product entity.
func (*OrderProductUpdateOne) SetProductsID ¶
func (opuo *OrderProductUpdateOne) SetProductsID(id int64) *OrderProductUpdateOne
SetProductsID sets the "products" edge to the Product entity by ID.
func (*OrderProductUpdateOne) SetUpdatedAt ¶
func (opuo *OrderProductUpdateOne) SetUpdatedAt(t time.Time) *OrderProductUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*OrderProductUpdateOne) Where ¶
func (opuo *OrderProductUpdateOne) Where(ps ...predicate.OrderProduct) *OrderProductUpdateOne
Where appends a list predicates to the OrderProductUpdate builder.
type OrderProductUpsert ¶
OrderProductUpsert is the "OnConflict" setter.
func (*OrderProductUpsert) AddAmount ¶
func (u *OrderProductUpsert) AddAmount(v int64) *OrderProductUpsert
AddAmount adds v to the "amount" field.
func (*OrderProductUpsert) AddPrice ¶
func (u *OrderProductUpsert) AddPrice(v int64) *OrderProductUpsert
AddPrice adds v to the "price" field.
func (*OrderProductUpsert) SetAmount ¶
func (u *OrderProductUpsert) SetAmount(v int64) *OrderProductUpsert
SetAmount sets the "amount" field.
func (*OrderProductUpsert) SetOrderID ¶
func (u *OrderProductUpsert) SetOrderID(v int64) *OrderProductUpsert
SetOrderID sets the "order_id" field.
func (*OrderProductUpsert) SetPrice ¶
func (u *OrderProductUpsert) SetPrice(v int64) *OrderProductUpsert
SetPrice sets the "price" field.
func (*OrderProductUpsert) SetProductID ¶
func (u *OrderProductUpsert) SetProductID(v int64) *OrderProductUpsert
SetProductID sets the "product_id" field.
func (*OrderProductUpsert) SetUpdatedAt ¶
func (u *OrderProductUpsert) SetUpdatedAt(v time.Time) *OrderProductUpsert
SetUpdatedAt sets the "updated_at" field.
func (*OrderProductUpsert) UpdateAmount ¶
func (u *OrderProductUpsert) UpdateAmount() *OrderProductUpsert
UpdateAmount sets the "amount" field to the value that was provided on create.
func (*OrderProductUpsert) UpdateOrderID ¶
func (u *OrderProductUpsert) UpdateOrderID() *OrderProductUpsert
UpdateOrderID sets the "order_id" field to the value that was provided on create.
func (*OrderProductUpsert) UpdatePrice ¶
func (u *OrderProductUpsert) UpdatePrice() *OrderProductUpsert
UpdatePrice sets the "price" field to the value that was provided on create.
func (*OrderProductUpsert) UpdateProductID ¶
func (u *OrderProductUpsert) UpdateProductID() *OrderProductUpsert
UpdateProductID sets the "product_id" field to the value that was provided on create.
func (*OrderProductUpsert) UpdateUpdatedAt ¶
func (u *OrderProductUpsert) UpdateUpdatedAt() *OrderProductUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type OrderProductUpsertBulk ¶
type OrderProductUpsertBulk struct {
// contains filtered or unexported fields
}
OrderProductUpsertBulk is the builder for "upsert"-ing a bulk of OrderProduct nodes.
func (*OrderProductUpsertBulk) AddAmount ¶
func (u *OrderProductUpsertBulk) AddAmount(v int64) *OrderProductUpsertBulk
AddAmount adds v to the "amount" field.
func (*OrderProductUpsertBulk) AddPrice ¶
func (u *OrderProductUpsertBulk) AddPrice(v int64) *OrderProductUpsertBulk
AddPrice adds v to the "price" field.
func (*OrderProductUpsertBulk) DoNothing ¶
func (u *OrderProductUpsertBulk) DoNothing() *OrderProductUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*OrderProductUpsertBulk) Exec ¶
func (u *OrderProductUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*OrderProductUpsertBulk) ExecX ¶
func (u *OrderProductUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderProductUpsertBulk) Ignore ¶
func (u *OrderProductUpsertBulk) Ignore() *OrderProductUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.OrderProduct.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*OrderProductUpsertBulk) SetAmount ¶
func (u *OrderProductUpsertBulk) SetAmount(v int64) *OrderProductUpsertBulk
SetAmount sets the "amount" field.
func (*OrderProductUpsertBulk) SetOrderID ¶
func (u *OrderProductUpsertBulk) SetOrderID(v int64) *OrderProductUpsertBulk
SetOrderID sets the "order_id" field.
func (*OrderProductUpsertBulk) SetPrice ¶
func (u *OrderProductUpsertBulk) SetPrice(v int64) *OrderProductUpsertBulk
SetPrice sets the "price" field.
func (*OrderProductUpsertBulk) SetProductID ¶
func (u *OrderProductUpsertBulk) SetProductID(v int64) *OrderProductUpsertBulk
SetProductID sets the "product_id" field.
func (*OrderProductUpsertBulk) SetUpdatedAt ¶
func (u *OrderProductUpsertBulk) SetUpdatedAt(v time.Time) *OrderProductUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*OrderProductUpsertBulk) Update ¶
func (u *OrderProductUpsertBulk) Update(set func(*OrderProductUpsert)) *OrderProductUpsertBulk
Update allows overriding fields `UPDATE` values. See the OrderProductCreateBulk.OnConflict documentation for more info.
func (*OrderProductUpsertBulk) UpdateAmount ¶
func (u *OrderProductUpsertBulk) UpdateAmount() *OrderProductUpsertBulk
UpdateAmount sets the "amount" field to the value that was provided on create.
func (*OrderProductUpsertBulk) UpdateNewValues ¶
func (u *OrderProductUpsertBulk) UpdateNewValues() *OrderProductUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.OrderProduct.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*OrderProductUpsertBulk) UpdateOrderID ¶
func (u *OrderProductUpsertBulk) UpdateOrderID() *OrderProductUpsertBulk
UpdateOrderID sets the "order_id" field to the value that was provided on create.
func (*OrderProductUpsertBulk) UpdatePrice ¶
func (u *OrderProductUpsertBulk) UpdatePrice() *OrderProductUpsertBulk
UpdatePrice sets the "price" field to the value that was provided on create.
func (*OrderProductUpsertBulk) UpdateProductID ¶
func (u *OrderProductUpsertBulk) UpdateProductID() *OrderProductUpsertBulk
UpdateProductID sets the "product_id" field to the value that was provided on create.
func (*OrderProductUpsertBulk) UpdateUpdatedAt ¶
func (u *OrderProductUpsertBulk) UpdateUpdatedAt() *OrderProductUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type OrderProductUpsertOne ¶
type OrderProductUpsertOne struct {
// contains filtered or unexported fields
}
OrderProductUpsertOne is the builder for "upsert"-ing
one OrderProduct node.
func (*OrderProductUpsertOne) AddAmount ¶
func (u *OrderProductUpsertOne) AddAmount(v int64) *OrderProductUpsertOne
AddAmount adds v to the "amount" field.
func (*OrderProductUpsertOne) AddPrice ¶
func (u *OrderProductUpsertOne) AddPrice(v int64) *OrderProductUpsertOne
AddPrice adds v to the "price" field.
func (*OrderProductUpsertOne) DoNothing ¶
func (u *OrderProductUpsertOne) DoNothing() *OrderProductUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*OrderProductUpsertOne) Exec ¶
func (u *OrderProductUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*OrderProductUpsertOne) ExecX ¶
func (u *OrderProductUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderProductUpsertOne) ID ¶
func (u *OrderProductUpsertOne) ID(ctx context.Context) (id int64, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*OrderProductUpsertOne) IDX ¶
func (u *OrderProductUpsertOne) IDX(ctx context.Context) int64
IDX is like ID, but panics if an error occurs.
func (*OrderProductUpsertOne) Ignore ¶
func (u *OrderProductUpsertOne) Ignore() *OrderProductUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.OrderProduct.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*OrderProductUpsertOne) SetAmount ¶
func (u *OrderProductUpsertOne) SetAmount(v int64) *OrderProductUpsertOne
SetAmount sets the "amount" field.
func (*OrderProductUpsertOne) SetOrderID ¶
func (u *OrderProductUpsertOne) SetOrderID(v int64) *OrderProductUpsertOne
SetOrderID sets the "order_id" field.
func (*OrderProductUpsertOne) SetPrice ¶
func (u *OrderProductUpsertOne) SetPrice(v int64) *OrderProductUpsertOne
SetPrice sets the "price" field.
func (*OrderProductUpsertOne) SetProductID ¶
func (u *OrderProductUpsertOne) SetProductID(v int64) *OrderProductUpsertOne
SetProductID sets the "product_id" field.
func (*OrderProductUpsertOne) SetUpdatedAt ¶
func (u *OrderProductUpsertOne) SetUpdatedAt(v time.Time) *OrderProductUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*OrderProductUpsertOne) Update ¶
func (u *OrderProductUpsertOne) Update(set func(*OrderProductUpsert)) *OrderProductUpsertOne
Update allows overriding fields `UPDATE` values. See the OrderProductCreate.OnConflict documentation for more info.
func (*OrderProductUpsertOne) UpdateAmount ¶
func (u *OrderProductUpsertOne) UpdateAmount() *OrderProductUpsertOne
UpdateAmount sets the "amount" field to the value that was provided on create.
func (*OrderProductUpsertOne) UpdateNewValues ¶
func (u *OrderProductUpsertOne) UpdateNewValues() *OrderProductUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.OrderProduct.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*OrderProductUpsertOne) UpdateOrderID ¶
func (u *OrderProductUpsertOne) UpdateOrderID() *OrderProductUpsertOne
UpdateOrderID sets the "order_id" field to the value that was provided on create.
func (*OrderProductUpsertOne) UpdatePrice ¶
func (u *OrderProductUpsertOne) UpdatePrice() *OrderProductUpsertOne
UpdatePrice sets the "price" field to the value that was provided on create.
func (*OrderProductUpsertOne) UpdateProductID ¶
func (u *OrderProductUpsertOne) UpdateProductID() *OrderProductUpsertOne
UpdateProductID sets the "product_id" field to the value that was provided on create.
func (*OrderProductUpsertOne) UpdateUpdatedAt ¶
func (u *OrderProductUpsertOne) UpdateUpdatedAt() *OrderProductUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type OrderProducts ¶
type OrderProducts []*OrderProduct
OrderProducts is a parsable slice of OrderProduct.
type OrderQuery ¶
type OrderQuery struct {
// contains filtered or unexported fields
}
OrderQuery is the builder for querying Order entities.
func (*OrderQuery) Aggregate ¶
func (oq *OrderQuery) Aggregate(fns ...AggregateFunc) *OrderSelect
Aggregate returns a OrderSelect configured with the given aggregations.
func (*OrderQuery) All ¶
func (oq *OrderQuery) All(ctx context.Context) ([]*Order, error)
All executes the query and returns a list of Orders.
func (*OrderQuery) AllX ¶
func (oq *OrderQuery) AllX(ctx context.Context) []*Order
AllX is like All, but panics if an error occurs.
func (*OrderQuery) Clone ¶
func (oq *OrderQuery) Clone() *OrderQuery
Clone returns a duplicate of the OrderQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*OrderQuery) Count ¶
func (oq *OrderQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*OrderQuery) CountX ¶
func (oq *OrderQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*OrderQuery) Exist ¶
func (oq *OrderQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*OrderQuery) ExistX ¶
func (oq *OrderQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*OrderQuery) First ¶
func (oq *OrderQuery) First(ctx context.Context) (*Order, error)
First returns the first Order entity from the query. Returns a *NotFoundError when no Order was found.
func (*OrderQuery) FirstID ¶
func (oq *OrderQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first Order ID from the query. Returns a *NotFoundError when no Order ID was found.
func (*OrderQuery) FirstIDX ¶
func (oq *OrderQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*OrderQuery) FirstX ¶
func (oq *OrderQuery) FirstX(ctx context.Context) *Order
FirstX is like First, but panics if an error occurs.
func (*OrderQuery) GroupBy ¶
func (oq *OrderQuery) GroupBy(field string, fields ...string) *OrderGroupBy
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.Order.Query(). GroupBy(order.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*OrderQuery) IDs ¶
func (oq *OrderQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of Order IDs.
func (*OrderQuery) IDsX ¶
func (oq *OrderQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*OrderQuery) Limit ¶
func (oq *OrderQuery) Limit(limit int) *OrderQuery
Limit the number of records to be returned by this query.
func (*OrderQuery) Offset ¶
func (oq *OrderQuery) Offset(offset int) *OrderQuery
Offset to start from.
func (*OrderQuery) Only ¶
func (oq *OrderQuery) Only(ctx context.Context) (*Order, error)
Only returns a single Order entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Order entity is found. Returns a *NotFoundError when no Order entities are found.
func (*OrderQuery) OnlyID ¶
func (oq *OrderQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only Order ID in the query. Returns a *NotSingularError when more than one Order ID is found. Returns a *NotFoundError when no entities are found.
func (*OrderQuery) OnlyIDX ¶
func (oq *OrderQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*OrderQuery) OnlyX ¶
func (oq *OrderQuery) OnlyX(ctx context.Context) *Order
OnlyX is like Only, but panics if an error occurs.
func (*OrderQuery) Order ¶
func (oq *OrderQuery) Order(o ...order.OrderOption) *OrderQuery
Order specifies how the records should be ordered.
func (*OrderQuery) QueryOrderProducts ¶
func (oq *OrderQuery) QueryOrderProducts() *OrderProductQuery
QueryOrderProducts chains the current query on the "order_products" edge.
func (*OrderQuery) QueryUsers ¶
func (oq *OrderQuery) QueryUsers() *UserQuery
QueryUsers chains the current query on the "users" edge.
func (*OrderQuery) Select ¶
func (oq *OrderQuery) Select(fields ...string) *OrderSelect
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.Order.Query(). Select(order.FieldCreatedAt). Scan(ctx, &v)
func (*OrderQuery) Unique ¶
func (oq *OrderQuery) Unique(unique bool) *OrderQuery
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 (*OrderQuery) Where ¶
func (oq *OrderQuery) Where(ps ...predicate.Order) *OrderQuery
Where adds a new predicate for the OrderQuery builder.
func (*OrderQuery) WithOrderProducts ¶
func (oq *OrderQuery) WithOrderProducts(opts ...func(*OrderProductQuery)) *OrderQuery
WithOrderProducts tells the query-builder to eager-load the nodes that are connected to the "order_products" edge. The optional arguments are used to configure the query builder of the edge.
func (*OrderQuery) WithUsers ¶
func (oq *OrderQuery) WithUsers(opts ...func(*UserQuery)) *OrderQuery
WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.
type OrderSelect ¶
type OrderSelect struct { *OrderQuery // contains filtered or unexported fields }
OrderSelect is the builder for selecting fields of Order entities.
func (*OrderSelect) Aggregate ¶
func (os *OrderSelect) Aggregate(fns ...AggregateFunc) *OrderSelect
Aggregate adds the given aggregation functions to the selector query.
func (*OrderSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrderSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrderSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrderSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrderSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrderSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrderSelect) Scan ¶
func (os *OrderSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OrderSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrderUpdate ¶
type OrderUpdate struct {
// contains filtered or unexported fields
}
OrderUpdate is the builder for updating Order entities.
func (*OrderUpdate) AddOrderProductIDs ¶
func (ou *OrderUpdate) AddOrderProductIDs(ids ...int64) *OrderUpdate
AddOrderProductIDs adds the "order_products" edge to the OrderProduct entity by IDs.
func (*OrderUpdate) AddOrderProducts ¶
func (ou *OrderUpdate) AddOrderProducts(o ...*OrderProduct) *OrderUpdate
AddOrderProducts adds the "order_products" edges to the OrderProduct entity.
func (*OrderUpdate) ClearOrderProducts ¶
func (ou *OrderUpdate) ClearOrderProducts() *OrderUpdate
ClearOrderProducts clears all "order_products" edges to the OrderProduct entity.
func (*OrderUpdate) ClearUsers ¶
func (ou *OrderUpdate) ClearUsers() *OrderUpdate
ClearUsers clears the "users" edge to the User entity.
func (*OrderUpdate) Exec ¶
func (ou *OrderUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*OrderUpdate) ExecX ¶
func (ou *OrderUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderUpdate) Mutation ¶
func (ou *OrderUpdate) Mutation() *OrderMutation
Mutation returns the OrderMutation object of the builder.
func (*OrderUpdate) RemoveOrderProductIDs ¶
func (ou *OrderUpdate) RemoveOrderProductIDs(ids ...int64) *OrderUpdate
RemoveOrderProductIDs removes the "order_products" edge to OrderProduct entities by IDs.
func (*OrderUpdate) RemoveOrderProducts ¶
func (ou *OrderUpdate) RemoveOrderProducts(o ...*OrderProduct) *OrderUpdate
RemoveOrderProducts removes "order_products" edges to OrderProduct entities.
func (*OrderUpdate) Save ¶
func (ou *OrderUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*OrderUpdate) SaveX ¶
func (ou *OrderUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*OrderUpdate) SetNillableStatus ¶
func (ou *OrderUpdate) SetNillableStatus(o *order.Status) *OrderUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*OrderUpdate) SetNillableUserID ¶
func (ou *OrderUpdate) SetNillableUserID(i *int64) *OrderUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*OrderUpdate) SetStatus ¶
func (ou *OrderUpdate) SetStatus(o order.Status) *OrderUpdate
SetStatus sets the "status" field.
func (*OrderUpdate) SetUpdatedAt ¶
func (ou *OrderUpdate) SetUpdatedAt(t time.Time) *OrderUpdate
SetUpdatedAt sets the "updated_at" field.
func (*OrderUpdate) SetUserID ¶
func (ou *OrderUpdate) SetUserID(i int64) *OrderUpdate
SetUserID sets the "user_id" field.
func (*OrderUpdate) SetUsers ¶
func (ou *OrderUpdate) SetUsers(u *User) *OrderUpdate
SetUsers sets the "users" edge to the User entity.
func (*OrderUpdate) SetUsersID ¶
func (ou *OrderUpdate) SetUsersID(id int64) *OrderUpdate
SetUsersID sets the "users" edge to the User entity by ID.
func (*OrderUpdate) Where ¶
func (ou *OrderUpdate) Where(ps ...predicate.Order) *OrderUpdate
Where appends a list predicates to the OrderUpdate builder.
type OrderUpdateOne ¶
type OrderUpdateOne struct {
// contains filtered or unexported fields
}
OrderUpdateOne is the builder for updating a single Order entity.
func (*OrderUpdateOne) AddOrderProductIDs ¶
func (ouo *OrderUpdateOne) AddOrderProductIDs(ids ...int64) *OrderUpdateOne
AddOrderProductIDs adds the "order_products" edge to the OrderProduct entity by IDs.
func (*OrderUpdateOne) AddOrderProducts ¶
func (ouo *OrderUpdateOne) AddOrderProducts(o ...*OrderProduct) *OrderUpdateOne
AddOrderProducts adds the "order_products" edges to the OrderProduct entity.
func (*OrderUpdateOne) ClearOrderProducts ¶
func (ouo *OrderUpdateOne) ClearOrderProducts() *OrderUpdateOne
ClearOrderProducts clears all "order_products" edges to the OrderProduct entity.
func (*OrderUpdateOne) ClearUsers ¶
func (ouo *OrderUpdateOne) ClearUsers() *OrderUpdateOne
ClearUsers clears the "users" edge to the User entity.
func (*OrderUpdateOne) Exec ¶
func (ouo *OrderUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*OrderUpdateOne) ExecX ¶
func (ouo *OrderUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderUpdateOne) Mutation ¶
func (ouo *OrderUpdateOne) Mutation() *OrderMutation
Mutation returns the OrderMutation object of the builder.
func (*OrderUpdateOne) RemoveOrderProductIDs ¶
func (ouo *OrderUpdateOne) RemoveOrderProductIDs(ids ...int64) *OrderUpdateOne
RemoveOrderProductIDs removes the "order_products" edge to OrderProduct entities by IDs.
func (*OrderUpdateOne) RemoveOrderProducts ¶
func (ouo *OrderUpdateOne) RemoveOrderProducts(o ...*OrderProduct) *OrderUpdateOne
RemoveOrderProducts removes "order_products" edges to OrderProduct entities.
func (*OrderUpdateOne) Save ¶
func (ouo *OrderUpdateOne) Save(ctx context.Context) (*Order, error)
Save executes the query and returns the updated Order entity.
func (*OrderUpdateOne) SaveX ¶
func (ouo *OrderUpdateOne) SaveX(ctx context.Context) *Order
SaveX is like Save, but panics if an error occurs.
func (*OrderUpdateOne) Select ¶
func (ouo *OrderUpdateOne) Select(field string, fields ...string) *OrderUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*OrderUpdateOne) SetNillableStatus ¶
func (ouo *OrderUpdateOne) SetNillableStatus(o *order.Status) *OrderUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*OrderUpdateOne) SetNillableUserID ¶
func (ouo *OrderUpdateOne) SetNillableUserID(i *int64) *OrderUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*OrderUpdateOne) SetStatus ¶
func (ouo *OrderUpdateOne) SetStatus(o order.Status) *OrderUpdateOne
SetStatus sets the "status" field.
func (*OrderUpdateOne) SetUpdatedAt ¶
func (ouo *OrderUpdateOne) SetUpdatedAt(t time.Time) *OrderUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*OrderUpdateOne) SetUserID ¶
func (ouo *OrderUpdateOne) SetUserID(i int64) *OrderUpdateOne
SetUserID sets the "user_id" field.
func (*OrderUpdateOne) SetUsers ¶
func (ouo *OrderUpdateOne) SetUsers(u *User) *OrderUpdateOne
SetUsers sets the "users" edge to the User entity.
func (*OrderUpdateOne) SetUsersID ¶
func (ouo *OrderUpdateOne) SetUsersID(id int64) *OrderUpdateOne
SetUsersID sets the "users" edge to the User entity by ID.
func (*OrderUpdateOne) Where ¶
func (ouo *OrderUpdateOne) Where(ps ...predicate.Order) *OrderUpdateOne
Where appends a list predicates to the OrderUpdate builder.
type OrderUpsert ¶
OrderUpsert is the "OnConflict" setter.
func (*OrderUpsert) SetStatus ¶
func (u *OrderUpsert) SetStatus(v order.Status) *OrderUpsert
SetStatus sets the "status" field.
func (*OrderUpsert) SetUpdatedAt ¶
func (u *OrderUpsert) SetUpdatedAt(v time.Time) *OrderUpsert
SetUpdatedAt sets the "updated_at" field.
func (*OrderUpsert) SetUserID ¶
func (u *OrderUpsert) SetUserID(v int64) *OrderUpsert
SetUserID sets the "user_id" field.
func (*OrderUpsert) UpdateStatus ¶
func (u *OrderUpsert) UpdateStatus() *OrderUpsert
UpdateStatus sets the "status" field to the value that was provided on create.
func (*OrderUpsert) UpdateUpdatedAt ¶
func (u *OrderUpsert) UpdateUpdatedAt() *OrderUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*OrderUpsert) UpdateUserID ¶
func (u *OrderUpsert) UpdateUserID() *OrderUpsert
UpdateUserID sets the "user_id" field to the value that was provided on create.
type OrderUpsertBulk ¶
type OrderUpsertBulk struct {
// contains filtered or unexported fields
}
OrderUpsertBulk is the builder for "upsert"-ing a bulk of Order nodes.
func (*OrderUpsertBulk) DoNothing ¶
func (u *OrderUpsertBulk) DoNothing() *OrderUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*OrderUpsertBulk) Exec ¶
func (u *OrderUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*OrderUpsertBulk) ExecX ¶
func (u *OrderUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderUpsertBulk) Ignore ¶
func (u *OrderUpsertBulk) Ignore() *OrderUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Order.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*OrderUpsertBulk) SetStatus ¶
func (u *OrderUpsertBulk) SetStatus(v order.Status) *OrderUpsertBulk
SetStatus sets the "status" field.
func (*OrderUpsertBulk) SetUpdatedAt ¶
func (u *OrderUpsertBulk) SetUpdatedAt(v time.Time) *OrderUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*OrderUpsertBulk) SetUserID ¶
func (u *OrderUpsertBulk) SetUserID(v int64) *OrderUpsertBulk
SetUserID sets the "user_id" field.
func (*OrderUpsertBulk) Update ¶
func (u *OrderUpsertBulk) Update(set func(*OrderUpsert)) *OrderUpsertBulk
Update allows overriding fields `UPDATE` values. See the OrderCreateBulk.OnConflict documentation for more info.
func (*OrderUpsertBulk) UpdateNewValues ¶
func (u *OrderUpsertBulk) UpdateNewValues() *OrderUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Order.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*OrderUpsertBulk) UpdateStatus ¶
func (u *OrderUpsertBulk) UpdateStatus() *OrderUpsertBulk
UpdateStatus sets the "status" field to the value that was provided on create.
func (*OrderUpsertBulk) UpdateUpdatedAt ¶
func (u *OrderUpsertBulk) UpdateUpdatedAt() *OrderUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*OrderUpsertBulk) UpdateUserID ¶
func (u *OrderUpsertBulk) UpdateUserID() *OrderUpsertBulk
UpdateUserID sets the "user_id" field to the value that was provided on create.
type OrderUpsertOne ¶
type OrderUpsertOne struct {
// contains filtered or unexported fields
}
OrderUpsertOne is the builder for "upsert"-ing
one Order node.
func (*OrderUpsertOne) DoNothing ¶
func (u *OrderUpsertOne) DoNothing() *OrderUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*OrderUpsertOne) Exec ¶
func (u *OrderUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*OrderUpsertOne) ExecX ¶
func (u *OrderUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrderUpsertOne) ID ¶
func (u *OrderUpsertOne) ID(ctx context.Context) (id int64, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*OrderUpsertOne) IDX ¶
func (u *OrderUpsertOne) IDX(ctx context.Context) int64
IDX is like ID, but panics if an error occurs.
func (*OrderUpsertOne) Ignore ¶
func (u *OrderUpsertOne) Ignore() *OrderUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Order.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*OrderUpsertOne) SetStatus ¶
func (u *OrderUpsertOne) SetStatus(v order.Status) *OrderUpsertOne
SetStatus sets the "status" field.
func (*OrderUpsertOne) SetUpdatedAt ¶
func (u *OrderUpsertOne) SetUpdatedAt(v time.Time) *OrderUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*OrderUpsertOne) SetUserID ¶
func (u *OrderUpsertOne) SetUserID(v int64) *OrderUpsertOne
SetUserID sets the "user_id" field.
func (*OrderUpsertOne) Update ¶
func (u *OrderUpsertOne) Update(set func(*OrderUpsert)) *OrderUpsertOne
Update allows overriding fields `UPDATE` values. See the OrderCreate.OnConflict documentation for more info.
func (*OrderUpsertOne) UpdateNewValues ¶
func (u *OrderUpsertOne) UpdateNewValues() *OrderUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Order.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*OrderUpsertOne) UpdateStatus ¶
func (u *OrderUpsertOne) UpdateStatus() *OrderUpsertOne
UpdateStatus sets the "status" field to the value that was provided on create.
func (*OrderUpsertOne) UpdateUpdatedAt ¶
func (u *OrderUpsertOne) UpdateUpdatedAt() *OrderUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*OrderUpsertOne) UpdateUserID ¶
func (u *OrderUpsertOne) UpdateUserID() *OrderUpsertOne
UpdateUserID sets the "user_id" field to the value that was provided on create.
type Product ¶
type Product struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // CategoryID holds the value of the "category_id" field. CategoryID int64 `json:"category_id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // Amount holds the value of the "amount" field. Amount int64 `json:"amount,omitempty"` // Price holds the value of the "price" field. Price int64 `json:"price,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ProductQuery when eager-loading is set. Edges ProductEdges `json:"edges"` // contains filtered or unexported fields }
Product is the model entity for the Product schema.
func (*Product) QueryCarts ¶
QueryCarts queries the "carts" edge of the Product entity.
func (*Product) QueryCategories ¶
func (pr *Product) QueryCategories() *CategoryQuery
QueryCategories queries the "categories" edge of the Product entity.
func (*Product) QueryOrderProducts ¶
func (pr *Product) QueryOrderProducts() *OrderProductQuery
QueryOrderProducts queries the "order_products" edge of the Product entity.
func (*Product) QueryProductImages ¶
func (pr *Product) QueryProductImages() *ProductImageQuery
QueryProductImages queries the "product_images" edge of the Product entity.
func (*Product) Unwrap ¶
Unwrap unwraps the Product entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Product) Update ¶
func (pr *Product) Update() *ProductUpdateOne
Update returns a builder for updating this Product. Note that you need to call Product.Unwrap() before calling this method if this Product was returned from a transaction, and the transaction was committed or rolled back.
type ProductClient ¶
type ProductClient struct {
// contains filtered or unexported fields
}
ProductClient is a client for the Product schema.
func NewProductClient ¶
func NewProductClient(c config) *ProductClient
NewProductClient returns a client for the Product from the given config.
func (*ProductClient) Create ¶
func (c *ProductClient) Create() *ProductCreate
Create returns a builder for creating a Product entity.
func (*ProductClient) CreateBulk ¶
func (c *ProductClient) CreateBulk(builders ...*ProductCreate) *ProductCreateBulk
CreateBulk returns a builder for creating a bulk of Product entities.
func (*ProductClient) Delete ¶
func (c *ProductClient) Delete() *ProductDelete
Delete returns a delete builder for Product.
func (*ProductClient) DeleteOne ¶
func (c *ProductClient) DeleteOne(pr *Product) *ProductDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ProductClient) DeleteOneID ¶
func (c *ProductClient) DeleteOneID(id int64) *ProductDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ProductClient) GetX ¶
func (c *ProductClient) GetX(ctx context.Context, id int64) *Product
GetX is like Get, but panics if an error occurs.
func (*ProductClient) Hooks ¶
func (c *ProductClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ProductClient) Intercept ¶
func (c *ProductClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `product.Intercept(f(g(h())))`.
func (*ProductClient) Interceptors ¶
func (c *ProductClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ProductClient) MapCreateBulk ¶
func (c *ProductClient) MapCreateBulk(slice any, setFunc func(*ProductCreate, int)) *ProductCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*ProductClient) Query ¶
func (c *ProductClient) Query() *ProductQuery
Query returns a query builder for Product.
func (*ProductClient) QueryCarts ¶
func (c *ProductClient) QueryCarts(pr *Product) *CartQuery
QueryCarts queries the carts edge of a Product.
func (*ProductClient) QueryCategories ¶
func (c *ProductClient) QueryCategories(pr *Product) *CategoryQuery
QueryCategories queries the categories edge of a Product.
func (*ProductClient) QueryOrderProducts ¶
func (c *ProductClient) QueryOrderProducts(pr *Product) *OrderProductQuery
QueryOrderProducts queries the order_products edge of a Product.
func (*ProductClient) QueryProductImages ¶
func (c *ProductClient) QueryProductImages(pr *Product) *ProductImageQuery
QueryProductImages queries the product_images edge of a Product.
func (*ProductClient) Update ¶
func (c *ProductClient) Update() *ProductUpdate
Update returns an update builder for Product.
func (*ProductClient) UpdateOne ¶
func (c *ProductClient) UpdateOne(pr *Product) *ProductUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ProductClient) UpdateOneID ¶
func (c *ProductClient) UpdateOneID(id int64) *ProductUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ProductClient) Use ¶
func (c *ProductClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `product.Hooks(f(g(h())))`.
type ProductCreate ¶
type ProductCreate struct {
// contains filtered or unexported fields
}
ProductCreate is the builder for creating a Product entity.
func (*ProductCreate) AddCartIDs ¶
func (pc *ProductCreate) AddCartIDs(ids ...int64) *ProductCreate
AddCartIDs adds the "carts" edge to the Cart entity by IDs.
func (*ProductCreate) AddCarts ¶
func (pc *ProductCreate) AddCarts(c ...*Cart) *ProductCreate
AddCarts adds the "carts" edges to the Cart entity.
func (*ProductCreate) AddOrderProductIDs ¶
func (pc *ProductCreate) AddOrderProductIDs(ids ...int64) *ProductCreate
AddOrderProductIDs adds the "order_products" edge to the OrderProduct entity by IDs.
func (*ProductCreate) AddOrderProducts ¶
func (pc *ProductCreate) AddOrderProducts(o ...*OrderProduct) *ProductCreate
AddOrderProducts adds the "order_products" edges to the OrderProduct entity.
func (*ProductCreate) AddProductImageIDs ¶
func (pc *ProductCreate) AddProductImageIDs(ids ...int64) *ProductCreate
AddProductImageIDs adds the "product_images" edge to the ProductImage entity by IDs.
func (*ProductCreate) AddProductImages ¶
func (pc *ProductCreate) AddProductImages(p ...*ProductImage) *ProductCreate
AddProductImages adds the "product_images" edges to the ProductImage entity.
func (*ProductCreate) Exec ¶
func (pc *ProductCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductCreate) ExecX ¶
func (pc *ProductCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductCreate) Mutation ¶
func (pc *ProductCreate) Mutation() *ProductMutation
Mutation returns the ProductMutation object of the builder.
func (*ProductCreate) OnConflict ¶
func (pc *ProductCreate) OnConflict(opts ...sql.ConflictOption) *ProductUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Product.Create(). SetCreatedAt(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ProductUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*ProductCreate) OnConflictColumns ¶
func (pc *ProductCreate) OnConflictColumns(columns ...string) *ProductUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Product.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*ProductCreate) Save ¶
func (pc *ProductCreate) Save(ctx context.Context) (*Product, error)
Save creates the Product in the database.
func (*ProductCreate) SaveX ¶
func (pc *ProductCreate) SaveX(ctx context.Context) *Product
SaveX calls Save and panics if Save returns an error.
func (*ProductCreate) SetAmount ¶
func (pc *ProductCreate) SetAmount(i int64) *ProductCreate
SetAmount sets the "amount" field.
func (*ProductCreate) SetCategories ¶
func (pc *ProductCreate) SetCategories(c *Category) *ProductCreate
SetCategories sets the "categories" edge to the Category entity.
func (*ProductCreate) SetCategoriesID ¶
func (pc *ProductCreate) SetCategoriesID(id int64) *ProductCreate
SetCategoriesID sets the "categories" edge to the Category entity by ID.
func (*ProductCreate) SetCategoryID ¶
func (pc *ProductCreate) SetCategoryID(i int64) *ProductCreate
SetCategoryID sets the "category_id" field.
func (*ProductCreate) SetCreatedAt ¶
func (pc *ProductCreate) SetCreatedAt(t time.Time) *ProductCreate
SetCreatedAt sets the "created_at" field.
func (*ProductCreate) SetDescription ¶
func (pc *ProductCreate) SetDescription(s string) *ProductCreate
SetDescription sets the "description" field.
func (*ProductCreate) SetName ¶
func (pc *ProductCreate) SetName(s string) *ProductCreate
SetName sets the "name" field.
func (*ProductCreate) SetNillableAmount ¶
func (pc *ProductCreate) SetNillableAmount(i *int64) *ProductCreate
SetNillableAmount sets the "amount" field if the given value is not nil.
func (*ProductCreate) SetNillableCreatedAt ¶
func (pc *ProductCreate) SetNillableCreatedAt(t *time.Time) *ProductCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ProductCreate) SetNillableDescription ¶
func (pc *ProductCreate) SetNillableDescription(s *string) *ProductCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ProductCreate) SetNillableUpdatedAt ¶
func (pc *ProductCreate) SetNillableUpdatedAt(t *time.Time) *ProductCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ProductCreate) SetPrice ¶
func (pc *ProductCreate) SetPrice(i int64) *ProductCreate
SetPrice sets the "price" field.
func (*ProductCreate) SetUpdatedAt ¶
func (pc *ProductCreate) SetUpdatedAt(t time.Time) *ProductCreate
SetUpdatedAt sets the "updated_at" field.
type ProductCreateBulk ¶
type ProductCreateBulk struct {
// contains filtered or unexported fields
}
ProductCreateBulk is the builder for creating many Product entities in bulk.
func (*ProductCreateBulk) Exec ¶
func (pcb *ProductCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductCreateBulk) ExecX ¶
func (pcb *ProductCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductCreateBulk) OnConflict ¶
func (pcb *ProductCreateBulk) OnConflict(opts ...sql.ConflictOption) *ProductUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Product.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ProductUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*ProductCreateBulk) OnConflictColumns ¶
func (pcb *ProductCreateBulk) OnConflictColumns(columns ...string) *ProductUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Product.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type ProductDelete ¶
type ProductDelete struct {
// contains filtered or unexported fields
}
ProductDelete is the builder for deleting a Product entity.
func (*ProductDelete) Exec ¶
func (pd *ProductDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ProductDelete) ExecX ¶
func (pd *ProductDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ProductDelete) Where ¶
func (pd *ProductDelete) Where(ps ...predicate.Product) *ProductDelete
Where appends a list predicates to the ProductDelete builder.
type ProductDeleteOne ¶
type ProductDeleteOne struct {
// contains filtered or unexported fields
}
ProductDeleteOne is the builder for deleting a single Product entity.
func (*ProductDeleteOne) Exec ¶
func (pdo *ProductDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ProductDeleteOne) ExecX ¶
func (pdo *ProductDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductDeleteOne) Where ¶
func (pdo *ProductDeleteOne) Where(ps ...predicate.Product) *ProductDeleteOne
Where appends a list predicates to the ProductDelete builder.
type ProductEdges ¶
type ProductEdges struct { // Categories holds the value of the categories edge. Categories *Category `json:"categories,omitempty"` // Carts holds the value of the carts edge. Carts []*Cart `json:"carts,omitempty"` // ProductImages holds the value of the product_images edge. ProductImages []*ProductImage `json:"product_images,omitempty"` // OrderProducts holds the value of the order_products edge. OrderProducts []*OrderProduct `json:"order_products,omitempty"` // contains filtered or unexported fields }
ProductEdges holds the relations/edges for other nodes in the graph.
func (ProductEdges) CartsOrErr ¶
func (e ProductEdges) CartsOrErr() ([]*Cart, error)
CartsOrErr returns the Carts value or an error if the edge was not loaded in eager-loading.
func (ProductEdges) CategoriesOrErr ¶
func (e ProductEdges) CategoriesOrErr() (*Category, error)
CategoriesOrErr returns the Categories value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ProductEdges) OrderProductsOrErr ¶
func (e ProductEdges) OrderProductsOrErr() ([]*OrderProduct, error)
OrderProductsOrErr returns the OrderProducts value or an error if the edge was not loaded in eager-loading.
func (ProductEdges) ProductImagesOrErr ¶
func (e ProductEdges) ProductImagesOrErr() ([]*ProductImage, error)
ProductImagesOrErr returns the ProductImages value or an error if the edge was not loaded in eager-loading.
type ProductGroupBy ¶
type ProductGroupBy struct {
// contains filtered or unexported fields
}
ProductGroupBy is the group-by builder for Product entities.
func (*ProductGroupBy) Aggregate ¶
func (pgb *ProductGroupBy) Aggregate(fns ...AggregateFunc) *ProductGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ProductGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProductGroupBy) Scan ¶
func (pgb *ProductGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProductGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProductImage ¶
type ProductImage struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // ProductID holds the value of the "product_id" field. ProductID int64 `json:"product_id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ProductImageQuery when eager-loading is set. Edges ProductImageEdges `json:"edges"` // contains filtered or unexported fields }
ProductImage is the model entity for the ProductImage schema.
func (*ProductImage) QueryProducts ¶
func (pi *ProductImage) QueryProducts() *ProductQuery
QueryProducts queries the "products" edge of the ProductImage entity.
func (*ProductImage) String ¶
func (pi *ProductImage) String() string
String implements the fmt.Stringer.
func (*ProductImage) Unwrap ¶
func (pi *ProductImage) Unwrap() *ProductImage
Unwrap unwraps the ProductImage 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 (*ProductImage) Update ¶
func (pi *ProductImage) Update() *ProductImageUpdateOne
Update returns a builder for updating this ProductImage. Note that you need to call ProductImage.Unwrap() before calling this method if this ProductImage was returned from a transaction, and the transaction was committed or rolled back.
type ProductImageClient ¶
type ProductImageClient struct {
// contains filtered or unexported fields
}
ProductImageClient is a client for the ProductImage schema.
func NewProductImageClient ¶
func NewProductImageClient(c config) *ProductImageClient
NewProductImageClient returns a client for the ProductImage from the given config.
func (*ProductImageClient) Create ¶
func (c *ProductImageClient) Create() *ProductImageCreate
Create returns a builder for creating a ProductImage entity.
func (*ProductImageClient) CreateBulk ¶
func (c *ProductImageClient) CreateBulk(builders ...*ProductImageCreate) *ProductImageCreateBulk
CreateBulk returns a builder for creating a bulk of ProductImage entities.
func (*ProductImageClient) Delete ¶
func (c *ProductImageClient) Delete() *ProductImageDelete
Delete returns a delete builder for ProductImage.
func (*ProductImageClient) DeleteOne ¶
func (c *ProductImageClient) DeleteOne(pi *ProductImage) *ProductImageDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ProductImageClient) DeleteOneID ¶
func (c *ProductImageClient) DeleteOneID(id int64) *ProductImageDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ProductImageClient) Get ¶
func (c *ProductImageClient) Get(ctx context.Context, id int64) (*ProductImage, error)
Get returns a ProductImage entity by its id.
func (*ProductImageClient) GetX ¶
func (c *ProductImageClient) GetX(ctx context.Context, id int64) *ProductImage
GetX is like Get, but panics if an error occurs.
func (*ProductImageClient) Hooks ¶
func (c *ProductImageClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ProductImageClient) Intercept ¶
func (c *ProductImageClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `productimage.Intercept(f(g(h())))`.
func (*ProductImageClient) Interceptors ¶
func (c *ProductImageClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ProductImageClient) MapCreateBulk ¶
func (c *ProductImageClient) MapCreateBulk(slice any, setFunc func(*ProductImageCreate, int)) *ProductImageCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*ProductImageClient) Query ¶
func (c *ProductImageClient) Query() *ProductImageQuery
Query returns a query builder for ProductImage.
func (*ProductImageClient) QueryProducts ¶
func (c *ProductImageClient) QueryProducts(pi *ProductImage) *ProductQuery
QueryProducts queries the products edge of a ProductImage.
func (*ProductImageClient) Update ¶
func (c *ProductImageClient) Update() *ProductImageUpdate
Update returns an update builder for ProductImage.
func (*ProductImageClient) UpdateOne ¶
func (c *ProductImageClient) UpdateOne(pi *ProductImage) *ProductImageUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ProductImageClient) UpdateOneID ¶
func (c *ProductImageClient) UpdateOneID(id int64) *ProductImageUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ProductImageClient) Use ¶
func (c *ProductImageClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `productimage.Hooks(f(g(h())))`.
type ProductImageCreate ¶
type ProductImageCreate struct {
// contains filtered or unexported fields
}
ProductImageCreate is the builder for creating a ProductImage entity.
func (*ProductImageCreate) Exec ¶
func (pic *ProductImageCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductImageCreate) ExecX ¶
func (pic *ProductImageCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductImageCreate) Mutation ¶
func (pic *ProductImageCreate) Mutation() *ProductImageMutation
Mutation returns the ProductImageMutation object of the builder.
func (*ProductImageCreate) OnConflict ¶
func (pic *ProductImageCreate) OnConflict(opts ...sql.ConflictOption) *ProductImageUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.ProductImage.Create(). SetCreatedAt(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ProductImageUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*ProductImageCreate) OnConflictColumns ¶
func (pic *ProductImageCreate) OnConflictColumns(columns ...string) *ProductImageUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.ProductImage.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*ProductImageCreate) Save ¶
func (pic *ProductImageCreate) Save(ctx context.Context) (*ProductImage, error)
Save creates the ProductImage in the database.
func (*ProductImageCreate) SaveX ¶
func (pic *ProductImageCreate) SaveX(ctx context.Context) *ProductImage
SaveX calls Save and panics if Save returns an error.
func (*ProductImageCreate) SetCreatedAt ¶
func (pic *ProductImageCreate) SetCreatedAt(t time.Time) *ProductImageCreate
SetCreatedAt sets the "created_at" field.
func (*ProductImageCreate) SetName ¶
func (pic *ProductImageCreate) SetName(s string) *ProductImageCreate
SetName sets the "name" field.
func (*ProductImageCreate) SetNillableCreatedAt ¶
func (pic *ProductImageCreate) SetNillableCreatedAt(t *time.Time) *ProductImageCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ProductImageCreate) SetNillableUpdatedAt ¶
func (pic *ProductImageCreate) SetNillableUpdatedAt(t *time.Time) *ProductImageCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ProductImageCreate) SetProductID ¶
func (pic *ProductImageCreate) SetProductID(i int64) *ProductImageCreate
SetProductID sets the "product_id" field.
func (*ProductImageCreate) SetProducts ¶
func (pic *ProductImageCreate) SetProducts(p *Product) *ProductImageCreate
SetProducts sets the "products" edge to the Product entity.
func (*ProductImageCreate) SetProductsID ¶
func (pic *ProductImageCreate) SetProductsID(id int64) *ProductImageCreate
SetProductsID sets the "products" edge to the Product entity by ID.
func (*ProductImageCreate) SetUpdatedAt ¶
func (pic *ProductImageCreate) SetUpdatedAt(t time.Time) *ProductImageCreate
SetUpdatedAt sets the "updated_at" field.
type ProductImageCreateBulk ¶
type ProductImageCreateBulk struct {
// contains filtered or unexported fields
}
ProductImageCreateBulk is the builder for creating many ProductImage entities in bulk.
func (*ProductImageCreateBulk) Exec ¶
func (picb *ProductImageCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductImageCreateBulk) ExecX ¶
func (picb *ProductImageCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductImageCreateBulk) OnConflict ¶
func (picb *ProductImageCreateBulk) OnConflict(opts ...sql.ConflictOption) *ProductImageUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.ProductImage.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ProductImageUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*ProductImageCreateBulk) OnConflictColumns ¶
func (picb *ProductImageCreateBulk) OnConflictColumns(columns ...string) *ProductImageUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.ProductImage.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*ProductImageCreateBulk) Save ¶
func (picb *ProductImageCreateBulk) Save(ctx context.Context) ([]*ProductImage, error)
Save creates the ProductImage entities in the database.
func (*ProductImageCreateBulk) SaveX ¶
func (picb *ProductImageCreateBulk) SaveX(ctx context.Context) []*ProductImage
SaveX is like Save, but panics if an error occurs.
type ProductImageDelete ¶
type ProductImageDelete struct {
// contains filtered or unexported fields
}
ProductImageDelete is the builder for deleting a ProductImage entity.
func (*ProductImageDelete) Exec ¶
func (pid *ProductImageDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ProductImageDelete) ExecX ¶
func (pid *ProductImageDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ProductImageDelete) Where ¶
func (pid *ProductImageDelete) Where(ps ...predicate.ProductImage) *ProductImageDelete
Where appends a list predicates to the ProductImageDelete builder.
type ProductImageDeleteOne ¶
type ProductImageDeleteOne struct {
// contains filtered or unexported fields
}
ProductImageDeleteOne is the builder for deleting a single ProductImage entity.
func (*ProductImageDeleteOne) Exec ¶
func (pido *ProductImageDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ProductImageDeleteOne) ExecX ¶
func (pido *ProductImageDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductImageDeleteOne) Where ¶
func (pido *ProductImageDeleteOne) Where(ps ...predicate.ProductImage) *ProductImageDeleteOne
Where appends a list predicates to the ProductImageDelete builder.
type ProductImageEdges ¶
type ProductImageEdges struct { // Products holds the value of the products edge. Products *Product `json:"products,omitempty"` // contains filtered or unexported fields }
ProductImageEdges holds the relations/edges for other nodes in the graph.
func (ProductImageEdges) ProductsOrErr ¶
func (e ProductImageEdges) ProductsOrErr() (*Product, error)
ProductsOrErr returns the Products value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ProductImageGroupBy ¶
type ProductImageGroupBy struct {
// contains filtered or unexported fields
}
ProductImageGroupBy is the group-by builder for ProductImage entities.
func (*ProductImageGroupBy) Aggregate ¶
func (pigb *ProductImageGroupBy) Aggregate(fns ...AggregateFunc) *ProductImageGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ProductImageGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProductImageGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProductImageGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProductImageGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProductImageGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProductImageGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProductImageGroupBy) Scan ¶
func (pigb *ProductImageGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProductImageGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProductImageMutation ¶
type ProductImageMutation struct {
// contains filtered or unexported fields
}
ProductImageMutation represents an operation that mutates the ProductImage nodes in the graph.
func (*ProductImageMutation) AddField ¶
func (m *ProductImageMutation) 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 (*ProductImageMutation) AddedEdges ¶
func (m *ProductImageMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ProductImageMutation) AddedField ¶
func (m *ProductImageMutation) 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 (*ProductImageMutation) AddedFields ¶
func (m *ProductImageMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ProductImageMutation) AddedIDs ¶
func (m *ProductImageMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ProductImageMutation) ClearEdge ¶
func (m *ProductImageMutation) 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 (*ProductImageMutation) ClearField ¶
func (m *ProductImageMutation) 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 (*ProductImageMutation) ClearProducts ¶
func (m *ProductImageMutation) ClearProducts()
ClearProducts clears the "products" edge to the Product entity.
func (*ProductImageMutation) ClearedEdges ¶
func (m *ProductImageMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ProductImageMutation) ClearedFields ¶
func (m *ProductImageMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ProductImageMutation) Client ¶
func (m ProductImageMutation) 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 (*ProductImageMutation) CreatedAt ¶
func (m *ProductImageMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ProductImageMutation) EdgeCleared ¶
func (m *ProductImageMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ProductImageMutation) Field ¶
func (m *ProductImageMutation) 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 (*ProductImageMutation) FieldCleared ¶
func (m *ProductImageMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ProductImageMutation) Fields ¶
func (m *ProductImageMutation) 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 (*ProductImageMutation) ID ¶
func (m *ProductImageMutation) ID() (id int64, 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 (*ProductImageMutation) IDs ¶
func (m *ProductImageMutation) IDs(ctx context.Context) ([]int64, 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 (*ProductImageMutation) Name ¶
func (m *ProductImageMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*ProductImageMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*ProductImageMutation) OldName ¶
func (m *ProductImageMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) OldProductID ¶
func (m *ProductImageMutation) OldProductID(ctx context.Context) (v int64, err error)
OldProductID returns the old "product_id" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) Op ¶
func (m *ProductImageMutation) Op() Op
Op returns the operation name.
func (*ProductImageMutation) ProductID ¶
func (m *ProductImageMutation) ProductID() (r int64, exists bool)
ProductID returns the value of the "product_id" field in the mutation.
func (*ProductImageMutation) ProductsCleared ¶
func (m *ProductImageMutation) ProductsCleared() bool
ProductsCleared reports if the "products" edge to the Product entity was cleared.
func (*ProductImageMutation) ProductsID ¶
func (m *ProductImageMutation) ProductsID() (id int64, exists bool)
ProductsID returns the "products" edge ID in the mutation.
func (*ProductImageMutation) ProductsIDs ¶
func (m *ProductImageMutation) ProductsIDs() (ids []int64)
ProductsIDs returns the "products" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductsID instead. It exists only for internal usage by the builders.
func (*ProductImageMutation) RemovedEdges ¶
func (m *ProductImageMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ProductImageMutation) RemovedIDs ¶
func (m *ProductImageMutation) 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 (*ProductImageMutation) ResetCreatedAt ¶
func (m *ProductImageMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ProductImageMutation) ResetEdge ¶
func (m *ProductImageMutation) 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 (*ProductImageMutation) ResetField ¶
func (m *ProductImageMutation) 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 (*ProductImageMutation) ResetName ¶
func (m *ProductImageMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*ProductImageMutation) ResetProductID ¶
func (m *ProductImageMutation) ResetProductID()
ResetProductID resets all changes to the "product_id" field.
func (*ProductImageMutation) ResetProducts ¶
func (m *ProductImageMutation) ResetProducts()
ResetProducts resets all changes to the "products" edge.
func (*ProductImageMutation) ResetUpdatedAt ¶
func (m *ProductImageMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*ProductImageMutation) SetCreatedAt ¶
func (m *ProductImageMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ProductImageMutation) SetField ¶
func (m *ProductImageMutation) 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 (*ProductImageMutation) SetName ¶
func (m *ProductImageMutation) SetName(s string)
SetName sets the "name" field.
func (*ProductImageMutation) SetOp ¶
func (m *ProductImageMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ProductImageMutation) SetProductID ¶
func (m *ProductImageMutation) SetProductID(i int64)
SetProductID sets the "product_id" field.
func (*ProductImageMutation) SetProductsID ¶
func (m *ProductImageMutation) SetProductsID(id int64)
SetProductsID sets the "products" edge to the Product entity by id.
func (*ProductImageMutation) SetUpdatedAt ¶
func (m *ProductImageMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (ProductImageMutation) Tx ¶
func (m ProductImageMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ProductImageMutation) Type ¶
func (m *ProductImageMutation) Type() string
Type returns the node type of this mutation (ProductImage).
func (*ProductImageMutation) UpdatedAt ¶
func (m *ProductImageMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*ProductImageMutation) Where ¶
func (m *ProductImageMutation) Where(ps ...predicate.ProductImage)
Where appends a list predicates to the ProductImageMutation builder.
func (*ProductImageMutation) WhereP ¶
func (m *ProductImageMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ProductImageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ProductImageQuery ¶
type ProductImageQuery struct {
// contains filtered or unexported fields
}
ProductImageQuery is the builder for querying ProductImage entities.
func (*ProductImageQuery) Aggregate ¶
func (piq *ProductImageQuery) Aggregate(fns ...AggregateFunc) *ProductImageSelect
Aggregate returns a ProductImageSelect configured with the given aggregations.
func (*ProductImageQuery) All ¶
func (piq *ProductImageQuery) All(ctx context.Context) ([]*ProductImage, error)
All executes the query and returns a list of ProductImages.
func (*ProductImageQuery) AllX ¶
func (piq *ProductImageQuery) AllX(ctx context.Context) []*ProductImage
AllX is like All, but panics if an error occurs.
func (*ProductImageQuery) Clone ¶
func (piq *ProductImageQuery) Clone() *ProductImageQuery
Clone returns a duplicate of the ProductImageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ProductImageQuery) Count ¶
func (piq *ProductImageQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ProductImageQuery) CountX ¶
func (piq *ProductImageQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ProductImageQuery) Exist ¶
func (piq *ProductImageQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ProductImageQuery) ExistX ¶
func (piq *ProductImageQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ProductImageQuery) First ¶
func (piq *ProductImageQuery) First(ctx context.Context) (*ProductImage, error)
First returns the first ProductImage entity from the query. Returns a *NotFoundError when no ProductImage was found.
func (*ProductImageQuery) FirstID ¶
func (piq *ProductImageQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first ProductImage ID from the query. Returns a *NotFoundError when no ProductImage ID was found.
func (*ProductImageQuery) FirstIDX ¶
func (piq *ProductImageQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*ProductImageQuery) FirstX ¶
func (piq *ProductImageQuery) FirstX(ctx context.Context) *ProductImage
FirstX is like First, but panics if an error occurs.
func (*ProductImageQuery) GroupBy ¶
func (piq *ProductImageQuery) GroupBy(field string, fields ...string) *ProductImageGroupBy
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.ProductImage.Query(). GroupBy(productimage.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ProductImageQuery) IDs ¶
func (piq *ProductImageQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of ProductImage IDs.
func (*ProductImageQuery) IDsX ¶
func (piq *ProductImageQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*ProductImageQuery) Limit ¶
func (piq *ProductImageQuery) Limit(limit int) *ProductImageQuery
Limit the number of records to be returned by this query.
func (*ProductImageQuery) Offset ¶
func (piq *ProductImageQuery) Offset(offset int) *ProductImageQuery
Offset to start from.
func (*ProductImageQuery) Only ¶
func (piq *ProductImageQuery) Only(ctx context.Context) (*ProductImage, error)
Only returns a single ProductImage entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ProductImage entity is found. Returns a *NotFoundError when no ProductImage entities are found.
func (*ProductImageQuery) OnlyID ¶
func (piq *ProductImageQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only ProductImage ID in the query. Returns a *NotSingularError when more than one ProductImage ID is found. Returns a *NotFoundError when no entities are found.
func (*ProductImageQuery) OnlyIDX ¶
func (piq *ProductImageQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ProductImageQuery) OnlyX ¶
func (piq *ProductImageQuery) OnlyX(ctx context.Context) *ProductImage
OnlyX is like Only, but panics if an error occurs.
func (*ProductImageQuery) Order ¶
func (piq *ProductImageQuery) Order(o ...productimage.OrderOption) *ProductImageQuery
Order specifies how the records should be ordered.
func (*ProductImageQuery) QueryProducts ¶
func (piq *ProductImageQuery) QueryProducts() *ProductQuery
QueryProducts chains the current query on the "products" edge.
func (*ProductImageQuery) Select ¶
func (piq *ProductImageQuery) Select(fields ...string) *ProductImageSelect
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.ProductImage.Query(). Select(productimage.FieldCreatedAt). Scan(ctx, &v)
func (*ProductImageQuery) Unique ¶
func (piq *ProductImageQuery) Unique(unique bool) *ProductImageQuery
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 (*ProductImageQuery) Where ¶
func (piq *ProductImageQuery) Where(ps ...predicate.ProductImage) *ProductImageQuery
Where adds a new predicate for the ProductImageQuery builder.
func (*ProductImageQuery) WithProducts ¶
func (piq *ProductImageQuery) WithProducts(opts ...func(*ProductQuery)) *ProductImageQuery
WithProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge. The optional arguments are used to configure the query builder of the edge.
type ProductImageSelect ¶
type ProductImageSelect struct { *ProductImageQuery // contains filtered or unexported fields }
ProductImageSelect is the builder for selecting fields of ProductImage entities.
func (*ProductImageSelect) Aggregate ¶
func (pis *ProductImageSelect) Aggregate(fns ...AggregateFunc) *ProductImageSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ProductImageSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProductImageSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProductImageSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProductImageSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProductImageSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProductImageSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProductImageSelect) Scan ¶
func (pis *ProductImageSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProductImageSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProductImageUpdate ¶
type ProductImageUpdate struct {
// contains filtered or unexported fields
}
ProductImageUpdate is the builder for updating ProductImage entities.
func (*ProductImageUpdate) ClearProducts ¶
func (piu *ProductImageUpdate) ClearProducts() *ProductImageUpdate
ClearProducts clears the "products" edge to the Product entity.
func (*ProductImageUpdate) Exec ¶
func (piu *ProductImageUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductImageUpdate) ExecX ¶
func (piu *ProductImageUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductImageUpdate) Mutation ¶
func (piu *ProductImageUpdate) Mutation() *ProductImageMutation
Mutation returns the ProductImageMutation object of the builder.
func (*ProductImageUpdate) Save ¶
func (piu *ProductImageUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ProductImageUpdate) SaveX ¶
func (piu *ProductImageUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ProductImageUpdate) SetName ¶
func (piu *ProductImageUpdate) SetName(s string) *ProductImageUpdate
SetName sets the "name" field.
func (*ProductImageUpdate) SetNillableName ¶
func (piu *ProductImageUpdate) SetNillableName(s *string) *ProductImageUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*ProductImageUpdate) SetNillableProductID ¶
func (piu *ProductImageUpdate) SetNillableProductID(i *int64) *ProductImageUpdate
SetNillableProductID sets the "product_id" field if the given value is not nil.
func (*ProductImageUpdate) SetProductID ¶
func (piu *ProductImageUpdate) SetProductID(i int64) *ProductImageUpdate
SetProductID sets the "product_id" field.
func (*ProductImageUpdate) SetProducts ¶
func (piu *ProductImageUpdate) SetProducts(p *Product) *ProductImageUpdate
SetProducts sets the "products" edge to the Product entity.
func (*ProductImageUpdate) SetProductsID ¶
func (piu *ProductImageUpdate) SetProductsID(id int64) *ProductImageUpdate
SetProductsID sets the "products" edge to the Product entity by ID.
func (*ProductImageUpdate) SetUpdatedAt ¶
func (piu *ProductImageUpdate) SetUpdatedAt(t time.Time) *ProductImageUpdate
SetUpdatedAt sets the "updated_at" field.
func (*ProductImageUpdate) Where ¶
func (piu *ProductImageUpdate) Where(ps ...predicate.ProductImage) *ProductImageUpdate
Where appends a list predicates to the ProductImageUpdate builder.
type ProductImageUpdateOne ¶
type ProductImageUpdateOne struct {
// contains filtered or unexported fields
}
ProductImageUpdateOne is the builder for updating a single ProductImage entity.
func (*ProductImageUpdateOne) ClearProducts ¶
func (piuo *ProductImageUpdateOne) ClearProducts() *ProductImageUpdateOne
ClearProducts clears the "products" edge to the Product entity.
func (*ProductImageUpdateOne) Exec ¶
func (piuo *ProductImageUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ProductImageUpdateOne) ExecX ¶
func (piuo *ProductImageUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductImageUpdateOne) Mutation ¶
func (piuo *ProductImageUpdateOne) Mutation() *ProductImageMutation
Mutation returns the ProductImageMutation object of the builder.
func (*ProductImageUpdateOne) Save ¶
func (piuo *ProductImageUpdateOne) Save(ctx context.Context) (*ProductImage, error)
Save executes the query and returns the updated ProductImage entity.
func (*ProductImageUpdateOne) SaveX ¶
func (piuo *ProductImageUpdateOne) SaveX(ctx context.Context) *ProductImage
SaveX is like Save, but panics if an error occurs.
func (*ProductImageUpdateOne) Select ¶
func (piuo *ProductImageUpdateOne) Select(field string, fields ...string) *ProductImageUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ProductImageUpdateOne) SetName ¶
func (piuo *ProductImageUpdateOne) SetName(s string) *ProductImageUpdateOne
SetName sets the "name" field.
func (*ProductImageUpdateOne) SetNillableName ¶
func (piuo *ProductImageUpdateOne) SetNillableName(s *string) *ProductImageUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*ProductImageUpdateOne) SetNillableProductID ¶
func (piuo *ProductImageUpdateOne) SetNillableProductID(i *int64) *ProductImageUpdateOne
SetNillableProductID sets the "product_id" field if the given value is not nil.
func (*ProductImageUpdateOne) SetProductID ¶
func (piuo *ProductImageUpdateOne) SetProductID(i int64) *ProductImageUpdateOne
SetProductID sets the "product_id" field.
func (*ProductImageUpdateOne) SetProducts ¶
func (piuo *ProductImageUpdateOne) SetProducts(p *Product) *ProductImageUpdateOne
SetProducts sets the "products" edge to the Product entity.
func (*ProductImageUpdateOne) SetProductsID ¶
func (piuo *ProductImageUpdateOne) SetProductsID(id int64) *ProductImageUpdateOne
SetProductsID sets the "products" edge to the Product entity by ID.
func (*ProductImageUpdateOne) SetUpdatedAt ¶
func (piuo *ProductImageUpdateOne) SetUpdatedAt(t time.Time) *ProductImageUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*ProductImageUpdateOne) Where ¶
func (piuo *ProductImageUpdateOne) Where(ps ...predicate.ProductImage) *ProductImageUpdateOne
Where appends a list predicates to the ProductImageUpdate builder.
type ProductImageUpsert ¶
ProductImageUpsert is the "OnConflict" setter.
func (*ProductImageUpsert) SetName ¶
func (u *ProductImageUpsert) SetName(v string) *ProductImageUpsert
SetName sets the "name" field.
func (*ProductImageUpsert) SetProductID ¶
func (u *ProductImageUpsert) SetProductID(v int64) *ProductImageUpsert
SetProductID sets the "product_id" field.
func (*ProductImageUpsert) SetUpdatedAt ¶
func (u *ProductImageUpsert) SetUpdatedAt(v time.Time) *ProductImageUpsert
SetUpdatedAt sets the "updated_at" field.
func (*ProductImageUpsert) UpdateName ¶
func (u *ProductImageUpsert) UpdateName() *ProductImageUpsert
UpdateName sets the "name" field to the value that was provided on create.
func (*ProductImageUpsert) UpdateProductID ¶
func (u *ProductImageUpsert) UpdateProductID() *ProductImageUpsert
UpdateProductID sets the "product_id" field to the value that was provided on create.
func (*ProductImageUpsert) UpdateUpdatedAt ¶
func (u *ProductImageUpsert) UpdateUpdatedAt() *ProductImageUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type ProductImageUpsertBulk ¶
type ProductImageUpsertBulk struct {
// contains filtered or unexported fields
}
ProductImageUpsertBulk is the builder for "upsert"-ing a bulk of ProductImage nodes.
func (*ProductImageUpsertBulk) DoNothing ¶
func (u *ProductImageUpsertBulk) DoNothing() *ProductImageUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ProductImageUpsertBulk) Exec ¶
func (u *ProductImageUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductImageUpsertBulk) ExecX ¶
func (u *ProductImageUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductImageUpsertBulk) Ignore ¶
func (u *ProductImageUpsertBulk) Ignore() *ProductImageUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.ProductImage.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ProductImageUpsertBulk) SetName ¶
func (u *ProductImageUpsertBulk) SetName(v string) *ProductImageUpsertBulk
SetName sets the "name" field.
func (*ProductImageUpsertBulk) SetProductID ¶
func (u *ProductImageUpsertBulk) SetProductID(v int64) *ProductImageUpsertBulk
SetProductID sets the "product_id" field.
func (*ProductImageUpsertBulk) SetUpdatedAt ¶
func (u *ProductImageUpsertBulk) SetUpdatedAt(v time.Time) *ProductImageUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*ProductImageUpsertBulk) Update ¶
func (u *ProductImageUpsertBulk) Update(set func(*ProductImageUpsert)) *ProductImageUpsertBulk
Update allows overriding fields `UPDATE` values. See the ProductImageCreateBulk.OnConflict documentation for more info.
func (*ProductImageUpsertBulk) UpdateName ¶
func (u *ProductImageUpsertBulk) UpdateName() *ProductImageUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*ProductImageUpsertBulk) UpdateNewValues ¶
func (u *ProductImageUpsertBulk) UpdateNewValues() *ProductImageUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.ProductImage.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*ProductImageUpsertBulk) UpdateProductID ¶
func (u *ProductImageUpsertBulk) UpdateProductID() *ProductImageUpsertBulk
UpdateProductID sets the "product_id" field to the value that was provided on create.
func (*ProductImageUpsertBulk) UpdateUpdatedAt ¶
func (u *ProductImageUpsertBulk) UpdateUpdatedAt() *ProductImageUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type ProductImageUpsertOne ¶
type ProductImageUpsertOne struct {
// contains filtered or unexported fields
}
ProductImageUpsertOne is the builder for "upsert"-ing
one ProductImage node.
func (*ProductImageUpsertOne) DoNothing ¶
func (u *ProductImageUpsertOne) DoNothing() *ProductImageUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ProductImageUpsertOne) Exec ¶
func (u *ProductImageUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductImageUpsertOne) ExecX ¶
func (u *ProductImageUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductImageUpsertOne) ID ¶
func (u *ProductImageUpsertOne) ID(ctx context.Context) (id int64, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*ProductImageUpsertOne) IDX ¶
func (u *ProductImageUpsertOne) IDX(ctx context.Context) int64
IDX is like ID, but panics if an error occurs.
func (*ProductImageUpsertOne) Ignore ¶
func (u *ProductImageUpsertOne) Ignore() *ProductImageUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.ProductImage.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ProductImageUpsertOne) SetName ¶
func (u *ProductImageUpsertOne) SetName(v string) *ProductImageUpsertOne
SetName sets the "name" field.
func (*ProductImageUpsertOne) SetProductID ¶
func (u *ProductImageUpsertOne) SetProductID(v int64) *ProductImageUpsertOne
SetProductID sets the "product_id" field.
func (*ProductImageUpsertOne) SetUpdatedAt ¶
func (u *ProductImageUpsertOne) SetUpdatedAt(v time.Time) *ProductImageUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*ProductImageUpsertOne) Update ¶
func (u *ProductImageUpsertOne) Update(set func(*ProductImageUpsert)) *ProductImageUpsertOne
Update allows overriding fields `UPDATE` values. See the ProductImageCreate.OnConflict documentation for more info.
func (*ProductImageUpsertOne) UpdateName ¶
func (u *ProductImageUpsertOne) UpdateName() *ProductImageUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*ProductImageUpsertOne) UpdateNewValues ¶
func (u *ProductImageUpsertOne) UpdateNewValues() *ProductImageUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.ProductImage.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*ProductImageUpsertOne) UpdateProductID ¶
func (u *ProductImageUpsertOne) UpdateProductID() *ProductImageUpsertOne
UpdateProductID sets the "product_id" field to the value that was provided on create.
func (*ProductImageUpsertOne) UpdateUpdatedAt ¶
func (u *ProductImageUpsertOne) UpdateUpdatedAt() *ProductImageUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type ProductImages ¶
type ProductImages []*ProductImage
ProductImages is a parsable slice of ProductImage.
type ProductMutation ¶
type ProductMutation struct {
// contains filtered or unexported fields
}
ProductMutation represents an operation that mutates the Product nodes in the graph.
func (*ProductMutation) AddAmount ¶
func (m *ProductMutation) AddAmount(i int64)
AddAmount adds i to the "amount" field.
func (*ProductMutation) AddCartIDs ¶
func (m *ProductMutation) AddCartIDs(ids ...int64)
AddCartIDs adds the "carts" edge to the Cart entity by ids.
func (*ProductMutation) AddField ¶
func (m *ProductMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*ProductMutation) AddOrderProductIDs ¶
func (m *ProductMutation) AddOrderProductIDs(ids ...int64)
AddOrderProductIDs adds the "order_products" edge to the OrderProduct entity by ids.
func (*ProductMutation) AddPrice ¶
func (m *ProductMutation) AddPrice(i int64)
AddPrice adds i to the "price" field.
func (*ProductMutation) AddProductImageIDs ¶
func (m *ProductMutation) AddProductImageIDs(ids ...int64)
AddProductImageIDs adds the "product_images" edge to the ProductImage entity by ids.
func (*ProductMutation) AddedAmount ¶
func (m *ProductMutation) AddedAmount() (r int64, exists bool)
AddedAmount returns the value that was added to the "amount" field in this mutation.
func (*ProductMutation) AddedEdges ¶
func (m *ProductMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ProductMutation) AddedField ¶
func (m *ProductMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*ProductMutation) AddedFields ¶
func (m *ProductMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ProductMutation) AddedIDs ¶
func (m *ProductMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ProductMutation) AddedPrice ¶
func (m *ProductMutation) AddedPrice() (r int64, exists bool)
AddedPrice returns the value that was added to the "price" field in this mutation.
func (*ProductMutation) Amount ¶
func (m *ProductMutation) Amount() (r int64, exists bool)
Amount returns the value of the "amount" field in the mutation.
func (*ProductMutation) CartsCleared ¶
func (m *ProductMutation) CartsCleared() bool
CartsCleared reports if the "carts" edge to the Cart entity was cleared.
func (*ProductMutation) CartsIDs ¶
func (m *ProductMutation) CartsIDs() (ids []int64)
CartsIDs returns the "carts" edge IDs in the mutation.
func (*ProductMutation) CategoriesCleared ¶
func (m *ProductMutation) CategoriesCleared() bool
CategoriesCleared reports if the "categories" edge to the Category entity was cleared.
func (*ProductMutation) CategoriesID ¶
func (m *ProductMutation) CategoriesID() (id int64, exists bool)
CategoriesID returns the "categories" edge ID in the mutation.
func (*ProductMutation) CategoriesIDs ¶
func (m *ProductMutation) CategoriesIDs() (ids []int64)
CategoriesIDs returns the "categories" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CategoriesID instead. It exists only for internal usage by the builders.
func (*ProductMutation) CategoryID ¶
func (m *ProductMutation) CategoryID() (r int64, exists bool)
CategoryID returns the value of the "category_id" field in the mutation.
func (*ProductMutation) ClearCarts ¶
func (m *ProductMutation) ClearCarts()
ClearCarts clears the "carts" edge to the Cart entity.
func (*ProductMutation) ClearCategories ¶
func (m *ProductMutation) ClearCategories()
ClearCategories clears the "categories" edge to the Category entity.
func (*ProductMutation) ClearDescription ¶
func (m *ProductMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*ProductMutation) ClearEdge ¶
func (m *ProductMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*ProductMutation) ClearField ¶
func (m *ProductMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*ProductMutation) ClearOrderProducts ¶
func (m *ProductMutation) ClearOrderProducts()
ClearOrderProducts clears the "order_products" edge to the OrderProduct entity.
func (*ProductMutation) ClearProductImages ¶
func (m *ProductMutation) ClearProductImages()
ClearProductImages clears the "product_images" edge to the ProductImage entity.
func (*ProductMutation) ClearedEdges ¶
func (m *ProductMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ProductMutation) ClearedFields ¶
func (m *ProductMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ProductMutation) Client ¶
func (m ProductMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*ProductMutation) CreatedAt ¶
func (m *ProductMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ProductMutation) Description ¶
func (m *ProductMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*ProductMutation) DescriptionCleared ¶
func (m *ProductMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*ProductMutation) EdgeCleared ¶
func (m *ProductMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ProductMutation) Field ¶
func (m *ProductMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*ProductMutation) FieldCleared ¶
func (m *ProductMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ProductMutation) Fields ¶
func (m *ProductMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*ProductMutation) ID ¶
func (m *ProductMutation) ID() (id int64, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*ProductMutation) IDs ¶
func (m *ProductMutation) IDs(ctx context.Context) ([]int64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*ProductMutation) Name ¶
func (m *ProductMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*ProductMutation) OldAmount ¶
func (m *ProductMutation) OldAmount(ctx context.Context) (v int64, err error)
OldAmount returns the old "amount" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ProductMutation) OldCategoryID ¶
func (m *ProductMutation) OldCategoryID(ctx context.Context) (v int64, err error)
OldCategoryID returns the old "category_id" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ProductMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ProductMutation) OldDescription ¶
func (m *ProductMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ProductMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*ProductMutation) OldName ¶
func (m *ProductMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ProductMutation) OldPrice ¶
func (m *ProductMutation) OldPrice(ctx context.Context) (v int64, err error)
OldPrice returns the old "price" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ProductMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ProductMutation) OrderProductsCleared ¶
func (m *ProductMutation) OrderProductsCleared() bool
OrderProductsCleared reports if the "order_products" edge to the OrderProduct entity was cleared.
func (*ProductMutation) OrderProductsIDs ¶
func (m *ProductMutation) OrderProductsIDs() (ids []int64)
OrderProductsIDs returns the "order_products" edge IDs in the mutation.
func (*ProductMutation) Price ¶
func (m *ProductMutation) Price() (r int64, exists bool)
Price returns the value of the "price" field in the mutation.
func (*ProductMutation) ProductImagesCleared ¶
func (m *ProductMutation) ProductImagesCleared() bool
ProductImagesCleared reports if the "product_images" edge to the ProductImage entity was cleared.
func (*ProductMutation) ProductImagesIDs ¶
func (m *ProductMutation) ProductImagesIDs() (ids []int64)
ProductImagesIDs returns the "product_images" edge IDs in the mutation.
func (*ProductMutation) RemoveCartIDs ¶
func (m *ProductMutation) RemoveCartIDs(ids ...int64)
RemoveCartIDs removes the "carts" edge to the Cart entity by IDs.
func (*ProductMutation) RemoveOrderProductIDs ¶
func (m *ProductMutation) RemoveOrderProductIDs(ids ...int64)
RemoveOrderProductIDs removes the "order_products" edge to the OrderProduct entity by IDs.
func (*ProductMutation) RemoveProductImageIDs ¶
func (m *ProductMutation) RemoveProductImageIDs(ids ...int64)
RemoveProductImageIDs removes the "product_images" edge to the ProductImage entity by IDs.
func (*ProductMutation) RemovedCartsIDs ¶
func (m *ProductMutation) RemovedCartsIDs() (ids []int64)
RemovedCarts returns the removed IDs of the "carts" edge to the Cart entity.
func (*ProductMutation) RemovedEdges ¶
func (m *ProductMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ProductMutation) RemovedIDs ¶
func (m *ProductMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*ProductMutation) RemovedOrderProductsIDs ¶
func (m *ProductMutation) RemovedOrderProductsIDs() (ids []int64)
RemovedOrderProducts returns the removed IDs of the "order_products" edge to the OrderProduct entity.
func (*ProductMutation) RemovedProductImagesIDs ¶
func (m *ProductMutation) RemovedProductImagesIDs() (ids []int64)
RemovedProductImages returns the removed IDs of the "product_images" edge to the ProductImage entity.
func (*ProductMutation) ResetAmount ¶
func (m *ProductMutation) ResetAmount()
ResetAmount resets all changes to the "amount" field.
func (*ProductMutation) ResetCarts ¶
func (m *ProductMutation) ResetCarts()
ResetCarts resets all changes to the "carts" edge.
func (*ProductMutation) ResetCategories ¶
func (m *ProductMutation) ResetCategories()
ResetCategories resets all changes to the "categories" edge.
func (*ProductMutation) ResetCategoryID ¶
func (m *ProductMutation) ResetCategoryID()
ResetCategoryID resets all changes to the "category_id" field.
func (*ProductMutation) ResetCreatedAt ¶
func (m *ProductMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ProductMutation) ResetDescription ¶
func (m *ProductMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*ProductMutation) ResetEdge ¶
func (m *ProductMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*ProductMutation) ResetField ¶
func (m *ProductMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*ProductMutation) ResetName ¶
func (m *ProductMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*ProductMutation) ResetOrderProducts ¶
func (m *ProductMutation) ResetOrderProducts()
ResetOrderProducts resets all changes to the "order_products" edge.
func (*ProductMutation) ResetPrice ¶
func (m *ProductMutation) ResetPrice()
ResetPrice resets all changes to the "price" field.
func (*ProductMutation) ResetProductImages ¶
func (m *ProductMutation) ResetProductImages()
ResetProductImages resets all changes to the "product_images" edge.
func (*ProductMutation) ResetUpdatedAt ¶
func (m *ProductMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*ProductMutation) SetAmount ¶
func (m *ProductMutation) SetAmount(i int64)
SetAmount sets the "amount" field.
func (*ProductMutation) SetCategoriesID ¶
func (m *ProductMutation) SetCategoriesID(id int64)
SetCategoriesID sets the "categories" edge to the Category entity by id.
func (*ProductMutation) SetCategoryID ¶
func (m *ProductMutation) SetCategoryID(i int64)
SetCategoryID sets the "category_id" field.
func (*ProductMutation) SetCreatedAt ¶
func (m *ProductMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ProductMutation) SetDescription ¶
func (m *ProductMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*ProductMutation) SetField ¶
func (m *ProductMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*ProductMutation) SetName ¶
func (m *ProductMutation) SetName(s string)
SetName sets the "name" field.
func (*ProductMutation) SetOp ¶
func (m *ProductMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ProductMutation) SetPrice ¶
func (m *ProductMutation) SetPrice(i int64)
SetPrice sets the "price" field.
func (*ProductMutation) SetUpdatedAt ¶
func (m *ProductMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (ProductMutation) Tx ¶
func (m ProductMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ProductMutation) Type ¶
func (m *ProductMutation) Type() string
Type returns the node type of this mutation (Product).
func (*ProductMutation) UpdatedAt ¶
func (m *ProductMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*ProductMutation) Where ¶
func (m *ProductMutation) Where(ps ...predicate.Product)
Where appends a list predicates to the ProductMutation builder.
func (*ProductMutation) WhereP ¶
func (m *ProductMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ProductMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ProductQuery ¶
type ProductQuery struct {
// contains filtered or unexported fields
}
ProductQuery is the builder for querying Product entities.
func (*ProductQuery) Aggregate ¶
func (pq *ProductQuery) Aggregate(fns ...AggregateFunc) *ProductSelect
Aggregate returns a ProductSelect configured with the given aggregations.
func (*ProductQuery) All ¶
func (pq *ProductQuery) All(ctx context.Context) ([]*Product, error)
All executes the query and returns a list of Products.
func (*ProductQuery) AllX ¶
func (pq *ProductQuery) AllX(ctx context.Context) []*Product
AllX is like All, but panics if an error occurs.
func (*ProductQuery) Clone ¶
func (pq *ProductQuery) Clone() *ProductQuery
Clone returns a duplicate of the ProductQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ProductQuery) Count ¶
func (pq *ProductQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ProductQuery) CountX ¶
func (pq *ProductQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ProductQuery) Exist ¶
func (pq *ProductQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ProductQuery) ExistX ¶
func (pq *ProductQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ProductQuery) First ¶
func (pq *ProductQuery) First(ctx context.Context) (*Product, error)
First returns the first Product entity from the query. Returns a *NotFoundError when no Product was found.
func (*ProductQuery) FirstID ¶
func (pq *ProductQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first Product ID from the query. Returns a *NotFoundError when no Product ID was found.
func (*ProductQuery) FirstIDX ¶
func (pq *ProductQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*ProductQuery) FirstX ¶
func (pq *ProductQuery) FirstX(ctx context.Context) *Product
FirstX is like First, but panics if an error occurs.
func (*ProductQuery) GroupBy ¶
func (pq *ProductQuery) GroupBy(field string, fields ...string) *ProductGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Product.Query(). GroupBy(product.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ProductQuery) IDs ¶
func (pq *ProductQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of Product IDs.
func (*ProductQuery) IDsX ¶
func (pq *ProductQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*ProductQuery) Limit ¶
func (pq *ProductQuery) Limit(limit int) *ProductQuery
Limit the number of records to be returned by this query.
func (*ProductQuery) Offset ¶
func (pq *ProductQuery) Offset(offset int) *ProductQuery
Offset to start from.
func (*ProductQuery) Only ¶
func (pq *ProductQuery) Only(ctx context.Context) (*Product, error)
Only returns a single Product entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Product entity is found. Returns a *NotFoundError when no Product entities are found.
func (*ProductQuery) OnlyID ¶
func (pq *ProductQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only Product ID in the query. Returns a *NotSingularError when more than one Product ID is found. Returns a *NotFoundError when no entities are found.
func (*ProductQuery) OnlyIDX ¶
func (pq *ProductQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ProductQuery) OnlyX ¶
func (pq *ProductQuery) OnlyX(ctx context.Context) *Product
OnlyX is like Only, but panics if an error occurs.
func (*ProductQuery) Order ¶
func (pq *ProductQuery) Order(o ...product.OrderOption) *ProductQuery
Order specifies how the records should be ordered.
func (*ProductQuery) QueryCarts ¶
func (pq *ProductQuery) QueryCarts() *CartQuery
QueryCarts chains the current query on the "carts" edge.
func (*ProductQuery) QueryCategories ¶
func (pq *ProductQuery) QueryCategories() *CategoryQuery
QueryCategories chains the current query on the "categories" edge.
func (*ProductQuery) QueryOrderProducts ¶
func (pq *ProductQuery) QueryOrderProducts() *OrderProductQuery
QueryOrderProducts chains the current query on the "order_products" edge.
func (*ProductQuery) QueryProductImages ¶
func (pq *ProductQuery) QueryProductImages() *ProductImageQuery
QueryProductImages chains the current query on the "product_images" edge.
func (*ProductQuery) Select ¶
func (pq *ProductQuery) Select(fields ...string) *ProductSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.Product.Query(). Select(product.FieldCreatedAt). Scan(ctx, &v)
func (*ProductQuery) Unique ¶
func (pq *ProductQuery) Unique(unique bool) *ProductQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*ProductQuery) Where ¶
func (pq *ProductQuery) Where(ps ...predicate.Product) *ProductQuery
Where adds a new predicate for the ProductQuery builder.
func (*ProductQuery) WithCarts ¶
func (pq *ProductQuery) WithCarts(opts ...func(*CartQuery)) *ProductQuery
WithCarts tells the query-builder to eager-load the nodes that are connected to the "carts" edge. The optional arguments are used to configure the query builder of the edge.
func (*ProductQuery) WithCategories ¶
func (pq *ProductQuery) WithCategories(opts ...func(*CategoryQuery)) *ProductQuery
WithCategories tells the query-builder to eager-load the nodes that are connected to the "categories" edge. The optional arguments are used to configure the query builder of the edge.
func (*ProductQuery) WithOrderProducts ¶
func (pq *ProductQuery) WithOrderProducts(opts ...func(*OrderProductQuery)) *ProductQuery
WithOrderProducts tells the query-builder to eager-load the nodes that are connected to the "order_products" edge. The optional arguments are used to configure the query builder of the edge.
func (*ProductQuery) WithProductImages ¶
func (pq *ProductQuery) WithProductImages(opts ...func(*ProductImageQuery)) *ProductQuery
WithProductImages tells the query-builder to eager-load the nodes that are connected to the "product_images" edge. The optional arguments are used to configure the query builder of the edge.
type ProductSelect ¶
type ProductSelect struct { *ProductQuery // contains filtered or unexported fields }
ProductSelect is the builder for selecting fields of Product entities.
func (*ProductSelect) Aggregate ¶
func (ps *ProductSelect) Aggregate(fns ...AggregateFunc) *ProductSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ProductSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProductSelect) Scan ¶
func (ps *ProductSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProductSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProductUpdate ¶
type ProductUpdate struct {
// contains filtered or unexported fields
}
ProductUpdate is the builder for updating Product entities.
func (*ProductUpdate) AddAmount ¶
func (pu *ProductUpdate) AddAmount(i int64) *ProductUpdate
AddAmount adds i to the "amount" field.
func (*ProductUpdate) AddCartIDs ¶
func (pu *ProductUpdate) AddCartIDs(ids ...int64) *ProductUpdate
AddCartIDs adds the "carts" edge to the Cart entity by IDs.
func (*ProductUpdate) AddCarts ¶
func (pu *ProductUpdate) AddCarts(c ...*Cart) *ProductUpdate
AddCarts adds the "carts" edges to the Cart entity.
func (*ProductUpdate) AddOrderProductIDs ¶
func (pu *ProductUpdate) AddOrderProductIDs(ids ...int64) *ProductUpdate
AddOrderProductIDs adds the "order_products" edge to the OrderProduct entity by IDs.
func (*ProductUpdate) AddOrderProducts ¶
func (pu *ProductUpdate) AddOrderProducts(o ...*OrderProduct) *ProductUpdate
AddOrderProducts adds the "order_products" edges to the OrderProduct entity.
func (*ProductUpdate) AddPrice ¶
func (pu *ProductUpdate) AddPrice(i int64) *ProductUpdate
AddPrice adds i to the "price" field.
func (*ProductUpdate) AddProductImageIDs ¶
func (pu *ProductUpdate) AddProductImageIDs(ids ...int64) *ProductUpdate
AddProductImageIDs adds the "product_images" edge to the ProductImage entity by IDs.
func (*ProductUpdate) AddProductImages ¶
func (pu *ProductUpdate) AddProductImages(p ...*ProductImage) *ProductUpdate
AddProductImages adds the "product_images" edges to the ProductImage entity.
func (*ProductUpdate) ClearCarts ¶
func (pu *ProductUpdate) ClearCarts() *ProductUpdate
ClearCarts clears all "carts" edges to the Cart entity.
func (*ProductUpdate) ClearCategories ¶
func (pu *ProductUpdate) ClearCategories() *ProductUpdate
ClearCategories clears the "categories" edge to the Category entity.
func (*ProductUpdate) ClearDescription ¶
func (pu *ProductUpdate) ClearDescription() *ProductUpdate
ClearDescription clears the value of the "description" field.
func (*ProductUpdate) ClearOrderProducts ¶
func (pu *ProductUpdate) ClearOrderProducts() *ProductUpdate
ClearOrderProducts clears all "order_products" edges to the OrderProduct entity.
func (*ProductUpdate) ClearProductImages ¶
func (pu *ProductUpdate) ClearProductImages() *ProductUpdate
ClearProductImages clears all "product_images" edges to the ProductImage entity.
func (*ProductUpdate) Exec ¶
func (pu *ProductUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductUpdate) ExecX ¶
func (pu *ProductUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductUpdate) Mutation ¶
func (pu *ProductUpdate) Mutation() *ProductMutation
Mutation returns the ProductMutation object of the builder.
func (*ProductUpdate) RemoveCartIDs ¶
func (pu *ProductUpdate) RemoveCartIDs(ids ...int64) *ProductUpdate
RemoveCartIDs removes the "carts" edge to Cart entities by IDs.
func (*ProductUpdate) RemoveCarts ¶
func (pu *ProductUpdate) RemoveCarts(c ...*Cart) *ProductUpdate
RemoveCarts removes "carts" edges to Cart entities.
func (*ProductUpdate) RemoveOrderProductIDs ¶
func (pu *ProductUpdate) RemoveOrderProductIDs(ids ...int64) *ProductUpdate
RemoveOrderProductIDs removes the "order_products" edge to OrderProduct entities by IDs.
func (*ProductUpdate) RemoveOrderProducts ¶
func (pu *ProductUpdate) RemoveOrderProducts(o ...*OrderProduct) *ProductUpdate
RemoveOrderProducts removes "order_products" edges to OrderProduct entities.
func (*ProductUpdate) RemoveProductImageIDs ¶
func (pu *ProductUpdate) RemoveProductImageIDs(ids ...int64) *ProductUpdate
RemoveProductImageIDs removes the "product_images" edge to ProductImage entities by IDs.
func (*ProductUpdate) RemoveProductImages ¶
func (pu *ProductUpdate) RemoveProductImages(p ...*ProductImage) *ProductUpdate
RemoveProductImages removes "product_images" edges to ProductImage entities.
func (*ProductUpdate) Save ¶
func (pu *ProductUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ProductUpdate) SaveX ¶
func (pu *ProductUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ProductUpdate) SetAmount ¶
func (pu *ProductUpdate) SetAmount(i int64) *ProductUpdate
SetAmount sets the "amount" field.
func (*ProductUpdate) SetCategories ¶
func (pu *ProductUpdate) SetCategories(c *Category) *ProductUpdate
SetCategories sets the "categories" edge to the Category entity.
func (*ProductUpdate) SetCategoriesID ¶
func (pu *ProductUpdate) SetCategoriesID(id int64) *ProductUpdate
SetCategoriesID sets the "categories" edge to the Category entity by ID.
func (*ProductUpdate) SetCategoryID ¶
func (pu *ProductUpdate) SetCategoryID(i int64) *ProductUpdate
SetCategoryID sets the "category_id" field.
func (*ProductUpdate) SetDescription ¶
func (pu *ProductUpdate) SetDescription(s string) *ProductUpdate
SetDescription sets the "description" field.
func (*ProductUpdate) SetName ¶
func (pu *ProductUpdate) SetName(s string) *ProductUpdate
SetName sets the "name" field.
func (*ProductUpdate) SetNillableAmount ¶
func (pu *ProductUpdate) SetNillableAmount(i *int64) *ProductUpdate
SetNillableAmount sets the "amount" field if the given value is not nil.
func (*ProductUpdate) SetNillableCategoryID ¶
func (pu *ProductUpdate) SetNillableCategoryID(i *int64) *ProductUpdate
SetNillableCategoryID sets the "category_id" field if the given value is not nil.
func (*ProductUpdate) SetNillableDescription ¶
func (pu *ProductUpdate) SetNillableDescription(s *string) *ProductUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ProductUpdate) SetNillableName ¶
func (pu *ProductUpdate) SetNillableName(s *string) *ProductUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*ProductUpdate) SetNillablePrice ¶
func (pu *ProductUpdate) SetNillablePrice(i *int64) *ProductUpdate
SetNillablePrice sets the "price" field if the given value is not nil.
func (*ProductUpdate) SetPrice ¶
func (pu *ProductUpdate) SetPrice(i int64) *ProductUpdate
SetPrice sets the "price" field.
func (*ProductUpdate) SetUpdatedAt ¶
func (pu *ProductUpdate) SetUpdatedAt(t time.Time) *ProductUpdate
SetUpdatedAt sets the "updated_at" field.
func (*ProductUpdate) Where ¶
func (pu *ProductUpdate) Where(ps ...predicate.Product) *ProductUpdate
Where appends a list predicates to the ProductUpdate builder.
type ProductUpdateOne ¶
type ProductUpdateOne struct {
// contains filtered or unexported fields
}
ProductUpdateOne is the builder for updating a single Product entity.
func (*ProductUpdateOne) AddAmount ¶
func (puo *ProductUpdateOne) AddAmount(i int64) *ProductUpdateOne
AddAmount adds i to the "amount" field.
func (*ProductUpdateOne) AddCartIDs ¶
func (puo *ProductUpdateOne) AddCartIDs(ids ...int64) *ProductUpdateOne
AddCartIDs adds the "carts" edge to the Cart entity by IDs.
func (*ProductUpdateOne) AddCarts ¶
func (puo *ProductUpdateOne) AddCarts(c ...*Cart) *ProductUpdateOne
AddCarts adds the "carts" edges to the Cart entity.
func (*ProductUpdateOne) AddOrderProductIDs ¶
func (puo *ProductUpdateOne) AddOrderProductIDs(ids ...int64) *ProductUpdateOne
AddOrderProductIDs adds the "order_products" edge to the OrderProduct entity by IDs.
func (*ProductUpdateOne) AddOrderProducts ¶
func (puo *ProductUpdateOne) AddOrderProducts(o ...*OrderProduct) *ProductUpdateOne
AddOrderProducts adds the "order_products" edges to the OrderProduct entity.
func (*ProductUpdateOne) AddPrice ¶
func (puo *ProductUpdateOne) AddPrice(i int64) *ProductUpdateOne
AddPrice adds i to the "price" field.
func (*ProductUpdateOne) AddProductImageIDs ¶
func (puo *ProductUpdateOne) AddProductImageIDs(ids ...int64) *ProductUpdateOne
AddProductImageIDs adds the "product_images" edge to the ProductImage entity by IDs.
func (*ProductUpdateOne) AddProductImages ¶
func (puo *ProductUpdateOne) AddProductImages(p ...*ProductImage) *ProductUpdateOne
AddProductImages adds the "product_images" edges to the ProductImage entity.
func (*ProductUpdateOne) ClearCarts ¶
func (puo *ProductUpdateOne) ClearCarts() *ProductUpdateOne
ClearCarts clears all "carts" edges to the Cart entity.
func (*ProductUpdateOne) ClearCategories ¶
func (puo *ProductUpdateOne) ClearCategories() *ProductUpdateOne
ClearCategories clears the "categories" edge to the Category entity.
func (*ProductUpdateOne) ClearDescription ¶
func (puo *ProductUpdateOne) ClearDescription() *ProductUpdateOne
ClearDescription clears the value of the "description" field.
func (*ProductUpdateOne) ClearOrderProducts ¶
func (puo *ProductUpdateOne) ClearOrderProducts() *ProductUpdateOne
ClearOrderProducts clears all "order_products" edges to the OrderProduct entity.
func (*ProductUpdateOne) ClearProductImages ¶
func (puo *ProductUpdateOne) ClearProductImages() *ProductUpdateOne
ClearProductImages clears all "product_images" edges to the ProductImage entity.
func (*ProductUpdateOne) Exec ¶
func (puo *ProductUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ProductUpdateOne) ExecX ¶
func (puo *ProductUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductUpdateOne) Mutation ¶
func (puo *ProductUpdateOne) Mutation() *ProductMutation
Mutation returns the ProductMutation object of the builder.
func (*ProductUpdateOne) RemoveCartIDs ¶
func (puo *ProductUpdateOne) RemoveCartIDs(ids ...int64) *ProductUpdateOne
RemoveCartIDs removes the "carts" edge to Cart entities by IDs.
func (*ProductUpdateOne) RemoveCarts ¶
func (puo *ProductUpdateOne) RemoveCarts(c ...*Cart) *ProductUpdateOne
RemoveCarts removes "carts" edges to Cart entities.
func (*ProductUpdateOne) RemoveOrderProductIDs ¶
func (puo *ProductUpdateOne) RemoveOrderProductIDs(ids ...int64) *ProductUpdateOne
RemoveOrderProductIDs removes the "order_products" edge to OrderProduct entities by IDs.
func (*ProductUpdateOne) RemoveOrderProducts ¶
func (puo *ProductUpdateOne) RemoveOrderProducts(o ...*OrderProduct) *ProductUpdateOne
RemoveOrderProducts removes "order_products" edges to OrderProduct entities.
func (*ProductUpdateOne) RemoveProductImageIDs ¶
func (puo *ProductUpdateOne) RemoveProductImageIDs(ids ...int64) *ProductUpdateOne
RemoveProductImageIDs removes the "product_images" edge to ProductImage entities by IDs.
func (*ProductUpdateOne) RemoveProductImages ¶
func (puo *ProductUpdateOne) RemoveProductImages(p ...*ProductImage) *ProductUpdateOne
RemoveProductImages removes "product_images" edges to ProductImage entities.
func (*ProductUpdateOne) Save ¶
func (puo *ProductUpdateOne) Save(ctx context.Context) (*Product, error)
Save executes the query and returns the updated Product entity.
func (*ProductUpdateOne) SaveX ¶
func (puo *ProductUpdateOne) SaveX(ctx context.Context) *Product
SaveX is like Save, but panics if an error occurs.
func (*ProductUpdateOne) Select ¶
func (puo *ProductUpdateOne) Select(field string, fields ...string) *ProductUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ProductUpdateOne) SetAmount ¶
func (puo *ProductUpdateOne) SetAmount(i int64) *ProductUpdateOne
SetAmount sets the "amount" field.
func (*ProductUpdateOne) SetCategories ¶
func (puo *ProductUpdateOne) SetCategories(c *Category) *ProductUpdateOne
SetCategories sets the "categories" edge to the Category entity.
func (*ProductUpdateOne) SetCategoriesID ¶
func (puo *ProductUpdateOne) SetCategoriesID(id int64) *ProductUpdateOne
SetCategoriesID sets the "categories" edge to the Category entity by ID.
func (*ProductUpdateOne) SetCategoryID ¶
func (puo *ProductUpdateOne) SetCategoryID(i int64) *ProductUpdateOne
SetCategoryID sets the "category_id" field.
func (*ProductUpdateOne) SetDescription ¶
func (puo *ProductUpdateOne) SetDescription(s string) *ProductUpdateOne
SetDescription sets the "description" field.
func (*ProductUpdateOne) SetName ¶
func (puo *ProductUpdateOne) SetName(s string) *ProductUpdateOne
SetName sets the "name" field.
func (*ProductUpdateOne) SetNillableAmount ¶
func (puo *ProductUpdateOne) SetNillableAmount(i *int64) *ProductUpdateOne
SetNillableAmount sets the "amount" field if the given value is not nil.
func (*ProductUpdateOne) SetNillableCategoryID ¶
func (puo *ProductUpdateOne) SetNillableCategoryID(i *int64) *ProductUpdateOne
SetNillableCategoryID sets the "category_id" field if the given value is not nil.
func (*ProductUpdateOne) SetNillableDescription ¶
func (puo *ProductUpdateOne) SetNillableDescription(s *string) *ProductUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ProductUpdateOne) SetNillableName ¶
func (puo *ProductUpdateOne) SetNillableName(s *string) *ProductUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*ProductUpdateOne) SetNillablePrice ¶
func (puo *ProductUpdateOne) SetNillablePrice(i *int64) *ProductUpdateOne
SetNillablePrice sets the "price" field if the given value is not nil.
func (*ProductUpdateOne) SetPrice ¶
func (puo *ProductUpdateOne) SetPrice(i int64) *ProductUpdateOne
SetPrice sets the "price" field.
func (*ProductUpdateOne) SetUpdatedAt ¶
func (puo *ProductUpdateOne) SetUpdatedAt(t time.Time) *ProductUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*ProductUpdateOne) Where ¶
func (puo *ProductUpdateOne) Where(ps ...predicate.Product) *ProductUpdateOne
Where appends a list predicates to the ProductUpdate builder.
type ProductUpsert ¶
ProductUpsert is the "OnConflict" setter.
func (*ProductUpsert) AddAmount ¶
func (u *ProductUpsert) AddAmount(v int64) *ProductUpsert
AddAmount adds v to the "amount" field.
func (*ProductUpsert) AddPrice ¶
func (u *ProductUpsert) AddPrice(v int64) *ProductUpsert
AddPrice adds v to the "price" field.
func (*ProductUpsert) ClearDescription ¶
func (u *ProductUpsert) ClearDescription() *ProductUpsert
ClearDescription clears the value of the "description" field.
func (*ProductUpsert) SetAmount ¶
func (u *ProductUpsert) SetAmount(v int64) *ProductUpsert
SetAmount sets the "amount" field.
func (*ProductUpsert) SetCategoryID ¶
func (u *ProductUpsert) SetCategoryID(v int64) *ProductUpsert
SetCategoryID sets the "category_id" field.
func (*ProductUpsert) SetDescription ¶
func (u *ProductUpsert) SetDescription(v string) *ProductUpsert
SetDescription sets the "description" field.
func (*ProductUpsert) SetName ¶
func (u *ProductUpsert) SetName(v string) *ProductUpsert
SetName sets the "name" field.
func (*ProductUpsert) SetPrice ¶
func (u *ProductUpsert) SetPrice(v int64) *ProductUpsert
SetPrice sets the "price" field.
func (*ProductUpsert) SetUpdatedAt ¶
func (u *ProductUpsert) SetUpdatedAt(v time.Time) *ProductUpsert
SetUpdatedAt sets the "updated_at" field.
func (*ProductUpsert) UpdateAmount ¶
func (u *ProductUpsert) UpdateAmount() *ProductUpsert
UpdateAmount sets the "amount" field to the value that was provided on create.
func (*ProductUpsert) UpdateCategoryID ¶
func (u *ProductUpsert) UpdateCategoryID() *ProductUpsert
UpdateCategoryID sets the "category_id" field to the value that was provided on create.
func (*ProductUpsert) UpdateDescription ¶
func (u *ProductUpsert) UpdateDescription() *ProductUpsert
UpdateDescription sets the "description" field to the value that was provided on create.
func (*ProductUpsert) UpdateName ¶
func (u *ProductUpsert) UpdateName() *ProductUpsert
UpdateName sets the "name" field to the value that was provided on create.
func (*ProductUpsert) UpdatePrice ¶
func (u *ProductUpsert) UpdatePrice() *ProductUpsert
UpdatePrice sets the "price" field to the value that was provided on create.
func (*ProductUpsert) UpdateUpdatedAt ¶
func (u *ProductUpsert) UpdateUpdatedAt() *ProductUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type ProductUpsertBulk ¶
type ProductUpsertBulk struct {
// contains filtered or unexported fields
}
ProductUpsertBulk is the builder for "upsert"-ing a bulk of Product nodes.
func (*ProductUpsertBulk) AddAmount ¶
func (u *ProductUpsertBulk) AddAmount(v int64) *ProductUpsertBulk
AddAmount adds v to the "amount" field.
func (*ProductUpsertBulk) AddPrice ¶
func (u *ProductUpsertBulk) AddPrice(v int64) *ProductUpsertBulk
AddPrice adds v to the "price" field.
func (*ProductUpsertBulk) ClearDescription ¶
func (u *ProductUpsertBulk) ClearDescription() *ProductUpsertBulk
ClearDescription clears the value of the "description" field.
func (*ProductUpsertBulk) DoNothing ¶
func (u *ProductUpsertBulk) DoNothing() *ProductUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ProductUpsertBulk) Exec ¶
func (u *ProductUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductUpsertBulk) ExecX ¶
func (u *ProductUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductUpsertBulk) Ignore ¶
func (u *ProductUpsertBulk) Ignore() *ProductUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Product.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ProductUpsertBulk) SetAmount ¶
func (u *ProductUpsertBulk) SetAmount(v int64) *ProductUpsertBulk
SetAmount sets the "amount" field.
func (*ProductUpsertBulk) SetCategoryID ¶
func (u *ProductUpsertBulk) SetCategoryID(v int64) *ProductUpsertBulk
SetCategoryID sets the "category_id" field.
func (*ProductUpsertBulk) SetDescription ¶
func (u *ProductUpsertBulk) SetDescription(v string) *ProductUpsertBulk
SetDescription sets the "description" field.
func (*ProductUpsertBulk) SetName ¶
func (u *ProductUpsertBulk) SetName(v string) *ProductUpsertBulk
SetName sets the "name" field.
func (*ProductUpsertBulk) SetPrice ¶
func (u *ProductUpsertBulk) SetPrice(v int64) *ProductUpsertBulk
SetPrice sets the "price" field.
func (*ProductUpsertBulk) SetUpdatedAt ¶
func (u *ProductUpsertBulk) SetUpdatedAt(v time.Time) *ProductUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*ProductUpsertBulk) Update ¶
func (u *ProductUpsertBulk) Update(set func(*ProductUpsert)) *ProductUpsertBulk
Update allows overriding fields `UPDATE` values. See the ProductCreateBulk.OnConflict documentation for more info.
func (*ProductUpsertBulk) UpdateAmount ¶
func (u *ProductUpsertBulk) UpdateAmount() *ProductUpsertBulk
UpdateAmount sets the "amount" field to the value that was provided on create.
func (*ProductUpsertBulk) UpdateCategoryID ¶
func (u *ProductUpsertBulk) UpdateCategoryID() *ProductUpsertBulk
UpdateCategoryID sets the "category_id" field to the value that was provided on create.
func (*ProductUpsertBulk) UpdateDescription ¶
func (u *ProductUpsertBulk) UpdateDescription() *ProductUpsertBulk
UpdateDescription sets the "description" field to the value that was provided on create.
func (*ProductUpsertBulk) UpdateName ¶
func (u *ProductUpsertBulk) UpdateName() *ProductUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*ProductUpsertBulk) UpdateNewValues ¶
func (u *ProductUpsertBulk) UpdateNewValues() *ProductUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Product.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*ProductUpsertBulk) UpdatePrice ¶
func (u *ProductUpsertBulk) UpdatePrice() *ProductUpsertBulk
UpdatePrice sets the "price" field to the value that was provided on create.
func (*ProductUpsertBulk) UpdateUpdatedAt ¶
func (u *ProductUpsertBulk) UpdateUpdatedAt() *ProductUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type ProductUpsertOne ¶
type ProductUpsertOne struct {
// contains filtered or unexported fields
}
ProductUpsertOne is the builder for "upsert"-ing
one Product node.
func (*ProductUpsertOne) AddAmount ¶
func (u *ProductUpsertOne) AddAmount(v int64) *ProductUpsertOne
AddAmount adds v to the "amount" field.
func (*ProductUpsertOne) AddPrice ¶
func (u *ProductUpsertOne) AddPrice(v int64) *ProductUpsertOne
AddPrice adds v to the "price" field.
func (*ProductUpsertOne) ClearDescription ¶
func (u *ProductUpsertOne) ClearDescription() *ProductUpsertOne
ClearDescription clears the value of the "description" field.
func (*ProductUpsertOne) DoNothing ¶
func (u *ProductUpsertOne) DoNothing() *ProductUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ProductUpsertOne) Exec ¶
func (u *ProductUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*ProductUpsertOne) ExecX ¶
func (u *ProductUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProductUpsertOne) ID ¶
func (u *ProductUpsertOne) ID(ctx context.Context) (id int64, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*ProductUpsertOne) IDX ¶
func (u *ProductUpsertOne) IDX(ctx context.Context) int64
IDX is like ID, but panics if an error occurs.
func (*ProductUpsertOne) Ignore ¶
func (u *ProductUpsertOne) Ignore() *ProductUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Product.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ProductUpsertOne) SetAmount ¶
func (u *ProductUpsertOne) SetAmount(v int64) *ProductUpsertOne
SetAmount sets the "amount" field.
func (*ProductUpsertOne) SetCategoryID ¶
func (u *ProductUpsertOne) SetCategoryID(v int64) *ProductUpsertOne
SetCategoryID sets the "category_id" field.
func (*ProductUpsertOne) SetDescription ¶
func (u *ProductUpsertOne) SetDescription(v string) *ProductUpsertOne
SetDescription sets the "description" field.
func (*ProductUpsertOne) SetName ¶
func (u *ProductUpsertOne) SetName(v string) *ProductUpsertOne
SetName sets the "name" field.
func (*ProductUpsertOne) SetPrice ¶
func (u *ProductUpsertOne) SetPrice(v int64) *ProductUpsertOne
SetPrice sets the "price" field.
func (*ProductUpsertOne) SetUpdatedAt ¶
func (u *ProductUpsertOne) SetUpdatedAt(v time.Time) *ProductUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*ProductUpsertOne) Update ¶
func (u *ProductUpsertOne) Update(set func(*ProductUpsert)) *ProductUpsertOne
Update allows overriding fields `UPDATE` values. See the ProductCreate.OnConflict documentation for more info.
func (*ProductUpsertOne) UpdateAmount ¶
func (u *ProductUpsertOne) UpdateAmount() *ProductUpsertOne
UpdateAmount sets the "amount" field to the value that was provided on create.
func (*ProductUpsertOne) UpdateCategoryID ¶
func (u *ProductUpsertOne) UpdateCategoryID() *ProductUpsertOne
UpdateCategoryID sets the "category_id" field to the value that was provided on create.
func (*ProductUpsertOne) UpdateDescription ¶
func (u *ProductUpsertOne) UpdateDescription() *ProductUpsertOne
UpdateDescription sets the "description" field to the value that was provided on create.
func (*ProductUpsertOne) UpdateName ¶
func (u *ProductUpsertOne) UpdateName() *ProductUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*ProductUpsertOne) UpdateNewValues ¶
func (u *ProductUpsertOne) UpdateNewValues() *ProductUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Product.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*ProductUpsertOne) UpdatePrice ¶
func (u *ProductUpsertOne) UpdatePrice() *ProductUpsertOne
UpdatePrice sets the "price" field to the value that was provided on create.
func (*ProductUpsertOne) UpdateUpdatedAt ¶
func (u *ProductUpsertOne) UpdateUpdatedAt() *ProductUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
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 ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(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 ¶
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 Tx ¶
type Tx struct { // Address is the client for interacting with the Address builders. Address *AddressClient // Cart is the client for interacting with the Cart builders. Cart *CartClient // Category is the client for interacting with the Category builders. Category *CategoryClient // Order is the client for interacting with the Order builders. Order *OrderClient // OrderProduct is the client for interacting with the OrderProduct builders. OrderProduct *OrderProductClient // Product is the client for interacting with the Product builders. Product *ProductClient // ProductImage is the client for interacting with the ProductImage builders. ProductImage *ProductImageClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Phone holds the value of the "phone" field. Phone string `json:"phone,omitempty"` // Email holds the value of the "email" field. Email string `json:"email,omitempty"` // Role holds the value of the "role" field. Role user.Role `json:"role,omitempty"` // Password holds the value of the "password" field. Password string `json:"-"` // 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) QueryAddresses ¶
func (u *User) QueryAddresses() *AddressQuery
QueryAddresses queries the "addresses" edge of the User entity.
func (*User) QueryCarts ¶
QueryCarts queries the "carts" edge of the User entity.
func (*User) QueryOrders ¶
func (u *User) QueryOrders() *OrderQuery
QueryOrders queries the "orders" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a 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 int64) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int64) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryAddresses ¶
func (c *UserClient) QueryAddresses(u *User) *AddressQuery
QueryAddresses queries the addresses edge of a User.
func (*UserClient) QueryCarts ¶
func (c *UserClient) QueryCarts(u *User) *CartQuery
QueryCarts queries the carts edge of a User.
func (*UserClient) QueryOrders ¶
func (c *UserClient) QueryOrders(u *User) *OrderQuery
QueryOrders queries the orders 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 int64) *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) AddAddressIDs ¶
func (uc *UserCreate) AddAddressIDs(ids ...int64) *UserCreate
AddAddressIDs adds the "addresses" edge to the Address entity by IDs.
func (*UserCreate) AddAddresses ¶
func (uc *UserCreate) AddAddresses(a ...*Address) *UserCreate
AddAddresses adds the "addresses" edges to the Address entity.
func (*UserCreate) AddCartIDs ¶
func (uc *UserCreate) AddCartIDs(ids ...int64) *UserCreate
AddCartIDs adds the "carts" edge to the Cart entity by IDs.
func (*UserCreate) AddCarts ¶
func (uc *UserCreate) AddCarts(c ...*Cart) *UserCreate
AddCarts adds the "carts" edges to the Cart entity.
func (*UserCreate) AddOrderIDs ¶
func (uc *UserCreate) AddOrderIDs(ids ...int64) *UserCreate
AddOrderIDs adds the "orders" edge to the Order entity by IDs.
func (*UserCreate) AddOrders ¶
func (uc *UserCreate) AddOrders(o ...*Order) *UserCreate
AddOrders adds the "orders" edges to the Order entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) OnConflict ¶
func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.User.Create(). SetCreatedAt(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.UserUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*UserCreate) OnConflictColumns ¶
func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetCreatedAt ¶
func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
SetCreatedAt sets the "created_at" field.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetName ¶
func (uc *UserCreate) SetName(s string) *UserCreate
SetName sets the "name" 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) SetNillableRole ¶
func (uc *UserCreate) SetNillableRole(u *user.Role) *UserCreate
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserCreate) SetNillableUpdatedAt ¶
func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserCreate) SetPassword ¶
func (uc *UserCreate) SetPassword(s string) *UserCreate
SetPassword sets the "password" field.
func (*UserCreate) SetPhone ¶
func (uc *UserCreate) SetPhone(s string) *UserCreate
SetPhone sets the "phone" field.
func (*UserCreate) SetRole ¶
func (uc *UserCreate) SetRole(u user.Role) *UserCreate
SetRole sets the "role" field.
func (*UserCreate) SetUpdatedAt ¶
func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
SetUpdatedAt sets the "updated_at" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreateBulk) OnConflict ¶
func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.User.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.UserUpsert) { SetCreatedAt(v+v). }). Exec(ctx)
func (*UserCreateBulk) OnConflictColumns ¶
func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
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 { // Addresses holds the value of the addresses edge. Addresses []*Address `json:"addresses,omitempty"` // Carts holds the value of the carts edge. Carts []*Cart `json:"carts,omitempty"` // Orders holds the value of the orders edge. Orders []*Order `json:"orders,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) AddressesOrErr ¶
AddressesOrErr returns the Addresses value or an error if the edge was not loaded in eager-loading.
func (UserEdges) CartsOrErr ¶
CartsOrErr returns the Carts value or an error if the edge was not loaded in eager-loading.
func (UserEdges) OrdersOrErr ¶
OrdersOrErr returns the Orders 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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddAddressIDs ¶
func (m *UserMutation) AddAddressIDs(ids ...int64)
AddAddressIDs adds the "addresses" edge to the Address entity by ids.
func (*UserMutation) AddCartIDs ¶
func (m *UserMutation) AddCartIDs(ids ...int64)
AddCartIDs adds the "carts" edge to the Cart 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) AddOrderIDs ¶
func (m *UserMutation) AddOrderIDs(ids ...int64)
AddOrderIDs adds the "orders" edge to the Order entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) AddressesCleared ¶
func (m *UserMutation) AddressesCleared() bool
AddressesCleared reports if the "addresses" edge to the Address entity was cleared.
func (*UserMutation) AddressesIDs ¶
func (m *UserMutation) AddressesIDs() (ids []int64)
AddressesIDs returns the "addresses" edge IDs in the mutation.
func (*UserMutation) CartsCleared ¶
func (m *UserMutation) CartsCleared() bool
CartsCleared reports if the "carts" edge to the Cart entity was cleared.
func (*UserMutation) CartsIDs ¶
func (m *UserMutation) CartsIDs() (ids []int64)
CartsIDs returns the "carts" edge IDs in the mutation.
func (*UserMutation) ClearAddresses ¶
func (m *UserMutation) ClearAddresses()
ClearAddresses clears the "addresses" edge to the Address entity.
func (*UserMutation) ClearCarts ¶
func (m *UserMutation) ClearCarts()
ClearCarts clears the "carts" edge to the Cart 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) ClearOrders ¶
func (m *UserMutation) ClearOrders()
ClearOrders clears the "orders" edge to the Order 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) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int64, 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) ([]int64, 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) Name ¶
func (m *UserMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*UserMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) OldName ¶
func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldPassword ¶
func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
OldPassword returns the old "password" 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) OldPhone ¶
func (m *UserMutation) OldPhone(ctx context.Context) (v string, err error)
OldPhone returns the old "phone" 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) OldRole ¶
OldRole returns the old "role" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OrdersCleared ¶
func (m *UserMutation) OrdersCleared() bool
OrdersCleared reports if the "orders" edge to the Order entity was cleared.
func (*UserMutation) OrdersIDs ¶
func (m *UserMutation) OrdersIDs() (ids []int64)
OrdersIDs returns the "orders" edge IDs in the mutation.
func (*UserMutation) Password ¶
func (m *UserMutation) Password() (r string, exists bool)
Password returns the value of the "password" field in the mutation.
func (*UserMutation) Phone ¶
func (m *UserMutation) Phone() (r string, exists bool)
Phone returns the value of the "phone" field in the mutation.
func (*UserMutation) RemoveAddressIDs ¶
func (m *UserMutation) RemoveAddressIDs(ids ...int64)
RemoveAddressIDs removes the "addresses" edge to the Address entity by IDs.
func (*UserMutation) RemoveCartIDs ¶
func (m *UserMutation) RemoveCartIDs(ids ...int64)
RemoveCartIDs removes the "carts" edge to the Cart entity by IDs.
func (*UserMutation) RemoveOrderIDs ¶
func (m *UserMutation) RemoveOrderIDs(ids ...int64)
RemoveOrderIDs removes the "orders" edge to the Order entity by IDs.
func (*UserMutation) RemovedAddressesIDs ¶
func (m *UserMutation) RemovedAddressesIDs() (ids []int64)
RemovedAddresses returns the removed IDs of the "addresses" edge to the Address entity.
func (*UserMutation) RemovedCartsIDs ¶
func (m *UserMutation) RemovedCartsIDs() (ids []int64)
RemovedCarts returns the removed IDs of the "carts" edge to the Cart entity.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) RemovedOrdersIDs ¶
func (m *UserMutation) RemovedOrdersIDs() (ids []int64)
RemovedOrders returns the removed IDs of the "orders" edge to the Order entity.
func (*UserMutation) ResetAddresses ¶
func (m *UserMutation) ResetAddresses()
ResetAddresses resets all changes to the "addresses" edge.
func (*UserMutation) ResetCarts ¶
func (m *UserMutation) ResetCarts()
ResetCarts resets all changes to the "carts" edge.
func (*UserMutation) ResetCreatedAt ¶
func (m *UserMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetName ¶
func (m *UserMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*UserMutation) ResetOrders ¶
func (m *UserMutation) ResetOrders()
ResetOrders resets all changes to the "orders" edge.
func (*UserMutation) ResetPassword ¶
func (m *UserMutation) ResetPassword()
ResetPassword resets all changes to the "password" field.
func (*UserMutation) ResetPhone ¶
func (m *UserMutation) ResetPhone()
ResetPhone resets all changes to the "phone" field.
func (*UserMutation) ResetRole ¶
func (m *UserMutation) ResetRole()
ResetRole resets all changes to the "role" field.
func (*UserMutation) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) Role ¶
func (m *UserMutation) Role() (r user.Role, exists bool)
Role returns the value of the "role" field in the mutation.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetName ¶
func (m *UserMutation) SetName(s string)
SetName sets the "name" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPassword ¶
func (m *UserMutation) SetPassword(s string)
SetPassword sets the "password" field.
func (*UserMutation) SetPhone ¶
func (m *UserMutation) SetPhone(s string)
SetPhone sets the "phone" field.
func (*UserMutation) SetRole ¶
func (m *UserMutation) SetRole(u user.Role)
SetRole sets the "role" field.
func (*UserMutation) SetUpdatedAt ¶
func (m *UserMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) UpdatedAt ¶
func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryAddresses ¶
func (uq *UserQuery) QueryAddresses() *AddressQuery
QueryAddresses chains the current query on the "addresses" edge.
func (*UserQuery) QueryCarts ¶
QueryCarts chains the current query on the "carts" edge.
func (*UserQuery) QueryOrders ¶
func (uq *UserQuery) QueryOrders() *OrderQuery
QueryOrders chains the current query on the "orders" 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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.User.Query(). Select(user.FieldCreatedAt). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithAddresses ¶
func (uq *UserQuery) WithAddresses(opts ...func(*AddressQuery)) *UserQuery
WithAddresses tells the query-builder to eager-load the nodes that are connected to the "addresses" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithCarts ¶
WithCarts tells the query-builder to eager-load the nodes that are connected to the "carts" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithOrders ¶
func (uq *UserQuery) WithOrders(opts ...func(*OrderQuery)) *UserQuery
WithOrders tells the query-builder to eager-load the nodes that are connected to the "orders" 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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddAddressIDs ¶
func (uu *UserUpdate) AddAddressIDs(ids ...int64) *UserUpdate
AddAddressIDs adds the "addresses" edge to the Address entity by IDs.
func (*UserUpdate) AddAddresses ¶
func (uu *UserUpdate) AddAddresses(a ...*Address) *UserUpdate
AddAddresses adds the "addresses" edges to the Address entity.
func (*UserUpdate) AddCartIDs ¶
func (uu *UserUpdate) AddCartIDs(ids ...int64) *UserUpdate
AddCartIDs adds the "carts" edge to the Cart entity by IDs.
func (*UserUpdate) AddCarts ¶
func (uu *UserUpdate) AddCarts(c ...*Cart) *UserUpdate
AddCarts adds the "carts" edges to the Cart entity.
func (*UserUpdate) AddOrderIDs ¶
func (uu *UserUpdate) AddOrderIDs(ids ...int64) *UserUpdate
AddOrderIDs adds the "orders" edge to the Order entity by IDs.
func (*UserUpdate) AddOrders ¶
func (uu *UserUpdate) AddOrders(o ...*Order) *UserUpdate
AddOrders adds the "orders" edges to the Order entity.
func (*UserUpdate) ClearAddresses ¶
func (uu *UserUpdate) ClearAddresses() *UserUpdate
ClearAddresses clears all "addresses" edges to the Address entity.
func (*UserUpdate) ClearCarts ¶
func (uu *UserUpdate) ClearCarts() *UserUpdate
ClearCarts clears all "carts" edges to the Cart entity.
func (*UserUpdate) ClearOrders ¶
func (uu *UserUpdate) ClearOrders() *UserUpdate
ClearOrders clears all "orders" edges to the Order 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) RemoveAddressIDs ¶
func (uu *UserUpdate) RemoveAddressIDs(ids ...int64) *UserUpdate
RemoveAddressIDs removes the "addresses" edge to Address entities by IDs.
func (*UserUpdate) RemoveAddresses ¶
func (uu *UserUpdate) RemoveAddresses(a ...*Address) *UserUpdate
RemoveAddresses removes "addresses" edges to Address entities.
func (*UserUpdate) RemoveCartIDs ¶
func (uu *UserUpdate) RemoveCartIDs(ids ...int64) *UserUpdate
RemoveCartIDs removes the "carts" edge to Cart entities by IDs.
func (*UserUpdate) RemoveCarts ¶
func (uu *UserUpdate) RemoveCarts(c ...*Cart) *UserUpdate
RemoveCarts removes "carts" edges to Cart entities.
func (*UserUpdate) RemoveOrderIDs ¶
func (uu *UserUpdate) RemoveOrderIDs(ids ...int64) *UserUpdate
RemoveOrderIDs removes the "orders" edge to Order entities by IDs.
func (*UserUpdate) RemoveOrders ¶
func (uu *UserUpdate) RemoveOrders(o ...*Order) *UserUpdate
RemoveOrders removes "orders" edges to Order 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) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetName ¶
func (uu *UserUpdate) SetName(s string) *UserUpdate
SetName sets the "name" field.
func (*UserUpdate) SetNillableEmail ¶
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetNillableName ¶
func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdate) SetNillablePassword ¶
func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UserUpdate) SetNillablePhone ¶
func (uu *UserUpdate) SetNillablePhone(s *string) *UserUpdate
SetNillablePhone sets the "phone" field if the given value is not nil.
func (*UserUpdate) SetNillableRole ¶
func (uu *UserUpdate) SetNillableRole(u *user.Role) *UserUpdate
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserUpdate) SetPassword ¶
func (uu *UserUpdate) SetPassword(s string) *UserUpdate
SetPassword sets the "password" field.
func (*UserUpdate) SetPhone ¶
func (uu *UserUpdate) SetPhone(s string) *UserUpdate
SetPhone sets the "phone" field.
func (*UserUpdate) SetRole ¶
func (uu *UserUpdate) SetRole(u user.Role) *UserUpdate
SetRole sets the "role" field.
func (*UserUpdate) SetUpdatedAt ¶
func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddAddressIDs ¶
func (uuo *UserUpdateOne) AddAddressIDs(ids ...int64) *UserUpdateOne
AddAddressIDs adds the "addresses" edge to the Address entity by IDs.
func (*UserUpdateOne) AddAddresses ¶
func (uuo *UserUpdateOne) AddAddresses(a ...*Address) *UserUpdateOne
AddAddresses adds the "addresses" edges to the Address entity.
func (*UserUpdateOne) AddCartIDs ¶
func (uuo *UserUpdateOne) AddCartIDs(ids ...int64) *UserUpdateOne
AddCartIDs adds the "carts" edge to the Cart entity by IDs.
func (*UserUpdateOne) AddCarts ¶
func (uuo *UserUpdateOne) AddCarts(c ...*Cart) *UserUpdateOne
AddCarts adds the "carts" edges to the Cart entity.
func (*UserUpdateOne) AddOrderIDs ¶
func (uuo *UserUpdateOne) AddOrderIDs(ids ...int64) *UserUpdateOne
AddOrderIDs adds the "orders" edge to the Order entity by IDs.
func (*UserUpdateOne) AddOrders ¶
func (uuo *UserUpdateOne) AddOrders(o ...*Order) *UserUpdateOne
AddOrders adds the "orders" edges to the Order entity.
func (*UserUpdateOne) ClearAddresses ¶
func (uuo *UserUpdateOne) ClearAddresses() *UserUpdateOne
ClearAddresses clears all "addresses" edges to the Address entity.
func (*UserUpdateOne) ClearCarts ¶
func (uuo *UserUpdateOne) ClearCarts() *UserUpdateOne
ClearCarts clears all "carts" edges to the Cart entity.
func (*UserUpdateOne) ClearOrders ¶
func (uuo *UserUpdateOne) ClearOrders() *UserUpdateOne
ClearOrders clears all "orders" edges to the Order 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) RemoveAddressIDs ¶
func (uuo *UserUpdateOne) RemoveAddressIDs(ids ...int64) *UserUpdateOne
RemoveAddressIDs removes the "addresses" edge to Address entities by IDs.
func (*UserUpdateOne) RemoveAddresses ¶
func (uuo *UserUpdateOne) RemoveAddresses(a ...*Address) *UserUpdateOne
RemoveAddresses removes "addresses" edges to Address entities.
func (*UserUpdateOne) RemoveCartIDs ¶
func (uuo *UserUpdateOne) RemoveCartIDs(ids ...int64) *UserUpdateOne
RemoveCartIDs removes the "carts" edge to Cart entities by IDs.
func (*UserUpdateOne) RemoveCarts ¶
func (uuo *UserUpdateOne) RemoveCarts(c ...*Cart) *UserUpdateOne
RemoveCarts removes "carts" edges to Cart entities.
func (*UserUpdateOne) RemoveOrderIDs ¶
func (uuo *UserUpdateOne) RemoveOrderIDs(ids ...int64) *UserUpdateOne
RemoveOrderIDs removes the "orders" edge to Order entities by IDs.
func (*UserUpdateOne) RemoveOrders ¶
func (uuo *UserUpdateOne) RemoveOrders(o ...*Order) *UserUpdateOne
RemoveOrders removes "orders" edges to Order 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) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetName ¶
func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
SetName sets the "name" field.
func (*UserUpdateOne) SetNillableEmail ¶
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetNillableName ¶
func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePassword ¶
func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePhone ¶
func (uuo *UserUpdateOne) SetNillablePhone(s *string) *UserUpdateOne
SetNillablePhone sets the "phone" field if the given value is not nil.
func (*UserUpdateOne) SetNillableRole ¶
func (uuo *UserUpdateOne) SetNillableRole(u *user.Role) *UserUpdateOne
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserUpdateOne) SetPassword ¶
func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
SetPassword sets the "password" field.
func (*UserUpdateOne) SetPhone ¶
func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne
SetPhone sets the "phone" field.
func (*UserUpdateOne) SetRole ¶
func (uuo *UserUpdateOne) SetRole(u user.Role) *UserUpdateOne
SetRole sets the "role" field.
func (*UserUpdateOne) SetUpdatedAt ¶
func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type UserUpsert ¶
UserUpsert is the "OnConflict" setter.
func (*UserUpsert) SetEmail ¶
func (u *UserUpsert) SetEmail(v string) *UserUpsert
SetEmail sets the "email" field.
func (*UserUpsert) SetName ¶
func (u *UserUpsert) SetName(v string) *UserUpsert
SetName sets the "name" field.
func (*UserUpsert) SetPassword ¶
func (u *UserUpsert) SetPassword(v string) *UserUpsert
SetPassword sets the "password" field.
func (*UserUpsert) SetPhone ¶
func (u *UserUpsert) SetPhone(v string) *UserUpsert
SetPhone sets the "phone" field.
func (*UserUpsert) SetRole ¶
func (u *UserUpsert) SetRole(v user.Role) *UserUpsert
SetRole sets the "role" field.
func (*UserUpsert) SetUpdatedAt ¶
func (u *UserUpsert) SetUpdatedAt(v time.Time) *UserUpsert
SetUpdatedAt sets the "updated_at" field.
func (*UserUpsert) UpdateEmail ¶
func (u *UserUpsert) UpdateEmail() *UserUpsert
UpdateEmail sets the "email" field to the value that was provided on create.
func (*UserUpsert) UpdateName ¶
func (u *UserUpsert) UpdateName() *UserUpsert
UpdateName sets the "name" field to the value that was provided on create.
func (*UserUpsert) UpdatePassword ¶
func (u *UserUpsert) UpdatePassword() *UserUpsert
UpdatePassword sets the "password" field to the value that was provided on create.
func (*UserUpsert) UpdatePhone ¶
func (u *UserUpsert) UpdatePhone() *UserUpsert
UpdatePhone sets the "phone" field to the value that was provided on create.
func (*UserUpsert) UpdateRole ¶
func (u *UserUpsert) UpdateRole() *UserUpsert
UpdateRole sets the "role" field to the value that was provided on create.
func (*UserUpsert) UpdateUpdatedAt ¶
func (u *UserUpsert) UpdateUpdatedAt() *UserUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type UserUpsertBulk ¶
type UserUpsertBulk struct {
// contains filtered or unexported fields
}
UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.
func (*UserUpsertBulk) DoNothing ¶
func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserUpsertBulk) Exec ¶
func (u *UserUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpsertBulk) ExecX ¶
func (u *UserUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpsertBulk) Ignore ¶
func (u *UserUpsertBulk) Ignore() *UserUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserUpsertBulk) SetEmail ¶
func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk
SetEmail sets the "email" field.
func (*UserUpsertBulk) SetName ¶
func (u *UserUpsertBulk) SetName(v string) *UserUpsertBulk
SetName sets the "name" field.
func (*UserUpsertBulk) SetPassword ¶
func (u *UserUpsertBulk) SetPassword(v string) *UserUpsertBulk
SetPassword sets the "password" field.
func (*UserUpsertBulk) SetPhone ¶
func (u *UserUpsertBulk) SetPhone(v string) *UserUpsertBulk
SetPhone sets the "phone" field.
func (*UserUpsertBulk) SetRole ¶
func (u *UserUpsertBulk) SetRole(v user.Role) *UserUpsertBulk
SetRole sets the "role" field.
func (*UserUpsertBulk) SetUpdatedAt ¶
func (u *UserUpsertBulk) SetUpdatedAt(v time.Time) *UserUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*UserUpsertBulk) Update ¶
func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk
Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.
func (*UserUpsertBulk) UpdateEmail ¶
func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk
UpdateEmail sets the "email" field to the value that was provided on create.
func (*UserUpsertBulk) UpdateName ¶
func (u *UserUpsertBulk) UpdateName() *UserUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*UserUpsertBulk) UpdateNewValues ¶
func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.User.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*UserUpsertBulk) UpdatePassword ¶
func (u *UserUpsertBulk) UpdatePassword() *UserUpsertBulk
UpdatePassword sets the "password" field to the value that was provided on create.
func (*UserUpsertBulk) UpdatePhone ¶
func (u *UserUpsertBulk) UpdatePhone() *UserUpsertBulk
UpdatePhone sets the "phone" field to the value that was provided on create.
func (*UserUpsertBulk) UpdateRole ¶
func (u *UserUpsertBulk) UpdateRole() *UserUpsertBulk
UpdateRole sets the "role" field to the value that was provided on create.
func (*UserUpsertBulk) UpdateUpdatedAt ¶
func (u *UserUpsertBulk) UpdateUpdatedAt() *UserUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type UserUpsertOne ¶
type UserUpsertOne struct {
// contains filtered or unexported fields
}
UserUpsertOne is the builder for "upsert"-ing
one User node.
func (*UserUpsertOne) DoNothing ¶
func (u *UserUpsertOne) DoNothing() *UserUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserUpsertOne) Exec ¶
func (u *UserUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpsertOne) ExecX ¶
func (u *UserUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpsertOne) ID ¶
func (u *UserUpsertOne) ID(ctx context.Context) (id int64, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*UserUpsertOne) IDX ¶
func (u *UserUpsertOne) IDX(ctx context.Context) int64
IDX is like ID, but panics if an error occurs.
func (*UserUpsertOne) Ignore ¶
func (u *UserUpsertOne) Ignore() *UserUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserUpsertOne) SetEmail ¶
func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne
SetEmail sets the "email" field.
func (*UserUpsertOne) SetName ¶
func (u *UserUpsertOne) SetName(v string) *UserUpsertOne
SetName sets the "name" field.
func (*UserUpsertOne) SetPassword ¶
func (u *UserUpsertOne) SetPassword(v string) *UserUpsertOne
SetPassword sets the "password" field.
func (*UserUpsertOne) SetPhone ¶
func (u *UserUpsertOne) SetPhone(v string) *UserUpsertOne
SetPhone sets the "phone" field.
func (*UserUpsertOne) SetRole ¶
func (u *UserUpsertOne) SetRole(v user.Role) *UserUpsertOne
SetRole sets the "role" field.
func (*UserUpsertOne) SetUpdatedAt ¶
func (u *UserUpsertOne) SetUpdatedAt(v time.Time) *UserUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpsertOne) Update ¶
func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne
Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.
func (*UserUpsertOne) UpdateEmail ¶
func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne
UpdateEmail sets the "email" field to the value that was provided on create.
func (*UserUpsertOne) UpdateName ¶
func (u *UserUpsertOne) UpdateName() *UserUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*UserUpsertOne) UpdateNewValues ¶
func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.User.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*UserUpsertOne) UpdatePassword ¶
func (u *UserUpsertOne) UpdatePassword() *UserUpsertOne
UpdatePassword sets the "password" field to the value that was provided on create.
func (*UserUpsertOne) UpdatePhone ¶
func (u *UserUpsertOne) UpdatePhone() *UserUpsertOne
UpdatePhone sets the "phone" field to the value that was provided on create.
func (*UserUpsertOne) UpdateRole ¶
func (u *UserUpsertOne) UpdateRole() *UserUpsertOne
UpdateRole sets the "role" field to the value that was provided on create.
func (*UserUpsertOne) UpdateUpdatedAt ¶
func (u *UserUpsertOne) UpdateUpdatedAt() *UserUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type 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.
Source Files
¶
- address.go
- address_create.go
- address_delete.go
- address_query.go
- address_update.go
- cart.go
- cart_create.go
- cart_delete.go
- cart_query.go
- cart_update.go
- category.go
- category_create.go
- category_delete.go
- category_query.go
- category_update.go
- client.go
- ent.go
- generate.go
- migrations.go
- mutation.go
- order.go
- order_create.go
- order_delete.go
- order_query.go
- order_update.go
- orderproduct.go
- orderproduct_create.go
- orderproduct_delete.go
- orderproduct_query.go
- orderproduct_update.go
- product.go
- product_create.go
- product_delete.go
- product_query.go
- product_update.go
- productimage.go
- productimage_create.go
- productimage_delete.go
- productimage_query.go
- productimage_update.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go