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 Activities
- type Activity
- type ActivityClient
- func (c *ActivityClient) Create() *ActivityCreate
- func (c *ActivityClient) CreateBulk(builders ...*ActivityCreate) *ActivityCreateBulk
- func (c *ActivityClient) Delete() *ActivityDelete
- func (c *ActivityClient) DeleteOne(a *Activity) *ActivityDeleteOne
- func (c *ActivityClient) DeleteOneID(id int) *ActivityDeleteOne
- func (c *ActivityClient) Get(ctx context.Context, id int) (*Activity, error)
- func (c *ActivityClient) GetX(ctx context.Context, id int) *Activity
- func (c *ActivityClient) Hooks() []Hook
- func (c *ActivityClient) Intercept(interceptors ...Interceptor)
- func (c *ActivityClient) Interceptors() []Interceptor
- func (c *ActivityClient) MapCreateBulk(slice any, setFunc func(*ActivityCreate, int)) *ActivityCreateBulk
- func (c *ActivityClient) Query() *ActivityQuery
- func (c *ActivityClient) Update() *ActivityUpdate
- func (c *ActivityClient) UpdateOne(a *Activity) *ActivityUpdateOne
- func (c *ActivityClient) UpdateOneID(id int) *ActivityUpdateOne
- func (c *ActivityClient) Use(hooks ...Hook)
- type ActivityCreate
- func (ac *ActivityCreate) Exec(ctx context.Context) error
- func (ac *ActivityCreate) ExecX(ctx context.Context)
- func (ac *ActivityCreate) Mutation() *ActivityMutation
- func (ac *ActivityCreate) OnConflict(opts ...sql.ConflictOption) *ActivityUpsertOne
- func (ac *ActivityCreate) OnConflictColumns(columns ...string) *ActivityUpsertOne
- func (ac *ActivityCreate) Save(ctx context.Context) (*Activity, error)
- func (ac *ActivityCreate) SaveX(ctx context.Context) *Activity
- func (ac *ActivityCreate) SetActiveCal(f float64) *ActivityCreate
- func (ac *ActivityCreate) SetTimestamp(t time.Time) *ActivityCreate
- func (ac *ActivityCreate) SetUserid(i int64) *ActivityCreate
- type ActivityCreateBulk
- func (acb *ActivityCreateBulk) Exec(ctx context.Context) error
- func (acb *ActivityCreateBulk) ExecX(ctx context.Context)
- func (acb *ActivityCreateBulk) OnConflict(opts ...sql.ConflictOption) *ActivityUpsertBulk
- func (acb *ActivityCreateBulk) OnConflictColumns(columns ...string) *ActivityUpsertBulk
- func (acb *ActivityCreateBulk) Save(ctx context.Context) ([]*Activity, error)
- func (acb *ActivityCreateBulk) SaveX(ctx context.Context) []*Activity
- type ActivityDelete
- type ActivityDeleteOne
- type ActivityGroupBy
- func (agb *ActivityGroupBy) Aggregate(fns ...AggregateFunc) *ActivityGroupBy
- func (s *ActivityGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ActivityGroupBy) BoolX(ctx context.Context) bool
- func (s *ActivityGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ActivityGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ActivityGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ActivityGroupBy) Float64X(ctx context.Context) float64
- func (s *ActivityGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ActivityGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ActivityGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ActivityGroupBy) IntX(ctx context.Context) int
- func (s *ActivityGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ActivityGroupBy) IntsX(ctx context.Context) []int
- func (agb *ActivityGroupBy) Scan(ctx context.Context, v any) error
- func (s *ActivityGroupBy) ScanX(ctx context.Context, v any)
- func (s *ActivityGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ActivityGroupBy) StringX(ctx context.Context) string
- func (s *ActivityGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ActivityGroupBy) StringsX(ctx context.Context) []string
- type ActivityMutation
- func (m *ActivityMutation) ActiveCal() (r float64, exists bool)
- func (m *ActivityMutation) AddActiveCal(f float64)
- func (m *ActivityMutation) AddField(name string, value ent.Value) error
- func (m *ActivityMutation) AddUserid(i int64)
- func (m *ActivityMutation) AddedActiveCal() (r float64, exists bool)
- func (m *ActivityMutation) AddedEdges() []string
- func (m *ActivityMutation) AddedField(name string) (ent.Value, bool)
- func (m *ActivityMutation) AddedFields() []string
- func (m *ActivityMutation) AddedIDs(name string) []ent.Value
- func (m *ActivityMutation) AddedUserid() (r int64, exists bool)
- func (m *ActivityMutation) ClearEdge(name string) error
- func (m *ActivityMutation) ClearField(name string) error
- func (m *ActivityMutation) ClearedEdges() []string
- func (m *ActivityMutation) ClearedFields() []string
- func (m ActivityMutation) Client() *Client
- func (m *ActivityMutation) EdgeCleared(name string) bool
- func (m *ActivityMutation) Field(name string) (ent.Value, bool)
- func (m *ActivityMutation) FieldCleared(name string) bool
- func (m *ActivityMutation) Fields() []string
- func (m *ActivityMutation) ID() (id int, exists bool)
- func (m *ActivityMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ActivityMutation) OldActiveCal(ctx context.Context) (v float64, err error)
- func (m *ActivityMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ActivityMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)
- func (m *ActivityMutation) OldUserid(ctx context.Context) (v int64, err error)
- func (m *ActivityMutation) Op() Op
- func (m *ActivityMutation) RemovedEdges() []string
- func (m *ActivityMutation) RemovedIDs(name string) []ent.Value
- func (m *ActivityMutation) ResetActiveCal()
- func (m *ActivityMutation) ResetEdge(name string) error
- func (m *ActivityMutation) ResetField(name string) error
- func (m *ActivityMutation) ResetTimestamp()
- func (m *ActivityMutation) ResetUserid()
- func (m *ActivityMutation) SetActiveCal(f float64)
- func (m *ActivityMutation) SetField(name string, value ent.Value) error
- func (m *ActivityMutation) SetOp(op Op)
- func (m *ActivityMutation) SetTimestamp(t time.Time)
- func (m *ActivityMutation) SetUserid(i int64)
- func (m *ActivityMutation) Timestamp() (r time.Time, exists bool)
- func (m ActivityMutation) Tx() (*Tx, error)
- func (m *ActivityMutation) Type() string
- func (m *ActivityMutation) Userid() (r int64, exists bool)
- func (m *ActivityMutation) Where(ps ...predicate.Activity)
- func (m *ActivityMutation) WhereP(ps ...func(*sql.Selector))
- type ActivityQuery
- func (aq *ActivityQuery) Aggregate(fns ...AggregateFunc) *ActivitySelect
- func (aq *ActivityQuery) All(ctx context.Context) ([]*Activity, error)
- func (aq *ActivityQuery) AllX(ctx context.Context) []*Activity
- func (aq *ActivityQuery) Clone() *ActivityQuery
- func (aq *ActivityQuery) Count(ctx context.Context) (int, error)
- func (aq *ActivityQuery) CountX(ctx context.Context) int
- func (aq *ActivityQuery) Exist(ctx context.Context) (bool, error)
- func (aq *ActivityQuery) ExistX(ctx context.Context) bool
- func (aq *ActivityQuery) First(ctx context.Context) (*Activity, error)
- func (aq *ActivityQuery) FirstID(ctx context.Context) (id int, err error)
- func (aq *ActivityQuery) FirstIDX(ctx context.Context) int
- func (aq *ActivityQuery) FirstX(ctx context.Context) *Activity
- func (aq *ActivityQuery) GroupBy(field string, fields ...string) *ActivityGroupBy
- func (aq *ActivityQuery) IDs(ctx context.Context) (ids []int, err error)
- func (aq *ActivityQuery) IDsX(ctx context.Context) []int
- func (aq *ActivityQuery) Limit(limit int) *ActivityQuery
- func (aq *ActivityQuery) Modify(modifiers ...func(s *sql.Selector)) *ActivitySelect
- func (aq *ActivityQuery) Offset(offset int) *ActivityQuery
- func (aq *ActivityQuery) Only(ctx context.Context) (*Activity, error)
- func (aq *ActivityQuery) OnlyID(ctx context.Context) (id int, err error)
- func (aq *ActivityQuery) OnlyIDX(ctx context.Context) int
- func (aq *ActivityQuery) OnlyX(ctx context.Context) *Activity
- func (aq *ActivityQuery) Order(o ...activity.OrderOption) *ActivityQuery
- func (aq *ActivityQuery) Select(fields ...string) *ActivitySelect
- func (aq *ActivityQuery) Unique(unique bool) *ActivityQuery
- func (aq *ActivityQuery) Where(ps ...predicate.Activity) *ActivityQuery
- type ActivitySelect
- func (as *ActivitySelect) Aggregate(fns ...AggregateFunc) *ActivitySelect
- func (s *ActivitySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ActivitySelect) BoolX(ctx context.Context) bool
- func (s *ActivitySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ActivitySelect) BoolsX(ctx context.Context) []bool
- func (s *ActivitySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ActivitySelect) Float64X(ctx context.Context) float64
- func (s *ActivitySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ActivitySelect) Float64sX(ctx context.Context) []float64
- func (s *ActivitySelect) Int(ctx context.Context) (_ int, err error)
- func (s *ActivitySelect) IntX(ctx context.Context) int
- func (s *ActivitySelect) Ints(ctx context.Context) ([]int, error)
- func (s *ActivitySelect) IntsX(ctx context.Context) []int
- func (as *ActivitySelect) Modify(modifiers ...func(s *sql.Selector)) *ActivitySelect
- func (as *ActivitySelect) Scan(ctx context.Context, v any) error
- func (s *ActivitySelect) ScanX(ctx context.Context, v any)
- func (s *ActivitySelect) String(ctx context.Context) (_ string, err error)
- func (s *ActivitySelect) StringX(ctx context.Context) string
- func (s *ActivitySelect) Strings(ctx context.Context) ([]string, error)
- func (s *ActivitySelect) StringsX(ctx context.Context) []string
- type ActivityUpdate
- func (au *ActivityUpdate) AddActiveCal(f float64) *ActivityUpdate
- func (au *ActivityUpdate) AddUserid(i int64) *ActivityUpdate
- func (au *ActivityUpdate) Exec(ctx context.Context) error
- func (au *ActivityUpdate) ExecX(ctx context.Context)
- func (au *ActivityUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ActivityUpdate
- func (au *ActivityUpdate) Mutation() *ActivityMutation
- func (au *ActivityUpdate) Save(ctx context.Context) (int, error)
- func (au *ActivityUpdate) SaveX(ctx context.Context) int
- func (au *ActivityUpdate) SetActiveCal(f float64) *ActivityUpdate
- func (au *ActivityUpdate) SetNillableActiveCal(f *float64) *ActivityUpdate
- func (au *ActivityUpdate) SetNillableTimestamp(t *time.Time) *ActivityUpdate
- func (au *ActivityUpdate) SetNillableUserid(i *int64) *ActivityUpdate
- func (au *ActivityUpdate) SetTimestamp(t time.Time) *ActivityUpdate
- func (au *ActivityUpdate) SetUserid(i int64) *ActivityUpdate
- func (au *ActivityUpdate) Where(ps ...predicate.Activity) *ActivityUpdate
- type ActivityUpdateOne
- func (auo *ActivityUpdateOne) AddActiveCal(f float64) *ActivityUpdateOne
- func (auo *ActivityUpdateOne) AddUserid(i int64) *ActivityUpdateOne
- func (auo *ActivityUpdateOne) Exec(ctx context.Context) error
- func (auo *ActivityUpdateOne) ExecX(ctx context.Context)
- func (auo *ActivityUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ActivityUpdateOne
- func (auo *ActivityUpdateOne) Mutation() *ActivityMutation
- func (auo *ActivityUpdateOne) Save(ctx context.Context) (*Activity, error)
- func (auo *ActivityUpdateOne) SaveX(ctx context.Context) *Activity
- func (auo *ActivityUpdateOne) Select(field string, fields ...string) *ActivityUpdateOne
- func (auo *ActivityUpdateOne) SetActiveCal(f float64) *ActivityUpdateOne
- func (auo *ActivityUpdateOne) SetNillableActiveCal(f *float64) *ActivityUpdateOne
- func (auo *ActivityUpdateOne) SetNillableTimestamp(t *time.Time) *ActivityUpdateOne
- func (auo *ActivityUpdateOne) SetNillableUserid(i *int64) *ActivityUpdateOne
- func (auo *ActivityUpdateOne) SetTimestamp(t time.Time) *ActivityUpdateOne
- func (auo *ActivityUpdateOne) SetUserid(i int64) *ActivityUpdateOne
- func (auo *ActivityUpdateOne) Where(ps ...predicate.Activity) *ActivityUpdateOne
- type ActivityUpsert
- func (u *ActivityUpsert) AddActiveCal(v float64) *ActivityUpsert
- func (u *ActivityUpsert) AddUserid(v int64) *ActivityUpsert
- func (u *ActivityUpsert) SetActiveCal(v float64) *ActivityUpsert
- func (u *ActivityUpsert) SetTimestamp(v time.Time) *ActivityUpsert
- func (u *ActivityUpsert) SetUserid(v int64) *ActivityUpsert
- func (u *ActivityUpsert) UpdateActiveCal() *ActivityUpsert
- func (u *ActivityUpsert) UpdateTimestamp() *ActivityUpsert
- func (u *ActivityUpsert) UpdateUserid() *ActivityUpsert
- type ActivityUpsertBulk
- func (u *ActivityUpsertBulk) AddActiveCal(v float64) *ActivityUpsertBulk
- func (u *ActivityUpsertBulk) AddUserid(v int64) *ActivityUpsertBulk
- func (u *ActivityUpsertBulk) DoNothing() *ActivityUpsertBulk
- func (u *ActivityUpsertBulk) Exec(ctx context.Context) error
- func (u *ActivityUpsertBulk) ExecX(ctx context.Context)
- func (u *ActivityUpsertBulk) Ignore() *ActivityUpsertBulk
- func (u *ActivityUpsertBulk) SetActiveCal(v float64) *ActivityUpsertBulk
- func (u *ActivityUpsertBulk) SetTimestamp(v time.Time) *ActivityUpsertBulk
- func (u *ActivityUpsertBulk) SetUserid(v int64) *ActivityUpsertBulk
- func (u *ActivityUpsertBulk) Update(set func(*ActivityUpsert)) *ActivityUpsertBulk
- func (u *ActivityUpsertBulk) UpdateActiveCal() *ActivityUpsertBulk
- func (u *ActivityUpsertBulk) UpdateNewValues() *ActivityUpsertBulk
- func (u *ActivityUpsertBulk) UpdateTimestamp() *ActivityUpsertBulk
- func (u *ActivityUpsertBulk) UpdateUserid() *ActivityUpsertBulk
- type ActivityUpsertOne
- func (u *ActivityUpsertOne) AddActiveCal(v float64) *ActivityUpsertOne
- func (u *ActivityUpsertOne) AddUserid(v int64) *ActivityUpsertOne
- func (u *ActivityUpsertOne) DoNothing() *ActivityUpsertOne
- func (u *ActivityUpsertOne) Exec(ctx context.Context) error
- func (u *ActivityUpsertOne) ExecX(ctx context.Context)
- func (u *ActivityUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *ActivityUpsertOne) IDX(ctx context.Context) int
- func (u *ActivityUpsertOne) Ignore() *ActivityUpsertOne
- func (u *ActivityUpsertOne) SetActiveCal(v float64) *ActivityUpsertOne
- func (u *ActivityUpsertOne) SetTimestamp(v time.Time) *ActivityUpsertOne
- func (u *ActivityUpsertOne) SetUserid(v int64) *ActivityUpsertOne
- func (u *ActivityUpsertOne) Update(set func(*ActivityUpsert)) *ActivityUpsertOne
- func (u *ActivityUpsertOne) UpdateActiveCal() *ActivityUpsertOne
- func (u *ActivityUpsertOne) UpdateNewValues() *ActivityUpsertOne
- func (u *ActivityUpsertOne) UpdateTimestamp() *ActivityUpsertOne
- func (u *ActivityUpsertOne) UpdateUserid() *ActivityUpsertOne
- type AggregateFunc
- type Bundle
- type BundleClient
- func (c *BundleClient) Create() *BundleCreate
- func (c *BundleClient) CreateBulk(builders ...*BundleCreate) *BundleCreateBulk
- func (c *BundleClient) Delete() *BundleDelete
- func (c *BundleClient) DeleteOne(b *Bundle) *BundleDeleteOne
- func (c *BundleClient) DeleteOneID(id int) *BundleDeleteOne
- func (c *BundleClient) Get(ctx context.Context, id int) (*Bundle, error)
- func (c *BundleClient) GetX(ctx context.Context, id int) *Bundle
- func (c *BundleClient) Hooks() []Hook
- func (c *BundleClient) Intercept(interceptors ...Interceptor)
- func (c *BundleClient) Interceptors() []Interceptor
- func (c *BundleClient) MapCreateBulk(slice any, setFunc func(*BundleCreate, int)) *BundleCreateBulk
- func (c *BundleClient) Query() *BundleQuery
- func (c *BundleClient) Update() *BundleUpdate
- func (c *BundleClient) UpdateOne(b *Bundle) *BundleUpdateOne
- func (c *BundleClient) UpdateOneID(id int) *BundleUpdateOne
- func (c *BundleClient) Use(hooks ...Hook)
- type BundleCreate
- func (bc *BundleCreate) Exec(ctx context.Context) error
- func (bc *BundleCreate) ExecX(ctx context.Context)
- func (bc *BundleCreate) Mutation() *BundleMutation
- func (bc *BundleCreate) OnConflict(opts ...sql.ConflictOption) *BundleUpsertOne
- func (bc *BundleCreate) OnConflictColumns(columns ...string) *BundleUpsertOne
- func (bc *BundleCreate) Save(ctx context.Context) (*Bundle, error)
- func (bc *BundleCreate) SaveX(ctx context.Context) *Bundle
- func (bc *BundleCreate) SetData(m map[string]float64) *BundleCreate
- func (bc *BundleCreate) SetKey(s string) *BundleCreate
- func (bc *BundleCreate) SetUserid(i int64) *BundleCreate
- type BundleCreateBulk
- func (bcb *BundleCreateBulk) Exec(ctx context.Context) error
- func (bcb *BundleCreateBulk) ExecX(ctx context.Context)
- func (bcb *BundleCreateBulk) OnConflict(opts ...sql.ConflictOption) *BundleUpsertBulk
- func (bcb *BundleCreateBulk) OnConflictColumns(columns ...string) *BundleUpsertBulk
- func (bcb *BundleCreateBulk) Save(ctx context.Context) ([]*Bundle, error)
- func (bcb *BundleCreateBulk) SaveX(ctx context.Context) []*Bundle
- type BundleDelete
- type BundleDeleteOne
- type BundleGroupBy
- func (bgb *BundleGroupBy) Aggregate(fns ...AggregateFunc) *BundleGroupBy
- func (s *BundleGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BundleGroupBy) BoolX(ctx context.Context) bool
- func (s *BundleGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BundleGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BundleGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BundleGroupBy) Float64X(ctx context.Context) float64
- func (s *BundleGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BundleGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BundleGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BundleGroupBy) IntX(ctx context.Context) int
- func (s *BundleGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BundleGroupBy) IntsX(ctx context.Context) []int
- func (bgb *BundleGroupBy) Scan(ctx context.Context, v any) error
- func (s *BundleGroupBy) ScanX(ctx context.Context, v any)
- func (s *BundleGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BundleGroupBy) StringX(ctx context.Context) string
- func (s *BundleGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BundleGroupBy) StringsX(ctx context.Context) []string
- type BundleMutation
- func (m *BundleMutation) AddField(name string, value ent.Value) error
- func (m *BundleMutation) AddUserid(i int64)
- func (m *BundleMutation) AddedEdges() []string
- func (m *BundleMutation) AddedField(name string) (ent.Value, bool)
- func (m *BundleMutation) AddedFields() []string
- func (m *BundleMutation) AddedIDs(name string) []ent.Value
- func (m *BundleMutation) AddedUserid() (r int64, exists bool)
- func (m *BundleMutation) ClearEdge(name string) error
- func (m *BundleMutation) ClearField(name string) error
- func (m *BundleMutation) ClearedEdges() []string
- func (m *BundleMutation) ClearedFields() []string
- func (m BundleMutation) Client() *Client
- func (m *BundleMutation) Data() (r map[string]float64, exists bool)
- func (m *BundleMutation) EdgeCleared(name string) bool
- func (m *BundleMutation) Field(name string) (ent.Value, bool)
- func (m *BundleMutation) FieldCleared(name string) bool
- func (m *BundleMutation) Fields() []string
- func (m *BundleMutation) ID() (id int, exists bool)
- func (m *BundleMutation) IDs(ctx context.Context) ([]int, error)
- func (m *BundleMutation) Key() (r string, exists bool)
- func (m *BundleMutation) OldData(ctx context.Context) (v map[string]float64, err error)
- func (m *BundleMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BundleMutation) OldKey(ctx context.Context) (v string, err error)
- func (m *BundleMutation) OldUserid(ctx context.Context) (v int64, err error)
- func (m *BundleMutation) Op() Op
- func (m *BundleMutation) RemovedEdges() []string
- func (m *BundleMutation) RemovedIDs(name string) []ent.Value
- func (m *BundleMutation) ResetData()
- func (m *BundleMutation) ResetEdge(name string) error
- func (m *BundleMutation) ResetField(name string) error
- func (m *BundleMutation) ResetKey()
- func (m *BundleMutation) ResetUserid()
- func (m *BundleMutation) SetData(value map[string]float64)
- func (m *BundleMutation) SetField(name string, value ent.Value) error
- func (m *BundleMutation) SetKey(s string)
- func (m *BundleMutation) SetOp(op Op)
- func (m *BundleMutation) SetUserid(i int64)
- func (m BundleMutation) Tx() (*Tx, error)
- func (m *BundleMutation) Type() string
- func (m *BundleMutation) Userid() (r int64, exists bool)
- func (m *BundleMutation) Where(ps ...predicate.Bundle)
- func (m *BundleMutation) WhereP(ps ...func(*sql.Selector))
- type BundleQuery
- func (bq *BundleQuery) Aggregate(fns ...AggregateFunc) *BundleSelect
- func (bq *BundleQuery) All(ctx context.Context) ([]*Bundle, error)
- func (bq *BundleQuery) AllX(ctx context.Context) []*Bundle
- func (bq *BundleQuery) Clone() *BundleQuery
- func (bq *BundleQuery) Count(ctx context.Context) (int, error)
- func (bq *BundleQuery) CountX(ctx context.Context) int
- func (bq *BundleQuery) Exist(ctx context.Context) (bool, error)
- func (bq *BundleQuery) ExistX(ctx context.Context) bool
- func (bq *BundleQuery) First(ctx context.Context) (*Bundle, error)
- func (bq *BundleQuery) FirstID(ctx context.Context) (id int, err error)
- func (bq *BundleQuery) FirstIDX(ctx context.Context) int
- func (bq *BundleQuery) FirstX(ctx context.Context) *Bundle
- func (bq *BundleQuery) GroupBy(field string, fields ...string) *BundleGroupBy
- func (bq *BundleQuery) IDs(ctx context.Context) (ids []int, err error)
- func (bq *BundleQuery) IDsX(ctx context.Context) []int
- func (bq *BundleQuery) Limit(limit int) *BundleQuery
- func (bq *BundleQuery) Modify(modifiers ...func(s *sql.Selector)) *BundleSelect
- func (bq *BundleQuery) Offset(offset int) *BundleQuery
- func (bq *BundleQuery) Only(ctx context.Context) (*Bundle, error)
- func (bq *BundleQuery) OnlyID(ctx context.Context) (id int, err error)
- func (bq *BundleQuery) OnlyIDX(ctx context.Context) int
- func (bq *BundleQuery) OnlyX(ctx context.Context) *Bundle
- func (bq *BundleQuery) Order(o ...bundle.OrderOption) *BundleQuery
- func (bq *BundleQuery) Select(fields ...string) *BundleSelect
- func (bq *BundleQuery) Unique(unique bool) *BundleQuery
- func (bq *BundleQuery) Where(ps ...predicate.Bundle) *BundleQuery
- type BundleSelect
- func (bs *BundleSelect) Aggregate(fns ...AggregateFunc) *BundleSelect
- func (s *BundleSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BundleSelect) BoolX(ctx context.Context) bool
- func (s *BundleSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BundleSelect) BoolsX(ctx context.Context) []bool
- func (s *BundleSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BundleSelect) Float64X(ctx context.Context) float64
- func (s *BundleSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BundleSelect) Float64sX(ctx context.Context) []float64
- func (s *BundleSelect) Int(ctx context.Context) (_ int, err error)
- func (s *BundleSelect) IntX(ctx context.Context) int
- func (s *BundleSelect) Ints(ctx context.Context) ([]int, error)
- func (s *BundleSelect) IntsX(ctx context.Context) []int
- func (bs *BundleSelect) Modify(modifiers ...func(s *sql.Selector)) *BundleSelect
- func (bs *BundleSelect) Scan(ctx context.Context, v any) error
- func (s *BundleSelect) ScanX(ctx context.Context, v any)
- func (s *BundleSelect) String(ctx context.Context) (_ string, err error)
- func (s *BundleSelect) StringX(ctx context.Context) string
- func (s *BundleSelect) Strings(ctx context.Context) ([]string, error)
- func (s *BundleSelect) StringsX(ctx context.Context) []string
- type BundleUpdate
- func (bu *BundleUpdate) AddUserid(i int64) *BundleUpdate
- func (bu *BundleUpdate) Exec(ctx context.Context) error
- func (bu *BundleUpdate) ExecX(ctx context.Context)
- func (bu *BundleUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *BundleUpdate
- func (bu *BundleUpdate) Mutation() *BundleMutation
- func (bu *BundleUpdate) Save(ctx context.Context) (int, error)
- func (bu *BundleUpdate) SaveX(ctx context.Context) int
- func (bu *BundleUpdate) SetData(m map[string]float64) *BundleUpdate
- func (bu *BundleUpdate) SetKey(s string) *BundleUpdate
- func (bu *BundleUpdate) SetNillableKey(s *string) *BundleUpdate
- func (bu *BundleUpdate) SetNillableUserid(i *int64) *BundleUpdate
- func (bu *BundleUpdate) SetUserid(i int64) *BundleUpdate
- func (bu *BundleUpdate) Where(ps ...predicate.Bundle) *BundleUpdate
- type BundleUpdateOne
- func (buo *BundleUpdateOne) AddUserid(i int64) *BundleUpdateOne
- func (buo *BundleUpdateOne) Exec(ctx context.Context) error
- func (buo *BundleUpdateOne) ExecX(ctx context.Context)
- func (buo *BundleUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *BundleUpdateOne
- func (buo *BundleUpdateOne) Mutation() *BundleMutation
- func (buo *BundleUpdateOne) Save(ctx context.Context) (*Bundle, error)
- func (buo *BundleUpdateOne) SaveX(ctx context.Context) *Bundle
- func (buo *BundleUpdateOne) Select(field string, fields ...string) *BundleUpdateOne
- func (buo *BundleUpdateOne) SetData(m map[string]float64) *BundleUpdateOne
- func (buo *BundleUpdateOne) SetKey(s string) *BundleUpdateOne
- func (buo *BundleUpdateOne) SetNillableKey(s *string) *BundleUpdateOne
- func (buo *BundleUpdateOne) SetNillableUserid(i *int64) *BundleUpdateOne
- func (buo *BundleUpdateOne) SetUserid(i int64) *BundleUpdateOne
- func (buo *BundleUpdateOne) Where(ps ...predicate.Bundle) *BundleUpdateOne
- type BundleUpsert
- func (u *BundleUpsert) AddUserid(v int64) *BundleUpsert
- func (u *BundleUpsert) SetData(v map[string]float64) *BundleUpsert
- func (u *BundleUpsert) SetKey(v string) *BundleUpsert
- func (u *BundleUpsert) SetUserid(v int64) *BundleUpsert
- func (u *BundleUpsert) UpdateData() *BundleUpsert
- func (u *BundleUpsert) UpdateKey() *BundleUpsert
- func (u *BundleUpsert) UpdateUserid() *BundleUpsert
- type BundleUpsertBulk
- func (u *BundleUpsertBulk) AddUserid(v int64) *BundleUpsertBulk
- func (u *BundleUpsertBulk) DoNothing() *BundleUpsertBulk
- func (u *BundleUpsertBulk) Exec(ctx context.Context) error
- func (u *BundleUpsertBulk) ExecX(ctx context.Context)
- func (u *BundleUpsertBulk) Ignore() *BundleUpsertBulk
- func (u *BundleUpsertBulk) SetData(v map[string]float64) *BundleUpsertBulk
- func (u *BundleUpsertBulk) SetKey(v string) *BundleUpsertBulk
- func (u *BundleUpsertBulk) SetUserid(v int64) *BundleUpsertBulk
- func (u *BundleUpsertBulk) Update(set func(*BundleUpsert)) *BundleUpsertBulk
- func (u *BundleUpsertBulk) UpdateData() *BundleUpsertBulk
- func (u *BundleUpsertBulk) UpdateKey() *BundleUpsertBulk
- func (u *BundleUpsertBulk) UpdateNewValues() *BundleUpsertBulk
- func (u *BundleUpsertBulk) UpdateUserid() *BundleUpsertBulk
- type BundleUpsertOne
- func (u *BundleUpsertOne) AddUserid(v int64) *BundleUpsertOne
- func (u *BundleUpsertOne) DoNothing() *BundleUpsertOne
- func (u *BundleUpsertOne) Exec(ctx context.Context) error
- func (u *BundleUpsertOne) ExecX(ctx context.Context)
- func (u *BundleUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *BundleUpsertOne) IDX(ctx context.Context) int
- func (u *BundleUpsertOne) Ignore() *BundleUpsertOne
- func (u *BundleUpsertOne) SetData(v map[string]float64) *BundleUpsertOne
- func (u *BundleUpsertOne) SetKey(v string) *BundleUpsertOne
- func (u *BundleUpsertOne) SetUserid(v int64) *BundleUpsertOne
- func (u *BundleUpsertOne) Update(set func(*BundleUpsert)) *BundleUpsertOne
- func (u *BundleUpsertOne) UpdateData() *BundleUpsertOne
- func (u *BundleUpsertOne) UpdateKey() *BundleUpsertOne
- func (u *BundleUpsertOne) UpdateNewValues() *BundleUpsertOne
- func (u *BundleUpsertOne) UpdateUserid() *BundleUpsertOne
- type Bundles
- 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 Food
- type FoodClient
- func (c *FoodClient) Create() *FoodCreate
- func (c *FoodClient) CreateBulk(builders ...*FoodCreate) *FoodCreateBulk
- func (c *FoodClient) Delete() *FoodDelete
- func (c *FoodClient) DeleteOne(f *Food) *FoodDeleteOne
- func (c *FoodClient) DeleteOneID(id int) *FoodDeleteOne
- func (c *FoodClient) Get(ctx context.Context, id int) (*Food, error)
- func (c *FoodClient) GetX(ctx context.Context, id int) *Food
- func (c *FoodClient) Hooks() []Hook
- func (c *FoodClient) Intercept(interceptors ...Interceptor)
- func (c *FoodClient) Interceptors() []Interceptor
- func (c *FoodClient) MapCreateBulk(slice any, setFunc func(*FoodCreate, int)) *FoodCreateBulk
- func (c *FoodClient) Query() *FoodQuery
- func (c *FoodClient) QueryJournals(f *Food) *JournalQuery
- func (c *FoodClient) Update() *FoodUpdate
- func (c *FoodClient) UpdateOne(f *Food) *FoodUpdateOne
- func (c *FoodClient) UpdateOneID(id int) *FoodUpdateOne
- func (c *FoodClient) Use(hooks ...Hook)
- type FoodCreate
- func (fc *FoodCreate) AddJournalIDs(ids ...int) *FoodCreate
- func (fc *FoodCreate) AddJournals(j ...*Journal) *FoodCreate
- func (fc *FoodCreate) Exec(ctx context.Context) error
- func (fc *FoodCreate) ExecX(ctx context.Context)
- func (fc *FoodCreate) Mutation() *FoodMutation
- func (fc *FoodCreate) OnConflict(opts ...sql.ConflictOption) *FoodUpsertOne
- func (fc *FoodCreate) OnConflictColumns(columns ...string) *FoodUpsertOne
- func (fc *FoodCreate) Save(ctx context.Context) (*Food, error)
- func (fc *FoodCreate) SaveX(ctx context.Context) *Food
- func (fc *FoodCreate) SetBrand(s string) *FoodCreate
- func (fc *FoodCreate) SetCal100(f float64) *FoodCreate
- func (fc *FoodCreate) SetCarb100(f float64) *FoodCreate
- func (fc *FoodCreate) SetComment(s string) *FoodCreate
- func (fc *FoodCreate) SetFat100(f float64) *FoodCreate
- func (fc *FoodCreate) SetKey(s string) *FoodCreate
- func (fc *FoodCreate) SetName(s string) *FoodCreate
- func (fc *FoodCreate) SetNillableBrand(s *string) *FoodCreate
- func (fc *FoodCreate) SetNillableComment(s *string) *FoodCreate
- func (fc *FoodCreate) SetProt100(f float64) *FoodCreate
- type FoodCreateBulk
- func (fcb *FoodCreateBulk) Exec(ctx context.Context) error
- func (fcb *FoodCreateBulk) ExecX(ctx context.Context)
- func (fcb *FoodCreateBulk) OnConflict(opts ...sql.ConflictOption) *FoodUpsertBulk
- func (fcb *FoodCreateBulk) OnConflictColumns(columns ...string) *FoodUpsertBulk
- func (fcb *FoodCreateBulk) Save(ctx context.Context) ([]*Food, error)
- func (fcb *FoodCreateBulk) SaveX(ctx context.Context) []*Food
- type FoodDelete
- type FoodDeleteOne
- type FoodEdges
- type FoodGroupBy
- func (fgb *FoodGroupBy) Aggregate(fns ...AggregateFunc) *FoodGroupBy
- func (s *FoodGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FoodGroupBy) BoolX(ctx context.Context) bool
- func (s *FoodGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FoodGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FoodGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FoodGroupBy) Float64X(ctx context.Context) float64
- func (s *FoodGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FoodGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FoodGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FoodGroupBy) IntX(ctx context.Context) int
- func (s *FoodGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FoodGroupBy) IntsX(ctx context.Context) []int
- func (fgb *FoodGroupBy) Scan(ctx context.Context, v any) error
- func (s *FoodGroupBy) ScanX(ctx context.Context, v any)
- func (s *FoodGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FoodGroupBy) StringX(ctx context.Context) string
- func (s *FoodGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FoodGroupBy) StringsX(ctx context.Context) []string
- type FoodMutation
- func (m *FoodMutation) AddCal100(f float64)
- func (m *FoodMutation) AddCarb100(f float64)
- func (m *FoodMutation) AddFat100(f float64)
- func (m *FoodMutation) AddField(name string, value ent.Value) error
- func (m *FoodMutation) AddJournalIDs(ids ...int)
- func (m *FoodMutation) AddProt100(f float64)
- func (m *FoodMutation) AddedCal100() (r float64, exists bool)
- func (m *FoodMutation) AddedCarb100() (r float64, exists bool)
- func (m *FoodMutation) AddedEdges() []string
- func (m *FoodMutation) AddedFat100() (r float64, exists bool)
- func (m *FoodMutation) AddedField(name string) (ent.Value, bool)
- func (m *FoodMutation) AddedFields() []string
- func (m *FoodMutation) AddedIDs(name string) []ent.Value
- func (m *FoodMutation) AddedProt100() (r float64, exists bool)
- func (m *FoodMutation) Brand() (r string, exists bool)
- func (m *FoodMutation) BrandCleared() bool
- func (m *FoodMutation) Cal100() (r float64, exists bool)
- func (m *FoodMutation) Carb100() (r float64, exists bool)
- func (m *FoodMutation) ClearBrand()
- func (m *FoodMutation) ClearComment()
- func (m *FoodMutation) ClearEdge(name string) error
- func (m *FoodMutation) ClearField(name string) error
- func (m *FoodMutation) ClearJournals()
- func (m *FoodMutation) ClearedEdges() []string
- func (m *FoodMutation) ClearedFields() []string
- func (m FoodMutation) Client() *Client
- func (m *FoodMutation) Comment() (r string, exists bool)
- func (m *FoodMutation) CommentCleared() bool
- func (m *FoodMutation) EdgeCleared(name string) bool
- func (m *FoodMutation) Fat100() (r float64, exists bool)
- func (m *FoodMutation) Field(name string) (ent.Value, bool)
- func (m *FoodMutation) FieldCleared(name string) bool
- func (m *FoodMutation) Fields() []string
- func (m *FoodMutation) ID() (id int, exists bool)
- func (m *FoodMutation) IDs(ctx context.Context) ([]int, error)
- func (m *FoodMutation) JournalsCleared() bool
- func (m *FoodMutation) JournalsIDs() (ids []int)
- func (m *FoodMutation) Key() (r string, exists bool)
- func (m *FoodMutation) Name() (r string, exists bool)
- func (m *FoodMutation) OldBrand(ctx context.Context) (v string, err error)
- func (m *FoodMutation) OldCal100(ctx context.Context) (v float64, err error)
- func (m *FoodMutation) OldCarb100(ctx context.Context) (v float64, err error)
- func (m *FoodMutation) OldComment(ctx context.Context) (v string, err error)
- func (m *FoodMutation) OldFat100(ctx context.Context) (v float64, err error)
- func (m *FoodMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FoodMutation) OldKey(ctx context.Context) (v string, err error)
- func (m *FoodMutation) OldName(ctx context.Context) (v string, err error)
- func (m *FoodMutation) OldProt100(ctx context.Context) (v float64, err error)
- func (m *FoodMutation) Op() Op
- func (m *FoodMutation) Prot100() (r float64, exists bool)
- func (m *FoodMutation) RemoveJournalIDs(ids ...int)
- func (m *FoodMutation) RemovedEdges() []string
- func (m *FoodMutation) RemovedIDs(name string) []ent.Value
- func (m *FoodMutation) RemovedJournalsIDs() (ids []int)
- func (m *FoodMutation) ResetBrand()
- func (m *FoodMutation) ResetCal100()
- func (m *FoodMutation) ResetCarb100()
- func (m *FoodMutation) ResetComment()
- func (m *FoodMutation) ResetEdge(name string) error
- func (m *FoodMutation) ResetFat100()
- func (m *FoodMutation) ResetField(name string) error
- func (m *FoodMutation) ResetJournals()
- func (m *FoodMutation) ResetKey()
- func (m *FoodMutation) ResetName()
- func (m *FoodMutation) ResetProt100()
- func (m *FoodMutation) SetBrand(s string)
- func (m *FoodMutation) SetCal100(f float64)
- func (m *FoodMutation) SetCarb100(f float64)
- func (m *FoodMutation) SetComment(s string)
- func (m *FoodMutation) SetFat100(f float64)
- func (m *FoodMutation) SetField(name string, value ent.Value) error
- func (m *FoodMutation) SetKey(s string)
- func (m *FoodMutation) SetName(s string)
- func (m *FoodMutation) SetOp(op Op)
- func (m *FoodMutation) SetProt100(f float64)
- func (m FoodMutation) Tx() (*Tx, error)
- func (m *FoodMutation) Type() string
- func (m *FoodMutation) Where(ps ...predicate.Food)
- func (m *FoodMutation) WhereP(ps ...func(*sql.Selector))
- type FoodQuery
- func (fq *FoodQuery) Aggregate(fns ...AggregateFunc) *FoodSelect
- func (fq *FoodQuery) All(ctx context.Context) ([]*Food, error)
- func (fq *FoodQuery) AllX(ctx context.Context) []*Food
- func (fq *FoodQuery) Clone() *FoodQuery
- func (fq *FoodQuery) Count(ctx context.Context) (int, error)
- func (fq *FoodQuery) CountX(ctx context.Context) int
- func (fq *FoodQuery) Exist(ctx context.Context) (bool, error)
- func (fq *FoodQuery) ExistX(ctx context.Context) bool
- func (fq *FoodQuery) First(ctx context.Context) (*Food, error)
- func (fq *FoodQuery) FirstID(ctx context.Context) (id int, err error)
- func (fq *FoodQuery) FirstIDX(ctx context.Context) int
- func (fq *FoodQuery) FirstX(ctx context.Context) *Food
- func (fq *FoodQuery) GroupBy(field string, fields ...string) *FoodGroupBy
- func (fq *FoodQuery) IDs(ctx context.Context) (ids []int, err error)
- func (fq *FoodQuery) IDsX(ctx context.Context) []int
- func (fq *FoodQuery) Limit(limit int) *FoodQuery
- func (fq *FoodQuery) Modify(modifiers ...func(s *sql.Selector)) *FoodSelect
- func (fq *FoodQuery) Offset(offset int) *FoodQuery
- func (fq *FoodQuery) Only(ctx context.Context) (*Food, error)
- func (fq *FoodQuery) OnlyID(ctx context.Context) (id int, err error)
- func (fq *FoodQuery) OnlyIDX(ctx context.Context) int
- func (fq *FoodQuery) OnlyX(ctx context.Context) *Food
- func (fq *FoodQuery) Order(o ...food.OrderOption) *FoodQuery
- func (fq *FoodQuery) QueryJournals() *JournalQuery
- func (fq *FoodQuery) Select(fields ...string) *FoodSelect
- func (fq *FoodQuery) Unique(unique bool) *FoodQuery
- func (fq *FoodQuery) Where(ps ...predicate.Food) *FoodQuery
- func (fq *FoodQuery) WithJournals(opts ...func(*JournalQuery)) *FoodQuery
- type FoodSelect
- func (fs *FoodSelect) Aggregate(fns ...AggregateFunc) *FoodSelect
- func (s *FoodSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FoodSelect) BoolX(ctx context.Context) bool
- func (s *FoodSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FoodSelect) BoolsX(ctx context.Context) []bool
- func (s *FoodSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FoodSelect) Float64X(ctx context.Context) float64
- func (s *FoodSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FoodSelect) Float64sX(ctx context.Context) []float64
- func (s *FoodSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FoodSelect) IntX(ctx context.Context) int
- func (s *FoodSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FoodSelect) IntsX(ctx context.Context) []int
- func (fs *FoodSelect) Modify(modifiers ...func(s *sql.Selector)) *FoodSelect
- func (fs *FoodSelect) Scan(ctx context.Context, v any) error
- func (s *FoodSelect) ScanX(ctx context.Context, v any)
- func (s *FoodSelect) String(ctx context.Context) (_ string, err error)
- func (s *FoodSelect) StringX(ctx context.Context) string
- func (s *FoodSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FoodSelect) StringsX(ctx context.Context) []string
- type FoodUpdate
- func (fu *FoodUpdate) AddCal100(f float64) *FoodUpdate
- func (fu *FoodUpdate) AddCarb100(f float64) *FoodUpdate
- func (fu *FoodUpdate) AddFat100(f float64) *FoodUpdate
- func (fu *FoodUpdate) AddJournalIDs(ids ...int) *FoodUpdate
- func (fu *FoodUpdate) AddJournals(j ...*Journal) *FoodUpdate
- func (fu *FoodUpdate) AddProt100(f float64) *FoodUpdate
- func (fu *FoodUpdate) ClearBrand() *FoodUpdate
- func (fu *FoodUpdate) ClearComment() *FoodUpdate
- func (fu *FoodUpdate) ClearJournals() *FoodUpdate
- func (fu *FoodUpdate) Exec(ctx context.Context) error
- func (fu *FoodUpdate) ExecX(ctx context.Context)
- func (fu *FoodUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *FoodUpdate
- func (fu *FoodUpdate) Mutation() *FoodMutation
- func (fu *FoodUpdate) RemoveJournalIDs(ids ...int) *FoodUpdate
- func (fu *FoodUpdate) RemoveJournals(j ...*Journal) *FoodUpdate
- func (fu *FoodUpdate) Save(ctx context.Context) (int, error)
- func (fu *FoodUpdate) SaveX(ctx context.Context) int
- func (fu *FoodUpdate) SetBrand(s string) *FoodUpdate
- func (fu *FoodUpdate) SetCal100(f float64) *FoodUpdate
- func (fu *FoodUpdate) SetCarb100(f float64) *FoodUpdate
- func (fu *FoodUpdate) SetComment(s string) *FoodUpdate
- func (fu *FoodUpdate) SetFat100(f float64) *FoodUpdate
- func (fu *FoodUpdate) SetKey(s string) *FoodUpdate
- func (fu *FoodUpdate) SetName(s string) *FoodUpdate
- func (fu *FoodUpdate) SetNillableBrand(s *string) *FoodUpdate
- func (fu *FoodUpdate) SetNillableCal100(f *float64) *FoodUpdate
- func (fu *FoodUpdate) SetNillableCarb100(f *float64) *FoodUpdate
- func (fu *FoodUpdate) SetNillableComment(s *string) *FoodUpdate
- func (fu *FoodUpdate) SetNillableFat100(f *float64) *FoodUpdate
- func (fu *FoodUpdate) SetNillableKey(s *string) *FoodUpdate
- func (fu *FoodUpdate) SetNillableName(s *string) *FoodUpdate
- func (fu *FoodUpdate) SetNillableProt100(f *float64) *FoodUpdate
- func (fu *FoodUpdate) SetProt100(f float64) *FoodUpdate
- func (fu *FoodUpdate) Where(ps ...predicate.Food) *FoodUpdate
- type FoodUpdateOne
- func (fuo *FoodUpdateOne) AddCal100(f float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) AddCarb100(f float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) AddFat100(f float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) AddJournalIDs(ids ...int) *FoodUpdateOne
- func (fuo *FoodUpdateOne) AddJournals(j ...*Journal) *FoodUpdateOne
- func (fuo *FoodUpdateOne) AddProt100(f float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) ClearBrand() *FoodUpdateOne
- func (fuo *FoodUpdateOne) ClearComment() *FoodUpdateOne
- func (fuo *FoodUpdateOne) ClearJournals() *FoodUpdateOne
- func (fuo *FoodUpdateOne) Exec(ctx context.Context) error
- func (fuo *FoodUpdateOne) ExecX(ctx context.Context)
- func (fuo *FoodUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *FoodUpdateOne
- func (fuo *FoodUpdateOne) Mutation() *FoodMutation
- func (fuo *FoodUpdateOne) RemoveJournalIDs(ids ...int) *FoodUpdateOne
- func (fuo *FoodUpdateOne) RemoveJournals(j ...*Journal) *FoodUpdateOne
- func (fuo *FoodUpdateOne) Save(ctx context.Context) (*Food, error)
- func (fuo *FoodUpdateOne) SaveX(ctx context.Context) *Food
- func (fuo *FoodUpdateOne) Select(field string, fields ...string) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetBrand(s string) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetCal100(f float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetCarb100(f float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetComment(s string) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetFat100(f float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetKey(s string) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetName(s string) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetNillableBrand(s *string) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetNillableCal100(f *float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetNillableCarb100(f *float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetNillableComment(s *string) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetNillableFat100(f *float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetNillableKey(s *string) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetNillableName(s *string) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetNillableProt100(f *float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) SetProt100(f float64) *FoodUpdateOne
- func (fuo *FoodUpdateOne) Where(ps ...predicate.Food) *FoodUpdateOne
- type FoodUpsert
- func (u *FoodUpsert) AddCal100(v float64) *FoodUpsert
- func (u *FoodUpsert) AddCarb100(v float64) *FoodUpsert
- func (u *FoodUpsert) AddFat100(v float64) *FoodUpsert
- func (u *FoodUpsert) AddProt100(v float64) *FoodUpsert
- func (u *FoodUpsert) ClearBrand() *FoodUpsert
- func (u *FoodUpsert) ClearComment() *FoodUpsert
- func (u *FoodUpsert) SetBrand(v string) *FoodUpsert
- func (u *FoodUpsert) SetCal100(v float64) *FoodUpsert
- func (u *FoodUpsert) SetCarb100(v float64) *FoodUpsert
- func (u *FoodUpsert) SetComment(v string) *FoodUpsert
- func (u *FoodUpsert) SetFat100(v float64) *FoodUpsert
- func (u *FoodUpsert) SetKey(v string) *FoodUpsert
- func (u *FoodUpsert) SetName(v string) *FoodUpsert
- func (u *FoodUpsert) SetProt100(v float64) *FoodUpsert
- func (u *FoodUpsert) UpdateBrand() *FoodUpsert
- func (u *FoodUpsert) UpdateCal100() *FoodUpsert
- func (u *FoodUpsert) UpdateCarb100() *FoodUpsert
- func (u *FoodUpsert) UpdateComment() *FoodUpsert
- func (u *FoodUpsert) UpdateFat100() *FoodUpsert
- func (u *FoodUpsert) UpdateKey() *FoodUpsert
- func (u *FoodUpsert) UpdateName() *FoodUpsert
- func (u *FoodUpsert) UpdateProt100() *FoodUpsert
- type FoodUpsertBulk
- func (u *FoodUpsertBulk) AddCal100(v float64) *FoodUpsertBulk
- func (u *FoodUpsertBulk) AddCarb100(v float64) *FoodUpsertBulk
- func (u *FoodUpsertBulk) AddFat100(v float64) *FoodUpsertBulk
- func (u *FoodUpsertBulk) AddProt100(v float64) *FoodUpsertBulk
- func (u *FoodUpsertBulk) ClearBrand() *FoodUpsertBulk
- func (u *FoodUpsertBulk) ClearComment() *FoodUpsertBulk
- func (u *FoodUpsertBulk) DoNothing() *FoodUpsertBulk
- func (u *FoodUpsertBulk) Exec(ctx context.Context) error
- func (u *FoodUpsertBulk) ExecX(ctx context.Context)
- func (u *FoodUpsertBulk) Ignore() *FoodUpsertBulk
- func (u *FoodUpsertBulk) SetBrand(v string) *FoodUpsertBulk
- func (u *FoodUpsertBulk) SetCal100(v float64) *FoodUpsertBulk
- func (u *FoodUpsertBulk) SetCarb100(v float64) *FoodUpsertBulk
- func (u *FoodUpsertBulk) SetComment(v string) *FoodUpsertBulk
- func (u *FoodUpsertBulk) SetFat100(v float64) *FoodUpsertBulk
- func (u *FoodUpsertBulk) SetKey(v string) *FoodUpsertBulk
- func (u *FoodUpsertBulk) SetName(v string) *FoodUpsertBulk
- func (u *FoodUpsertBulk) SetProt100(v float64) *FoodUpsertBulk
- func (u *FoodUpsertBulk) Update(set func(*FoodUpsert)) *FoodUpsertBulk
- func (u *FoodUpsertBulk) UpdateBrand() *FoodUpsertBulk
- func (u *FoodUpsertBulk) UpdateCal100() *FoodUpsertBulk
- func (u *FoodUpsertBulk) UpdateCarb100() *FoodUpsertBulk
- func (u *FoodUpsertBulk) UpdateComment() *FoodUpsertBulk
- func (u *FoodUpsertBulk) UpdateFat100() *FoodUpsertBulk
- func (u *FoodUpsertBulk) UpdateKey() *FoodUpsertBulk
- func (u *FoodUpsertBulk) UpdateName() *FoodUpsertBulk
- func (u *FoodUpsertBulk) UpdateNewValues() *FoodUpsertBulk
- func (u *FoodUpsertBulk) UpdateProt100() *FoodUpsertBulk
- type FoodUpsertOne
- func (u *FoodUpsertOne) AddCal100(v float64) *FoodUpsertOne
- func (u *FoodUpsertOne) AddCarb100(v float64) *FoodUpsertOne
- func (u *FoodUpsertOne) AddFat100(v float64) *FoodUpsertOne
- func (u *FoodUpsertOne) AddProt100(v float64) *FoodUpsertOne
- func (u *FoodUpsertOne) ClearBrand() *FoodUpsertOne
- func (u *FoodUpsertOne) ClearComment() *FoodUpsertOne
- func (u *FoodUpsertOne) DoNothing() *FoodUpsertOne
- func (u *FoodUpsertOne) Exec(ctx context.Context) error
- func (u *FoodUpsertOne) ExecX(ctx context.Context)
- func (u *FoodUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *FoodUpsertOne) IDX(ctx context.Context) int
- func (u *FoodUpsertOne) Ignore() *FoodUpsertOne
- func (u *FoodUpsertOne) SetBrand(v string) *FoodUpsertOne
- func (u *FoodUpsertOne) SetCal100(v float64) *FoodUpsertOne
- func (u *FoodUpsertOne) SetCarb100(v float64) *FoodUpsertOne
- func (u *FoodUpsertOne) SetComment(v string) *FoodUpsertOne
- func (u *FoodUpsertOne) SetFat100(v float64) *FoodUpsertOne
- func (u *FoodUpsertOne) SetKey(v string) *FoodUpsertOne
- func (u *FoodUpsertOne) SetName(v string) *FoodUpsertOne
- func (u *FoodUpsertOne) SetProt100(v float64) *FoodUpsertOne
- func (u *FoodUpsertOne) Update(set func(*FoodUpsert)) *FoodUpsertOne
- func (u *FoodUpsertOne) UpdateBrand() *FoodUpsertOne
- func (u *FoodUpsertOne) UpdateCal100() *FoodUpsertOne
- func (u *FoodUpsertOne) UpdateCarb100() *FoodUpsertOne
- func (u *FoodUpsertOne) UpdateComment() *FoodUpsertOne
- func (u *FoodUpsertOne) UpdateFat100() *FoodUpsertOne
- func (u *FoodUpsertOne) UpdateKey() *FoodUpsertOne
- func (u *FoodUpsertOne) UpdateName() *FoodUpsertOne
- func (u *FoodUpsertOne) UpdateNewValues() *FoodUpsertOne
- func (u *FoodUpsertOne) UpdateProt100() *FoodUpsertOne
- type Foods
- type Hook
- type InterceptFunc
- type Interceptor
- type Journal
- type JournalClient
- func (c *JournalClient) Create() *JournalCreate
- func (c *JournalClient) CreateBulk(builders ...*JournalCreate) *JournalCreateBulk
- func (c *JournalClient) Delete() *JournalDelete
- func (c *JournalClient) DeleteOne(j *Journal) *JournalDeleteOne
- func (c *JournalClient) DeleteOneID(id int) *JournalDeleteOne
- func (c *JournalClient) Get(ctx context.Context, id int) (*Journal, error)
- func (c *JournalClient) GetX(ctx context.Context, id int) *Journal
- func (c *JournalClient) Hooks() []Hook
- func (c *JournalClient) Intercept(interceptors ...Interceptor)
- func (c *JournalClient) Interceptors() []Interceptor
- func (c *JournalClient) MapCreateBulk(slice any, setFunc func(*JournalCreate, int)) *JournalCreateBulk
- func (c *JournalClient) Query() *JournalQuery
- func (c *JournalClient) QueryFood(j *Journal) *FoodQuery
- func (c *JournalClient) Update() *JournalUpdate
- func (c *JournalClient) UpdateOne(j *Journal) *JournalUpdateOne
- func (c *JournalClient) UpdateOneID(id int) *JournalUpdateOne
- func (c *JournalClient) Use(hooks ...Hook)
- type JournalCreate
- func (jc *JournalCreate) Exec(ctx context.Context) error
- func (jc *JournalCreate) ExecX(ctx context.Context)
- func (jc *JournalCreate) Mutation() *JournalMutation
- func (jc *JournalCreate) OnConflict(opts ...sql.ConflictOption) *JournalUpsertOne
- func (jc *JournalCreate) OnConflictColumns(columns ...string) *JournalUpsertOne
- func (jc *JournalCreate) Save(ctx context.Context) (*Journal, error)
- func (jc *JournalCreate) SaveX(ctx context.Context) *Journal
- func (jc *JournalCreate) SetFood(f *Food) *JournalCreate
- func (jc *JournalCreate) SetFoodID(id int) *JournalCreate
- func (jc *JournalCreate) SetFoodweight(f float64) *JournalCreate
- func (jc *JournalCreate) SetMeal(i int64) *JournalCreate
- func (jc *JournalCreate) SetTimestamp(t time.Time) *JournalCreate
- func (jc *JournalCreate) SetUserid(i int64) *JournalCreate
- type JournalCreateBulk
- func (jcb *JournalCreateBulk) Exec(ctx context.Context) error
- func (jcb *JournalCreateBulk) ExecX(ctx context.Context)
- func (jcb *JournalCreateBulk) OnConflict(opts ...sql.ConflictOption) *JournalUpsertBulk
- func (jcb *JournalCreateBulk) OnConflictColumns(columns ...string) *JournalUpsertBulk
- func (jcb *JournalCreateBulk) Save(ctx context.Context) ([]*Journal, error)
- func (jcb *JournalCreateBulk) SaveX(ctx context.Context) []*Journal
- type JournalDelete
- type JournalDeleteOne
- type JournalEdges
- type JournalGroupBy
- func (jgb *JournalGroupBy) Aggregate(fns ...AggregateFunc) *JournalGroupBy
- func (s *JournalGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *JournalGroupBy) BoolX(ctx context.Context) bool
- func (s *JournalGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *JournalGroupBy) BoolsX(ctx context.Context) []bool
- func (s *JournalGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *JournalGroupBy) Float64X(ctx context.Context) float64
- func (s *JournalGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *JournalGroupBy) Float64sX(ctx context.Context) []float64
- func (s *JournalGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *JournalGroupBy) IntX(ctx context.Context) int
- func (s *JournalGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *JournalGroupBy) IntsX(ctx context.Context) []int
- func (jgb *JournalGroupBy) Scan(ctx context.Context, v any) error
- func (s *JournalGroupBy) ScanX(ctx context.Context, v any)
- func (s *JournalGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *JournalGroupBy) StringX(ctx context.Context) string
- func (s *JournalGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *JournalGroupBy) StringsX(ctx context.Context) []string
- type JournalMutation
- func (m *JournalMutation) AddField(name string, value ent.Value) error
- func (m *JournalMutation) AddFoodweight(f float64)
- func (m *JournalMutation) AddMeal(i int64)
- func (m *JournalMutation) AddUserid(i int64)
- func (m *JournalMutation) AddedEdges() []string
- func (m *JournalMutation) AddedField(name string) (ent.Value, bool)
- func (m *JournalMutation) AddedFields() []string
- func (m *JournalMutation) AddedFoodweight() (r float64, exists bool)
- func (m *JournalMutation) AddedIDs(name string) []ent.Value
- func (m *JournalMutation) AddedMeal() (r int64, exists bool)
- func (m *JournalMutation) AddedUserid() (r int64, exists bool)
- func (m *JournalMutation) ClearEdge(name string) error
- func (m *JournalMutation) ClearField(name string) error
- func (m *JournalMutation) ClearFood()
- func (m *JournalMutation) ClearedEdges() []string
- func (m *JournalMutation) ClearedFields() []string
- func (m JournalMutation) Client() *Client
- func (m *JournalMutation) EdgeCleared(name string) bool
- func (m *JournalMutation) Field(name string) (ent.Value, bool)
- func (m *JournalMutation) FieldCleared(name string) bool
- func (m *JournalMutation) Fields() []string
- func (m *JournalMutation) FoodCleared() bool
- func (m *JournalMutation) FoodID() (id int, exists bool)
- func (m *JournalMutation) FoodIDs() (ids []int)
- func (m *JournalMutation) Foodweight() (r float64, exists bool)
- func (m *JournalMutation) ID() (id int, exists bool)
- func (m *JournalMutation) IDs(ctx context.Context) ([]int, error)
- func (m *JournalMutation) Meal() (r int64, exists bool)
- func (m *JournalMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *JournalMutation) OldFoodweight(ctx context.Context) (v float64, err error)
- func (m *JournalMutation) OldMeal(ctx context.Context) (v int64, err error)
- func (m *JournalMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)
- func (m *JournalMutation) OldUserid(ctx context.Context) (v int64, err error)
- func (m *JournalMutation) Op() Op
- func (m *JournalMutation) RemovedEdges() []string
- func (m *JournalMutation) RemovedIDs(name string) []ent.Value
- func (m *JournalMutation) ResetEdge(name string) error
- func (m *JournalMutation) ResetField(name string) error
- func (m *JournalMutation) ResetFood()
- func (m *JournalMutation) ResetFoodweight()
- func (m *JournalMutation) ResetMeal()
- func (m *JournalMutation) ResetTimestamp()
- func (m *JournalMutation) ResetUserid()
- func (m *JournalMutation) SetField(name string, value ent.Value) error
- func (m *JournalMutation) SetFoodID(id int)
- func (m *JournalMutation) SetFoodweight(f float64)
- func (m *JournalMutation) SetMeal(i int64)
- func (m *JournalMutation) SetOp(op Op)
- func (m *JournalMutation) SetTimestamp(t time.Time)
- func (m *JournalMutation) SetUserid(i int64)
- func (m *JournalMutation) Timestamp() (r time.Time, exists bool)
- func (m JournalMutation) Tx() (*Tx, error)
- func (m *JournalMutation) Type() string
- func (m *JournalMutation) Userid() (r int64, exists bool)
- func (m *JournalMutation) Where(ps ...predicate.Journal)
- func (m *JournalMutation) WhereP(ps ...func(*sql.Selector))
- type JournalQuery
- func (jq *JournalQuery) Aggregate(fns ...AggregateFunc) *JournalSelect
- func (jq *JournalQuery) All(ctx context.Context) ([]*Journal, error)
- func (jq *JournalQuery) AllX(ctx context.Context) []*Journal
- func (jq *JournalQuery) Clone() *JournalQuery
- func (jq *JournalQuery) Count(ctx context.Context) (int, error)
- func (jq *JournalQuery) CountX(ctx context.Context) int
- func (jq *JournalQuery) Exist(ctx context.Context) (bool, error)
- func (jq *JournalQuery) ExistX(ctx context.Context) bool
- func (jq *JournalQuery) First(ctx context.Context) (*Journal, error)
- func (jq *JournalQuery) FirstID(ctx context.Context) (id int, err error)
- func (jq *JournalQuery) FirstIDX(ctx context.Context) int
- func (jq *JournalQuery) FirstX(ctx context.Context) *Journal
- func (jq *JournalQuery) GroupBy(field string, fields ...string) *JournalGroupBy
- func (jq *JournalQuery) IDs(ctx context.Context) (ids []int, err error)
- func (jq *JournalQuery) IDsX(ctx context.Context) []int
- func (jq *JournalQuery) Limit(limit int) *JournalQuery
- func (jq *JournalQuery) Modify(modifiers ...func(s *sql.Selector)) *JournalSelect
- func (jq *JournalQuery) Offset(offset int) *JournalQuery
- func (jq *JournalQuery) Only(ctx context.Context) (*Journal, error)
- func (jq *JournalQuery) OnlyID(ctx context.Context) (id int, err error)
- func (jq *JournalQuery) OnlyIDX(ctx context.Context) int
- func (jq *JournalQuery) OnlyX(ctx context.Context) *Journal
- func (jq *JournalQuery) Order(o ...journal.OrderOption) *JournalQuery
- func (jq *JournalQuery) QueryFood() *FoodQuery
- func (jq *JournalQuery) Select(fields ...string) *JournalSelect
- func (jq *JournalQuery) Unique(unique bool) *JournalQuery
- func (jq *JournalQuery) Where(ps ...predicate.Journal) *JournalQuery
- func (jq *JournalQuery) WithFood(opts ...func(*FoodQuery)) *JournalQuery
- type JournalSelect
- func (js *JournalSelect) Aggregate(fns ...AggregateFunc) *JournalSelect
- func (s *JournalSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *JournalSelect) BoolX(ctx context.Context) bool
- func (s *JournalSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *JournalSelect) BoolsX(ctx context.Context) []bool
- func (s *JournalSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *JournalSelect) Float64X(ctx context.Context) float64
- func (s *JournalSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *JournalSelect) Float64sX(ctx context.Context) []float64
- func (s *JournalSelect) Int(ctx context.Context) (_ int, err error)
- func (s *JournalSelect) IntX(ctx context.Context) int
- func (s *JournalSelect) Ints(ctx context.Context) ([]int, error)
- func (s *JournalSelect) IntsX(ctx context.Context) []int
- func (js *JournalSelect) Modify(modifiers ...func(s *sql.Selector)) *JournalSelect
- func (js *JournalSelect) Scan(ctx context.Context, v any) error
- func (s *JournalSelect) ScanX(ctx context.Context, v any)
- func (s *JournalSelect) String(ctx context.Context) (_ string, err error)
- func (s *JournalSelect) StringX(ctx context.Context) string
- func (s *JournalSelect) Strings(ctx context.Context) ([]string, error)
- func (s *JournalSelect) StringsX(ctx context.Context) []string
- type JournalUpdate
- func (ju *JournalUpdate) AddFoodweight(f float64) *JournalUpdate
- func (ju *JournalUpdate) AddMeal(i int64) *JournalUpdate
- func (ju *JournalUpdate) AddUserid(i int64) *JournalUpdate
- func (ju *JournalUpdate) ClearFood() *JournalUpdate
- func (ju *JournalUpdate) Exec(ctx context.Context) error
- func (ju *JournalUpdate) ExecX(ctx context.Context)
- func (ju *JournalUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *JournalUpdate
- func (ju *JournalUpdate) Mutation() *JournalMutation
- func (ju *JournalUpdate) Save(ctx context.Context) (int, error)
- func (ju *JournalUpdate) SaveX(ctx context.Context) int
- func (ju *JournalUpdate) SetFood(f *Food) *JournalUpdate
- func (ju *JournalUpdate) SetFoodID(id int) *JournalUpdate
- func (ju *JournalUpdate) SetFoodweight(f float64) *JournalUpdate
- func (ju *JournalUpdate) SetMeal(i int64) *JournalUpdate
- func (ju *JournalUpdate) SetNillableFoodweight(f *float64) *JournalUpdate
- func (ju *JournalUpdate) SetNillableMeal(i *int64) *JournalUpdate
- func (ju *JournalUpdate) SetNillableTimestamp(t *time.Time) *JournalUpdate
- func (ju *JournalUpdate) SetNillableUserid(i *int64) *JournalUpdate
- func (ju *JournalUpdate) SetTimestamp(t time.Time) *JournalUpdate
- func (ju *JournalUpdate) SetUserid(i int64) *JournalUpdate
- func (ju *JournalUpdate) Where(ps ...predicate.Journal) *JournalUpdate
- type JournalUpdateOne
- func (juo *JournalUpdateOne) AddFoodweight(f float64) *JournalUpdateOne
- func (juo *JournalUpdateOne) AddMeal(i int64) *JournalUpdateOne
- func (juo *JournalUpdateOne) AddUserid(i int64) *JournalUpdateOne
- func (juo *JournalUpdateOne) ClearFood() *JournalUpdateOne
- func (juo *JournalUpdateOne) Exec(ctx context.Context) error
- func (juo *JournalUpdateOne) ExecX(ctx context.Context)
- func (juo *JournalUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *JournalUpdateOne
- func (juo *JournalUpdateOne) Mutation() *JournalMutation
- func (juo *JournalUpdateOne) Save(ctx context.Context) (*Journal, error)
- func (juo *JournalUpdateOne) SaveX(ctx context.Context) *Journal
- func (juo *JournalUpdateOne) Select(field string, fields ...string) *JournalUpdateOne
- func (juo *JournalUpdateOne) SetFood(f *Food) *JournalUpdateOne
- func (juo *JournalUpdateOne) SetFoodID(id int) *JournalUpdateOne
- func (juo *JournalUpdateOne) SetFoodweight(f float64) *JournalUpdateOne
- func (juo *JournalUpdateOne) SetMeal(i int64) *JournalUpdateOne
- func (juo *JournalUpdateOne) SetNillableFoodweight(f *float64) *JournalUpdateOne
- func (juo *JournalUpdateOne) SetNillableMeal(i *int64) *JournalUpdateOne
- func (juo *JournalUpdateOne) SetNillableTimestamp(t *time.Time) *JournalUpdateOne
- func (juo *JournalUpdateOne) SetNillableUserid(i *int64) *JournalUpdateOne
- func (juo *JournalUpdateOne) SetTimestamp(t time.Time) *JournalUpdateOne
- func (juo *JournalUpdateOne) SetUserid(i int64) *JournalUpdateOne
- func (juo *JournalUpdateOne) Where(ps ...predicate.Journal) *JournalUpdateOne
- type JournalUpsert
- func (u *JournalUpsert) AddFoodweight(v float64) *JournalUpsert
- func (u *JournalUpsert) AddMeal(v int64) *JournalUpsert
- func (u *JournalUpsert) AddUserid(v int64) *JournalUpsert
- func (u *JournalUpsert) SetFoodweight(v float64) *JournalUpsert
- func (u *JournalUpsert) SetMeal(v int64) *JournalUpsert
- func (u *JournalUpsert) SetTimestamp(v time.Time) *JournalUpsert
- func (u *JournalUpsert) SetUserid(v int64) *JournalUpsert
- func (u *JournalUpsert) UpdateFoodweight() *JournalUpsert
- func (u *JournalUpsert) UpdateMeal() *JournalUpsert
- func (u *JournalUpsert) UpdateTimestamp() *JournalUpsert
- func (u *JournalUpsert) UpdateUserid() *JournalUpsert
- type JournalUpsertBulk
- func (u *JournalUpsertBulk) AddFoodweight(v float64) *JournalUpsertBulk
- func (u *JournalUpsertBulk) AddMeal(v int64) *JournalUpsertBulk
- func (u *JournalUpsertBulk) AddUserid(v int64) *JournalUpsertBulk
- func (u *JournalUpsertBulk) DoNothing() *JournalUpsertBulk
- func (u *JournalUpsertBulk) Exec(ctx context.Context) error
- func (u *JournalUpsertBulk) ExecX(ctx context.Context)
- func (u *JournalUpsertBulk) Ignore() *JournalUpsertBulk
- func (u *JournalUpsertBulk) SetFoodweight(v float64) *JournalUpsertBulk
- func (u *JournalUpsertBulk) SetMeal(v int64) *JournalUpsertBulk
- func (u *JournalUpsertBulk) SetTimestamp(v time.Time) *JournalUpsertBulk
- func (u *JournalUpsertBulk) SetUserid(v int64) *JournalUpsertBulk
- func (u *JournalUpsertBulk) Update(set func(*JournalUpsert)) *JournalUpsertBulk
- func (u *JournalUpsertBulk) UpdateFoodweight() *JournalUpsertBulk
- func (u *JournalUpsertBulk) UpdateMeal() *JournalUpsertBulk
- func (u *JournalUpsertBulk) UpdateNewValues() *JournalUpsertBulk
- func (u *JournalUpsertBulk) UpdateTimestamp() *JournalUpsertBulk
- func (u *JournalUpsertBulk) UpdateUserid() *JournalUpsertBulk
- type JournalUpsertOne
- func (u *JournalUpsertOne) AddFoodweight(v float64) *JournalUpsertOne
- func (u *JournalUpsertOne) AddMeal(v int64) *JournalUpsertOne
- func (u *JournalUpsertOne) AddUserid(v int64) *JournalUpsertOne
- func (u *JournalUpsertOne) DoNothing() *JournalUpsertOne
- func (u *JournalUpsertOne) Exec(ctx context.Context) error
- func (u *JournalUpsertOne) ExecX(ctx context.Context)
- func (u *JournalUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *JournalUpsertOne) IDX(ctx context.Context) int
- func (u *JournalUpsertOne) Ignore() *JournalUpsertOne
- func (u *JournalUpsertOne) SetFoodweight(v float64) *JournalUpsertOne
- func (u *JournalUpsertOne) SetMeal(v int64) *JournalUpsertOne
- func (u *JournalUpsertOne) SetTimestamp(v time.Time) *JournalUpsertOne
- func (u *JournalUpsertOne) SetUserid(v int64) *JournalUpsertOne
- func (u *JournalUpsertOne) Update(set func(*JournalUpsert)) *JournalUpsertOne
- func (u *JournalUpsertOne) UpdateFoodweight() *JournalUpsertOne
- func (u *JournalUpsertOne) UpdateMeal() *JournalUpsertOne
- func (u *JournalUpsertOne) UpdateNewValues() *JournalUpsertOne
- func (u *JournalUpsertOne) UpdateTimestamp() *JournalUpsertOne
- func (u *JournalUpsertOne) UpdateUserid() *JournalUpsertOne
- type Journals
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type UserSettings
- type UserSettingsClient
- func (c *UserSettingsClient) Create() *UserSettingsCreate
- func (c *UserSettingsClient) CreateBulk(builders ...*UserSettingsCreate) *UserSettingsCreateBulk
- func (c *UserSettingsClient) Delete() *UserSettingsDelete
- func (c *UserSettingsClient) DeleteOne(us *UserSettings) *UserSettingsDeleteOne
- func (c *UserSettingsClient) DeleteOneID(id int) *UserSettingsDeleteOne
- func (c *UserSettingsClient) Get(ctx context.Context, id int) (*UserSettings, error)
- func (c *UserSettingsClient) GetX(ctx context.Context, id int) *UserSettings
- func (c *UserSettingsClient) Hooks() []Hook
- func (c *UserSettingsClient) Intercept(interceptors ...Interceptor)
- func (c *UserSettingsClient) Interceptors() []Interceptor
- func (c *UserSettingsClient) MapCreateBulk(slice any, setFunc func(*UserSettingsCreate, int)) *UserSettingsCreateBulk
- func (c *UserSettingsClient) Query() *UserSettingsQuery
- func (c *UserSettingsClient) Update() *UserSettingsUpdate
- func (c *UserSettingsClient) UpdateOne(us *UserSettings) *UserSettingsUpdateOne
- func (c *UserSettingsClient) UpdateOneID(id int) *UserSettingsUpdateOne
- func (c *UserSettingsClient) Use(hooks ...Hook)
- type UserSettingsCreate
- func (usc *UserSettingsCreate) Exec(ctx context.Context) error
- func (usc *UserSettingsCreate) ExecX(ctx context.Context)
- func (usc *UserSettingsCreate) Mutation() *UserSettingsMutation
- func (usc *UserSettingsCreate) OnConflict(opts ...sql.ConflictOption) *UserSettingsUpsertOne
- func (usc *UserSettingsCreate) OnConflictColumns(columns ...string) *UserSettingsUpsertOne
- func (usc *UserSettingsCreate) Save(ctx context.Context) (*UserSettings, error)
- func (usc *UserSettingsCreate) SaveX(ctx context.Context) *UserSettings
- func (usc *UserSettingsCreate) SetCalLimit(f float64) *UserSettingsCreate
- func (usc *UserSettingsCreate) SetDefaultActiveCal(f float64) *UserSettingsCreate
- func (usc *UserSettingsCreate) SetUserid(i int64) *UserSettingsCreate
- type UserSettingsCreateBulk
- func (uscb *UserSettingsCreateBulk) Exec(ctx context.Context) error
- func (uscb *UserSettingsCreateBulk) ExecX(ctx context.Context)
- func (uscb *UserSettingsCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserSettingsUpsertBulk
- func (uscb *UserSettingsCreateBulk) OnConflictColumns(columns ...string) *UserSettingsUpsertBulk
- func (uscb *UserSettingsCreateBulk) Save(ctx context.Context) ([]*UserSettings, error)
- func (uscb *UserSettingsCreateBulk) SaveX(ctx context.Context) []*UserSettings
- type UserSettingsDelete
- type UserSettingsDeleteOne
- type UserSettingsGroupBy
- func (usgb *UserSettingsGroupBy) Aggregate(fns ...AggregateFunc) *UserSettingsGroupBy
- func (s *UserSettingsGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSettingsGroupBy) BoolX(ctx context.Context) bool
- func (s *UserSettingsGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSettingsGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserSettingsGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSettingsGroupBy) Float64X(ctx context.Context) float64
- func (s *UserSettingsGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSettingsGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserSettingsGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserSettingsGroupBy) IntX(ctx context.Context) int
- func (s *UserSettingsGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserSettingsGroupBy) IntsX(ctx context.Context) []int
- func (usgb *UserSettingsGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserSettingsGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserSettingsGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserSettingsGroupBy) StringX(ctx context.Context) string
- func (s *UserSettingsGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserSettingsGroupBy) StringsX(ctx context.Context) []string
- type UserSettingsMutation
- func (m *UserSettingsMutation) AddCalLimit(f float64)
- func (m *UserSettingsMutation) AddDefaultActiveCal(f float64)
- func (m *UserSettingsMutation) AddField(name string, value ent.Value) error
- func (m *UserSettingsMutation) AddUserid(i int64)
- func (m *UserSettingsMutation) AddedCalLimit() (r float64, exists bool)
- func (m *UserSettingsMutation) AddedDefaultActiveCal() (r float64, exists bool)
- func (m *UserSettingsMutation) AddedEdges() []string
- func (m *UserSettingsMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserSettingsMutation) AddedFields() []string
- func (m *UserSettingsMutation) AddedIDs(name string) []ent.Value
- func (m *UserSettingsMutation) AddedUserid() (r int64, exists bool)
- func (m *UserSettingsMutation) CalLimit() (r float64, exists bool)
- func (m *UserSettingsMutation) ClearEdge(name string) error
- func (m *UserSettingsMutation) ClearField(name string) error
- func (m *UserSettingsMutation) ClearedEdges() []string
- func (m *UserSettingsMutation) ClearedFields() []string
- func (m UserSettingsMutation) Client() *Client
- func (m *UserSettingsMutation) DefaultActiveCal() (r float64, exists bool)
- func (m *UserSettingsMutation) EdgeCleared(name string) bool
- func (m *UserSettingsMutation) Field(name string) (ent.Value, bool)
- func (m *UserSettingsMutation) FieldCleared(name string) bool
- func (m *UserSettingsMutation) Fields() []string
- func (m *UserSettingsMutation) ID() (id int, exists bool)
- func (m *UserSettingsMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserSettingsMutation) OldCalLimit(ctx context.Context) (v float64, err error)
- func (m *UserSettingsMutation) OldDefaultActiveCal(ctx context.Context) (v float64, err error)
- func (m *UserSettingsMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserSettingsMutation) OldUserid(ctx context.Context) (v int64, err error)
- func (m *UserSettingsMutation) Op() Op
- func (m *UserSettingsMutation) RemovedEdges() []string
- func (m *UserSettingsMutation) RemovedIDs(name string) []ent.Value
- func (m *UserSettingsMutation) ResetCalLimit()
- func (m *UserSettingsMutation) ResetDefaultActiveCal()
- func (m *UserSettingsMutation) ResetEdge(name string) error
- func (m *UserSettingsMutation) ResetField(name string) error
- func (m *UserSettingsMutation) ResetUserid()
- func (m *UserSettingsMutation) SetCalLimit(f float64)
- func (m *UserSettingsMutation) SetDefaultActiveCal(f float64)
- func (m *UserSettingsMutation) SetField(name string, value ent.Value) error
- func (m *UserSettingsMutation) SetOp(op Op)
- func (m *UserSettingsMutation) SetUserid(i int64)
- func (m UserSettingsMutation) Tx() (*Tx, error)
- func (m *UserSettingsMutation) Type() string
- func (m *UserSettingsMutation) Userid() (r int64, exists bool)
- func (m *UserSettingsMutation) Where(ps ...predicate.UserSettings)
- func (m *UserSettingsMutation) WhereP(ps ...func(*sql.Selector))
- type UserSettingsQuery
- func (usq *UserSettingsQuery) Aggregate(fns ...AggregateFunc) *UserSettingsSelect
- func (usq *UserSettingsQuery) All(ctx context.Context) ([]*UserSettings, error)
- func (usq *UserSettingsQuery) AllX(ctx context.Context) []*UserSettings
- func (usq *UserSettingsQuery) Clone() *UserSettingsQuery
- func (usq *UserSettingsQuery) Count(ctx context.Context) (int, error)
- func (usq *UserSettingsQuery) CountX(ctx context.Context) int
- func (usq *UserSettingsQuery) Exist(ctx context.Context) (bool, error)
- func (usq *UserSettingsQuery) ExistX(ctx context.Context) bool
- func (usq *UserSettingsQuery) First(ctx context.Context) (*UserSettings, error)
- func (usq *UserSettingsQuery) FirstID(ctx context.Context) (id int, err error)
- func (usq *UserSettingsQuery) FirstIDX(ctx context.Context) int
- func (usq *UserSettingsQuery) FirstX(ctx context.Context) *UserSettings
- func (usq *UserSettingsQuery) GroupBy(field string, fields ...string) *UserSettingsGroupBy
- func (usq *UserSettingsQuery) IDs(ctx context.Context) (ids []int, err error)
- func (usq *UserSettingsQuery) IDsX(ctx context.Context) []int
- func (usq *UserSettingsQuery) Limit(limit int) *UserSettingsQuery
- func (usq *UserSettingsQuery) Modify(modifiers ...func(s *sql.Selector)) *UserSettingsSelect
- func (usq *UserSettingsQuery) Offset(offset int) *UserSettingsQuery
- func (usq *UserSettingsQuery) Only(ctx context.Context) (*UserSettings, error)
- func (usq *UserSettingsQuery) OnlyID(ctx context.Context) (id int, err error)
- func (usq *UserSettingsQuery) OnlyIDX(ctx context.Context) int
- func (usq *UserSettingsQuery) OnlyX(ctx context.Context) *UserSettings
- func (usq *UserSettingsQuery) Order(o ...usersettings.OrderOption) *UserSettingsQuery
- func (usq *UserSettingsQuery) Select(fields ...string) *UserSettingsSelect
- func (usq *UserSettingsQuery) Unique(unique bool) *UserSettingsQuery
- func (usq *UserSettingsQuery) Where(ps ...predicate.UserSettings) *UserSettingsQuery
- type UserSettingsSelect
- func (uss *UserSettingsSelect) Aggregate(fns ...AggregateFunc) *UserSettingsSelect
- func (s *UserSettingsSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSettingsSelect) BoolX(ctx context.Context) bool
- func (s *UserSettingsSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSettingsSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSettingsSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSettingsSelect) Float64X(ctx context.Context) float64
- func (s *UserSettingsSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSettingsSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSettingsSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSettingsSelect) IntX(ctx context.Context) int
- func (s *UserSettingsSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSettingsSelect) IntsX(ctx context.Context) []int
- func (uss *UserSettingsSelect) Modify(modifiers ...func(s *sql.Selector)) *UserSettingsSelect
- func (uss *UserSettingsSelect) Scan(ctx context.Context, v any) error
- func (s *UserSettingsSelect) ScanX(ctx context.Context, v any)
- func (s *UserSettingsSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSettingsSelect) StringX(ctx context.Context) string
- func (s *UserSettingsSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSettingsSelect) StringsX(ctx context.Context) []string
- type UserSettingsSlice
- type UserSettingsUpdate
- func (usu *UserSettingsUpdate) AddCalLimit(f float64) *UserSettingsUpdate
- func (usu *UserSettingsUpdate) AddDefaultActiveCal(f float64) *UserSettingsUpdate
- func (usu *UserSettingsUpdate) AddUserid(i int64) *UserSettingsUpdate
- func (usu *UserSettingsUpdate) Exec(ctx context.Context) error
- func (usu *UserSettingsUpdate) ExecX(ctx context.Context)
- func (usu *UserSettingsUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserSettingsUpdate
- func (usu *UserSettingsUpdate) Mutation() *UserSettingsMutation
- func (usu *UserSettingsUpdate) Save(ctx context.Context) (int, error)
- func (usu *UserSettingsUpdate) SaveX(ctx context.Context) int
- func (usu *UserSettingsUpdate) SetCalLimit(f float64) *UserSettingsUpdate
- func (usu *UserSettingsUpdate) SetDefaultActiveCal(f float64) *UserSettingsUpdate
- func (usu *UserSettingsUpdate) SetNillableCalLimit(f *float64) *UserSettingsUpdate
- func (usu *UserSettingsUpdate) SetNillableDefaultActiveCal(f *float64) *UserSettingsUpdate
- func (usu *UserSettingsUpdate) SetNillableUserid(i *int64) *UserSettingsUpdate
- func (usu *UserSettingsUpdate) SetUserid(i int64) *UserSettingsUpdate
- func (usu *UserSettingsUpdate) Where(ps ...predicate.UserSettings) *UserSettingsUpdate
- type UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) AddCalLimit(f float64) *UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) AddDefaultActiveCal(f float64) *UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) AddUserid(i int64) *UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) Exec(ctx context.Context) error
- func (usuo *UserSettingsUpdateOne) ExecX(ctx context.Context)
- func (usuo *UserSettingsUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) Mutation() *UserSettingsMutation
- func (usuo *UserSettingsUpdateOne) Save(ctx context.Context) (*UserSettings, error)
- func (usuo *UserSettingsUpdateOne) SaveX(ctx context.Context) *UserSettings
- func (usuo *UserSettingsUpdateOne) Select(field string, fields ...string) *UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) SetCalLimit(f float64) *UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) SetDefaultActiveCal(f float64) *UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) SetNillableCalLimit(f *float64) *UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) SetNillableDefaultActiveCal(f *float64) *UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) SetNillableUserid(i *int64) *UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) SetUserid(i int64) *UserSettingsUpdateOne
- func (usuo *UserSettingsUpdateOne) Where(ps ...predicate.UserSettings) *UserSettingsUpdateOne
- type UserSettingsUpsert
- func (u *UserSettingsUpsert) AddCalLimit(v float64) *UserSettingsUpsert
- func (u *UserSettingsUpsert) AddDefaultActiveCal(v float64) *UserSettingsUpsert
- func (u *UserSettingsUpsert) AddUserid(v int64) *UserSettingsUpsert
- func (u *UserSettingsUpsert) SetCalLimit(v float64) *UserSettingsUpsert
- func (u *UserSettingsUpsert) SetDefaultActiveCal(v float64) *UserSettingsUpsert
- func (u *UserSettingsUpsert) SetUserid(v int64) *UserSettingsUpsert
- func (u *UserSettingsUpsert) UpdateCalLimit() *UserSettingsUpsert
- func (u *UserSettingsUpsert) UpdateDefaultActiveCal() *UserSettingsUpsert
- func (u *UserSettingsUpsert) UpdateUserid() *UserSettingsUpsert
- type UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) AddCalLimit(v float64) *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) AddDefaultActiveCal(v float64) *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) AddUserid(v int64) *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) DoNothing() *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) Exec(ctx context.Context) error
- func (u *UserSettingsUpsertBulk) ExecX(ctx context.Context)
- func (u *UserSettingsUpsertBulk) Ignore() *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) SetCalLimit(v float64) *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) SetDefaultActiveCal(v float64) *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) SetUserid(v int64) *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) Update(set func(*UserSettingsUpsert)) *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) UpdateCalLimit() *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) UpdateDefaultActiveCal() *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) UpdateNewValues() *UserSettingsUpsertBulk
- func (u *UserSettingsUpsertBulk) UpdateUserid() *UserSettingsUpsertBulk
- type UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) AddCalLimit(v float64) *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) AddDefaultActiveCal(v float64) *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) AddUserid(v int64) *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) DoNothing() *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) Exec(ctx context.Context) error
- func (u *UserSettingsUpsertOne) ExecX(ctx context.Context)
- func (u *UserSettingsUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *UserSettingsUpsertOne) IDX(ctx context.Context) int
- func (u *UserSettingsUpsertOne) Ignore() *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) SetCalLimit(v float64) *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) SetDefaultActiveCal(v float64) *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) SetUserid(v int64) *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) Update(set func(*UserSettingsUpsert)) *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) UpdateCalLimit() *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) UpdateDefaultActiveCal() *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) UpdateNewValues() *UserSettingsUpsertOne
- func (u *UserSettingsUpsertOne) UpdateUserid() *UserSettingsUpsertOne
- type ValidationError
- type Value
- type Weight
- type WeightClient
- func (c *WeightClient) Create() *WeightCreate
- func (c *WeightClient) CreateBulk(builders ...*WeightCreate) *WeightCreateBulk
- func (c *WeightClient) Delete() *WeightDelete
- func (c *WeightClient) DeleteOne(w *Weight) *WeightDeleteOne
- func (c *WeightClient) DeleteOneID(id int) *WeightDeleteOne
- func (c *WeightClient) Get(ctx context.Context, id int) (*Weight, error)
- func (c *WeightClient) GetX(ctx context.Context, id int) *Weight
- func (c *WeightClient) Hooks() []Hook
- func (c *WeightClient) Intercept(interceptors ...Interceptor)
- func (c *WeightClient) Interceptors() []Interceptor
- func (c *WeightClient) MapCreateBulk(slice any, setFunc func(*WeightCreate, int)) *WeightCreateBulk
- func (c *WeightClient) Query() *WeightQuery
- func (c *WeightClient) Update() *WeightUpdate
- func (c *WeightClient) UpdateOne(w *Weight) *WeightUpdateOne
- func (c *WeightClient) UpdateOneID(id int) *WeightUpdateOne
- func (c *WeightClient) Use(hooks ...Hook)
- type WeightCreate
- func (wc *WeightCreate) Exec(ctx context.Context) error
- func (wc *WeightCreate) ExecX(ctx context.Context)
- func (wc *WeightCreate) Mutation() *WeightMutation
- func (wc *WeightCreate) OnConflict(opts ...sql.ConflictOption) *WeightUpsertOne
- func (wc *WeightCreate) OnConflictColumns(columns ...string) *WeightUpsertOne
- func (wc *WeightCreate) Save(ctx context.Context) (*Weight, error)
- func (wc *WeightCreate) SaveX(ctx context.Context) *Weight
- func (wc *WeightCreate) SetTimestamp(t time.Time) *WeightCreate
- func (wc *WeightCreate) SetUserid(i int64) *WeightCreate
- func (wc *WeightCreate) SetValue(f float64) *WeightCreate
- type WeightCreateBulk
- func (wcb *WeightCreateBulk) Exec(ctx context.Context) error
- func (wcb *WeightCreateBulk) ExecX(ctx context.Context)
- func (wcb *WeightCreateBulk) OnConflict(opts ...sql.ConflictOption) *WeightUpsertBulk
- func (wcb *WeightCreateBulk) OnConflictColumns(columns ...string) *WeightUpsertBulk
- func (wcb *WeightCreateBulk) Save(ctx context.Context) ([]*Weight, error)
- func (wcb *WeightCreateBulk) SaveX(ctx context.Context) []*Weight
- type WeightDelete
- type WeightDeleteOne
- type WeightGroupBy
- func (wgb *WeightGroupBy) Aggregate(fns ...AggregateFunc) *WeightGroupBy
- func (s *WeightGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *WeightGroupBy) BoolX(ctx context.Context) bool
- func (s *WeightGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *WeightGroupBy) BoolsX(ctx context.Context) []bool
- func (s *WeightGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *WeightGroupBy) Float64X(ctx context.Context) float64
- func (s *WeightGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *WeightGroupBy) Float64sX(ctx context.Context) []float64
- func (s *WeightGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *WeightGroupBy) IntX(ctx context.Context) int
- func (s *WeightGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *WeightGroupBy) IntsX(ctx context.Context) []int
- func (wgb *WeightGroupBy) Scan(ctx context.Context, v any) error
- func (s *WeightGroupBy) ScanX(ctx context.Context, v any)
- func (s *WeightGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *WeightGroupBy) StringX(ctx context.Context) string
- func (s *WeightGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *WeightGroupBy) StringsX(ctx context.Context) []string
- type WeightMutation
- func (m *WeightMutation) AddField(name string, value ent.Value) error
- func (m *WeightMutation) AddUserid(i int64)
- func (m *WeightMutation) AddValue(f float64)
- func (m *WeightMutation) AddedEdges() []string
- func (m *WeightMutation) AddedField(name string) (ent.Value, bool)
- func (m *WeightMutation) AddedFields() []string
- func (m *WeightMutation) AddedIDs(name string) []ent.Value
- func (m *WeightMutation) AddedUserid() (r int64, exists bool)
- func (m *WeightMutation) AddedValue() (r float64, exists bool)
- func (m *WeightMutation) ClearEdge(name string) error
- func (m *WeightMutation) ClearField(name string) error
- func (m *WeightMutation) ClearedEdges() []string
- func (m *WeightMutation) ClearedFields() []string
- func (m WeightMutation) Client() *Client
- func (m *WeightMutation) EdgeCleared(name string) bool
- func (m *WeightMutation) Field(name string) (ent.Value, bool)
- func (m *WeightMutation) FieldCleared(name string) bool
- func (m *WeightMutation) Fields() []string
- func (m *WeightMutation) ID() (id int, exists bool)
- func (m *WeightMutation) IDs(ctx context.Context) ([]int, error)
- func (m *WeightMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *WeightMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)
- func (m *WeightMutation) OldUserid(ctx context.Context) (v int64, err error)
- func (m *WeightMutation) OldValue(ctx context.Context) (v float64, err error)
- func (m *WeightMutation) Op() Op
- func (m *WeightMutation) RemovedEdges() []string
- func (m *WeightMutation) RemovedIDs(name string) []ent.Value
- func (m *WeightMutation) ResetEdge(name string) error
- func (m *WeightMutation) ResetField(name string) error
- func (m *WeightMutation) ResetTimestamp()
- func (m *WeightMutation) ResetUserid()
- func (m *WeightMutation) ResetValue()
- func (m *WeightMutation) SetField(name string, value ent.Value) error
- func (m *WeightMutation) SetOp(op Op)
- func (m *WeightMutation) SetTimestamp(t time.Time)
- func (m *WeightMutation) SetUserid(i int64)
- func (m *WeightMutation) SetValue(f float64)
- func (m *WeightMutation) Timestamp() (r time.Time, exists bool)
- func (m WeightMutation) Tx() (*Tx, error)
- func (m *WeightMutation) Type() string
- func (m *WeightMutation) Userid() (r int64, exists bool)
- func (m *WeightMutation) Value() (r float64, exists bool)
- func (m *WeightMutation) Where(ps ...predicate.Weight)
- func (m *WeightMutation) WhereP(ps ...func(*sql.Selector))
- type WeightQuery
- func (wq *WeightQuery) Aggregate(fns ...AggregateFunc) *WeightSelect
- func (wq *WeightQuery) All(ctx context.Context) ([]*Weight, error)
- func (wq *WeightQuery) AllX(ctx context.Context) []*Weight
- func (wq *WeightQuery) Clone() *WeightQuery
- func (wq *WeightQuery) Count(ctx context.Context) (int, error)
- func (wq *WeightQuery) CountX(ctx context.Context) int
- func (wq *WeightQuery) Exist(ctx context.Context) (bool, error)
- func (wq *WeightQuery) ExistX(ctx context.Context) bool
- func (wq *WeightQuery) First(ctx context.Context) (*Weight, error)
- func (wq *WeightQuery) FirstID(ctx context.Context) (id int, err error)
- func (wq *WeightQuery) FirstIDX(ctx context.Context) int
- func (wq *WeightQuery) FirstX(ctx context.Context) *Weight
- func (wq *WeightQuery) GroupBy(field string, fields ...string) *WeightGroupBy
- func (wq *WeightQuery) IDs(ctx context.Context) (ids []int, err error)
- func (wq *WeightQuery) IDsX(ctx context.Context) []int
- func (wq *WeightQuery) Limit(limit int) *WeightQuery
- func (wq *WeightQuery) Modify(modifiers ...func(s *sql.Selector)) *WeightSelect
- func (wq *WeightQuery) Offset(offset int) *WeightQuery
- func (wq *WeightQuery) Only(ctx context.Context) (*Weight, error)
- func (wq *WeightQuery) OnlyID(ctx context.Context) (id int, err error)
- func (wq *WeightQuery) OnlyIDX(ctx context.Context) int
- func (wq *WeightQuery) OnlyX(ctx context.Context) *Weight
- func (wq *WeightQuery) Order(o ...weight.OrderOption) *WeightQuery
- func (wq *WeightQuery) Select(fields ...string) *WeightSelect
- func (wq *WeightQuery) Unique(unique bool) *WeightQuery
- func (wq *WeightQuery) Where(ps ...predicate.Weight) *WeightQuery
- type WeightSelect
- func (ws *WeightSelect) Aggregate(fns ...AggregateFunc) *WeightSelect
- func (s *WeightSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *WeightSelect) BoolX(ctx context.Context) bool
- func (s *WeightSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *WeightSelect) BoolsX(ctx context.Context) []bool
- func (s *WeightSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *WeightSelect) Float64X(ctx context.Context) float64
- func (s *WeightSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *WeightSelect) Float64sX(ctx context.Context) []float64
- func (s *WeightSelect) Int(ctx context.Context) (_ int, err error)
- func (s *WeightSelect) IntX(ctx context.Context) int
- func (s *WeightSelect) Ints(ctx context.Context) ([]int, error)
- func (s *WeightSelect) IntsX(ctx context.Context) []int
- func (ws *WeightSelect) Modify(modifiers ...func(s *sql.Selector)) *WeightSelect
- func (ws *WeightSelect) Scan(ctx context.Context, v any) error
- func (s *WeightSelect) ScanX(ctx context.Context, v any)
- func (s *WeightSelect) String(ctx context.Context) (_ string, err error)
- func (s *WeightSelect) StringX(ctx context.Context) string
- func (s *WeightSelect) Strings(ctx context.Context) ([]string, error)
- func (s *WeightSelect) StringsX(ctx context.Context) []string
- type WeightUpdate
- func (wu *WeightUpdate) AddUserid(i int64) *WeightUpdate
- func (wu *WeightUpdate) AddValue(f float64) *WeightUpdate
- func (wu *WeightUpdate) Exec(ctx context.Context) error
- func (wu *WeightUpdate) ExecX(ctx context.Context)
- func (wu *WeightUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *WeightUpdate
- func (wu *WeightUpdate) Mutation() *WeightMutation
- func (wu *WeightUpdate) Save(ctx context.Context) (int, error)
- func (wu *WeightUpdate) SaveX(ctx context.Context) int
- func (wu *WeightUpdate) SetNillableTimestamp(t *time.Time) *WeightUpdate
- func (wu *WeightUpdate) SetNillableUserid(i *int64) *WeightUpdate
- func (wu *WeightUpdate) SetNillableValue(f *float64) *WeightUpdate
- func (wu *WeightUpdate) SetTimestamp(t time.Time) *WeightUpdate
- func (wu *WeightUpdate) SetUserid(i int64) *WeightUpdate
- func (wu *WeightUpdate) SetValue(f float64) *WeightUpdate
- func (wu *WeightUpdate) Where(ps ...predicate.Weight) *WeightUpdate
- type WeightUpdateOne
- func (wuo *WeightUpdateOne) AddUserid(i int64) *WeightUpdateOne
- func (wuo *WeightUpdateOne) AddValue(f float64) *WeightUpdateOne
- func (wuo *WeightUpdateOne) Exec(ctx context.Context) error
- func (wuo *WeightUpdateOne) ExecX(ctx context.Context)
- func (wuo *WeightUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *WeightUpdateOne
- func (wuo *WeightUpdateOne) Mutation() *WeightMutation
- func (wuo *WeightUpdateOne) Save(ctx context.Context) (*Weight, error)
- func (wuo *WeightUpdateOne) SaveX(ctx context.Context) *Weight
- func (wuo *WeightUpdateOne) Select(field string, fields ...string) *WeightUpdateOne
- func (wuo *WeightUpdateOne) SetNillableTimestamp(t *time.Time) *WeightUpdateOne
- func (wuo *WeightUpdateOne) SetNillableUserid(i *int64) *WeightUpdateOne
- func (wuo *WeightUpdateOne) SetNillableValue(f *float64) *WeightUpdateOne
- func (wuo *WeightUpdateOne) SetTimestamp(t time.Time) *WeightUpdateOne
- func (wuo *WeightUpdateOne) SetUserid(i int64) *WeightUpdateOne
- func (wuo *WeightUpdateOne) SetValue(f float64) *WeightUpdateOne
- func (wuo *WeightUpdateOne) Where(ps ...predicate.Weight) *WeightUpdateOne
- type WeightUpsert
- func (u *WeightUpsert) AddUserid(v int64) *WeightUpsert
- func (u *WeightUpsert) AddValue(v float64) *WeightUpsert
- func (u *WeightUpsert) SetTimestamp(v time.Time) *WeightUpsert
- func (u *WeightUpsert) SetUserid(v int64) *WeightUpsert
- func (u *WeightUpsert) SetValue(v float64) *WeightUpsert
- func (u *WeightUpsert) UpdateTimestamp() *WeightUpsert
- func (u *WeightUpsert) UpdateUserid() *WeightUpsert
- func (u *WeightUpsert) UpdateValue() *WeightUpsert
- type WeightUpsertBulk
- func (u *WeightUpsertBulk) AddUserid(v int64) *WeightUpsertBulk
- func (u *WeightUpsertBulk) AddValue(v float64) *WeightUpsertBulk
- func (u *WeightUpsertBulk) DoNothing() *WeightUpsertBulk
- func (u *WeightUpsertBulk) Exec(ctx context.Context) error
- func (u *WeightUpsertBulk) ExecX(ctx context.Context)
- func (u *WeightUpsertBulk) Ignore() *WeightUpsertBulk
- func (u *WeightUpsertBulk) SetTimestamp(v time.Time) *WeightUpsertBulk
- func (u *WeightUpsertBulk) SetUserid(v int64) *WeightUpsertBulk
- func (u *WeightUpsertBulk) SetValue(v float64) *WeightUpsertBulk
- func (u *WeightUpsertBulk) Update(set func(*WeightUpsert)) *WeightUpsertBulk
- func (u *WeightUpsertBulk) UpdateNewValues() *WeightUpsertBulk
- func (u *WeightUpsertBulk) UpdateTimestamp() *WeightUpsertBulk
- func (u *WeightUpsertBulk) UpdateUserid() *WeightUpsertBulk
- func (u *WeightUpsertBulk) UpdateValue() *WeightUpsertBulk
- type WeightUpsertOne
- func (u *WeightUpsertOne) AddUserid(v int64) *WeightUpsertOne
- func (u *WeightUpsertOne) AddValue(v float64) *WeightUpsertOne
- func (u *WeightUpsertOne) DoNothing() *WeightUpsertOne
- func (u *WeightUpsertOne) Exec(ctx context.Context) error
- func (u *WeightUpsertOne) ExecX(ctx context.Context)
- func (u *WeightUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *WeightUpsertOne) IDX(ctx context.Context) int
- func (u *WeightUpsertOne) Ignore() *WeightUpsertOne
- func (u *WeightUpsertOne) SetTimestamp(v time.Time) *WeightUpsertOne
- func (u *WeightUpsertOne) SetUserid(v int64) *WeightUpsertOne
- func (u *WeightUpsertOne) SetValue(v float64) *WeightUpsertOne
- func (u *WeightUpsertOne) Update(set func(*WeightUpsert)) *WeightUpsertOne
- func (u *WeightUpsertOne) UpdateNewValues() *WeightUpsertOne
- func (u *WeightUpsertOne) UpdateTimestamp() *WeightUpsertOne
- func (u *WeightUpsertOne) UpdateUserid() *WeightUpsertOne
- func (u *WeightUpsertOne) UpdateValue() *WeightUpsertOne
- type Weights
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeActivity = "Activity" TypeBundle = "Bundle" TypeFood = "Food" TypeJournal = "Journal" TypeUserSettings = "UserSettings" TypeWeight = "Weight" )
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.
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 Activity ¶
type Activity struct { // ID of the ent. ID int `json:"id,omitempty"` // Userid holds the value of the "userid" field. Userid int64 `json:"userid,omitempty"` // Timestamp holds the value of the "timestamp" field. Timestamp time.Time `json:"timestamp,omitempty"` // ActiveCal holds the value of the "active_cal" field. ActiveCal float64 `json:"active_cal,omitempty"` // contains filtered or unexported fields }
Activity is the model entity for the Activity schema.
func (*Activity) Unwrap ¶
Unwrap unwraps the Activity 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 (*Activity) Update ¶
func (a *Activity) Update() *ActivityUpdateOne
Update returns a builder for updating this Activity. Note that you need to call Activity.Unwrap() before calling this method if this Activity was returned from a transaction, and the transaction was committed or rolled back.
type ActivityClient ¶
type ActivityClient struct {
// contains filtered or unexported fields
}
ActivityClient is a client for the Activity schema.
func NewActivityClient ¶
func NewActivityClient(c config) *ActivityClient
NewActivityClient returns a client for the Activity from the given config.
func (*ActivityClient) Create ¶
func (c *ActivityClient) Create() *ActivityCreate
Create returns a builder for creating a Activity entity.
func (*ActivityClient) CreateBulk ¶
func (c *ActivityClient) CreateBulk(builders ...*ActivityCreate) *ActivityCreateBulk
CreateBulk returns a builder for creating a bulk of Activity entities.
func (*ActivityClient) Delete ¶
func (c *ActivityClient) Delete() *ActivityDelete
Delete returns a delete builder for Activity.
func (*ActivityClient) DeleteOne ¶
func (c *ActivityClient) DeleteOne(a *Activity) *ActivityDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ActivityClient) DeleteOneID ¶
func (c *ActivityClient) DeleteOneID(id int) *ActivityDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ActivityClient) GetX ¶
func (c *ActivityClient) GetX(ctx context.Context, id int) *Activity
GetX is like Get, but panics if an error occurs.
func (*ActivityClient) Hooks ¶
func (c *ActivityClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ActivityClient) Intercept ¶
func (c *ActivityClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `activity.Intercept(f(g(h())))`.
func (*ActivityClient) Interceptors ¶
func (c *ActivityClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ActivityClient) MapCreateBulk ¶
func (c *ActivityClient) MapCreateBulk(slice any, setFunc func(*ActivityCreate, int)) *ActivityCreateBulk
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 (*ActivityClient) Query ¶
func (c *ActivityClient) Query() *ActivityQuery
Query returns a query builder for Activity.
func (*ActivityClient) Update ¶
func (c *ActivityClient) Update() *ActivityUpdate
Update returns an update builder for Activity.
func (*ActivityClient) UpdateOne ¶
func (c *ActivityClient) UpdateOne(a *Activity) *ActivityUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ActivityClient) UpdateOneID ¶
func (c *ActivityClient) UpdateOneID(id int) *ActivityUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ActivityClient) Use ¶
func (c *ActivityClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `activity.Hooks(f(g(h())))`.
type ActivityCreate ¶
type ActivityCreate struct {
// contains filtered or unexported fields
}
ActivityCreate is the builder for creating a Activity entity.
func (*ActivityCreate) Exec ¶
func (ac *ActivityCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ActivityCreate) ExecX ¶
func (ac *ActivityCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ActivityCreate) Mutation ¶
func (ac *ActivityCreate) Mutation() *ActivityMutation
Mutation returns the ActivityMutation object of the builder.
func (*ActivityCreate) OnConflict ¶
func (ac *ActivityCreate) OnConflict(opts ...sql.ConflictOption) *ActivityUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Activity.Create(). SetUserid(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.ActivityUpsert) { SetUserid(v+v). }). Exec(ctx)
func (*ActivityCreate) OnConflictColumns ¶
func (ac *ActivityCreate) OnConflictColumns(columns ...string) *ActivityUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Activity.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*ActivityCreate) Save ¶
func (ac *ActivityCreate) Save(ctx context.Context) (*Activity, error)
Save creates the Activity in the database.
func (*ActivityCreate) SaveX ¶
func (ac *ActivityCreate) SaveX(ctx context.Context) *Activity
SaveX calls Save and panics if Save returns an error.
func (*ActivityCreate) SetActiveCal ¶
func (ac *ActivityCreate) SetActiveCal(f float64) *ActivityCreate
SetActiveCal sets the "active_cal" field.
func (*ActivityCreate) SetTimestamp ¶
func (ac *ActivityCreate) SetTimestamp(t time.Time) *ActivityCreate
SetTimestamp sets the "timestamp" field.
func (*ActivityCreate) SetUserid ¶
func (ac *ActivityCreate) SetUserid(i int64) *ActivityCreate
SetUserid sets the "userid" field.
type ActivityCreateBulk ¶
type ActivityCreateBulk struct {
// contains filtered or unexported fields
}
ActivityCreateBulk is the builder for creating many Activity entities in bulk.
func (*ActivityCreateBulk) Exec ¶
func (acb *ActivityCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ActivityCreateBulk) ExecX ¶
func (acb *ActivityCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ActivityCreateBulk) OnConflict ¶
func (acb *ActivityCreateBulk) OnConflict(opts ...sql.ConflictOption) *ActivityUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Activity.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.ActivityUpsert) { SetUserid(v+v). }). Exec(ctx)
func (*ActivityCreateBulk) OnConflictColumns ¶
func (acb *ActivityCreateBulk) OnConflictColumns(columns ...string) *ActivityUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Activity.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type ActivityDelete ¶
type ActivityDelete struct {
// contains filtered or unexported fields
}
ActivityDelete is the builder for deleting a Activity entity.
func (*ActivityDelete) Exec ¶
func (ad *ActivityDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ActivityDelete) ExecX ¶
func (ad *ActivityDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ActivityDelete) Where ¶
func (ad *ActivityDelete) Where(ps ...predicate.Activity) *ActivityDelete
Where appends a list predicates to the ActivityDelete builder.
type ActivityDeleteOne ¶
type ActivityDeleteOne struct {
// contains filtered or unexported fields
}
ActivityDeleteOne is the builder for deleting a single Activity entity.
func (*ActivityDeleteOne) Exec ¶
func (ado *ActivityDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ActivityDeleteOne) ExecX ¶
func (ado *ActivityDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ActivityDeleteOne) Where ¶
func (ado *ActivityDeleteOne) Where(ps ...predicate.Activity) *ActivityDeleteOne
Where appends a list predicates to the ActivityDelete builder.
type ActivityGroupBy ¶
type ActivityGroupBy struct {
// contains filtered or unexported fields
}
ActivityGroupBy is the group-by builder for Activity entities.
func (*ActivityGroupBy) Aggregate ¶
func (agb *ActivityGroupBy) Aggregate(fns ...AggregateFunc) *ActivityGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ActivityGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ActivityGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ActivityGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ActivityGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ActivityGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ActivityGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ActivityGroupBy) Scan ¶
func (agb *ActivityGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ActivityGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ActivityMutation ¶
type ActivityMutation struct {
// contains filtered or unexported fields
}
ActivityMutation represents an operation that mutates the Activity nodes in the graph.
func (*ActivityMutation) ActiveCal ¶
func (m *ActivityMutation) ActiveCal() (r float64, exists bool)
ActiveCal returns the value of the "active_cal" field in the mutation.
func (*ActivityMutation) AddActiveCal ¶
func (m *ActivityMutation) AddActiveCal(f float64)
AddActiveCal adds f to the "active_cal" field.
func (*ActivityMutation) AddField ¶
func (m *ActivityMutation) 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 (*ActivityMutation) AddUserid ¶
func (m *ActivityMutation) AddUserid(i int64)
AddUserid adds i to the "userid" field.
func (*ActivityMutation) AddedActiveCal ¶
func (m *ActivityMutation) AddedActiveCal() (r float64, exists bool)
AddedActiveCal returns the value that was added to the "active_cal" field in this mutation.
func (*ActivityMutation) AddedEdges ¶
func (m *ActivityMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ActivityMutation) AddedField ¶
func (m *ActivityMutation) 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 (*ActivityMutation) AddedFields ¶
func (m *ActivityMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ActivityMutation) AddedIDs ¶
func (m *ActivityMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ActivityMutation) AddedUserid ¶
func (m *ActivityMutation) AddedUserid() (r int64, exists bool)
AddedUserid returns the value that was added to the "userid" field in this mutation.
func (*ActivityMutation) ClearEdge ¶
func (m *ActivityMutation) 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 (*ActivityMutation) ClearField ¶
func (m *ActivityMutation) 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 (*ActivityMutation) ClearedEdges ¶
func (m *ActivityMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ActivityMutation) ClearedFields ¶
func (m *ActivityMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ActivityMutation) Client ¶
func (m ActivityMutation) 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 (*ActivityMutation) EdgeCleared ¶
func (m *ActivityMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ActivityMutation) Field ¶
func (m *ActivityMutation) 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 (*ActivityMutation) FieldCleared ¶
func (m *ActivityMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ActivityMutation) Fields ¶
func (m *ActivityMutation) 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 (*ActivityMutation) ID ¶
func (m *ActivityMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*ActivityMutation) IDs ¶
func (m *ActivityMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*ActivityMutation) OldActiveCal ¶
func (m *ActivityMutation) OldActiveCal(ctx context.Context) (v float64, err error)
OldActiveCal returns the old "active_cal" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) 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 (*ActivityMutation) OldTimestamp ¶
OldTimestamp returns the old "timestamp" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldUserid ¶
func (m *ActivityMutation) OldUserid(ctx context.Context) (v int64, err error)
OldUserid returns the old "userid" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) RemovedEdges ¶
func (m *ActivityMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ActivityMutation) RemovedIDs ¶
func (m *ActivityMutation) 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 (*ActivityMutation) ResetActiveCal ¶
func (m *ActivityMutation) ResetActiveCal()
ResetActiveCal resets all changes to the "active_cal" field.
func (*ActivityMutation) ResetEdge ¶
func (m *ActivityMutation) 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 (*ActivityMutation) ResetField ¶
func (m *ActivityMutation) 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 (*ActivityMutation) ResetTimestamp ¶
func (m *ActivityMutation) ResetTimestamp()
ResetTimestamp resets all changes to the "timestamp" field.
func (*ActivityMutation) ResetUserid ¶
func (m *ActivityMutation) ResetUserid()
ResetUserid resets all changes to the "userid" field.
func (*ActivityMutation) SetActiveCal ¶
func (m *ActivityMutation) SetActiveCal(f float64)
SetActiveCal sets the "active_cal" field.
func (*ActivityMutation) SetField ¶
func (m *ActivityMutation) 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 (*ActivityMutation) SetOp ¶
func (m *ActivityMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ActivityMutation) SetTimestamp ¶
func (m *ActivityMutation) SetTimestamp(t time.Time)
SetTimestamp sets the "timestamp" field.
func (*ActivityMutation) SetUserid ¶
func (m *ActivityMutation) SetUserid(i int64)
SetUserid sets the "userid" field.
func (*ActivityMutation) Timestamp ¶
func (m *ActivityMutation) Timestamp() (r time.Time, exists bool)
Timestamp returns the value of the "timestamp" field in the mutation.
func (ActivityMutation) Tx ¶
func (m ActivityMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ActivityMutation) Type ¶
func (m *ActivityMutation) Type() string
Type returns the node type of this mutation (Activity).
func (*ActivityMutation) Userid ¶
func (m *ActivityMutation) Userid() (r int64, exists bool)
Userid returns the value of the "userid" field in the mutation.
func (*ActivityMutation) Where ¶
func (m *ActivityMutation) Where(ps ...predicate.Activity)
Where appends a list predicates to the ActivityMutation builder.
func (*ActivityMutation) WhereP ¶
func (m *ActivityMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ActivityMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ActivityQuery ¶
type ActivityQuery struct {
// contains filtered or unexported fields
}
ActivityQuery is the builder for querying Activity entities.
func (*ActivityQuery) Aggregate ¶
func (aq *ActivityQuery) Aggregate(fns ...AggregateFunc) *ActivitySelect
Aggregate returns a ActivitySelect configured with the given aggregations.
func (*ActivityQuery) All ¶
func (aq *ActivityQuery) All(ctx context.Context) ([]*Activity, error)
All executes the query and returns a list of Activities.
func (*ActivityQuery) AllX ¶
func (aq *ActivityQuery) AllX(ctx context.Context) []*Activity
AllX is like All, but panics if an error occurs.
func (*ActivityQuery) Clone ¶
func (aq *ActivityQuery) Clone() *ActivityQuery
Clone returns a duplicate of the ActivityQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ActivityQuery) Count ¶
func (aq *ActivityQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ActivityQuery) CountX ¶
func (aq *ActivityQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ActivityQuery) Exist ¶
func (aq *ActivityQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ActivityQuery) ExistX ¶
func (aq *ActivityQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ActivityQuery) First ¶
func (aq *ActivityQuery) First(ctx context.Context) (*Activity, error)
First returns the first Activity entity from the query. Returns a *NotFoundError when no Activity was found.
func (*ActivityQuery) FirstID ¶
func (aq *ActivityQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Activity ID from the query. Returns a *NotFoundError when no Activity ID was found.
func (*ActivityQuery) FirstIDX ¶
func (aq *ActivityQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ActivityQuery) FirstX ¶
func (aq *ActivityQuery) FirstX(ctx context.Context) *Activity
FirstX is like First, but panics if an error occurs.
func (*ActivityQuery) GroupBy ¶
func (aq *ActivityQuery) GroupBy(field string, fields ...string) *ActivityGroupBy
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 { Userid int64 `json:"userid,omitempty"` Count int `json:"count,omitempty"` } client.Activity.Query(). GroupBy(activity.FieldUserid). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ActivityQuery) IDs ¶
func (aq *ActivityQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Activity IDs.
func (*ActivityQuery) IDsX ¶
func (aq *ActivityQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ActivityQuery) Limit ¶
func (aq *ActivityQuery) Limit(limit int) *ActivityQuery
Limit the number of records to be returned by this query.
func (*ActivityQuery) Modify ¶
func (aq *ActivityQuery) Modify(modifiers ...func(s *sql.Selector)) *ActivitySelect
Modify adds a query modifier for attaching custom logic to queries.
func (*ActivityQuery) Offset ¶
func (aq *ActivityQuery) Offset(offset int) *ActivityQuery
Offset to start from.
func (*ActivityQuery) Only ¶
func (aq *ActivityQuery) Only(ctx context.Context) (*Activity, error)
Only returns a single Activity entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Activity entity is found. Returns a *NotFoundError when no Activity entities are found.
func (*ActivityQuery) OnlyID ¶
func (aq *ActivityQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Activity ID in the query. Returns a *NotSingularError when more than one Activity ID is found. Returns a *NotFoundError when no entities are found.
func (*ActivityQuery) OnlyIDX ¶
func (aq *ActivityQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ActivityQuery) OnlyX ¶
func (aq *ActivityQuery) OnlyX(ctx context.Context) *Activity
OnlyX is like Only, but panics if an error occurs.
func (*ActivityQuery) Order ¶
func (aq *ActivityQuery) Order(o ...activity.OrderOption) *ActivityQuery
Order specifies how the records should be ordered.
func (*ActivityQuery) Select ¶
func (aq *ActivityQuery) Select(fields ...string) *ActivitySelect
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 { Userid int64 `json:"userid,omitempty"` } client.Activity.Query(). Select(activity.FieldUserid). Scan(ctx, &v)
func (*ActivityQuery) Unique ¶
func (aq *ActivityQuery) Unique(unique bool) *ActivityQuery
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 (*ActivityQuery) Where ¶
func (aq *ActivityQuery) Where(ps ...predicate.Activity) *ActivityQuery
Where adds a new predicate for the ActivityQuery builder.
type ActivitySelect ¶
type ActivitySelect struct { *ActivityQuery // contains filtered or unexported fields }
ActivitySelect is the builder for selecting fields of Activity entities.
func (*ActivitySelect) Aggregate ¶
func (as *ActivitySelect) Aggregate(fns ...AggregateFunc) *ActivitySelect
Aggregate adds the given aggregation functions to the selector query.
func (*ActivitySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ActivitySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ActivitySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ActivitySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ActivitySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ActivitySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ActivitySelect) Modify ¶
func (as *ActivitySelect) Modify(modifiers ...func(s *sql.Selector)) *ActivitySelect
Modify adds a query modifier for attaching custom logic to queries.
func (*ActivitySelect) Scan ¶
func (as *ActivitySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ActivitySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ActivityUpdate ¶
type ActivityUpdate struct {
// contains filtered or unexported fields
}
ActivityUpdate is the builder for updating Activity entities.
func (*ActivityUpdate) AddActiveCal ¶
func (au *ActivityUpdate) AddActiveCal(f float64) *ActivityUpdate
AddActiveCal adds f to the "active_cal" field.
func (*ActivityUpdate) AddUserid ¶
func (au *ActivityUpdate) AddUserid(i int64) *ActivityUpdate
AddUserid adds i to the "userid" field.
func (*ActivityUpdate) Exec ¶
func (au *ActivityUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ActivityUpdate) ExecX ¶
func (au *ActivityUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ActivityUpdate) Modify ¶
func (au *ActivityUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ActivityUpdate
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*ActivityUpdate) Mutation ¶
func (au *ActivityUpdate) Mutation() *ActivityMutation
Mutation returns the ActivityMutation object of the builder.
func (*ActivityUpdate) Save ¶
func (au *ActivityUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ActivityUpdate) SaveX ¶
func (au *ActivityUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ActivityUpdate) SetActiveCal ¶
func (au *ActivityUpdate) SetActiveCal(f float64) *ActivityUpdate
SetActiveCal sets the "active_cal" field.
func (*ActivityUpdate) SetNillableActiveCal ¶
func (au *ActivityUpdate) SetNillableActiveCal(f *float64) *ActivityUpdate
SetNillableActiveCal sets the "active_cal" field if the given value is not nil.
func (*ActivityUpdate) SetNillableTimestamp ¶
func (au *ActivityUpdate) SetNillableTimestamp(t *time.Time) *ActivityUpdate
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*ActivityUpdate) SetNillableUserid ¶
func (au *ActivityUpdate) SetNillableUserid(i *int64) *ActivityUpdate
SetNillableUserid sets the "userid" field if the given value is not nil.
func (*ActivityUpdate) SetTimestamp ¶
func (au *ActivityUpdate) SetTimestamp(t time.Time) *ActivityUpdate
SetTimestamp sets the "timestamp" field.
func (*ActivityUpdate) SetUserid ¶
func (au *ActivityUpdate) SetUserid(i int64) *ActivityUpdate
SetUserid sets the "userid" field.
func (*ActivityUpdate) Where ¶
func (au *ActivityUpdate) Where(ps ...predicate.Activity) *ActivityUpdate
Where appends a list predicates to the ActivityUpdate builder.
type ActivityUpdateOne ¶
type ActivityUpdateOne struct {
// contains filtered or unexported fields
}
ActivityUpdateOne is the builder for updating a single Activity entity.
func (*ActivityUpdateOne) AddActiveCal ¶
func (auo *ActivityUpdateOne) AddActiveCal(f float64) *ActivityUpdateOne
AddActiveCal adds f to the "active_cal" field.
func (*ActivityUpdateOne) AddUserid ¶
func (auo *ActivityUpdateOne) AddUserid(i int64) *ActivityUpdateOne
AddUserid adds i to the "userid" field.
func (*ActivityUpdateOne) Exec ¶
func (auo *ActivityUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ActivityUpdateOne) ExecX ¶
func (auo *ActivityUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ActivityUpdateOne) Modify ¶
func (auo *ActivityUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ActivityUpdateOne
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*ActivityUpdateOne) Mutation ¶
func (auo *ActivityUpdateOne) Mutation() *ActivityMutation
Mutation returns the ActivityMutation object of the builder.
func (*ActivityUpdateOne) Save ¶
func (auo *ActivityUpdateOne) Save(ctx context.Context) (*Activity, error)
Save executes the query and returns the updated Activity entity.
func (*ActivityUpdateOne) SaveX ¶
func (auo *ActivityUpdateOne) SaveX(ctx context.Context) *Activity
SaveX is like Save, but panics if an error occurs.
func (*ActivityUpdateOne) Select ¶
func (auo *ActivityUpdateOne) Select(field string, fields ...string) *ActivityUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ActivityUpdateOne) SetActiveCal ¶
func (auo *ActivityUpdateOne) SetActiveCal(f float64) *ActivityUpdateOne
SetActiveCal sets the "active_cal" field.
func (*ActivityUpdateOne) SetNillableActiveCal ¶
func (auo *ActivityUpdateOne) SetNillableActiveCal(f *float64) *ActivityUpdateOne
SetNillableActiveCal sets the "active_cal" field if the given value is not nil.
func (*ActivityUpdateOne) SetNillableTimestamp ¶
func (auo *ActivityUpdateOne) SetNillableTimestamp(t *time.Time) *ActivityUpdateOne
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*ActivityUpdateOne) SetNillableUserid ¶
func (auo *ActivityUpdateOne) SetNillableUserid(i *int64) *ActivityUpdateOne
SetNillableUserid sets the "userid" field if the given value is not nil.
func (*ActivityUpdateOne) SetTimestamp ¶
func (auo *ActivityUpdateOne) SetTimestamp(t time.Time) *ActivityUpdateOne
SetTimestamp sets the "timestamp" field.
func (*ActivityUpdateOne) SetUserid ¶
func (auo *ActivityUpdateOne) SetUserid(i int64) *ActivityUpdateOne
SetUserid sets the "userid" field.
func (*ActivityUpdateOne) Where ¶
func (auo *ActivityUpdateOne) Where(ps ...predicate.Activity) *ActivityUpdateOne
Where appends a list predicates to the ActivityUpdate builder.
type ActivityUpsert ¶
ActivityUpsert is the "OnConflict" setter.
func (*ActivityUpsert) AddActiveCal ¶
func (u *ActivityUpsert) AddActiveCal(v float64) *ActivityUpsert
AddActiveCal adds v to the "active_cal" field.
func (*ActivityUpsert) AddUserid ¶
func (u *ActivityUpsert) AddUserid(v int64) *ActivityUpsert
AddUserid adds v to the "userid" field.
func (*ActivityUpsert) SetActiveCal ¶
func (u *ActivityUpsert) SetActiveCal(v float64) *ActivityUpsert
SetActiveCal sets the "active_cal" field.
func (*ActivityUpsert) SetTimestamp ¶
func (u *ActivityUpsert) SetTimestamp(v time.Time) *ActivityUpsert
SetTimestamp sets the "timestamp" field.
func (*ActivityUpsert) SetUserid ¶
func (u *ActivityUpsert) SetUserid(v int64) *ActivityUpsert
SetUserid sets the "userid" field.
func (*ActivityUpsert) UpdateActiveCal ¶
func (u *ActivityUpsert) UpdateActiveCal() *ActivityUpsert
UpdateActiveCal sets the "active_cal" field to the value that was provided on create.
func (*ActivityUpsert) UpdateTimestamp ¶
func (u *ActivityUpsert) UpdateTimestamp() *ActivityUpsert
UpdateTimestamp sets the "timestamp" field to the value that was provided on create.
func (*ActivityUpsert) UpdateUserid ¶
func (u *ActivityUpsert) UpdateUserid() *ActivityUpsert
UpdateUserid sets the "userid" field to the value that was provided on create.
type ActivityUpsertBulk ¶
type ActivityUpsertBulk struct {
// contains filtered or unexported fields
}
ActivityUpsertBulk is the builder for "upsert"-ing a bulk of Activity nodes.
func (*ActivityUpsertBulk) AddActiveCal ¶
func (u *ActivityUpsertBulk) AddActiveCal(v float64) *ActivityUpsertBulk
AddActiveCal adds v to the "active_cal" field.
func (*ActivityUpsertBulk) AddUserid ¶
func (u *ActivityUpsertBulk) AddUserid(v int64) *ActivityUpsertBulk
AddUserid adds v to the "userid" field.
func (*ActivityUpsertBulk) DoNothing ¶
func (u *ActivityUpsertBulk) DoNothing() *ActivityUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ActivityUpsertBulk) Exec ¶
func (u *ActivityUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ActivityUpsertBulk) ExecX ¶
func (u *ActivityUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ActivityUpsertBulk) Ignore ¶
func (u *ActivityUpsertBulk) Ignore() *ActivityUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Activity.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ActivityUpsertBulk) SetActiveCal ¶
func (u *ActivityUpsertBulk) SetActiveCal(v float64) *ActivityUpsertBulk
SetActiveCal sets the "active_cal" field.
func (*ActivityUpsertBulk) SetTimestamp ¶
func (u *ActivityUpsertBulk) SetTimestamp(v time.Time) *ActivityUpsertBulk
SetTimestamp sets the "timestamp" field.
func (*ActivityUpsertBulk) SetUserid ¶
func (u *ActivityUpsertBulk) SetUserid(v int64) *ActivityUpsertBulk
SetUserid sets the "userid" field.
func (*ActivityUpsertBulk) Update ¶
func (u *ActivityUpsertBulk) Update(set func(*ActivityUpsert)) *ActivityUpsertBulk
Update allows overriding fields `UPDATE` values. See the ActivityCreateBulk.OnConflict documentation for more info.
func (*ActivityUpsertBulk) UpdateActiveCal ¶
func (u *ActivityUpsertBulk) UpdateActiveCal() *ActivityUpsertBulk
UpdateActiveCal sets the "active_cal" field to the value that was provided on create.
func (*ActivityUpsertBulk) UpdateNewValues ¶
func (u *ActivityUpsertBulk) UpdateNewValues() *ActivityUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Activity.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*ActivityUpsertBulk) UpdateTimestamp ¶
func (u *ActivityUpsertBulk) UpdateTimestamp() *ActivityUpsertBulk
UpdateTimestamp sets the "timestamp" field to the value that was provided on create.
func (*ActivityUpsertBulk) UpdateUserid ¶
func (u *ActivityUpsertBulk) UpdateUserid() *ActivityUpsertBulk
UpdateUserid sets the "userid" field to the value that was provided on create.
type ActivityUpsertOne ¶
type ActivityUpsertOne struct {
// contains filtered or unexported fields
}
ActivityUpsertOne is the builder for "upsert"-ing
one Activity node.
func (*ActivityUpsertOne) AddActiveCal ¶
func (u *ActivityUpsertOne) AddActiveCal(v float64) *ActivityUpsertOne
AddActiveCal adds v to the "active_cal" field.
func (*ActivityUpsertOne) AddUserid ¶
func (u *ActivityUpsertOne) AddUserid(v int64) *ActivityUpsertOne
AddUserid adds v to the "userid" field.
func (*ActivityUpsertOne) DoNothing ¶
func (u *ActivityUpsertOne) DoNothing() *ActivityUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ActivityUpsertOne) Exec ¶
func (u *ActivityUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*ActivityUpsertOne) ExecX ¶
func (u *ActivityUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ActivityUpsertOne) ID ¶
func (u *ActivityUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*ActivityUpsertOne) IDX ¶
func (u *ActivityUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*ActivityUpsertOne) Ignore ¶
func (u *ActivityUpsertOne) Ignore() *ActivityUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Activity.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ActivityUpsertOne) SetActiveCal ¶
func (u *ActivityUpsertOne) SetActiveCal(v float64) *ActivityUpsertOne
SetActiveCal sets the "active_cal" field.
func (*ActivityUpsertOne) SetTimestamp ¶
func (u *ActivityUpsertOne) SetTimestamp(v time.Time) *ActivityUpsertOne
SetTimestamp sets the "timestamp" field.
func (*ActivityUpsertOne) SetUserid ¶
func (u *ActivityUpsertOne) SetUserid(v int64) *ActivityUpsertOne
SetUserid sets the "userid" field.
func (*ActivityUpsertOne) Update ¶
func (u *ActivityUpsertOne) Update(set func(*ActivityUpsert)) *ActivityUpsertOne
Update allows overriding fields `UPDATE` values. See the ActivityCreate.OnConflict documentation for more info.
func (*ActivityUpsertOne) UpdateActiveCal ¶
func (u *ActivityUpsertOne) UpdateActiveCal() *ActivityUpsertOne
UpdateActiveCal sets the "active_cal" field to the value that was provided on create.
func (*ActivityUpsertOne) UpdateNewValues ¶
func (u *ActivityUpsertOne) UpdateNewValues() *ActivityUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Activity.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*ActivityUpsertOne) UpdateTimestamp ¶
func (u *ActivityUpsertOne) UpdateTimestamp() *ActivityUpsertOne
UpdateTimestamp sets the "timestamp" field to the value that was provided on create.
func (*ActivityUpsertOne) UpdateUserid ¶
func (u *ActivityUpsertOne) UpdateUserid() *ActivityUpsertOne
UpdateUserid sets the "userid" 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 Bundle ¶
type Bundle struct { // ID of the ent. ID int `json:"id,omitempty"` // Userid holds the value of the "userid" field. Userid int64 `json:"userid,omitempty"` // Key holds the value of the "key" field. Key string `json:"key,omitempty"` // Data holds the value of the "data" field. Data map[string]float64 `json:"data,omitempty"` // contains filtered or unexported fields }
Bundle is the model entity for the Bundle schema.
func (*Bundle) Unwrap ¶
Unwrap unwraps the Bundle 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 (*Bundle) Update ¶
func (b *Bundle) Update() *BundleUpdateOne
Update returns a builder for updating this Bundle. Note that you need to call Bundle.Unwrap() before calling this method if this Bundle was returned from a transaction, and the transaction was committed or rolled back.
type BundleClient ¶
type BundleClient struct {
// contains filtered or unexported fields
}
BundleClient is a client for the Bundle schema.
func NewBundleClient ¶
func NewBundleClient(c config) *BundleClient
NewBundleClient returns a client for the Bundle from the given config.
func (*BundleClient) Create ¶
func (c *BundleClient) Create() *BundleCreate
Create returns a builder for creating a Bundle entity.
func (*BundleClient) CreateBulk ¶
func (c *BundleClient) CreateBulk(builders ...*BundleCreate) *BundleCreateBulk
CreateBulk returns a builder for creating a bulk of Bundle entities.
func (*BundleClient) Delete ¶
func (c *BundleClient) Delete() *BundleDelete
Delete returns a delete builder for Bundle.
func (*BundleClient) DeleteOne ¶
func (c *BundleClient) DeleteOne(b *Bundle) *BundleDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*BundleClient) DeleteOneID ¶
func (c *BundleClient) DeleteOneID(id int) *BundleDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*BundleClient) GetX ¶
func (c *BundleClient) GetX(ctx context.Context, id int) *Bundle
GetX is like Get, but panics if an error occurs.
func (*BundleClient) Intercept ¶
func (c *BundleClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `bundle.Intercept(f(g(h())))`.
func (*BundleClient) Interceptors ¶
func (c *BundleClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*BundleClient) MapCreateBulk ¶
func (c *BundleClient) MapCreateBulk(slice any, setFunc func(*BundleCreate, int)) *BundleCreateBulk
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 (*BundleClient) Query ¶
func (c *BundleClient) Query() *BundleQuery
Query returns a query builder for Bundle.
func (*BundleClient) Update ¶
func (c *BundleClient) Update() *BundleUpdate
Update returns an update builder for Bundle.
func (*BundleClient) UpdateOne ¶
func (c *BundleClient) UpdateOne(b *Bundle) *BundleUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BundleClient) UpdateOneID ¶
func (c *BundleClient) UpdateOneID(id int) *BundleUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BundleClient) Use ¶
func (c *BundleClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `bundle.Hooks(f(g(h())))`.
type BundleCreate ¶
type BundleCreate struct {
// contains filtered or unexported fields
}
BundleCreate is the builder for creating a Bundle entity.
func (*BundleCreate) Exec ¶
func (bc *BundleCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BundleCreate) ExecX ¶
func (bc *BundleCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BundleCreate) Mutation ¶
func (bc *BundleCreate) Mutation() *BundleMutation
Mutation returns the BundleMutation object of the builder.
func (*BundleCreate) OnConflict ¶
func (bc *BundleCreate) OnConflict(opts ...sql.ConflictOption) *BundleUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Bundle.Create(). SetUserid(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.BundleUpsert) { SetUserid(v+v). }). Exec(ctx)
func (*BundleCreate) OnConflictColumns ¶
func (bc *BundleCreate) OnConflictColumns(columns ...string) *BundleUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Bundle.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*BundleCreate) Save ¶
func (bc *BundleCreate) Save(ctx context.Context) (*Bundle, error)
Save creates the Bundle in the database.
func (*BundleCreate) SaveX ¶
func (bc *BundleCreate) SaveX(ctx context.Context) *Bundle
SaveX calls Save and panics if Save returns an error.
func (*BundleCreate) SetData ¶
func (bc *BundleCreate) SetData(m map[string]float64) *BundleCreate
SetData sets the "data" field.
func (*BundleCreate) SetKey ¶
func (bc *BundleCreate) SetKey(s string) *BundleCreate
SetKey sets the "key" field.
func (*BundleCreate) SetUserid ¶
func (bc *BundleCreate) SetUserid(i int64) *BundleCreate
SetUserid sets the "userid" field.
type BundleCreateBulk ¶
type BundleCreateBulk struct {
// contains filtered or unexported fields
}
BundleCreateBulk is the builder for creating many Bundle entities in bulk.
func (*BundleCreateBulk) Exec ¶
func (bcb *BundleCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BundleCreateBulk) ExecX ¶
func (bcb *BundleCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BundleCreateBulk) OnConflict ¶
func (bcb *BundleCreateBulk) OnConflict(opts ...sql.ConflictOption) *BundleUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Bundle.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.BundleUpsert) { SetUserid(v+v). }). Exec(ctx)
func (*BundleCreateBulk) OnConflictColumns ¶
func (bcb *BundleCreateBulk) OnConflictColumns(columns ...string) *BundleUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Bundle.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type BundleDelete ¶
type BundleDelete struct {
// contains filtered or unexported fields
}
BundleDelete is the builder for deleting a Bundle entity.
func (*BundleDelete) Exec ¶
func (bd *BundleDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BundleDelete) ExecX ¶
func (bd *BundleDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BundleDelete) Where ¶
func (bd *BundleDelete) Where(ps ...predicate.Bundle) *BundleDelete
Where appends a list predicates to the BundleDelete builder.
type BundleDeleteOne ¶
type BundleDeleteOne struct {
// contains filtered or unexported fields
}
BundleDeleteOne is the builder for deleting a single Bundle entity.
func (*BundleDeleteOne) Exec ¶
func (bdo *BundleDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BundleDeleteOne) ExecX ¶
func (bdo *BundleDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BundleDeleteOne) Where ¶
func (bdo *BundleDeleteOne) Where(ps ...predicate.Bundle) *BundleDeleteOne
Where appends a list predicates to the BundleDelete builder.
type BundleGroupBy ¶
type BundleGroupBy struct {
// contains filtered or unexported fields
}
BundleGroupBy is the group-by builder for Bundle entities.
func (*BundleGroupBy) Aggregate ¶
func (bgb *BundleGroupBy) Aggregate(fns ...AggregateFunc) *BundleGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BundleGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BundleGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BundleGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BundleGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BundleGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BundleGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BundleGroupBy) Scan ¶
func (bgb *BundleGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BundleGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BundleMutation ¶
type BundleMutation struct {
// contains filtered or unexported fields
}
BundleMutation represents an operation that mutates the Bundle nodes in the graph.
func (*BundleMutation) AddField ¶
func (m *BundleMutation) 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 (*BundleMutation) AddUserid ¶
func (m *BundleMutation) AddUserid(i int64)
AddUserid adds i to the "userid" field.
func (*BundleMutation) AddedEdges ¶
func (m *BundleMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BundleMutation) AddedField ¶
func (m *BundleMutation) 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 (*BundleMutation) AddedFields ¶
func (m *BundleMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BundleMutation) AddedIDs ¶
func (m *BundleMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BundleMutation) AddedUserid ¶
func (m *BundleMutation) AddedUserid() (r int64, exists bool)
AddedUserid returns the value that was added to the "userid" field in this mutation.
func (*BundleMutation) ClearEdge ¶
func (m *BundleMutation) 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 (*BundleMutation) ClearField ¶
func (m *BundleMutation) 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 (*BundleMutation) ClearedEdges ¶
func (m *BundleMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BundleMutation) ClearedFields ¶
func (m *BundleMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BundleMutation) Client ¶
func (m BundleMutation) 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 (*BundleMutation) Data ¶
func (m *BundleMutation) Data() (r map[string]float64, exists bool)
Data returns the value of the "data" field in the mutation.
func (*BundleMutation) EdgeCleared ¶
func (m *BundleMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BundleMutation) Field ¶
func (m *BundleMutation) 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 (*BundleMutation) FieldCleared ¶
func (m *BundleMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BundleMutation) Fields ¶
func (m *BundleMutation) 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 (*BundleMutation) ID ¶
func (m *BundleMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*BundleMutation) IDs ¶
func (m *BundleMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*BundleMutation) Key ¶
func (m *BundleMutation) Key() (r string, exists bool)
Key returns the value of the "key" field in the mutation.
func (*BundleMutation) OldData ¶
OldData returns the old "data" field's value of the Bundle entity. If the Bundle 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 (*BundleMutation) 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 (*BundleMutation) OldKey ¶
func (m *BundleMutation) OldKey(ctx context.Context) (v string, err error)
OldKey returns the old "key" field's value of the Bundle entity. If the Bundle 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 (*BundleMutation) OldUserid ¶
func (m *BundleMutation) OldUserid(ctx context.Context) (v int64, err error)
OldUserid returns the old "userid" field's value of the Bundle entity. If the Bundle 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 (*BundleMutation) RemovedEdges ¶
func (m *BundleMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BundleMutation) RemovedIDs ¶
func (m *BundleMutation) 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 (*BundleMutation) ResetData ¶
func (m *BundleMutation) ResetData()
ResetData resets all changes to the "data" field.
func (*BundleMutation) ResetEdge ¶
func (m *BundleMutation) 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 (*BundleMutation) ResetField ¶
func (m *BundleMutation) 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 (*BundleMutation) ResetKey ¶
func (m *BundleMutation) ResetKey()
ResetKey resets all changes to the "key" field.
func (*BundleMutation) ResetUserid ¶
func (m *BundleMutation) ResetUserid()
ResetUserid resets all changes to the "userid" field.
func (*BundleMutation) SetData ¶
func (m *BundleMutation) SetData(value map[string]float64)
SetData sets the "data" field.
func (*BundleMutation) SetField ¶
func (m *BundleMutation) 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 (*BundleMutation) SetKey ¶
func (m *BundleMutation) SetKey(s string)
SetKey sets the "key" field.
func (*BundleMutation) SetOp ¶
func (m *BundleMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*BundleMutation) SetUserid ¶
func (m *BundleMutation) SetUserid(i int64)
SetUserid sets the "userid" field.
func (BundleMutation) Tx ¶
func (m BundleMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BundleMutation) Type ¶
func (m *BundleMutation) Type() string
Type returns the node type of this mutation (Bundle).
func (*BundleMutation) Userid ¶
func (m *BundleMutation) Userid() (r int64, exists bool)
Userid returns the value of the "userid" field in the mutation.
func (*BundleMutation) Where ¶
func (m *BundleMutation) Where(ps ...predicate.Bundle)
Where appends a list predicates to the BundleMutation builder.
func (*BundleMutation) WhereP ¶
func (m *BundleMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the BundleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type BundleQuery ¶
type BundleQuery struct {
// contains filtered or unexported fields
}
BundleQuery is the builder for querying Bundle entities.
func (*BundleQuery) Aggregate ¶
func (bq *BundleQuery) Aggregate(fns ...AggregateFunc) *BundleSelect
Aggregate returns a BundleSelect configured with the given aggregations.
func (*BundleQuery) All ¶
func (bq *BundleQuery) All(ctx context.Context) ([]*Bundle, error)
All executes the query and returns a list of Bundles.
func (*BundleQuery) AllX ¶
func (bq *BundleQuery) AllX(ctx context.Context) []*Bundle
AllX is like All, but panics if an error occurs.
func (*BundleQuery) Clone ¶
func (bq *BundleQuery) Clone() *BundleQuery
Clone returns a duplicate of the BundleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BundleQuery) Count ¶
func (bq *BundleQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*BundleQuery) CountX ¶
func (bq *BundleQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*BundleQuery) Exist ¶
func (bq *BundleQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*BundleQuery) ExistX ¶
func (bq *BundleQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*BundleQuery) First ¶
func (bq *BundleQuery) First(ctx context.Context) (*Bundle, error)
First returns the first Bundle entity from the query. Returns a *NotFoundError when no Bundle was found.
func (*BundleQuery) FirstID ¶
func (bq *BundleQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Bundle ID from the query. Returns a *NotFoundError when no Bundle ID was found.
func (*BundleQuery) FirstIDX ¶
func (bq *BundleQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*BundleQuery) FirstX ¶
func (bq *BundleQuery) FirstX(ctx context.Context) *Bundle
FirstX is like First, but panics if an error occurs.
func (*BundleQuery) GroupBy ¶
func (bq *BundleQuery) GroupBy(field string, fields ...string) *BundleGroupBy
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 { Userid int64 `json:"userid,omitempty"` Count int `json:"count,omitempty"` } client.Bundle.Query(). GroupBy(bundle.FieldUserid). Aggregate(ent.Count()). Scan(ctx, &v)
func (*BundleQuery) IDs ¶
func (bq *BundleQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Bundle IDs.
func (*BundleQuery) IDsX ¶
func (bq *BundleQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*BundleQuery) Limit ¶
func (bq *BundleQuery) Limit(limit int) *BundleQuery
Limit the number of records to be returned by this query.
func (*BundleQuery) Modify ¶
func (bq *BundleQuery) Modify(modifiers ...func(s *sql.Selector)) *BundleSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*BundleQuery) Offset ¶
func (bq *BundleQuery) Offset(offset int) *BundleQuery
Offset to start from.
func (*BundleQuery) Only ¶
func (bq *BundleQuery) Only(ctx context.Context) (*Bundle, error)
Only returns a single Bundle entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Bundle entity is found. Returns a *NotFoundError when no Bundle entities are found.
func (*BundleQuery) OnlyID ¶
func (bq *BundleQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Bundle ID in the query. Returns a *NotSingularError when more than one Bundle ID is found. Returns a *NotFoundError when no entities are found.
func (*BundleQuery) OnlyIDX ¶
func (bq *BundleQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*BundleQuery) OnlyX ¶
func (bq *BundleQuery) OnlyX(ctx context.Context) *Bundle
OnlyX is like Only, but panics if an error occurs.
func (*BundleQuery) Order ¶
func (bq *BundleQuery) Order(o ...bundle.OrderOption) *BundleQuery
Order specifies how the records should be ordered.
func (*BundleQuery) Select ¶
func (bq *BundleQuery) Select(fields ...string) *BundleSelect
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 { Userid int64 `json:"userid,omitempty"` } client.Bundle.Query(). Select(bundle.FieldUserid). Scan(ctx, &v)
func (*BundleQuery) Unique ¶
func (bq *BundleQuery) Unique(unique bool) *BundleQuery
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 (*BundleQuery) Where ¶
func (bq *BundleQuery) Where(ps ...predicate.Bundle) *BundleQuery
Where adds a new predicate for the BundleQuery builder.
type BundleSelect ¶
type BundleSelect struct { *BundleQuery // contains filtered or unexported fields }
BundleSelect is the builder for selecting fields of Bundle entities.
func (*BundleSelect) Aggregate ¶
func (bs *BundleSelect) Aggregate(fns ...AggregateFunc) *BundleSelect
Aggregate adds the given aggregation functions to the selector query.
func (*BundleSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BundleSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BundleSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BundleSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BundleSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BundleSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BundleSelect) Modify ¶
func (bs *BundleSelect) Modify(modifiers ...func(s *sql.Selector)) *BundleSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*BundleSelect) Scan ¶
func (bs *BundleSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BundleSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BundleUpdate ¶
type BundleUpdate struct {
// contains filtered or unexported fields
}
BundleUpdate is the builder for updating Bundle entities.
func (*BundleUpdate) AddUserid ¶
func (bu *BundleUpdate) AddUserid(i int64) *BundleUpdate
AddUserid adds i to the "userid" field.
func (*BundleUpdate) Exec ¶
func (bu *BundleUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BundleUpdate) ExecX ¶
func (bu *BundleUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BundleUpdate) Modify ¶
func (bu *BundleUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *BundleUpdate
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*BundleUpdate) Mutation ¶
func (bu *BundleUpdate) Mutation() *BundleMutation
Mutation returns the BundleMutation object of the builder.
func (*BundleUpdate) Save ¶
func (bu *BundleUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BundleUpdate) SaveX ¶
func (bu *BundleUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BundleUpdate) SetData ¶
func (bu *BundleUpdate) SetData(m map[string]float64) *BundleUpdate
SetData sets the "data" field.
func (*BundleUpdate) SetKey ¶
func (bu *BundleUpdate) SetKey(s string) *BundleUpdate
SetKey sets the "key" field.
func (*BundleUpdate) SetNillableKey ¶
func (bu *BundleUpdate) SetNillableKey(s *string) *BundleUpdate
SetNillableKey sets the "key" field if the given value is not nil.
func (*BundleUpdate) SetNillableUserid ¶
func (bu *BundleUpdate) SetNillableUserid(i *int64) *BundleUpdate
SetNillableUserid sets the "userid" field if the given value is not nil.
func (*BundleUpdate) SetUserid ¶
func (bu *BundleUpdate) SetUserid(i int64) *BundleUpdate
SetUserid sets the "userid" field.
func (*BundleUpdate) Where ¶
func (bu *BundleUpdate) Where(ps ...predicate.Bundle) *BundleUpdate
Where appends a list predicates to the BundleUpdate builder.
type BundleUpdateOne ¶
type BundleUpdateOne struct {
// contains filtered or unexported fields
}
BundleUpdateOne is the builder for updating a single Bundle entity.
func (*BundleUpdateOne) AddUserid ¶
func (buo *BundleUpdateOne) AddUserid(i int64) *BundleUpdateOne
AddUserid adds i to the "userid" field.
func (*BundleUpdateOne) Exec ¶
func (buo *BundleUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BundleUpdateOne) ExecX ¶
func (buo *BundleUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BundleUpdateOne) Modify ¶
func (buo *BundleUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *BundleUpdateOne
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*BundleUpdateOne) Mutation ¶
func (buo *BundleUpdateOne) Mutation() *BundleMutation
Mutation returns the BundleMutation object of the builder.
func (*BundleUpdateOne) Save ¶
func (buo *BundleUpdateOne) Save(ctx context.Context) (*Bundle, error)
Save executes the query and returns the updated Bundle entity.
func (*BundleUpdateOne) SaveX ¶
func (buo *BundleUpdateOne) SaveX(ctx context.Context) *Bundle
SaveX is like Save, but panics if an error occurs.
func (*BundleUpdateOne) Select ¶
func (buo *BundleUpdateOne) Select(field string, fields ...string) *BundleUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BundleUpdateOne) SetData ¶
func (buo *BundleUpdateOne) SetData(m map[string]float64) *BundleUpdateOne
SetData sets the "data" field.
func (*BundleUpdateOne) SetKey ¶
func (buo *BundleUpdateOne) SetKey(s string) *BundleUpdateOne
SetKey sets the "key" field.
func (*BundleUpdateOne) SetNillableKey ¶
func (buo *BundleUpdateOne) SetNillableKey(s *string) *BundleUpdateOne
SetNillableKey sets the "key" field if the given value is not nil.
func (*BundleUpdateOne) SetNillableUserid ¶
func (buo *BundleUpdateOne) SetNillableUserid(i *int64) *BundleUpdateOne
SetNillableUserid sets the "userid" field if the given value is not nil.
func (*BundleUpdateOne) SetUserid ¶
func (buo *BundleUpdateOne) SetUserid(i int64) *BundleUpdateOne
SetUserid sets the "userid" field.
func (*BundleUpdateOne) Where ¶
func (buo *BundleUpdateOne) Where(ps ...predicate.Bundle) *BundleUpdateOne
Where appends a list predicates to the BundleUpdate builder.
type BundleUpsert ¶
BundleUpsert is the "OnConflict" setter.
func (*BundleUpsert) AddUserid ¶
func (u *BundleUpsert) AddUserid(v int64) *BundleUpsert
AddUserid adds v to the "userid" field.
func (*BundleUpsert) SetData ¶
func (u *BundleUpsert) SetData(v map[string]float64) *BundleUpsert
SetData sets the "data" field.
func (*BundleUpsert) SetKey ¶
func (u *BundleUpsert) SetKey(v string) *BundleUpsert
SetKey sets the "key" field.
func (*BundleUpsert) SetUserid ¶
func (u *BundleUpsert) SetUserid(v int64) *BundleUpsert
SetUserid sets the "userid" field.
func (*BundleUpsert) UpdateData ¶
func (u *BundleUpsert) UpdateData() *BundleUpsert
UpdateData sets the "data" field to the value that was provided on create.
func (*BundleUpsert) UpdateKey ¶
func (u *BundleUpsert) UpdateKey() *BundleUpsert
UpdateKey sets the "key" field to the value that was provided on create.
func (*BundleUpsert) UpdateUserid ¶
func (u *BundleUpsert) UpdateUserid() *BundleUpsert
UpdateUserid sets the "userid" field to the value that was provided on create.
type BundleUpsertBulk ¶
type BundleUpsertBulk struct {
// contains filtered or unexported fields
}
BundleUpsertBulk is the builder for "upsert"-ing a bulk of Bundle nodes.
func (*BundleUpsertBulk) AddUserid ¶
func (u *BundleUpsertBulk) AddUserid(v int64) *BundleUpsertBulk
AddUserid adds v to the "userid" field.
func (*BundleUpsertBulk) DoNothing ¶
func (u *BundleUpsertBulk) DoNothing() *BundleUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*BundleUpsertBulk) Exec ¶
func (u *BundleUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BundleUpsertBulk) ExecX ¶
func (u *BundleUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BundleUpsertBulk) Ignore ¶
func (u *BundleUpsertBulk) Ignore() *BundleUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Bundle.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*BundleUpsertBulk) SetData ¶
func (u *BundleUpsertBulk) SetData(v map[string]float64) *BundleUpsertBulk
SetData sets the "data" field.
func (*BundleUpsertBulk) SetKey ¶
func (u *BundleUpsertBulk) SetKey(v string) *BundleUpsertBulk
SetKey sets the "key" field.
func (*BundleUpsertBulk) SetUserid ¶
func (u *BundleUpsertBulk) SetUserid(v int64) *BundleUpsertBulk
SetUserid sets the "userid" field.
func (*BundleUpsertBulk) Update ¶
func (u *BundleUpsertBulk) Update(set func(*BundleUpsert)) *BundleUpsertBulk
Update allows overriding fields `UPDATE` values. See the BundleCreateBulk.OnConflict documentation for more info.
func (*BundleUpsertBulk) UpdateData ¶
func (u *BundleUpsertBulk) UpdateData() *BundleUpsertBulk
UpdateData sets the "data" field to the value that was provided on create.
func (*BundleUpsertBulk) UpdateKey ¶
func (u *BundleUpsertBulk) UpdateKey() *BundleUpsertBulk
UpdateKey sets the "key" field to the value that was provided on create.
func (*BundleUpsertBulk) UpdateNewValues ¶
func (u *BundleUpsertBulk) UpdateNewValues() *BundleUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Bundle.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*BundleUpsertBulk) UpdateUserid ¶
func (u *BundleUpsertBulk) UpdateUserid() *BundleUpsertBulk
UpdateUserid sets the "userid" field to the value that was provided on create.
type BundleUpsertOne ¶
type BundleUpsertOne struct {
// contains filtered or unexported fields
}
BundleUpsertOne is the builder for "upsert"-ing
one Bundle node.
func (*BundleUpsertOne) AddUserid ¶
func (u *BundleUpsertOne) AddUserid(v int64) *BundleUpsertOne
AddUserid adds v to the "userid" field.
func (*BundleUpsertOne) DoNothing ¶
func (u *BundleUpsertOne) DoNothing() *BundleUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*BundleUpsertOne) Exec ¶
func (u *BundleUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*BundleUpsertOne) ExecX ¶
func (u *BundleUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BundleUpsertOne) ID ¶
func (u *BundleUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*BundleUpsertOne) IDX ¶
func (u *BundleUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*BundleUpsertOne) Ignore ¶
func (u *BundleUpsertOne) Ignore() *BundleUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Bundle.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*BundleUpsertOne) SetData ¶
func (u *BundleUpsertOne) SetData(v map[string]float64) *BundleUpsertOne
SetData sets the "data" field.
func (*BundleUpsertOne) SetKey ¶
func (u *BundleUpsertOne) SetKey(v string) *BundleUpsertOne
SetKey sets the "key" field.
func (*BundleUpsertOne) SetUserid ¶
func (u *BundleUpsertOne) SetUserid(v int64) *BundleUpsertOne
SetUserid sets the "userid" field.
func (*BundleUpsertOne) Update ¶
func (u *BundleUpsertOne) Update(set func(*BundleUpsert)) *BundleUpsertOne
Update allows overriding fields `UPDATE` values. See the BundleCreate.OnConflict documentation for more info.
func (*BundleUpsertOne) UpdateData ¶
func (u *BundleUpsertOne) UpdateData() *BundleUpsertOne
UpdateData sets the "data" field to the value that was provided on create.
func (*BundleUpsertOne) UpdateKey ¶
func (u *BundleUpsertOne) UpdateKey() *BundleUpsertOne
UpdateKey sets the "key" field to the value that was provided on create.
func (*BundleUpsertOne) UpdateNewValues ¶
func (u *BundleUpsertOne) UpdateNewValues() *BundleUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Bundle.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*BundleUpsertOne) UpdateUserid ¶
func (u *BundleUpsertOne) UpdateUserid() *BundleUpsertOne
UpdateUserid sets the "userid" 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 // Activity is the client for interacting with the Activity builders. Activity *ActivityClient // Bundle is the client for interacting with the Bundle builders. Bundle *BundleClient // Food is the client for interacting with the Food builders. Food *FoodClient // Journal is the client for interacting with the Journal builders. Journal *JournalClient // UserSettings is the client for interacting with the UserSettings builders. UserSettings *UserSettingsClient // Weight is the client for interacting with the Weight builders. Weight *WeightClient // 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(). Activity. 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 Food ¶
type Food struct { // ID of the ent. ID int `json:"id,omitempty"` // Key holds the value of the "key" field. Key string `json:"key,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Brand holds the value of the "brand" field. Brand string `json:"brand,omitempty"` // Cal100 holds the value of the "cal100" field. Cal100 float64 `json:"cal100,omitempty"` // Prot100 holds the value of the "prot100" field. Prot100 float64 `json:"prot100,omitempty"` // Fat100 holds the value of the "fat100" field. Fat100 float64 `json:"fat100,omitempty"` // Carb100 holds the value of the "carb100" field. Carb100 float64 `json:"carb100,omitempty"` // Comment holds the value of the "comment" field. Comment string `json:"comment,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the FoodQuery when eager-loading is set. Edges FoodEdges `json:"edges"` // contains filtered or unexported fields }
Food is the model entity for the Food schema.
func (*Food) QueryJournals ¶
func (f *Food) QueryJournals() *JournalQuery
QueryJournals queries the "journals" edge of the Food entity.
func (*Food) Unwrap ¶
Unwrap unwraps the Food 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 (*Food) Update ¶
func (f *Food) Update() *FoodUpdateOne
Update returns a builder for updating this Food. Note that you need to call Food.Unwrap() before calling this method if this Food was returned from a transaction, and the transaction was committed or rolled back.
type FoodClient ¶
type FoodClient struct {
// contains filtered or unexported fields
}
FoodClient is a client for the Food schema.
func NewFoodClient ¶
func NewFoodClient(c config) *FoodClient
NewFoodClient returns a client for the Food from the given config.
func (*FoodClient) Create ¶
func (c *FoodClient) Create() *FoodCreate
Create returns a builder for creating a Food entity.
func (*FoodClient) CreateBulk ¶
func (c *FoodClient) CreateBulk(builders ...*FoodCreate) *FoodCreateBulk
CreateBulk returns a builder for creating a bulk of Food entities.
func (*FoodClient) Delete ¶
func (c *FoodClient) Delete() *FoodDelete
Delete returns a delete builder for Food.
func (*FoodClient) DeleteOne ¶
func (c *FoodClient) DeleteOne(f *Food) *FoodDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*FoodClient) DeleteOneID ¶
func (c *FoodClient) DeleteOneID(id int) *FoodDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*FoodClient) GetX ¶
func (c *FoodClient) GetX(ctx context.Context, id int) *Food
GetX is like Get, but panics if an error occurs.
func (*FoodClient) Intercept ¶
func (c *FoodClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `food.Intercept(f(g(h())))`.
func (*FoodClient) Interceptors ¶
func (c *FoodClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*FoodClient) MapCreateBulk ¶
func (c *FoodClient) MapCreateBulk(slice any, setFunc func(*FoodCreate, int)) *FoodCreateBulk
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 (*FoodClient) Query ¶
func (c *FoodClient) Query() *FoodQuery
Query returns a query builder for Food.
func (*FoodClient) QueryJournals ¶
func (c *FoodClient) QueryJournals(f *Food) *JournalQuery
QueryJournals queries the journals edge of a Food.
func (*FoodClient) Update ¶
func (c *FoodClient) Update() *FoodUpdate
Update returns an update builder for Food.
func (*FoodClient) UpdateOne ¶
func (c *FoodClient) UpdateOne(f *Food) *FoodUpdateOne
UpdateOne returns an update builder for the given entity.
func (*FoodClient) UpdateOneID ¶
func (c *FoodClient) UpdateOneID(id int) *FoodUpdateOne
UpdateOneID returns an update builder for the given id.
func (*FoodClient) Use ¶
func (c *FoodClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `food.Hooks(f(g(h())))`.
type FoodCreate ¶
type FoodCreate struct {
// contains filtered or unexported fields
}
FoodCreate is the builder for creating a Food entity.
func (*FoodCreate) AddJournalIDs ¶
func (fc *FoodCreate) AddJournalIDs(ids ...int) *FoodCreate
AddJournalIDs adds the "journals" edge to the Journal entity by IDs.
func (*FoodCreate) AddJournals ¶
func (fc *FoodCreate) AddJournals(j ...*Journal) *FoodCreate
AddJournals adds the "journals" edges to the Journal entity.
func (*FoodCreate) Exec ¶
func (fc *FoodCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*FoodCreate) ExecX ¶
func (fc *FoodCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FoodCreate) Mutation ¶
func (fc *FoodCreate) Mutation() *FoodMutation
Mutation returns the FoodMutation object of the builder.
func (*FoodCreate) OnConflict ¶
func (fc *FoodCreate) OnConflict(opts ...sql.ConflictOption) *FoodUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Food.Create(). SetKey(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.FoodUpsert) { SetKey(v+v). }). Exec(ctx)
func (*FoodCreate) OnConflictColumns ¶
func (fc *FoodCreate) OnConflictColumns(columns ...string) *FoodUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Food.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*FoodCreate) Save ¶
func (fc *FoodCreate) Save(ctx context.Context) (*Food, error)
Save creates the Food in the database.
func (*FoodCreate) SaveX ¶
func (fc *FoodCreate) SaveX(ctx context.Context) *Food
SaveX calls Save and panics if Save returns an error.
func (*FoodCreate) SetBrand ¶
func (fc *FoodCreate) SetBrand(s string) *FoodCreate
SetBrand sets the "brand" field.
func (*FoodCreate) SetCal100 ¶
func (fc *FoodCreate) SetCal100(f float64) *FoodCreate
SetCal100 sets the "cal100" field.
func (*FoodCreate) SetCarb100 ¶
func (fc *FoodCreate) SetCarb100(f float64) *FoodCreate
SetCarb100 sets the "carb100" field.
func (*FoodCreate) SetComment ¶
func (fc *FoodCreate) SetComment(s string) *FoodCreate
SetComment sets the "comment" field.
func (*FoodCreate) SetFat100 ¶
func (fc *FoodCreate) SetFat100(f float64) *FoodCreate
SetFat100 sets the "fat100" field.
func (*FoodCreate) SetKey ¶
func (fc *FoodCreate) SetKey(s string) *FoodCreate
SetKey sets the "key" field.
func (*FoodCreate) SetName ¶
func (fc *FoodCreate) SetName(s string) *FoodCreate
SetName sets the "name" field.
func (*FoodCreate) SetNillableBrand ¶
func (fc *FoodCreate) SetNillableBrand(s *string) *FoodCreate
SetNillableBrand sets the "brand" field if the given value is not nil.
func (*FoodCreate) SetNillableComment ¶
func (fc *FoodCreate) SetNillableComment(s *string) *FoodCreate
SetNillableComment sets the "comment" field if the given value is not nil.
func (*FoodCreate) SetProt100 ¶
func (fc *FoodCreate) SetProt100(f float64) *FoodCreate
SetProt100 sets the "prot100" field.
type FoodCreateBulk ¶
type FoodCreateBulk struct {
// contains filtered or unexported fields
}
FoodCreateBulk is the builder for creating many Food entities in bulk.
func (*FoodCreateBulk) Exec ¶
func (fcb *FoodCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FoodCreateBulk) ExecX ¶
func (fcb *FoodCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FoodCreateBulk) OnConflict ¶
func (fcb *FoodCreateBulk) OnConflict(opts ...sql.ConflictOption) *FoodUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Food.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.FoodUpsert) { SetKey(v+v). }). Exec(ctx)
func (*FoodCreateBulk) OnConflictColumns ¶
func (fcb *FoodCreateBulk) OnConflictColumns(columns ...string) *FoodUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Food.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type FoodDelete ¶
type FoodDelete struct {
// contains filtered or unexported fields
}
FoodDelete is the builder for deleting a Food entity.
func (*FoodDelete) Exec ¶
func (fd *FoodDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*FoodDelete) ExecX ¶
func (fd *FoodDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FoodDelete) Where ¶
func (fd *FoodDelete) Where(ps ...predicate.Food) *FoodDelete
Where appends a list predicates to the FoodDelete builder.
type FoodDeleteOne ¶
type FoodDeleteOne struct {
// contains filtered or unexported fields
}
FoodDeleteOne is the builder for deleting a single Food entity.
func (*FoodDeleteOne) Exec ¶
func (fdo *FoodDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*FoodDeleteOne) ExecX ¶
func (fdo *FoodDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FoodDeleteOne) Where ¶
func (fdo *FoodDeleteOne) Where(ps ...predicate.Food) *FoodDeleteOne
Where appends a list predicates to the FoodDelete builder.
type FoodEdges ¶
type FoodEdges struct { // Journals holds the value of the journals edge. Journals []*Journal `json:"journals,omitempty"` // contains filtered or unexported fields }
FoodEdges holds the relations/edges for other nodes in the graph.
func (FoodEdges) JournalsOrErr ¶
JournalsOrErr returns the Journals value or an error if the edge was not loaded in eager-loading.
type FoodGroupBy ¶
type FoodGroupBy struct {
// contains filtered or unexported fields
}
FoodGroupBy is the group-by builder for Food entities.
func (*FoodGroupBy) Aggregate ¶
func (fgb *FoodGroupBy) Aggregate(fns ...AggregateFunc) *FoodGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*FoodGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FoodGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FoodGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FoodGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FoodGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FoodGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FoodGroupBy) Scan ¶
func (fgb *FoodGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FoodGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FoodMutation ¶
type FoodMutation struct {
// contains filtered or unexported fields
}
FoodMutation represents an operation that mutates the Food nodes in the graph.
func (*FoodMutation) AddCal100 ¶
func (m *FoodMutation) AddCal100(f float64)
AddCal100 adds f to the "cal100" field.
func (*FoodMutation) AddCarb100 ¶
func (m *FoodMutation) AddCarb100(f float64)
AddCarb100 adds f to the "carb100" field.
func (*FoodMutation) AddFat100 ¶
func (m *FoodMutation) AddFat100(f float64)
AddFat100 adds f to the "fat100" field.
func (*FoodMutation) AddField ¶
func (m *FoodMutation) 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 (*FoodMutation) AddJournalIDs ¶
func (m *FoodMutation) AddJournalIDs(ids ...int)
AddJournalIDs adds the "journals" edge to the Journal entity by ids.
func (*FoodMutation) AddProt100 ¶
func (m *FoodMutation) AddProt100(f float64)
AddProt100 adds f to the "prot100" field.
func (*FoodMutation) AddedCal100 ¶
func (m *FoodMutation) AddedCal100() (r float64, exists bool)
AddedCal100 returns the value that was added to the "cal100" field in this mutation.
func (*FoodMutation) AddedCarb100 ¶
func (m *FoodMutation) AddedCarb100() (r float64, exists bool)
AddedCarb100 returns the value that was added to the "carb100" field in this mutation.
func (*FoodMutation) AddedEdges ¶
func (m *FoodMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*FoodMutation) AddedFat100 ¶
func (m *FoodMutation) AddedFat100() (r float64, exists bool)
AddedFat100 returns the value that was added to the "fat100" field in this mutation.
func (*FoodMutation) AddedField ¶
func (m *FoodMutation) 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 (*FoodMutation) AddedFields ¶
func (m *FoodMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*FoodMutation) AddedIDs ¶
func (m *FoodMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*FoodMutation) AddedProt100 ¶
func (m *FoodMutation) AddedProt100() (r float64, exists bool)
AddedProt100 returns the value that was added to the "prot100" field in this mutation.
func (*FoodMutation) Brand ¶
func (m *FoodMutation) Brand() (r string, exists bool)
Brand returns the value of the "brand" field in the mutation.
func (*FoodMutation) BrandCleared ¶
func (m *FoodMutation) BrandCleared() bool
BrandCleared returns if the "brand" field was cleared in this mutation.
func (*FoodMutation) Cal100 ¶
func (m *FoodMutation) Cal100() (r float64, exists bool)
Cal100 returns the value of the "cal100" field in the mutation.
func (*FoodMutation) Carb100 ¶
func (m *FoodMutation) Carb100() (r float64, exists bool)
Carb100 returns the value of the "carb100" field in the mutation.
func (*FoodMutation) ClearBrand ¶
func (m *FoodMutation) ClearBrand()
ClearBrand clears the value of the "brand" field.
func (*FoodMutation) ClearComment ¶
func (m *FoodMutation) ClearComment()
ClearComment clears the value of the "comment" field.
func (*FoodMutation) ClearEdge ¶
func (m *FoodMutation) 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 (*FoodMutation) ClearField ¶
func (m *FoodMutation) 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 (*FoodMutation) ClearJournals ¶
func (m *FoodMutation) ClearJournals()
ClearJournals clears the "journals" edge to the Journal entity.
func (*FoodMutation) ClearedEdges ¶
func (m *FoodMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*FoodMutation) ClearedFields ¶
func (m *FoodMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (FoodMutation) Client ¶
func (m FoodMutation) 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 (*FoodMutation) Comment ¶
func (m *FoodMutation) Comment() (r string, exists bool)
Comment returns the value of the "comment" field in the mutation.
func (*FoodMutation) CommentCleared ¶
func (m *FoodMutation) CommentCleared() bool
CommentCleared returns if the "comment" field was cleared in this mutation.
func (*FoodMutation) EdgeCleared ¶
func (m *FoodMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*FoodMutation) Fat100 ¶
func (m *FoodMutation) Fat100() (r float64, exists bool)
Fat100 returns the value of the "fat100" field in the mutation.
func (*FoodMutation) Field ¶
func (m *FoodMutation) 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 (*FoodMutation) FieldCleared ¶
func (m *FoodMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*FoodMutation) Fields ¶
func (m *FoodMutation) 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 (*FoodMutation) ID ¶
func (m *FoodMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*FoodMutation) IDs ¶
func (m *FoodMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*FoodMutation) JournalsCleared ¶
func (m *FoodMutation) JournalsCleared() bool
JournalsCleared reports if the "journals" edge to the Journal entity was cleared.
func (*FoodMutation) JournalsIDs ¶
func (m *FoodMutation) JournalsIDs() (ids []int)
JournalsIDs returns the "journals" edge IDs in the mutation.
func (*FoodMutation) Key ¶
func (m *FoodMutation) Key() (r string, exists bool)
Key returns the value of the "key" field in the mutation.
func (*FoodMutation) Name ¶
func (m *FoodMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*FoodMutation) OldBrand ¶
func (m *FoodMutation) OldBrand(ctx context.Context) (v string, err error)
OldBrand returns the old "brand" field's value of the Food entity. If the Food 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 (*FoodMutation) OldCal100 ¶
func (m *FoodMutation) OldCal100(ctx context.Context) (v float64, err error)
OldCal100 returns the old "cal100" field's value of the Food entity. If the Food 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 (*FoodMutation) OldCarb100 ¶
func (m *FoodMutation) OldCarb100(ctx context.Context) (v float64, err error)
OldCarb100 returns the old "carb100" field's value of the Food entity. If the Food 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 (*FoodMutation) OldComment ¶
func (m *FoodMutation) OldComment(ctx context.Context) (v string, err error)
OldComment returns the old "comment" field's value of the Food entity. If the Food 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 (*FoodMutation) OldFat100 ¶
func (m *FoodMutation) OldFat100(ctx context.Context) (v float64, err error)
OldFat100 returns the old "fat100" field's value of the Food entity. If the Food 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 (*FoodMutation) 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 (*FoodMutation) OldKey ¶
func (m *FoodMutation) OldKey(ctx context.Context) (v string, err error)
OldKey returns the old "key" field's value of the Food entity. If the Food 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 (*FoodMutation) OldName ¶
func (m *FoodMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Food entity. If the Food 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 (*FoodMutation) OldProt100 ¶
func (m *FoodMutation) OldProt100(ctx context.Context) (v float64, err error)
OldProt100 returns the old "prot100" field's value of the Food entity. If the Food 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 (*FoodMutation) Prot100 ¶
func (m *FoodMutation) Prot100() (r float64, exists bool)
Prot100 returns the value of the "prot100" field in the mutation.
func (*FoodMutation) RemoveJournalIDs ¶
func (m *FoodMutation) RemoveJournalIDs(ids ...int)
RemoveJournalIDs removes the "journals" edge to the Journal entity by IDs.
func (*FoodMutation) RemovedEdges ¶
func (m *FoodMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*FoodMutation) RemovedIDs ¶
func (m *FoodMutation) 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 (*FoodMutation) RemovedJournalsIDs ¶
func (m *FoodMutation) RemovedJournalsIDs() (ids []int)
RemovedJournals returns the removed IDs of the "journals" edge to the Journal entity.
func (*FoodMutation) ResetBrand ¶
func (m *FoodMutation) ResetBrand()
ResetBrand resets all changes to the "brand" field.
func (*FoodMutation) ResetCal100 ¶
func (m *FoodMutation) ResetCal100()
ResetCal100 resets all changes to the "cal100" field.
func (*FoodMutation) ResetCarb100 ¶
func (m *FoodMutation) ResetCarb100()
ResetCarb100 resets all changes to the "carb100" field.
func (*FoodMutation) ResetComment ¶
func (m *FoodMutation) ResetComment()
ResetComment resets all changes to the "comment" field.
func (*FoodMutation) ResetEdge ¶
func (m *FoodMutation) 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 (*FoodMutation) ResetFat100 ¶
func (m *FoodMutation) ResetFat100()
ResetFat100 resets all changes to the "fat100" field.
func (*FoodMutation) ResetField ¶
func (m *FoodMutation) 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 (*FoodMutation) ResetJournals ¶
func (m *FoodMutation) ResetJournals()
ResetJournals resets all changes to the "journals" edge.
func (*FoodMutation) ResetKey ¶
func (m *FoodMutation) ResetKey()
ResetKey resets all changes to the "key" field.
func (*FoodMutation) ResetName ¶
func (m *FoodMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*FoodMutation) ResetProt100 ¶
func (m *FoodMutation) ResetProt100()
ResetProt100 resets all changes to the "prot100" field.
func (*FoodMutation) SetBrand ¶
func (m *FoodMutation) SetBrand(s string)
SetBrand sets the "brand" field.
func (*FoodMutation) SetCal100 ¶
func (m *FoodMutation) SetCal100(f float64)
SetCal100 sets the "cal100" field.
func (*FoodMutation) SetCarb100 ¶
func (m *FoodMutation) SetCarb100(f float64)
SetCarb100 sets the "carb100" field.
func (*FoodMutation) SetComment ¶
func (m *FoodMutation) SetComment(s string)
SetComment sets the "comment" field.
func (*FoodMutation) SetFat100 ¶
func (m *FoodMutation) SetFat100(f float64)
SetFat100 sets the "fat100" field.
func (*FoodMutation) SetField ¶
func (m *FoodMutation) 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 (*FoodMutation) SetName ¶
func (m *FoodMutation) SetName(s string)
SetName sets the "name" field.
func (*FoodMutation) SetOp ¶
func (m *FoodMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*FoodMutation) SetProt100 ¶
func (m *FoodMutation) SetProt100(f float64)
SetProt100 sets the "prot100" field.
func (FoodMutation) Tx ¶
func (m FoodMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*FoodMutation) Type ¶
func (m *FoodMutation) Type() string
Type returns the node type of this mutation (Food).
func (*FoodMutation) Where ¶
func (m *FoodMutation) Where(ps ...predicate.Food)
Where appends a list predicates to the FoodMutation builder.
func (*FoodMutation) WhereP ¶
func (m *FoodMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the FoodMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type FoodQuery ¶
type FoodQuery struct {
// contains filtered or unexported fields
}
FoodQuery is the builder for querying Food entities.
func (*FoodQuery) Aggregate ¶
func (fq *FoodQuery) Aggregate(fns ...AggregateFunc) *FoodSelect
Aggregate returns a FoodSelect configured with the given aggregations.
func (*FoodQuery) Clone ¶
Clone returns a duplicate of the FoodQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*FoodQuery) First ¶
First returns the first Food entity from the query. Returns a *NotFoundError when no Food was found.
func (*FoodQuery) FirstID ¶
FirstID returns the first Food ID from the query. Returns a *NotFoundError when no Food ID was found.
func (*FoodQuery) GroupBy ¶
func (fq *FoodQuery) GroupBy(field string, fields ...string) *FoodGroupBy
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 { Key string `json:"key,omitempty"` Count int `json:"count,omitempty"` } client.Food.Query(). GroupBy(food.FieldKey). Aggregate(ent.Count()). Scan(ctx, &v)
func (*FoodQuery) Modify ¶
func (fq *FoodQuery) Modify(modifiers ...func(s *sql.Selector)) *FoodSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*FoodQuery) Only ¶
Only returns a single Food entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Food entity is found. Returns a *NotFoundError when no Food entities are found.
func (*FoodQuery) OnlyID ¶
OnlyID is like Only, but returns the only Food ID in the query. Returns a *NotSingularError when more than one Food ID is found. Returns a *NotFoundError when no entities are found.
func (*FoodQuery) Order ¶
func (fq *FoodQuery) Order(o ...food.OrderOption) *FoodQuery
Order specifies how the records should be ordered.
func (*FoodQuery) QueryJournals ¶
func (fq *FoodQuery) QueryJournals() *JournalQuery
QueryJournals chains the current query on the "journals" edge.
func (*FoodQuery) Select ¶
func (fq *FoodQuery) Select(fields ...string) *FoodSelect
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 { Key string `json:"key,omitempty"` } client.Food.Query(). Select(food.FieldKey). Scan(ctx, &v)
func (*FoodQuery) 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 (*FoodQuery) WithJournals ¶
func (fq *FoodQuery) WithJournals(opts ...func(*JournalQuery)) *FoodQuery
WithJournals tells the query-builder to eager-load the nodes that are connected to the "journals" edge. The optional arguments are used to configure the query builder of the edge.
type FoodSelect ¶
type FoodSelect struct { *FoodQuery // contains filtered or unexported fields }
FoodSelect is the builder for selecting fields of Food entities.
func (*FoodSelect) Aggregate ¶
func (fs *FoodSelect) Aggregate(fns ...AggregateFunc) *FoodSelect
Aggregate adds the given aggregation functions to the selector query.
func (*FoodSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FoodSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FoodSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FoodSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FoodSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FoodSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FoodSelect) Modify ¶
func (fs *FoodSelect) Modify(modifiers ...func(s *sql.Selector)) *FoodSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*FoodSelect) Scan ¶
func (fs *FoodSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FoodSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FoodUpdate ¶
type FoodUpdate struct {
// contains filtered or unexported fields
}
FoodUpdate is the builder for updating Food entities.
func (*FoodUpdate) AddCal100 ¶
func (fu *FoodUpdate) AddCal100(f float64) *FoodUpdate
AddCal100 adds f to the "cal100" field.
func (*FoodUpdate) AddCarb100 ¶
func (fu *FoodUpdate) AddCarb100(f float64) *FoodUpdate
AddCarb100 adds f to the "carb100" field.
func (*FoodUpdate) AddFat100 ¶
func (fu *FoodUpdate) AddFat100(f float64) *FoodUpdate
AddFat100 adds f to the "fat100" field.
func (*FoodUpdate) AddJournalIDs ¶
func (fu *FoodUpdate) AddJournalIDs(ids ...int) *FoodUpdate
AddJournalIDs adds the "journals" edge to the Journal entity by IDs.
func (*FoodUpdate) AddJournals ¶
func (fu *FoodUpdate) AddJournals(j ...*Journal) *FoodUpdate
AddJournals adds the "journals" edges to the Journal entity.
func (*FoodUpdate) AddProt100 ¶
func (fu *FoodUpdate) AddProt100(f float64) *FoodUpdate
AddProt100 adds f to the "prot100" field.
func (*FoodUpdate) ClearBrand ¶
func (fu *FoodUpdate) ClearBrand() *FoodUpdate
ClearBrand clears the value of the "brand" field.
func (*FoodUpdate) ClearComment ¶
func (fu *FoodUpdate) ClearComment() *FoodUpdate
ClearComment clears the value of the "comment" field.
func (*FoodUpdate) ClearJournals ¶
func (fu *FoodUpdate) ClearJournals() *FoodUpdate
ClearJournals clears all "journals" edges to the Journal entity.
func (*FoodUpdate) Exec ¶
func (fu *FoodUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FoodUpdate) ExecX ¶
func (fu *FoodUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FoodUpdate) Modify ¶
func (fu *FoodUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *FoodUpdate
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*FoodUpdate) Mutation ¶
func (fu *FoodUpdate) Mutation() *FoodMutation
Mutation returns the FoodMutation object of the builder.
func (*FoodUpdate) RemoveJournalIDs ¶
func (fu *FoodUpdate) RemoveJournalIDs(ids ...int) *FoodUpdate
RemoveJournalIDs removes the "journals" edge to Journal entities by IDs.
func (*FoodUpdate) RemoveJournals ¶
func (fu *FoodUpdate) RemoveJournals(j ...*Journal) *FoodUpdate
RemoveJournals removes "journals" edges to Journal entities.
func (*FoodUpdate) Save ¶
func (fu *FoodUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*FoodUpdate) SaveX ¶
func (fu *FoodUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*FoodUpdate) SetBrand ¶
func (fu *FoodUpdate) SetBrand(s string) *FoodUpdate
SetBrand sets the "brand" field.
func (*FoodUpdate) SetCal100 ¶
func (fu *FoodUpdate) SetCal100(f float64) *FoodUpdate
SetCal100 sets the "cal100" field.
func (*FoodUpdate) SetCarb100 ¶
func (fu *FoodUpdate) SetCarb100(f float64) *FoodUpdate
SetCarb100 sets the "carb100" field.
func (*FoodUpdate) SetComment ¶
func (fu *FoodUpdate) SetComment(s string) *FoodUpdate
SetComment sets the "comment" field.
func (*FoodUpdate) SetFat100 ¶
func (fu *FoodUpdate) SetFat100(f float64) *FoodUpdate
SetFat100 sets the "fat100" field.
func (*FoodUpdate) SetKey ¶
func (fu *FoodUpdate) SetKey(s string) *FoodUpdate
SetKey sets the "key" field.
func (*FoodUpdate) SetName ¶
func (fu *FoodUpdate) SetName(s string) *FoodUpdate
SetName sets the "name" field.
func (*FoodUpdate) SetNillableBrand ¶
func (fu *FoodUpdate) SetNillableBrand(s *string) *FoodUpdate
SetNillableBrand sets the "brand" field if the given value is not nil.
func (*FoodUpdate) SetNillableCal100 ¶
func (fu *FoodUpdate) SetNillableCal100(f *float64) *FoodUpdate
SetNillableCal100 sets the "cal100" field if the given value is not nil.
func (*FoodUpdate) SetNillableCarb100 ¶
func (fu *FoodUpdate) SetNillableCarb100(f *float64) *FoodUpdate
SetNillableCarb100 sets the "carb100" field if the given value is not nil.
func (*FoodUpdate) SetNillableComment ¶
func (fu *FoodUpdate) SetNillableComment(s *string) *FoodUpdate
SetNillableComment sets the "comment" field if the given value is not nil.
func (*FoodUpdate) SetNillableFat100 ¶
func (fu *FoodUpdate) SetNillableFat100(f *float64) *FoodUpdate
SetNillableFat100 sets the "fat100" field if the given value is not nil.
func (*FoodUpdate) SetNillableKey ¶
func (fu *FoodUpdate) SetNillableKey(s *string) *FoodUpdate
SetNillableKey sets the "key" field if the given value is not nil.
func (*FoodUpdate) SetNillableName ¶
func (fu *FoodUpdate) SetNillableName(s *string) *FoodUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*FoodUpdate) SetNillableProt100 ¶
func (fu *FoodUpdate) SetNillableProt100(f *float64) *FoodUpdate
SetNillableProt100 sets the "prot100" field if the given value is not nil.
func (*FoodUpdate) SetProt100 ¶
func (fu *FoodUpdate) SetProt100(f float64) *FoodUpdate
SetProt100 sets the "prot100" field.
func (*FoodUpdate) Where ¶
func (fu *FoodUpdate) Where(ps ...predicate.Food) *FoodUpdate
Where appends a list predicates to the FoodUpdate builder.
type FoodUpdateOne ¶
type FoodUpdateOne struct {
// contains filtered or unexported fields
}
FoodUpdateOne is the builder for updating a single Food entity.
func (*FoodUpdateOne) AddCal100 ¶
func (fuo *FoodUpdateOne) AddCal100(f float64) *FoodUpdateOne
AddCal100 adds f to the "cal100" field.
func (*FoodUpdateOne) AddCarb100 ¶
func (fuo *FoodUpdateOne) AddCarb100(f float64) *FoodUpdateOne
AddCarb100 adds f to the "carb100" field.
func (*FoodUpdateOne) AddFat100 ¶
func (fuo *FoodUpdateOne) AddFat100(f float64) *FoodUpdateOne
AddFat100 adds f to the "fat100" field.
func (*FoodUpdateOne) AddJournalIDs ¶
func (fuo *FoodUpdateOne) AddJournalIDs(ids ...int) *FoodUpdateOne
AddJournalIDs adds the "journals" edge to the Journal entity by IDs.
func (*FoodUpdateOne) AddJournals ¶
func (fuo *FoodUpdateOne) AddJournals(j ...*Journal) *FoodUpdateOne
AddJournals adds the "journals" edges to the Journal entity.
func (*FoodUpdateOne) AddProt100 ¶
func (fuo *FoodUpdateOne) AddProt100(f float64) *FoodUpdateOne
AddProt100 adds f to the "prot100" field.
func (*FoodUpdateOne) ClearBrand ¶
func (fuo *FoodUpdateOne) ClearBrand() *FoodUpdateOne
ClearBrand clears the value of the "brand" field.
func (*FoodUpdateOne) ClearComment ¶
func (fuo *FoodUpdateOne) ClearComment() *FoodUpdateOne
ClearComment clears the value of the "comment" field.
func (*FoodUpdateOne) ClearJournals ¶
func (fuo *FoodUpdateOne) ClearJournals() *FoodUpdateOne
ClearJournals clears all "journals" edges to the Journal entity.
func (*FoodUpdateOne) Exec ¶
func (fuo *FoodUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FoodUpdateOne) ExecX ¶
func (fuo *FoodUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FoodUpdateOne) Modify ¶
func (fuo *FoodUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *FoodUpdateOne
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*FoodUpdateOne) Mutation ¶
func (fuo *FoodUpdateOne) Mutation() *FoodMutation
Mutation returns the FoodMutation object of the builder.
func (*FoodUpdateOne) RemoveJournalIDs ¶
func (fuo *FoodUpdateOne) RemoveJournalIDs(ids ...int) *FoodUpdateOne
RemoveJournalIDs removes the "journals" edge to Journal entities by IDs.
func (*FoodUpdateOne) RemoveJournals ¶
func (fuo *FoodUpdateOne) RemoveJournals(j ...*Journal) *FoodUpdateOne
RemoveJournals removes "journals" edges to Journal entities.
func (*FoodUpdateOne) Save ¶
func (fuo *FoodUpdateOne) Save(ctx context.Context) (*Food, error)
Save executes the query and returns the updated Food entity.
func (*FoodUpdateOne) SaveX ¶
func (fuo *FoodUpdateOne) SaveX(ctx context.Context) *Food
SaveX is like Save, but panics if an error occurs.
func (*FoodUpdateOne) Select ¶
func (fuo *FoodUpdateOne) Select(field string, fields ...string) *FoodUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*FoodUpdateOne) SetBrand ¶
func (fuo *FoodUpdateOne) SetBrand(s string) *FoodUpdateOne
SetBrand sets the "brand" field.
func (*FoodUpdateOne) SetCal100 ¶
func (fuo *FoodUpdateOne) SetCal100(f float64) *FoodUpdateOne
SetCal100 sets the "cal100" field.
func (*FoodUpdateOne) SetCarb100 ¶
func (fuo *FoodUpdateOne) SetCarb100(f float64) *FoodUpdateOne
SetCarb100 sets the "carb100" field.
func (*FoodUpdateOne) SetComment ¶
func (fuo *FoodUpdateOne) SetComment(s string) *FoodUpdateOne
SetComment sets the "comment" field.
func (*FoodUpdateOne) SetFat100 ¶
func (fuo *FoodUpdateOne) SetFat100(f float64) *FoodUpdateOne
SetFat100 sets the "fat100" field.
func (*FoodUpdateOne) SetKey ¶
func (fuo *FoodUpdateOne) SetKey(s string) *FoodUpdateOne
SetKey sets the "key" field.
func (*FoodUpdateOne) SetName ¶
func (fuo *FoodUpdateOne) SetName(s string) *FoodUpdateOne
SetName sets the "name" field.
func (*FoodUpdateOne) SetNillableBrand ¶
func (fuo *FoodUpdateOne) SetNillableBrand(s *string) *FoodUpdateOne
SetNillableBrand sets the "brand" field if the given value is not nil.
func (*FoodUpdateOne) SetNillableCal100 ¶
func (fuo *FoodUpdateOne) SetNillableCal100(f *float64) *FoodUpdateOne
SetNillableCal100 sets the "cal100" field if the given value is not nil.
func (*FoodUpdateOne) SetNillableCarb100 ¶
func (fuo *FoodUpdateOne) SetNillableCarb100(f *float64) *FoodUpdateOne
SetNillableCarb100 sets the "carb100" field if the given value is not nil.
func (*FoodUpdateOne) SetNillableComment ¶
func (fuo *FoodUpdateOne) SetNillableComment(s *string) *FoodUpdateOne
SetNillableComment sets the "comment" field if the given value is not nil.
func (*FoodUpdateOne) SetNillableFat100 ¶
func (fuo *FoodUpdateOne) SetNillableFat100(f *float64) *FoodUpdateOne
SetNillableFat100 sets the "fat100" field if the given value is not nil.
func (*FoodUpdateOne) SetNillableKey ¶
func (fuo *FoodUpdateOne) SetNillableKey(s *string) *FoodUpdateOne
SetNillableKey sets the "key" field if the given value is not nil.
func (*FoodUpdateOne) SetNillableName ¶
func (fuo *FoodUpdateOne) SetNillableName(s *string) *FoodUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*FoodUpdateOne) SetNillableProt100 ¶
func (fuo *FoodUpdateOne) SetNillableProt100(f *float64) *FoodUpdateOne
SetNillableProt100 sets the "prot100" field if the given value is not nil.
func (*FoodUpdateOne) SetProt100 ¶
func (fuo *FoodUpdateOne) SetProt100(f float64) *FoodUpdateOne
SetProt100 sets the "prot100" field.
func (*FoodUpdateOne) Where ¶
func (fuo *FoodUpdateOne) Where(ps ...predicate.Food) *FoodUpdateOne
Where appends a list predicates to the FoodUpdate builder.
type FoodUpsert ¶
FoodUpsert is the "OnConflict" setter.
func (*FoodUpsert) AddCal100 ¶
func (u *FoodUpsert) AddCal100(v float64) *FoodUpsert
AddCal100 adds v to the "cal100" field.
func (*FoodUpsert) AddCarb100 ¶
func (u *FoodUpsert) AddCarb100(v float64) *FoodUpsert
AddCarb100 adds v to the "carb100" field.
func (*FoodUpsert) AddFat100 ¶
func (u *FoodUpsert) AddFat100(v float64) *FoodUpsert
AddFat100 adds v to the "fat100" field.
func (*FoodUpsert) AddProt100 ¶
func (u *FoodUpsert) AddProt100(v float64) *FoodUpsert
AddProt100 adds v to the "prot100" field.
func (*FoodUpsert) ClearBrand ¶
func (u *FoodUpsert) ClearBrand() *FoodUpsert
ClearBrand clears the value of the "brand" field.
func (*FoodUpsert) ClearComment ¶
func (u *FoodUpsert) ClearComment() *FoodUpsert
ClearComment clears the value of the "comment" field.
func (*FoodUpsert) SetBrand ¶
func (u *FoodUpsert) SetBrand(v string) *FoodUpsert
SetBrand sets the "brand" field.
func (*FoodUpsert) SetCal100 ¶
func (u *FoodUpsert) SetCal100(v float64) *FoodUpsert
SetCal100 sets the "cal100" field.
func (*FoodUpsert) SetCarb100 ¶
func (u *FoodUpsert) SetCarb100(v float64) *FoodUpsert
SetCarb100 sets the "carb100" field.
func (*FoodUpsert) SetComment ¶
func (u *FoodUpsert) SetComment(v string) *FoodUpsert
SetComment sets the "comment" field.
func (*FoodUpsert) SetFat100 ¶
func (u *FoodUpsert) SetFat100(v float64) *FoodUpsert
SetFat100 sets the "fat100" field.
func (*FoodUpsert) SetKey ¶
func (u *FoodUpsert) SetKey(v string) *FoodUpsert
SetKey sets the "key" field.
func (*FoodUpsert) SetName ¶
func (u *FoodUpsert) SetName(v string) *FoodUpsert
SetName sets the "name" field.
func (*FoodUpsert) SetProt100 ¶
func (u *FoodUpsert) SetProt100(v float64) *FoodUpsert
SetProt100 sets the "prot100" field.
func (*FoodUpsert) UpdateBrand ¶
func (u *FoodUpsert) UpdateBrand() *FoodUpsert
UpdateBrand sets the "brand" field to the value that was provided on create.
func (*FoodUpsert) UpdateCal100 ¶
func (u *FoodUpsert) UpdateCal100() *FoodUpsert
UpdateCal100 sets the "cal100" field to the value that was provided on create.
func (*FoodUpsert) UpdateCarb100 ¶
func (u *FoodUpsert) UpdateCarb100() *FoodUpsert
UpdateCarb100 sets the "carb100" field to the value that was provided on create.
func (*FoodUpsert) UpdateComment ¶
func (u *FoodUpsert) UpdateComment() *FoodUpsert
UpdateComment sets the "comment" field to the value that was provided on create.
func (*FoodUpsert) UpdateFat100 ¶
func (u *FoodUpsert) UpdateFat100() *FoodUpsert
UpdateFat100 sets the "fat100" field to the value that was provided on create.
func (*FoodUpsert) UpdateKey ¶
func (u *FoodUpsert) UpdateKey() *FoodUpsert
UpdateKey sets the "key" field to the value that was provided on create.
func (*FoodUpsert) UpdateName ¶
func (u *FoodUpsert) UpdateName() *FoodUpsert
UpdateName sets the "name" field to the value that was provided on create.
func (*FoodUpsert) UpdateProt100 ¶
func (u *FoodUpsert) UpdateProt100() *FoodUpsert
UpdateProt100 sets the "prot100" field to the value that was provided on create.
type FoodUpsertBulk ¶
type FoodUpsertBulk struct {
// contains filtered or unexported fields
}
FoodUpsertBulk is the builder for "upsert"-ing a bulk of Food nodes.
func (*FoodUpsertBulk) AddCal100 ¶
func (u *FoodUpsertBulk) AddCal100(v float64) *FoodUpsertBulk
AddCal100 adds v to the "cal100" field.
func (*FoodUpsertBulk) AddCarb100 ¶
func (u *FoodUpsertBulk) AddCarb100(v float64) *FoodUpsertBulk
AddCarb100 adds v to the "carb100" field.
func (*FoodUpsertBulk) AddFat100 ¶
func (u *FoodUpsertBulk) AddFat100(v float64) *FoodUpsertBulk
AddFat100 adds v to the "fat100" field.
func (*FoodUpsertBulk) AddProt100 ¶
func (u *FoodUpsertBulk) AddProt100(v float64) *FoodUpsertBulk
AddProt100 adds v to the "prot100" field.
func (*FoodUpsertBulk) ClearBrand ¶
func (u *FoodUpsertBulk) ClearBrand() *FoodUpsertBulk
ClearBrand clears the value of the "brand" field.
func (*FoodUpsertBulk) ClearComment ¶
func (u *FoodUpsertBulk) ClearComment() *FoodUpsertBulk
ClearComment clears the value of the "comment" field.
func (*FoodUpsertBulk) DoNothing ¶
func (u *FoodUpsertBulk) DoNothing() *FoodUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*FoodUpsertBulk) Exec ¶
func (u *FoodUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FoodUpsertBulk) ExecX ¶
func (u *FoodUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FoodUpsertBulk) Ignore ¶
func (u *FoodUpsertBulk) Ignore() *FoodUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Food.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*FoodUpsertBulk) SetBrand ¶
func (u *FoodUpsertBulk) SetBrand(v string) *FoodUpsertBulk
SetBrand sets the "brand" field.
func (*FoodUpsertBulk) SetCal100 ¶
func (u *FoodUpsertBulk) SetCal100(v float64) *FoodUpsertBulk
SetCal100 sets the "cal100" field.
func (*FoodUpsertBulk) SetCarb100 ¶
func (u *FoodUpsertBulk) SetCarb100(v float64) *FoodUpsertBulk
SetCarb100 sets the "carb100" field.
func (*FoodUpsertBulk) SetComment ¶
func (u *FoodUpsertBulk) SetComment(v string) *FoodUpsertBulk
SetComment sets the "comment" field.
func (*FoodUpsertBulk) SetFat100 ¶
func (u *FoodUpsertBulk) SetFat100(v float64) *FoodUpsertBulk
SetFat100 sets the "fat100" field.
func (*FoodUpsertBulk) SetKey ¶
func (u *FoodUpsertBulk) SetKey(v string) *FoodUpsertBulk
SetKey sets the "key" field.
func (*FoodUpsertBulk) SetName ¶
func (u *FoodUpsertBulk) SetName(v string) *FoodUpsertBulk
SetName sets the "name" field.
func (*FoodUpsertBulk) SetProt100 ¶
func (u *FoodUpsertBulk) SetProt100(v float64) *FoodUpsertBulk
SetProt100 sets the "prot100" field.
func (*FoodUpsertBulk) Update ¶
func (u *FoodUpsertBulk) Update(set func(*FoodUpsert)) *FoodUpsertBulk
Update allows overriding fields `UPDATE` values. See the FoodCreateBulk.OnConflict documentation for more info.
func (*FoodUpsertBulk) UpdateBrand ¶
func (u *FoodUpsertBulk) UpdateBrand() *FoodUpsertBulk
UpdateBrand sets the "brand" field to the value that was provided on create.
func (*FoodUpsertBulk) UpdateCal100 ¶
func (u *FoodUpsertBulk) UpdateCal100() *FoodUpsertBulk
UpdateCal100 sets the "cal100" field to the value that was provided on create.
func (*FoodUpsertBulk) UpdateCarb100 ¶
func (u *FoodUpsertBulk) UpdateCarb100() *FoodUpsertBulk
UpdateCarb100 sets the "carb100" field to the value that was provided on create.
func (*FoodUpsertBulk) UpdateComment ¶
func (u *FoodUpsertBulk) UpdateComment() *FoodUpsertBulk
UpdateComment sets the "comment" field to the value that was provided on create.
func (*FoodUpsertBulk) UpdateFat100 ¶
func (u *FoodUpsertBulk) UpdateFat100() *FoodUpsertBulk
UpdateFat100 sets the "fat100" field to the value that was provided on create.
func (*FoodUpsertBulk) UpdateKey ¶
func (u *FoodUpsertBulk) UpdateKey() *FoodUpsertBulk
UpdateKey sets the "key" field to the value that was provided on create.
func (*FoodUpsertBulk) UpdateName ¶
func (u *FoodUpsertBulk) UpdateName() *FoodUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*FoodUpsertBulk) UpdateNewValues ¶
func (u *FoodUpsertBulk) UpdateNewValues() *FoodUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Food.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*FoodUpsertBulk) UpdateProt100 ¶
func (u *FoodUpsertBulk) UpdateProt100() *FoodUpsertBulk
UpdateProt100 sets the "prot100" field to the value that was provided on create.
type FoodUpsertOne ¶
type FoodUpsertOne struct {
// contains filtered or unexported fields
}
FoodUpsertOne is the builder for "upsert"-ing
one Food node.
func (*FoodUpsertOne) AddCal100 ¶
func (u *FoodUpsertOne) AddCal100(v float64) *FoodUpsertOne
AddCal100 adds v to the "cal100" field.
func (*FoodUpsertOne) AddCarb100 ¶
func (u *FoodUpsertOne) AddCarb100(v float64) *FoodUpsertOne
AddCarb100 adds v to the "carb100" field.
func (*FoodUpsertOne) AddFat100 ¶
func (u *FoodUpsertOne) AddFat100(v float64) *FoodUpsertOne
AddFat100 adds v to the "fat100" field.
func (*FoodUpsertOne) AddProt100 ¶
func (u *FoodUpsertOne) AddProt100(v float64) *FoodUpsertOne
AddProt100 adds v to the "prot100" field.
func (*FoodUpsertOne) ClearBrand ¶
func (u *FoodUpsertOne) ClearBrand() *FoodUpsertOne
ClearBrand clears the value of the "brand" field.
func (*FoodUpsertOne) ClearComment ¶
func (u *FoodUpsertOne) ClearComment() *FoodUpsertOne
ClearComment clears the value of the "comment" field.
func (*FoodUpsertOne) DoNothing ¶
func (u *FoodUpsertOne) DoNothing() *FoodUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*FoodUpsertOne) Exec ¶
func (u *FoodUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*FoodUpsertOne) ExecX ¶
func (u *FoodUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FoodUpsertOne) ID ¶
func (u *FoodUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*FoodUpsertOne) IDX ¶
func (u *FoodUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*FoodUpsertOne) Ignore ¶
func (u *FoodUpsertOne) Ignore() *FoodUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Food.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*FoodUpsertOne) SetBrand ¶
func (u *FoodUpsertOne) SetBrand(v string) *FoodUpsertOne
SetBrand sets the "brand" field.
func (*FoodUpsertOne) SetCal100 ¶
func (u *FoodUpsertOne) SetCal100(v float64) *FoodUpsertOne
SetCal100 sets the "cal100" field.
func (*FoodUpsertOne) SetCarb100 ¶
func (u *FoodUpsertOne) SetCarb100(v float64) *FoodUpsertOne
SetCarb100 sets the "carb100" field.
func (*FoodUpsertOne) SetComment ¶
func (u *FoodUpsertOne) SetComment(v string) *FoodUpsertOne
SetComment sets the "comment" field.
func (*FoodUpsertOne) SetFat100 ¶
func (u *FoodUpsertOne) SetFat100(v float64) *FoodUpsertOne
SetFat100 sets the "fat100" field.
func (*FoodUpsertOne) SetKey ¶
func (u *FoodUpsertOne) SetKey(v string) *FoodUpsertOne
SetKey sets the "key" field.
func (*FoodUpsertOne) SetName ¶
func (u *FoodUpsertOne) SetName(v string) *FoodUpsertOne
SetName sets the "name" field.
func (*FoodUpsertOne) SetProt100 ¶
func (u *FoodUpsertOne) SetProt100(v float64) *FoodUpsertOne
SetProt100 sets the "prot100" field.
func (*FoodUpsertOne) Update ¶
func (u *FoodUpsertOne) Update(set func(*FoodUpsert)) *FoodUpsertOne
Update allows overriding fields `UPDATE` values. See the FoodCreate.OnConflict documentation for more info.
func (*FoodUpsertOne) UpdateBrand ¶
func (u *FoodUpsertOne) UpdateBrand() *FoodUpsertOne
UpdateBrand sets the "brand" field to the value that was provided on create.
func (*FoodUpsertOne) UpdateCal100 ¶
func (u *FoodUpsertOne) UpdateCal100() *FoodUpsertOne
UpdateCal100 sets the "cal100" field to the value that was provided on create.
func (*FoodUpsertOne) UpdateCarb100 ¶
func (u *FoodUpsertOne) UpdateCarb100() *FoodUpsertOne
UpdateCarb100 sets the "carb100" field to the value that was provided on create.
func (*FoodUpsertOne) UpdateComment ¶
func (u *FoodUpsertOne) UpdateComment() *FoodUpsertOne
UpdateComment sets the "comment" field to the value that was provided on create.
func (*FoodUpsertOne) UpdateFat100 ¶
func (u *FoodUpsertOne) UpdateFat100() *FoodUpsertOne
UpdateFat100 sets the "fat100" field to the value that was provided on create.
func (*FoodUpsertOne) UpdateKey ¶
func (u *FoodUpsertOne) UpdateKey() *FoodUpsertOne
UpdateKey sets the "key" field to the value that was provided on create.
func (*FoodUpsertOne) UpdateName ¶
func (u *FoodUpsertOne) UpdateName() *FoodUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*FoodUpsertOne) UpdateNewValues ¶
func (u *FoodUpsertOne) UpdateNewValues() *FoodUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Food.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*FoodUpsertOne) UpdateProt100 ¶
func (u *FoodUpsertOne) UpdateProt100() *FoodUpsertOne
UpdateProt100 sets the "prot100" field to the value that was provided on create.
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 Journal ¶
type Journal struct { // ID of the ent. ID int `json:"id,omitempty"` // Userid holds the value of the "userid" field. Userid int64 `json:"userid,omitempty"` // Timestamp holds the value of the "timestamp" field. Timestamp time.Time `json:"timestamp,omitempty"` // Meal holds the value of the "meal" field. Meal int64 `json:"meal,omitempty"` // Foodweight holds the value of the "foodweight" field. Foodweight float64 `json:"foodweight,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the JournalQuery when eager-loading is set. Edges JournalEdges `json:"edges"` // contains filtered or unexported fields }
Journal is the model entity for the Journal schema.
func (*Journal) Unwrap ¶
Unwrap unwraps the Journal 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 (*Journal) Update ¶
func (j *Journal) Update() *JournalUpdateOne
Update returns a builder for updating this Journal. Note that you need to call Journal.Unwrap() before calling this method if this Journal was returned from a transaction, and the transaction was committed or rolled back.
type JournalClient ¶
type JournalClient struct {
// contains filtered or unexported fields
}
JournalClient is a client for the Journal schema.
func NewJournalClient ¶
func NewJournalClient(c config) *JournalClient
NewJournalClient returns a client for the Journal from the given config.
func (*JournalClient) Create ¶
func (c *JournalClient) Create() *JournalCreate
Create returns a builder for creating a Journal entity.
func (*JournalClient) CreateBulk ¶
func (c *JournalClient) CreateBulk(builders ...*JournalCreate) *JournalCreateBulk
CreateBulk returns a builder for creating a bulk of Journal entities.
func (*JournalClient) Delete ¶
func (c *JournalClient) Delete() *JournalDelete
Delete returns a delete builder for Journal.
func (*JournalClient) DeleteOne ¶
func (c *JournalClient) DeleteOne(j *Journal) *JournalDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*JournalClient) DeleteOneID ¶
func (c *JournalClient) DeleteOneID(id int) *JournalDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*JournalClient) GetX ¶
func (c *JournalClient) GetX(ctx context.Context, id int) *Journal
GetX is like Get, but panics if an error occurs.
func (*JournalClient) Hooks ¶
func (c *JournalClient) Hooks() []Hook
Hooks returns the client hooks.
func (*JournalClient) Intercept ¶
func (c *JournalClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `journal.Intercept(f(g(h())))`.
func (*JournalClient) Interceptors ¶
func (c *JournalClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*JournalClient) MapCreateBulk ¶
func (c *JournalClient) MapCreateBulk(slice any, setFunc func(*JournalCreate, int)) *JournalCreateBulk
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 (*JournalClient) Query ¶
func (c *JournalClient) Query() *JournalQuery
Query returns a query builder for Journal.
func (*JournalClient) QueryFood ¶
func (c *JournalClient) QueryFood(j *Journal) *FoodQuery
QueryFood queries the food edge of a Journal.
func (*JournalClient) Update ¶
func (c *JournalClient) Update() *JournalUpdate
Update returns an update builder for Journal.
func (*JournalClient) UpdateOne ¶
func (c *JournalClient) UpdateOne(j *Journal) *JournalUpdateOne
UpdateOne returns an update builder for the given entity.
func (*JournalClient) UpdateOneID ¶
func (c *JournalClient) UpdateOneID(id int) *JournalUpdateOne
UpdateOneID returns an update builder for the given id.
func (*JournalClient) Use ¶
func (c *JournalClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `journal.Hooks(f(g(h())))`.
type JournalCreate ¶
type JournalCreate struct {
// contains filtered or unexported fields
}
JournalCreate is the builder for creating a Journal entity.
func (*JournalCreate) Exec ¶
func (jc *JournalCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*JournalCreate) ExecX ¶
func (jc *JournalCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JournalCreate) Mutation ¶
func (jc *JournalCreate) Mutation() *JournalMutation
Mutation returns the JournalMutation object of the builder.
func (*JournalCreate) OnConflict ¶
func (jc *JournalCreate) OnConflict(opts ...sql.ConflictOption) *JournalUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Journal.Create(). SetUserid(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.JournalUpsert) { SetUserid(v+v). }). Exec(ctx)
func (*JournalCreate) OnConflictColumns ¶
func (jc *JournalCreate) OnConflictColumns(columns ...string) *JournalUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Journal.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*JournalCreate) Save ¶
func (jc *JournalCreate) Save(ctx context.Context) (*Journal, error)
Save creates the Journal in the database.
func (*JournalCreate) SaveX ¶
func (jc *JournalCreate) SaveX(ctx context.Context) *Journal
SaveX calls Save and panics if Save returns an error.
func (*JournalCreate) SetFood ¶
func (jc *JournalCreate) SetFood(f *Food) *JournalCreate
SetFood sets the "food" edge to the Food entity.
func (*JournalCreate) SetFoodID ¶
func (jc *JournalCreate) SetFoodID(id int) *JournalCreate
SetFoodID sets the "food" edge to the Food entity by ID.
func (*JournalCreate) SetFoodweight ¶
func (jc *JournalCreate) SetFoodweight(f float64) *JournalCreate
SetFoodweight sets the "foodweight" field.
func (*JournalCreate) SetMeal ¶
func (jc *JournalCreate) SetMeal(i int64) *JournalCreate
SetMeal sets the "meal" field.
func (*JournalCreate) SetTimestamp ¶
func (jc *JournalCreate) SetTimestamp(t time.Time) *JournalCreate
SetTimestamp sets the "timestamp" field.
func (*JournalCreate) SetUserid ¶
func (jc *JournalCreate) SetUserid(i int64) *JournalCreate
SetUserid sets the "userid" field.
type JournalCreateBulk ¶
type JournalCreateBulk struct {
// contains filtered or unexported fields
}
JournalCreateBulk is the builder for creating many Journal entities in bulk.
func (*JournalCreateBulk) Exec ¶
func (jcb *JournalCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*JournalCreateBulk) ExecX ¶
func (jcb *JournalCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JournalCreateBulk) OnConflict ¶
func (jcb *JournalCreateBulk) OnConflict(opts ...sql.ConflictOption) *JournalUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Journal.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.JournalUpsert) { SetUserid(v+v). }). Exec(ctx)
func (*JournalCreateBulk) OnConflictColumns ¶
func (jcb *JournalCreateBulk) OnConflictColumns(columns ...string) *JournalUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Journal.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type JournalDelete ¶
type JournalDelete struct {
// contains filtered or unexported fields
}
JournalDelete is the builder for deleting a Journal entity.
func (*JournalDelete) Exec ¶
func (jd *JournalDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*JournalDelete) ExecX ¶
func (jd *JournalDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*JournalDelete) Where ¶
func (jd *JournalDelete) Where(ps ...predicate.Journal) *JournalDelete
Where appends a list predicates to the JournalDelete builder.
type JournalDeleteOne ¶
type JournalDeleteOne struct {
// contains filtered or unexported fields
}
JournalDeleteOne is the builder for deleting a single Journal entity.
func (*JournalDeleteOne) Exec ¶
func (jdo *JournalDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*JournalDeleteOne) ExecX ¶
func (jdo *JournalDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JournalDeleteOne) Where ¶
func (jdo *JournalDeleteOne) Where(ps ...predicate.Journal) *JournalDeleteOne
Where appends a list predicates to the JournalDelete builder.
type JournalEdges ¶
type JournalEdges struct { // Food holds the value of the food edge. Food *Food `json:"food,omitempty"` // contains filtered or unexported fields }
JournalEdges holds the relations/edges for other nodes in the graph.
func (JournalEdges) FoodOrErr ¶
func (e JournalEdges) FoodOrErr() (*Food, error)
FoodOrErr returns the Food value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type JournalGroupBy ¶
type JournalGroupBy struct {
// contains filtered or unexported fields
}
JournalGroupBy is the group-by builder for Journal entities.
func (*JournalGroupBy) Aggregate ¶
func (jgb *JournalGroupBy) Aggregate(fns ...AggregateFunc) *JournalGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*JournalGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*JournalGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*JournalGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*JournalGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*JournalGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*JournalGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*JournalGroupBy) Scan ¶
func (jgb *JournalGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*JournalGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type JournalMutation ¶
type JournalMutation struct {
// contains filtered or unexported fields
}
JournalMutation represents an operation that mutates the Journal nodes in the graph.
func (*JournalMutation) AddField ¶
func (m *JournalMutation) 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 (*JournalMutation) AddFoodweight ¶
func (m *JournalMutation) AddFoodweight(f float64)
AddFoodweight adds f to the "foodweight" field.
func (*JournalMutation) AddMeal ¶
func (m *JournalMutation) AddMeal(i int64)
AddMeal adds i to the "meal" field.
func (*JournalMutation) AddUserid ¶
func (m *JournalMutation) AddUserid(i int64)
AddUserid adds i to the "userid" field.
func (*JournalMutation) AddedEdges ¶
func (m *JournalMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*JournalMutation) AddedField ¶
func (m *JournalMutation) 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 (*JournalMutation) AddedFields ¶
func (m *JournalMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*JournalMutation) AddedFoodweight ¶
func (m *JournalMutation) AddedFoodweight() (r float64, exists bool)
AddedFoodweight returns the value that was added to the "foodweight" field in this mutation.
func (*JournalMutation) AddedIDs ¶
func (m *JournalMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*JournalMutation) AddedMeal ¶
func (m *JournalMutation) AddedMeal() (r int64, exists bool)
AddedMeal returns the value that was added to the "meal" field in this mutation.
func (*JournalMutation) AddedUserid ¶
func (m *JournalMutation) AddedUserid() (r int64, exists bool)
AddedUserid returns the value that was added to the "userid" field in this mutation.
func (*JournalMutation) ClearEdge ¶
func (m *JournalMutation) 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 (*JournalMutation) ClearField ¶
func (m *JournalMutation) 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 (*JournalMutation) ClearFood ¶
func (m *JournalMutation) ClearFood()
ClearFood clears the "food" edge to the Food entity.
func (*JournalMutation) ClearedEdges ¶
func (m *JournalMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*JournalMutation) ClearedFields ¶
func (m *JournalMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (JournalMutation) Client ¶
func (m JournalMutation) 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 (*JournalMutation) EdgeCleared ¶
func (m *JournalMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*JournalMutation) Field ¶
func (m *JournalMutation) 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 (*JournalMutation) FieldCleared ¶
func (m *JournalMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*JournalMutation) Fields ¶
func (m *JournalMutation) 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 (*JournalMutation) FoodCleared ¶
func (m *JournalMutation) FoodCleared() bool
FoodCleared reports if the "food" edge to the Food entity was cleared.
func (*JournalMutation) FoodID ¶
func (m *JournalMutation) FoodID() (id int, exists bool)
FoodID returns the "food" edge ID in the mutation.
func (*JournalMutation) FoodIDs ¶
func (m *JournalMutation) FoodIDs() (ids []int)
FoodIDs returns the "food" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use FoodID instead. It exists only for internal usage by the builders.
func (*JournalMutation) Foodweight ¶
func (m *JournalMutation) Foodweight() (r float64, exists bool)
Foodweight returns the value of the "foodweight" field in the mutation.
func (*JournalMutation) ID ¶
func (m *JournalMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*JournalMutation) IDs ¶
func (m *JournalMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*JournalMutation) Meal ¶
func (m *JournalMutation) Meal() (r int64, exists bool)
Meal returns the value of the "meal" field in the mutation.
func (*JournalMutation) 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 (*JournalMutation) OldFoodweight ¶
func (m *JournalMutation) OldFoodweight(ctx context.Context) (v float64, err error)
OldFoodweight returns the old "foodweight" field's value of the Journal entity. If the Journal 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 (*JournalMutation) OldMeal ¶
func (m *JournalMutation) OldMeal(ctx context.Context) (v int64, err error)
OldMeal returns the old "meal" field's value of the Journal entity. If the Journal 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 (*JournalMutation) OldTimestamp ¶
OldTimestamp returns the old "timestamp" field's value of the Journal entity. If the Journal 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 (*JournalMutation) OldUserid ¶
func (m *JournalMutation) OldUserid(ctx context.Context) (v int64, err error)
OldUserid returns the old "userid" field's value of the Journal entity. If the Journal 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 (*JournalMutation) RemovedEdges ¶
func (m *JournalMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*JournalMutation) RemovedIDs ¶
func (m *JournalMutation) 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 (*JournalMutation) ResetEdge ¶
func (m *JournalMutation) 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 (*JournalMutation) ResetField ¶
func (m *JournalMutation) 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 (*JournalMutation) ResetFood ¶
func (m *JournalMutation) ResetFood()
ResetFood resets all changes to the "food" edge.
func (*JournalMutation) ResetFoodweight ¶
func (m *JournalMutation) ResetFoodweight()
ResetFoodweight resets all changes to the "foodweight" field.
func (*JournalMutation) ResetMeal ¶
func (m *JournalMutation) ResetMeal()
ResetMeal resets all changes to the "meal" field.
func (*JournalMutation) ResetTimestamp ¶
func (m *JournalMutation) ResetTimestamp()
ResetTimestamp resets all changes to the "timestamp" field.
func (*JournalMutation) ResetUserid ¶
func (m *JournalMutation) ResetUserid()
ResetUserid resets all changes to the "userid" field.
func (*JournalMutation) SetField ¶
func (m *JournalMutation) 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 (*JournalMutation) SetFoodID ¶
func (m *JournalMutation) SetFoodID(id int)
SetFoodID sets the "food" edge to the Food entity by id.
func (*JournalMutation) SetFoodweight ¶
func (m *JournalMutation) SetFoodweight(f float64)
SetFoodweight sets the "foodweight" field.
func (*JournalMutation) SetMeal ¶
func (m *JournalMutation) SetMeal(i int64)
SetMeal sets the "meal" field.
func (*JournalMutation) SetOp ¶
func (m *JournalMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*JournalMutation) SetTimestamp ¶
func (m *JournalMutation) SetTimestamp(t time.Time)
SetTimestamp sets the "timestamp" field.
func (*JournalMutation) SetUserid ¶
func (m *JournalMutation) SetUserid(i int64)
SetUserid sets the "userid" field.
func (*JournalMutation) Timestamp ¶
func (m *JournalMutation) Timestamp() (r time.Time, exists bool)
Timestamp returns the value of the "timestamp" field in the mutation.
func (JournalMutation) Tx ¶
func (m JournalMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*JournalMutation) Type ¶
func (m *JournalMutation) Type() string
Type returns the node type of this mutation (Journal).
func (*JournalMutation) Userid ¶
func (m *JournalMutation) Userid() (r int64, exists bool)
Userid returns the value of the "userid" field in the mutation.
func (*JournalMutation) Where ¶
func (m *JournalMutation) Where(ps ...predicate.Journal)
Where appends a list predicates to the JournalMutation builder.
func (*JournalMutation) WhereP ¶
func (m *JournalMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the JournalMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type JournalQuery ¶
type JournalQuery struct {
// contains filtered or unexported fields
}
JournalQuery is the builder for querying Journal entities.
func (*JournalQuery) Aggregate ¶
func (jq *JournalQuery) Aggregate(fns ...AggregateFunc) *JournalSelect
Aggregate returns a JournalSelect configured with the given aggregations.
func (*JournalQuery) All ¶
func (jq *JournalQuery) All(ctx context.Context) ([]*Journal, error)
All executes the query and returns a list of Journals.
func (*JournalQuery) AllX ¶
func (jq *JournalQuery) AllX(ctx context.Context) []*Journal
AllX is like All, but panics if an error occurs.
func (*JournalQuery) Clone ¶
func (jq *JournalQuery) Clone() *JournalQuery
Clone returns a duplicate of the JournalQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*JournalQuery) Count ¶
func (jq *JournalQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*JournalQuery) CountX ¶
func (jq *JournalQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*JournalQuery) Exist ¶
func (jq *JournalQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*JournalQuery) ExistX ¶
func (jq *JournalQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*JournalQuery) First ¶
func (jq *JournalQuery) First(ctx context.Context) (*Journal, error)
First returns the first Journal entity from the query. Returns a *NotFoundError when no Journal was found.
func (*JournalQuery) FirstID ¶
func (jq *JournalQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Journal ID from the query. Returns a *NotFoundError when no Journal ID was found.
func (*JournalQuery) FirstIDX ¶
func (jq *JournalQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*JournalQuery) FirstX ¶
func (jq *JournalQuery) FirstX(ctx context.Context) *Journal
FirstX is like First, but panics if an error occurs.
func (*JournalQuery) GroupBy ¶
func (jq *JournalQuery) GroupBy(field string, fields ...string) *JournalGroupBy
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 { Userid int64 `json:"userid,omitempty"` Count int `json:"count,omitempty"` } client.Journal.Query(). GroupBy(journal.FieldUserid). Aggregate(ent.Count()). Scan(ctx, &v)
func (*JournalQuery) IDs ¶
func (jq *JournalQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Journal IDs.
func (*JournalQuery) IDsX ¶
func (jq *JournalQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*JournalQuery) Limit ¶
func (jq *JournalQuery) Limit(limit int) *JournalQuery
Limit the number of records to be returned by this query.
func (*JournalQuery) Modify ¶
func (jq *JournalQuery) Modify(modifiers ...func(s *sql.Selector)) *JournalSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*JournalQuery) Offset ¶
func (jq *JournalQuery) Offset(offset int) *JournalQuery
Offset to start from.
func (*JournalQuery) Only ¶
func (jq *JournalQuery) Only(ctx context.Context) (*Journal, error)
Only returns a single Journal entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Journal entity is found. Returns a *NotFoundError when no Journal entities are found.
func (*JournalQuery) OnlyID ¶
func (jq *JournalQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Journal ID in the query. Returns a *NotSingularError when more than one Journal ID is found. Returns a *NotFoundError when no entities are found.
func (*JournalQuery) OnlyIDX ¶
func (jq *JournalQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*JournalQuery) OnlyX ¶
func (jq *JournalQuery) OnlyX(ctx context.Context) *Journal
OnlyX is like Only, but panics if an error occurs.
func (*JournalQuery) Order ¶
func (jq *JournalQuery) Order(o ...journal.OrderOption) *JournalQuery
Order specifies how the records should be ordered.
func (*JournalQuery) QueryFood ¶
func (jq *JournalQuery) QueryFood() *FoodQuery
QueryFood chains the current query on the "food" edge.
func (*JournalQuery) Select ¶
func (jq *JournalQuery) Select(fields ...string) *JournalSelect
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 { Userid int64 `json:"userid,omitempty"` } client.Journal.Query(). Select(journal.FieldUserid). Scan(ctx, &v)
func (*JournalQuery) Unique ¶
func (jq *JournalQuery) Unique(unique bool) *JournalQuery
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 (*JournalQuery) Where ¶
func (jq *JournalQuery) Where(ps ...predicate.Journal) *JournalQuery
Where adds a new predicate for the JournalQuery builder.
func (*JournalQuery) WithFood ¶
func (jq *JournalQuery) WithFood(opts ...func(*FoodQuery)) *JournalQuery
WithFood tells the query-builder to eager-load the nodes that are connected to the "food" edge. The optional arguments are used to configure the query builder of the edge.
type JournalSelect ¶
type JournalSelect struct { *JournalQuery // contains filtered or unexported fields }
JournalSelect is the builder for selecting fields of Journal entities.
func (*JournalSelect) Aggregate ¶
func (js *JournalSelect) Aggregate(fns ...AggregateFunc) *JournalSelect
Aggregate adds the given aggregation functions to the selector query.
func (*JournalSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*JournalSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*JournalSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*JournalSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*JournalSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*JournalSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*JournalSelect) Modify ¶
func (js *JournalSelect) Modify(modifiers ...func(s *sql.Selector)) *JournalSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*JournalSelect) Scan ¶
func (js *JournalSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*JournalSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type JournalUpdate ¶
type JournalUpdate struct {
// contains filtered or unexported fields
}
JournalUpdate is the builder for updating Journal entities.
func (*JournalUpdate) AddFoodweight ¶
func (ju *JournalUpdate) AddFoodweight(f float64) *JournalUpdate
AddFoodweight adds f to the "foodweight" field.
func (*JournalUpdate) AddMeal ¶
func (ju *JournalUpdate) AddMeal(i int64) *JournalUpdate
AddMeal adds i to the "meal" field.
func (*JournalUpdate) AddUserid ¶
func (ju *JournalUpdate) AddUserid(i int64) *JournalUpdate
AddUserid adds i to the "userid" field.
func (*JournalUpdate) ClearFood ¶
func (ju *JournalUpdate) ClearFood() *JournalUpdate
ClearFood clears the "food" edge to the Food entity.
func (*JournalUpdate) Exec ¶
func (ju *JournalUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*JournalUpdate) ExecX ¶
func (ju *JournalUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JournalUpdate) Modify ¶
func (ju *JournalUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *JournalUpdate
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*JournalUpdate) Mutation ¶
func (ju *JournalUpdate) Mutation() *JournalMutation
Mutation returns the JournalMutation object of the builder.
func (*JournalUpdate) Save ¶
func (ju *JournalUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*JournalUpdate) SaveX ¶
func (ju *JournalUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*JournalUpdate) SetFood ¶
func (ju *JournalUpdate) SetFood(f *Food) *JournalUpdate
SetFood sets the "food" edge to the Food entity.
func (*JournalUpdate) SetFoodID ¶
func (ju *JournalUpdate) SetFoodID(id int) *JournalUpdate
SetFoodID sets the "food" edge to the Food entity by ID.
func (*JournalUpdate) SetFoodweight ¶
func (ju *JournalUpdate) SetFoodweight(f float64) *JournalUpdate
SetFoodweight sets the "foodweight" field.
func (*JournalUpdate) SetMeal ¶
func (ju *JournalUpdate) SetMeal(i int64) *JournalUpdate
SetMeal sets the "meal" field.
func (*JournalUpdate) SetNillableFoodweight ¶
func (ju *JournalUpdate) SetNillableFoodweight(f *float64) *JournalUpdate
SetNillableFoodweight sets the "foodweight" field if the given value is not nil.
func (*JournalUpdate) SetNillableMeal ¶
func (ju *JournalUpdate) SetNillableMeal(i *int64) *JournalUpdate
SetNillableMeal sets the "meal" field if the given value is not nil.
func (*JournalUpdate) SetNillableTimestamp ¶
func (ju *JournalUpdate) SetNillableTimestamp(t *time.Time) *JournalUpdate
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*JournalUpdate) SetNillableUserid ¶
func (ju *JournalUpdate) SetNillableUserid(i *int64) *JournalUpdate
SetNillableUserid sets the "userid" field if the given value is not nil.
func (*JournalUpdate) SetTimestamp ¶
func (ju *JournalUpdate) SetTimestamp(t time.Time) *JournalUpdate
SetTimestamp sets the "timestamp" field.
func (*JournalUpdate) SetUserid ¶
func (ju *JournalUpdate) SetUserid(i int64) *JournalUpdate
SetUserid sets the "userid" field.
func (*JournalUpdate) Where ¶
func (ju *JournalUpdate) Where(ps ...predicate.Journal) *JournalUpdate
Where appends a list predicates to the JournalUpdate builder.
type JournalUpdateOne ¶
type JournalUpdateOne struct {
// contains filtered or unexported fields
}
JournalUpdateOne is the builder for updating a single Journal entity.
func (*JournalUpdateOne) AddFoodweight ¶
func (juo *JournalUpdateOne) AddFoodweight(f float64) *JournalUpdateOne
AddFoodweight adds f to the "foodweight" field.
func (*JournalUpdateOne) AddMeal ¶
func (juo *JournalUpdateOne) AddMeal(i int64) *JournalUpdateOne
AddMeal adds i to the "meal" field.
func (*JournalUpdateOne) AddUserid ¶
func (juo *JournalUpdateOne) AddUserid(i int64) *JournalUpdateOne
AddUserid adds i to the "userid" field.
func (*JournalUpdateOne) ClearFood ¶
func (juo *JournalUpdateOne) ClearFood() *JournalUpdateOne
ClearFood clears the "food" edge to the Food entity.
func (*JournalUpdateOne) Exec ¶
func (juo *JournalUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*JournalUpdateOne) ExecX ¶
func (juo *JournalUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JournalUpdateOne) Modify ¶
func (juo *JournalUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *JournalUpdateOne
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*JournalUpdateOne) Mutation ¶
func (juo *JournalUpdateOne) Mutation() *JournalMutation
Mutation returns the JournalMutation object of the builder.
func (*JournalUpdateOne) Save ¶
func (juo *JournalUpdateOne) Save(ctx context.Context) (*Journal, error)
Save executes the query and returns the updated Journal entity.
func (*JournalUpdateOne) SaveX ¶
func (juo *JournalUpdateOne) SaveX(ctx context.Context) *Journal
SaveX is like Save, but panics if an error occurs.
func (*JournalUpdateOne) Select ¶
func (juo *JournalUpdateOne) Select(field string, fields ...string) *JournalUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*JournalUpdateOne) SetFood ¶
func (juo *JournalUpdateOne) SetFood(f *Food) *JournalUpdateOne
SetFood sets the "food" edge to the Food entity.
func (*JournalUpdateOne) SetFoodID ¶
func (juo *JournalUpdateOne) SetFoodID(id int) *JournalUpdateOne
SetFoodID sets the "food" edge to the Food entity by ID.
func (*JournalUpdateOne) SetFoodweight ¶
func (juo *JournalUpdateOne) SetFoodweight(f float64) *JournalUpdateOne
SetFoodweight sets the "foodweight" field.
func (*JournalUpdateOne) SetMeal ¶
func (juo *JournalUpdateOne) SetMeal(i int64) *JournalUpdateOne
SetMeal sets the "meal" field.
func (*JournalUpdateOne) SetNillableFoodweight ¶
func (juo *JournalUpdateOne) SetNillableFoodweight(f *float64) *JournalUpdateOne
SetNillableFoodweight sets the "foodweight" field if the given value is not nil.
func (*JournalUpdateOne) SetNillableMeal ¶
func (juo *JournalUpdateOne) SetNillableMeal(i *int64) *JournalUpdateOne
SetNillableMeal sets the "meal" field if the given value is not nil.
func (*JournalUpdateOne) SetNillableTimestamp ¶
func (juo *JournalUpdateOne) SetNillableTimestamp(t *time.Time) *JournalUpdateOne
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*JournalUpdateOne) SetNillableUserid ¶
func (juo *JournalUpdateOne) SetNillableUserid(i *int64) *JournalUpdateOne
SetNillableUserid sets the "userid" field if the given value is not nil.
func (*JournalUpdateOne) SetTimestamp ¶
func (juo *JournalUpdateOne) SetTimestamp(t time.Time) *JournalUpdateOne
SetTimestamp sets the "timestamp" field.
func (*JournalUpdateOne) SetUserid ¶
func (juo *JournalUpdateOne) SetUserid(i int64) *JournalUpdateOne
SetUserid sets the "userid" field.
func (*JournalUpdateOne) Where ¶
func (juo *JournalUpdateOne) Where(ps ...predicate.Journal) *JournalUpdateOne
Where appends a list predicates to the JournalUpdate builder.
type JournalUpsert ¶
JournalUpsert is the "OnConflict" setter.
func (*JournalUpsert) AddFoodweight ¶
func (u *JournalUpsert) AddFoodweight(v float64) *JournalUpsert
AddFoodweight adds v to the "foodweight" field.
func (*JournalUpsert) AddMeal ¶
func (u *JournalUpsert) AddMeal(v int64) *JournalUpsert
AddMeal adds v to the "meal" field.
func (*JournalUpsert) AddUserid ¶
func (u *JournalUpsert) AddUserid(v int64) *JournalUpsert
AddUserid adds v to the "userid" field.
func (*JournalUpsert) SetFoodweight ¶
func (u *JournalUpsert) SetFoodweight(v float64) *JournalUpsert
SetFoodweight sets the "foodweight" field.
func (*JournalUpsert) SetMeal ¶
func (u *JournalUpsert) SetMeal(v int64) *JournalUpsert
SetMeal sets the "meal" field.
func (*JournalUpsert) SetTimestamp ¶
func (u *JournalUpsert) SetTimestamp(v time.Time) *JournalUpsert
SetTimestamp sets the "timestamp" field.
func (*JournalUpsert) SetUserid ¶
func (u *JournalUpsert) SetUserid(v int64) *JournalUpsert
SetUserid sets the "userid" field.
func (*JournalUpsert) UpdateFoodweight ¶
func (u *JournalUpsert) UpdateFoodweight() *JournalUpsert
UpdateFoodweight sets the "foodweight" field to the value that was provided on create.
func (*JournalUpsert) UpdateMeal ¶
func (u *JournalUpsert) UpdateMeal() *JournalUpsert
UpdateMeal sets the "meal" field to the value that was provided on create.
func (*JournalUpsert) UpdateTimestamp ¶
func (u *JournalUpsert) UpdateTimestamp() *JournalUpsert
UpdateTimestamp sets the "timestamp" field to the value that was provided on create.
func (*JournalUpsert) UpdateUserid ¶
func (u *JournalUpsert) UpdateUserid() *JournalUpsert
UpdateUserid sets the "userid" field to the value that was provided on create.
type JournalUpsertBulk ¶
type JournalUpsertBulk struct {
// contains filtered or unexported fields
}
JournalUpsertBulk is the builder for "upsert"-ing a bulk of Journal nodes.
func (*JournalUpsertBulk) AddFoodweight ¶
func (u *JournalUpsertBulk) AddFoodweight(v float64) *JournalUpsertBulk
AddFoodweight adds v to the "foodweight" field.
func (*JournalUpsertBulk) AddMeal ¶
func (u *JournalUpsertBulk) AddMeal(v int64) *JournalUpsertBulk
AddMeal adds v to the "meal" field.
func (*JournalUpsertBulk) AddUserid ¶
func (u *JournalUpsertBulk) AddUserid(v int64) *JournalUpsertBulk
AddUserid adds v to the "userid" field.
func (*JournalUpsertBulk) DoNothing ¶
func (u *JournalUpsertBulk) DoNothing() *JournalUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*JournalUpsertBulk) Exec ¶
func (u *JournalUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*JournalUpsertBulk) ExecX ¶
func (u *JournalUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JournalUpsertBulk) Ignore ¶
func (u *JournalUpsertBulk) Ignore() *JournalUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Journal.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*JournalUpsertBulk) SetFoodweight ¶
func (u *JournalUpsertBulk) SetFoodweight(v float64) *JournalUpsertBulk
SetFoodweight sets the "foodweight" field.
func (*JournalUpsertBulk) SetMeal ¶
func (u *JournalUpsertBulk) SetMeal(v int64) *JournalUpsertBulk
SetMeal sets the "meal" field.
func (*JournalUpsertBulk) SetTimestamp ¶
func (u *JournalUpsertBulk) SetTimestamp(v time.Time) *JournalUpsertBulk
SetTimestamp sets the "timestamp" field.
func (*JournalUpsertBulk) SetUserid ¶
func (u *JournalUpsertBulk) SetUserid(v int64) *JournalUpsertBulk
SetUserid sets the "userid" field.
func (*JournalUpsertBulk) Update ¶
func (u *JournalUpsertBulk) Update(set func(*JournalUpsert)) *JournalUpsertBulk
Update allows overriding fields `UPDATE` values. See the JournalCreateBulk.OnConflict documentation for more info.
func (*JournalUpsertBulk) UpdateFoodweight ¶
func (u *JournalUpsertBulk) UpdateFoodweight() *JournalUpsertBulk
UpdateFoodweight sets the "foodweight" field to the value that was provided on create.
func (*JournalUpsertBulk) UpdateMeal ¶
func (u *JournalUpsertBulk) UpdateMeal() *JournalUpsertBulk
UpdateMeal sets the "meal" field to the value that was provided on create.
func (*JournalUpsertBulk) UpdateNewValues ¶
func (u *JournalUpsertBulk) UpdateNewValues() *JournalUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Journal.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*JournalUpsertBulk) UpdateTimestamp ¶
func (u *JournalUpsertBulk) UpdateTimestamp() *JournalUpsertBulk
UpdateTimestamp sets the "timestamp" field to the value that was provided on create.
func (*JournalUpsertBulk) UpdateUserid ¶
func (u *JournalUpsertBulk) UpdateUserid() *JournalUpsertBulk
UpdateUserid sets the "userid" field to the value that was provided on create.
type JournalUpsertOne ¶
type JournalUpsertOne struct {
// contains filtered or unexported fields
}
JournalUpsertOne is the builder for "upsert"-ing
one Journal node.
func (*JournalUpsertOne) AddFoodweight ¶
func (u *JournalUpsertOne) AddFoodweight(v float64) *JournalUpsertOne
AddFoodweight adds v to the "foodweight" field.
func (*JournalUpsertOne) AddMeal ¶
func (u *JournalUpsertOne) AddMeal(v int64) *JournalUpsertOne
AddMeal adds v to the "meal" field.
func (*JournalUpsertOne) AddUserid ¶
func (u *JournalUpsertOne) AddUserid(v int64) *JournalUpsertOne
AddUserid adds v to the "userid" field.
func (*JournalUpsertOne) DoNothing ¶
func (u *JournalUpsertOne) DoNothing() *JournalUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*JournalUpsertOne) Exec ¶
func (u *JournalUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*JournalUpsertOne) ExecX ¶
func (u *JournalUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*JournalUpsertOne) ID ¶
func (u *JournalUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*JournalUpsertOne) IDX ¶
func (u *JournalUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*JournalUpsertOne) Ignore ¶
func (u *JournalUpsertOne) Ignore() *JournalUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Journal.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*JournalUpsertOne) SetFoodweight ¶
func (u *JournalUpsertOne) SetFoodweight(v float64) *JournalUpsertOne
SetFoodweight sets the "foodweight" field.
func (*JournalUpsertOne) SetMeal ¶
func (u *JournalUpsertOne) SetMeal(v int64) *JournalUpsertOne
SetMeal sets the "meal" field.
func (*JournalUpsertOne) SetTimestamp ¶
func (u *JournalUpsertOne) SetTimestamp(v time.Time) *JournalUpsertOne
SetTimestamp sets the "timestamp" field.
func (*JournalUpsertOne) SetUserid ¶
func (u *JournalUpsertOne) SetUserid(v int64) *JournalUpsertOne
SetUserid sets the "userid" field.
func (*JournalUpsertOne) Update ¶
func (u *JournalUpsertOne) Update(set func(*JournalUpsert)) *JournalUpsertOne
Update allows overriding fields `UPDATE` values. See the JournalCreate.OnConflict documentation for more info.
func (*JournalUpsertOne) UpdateFoodweight ¶
func (u *JournalUpsertOne) UpdateFoodweight() *JournalUpsertOne
UpdateFoodweight sets the "foodweight" field to the value that was provided on create.
func (*JournalUpsertOne) UpdateMeal ¶
func (u *JournalUpsertOne) UpdateMeal() *JournalUpsertOne
UpdateMeal sets the "meal" field to the value that was provided on create.
func (*JournalUpsertOne) UpdateNewValues ¶
func (u *JournalUpsertOne) UpdateNewValues() *JournalUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Journal.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*JournalUpsertOne) UpdateTimestamp ¶
func (u *JournalUpsertOne) UpdateTimestamp() *JournalUpsertOne
UpdateTimestamp sets the "timestamp" field to the value that was provided on create.
func (*JournalUpsertOne) UpdateUserid ¶
func (u *JournalUpsertOne) UpdateUserid() *JournalUpsertOne
UpdateUserid sets the "userid" field to the value that was provided on create.
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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
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 { // Activity is the client for interacting with the Activity builders. Activity *ActivityClient // Bundle is the client for interacting with the Bundle builders. Bundle *BundleClient // Food is the client for interacting with the Food builders. Food *FoodClient // Journal is the client for interacting with the Journal builders. Journal *JournalClient // UserSettings is the client for interacting with the UserSettings builders. UserSettings *UserSettingsClient // Weight is the client for interacting with the Weight builders. Weight *WeightClient // 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 UserSettings ¶
type UserSettings struct { // ID of the ent. ID int `json:"id,omitempty"` // Userid holds the value of the "userid" field. Userid int64 `json:"userid,omitempty"` // CalLimit holds the value of the "cal_limit" field. CalLimit float64 `json:"cal_limit,omitempty"` // DefaultActiveCal holds the value of the "default_active_cal" field. DefaultActiveCal float64 `json:"default_active_cal,omitempty"` // contains filtered or unexported fields }
UserSettings is the model entity for the UserSettings schema.
func (*UserSettings) String ¶
func (us *UserSettings) String() string
String implements the fmt.Stringer.
func (*UserSettings) Unwrap ¶
func (us *UserSettings) Unwrap() *UserSettings
Unwrap unwraps the UserSettings 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 (*UserSettings) Update ¶
func (us *UserSettings) Update() *UserSettingsUpdateOne
Update returns a builder for updating this UserSettings. Note that you need to call UserSettings.Unwrap() before calling this method if this UserSettings was returned from a transaction, and the transaction was committed or rolled back.
type UserSettingsClient ¶
type UserSettingsClient struct {
// contains filtered or unexported fields
}
UserSettingsClient is a client for the UserSettings schema.
func NewUserSettingsClient ¶
func NewUserSettingsClient(c config) *UserSettingsClient
NewUserSettingsClient returns a client for the UserSettings from the given config.
func (*UserSettingsClient) Create ¶
func (c *UserSettingsClient) Create() *UserSettingsCreate
Create returns a builder for creating a UserSettings entity.
func (*UserSettingsClient) CreateBulk ¶
func (c *UserSettingsClient) CreateBulk(builders ...*UserSettingsCreate) *UserSettingsCreateBulk
CreateBulk returns a builder for creating a bulk of UserSettings entities.
func (*UserSettingsClient) Delete ¶
func (c *UserSettingsClient) Delete() *UserSettingsDelete
Delete returns a delete builder for UserSettings.
func (*UserSettingsClient) DeleteOne ¶
func (c *UserSettingsClient) DeleteOne(us *UserSettings) *UserSettingsDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserSettingsClient) DeleteOneID ¶
func (c *UserSettingsClient) DeleteOneID(id int) *UserSettingsDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserSettingsClient) Get ¶
func (c *UserSettingsClient) Get(ctx context.Context, id int) (*UserSettings, error)
Get returns a UserSettings entity by its id.
func (*UserSettingsClient) GetX ¶
func (c *UserSettingsClient) GetX(ctx context.Context, id int) *UserSettings
GetX is like Get, but panics if an error occurs.
func (*UserSettingsClient) Hooks ¶
func (c *UserSettingsClient) Hooks() []Hook
Hooks returns the client hooks.
func (*UserSettingsClient) Intercept ¶
func (c *UserSettingsClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `usersettings.Intercept(f(g(h())))`.
func (*UserSettingsClient) Interceptors ¶
func (c *UserSettingsClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserSettingsClient) MapCreateBulk ¶
func (c *UserSettingsClient) MapCreateBulk(slice any, setFunc func(*UserSettingsCreate, int)) *UserSettingsCreateBulk
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 (*UserSettingsClient) Query ¶
func (c *UserSettingsClient) Query() *UserSettingsQuery
Query returns a query builder for UserSettings.
func (*UserSettingsClient) Update ¶
func (c *UserSettingsClient) Update() *UserSettingsUpdate
Update returns an update builder for UserSettings.
func (*UserSettingsClient) UpdateOne ¶
func (c *UserSettingsClient) UpdateOne(us *UserSettings) *UserSettingsUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserSettingsClient) UpdateOneID ¶
func (c *UserSettingsClient) UpdateOneID(id int) *UserSettingsUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserSettingsClient) Use ¶
func (c *UserSettingsClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `usersettings.Hooks(f(g(h())))`.
type UserSettingsCreate ¶
type UserSettingsCreate struct {
// contains filtered or unexported fields
}
UserSettingsCreate is the builder for creating a UserSettings entity.
func (*UserSettingsCreate) Exec ¶
func (usc *UserSettingsCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserSettingsCreate) ExecX ¶
func (usc *UserSettingsCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSettingsCreate) Mutation ¶
func (usc *UserSettingsCreate) Mutation() *UserSettingsMutation
Mutation returns the UserSettingsMutation object of the builder.
func (*UserSettingsCreate) OnConflict ¶
func (usc *UserSettingsCreate) OnConflict(opts ...sql.ConflictOption) *UserSettingsUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.UserSettings.Create(). SetUserid(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.UserSettingsUpsert) { SetUserid(v+v). }). Exec(ctx)
func (*UserSettingsCreate) OnConflictColumns ¶
func (usc *UserSettingsCreate) OnConflictColumns(columns ...string) *UserSettingsUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.UserSettings.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*UserSettingsCreate) Save ¶
func (usc *UserSettingsCreate) Save(ctx context.Context) (*UserSettings, error)
Save creates the UserSettings in the database.
func (*UserSettingsCreate) SaveX ¶
func (usc *UserSettingsCreate) SaveX(ctx context.Context) *UserSettings
SaveX calls Save and panics if Save returns an error.
func (*UserSettingsCreate) SetCalLimit ¶
func (usc *UserSettingsCreate) SetCalLimit(f float64) *UserSettingsCreate
SetCalLimit sets the "cal_limit" field.
func (*UserSettingsCreate) SetDefaultActiveCal ¶
func (usc *UserSettingsCreate) SetDefaultActiveCal(f float64) *UserSettingsCreate
SetDefaultActiveCal sets the "default_active_cal" field.
func (*UserSettingsCreate) SetUserid ¶
func (usc *UserSettingsCreate) SetUserid(i int64) *UserSettingsCreate
SetUserid sets the "userid" field.
type UserSettingsCreateBulk ¶
type UserSettingsCreateBulk struct {
// contains filtered or unexported fields
}
UserSettingsCreateBulk is the builder for creating many UserSettings entities in bulk.
func (*UserSettingsCreateBulk) Exec ¶
func (uscb *UserSettingsCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserSettingsCreateBulk) ExecX ¶
func (uscb *UserSettingsCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSettingsCreateBulk) OnConflict ¶
func (uscb *UserSettingsCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserSettingsUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.UserSettings.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.UserSettingsUpsert) { SetUserid(v+v). }). Exec(ctx)
func (*UserSettingsCreateBulk) OnConflictColumns ¶
func (uscb *UserSettingsCreateBulk) OnConflictColumns(columns ...string) *UserSettingsUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.UserSettings.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*UserSettingsCreateBulk) Save ¶
func (uscb *UserSettingsCreateBulk) Save(ctx context.Context) ([]*UserSettings, error)
Save creates the UserSettings entities in the database.
func (*UserSettingsCreateBulk) SaveX ¶
func (uscb *UserSettingsCreateBulk) SaveX(ctx context.Context) []*UserSettings
SaveX is like Save, but panics if an error occurs.
type UserSettingsDelete ¶
type UserSettingsDelete struct {
// contains filtered or unexported fields
}
UserSettingsDelete is the builder for deleting a UserSettings entity.
func (*UserSettingsDelete) Exec ¶
func (usd *UserSettingsDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserSettingsDelete) ExecX ¶
func (usd *UserSettingsDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserSettingsDelete) Where ¶
func (usd *UserSettingsDelete) Where(ps ...predicate.UserSettings) *UserSettingsDelete
Where appends a list predicates to the UserSettingsDelete builder.
type UserSettingsDeleteOne ¶
type UserSettingsDeleteOne struct {
// contains filtered or unexported fields
}
UserSettingsDeleteOne is the builder for deleting a single UserSettings entity.
func (*UserSettingsDeleteOne) Exec ¶
func (usdo *UserSettingsDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserSettingsDeleteOne) ExecX ¶
func (usdo *UserSettingsDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSettingsDeleteOne) Where ¶
func (usdo *UserSettingsDeleteOne) Where(ps ...predicate.UserSettings) *UserSettingsDeleteOne
Where appends a list predicates to the UserSettingsDelete builder.
type UserSettingsGroupBy ¶
type UserSettingsGroupBy struct {
// contains filtered or unexported fields
}
UserSettingsGroupBy is the group-by builder for UserSettings entities.
func (*UserSettingsGroupBy) Aggregate ¶
func (usgb *UserSettingsGroupBy) Aggregate(fns ...AggregateFunc) *UserSettingsGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserSettingsGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSettingsGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSettingsGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSettingsGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSettingsGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSettingsGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSettingsGroupBy) Scan ¶
func (usgb *UserSettingsGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSettingsGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserSettingsMutation ¶
type UserSettingsMutation struct {
// contains filtered or unexported fields
}
UserSettingsMutation represents an operation that mutates the UserSettings nodes in the graph.
func (*UserSettingsMutation) AddCalLimit ¶
func (m *UserSettingsMutation) AddCalLimit(f float64)
AddCalLimit adds f to the "cal_limit" field.
func (*UserSettingsMutation) AddDefaultActiveCal ¶
func (m *UserSettingsMutation) AddDefaultActiveCal(f float64)
AddDefaultActiveCal adds f to the "default_active_cal" field.
func (*UserSettingsMutation) AddField ¶
func (m *UserSettingsMutation) 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 (*UserSettingsMutation) AddUserid ¶
func (m *UserSettingsMutation) AddUserid(i int64)
AddUserid adds i to the "userid" field.
func (*UserSettingsMutation) AddedCalLimit ¶
func (m *UserSettingsMutation) AddedCalLimit() (r float64, exists bool)
AddedCalLimit returns the value that was added to the "cal_limit" field in this mutation.
func (*UserSettingsMutation) AddedDefaultActiveCal ¶
func (m *UserSettingsMutation) AddedDefaultActiveCal() (r float64, exists bool)
AddedDefaultActiveCal returns the value that was added to the "default_active_cal" field in this mutation.
func (*UserSettingsMutation) AddedEdges ¶
func (m *UserSettingsMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserSettingsMutation) AddedField ¶
func (m *UserSettingsMutation) 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 (*UserSettingsMutation) AddedFields ¶
func (m *UserSettingsMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserSettingsMutation) AddedIDs ¶
func (m *UserSettingsMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserSettingsMutation) AddedUserid ¶
func (m *UserSettingsMutation) AddedUserid() (r int64, exists bool)
AddedUserid returns the value that was added to the "userid" field in this mutation.
func (*UserSettingsMutation) CalLimit ¶
func (m *UserSettingsMutation) CalLimit() (r float64, exists bool)
CalLimit returns the value of the "cal_limit" field in the mutation.
func (*UserSettingsMutation) ClearEdge ¶
func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ClearField ¶
func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ClearedEdges ¶
func (m *UserSettingsMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserSettingsMutation) ClearedFields ¶
func (m *UserSettingsMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserSettingsMutation) Client ¶
func (m UserSettingsMutation) 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 (*UserSettingsMutation) DefaultActiveCal ¶
func (m *UserSettingsMutation) DefaultActiveCal() (r float64, exists bool)
DefaultActiveCal returns the value of the "default_active_cal" field in the mutation.
func (*UserSettingsMutation) EdgeCleared ¶
func (m *UserSettingsMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserSettingsMutation) Field ¶
func (m *UserSettingsMutation) 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 (*UserSettingsMutation) FieldCleared ¶
func (m *UserSettingsMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserSettingsMutation) Fields ¶
func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ID ¶
func (m *UserSettingsMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserSettingsMutation) IDs ¶
func (m *UserSettingsMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserSettingsMutation) OldCalLimit ¶
func (m *UserSettingsMutation) OldCalLimit(ctx context.Context) (v float64, err error)
OldCalLimit returns the old "cal_limit" field's value of the UserSettings entity. If the UserSettings 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 (*UserSettingsMutation) OldDefaultActiveCal ¶
func (m *UserSettingsMutation) OldDefaultActiveCal(ctx context.Context) (v float64, err error)
OldDefaultActiveCal returns the old "default_active_cal" field's value of the UserSettings entity. If the UserSettings 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 (*UserSettingsMutation) 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 (*UserSettingsMutation) OldUserid ¶
func (m *UserSettingsMutation) OldUserid(ctx context.Context) (v int64, err error)
OldUserid returns the old "userid" field's value of the UserSettings entity. If the UserSettings 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 (*UserSettingsMutation) Op ¶
func (m *UserSettingsMutation) Op() Op
Op returns the operation name.
func (*UserSettingsMutation) RemovedEdges ¶
func (m *UserSettingsMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserSettingsMutation) RemovedIDs ¶
func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ResetCalLimit ¶
func (m *UserSettingsMutation) ResetCalLimit()
ResetCalLimit resets all changes to the "cal_limit" field.
func (*UserSettingsMutation) ResetDefaultActiveCal ¶
func (m *UserSettingsMutation) ResetDefaultActiveCal()
ResetDefaultActiveCal resets all changes to the "default_active_cal" field.
func (*UserSettingsMutation) ResetEdge ¶
func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ResetField ¶
func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ResetUserid ¶
func (m *UserSettingsMutation) ResetUserid()
ResetUserid resets all changes to the "userid" field.
func (*UserSettingsMutation) SetCalLimit ¶
func (m *UserSettingsMutation) SetCalLimit(f float64)
SetCalLimit sets the "cal_limit" field.
func (*UserSettingsMutation) SetDefaultActiveCal ¶
func (m *UserSettingsMutation) SetDefaultActiveCal(f float64)
SetDefaultActiveCal sets the "default_active_cal" field.
func (*UserSettingsMutation) SetField ¶
func (m *UserSettingsMutation) 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 (*UserSettingsMutation) SetOp ¶
func (m *UserSettingsMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserSettingsMutation) SetUserid ¶
func (m *UserSettingsMutation) SetUserid(i int64)
SetUserid sets the "userid" field.
func (UserSettingsMutation) Tx ¶
func (m UserSettingsMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserSettingsMutation) Type ¶
func (m *UserSettingsMutation) Type() string
Type returns the node type of this mutation (UserSettings).
func (*UserSettingsMutation) Userid ¶
func (m *UserSettingsMutation) Userid() (r int64, exists bool)
Userid returns the value of the "userid" field in the mutation.
func (*UserSettingsMutation) Where ¶
func (m *UserSettingsMutation) Where(ps ...predicate.UserSettings)
Where appends a list predicates to the UserSettingsMutation builder.
func (*UserSettingsMutation) WhereP ¶
func (m *UserSettingsMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserSettingsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserSettingsQuery ¶
type UserSettingsQuery struct {
// contains filtered or unexported fields
}
UserSettingsQuery is the builder for querying UserSettings entities.
func (*UserSettingsQuery) Aggregate ¶
func (usq *UserSettingsQuery) Aggregate(fns ...AggregateFunc) *UserSettingsSelect
Aggregate returns a UserSettingsSelect configured with the given aggregations.
func (*UserSettingsQuery) All ¶
func (usq *UserSettingsQuery) All(ctx context.Context) ([]*UserSettings, error)
All executes the query and returns a list of UserSettingsSlice.
func (*UserSettingsQuery) AllX ¶
func (usq *UserSettingsQuery) AllX(ctx context.Context) []*UserSettings
AllX is like All, but panics if an error occurs.
func (*UserSettingsQuery) Clone ¶
func (usq *UserSettingsQuery) Clone() *UserSettingsQuery
Clone returns a duplicate of the UserSettingsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserSettingsQuery) Count ¶
func (usq *UserSettingsQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*UserSettingsQuery) CountX ¶
func (usq *UserSettingsQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*UserSettingsQuery) Exist ¶
func (usq *UserSettingsQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*UserSettingsQuery) ExistX ¶
func (usq *UserSettingsQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*UserSettingsQuery) First ¶
func (usq *UserSettingsQuery) First(ctx context.Context) (*UserSettings, error)
First returns the first UserSettings entity from the query. Returns a *NotFoundError when no UserSettings was found.
func (*UserSettingsQuery) FirstID ¶
func (usq *UserSettingsQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first UserSettings ID from the query. Returns a *NotFoundError when no UserSettings ID was found.
func (*UserSettingsQuery) FirstIDX ¶
func (usq *UserSettingsQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*UserSettingsQuery) FirstX ¶
func (usq *UserSettingsQuery) FirstX(ctx context.Context) *UserSettings
FirstX is like First, but panics if an error occurs.
func (*UserSettingsQuery) GroupBy ¶
func (usq *UserSettingsQuery) GroupBy(field string, fields ...string) *UserSettingsGroupBy
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 { Userid int64 `json:"userid,omitempty"` Count int `json:"count,omitempty"` } client.UserSettings.Query(). GroupBy(usersettings.FieldUserid). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserSettingsQuery) IDs ¶
func (usq *UserSettingsQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of UserSettings IDs.
func (*UserSettingsQuery) IDsX ¶
func (usq *UserSettingsQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*UserSettingsQuery) Limit ¶
func (usq *UserSettingsQuery) Limit(limit int) *UserSettingsQuery
Limit the number of records to be returned by this query.
func (*UserSettingsQuery) Modify ¶
func (usq *UserSettingsQuery) Modify(modifiers ...func(s *sql.Selector)) *UserSettingsSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*UserSettingsQuery) Offset ¶
func (usq *UserSettingsQuery) Offset(offset int) *UserSettingsQuery
Offset to start from.
func (*UserSettingsQuery) Only ¶
func (usq *UserSettingsQuery) Only(ctx context.Context) (*UserSettings, error)
Only returns a single UserSettings entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserSettings entity is found. Returns a *NotFoundError when no UserSettings entities are found.
func (*UserSettingsQuery) OnlyID ¶
func (usq *UserSettingsQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only UserSettings ID in the query. Returns a *NotSingularError when more than one UserSettings ID is found. Returns a *NotFoundError when no entities are found.
func (*UserSettingsQuery) OnlyIDX ¶
func (usq *UserSettingsQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*UserSettingsQuery) OnlyX ¶
func (usq *UserSettingsQuery) OnlyX(ctx context.Context) *UserSettings
OnlyX is like Only, but panics if an error occurs.
func (*UserSettingsQuery) Order ¶
func (usq *UserSettingsQuery) Order(o ...usersettings.OrderOption) *UserSettingsQuery
Order specifies how the records should be ordered.
func (*UserSettingsQuery) Select ¶
func (usq *UserSettingsQuery) Select(fields ...string) *UserSettingsSelect
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 { Userid int64 `json:"userid,omitempty"` } client.UserSettings.Query(). Select(usersettings.FieldUserid). Scan(ctx, &v)
func (*UserSettingsQuery) Unique ¶
func (usq *UserSettingsQuery) Unique(unique bool) *UserSettingsQuery
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 (*UserSettingsQuery) Where ¶
func (usq *UserSettingsQuery) Where(ps ...predicate.UserSettings) *UserSettingsQuery
Where adds a new predicate for the UserSettingsQuery builder.
type UserSettingsSelect ¶
type UserSettingsSelect struct { *UserSettingsQuery // contains filtered or unexported fields }
UserSettingsSelect is the builder for selecting fields of UserSettings entities.
func (*UserSettingsSelect) Aggregate ¶
func (uss *UserSettingsSelect) Aggregate(fns ...AggregateFunc) *UserSettingsSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSettingsSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSettingsSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSettingsSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSettingsSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSettingsSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSettingsSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSettingsSelect) Modify ¶
func (uss *UserSettingsSelect) Modify(modifiers ...func(s *sql.Selector)) *UserSettingsSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*UserSettingsSelect) Scan ¶
func (uss *UserSettingsSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSettingsSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserSettingsSlice ¶
type UserSettingsSlice []*UserSettings
UserSettingsSlice is a parsable slice of UserSettings.
type UserSettingsUpdate ¶
type UserSettingsUpdate struct {
// contains filtered or unexported fields
}
UserSettingsUpdate is the builder for updating UserSettings entities.
func (*UserSettingsUpdate) AddCalLimit ¶
func (usu *UserSettingsUpdate) AddCalLimit(f float64) *UserSettingsUpdate
AddCalLimit adds f to the "cal_limit" field.
func (*UserSettingsUpdate) AddDefaultActiveCal ¶
func (usu *UserSettingsUpdate) AddDefaultActiveCal(f float64) *UserSettingsUpdate
AddDefaultActiveCal adds f to the "default_active_cal" field.
func (*UserSettingsUpdate) AddUserid ¶
func (usu *UserSettingsUpdate) AddUserid(i int64) *UserSettingsUpdate
AddUserid adds i to the "userid" field.
func (*UserSettingsUpdate) Exec ¶
func (usu *UserSettingsUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserSettingsUpdate) ExecX ¶
func (usu *UserSettingsUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSettingsUpdate) Modify ¶
func (usu *UserSettingsUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserSettingsUpdate
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*UserSettingsUpdate) Mutation ¶
func (usu *UserSettingsUpdate) Mutation() *UserSettingsMutation
Mutation returns the UserSettingsMutation object of the builder.
func (*UserSettingsUpdate) Save ¶
func (usu *UserSettingsUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserSettingsUpdate) SaveX ¶
func (usu *UserSettingsUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserSettingsUpdate) SetCalLimit ¶
func (usu *UserSettingsUpdate) SetCalLimit(f float64) *UserSettingsUpdate
SetCalLimit sets the "cal_limit" field.
func (*UserSettingsUpdate) SetDefaultActiveCal ¶
func (usu *UserSettingsUpdate) SetDefaultActiveCal(f float64) *UserSettingsUpdate
SetDefaultActiveCal sets the "default_active_cal" field.
func (*UserSettingsUpdate) SetNillableCalLimit ¶
func (usu *UserSettingsUpdate) SetNillableCalLimit(f *float64) *UserSettingsUpdate
SetNillableCalLimit sets the "cal_limit" field if the given value is not nil.
func (*UserSettingsUpdate) SetNillableDefaultActiveCal ¶
func (usu *UserSettingsUpdate) SetNillableDefaultActiveCal(f *float64) *UserSettingsUpdate
SetNillableDefaultActiveCal sets the "default_active_cal" field if the given value is not nil.
func (*UserSettingsUpdate) SetNillableUserid ¶
func (usu *UserSettingsUpdate) SetNillableUserid(i *int64) *UserSettingsUpdate
SetNillableUserid sets the "userid" field if the given value is not nil.
func (*UserSettingsUpdate) SetUserid ¶
func (usu *UserSettingsUpdate) SetUserid(i int64) *UserSettingsUpdate
SetUserid sets the "userid" field.
func (*UserSettingsUpdate) Where ¶
func (usu *UserSettingsUpdate) Where(ps ...predicate.UserSettings) *UserSettingsUpdate
Where appends a list predicates to the UserSettingsUpdate builder.
type UserSettingsUpdateOne ¶
type UserSettingsUpdateOne struct {
// contains filtered or unexported fields
}
UserSettingsUpdateOne is the builder for updating a single UserSettings entity.
func (*UserSettingsUpdateOne) AddCalLimit ¶
func (usuo *UserSettingsUpdateOne) AddCalLimit(f float64) *UserSettingsUpdateOne
AddCalLimit adds f to the "cal_limit" field.
func (*UserSettingsUpdateOne) AddDefaultActiveCal ¶
func (usuo *UserSettingsUpdateOne) AddDefaultActiveCal(f float64) *UserSettingsUpdateOne
AddDefaultActiveCal adds f to the "default_active_cal" field.
func (*UserSettingsUpdateOne) AddUserid ¶
func (usuo *UserSettingsUpdateOne) AddUserid(i int64) *UserSettingsUpdateOne
AddUserid adds i to the "userid" field.
func (*UserSettingsUpdateOne) Exec ¶
func (usuo *UserSettingsUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserSettingsUpdateOne) ExecX ¶
func (usuo *UserSettingsUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSettingsUpdateOne) Modify ¶
func (usuo *UserSettingsUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserSettingsUpdateOne
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*UserSettingsUpdateOne) Mutation ¶
func (usuo *UserSettingsUpdateOne) Mutation() *UserSettingsMutation
Mutation returns the UserSettingsMutation object of the builder.
func (*UserSettingsUpdateOne) Save ¶
func (usuo *UserSettingsUpdateOne) Save(ctx context.Context) (*UserSettings, error)
Save executes the query and returns the updated UserSettings entity.
func (*UserSettingsUpdateOne) SaveX ¶
func (usuo *UserSettingsUpdateOne) SaveX(ctx context.Context) *UserSettings
SaveX is like Save, but panics if an error occurs.
func (*UserSettingsUpdateOne) Select ¶
func (usuo *UserSettingsUpdateOne) Select(field string, fields ...string) *UserSettingsUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserSettingsUpdateOne) SetCalLimit ¶
func (usuo *UserSettingsUpdateOne) SetCalLimit(f float64) *UserSettingsUpdateOne
SetCalLimit sets the "cal_limit" field.
func (*UserSettingsUpdateOne) SetDefaultActiveCal ¶
func (usuo *UserSettingsUpdateOne) SetDefaultActiveCal(f float64) *UserSettingsUpdateOne
SetDefaultActiveCal sets the "default_active_cal" field.
func (*UserSettingsUpdateOne) SetNillableCalLimit ¶
func (usuo *UserSettingsUpdateOne) SetNillableCalLimit(f *float64) *UserSettingsUpdateOne
SetNillableCalLimit sets the "cal_limit" field if the given value is not nil.
func (*UserSettingsUpdateOne) SetNillableDefaultActiveCal ¶
func (usuo *UserSettingsUpdateOne) SetNillableDefaultActiveCal(f *float64) *UserSettingsUpdateOne
SetNillableDefaultActiveCal sets the "default_active_cal" field if the given value is not nil.
func (*UserSettingsUpdateOne) SetNillableUserid ¶
func (usuo *UserSettingsUpdateOne) SetNillableUserid(i *int64) *UserSettingsUpdateOne
SetNillableUserid sets the "userid" field if the given value is not nil.
func (*UserSettingsUpdateOne) SetUserid ¶
func (usuo *UserSettingsUpdateOne) SetUserid(i int64) *UserSettingsUpdateOne
SetUserid sets the "userid" field.
func (*UserSettingsUpdateOne) Where ¶
func (usuo *UserSettingsUpdateOne) Where(ps ...predicate.UserSettings) *UserSettingsUpdateOne
Where appends a list predicates to the UserSettingsUpdate builder.
type UserSettingsUpsert ¶
UserSettingsUpsert is the "OnConflict" setter.
func (*UserSettingsUpsert) AddCalLimit ¶
func (u *UserSettingsUpsert) AddCalLimit(v float64) *UserSettingsUpsert
AddCalLimit adds v to the "cal_limit" field.
func (*UserSettingsUpsert) AddDefaultActiveCal ¶
func (u *UserSettingsUpsert) AddDefaultActiveCal(v float64) *UserSettingsUpsert
AddDefaultActiveCal adds v to the "default_active_cal" field.
func (*UserSettingsUpsert) AddUserid ¶
func (u *UserSettingsUpsert) AddUserid(v int64) *UserSettingsUpsert
AddUserid adds v to the "userid" field.
func (*UserSettingsUpsert) SetCalLimit ¶
func (u *UserSettingsUpsert) SetCalLimit(v float64) *UserSettingsUpsert
SetCalLimit sets the "cal_limit" field.
func (*UserSettingsUpsert) SetDefaultActiveCal ¶
func (u *UserSettingsUpsert) SetDefaultActiveCal(v float64) *UserSettingsUpsert
SetDefaultActiveCal sets the "default_active_cal" field.
func (*UserSettingsUpsert) SetUserid ¶
func (u *UserSettingsUpsert) SetUserid(v int64) *UserSettingsUpsert
SetUserid sets the "userid" field.
func (*UserSettingsUpsert) UpdateCalLimit ¶
func (u *UserSettingsUpsert) UpdateCalLimit() *UserSettingsUpsert
UpdateCalLimit sets the "cal_limit" field to the value that was provided on create.
func (*UserSettingsUpsert) UpdateDefaultActiveCal ¶
func (u *UserSettingsUpsert) UpdateDefaultActiveCal() *UserSettingsUpsert
UpdateDefaultActiveCal sets the "default_active_cal" field to the value that was provided on create.
func (*UserSettingsUpsert) UpdateUserid ¶
func (u *UserSettingsUpsert) UpdateUserid() *UserSettingsUpsert
UpdateUserid sets the "userid" field to the value that was provided on create.
type UserSettingsUpsertBulk ¶
type UserSettingsUpsertBulk struct {
// contains filtered or unexported fields
}
UserSettingsUpsertBulk is the builder for "upsert"-ing a bulk of UserSettings nodes.
func (*UserSettingsUpsertBulk) AddCalLimit ¶
func (u *UserSettingsUpsertBulk) AddCalLimit(v float64) *UserSettingsUpsertBulk
AddCalLimit adds v to the "cal_limit" field.
func (*UserSettingsUpsertBulk) AddDefaultActiveCal ¶
func (u *UserSettingsUpsertBulk) AddDefaultActiveCal(v float64) *UserSettingsUpsertBulk
AddDefaultActiveCal adds v to the "default_active_cal" field.
func (*UserSettingsUpsertBulk) AddUserid ¶
func (u *UserSettingsUpsertBulk) AddUserid(v int64) *UserSettingsUpsertBulk
AddUserid adds v to the "userid" field.
func (*UserSettingsUpsertBulk) DoNothing ¶
func (u *UserSettingsUpsertBulk) DoNothing() *UserSettingsUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserSettingsUpsertBulk) Exec ¶
func (u *UserSettingsUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserSettingsUpsertBulk) ExecX ¶
func (u *UserSettingsUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSettingsUpsertBulk) Ignore ¶
func (u *UserSettingsUpsertBulk) Ignore() *UserSettingsUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.UserSettings.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserSettingsUpsertBulk) SetCalLimit ¶
func (u *UserSettingsUpsertBulk) SetCalLimit(v float64) *UserSettingsUpsertBulk
SetCalLimit sets the "cal_limit" field.
func (*UserSettingsUpsertBulk) SetDefaultActiveCal ¶
func (u *UserSettingsUpsertBulk) SetDefaultActiveCal(v float64) *UserSettingsUpsertBulk
SetDefaultActiveCal sets the "default_active_cal" field.
func (*UserSettingsUpsertBulk) SetUserid ¶
func (u *UserSettingsUpsertBulk) SetUserid(v int64) *UserSettingsUpsertBulk
SetUserid sets the "userid" field.
func (*UserSettingsUpsertBulk) Update ¶
func (u *UserSettingsUpsertBulk) Update(set func(*UserSettingsUpsert)) *UserSettingsUpsertBulk
Update allows overriding fields `UPDATE` values. See the UserSettingsCreateBulk.OnConflict documentation for more info.
func (*UserSettingsUpsertBulk) UpdateCalLimit ¶
func (u *UserSettingsUpsertBulk) UpdateCalLimit() *UserSettingsUpsertBulk
UpdateCalLimit sets the "cal_limit" field to the value that was provided on create.
func (*UserSettingsUpsertBulk) UpdateDefaultActiveCal ¶
func (u *UserSettingsUpsertBulk) UpdateDefaultActiveCal() *UserSettingsUpsertBulk
UpdateDefaultActiveCal sets the "default_active_cal" field to the value that was provided on create.
func (*UserSettingsUpsertBulk) UpdateNewValues ¶
func (u *UserSettingsUpsertBulk) UpdateNewValues() *UserSettingsUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.UserSettings.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*UserSettingsUpsertBulk) UpdateUserid ¶
func (u *UserSettingsUpsertBulk) UpdateUserid() *UserSettingsUpsertBulk
UpdateUserid sets the "userid" field to the value that was provided on create.
type UserSettingsUpsertOne ¶
type UserSettingsUpsertOne struct {
// contains filtered or unexported fields
}
UserSettingsUpsertOne is the builder for "upsert"-ing
one UserSettings node.
func (*UserSettingsUpsertOne) AddCalLimit ¶
func (u *UserSettingsUpsertOne) AddCalLimit(v float64) *UserSettingsUpsertOne
AddCalLimit adds v to the "cal_limit" field.
func (*UserSettingsUpsertOne) AddDefaultActiveCal ¶
func (u *UserSettingsUpsertOne) AddDefaultActiveCal(v float64) *UserSettingsUpsertOne
AddDefaultActiveCal adds v to the "default_active_cal" field.
func (*UserSettingsUpsertOne) AddUserid ¶
func (u *UserSettingsUpsertOne) AddUserid(v int64) *UserSettingsUpsertOne
AddUserid adds v to the "userid" field.
func (*UserSettingsUpsertOne) DoNothing ¶
func (u *UserSettingsUpsertOne) DoNothing() *UserSettingsUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserSettingsUpsertOne) Exec ¶
func (u *UserSettingsUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*UserSettingsUpsertOne) ExecX ¶
func (u *UserSettingsUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSettingsUpsertOne) ID ¶
func (u *UserSettingsUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*UserSettingsUpsertOne) IDX ¶
func (u *UserSettingsUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*UserSettingsUpsertOne) Ignore ¶
func (u *UserSettingsUpsertOne) Ignore() *UserSettingsUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.UserSettings.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserSettingsUpsertOne) SetCalLimit ¶
func (u *UserSettingsUpsertOne) SetCalLimit(v float64) *UserSettingsUpsertOne
SetCalLimit sets the "cal_limit" field.
func (*UserSettingsUpsertOne) SetDefaultActiveCal ¶
func (u *UserSettingsUpsertOne) SetDefaultActiveCal(v float64) *UserSettingsUpsertOne
SetDefaultActiveCal sets the "default_active_cal" field.
func (*UserSettingsUpsertOne) SetUserid ¶
func (u *UserSettingsUpsertOne) SetUserid(v int64) *UserSettingsUpsertOne
SetUserid sets the "userid" field.
func (*UserSettingsUpsertOne) Update ¶
func (u *UserSettingsUpsertOne) Update(set func(*UserSettingsUpsert)) *UserSettingsUpsertOne
Update allows overriding fields `UPDATE` values. See the UserSettingsCreate.OnConflict documentation for more info.
func (*UserSettingsUpsertOne) UpdateCalLimit ¶
func (u *UserSettingsUpsertOne) UpdateCalLimit() *UserSettingsUpsertOne
UpdateCalLimit sets the "cal_limit" field to the value that was provided on create.
func (*UserSettingsUpsertOne) UpdateDefaultActiveCal ¶
func (u *UserSettingsUpsertOne) UpdateDefaultActiveCal() *UserSettingsUpsertOne
UpdateDefaultActiveCal sets the "default_active_cal" field to the value that was provided on create.
func (*UserSettingsUpsertOne) UpdateNewValues ¶
func (u *UserSettingsUpsertOne) UpdateNewValues() *UserSettingsUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.UserSettings.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*UserSettingsUpsertOne) UpdateUserid ¶
func (u *UserSettingsUpsertOne) UpdateUserid() *UserSettingsUpsertOne
UpdateUserid sets the "userid" 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.
type Weight ¶
type Weight struct { // ID of the ent. ID int `json:"id,omitempty"` // Userid holds the value of the "userid" field. Userid int64 `json:"userid,omitempty"` // Timestamp holds the value of the "timestamp" field. Timestamp time.Time `json:"timestamp,omitempty"` // Value holds the value of the "value" field. Value float64 `json:"value,omitempty"` // contains filtered or unexported fields }
Weight is the model entity for the Weight schema.
func (*Weight) GetValue ¶
GetValue returns the ent.Value that was dynamically selected and assigned to the Weight. This includes values selected through modifiers, order, etc.
func (*Weight) Unwrap ¶
Unwrap unwraps the Weight 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 (*Weight) Update ¶
func (w *Weight) Update() *WeightUpdateOne
Update returns a builder for updating this Weight. Note that you need to call Weight.Unwrap() before calling this method if this Weight was returned from a transaction, and the transaction was committed or rolled back.
type WeightClient ¶
type WeightClient struct {
// contains filtered or unexported fields
}
WeightClient is a client for the Weight schema.
func NewWeightClient ¶
func NewWeightClient(c config) *WeightClient
NewWeightClient returns a client for the Weight from the given config.
func (*WeightClient) Create ¶
func (c *WeightClient) Create() *WeightCreate
Create returns a builder for creating a Weight entity.
func (*WeightClient) CreateBulk ¶
func (c *WeightClient) CreateBulk(builders ...*WeightCreate) *WeightCreateBulk
CreateBulk returns a builder for creating a bulk of Weight entities.
func (*WeightClient) Delete ¶
func (c *WeightClient) Delete() *WeightDelete
Delete returns a delete builder for Weight.
func (*WeightClient) DeleteOne ¶
func (c *WeightClient) DeleteOne(w *Weight) *WeightDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*WeightClient) DeleteOneID ¶
func (c *WeightClient) DeleteOneID(id int) *WeightDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*WeightClient) GetX ¶
func (c *WeightClient) GetX(ctx context.Context, id int) *Weight
GetX is like Get, but panics if an error occurs.
func (*WeightClient) Intercept ¶
func (c *WeightClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `weight.Intercept(f(g(h())))`.
func (*WeightClient) Interceptors ¶
func (c *WeightClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*WeightClient) MapCreateBulk ¶
func (c *WeightClient) MapCreateBulk(slice any, setFunc func(*WeightCreate, int)) *WeightCreateBulk
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 (*WeightClient) Query ¶
func (c *WeightClient) Query() *WeightQuery
Query returns a query builder for Weight.
func (*WeightClient) Update ¶
func (c *WeightClient) Update() *WeightUpdate
Update returns an update builder for Weight.
func (*WeightClient) UpdateOne ¶
func (c *WeightClient) UpdateOne(w *Weight) *WeightUpdateOne
UpdateOne returns an update builder for the given entity.
func (*WeightClient) UpdateOneID ¶
func (c *WeightClient) UpdateOneID(id int) *WeightUpdateOne
UpdateOneID returns an update builder for the given id.
func (*WeightClient) Use ¶
func (c *WeightClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `weight.Hooks(f(g(h())))`.
type WeightCreate ¶
type WeightCreate struct {
// contains filtered or unexported fields
}
WeightCreate is the builder for creating a Weight entity.
func (*WeightCreate) Exec ¶
func (wc *WeightCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*WeightCreate) ExecX ¶
func (wc *WeightCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WeightCreate) Mutation ¶
func (wc *WeightCreate) Mutation() *WeightMutation
Mutation returns the WeightMutation object of the builder.
func (*WeightCreate) OnConflict ¶
func (wc *WeightCreate) OnConflict(opts ...sql.ConflictOption) *WeightUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Weight.Create(). SetUserid(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.WeightUpsert) { SetUserid(v+v). }). Exec(ctx)
func (*WeightCreate) OnConflictColumns ¶
func (wc *WeightCreate) OnConflictColumns(columns ...string) *WeightUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Weight.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*WeightCreate) Save ¶
func (wc *WeightCreate) Save(ctx context.Context) (*Weight, error)
Save creates the Weight in the database.
func (*WeightCreate) SaveX ¶
func (wc *WeightCreate) SaveX(ctx context.Context) *Weight
SaveX calls Save and panics if Save returns an error.
func (*WeightCreate) SetTimestamp ¶
func (wc *WeightCreate) SetTimestamp(t time.Time) *WeightCreate
SetTimestamp sets the "timestamp" field.
func (*WeightCreate) SetUserid ¶
func (wc *WeightCreate) SetUserid(i int64) *WeightCreate
SetUserid sets the "userid" field.
func (*WeightCreate) SetValue ¶
func (wc *WeightCreate) SetValue(f float64) *WeightCreate
SetValue sets the "value" field.
type WeightCreateBulk ¶
type WeightCreateBulk struct {
// contains filtered or unexported fields
}
WeightCreateBulk is the builder for creating many Weight entities in bulk.
func (*WeightCreateBulk) Exec ¶
func (wcb *WeightCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*WeightCreateBulk) ExecX ¶
func (wcb *WeightCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WeightCreateBulk) OnConflict ¶
func (wcb *WeightCreateBulk) OnConflict(opts ...sql.ConflictOption) *WeightUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Weight.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.WeightUpsert) { SetUserid(v+v). }). Exec(ctx)
func (*WeightCreateBulk) OnConflictColumns ¶
func (wcb *WeightCreateBulk) OnConflictColumns(columns ...string) *WeightUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Weight.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type WeightDelete ¶
type WeightDelete struct {
// contains filtered or unexported fields
}
WeightDelete is the builder for deleting a Weight entity.
func (*WeightDelete) Exec ¶
func (wd *WeightDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*WeightDelete) ExecX ¶
func (wd *WeightDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*WeightDelete) Where ¶
func (wd *WeightDelete) Where(ps ...predicate.Weight) *WeightDelete
Where appends a list predicates to the WeightDelete builder.
type WeightDeleteOne ¶
type WeightDeleteOne struct {
// contains filtered or unexported fields
}
WeightDeleteOne is the builder for deleting a single Weight entity.
func (*WeightDeleteOne) Exec ¶
func (wdo *WeightDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*WeightDeleteOne) ExecX ¶
func (wdo *WeightDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WeightDeleteOne) Where ¶
func (wdo *WeightDeleteOne) Where(ps ...predicate.Weight) *WeightDeleteOne
Where appends a list predicates to the WeightDelete builder.
type WeightGroupBy ¶
type WeightGroupBy struct {
// contains filtered or unexported fields
}
WeightGroupBy is the group-by builder for Weight entities.
func (*WeightGroupBy) Aggregate ¶
func (wgb *WeightGroupBy) Aggregate(fns ...AggregateFunc) *WeightGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*WeightGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*WeightGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*WeightGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*WeightGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*WeightGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*WeightGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*WeightGroupBy) Scan ¶
func (wgb *WeightGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*WeightGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type WeightMutation ¶
type WeightMutation struct {
// contains filtered or unexported fields
}
WeightMutation represents an operation that mutates the Weight nodes in the graph.
func (*WeightMutation) AddField ¶
func (m *WeightMutation) 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 (*WeightMutation) AddUserid ¶
func (m *WeightMutation) AddUserid(i int64)
AddUserid adds i to the "userid" field.
func (*WeightMutation) AddValue ¶
func (m *WeightMutation) AddValue(f float64)
AddValue adds f to the "value" field.
func (*WeightMutation) AddedEdges ¶
func (m *WeightMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*WeightMutation) AddedField ¶
func (m *WeightMutation) 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 (*WeightMutation) AddedFields ¶
func (m *WeightMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*WeightMutation) AddedIDs ¶
func (m *WeightMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*WeightMutation) AddedUserid ¶
func (m *WeightMutation) AddedUserid() (r int64, exists bool)
AddedUserid returns the value that was added to the "userid" field in this mutation.
func (*WeightMutation) AddedValue ¶
func (m *WeightMutation) AddedValue() (r float64, exists bool)
AddedValue returns the value that was added to the "value" field in this mutation.
func (*WeightMutation) ClearEdge ¶
func (m *WeightMutation) 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 (*WeightMutation) ClearField ¶
func (m *WeightMutation) 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 (*WeightMutation) ClearedEdges ¶
func (m *WeightMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*WeightMutation) ClearedFields ¶
func (m *WeightMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (WeightMutation) Client ¶
func (m WeightMutation) 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 (*WeightMutation) EdgeCleared ¶
func (m *WeightMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*WeightMutation) Field ¶
func (m *WeightMutation) 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 (*WeightMutation) FieldCleared ¶
func (m *WeightMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*WeightMutation) Fields ¶
func (m *WeightMutation) 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 (*WeightMutation) ID ¶
func (m *WeightMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*WeightMutation) IDs ¶
func (m *WeightMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*WeightMutation) 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 (*WeightMutation) OldTimestamp ¶
OldTimestamp returns the old "timestamp" field's value of the Weight entity. If the Weight 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 (*WeightMutation) OldUserid ¶
func (m *WeightMutation) OldUserid(ctx context.Context) (v int64, err error)
OldUserid returns the old "userid" field's value of the Weight entity. If the Weight 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 (*WeightMutation) OldValue ¶
func (m *WeightMutation) OldValue(ctx context.Context) (v float64, err error)
OldValue returns the old "value" field's value of the Weight entity. If the Weight 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 (*WeightMutation) RemovedEdges ¶
func (m *WeightMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*WeightMutation) RemovedIDs ¶
func (m *WeightMutation) 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 (*WeightMutation) ResetEdge ¶
func (m *WeightMutation) 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 (*WeightMutation) ResetField ¶
func (m *WeightMutation) 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 (*WeightMutation) ResetTimestamp ¶
func (m *WeightMutation) ResetTimestamp()
ResetTimestamp resets all changes to the "timestamp" field.
func (*WeightMutation) ResetUserid ¶
func (m *WeightMutation) ResetUserid()
ResetUserid resets all changes to the "userid" field.
func (*WeightMutation) ResetValue ¶
func (m *WeightMutation) ResetValue()
ResetValue resets all changes to the "value" field.
func (*WeightMutation) SetField ¶
func (m *WeightMutation) 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 (*WeightMutation) SetOp ¶
func (m *WeightMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*WeightMutation) SetTimestamp ¶
func (m *WeightMutation) SetTimestamp(t time.Time)
SetTimestamp sets the "timestamp" field.
func (*WeightMutation) SetUserid ¶
func (m *WeightMutation) SetUserid(i int64)
SetUserid sets the "userid" field.
func (*WeightMutation) SetValue ¶
func (m *WeightMutation) SetValue(f float64)
SetValue sets the "value" field.
func (*WeightMutation) Timestamp ¶
func (m *WeightMutation) Timestamp() (r time.Time, exists bool)
Timestamp returns the value of the "timestamp" field in the mutation.
func (WeightMutation) Tx ¶
func (m WeightMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*WeightMutation) Type ¶
func (m *WeightMutation) Type() string
Type returns the node type of this mutation (Weight).
func (*WeightMutation) Userid ¶
func (m *WeightMutation) Userid() (r int64, exists bool)
Userid returns the value of the "userid" field in the mutation.
func (*WeightMutation) Value ¶
func (m *WeightMutation) Value() (r float64, exists bool)
Value returns the value of the "value" field in the mutation.
func (*WeightMutation) Where ¶
func (m *WeightMutation) Where(ps ...predicate.Weight)
Where appends a list predicates to the WeightMutation builder.
func (*WeightMutation) WhereP ¶
func (m *WeightMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the WeightMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type WeightQuery ¶
type WeightQuery struct {
// contains filtered or unexported fields
}
WeightQuery is the builder for querying Weight entities.
func (*WeightQuery) Aggregate ¶
func (wq *WeightQuery) Aggregate(fns ...AggregateFunc) *WeightSelect
Aggregate returns a WeightSelect configured with the given aggregations.
func (*WeightQuery) All ¶
func (wq *WeightQuery) All(ctx context.Context) ([]*Weight, error)
All executes the query and returns a list of Weights.
func (*WeightQuery) AllX ¶
func (wq *WeightQuery) AllX(ctx context.Context) []*Weight
AllX is like All, but panics if an error occurs.
func (*WeightQuery) Clone ¶
func (wq *WeightQuery) Clone() *WeightQuery
Clone returns a duplicate of the WeightQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*WeightQuery) Count ¶
func (wq *WeightQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*WeightQuery) CountX ¶
func (wq *WeightQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*WeightQuery) Exist ¶
func (wq *WeightQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*WeightQuery) ExistX ¶
func (wq *WeightQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*WeightQuery) First ¶
func (wq *WeightQuery) First(ctx context.Context) (*Weight, error)
First returns the first Weight entity from the query. Returns a *NotFoundError when no Weight was found.
func (*WeightQuery) FirstID ¶
func (wq *WeightQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Weight ID from the query. Returns a *NotFoundError when no Weight ID was found.
func (*WeightQuery) FirstIDX ¶
func (wq *WeightQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*WeightQuery) FirstX ¶
func (wq *WeightQuery) FirstX(ctx context.Context) *Weight
FirstX is like First, but panics if an error occurs.
func (*WeightQuery) GroupBy ¶
func (wq *WeightQuery) GroupBy(field string, fields ...string) *WeightGroupBy
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 { Userid int64 `json:"userid,omitempty"` Count int `json:"count,omitempty"` } client.Weight.Query(). GroupBy(weight.FieldUserid). Aggregate(ent.Count()). Scan(ctx, &v)
func (*WeightQuery) IDs ¶
func (wq *WeightQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Weight IDs.
func (*WeightQuery) IDsX ¶
func (wq *WeightQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*WeightQuery) Limit ¶
func (wq *WeightQuery) Limit(limit int) *WeightQuery
Limit the number of records to be returned by this query.
func (*WeightQuery) Modify ¶
func (wq *WeightQuery) Modify(modifiers ...func(s *sql.Selector)) *WeightSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*WeightQuery) Offset ¶
func (wq *WeightQuery) Offset(offset int) *WeightQuery
Offset to start from.
func (*WeightQuery) Only ¶
func (wq *WeightQuery) Only(ctx context.Context) (*Weight, error)
Only returns a single Weight entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Weight entity is found. Returns a *NotFoundError when no Weight entities are found.
func (*WeightQuery) OnlyID ¶
func (wq *WeightQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Weight ID in the query. Returns a *NotSingularError when more than one Weight ID is found. Returns a *NotFoundError when no entities are found.
func (*WeightQuery) OnlyIDX ¶
func (wq *WeightQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*WeightQuery) OnlyX ¶
func (wq *WeightQuery) OnlyX(ctx context.Context) *Weight
OnlyX is like Only, but panics if an error occurs.
func (*WeightQuery) Order ¶
func (wq *WeightQuery) Order(o ...weight.OrderOption) *WeightQuery
Order specifies how the records should be ordered.
func (*WeightQuery) Select ¶
func (wq *WeightQuery) Select(fields ...string) *WeightSelect
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 { Userid int64 `json:"userid,omitempty"` } client.Weight.Query(). Select(weight.FieldUserid). Scan(ctx, &v)
func (*WeightQuery) Unique ¶
func (wq *WeightQuery) Unique(unique bool) *WeightQuery
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 (*WeightQuery) Where ¶
func (wq *WeightQuery) Where(ps ...predicate.Weight) *WeightQuery
Where adds a new predicate for the WeightQuery builder.
type WeightSelect ¶
type WeightSelect struct { *WeightQuery // contains filtered or unexported fields }
WeightSelect is the builder for selecting fields of Weight entities.
func (*WeightSelect) Aggregate ¶
func (ws *WeightSelect) Aggregate(fns ...AggregateFunc) *WeightSelect
Aggregate adds the given aggregation functions to the selector query.
func (*WeightSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*WeightSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*WeightSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*WeightSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*WeightSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*WeightSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*WeightSelect) Modify ¶
func (ws *WeightSelect) Modify(modifiers ...func(s *sql.Selector)) *WeightSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*WeightSelect) Scan ¶
func (ws *WeightSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*WeightSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type WeightUpdate ¶
type WeightUpdate struct {
// contains filtered or unexported fields
}
WeightUpdate is the builder for updating Weight entities.
func (*WeightUpdate) AddUserid ¶
func (wu *WeightUpdate) AddUserid(i int64) *WeightUpdate
AddUserid adds i to the "userid" field.
func (*WeightUpdate) AddValue ¶
func (wu *WeightUpdate) AddValue(f float64) *WeightUpdate
AddValue adds f to the "value" field.
func (*WeightUpdate) Exec ¶
func (wu *WeightUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*WeightUpdate) ExecX ¶
func (wu *WeightUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WeightUpdate) Modify ¶
func (wu *WeightUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *WeightUpdate
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*WeightUpdate) Mutation ¶
func (wu *WeightUpdate) Mutation() *WeightMutation
Mutation returns the WeightMutation object of the builder.
func (*WeightUpdate) Save ¶
func (wu *WeightUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*WeightUpdate) SaveX ¶
func (wu *WeightUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*WeightUpdate) SetNillableTimestamp ¶
func (wu *WeightUpdate) SetNillableTimestamp(t *time.Time) *WeightUpdate
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*WeightUpdate) SetNillableUserid ¶
func (wu *WeightUpdate) SetNillableUserid(i *int64) *WeightUpdate
SetNillableUserid sets the "userid" field if the given value is not nil.
func (*WeightUpdate) SetNillableValue ¶
func (wu *WeightUpdate) SetNillableValue(f *float64) *WeightUpdate
SetNillableValue sets the "value" field if the given value is not nil.
func (*WeightUpdate) SetTimestamp ¶
func (wu *WeightUpdate) SetTimestamp(t time.Time) *WeightUpdate
SetTimestamp sets the "timestamp" field.
func (*WeightUpdate) SetUserid ¶
func (wu *WeightUpdate) SetUserid(i int64) *WeightUpdate
SetUserid sets the "userid" field.
func (*WeightUpdate) SetValue ¶
func (wu *WeightUpdate) SetValue(f float64) *WeightUpdate
SetValue sets the "value" field.
func (*WeightUpdate) Where ¶
func (wu *WeightUpdate) Where(ps ...predicate.Weight) *WeightUpdate
Where appends a list predicates to the WeightUpdate builder.
type WeightUpdateOne ¶
type WeightUpdateOne struct {
// contains filtered or unexported fields
}
WeightUpdateOne is the builder for updating a single Weight entity.
func (*WeightUpdateOne) AddUserid ¶
func (wuo *WeightUpdateOne) AddUserid(i int64) *WeightUpdateOne
AddUserid adds i to the "userid" field.
func (*WeightUpdateOne) AddValue ¶
func (wuo *WeightUpdateOne) AddValue(f float64) *WeightUpdateOne
AddValue adds f to the "value" field.
func (*WeightUpdateOne) Exec ¶
func (wuo *WeightUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*WeightUpdateOne) ExecX ¶
func (wuo *WeightUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WeightUpdateOne) Modify ¶
func (wuo *WeightUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *WeightUpdateOne
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*WeightUpdateOne) Mutation ¶
func (wuo *WeightUpdateOne) Mutation() *WeightMutation
Mutation returns the WeightMutation object of the builder.
func (*WeightUpdateOne) Save ¶
func (wuo *WeightUpdateOne) Save(ctx context.Context) (*Weight, error)
Save executes the query and returns the updated Weight entity.
func (*WeightUpdateOne) SaveX ¶
func (wuo *WeightUpdateOne) SaveX(ctx context.Context) *Weight
SaveX is like Save, but panics if an error occurs.
func (*WeightUpdateOne) Select ¶
func (wuo *WeightUpdateOne) Select(field string, fields ...string) *WeightUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*WeightUpdateOne) SetNillableTimestamp ¶
func (wuo *WeightUpdateOne) SetNillableTimestamp(t *time.Time) *WeightUpdateOne
SetNillableTimestamp sets the "timestamp" field if the given value is not nil.
func (*WeightUpdateOne) SetNillableUserid ¶
func (wuo *WeightUpdateOne) SetNillableUserid(i *int64) *WeightUpdateOne
SetNillableUserid sets the "userid" field if the given value is not nil.
func (*WeightUpdateOne) SetNillableValue ¶
func (wuo *WeightUpdateOne) SetNillableValue(f *float64) *WeightUpdateOne
SetNillableValue sets the "value" field if the given value is not nil.
func (*WeightUpdateOne) SetTimestamp ¶
func (wuo *WeightUpdateOne) SetTimestamp(t time.Time) *WeightUpdateOne
SetTimestamp sets the "timestamp" field.
func (*WeightUpdateOne) SetUserid ¶
func (wuo *WeightUpdateOne) SetUserid(i int64) *WeightUpdateOne
SetUserid sets the "userid" field.
func (*WeightUpdateOne) SetValue ¶
func (wuo *WeightUpdateOne) SetValue(f float64) *WeightUpdateOne
SetValue sets the "value" field.
func (*WeightUpdateOne) Where ¶
func (wuo *WeightUpdateOne) Where(ps ...predicate.Weight) *WeightUpdateOne
Where appends a list predicates to the WeightUpdate builder.
type WeightUpsert ¶
WeightUpsert is the "OnConflict" setter.
func (*WeightUpsert) AddUserid ¶
func (u *WeightUpsert) AddUserid(v int64) *WeightUpsert
AddUserid adds v to the "userid" field.
func (*WeightUpsert) AddValue ¶
func (u *WeightUpsert) AddValue(v float64) *WeightUpsert
AddValue adds v to the "value" field.
func (*WeightUpsert) SetTimestamp ¶
func (u *WeightUpsert) SetTimestamp(v time.Time) *WeightUpsert
SetTimestamp sets the "timestamp" field.
func (*WeightUpsert) SetUserid ¶
func (u *WeightUpsert) SetUserid(v int64) *WeightUpsert
SetUserid sets the "userid" field.
func (*WeightUpsert) SetValue ¶
func (u *WeightUpsert) SetValue(v float64) *WeightUpsert
SetValue sets the "value" field.
func (*WeightUpsert) UpdateTimestamp ¶
func (u *WeightUpsert) UpdateTimestamp() *WeightUpsert
UpdateTimestamp sets the "timestamp" field to the value that was provided on create.
func (*WeightUpsert) UpdateUserid ¶
func (u *WeightUpsert) UpdateUserid() *WeightUpsert
UpdateUserid sets the "userid" field to the value that was provided on create.
func (*WeightUpsert) UpdateValue ¶
func (u *WeightUpsert) UpdateValue() *WeightUpsert
UpdateValue sets the "value" field to the value that was provided on create.
type WeightUpsertBulk ¶
type WeightUpsertBulk struct {
// contains filtered or unexported fields
}
WeightUpsertBulk is the builder for "upsert"-ing a bulk of Weight nodes.
func (*WeightUpsertBulk) AddUserid ¶
func (u *WeightUpsertBulk) AddUserid(v int64) *WeightUpsertBulk
AddUserid adds v to the "userid" field.
func (*WeightUpsertBulk) AddValue ¶
func (u *WeightUpsertBulk) AddValue(v float64) *WeightUpsertBulk
AddValue adds v to the "value" field.
func (*WeightUpsertBulk) DoNothing ¶
func (u *WeightUpsertBulk) DoNothing() *WeightUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*WeightUpsertBulk) Exec ¶
func (u *WeightUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*WeightUpsertBulk) ExecX ¶
func (u *WeightUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WeightUpsertBulk) Ignore ¶
func (u *WeightUpsertBulk) Ignore() *WeightUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Weight.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*WeightUpsertBulk) SetTimestamp ¶
func (u *WeightUpsertBulk) SetTimestamp(v time.Time) *WeightUpsertBulk
SetTimestamp sets the "timestamp" field.
func (*WeightUpsertBulk) SetUserid ¶
func (u *WeightUpsertBulk) SetUserid(v int64) *WeightUpsertBulk
SetUserid sets the "userid" field.
func (*WeightUpsertBulk) SetValue ¶
func (u *WeightUpsertBulk) SetValue(v float64) *WeightUpsertBulk
SetValue sets the "value" field.
func (*WeightUpsertBulk) Update ¶
func (u *WeightUpsertBulk) Update(set func(*WeightUpsert)) *WeightUpsertBulk
Update allows overriding fields `UPDATE` values. See the WeightCreateBulk.OnConflict documentation for more info.
func (*WeightUpsertBulk) UpdateNewValues ¶
func (u *WeightUpsertBulk) UpdateNewValues() *WeightUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Weight.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*WeightUpsertBulk) UpdateTimestamp ¶
func (u *WeightUpsertBulk) UpdateTimestamp() *WeightUpsertBulk
UpdateTimestamp sets the "timestamp" field to the value that was provided on create.
func (*WeightUpsertBulk) UpdateUserid ¶
func (u *WeightUpsertBulk) UpdateUserid() *WeightUpsertBulk
UpdateUserid sets the "userid" field to the value that was provided on create.
func (*WeightUpsertBulk) UpdateValue ¶
func (u *WeightUpsertBulk) UpdateValue() *WeightUpsertBulk
UpdateValue sets the "value" field to the value that was provided on create.
type WeightUpsertOne ¶
type WeightUpsertOne struct {
// contains filtered or unexported fields
}
WeightUpsertOne is the builder for "upsert"-ing
one Weight node.
func (*WeightUpsertOne) AddUserid ¶
func (u *WeightUpsertOne) AddUserid(v int64) *WeightUpsertOne
AddUserid adds v to the "userid" field.
func (*WeightUpsertOne) AddValue ¶
func (u *WeightUpsertOne) AddValue(v float64) *WeightUpsertOne
AddValue adds v to the "value" field.
func (*WeightUpsertOne) DoNothing ¶
func (u *WeightUpsertOne) DoNothing() *WeightUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*WeightUpsertOne) Exec ¶
func (u *WeightUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*WeightUpsertOne) ExecX ¶
func (u *WeightUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WeightUpsertOne) ID ¶
func (u *WeightUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*WeightUpsertOne) IDX ¶
func (u *WeightUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*WeightUpsertOne) Ignore ¶
func (u *WeightUpsertOne) Ignore() *WeightUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Weight.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*WeightUpsertOne) SetTimestamp ¶
func (u *WeightUpsertOne) SetTimestamp(v time.Time) *WeightUpsertOne
SetTimestamp sets the "timestamp" field.
func (*WeightUpsertOne) SetUserid ¶
func (u *WeightUpsertOne) SetUserid(v int64) *WeightUpsertOne
SetUserid sets the "userid" field.
func (*WeightUpsertOne) SetValue ¶
func (u *WeightUpsertOne) SetValue(v float64) *WeightUpsertOne
SetValue sets the "value" field.
func (*WeightUpsertOne) Update ¶
func (u *WeightUpsertOne) Update(set func(*WeightUpsert)) *WeightUpsertOne
Update allows overriding fields `UPDATE` values. See the WeightCreate.OnConflict documentation for more info.
func (*WeightUpsertOne) UpdateNewValues ¶
func (u *WeightUpsertOne) UpdateNewValues() *WeightUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Weight.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*WeightUpsertOne) UpdateTimestamp ¶
func (u *WeightUpsertOne) UpdateTimestamp() *WeightUpsertOne
UpdateTimestamp sets the "timestamp" field to the value that was provided on create.
func (*WeightUpsertOne) UpdateUserid ¶
func (u *WeightUpsertOne) UpdateUserid() *WeightUpsertOne
UpdateUserid sets the "userid" field to the value that was provided on create.
func (*WeightUpsertOne) UpdateValue ¶
func (u *WeightUpsertOne) UpdateValue() *WeightUpsertOne
UpdateValue sets the "value" field to the value that was provided on create.
Source Files ¶
- activity.go
- activity_create.go
- activity_delete.go
- activity_query.go
- activity_update.go
- bundle.go
- bundle_create.go
- bundle_delete.go
- bundle_query.go
- bundle_update.go
- client.go
- ent.go
- food.go
- food_create.go
- food_delete.go
- food_query.go
- food_update.go
- generate.go
- journal.go
- journal_create.go
- journal_delete.go
- journal_query.go
- journal_update.go
- mutation.go
- runtime.go
- tx.go
- usersettings.go
- usersettings_create.go
- usersettings_delete.go
- usersettings_query.go
- usersettings_update.go
- weight.go
- weight_create.go
- weight_delete.go
- weight_query.go
- weight_update.go