Documentation ¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type Achievement
- type AchievementClient
- func (c *AchievementClient) Create() *AchievementCreate
- func (c *AchievementClient) CreateBulk(builders ...*AchievementCreate) *AchievementCreateBulk
- func (c *AchievementClient) Delete() *AchievementDelete
- func (c *AchievementClient) DeleteOne(a *Achievement) *AchievementDeleteOne
- func (c *AchievementClient) DeleteOneID(id int) *AchievementDeleteOne
- func (c *AchievementClient) Get(ctx context.Context, id int) (*Achievement, error)
- func (c *AchievementClient) GetX(ctx context.Context, id int) *Achievement
- func (c *AchievementClient) Hooks() []Hook
- func (c *AchievementClient) Intercept(interceptors ...Interceptor)
- func (c *AchievementClient) Interceptors() []Interceptor
- func (c *AchievementClient) Query() *AchievementQuery
- func (c *AchievementClient) QueryUser(a *Achievement) *UserQuery
- func (c *AchievementClient) Update() *AchievementUpdate
- func (c *AchievementClient) UpdateOne(a *Achievement) *AchievementUpdateOne
- func (c *AchievementClient) UpdateOneID(id int) *AchievementUpdateOne
- func (c *AchievementClient) Use(hooks ...Hook)
- type AchievementCreate
- func (ac *AchievementCreate) Exec(ctx context.Context) error
- func (ac *AchievementCreate) ExecX(ctx context.Context)
- func (ac *AchievementCreate) Mutation() *AchievementMutation
- func (ac *AchievementCreate) Save(ctx context.Context) (*Achievement, error)
- func (ac *AchievementCreate) SaveX(ctx context.Context) *Achievement
- func (ac *AchievementCreate) SetBfpGoal(f float64) *AchievementCreate
- func (ac *AchievementCreate) SetCreatedAt(t time.Time) *AchievementCreate
- func (ac *AchievementCreate) SetNillableCreatedAt(t *time.Time) *AchievementCreate
- func (ac *AchievementCreate) SetNillableStatus(s *string) *AchievementCreate
- func (ac *AchievementCreate) SetNillableThumbnailImgURL(s *string) *AchievementCreate
- func (ac *AchievementCreate) SetNillableUserID(id *int) *AchievementCreate
- func (ac *AchievementCreate) SetStatus(s string) *AchievementCreate
- func (ac *AchievementCreate) SetThumbnailImgURL(s string) *AchievementCreate
- func (ac *AchievementCreate) SetUser(u *User) *AchievementCreate
- func (ac *AchievementCreate) SetUserID(id int) *AchievementCreate
- type AchievementCreateBulk
- type AchievementDelete
- type AchievementDeleteOne
- type AchievementEdges
- type AchievementGroupBy
- func (agb *AchievementGroupBy) Aggregate(fns ...AggregateFunc) *AchievementGroupBy
- func (s *AchievementGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AchievementGroupBy) BoolX(ctx context.Context) bool
- func (s *AchievementGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AchievementGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AchievementGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AchievementGroupBy) Float64X(ctx context.Context) float64
- func (s *AchievementGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AchievementGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AchievementGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AchievementGroupBy) IntX(ctx context.Context) int
- func (s *AchievementGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AchievementGroupBy) IntsX(ctx context.Context) []int
- func (agb *AchievementGroupBy) Scan(ctx context.Context, v any) error
- func (s *AchievementGroupBy) ScanX(ctx context.Context, v any)
- func (s *AchievementGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AchievementGroupBy) StringX(ctx context.Context) string
- func (s *AchievementGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AchievementGroupBy) StringsX(ctx context.Context) []string
- type AchievementMutation
- func (m *AchievementMutation) AddBfpGoal(f float64)
- func (m *AchievementMutation) AddField(name string, value ent.Value) error
- func (m *AchievementMutation) AddedBfpGoal() (r float64, exists bool)
- func (m *AchievementMutation) AddedEdges() []string
- func (m *AchievementMutation) AddedField(name string) (ent.Value, bool)
- func (m *AchievementMutation) AddedFields() []string
- func (m *AchievementMutation) AddedIDs(name string) []ent.Value
- func (m *AchievementMutation) BfpGoal() (r float64, exists bool)
- func (m *AchievementMutation) ClearEdge(name string) error
- func (m *AchievementMutation) ClearField(name string) error
- func (m *AchievementMutation) ClearUser()
- func (m *AchievementMutation) ClearedEdges() []string
- func (m *AchievementMutation) ClearedFields() []string
- func (m AchievementMutation) Client() *Client
- func (m *AchievementMutation) CreatedAt() (r time.Time, exists bool)
- func (m *AchievementMutation) EdgeCleared(name string) bool
- func (m *AchievementMutation) Field(name string) (ent.Value, bool)
- func (m *AchievementMutation) FieldCleared(name string) bool
- func (m *AchievementMutation) Fields() []string
- func (m *AchievementMutation) ID() (id int, exists bool)
- func (m *AchievementMutation) IDs(ctx context.Context) ([]int, error)
- func (m *AchievementMutation) OldBfpGoal(ctx context.Context) (v float64, err error)
- func (m *AchievementMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *AchievementMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AchievementMutation) OldStatus(ctx context.Context) (v string, err error)
- func (m *AchievementMutation) OldThumbnailImgURL(ctx context.Context) (v string, err error)
- func (m *AchievementMutation) Op() Op
- func (m *AchievementMutation) RemovedEdges() []string
- func (m *AchievementMutation) RemovedIDs(name string) []ent.Value
- func (m *AchievementMutation) ResetBfpGoal()
- func (m *AchievementMutation) ResetCreatedAt()
- func (m *AchievementMutation) ResetEdge(name string) error
- func (m *AchievementMutation) ResetField(name string) error
- func (m *AchievementMutation) ResetStatus()
- func (m *AchievementMutation) ResetThumbnailImgURL()
- func (m *AchievementMutation) ResetUser()
- func (m *AchievementMutation) SetBfpGoal(f float64)
- func (m *AchievementMutation) SetCreatedAt(t time.Time)
- func (m *AchievementMutation) SetField(name string, value ent.Value) error
- func (m *AchievementMutation) SetOp(op Op)
- func (m *AchievementMutation) SetStatus(s string)
- func (m *AchievementMutation) SetThumbnailImgURL(s string)
- func (m *AchievementMutation) SetUserID(id int)
- func (m *AchievementMutation) Status() (r string, exists bool)
- func (m *AchievementMutation) ThumbnailImgURL() (r string, exists bool)
- func (m AchievementMutation) Tx() (*Tx, error)
- func (m *AchievementMutation) Type() string
- func (m *AchievementMutation) UserCleared() bool
- func (m *AchievementMutation) UserID() (id int, exists bool)
- func (m *AchievementMutation) UserIDs() (ids []int)
- func (m *AchievementMutation) Where(ps ...predicate.Achievement)
- func (m *AchievementMutation) WhereP(ps ...func(*sql.Selector))
- type AchievementQuery
- func (aq *AchievementQuery) Aggregate(fns ...AggregateFunc) *AchievementSelect
- func (aq *AchievementQuery) All(ctx context.Context) ([]*Achievement, error)
- func (aq *AchievementQuery) AllX(ctx context.Context) []*Achievement
- func (aq *AchievementQuery) Clone() *AchievementQuery
- func (aq *AchievementQuery) Count(ctx context.Context) (int, error)
- func (aq *AchievementQuery) CountX(ctx context.Context) int
- func (aq *AchievementQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AchievementQuery) ExistX(ctx context.Context) bool
- func (aq *AchievementQuery) First(ctx context.Context) (*Achievement, error)
- func (aq *AchievementQuery) FirstID(ctx context.Context) (id int, err error)
- func (aq *AchievementQuery) FirstIDX(ctx context.Context) int
- func (aq *AchievementQuery) FirstX(ctx context.Context) *Achievement
- func (aq *AchievementQuery) GroupBy(field string, fields ...string) *AchievementGroupBy
- func (aq *AchievementQuery) IDs(ctx context.Context) (ids []int, err error)
- func (aq *AchievementQuery) IDsX(ctx context.Context) []int
- func (aq *AchievementQuery) Limit(limit int) *AchievementQuery
- func (aq *AchievementQuery) Offset(offset int) *AchievementQuery
- func (aq *AchievementQuery) Only(ctx context.Context) (*Achievement, error)
- func (aq *AchievementQuery) OnlyID(ctx context.Context) (id int, err error)
- func (aq *AchievementQuery) OnlyIDX(ctx context.Context) int
- func (aq *AchievementQuery) OnlyX(ctx context.Context) *Achievement
- func (aq *AchievementQuery) Order(o ...OrderFunc) *AchievementQuery
- func (aq *AchievementQuery) QueryUser() *UserQuery
- func (aq *AchievementQuery) Select(fields ...string) *AchievementSelect
- func (aq *AchievementQuery) Unique(unique bool) *AchievementQuery
- func (aq *AchievementQuery) Where(ps ...predicate.Achievement) *AchievementQuery
- func (aq *AchievementQuery) WithUser(opts ...func(*UserQuery)) *AchievementQuery
- type AchievementSelect
- func (as *AchievementSelect) Aggregate(fns ...AggregateFunc) *AchievementSelect
- func (s *AchievementSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AchievementSelect) BoolX(ctx context.Context) bool
- func (s *AchievementSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AchievementSelect) BoolsX(ctx context.Context) []bool
- func (s *AchievementSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AchievementSelect) Float64X(ctx context.Context) float64
- func (s *AchievementSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AchievementSelect) Float64sX(ctx context.Context) []float64
- func (s *AchievementSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AchievementSelect) IntX(ctx context.Context) int
- func (s *AchievementSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AchievementSelect) IntsX(ctx context.Context) []int
- func (as *AchievementSelect) Scan(ctx context.Context, v any) error
- func (s *AchievementSelect) ScanX(ctx context.Context, v any)
- func (s *AchievementSelect) String(ctx context.Context) (_ string, err error)
- func (s *AchievementSelect) StringX(ctx context.Context) string
- func (s *AchievementSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AchievementSelect) StringsX(ctx context.Context) []string
- type AchievementUpdate
- func (au *AchievementUpdate) AddBfpGoal(f float64) *AchievementUpdate
- func (au *AchievementUpdate) ClearUser() *AchievementUpdate
- func (au *AchievementUpdate) Exec(ctx context.Context) error
- func (au *AchievementUpdate) ExecX(ctx context.Context)
- func (au *AchievementUpdate) Mutation() *AchievementMutation
- func (au *AchievementUpdate) Save(ctx context.Context) (int, error)
- func (au *AchievementUpdate) SaveX(ctx context.Context) int
- func (au *AchievementUpdate) SetBfpGoal(f float64) *AchievementUpdate
- func (au *AchievementUpdate) SetCreatedAt(t time.Time) *AchievementUpdate
- func (au *AchievementUpdate) SetNillableCreatedAt(t *time.Time) *AchievementUpdate
- func (au *AchievementUpdate) SetNillableStatus(s *string) *AchievementUpdate
- func (au *AchievementUpdate) SetNillableThumbnailImgURL(s *string) *AchievementUpdate
- func (au *AchievementUpdate) SetNillableUserID(id *int) *AchievementUpdate
- func (au *AchievementUpdate) SetStatus(s string) *AchievementUpdate
- func (au *AchievementUpdate) SetThumbnailImgURL(s string) *AchievementUpdate
- func (au *AchievementUpdate) SetUser(u *User) *AchievementUpdate
- func (au *AchievementUpdate) SetUserID(id int) *AchievementUpdate
- func (au *AchievementUpdate) Where(ps ...predicate.Achievement) *AchievementUpdate
- type AchievementUpdateOne
- func (auo *AchievementUpdateOne) AddBfpGoal(f float64) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) ClearUser() *AchievementUpdateOne
- func (auo *AchievementUpdateOne) Exec(ctx context.Context) error
- func (auo *AchievementUpdateOne) ExecX(ctx context.Context)
- func (auo *AchievementUpdateOne) Mutation() *AchievementMutation
- func (auo *AchievementUpdateOne) Save(ctx context.Context) (*Achievement, error)
- func (auo *AchievementUpdateOne) SaveX(ctx context.Context) *Achievement
- func (auo *AchievementUpdateOne) Select(field string, fields ...string) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) SetBfpGoal(f float64) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) SetCreatedAt(t time.Time) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) SetNillableCreatedAt(t *time.Time) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) SetNillableStatus(s *string) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) SetNillableThumbnailImgURL(s *string) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) SetNillableUserID(id *int) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) SetStatus(s string) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) SetThumbnailImgURL(s string) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) SetUser(u *User) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) SetUserID(id int) *AchievementUpdateOne
- func (auo *AchievementUpdateOne) Where(ps ...predicate.Achievement) *AchievementUpdateOne
- type Achievements
- type AggregateFunc
- type Article
- type ArticleClient
- func (c *ArticleClient) Create() *ArticleCreate
- func (c *ArticleClient) CreateBulk(builders ...*ArticleCreate) *ArticleCreateBulk
- func (c *ArticleClient) Delete() *ArticleDelete
- func (c *ArticleClient) DeleteOne(a *Article) *ArticleDeleteOne
- func (c *ArticleClient) DeleteOneID(id int) *ArticleDeleteOne
- func (c *ArticleClient) Get(ctx context.Context, id int) (*Article, error)
- func (c *ArticleClient) GetX(ctx context.Context, id int) *Article
- func (c *ArticleClient) Hooks() []Hook
- func (c *ArticleClient) Intercept(interceptors ...Interceptor)
- func (c *ArticleClient) Interceptors() []Interceptor
- func (c *ArticleClient) Query() *ArticleQuery
- func (c *ArticleClient) QueryTags(a *Article) *TagQuery
- func (c *ArticleClient) Update() *ArticleUpdate
- func (c *ArticleClient) UpdateOne(a *Article) *ArticleUpdateOne
- func (c *ArticleClient) UpdateOneID(id int) *ArticleUpdateOne
- func (c *ArticleClient) Use(hooks ...Hook)
- type ArticleCreate
- func (ac *ArticleCreate) AddTagIDs(ids ...int) *ArticleCreate
- func (ac *ArticleCreate) AddTags(t ...*Tag) *ArticleCreate
- func (ac *ArticleCreate) Exec(ctx context.Context) error
- func (ac *ArticleCreate) ExecX(ctx context.Context)
- func (ac *ArticleCreate) Mutation() *ArticleMutation
- func (ac *ArticleCreate) Save(ctx context.Context) (*Article, error)
- func (ac *ArticleCreate) SaveX(ctx context.Context) *Article
- func (ac *ArticleCreate) SetContent(s string) *ArticleCreate
- func (ac *ArticleCreate) SetCreatedAt(t time.Time) *ArticleCreate
- func (ac *ArticleCreate) SetNillableCreatedAt(t *time.Time) *ArticleCreate
- func (ac *ArticleCreate) SetNillableThumbnailImgURL(s *string) *ArticleCreate
- func (ac *ArticleCreate) SetThumbnailImgURL(s string) *ArticleCreate
- func (ac *ArticleCreate) SetTitle(s string) *ArticleCreate
- type ArticleCreateBulk
- type ArticleDelete
- type ArticleDeleteOne
- type ArticleEdges
- type ArticleGroupBy
- func (agb *ArticleGroupBy) Aggregate(fns ...AggregateFunc) *ArticleGroupBy
- func (s *ArticleGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ArticleGroupBy) BoolX(ctx context.Context) bool
- func (s *ArticleGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ArticleGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ArticleGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ArticleGroupBy) Float64X(ctx context.Context) float64
- func (s *ArticleGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ArticleGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ArticleGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ArticleGroupBy) IntX(ctx context.Context) int
- func (s *ArticleGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ArticleGroupBy) IntsX(ctx context.Context) []int
- func (agb *ArticleGroupBy) Scan(ctx context.Context, v any) error
- func (s *ArticleGroupBy) ScanX(ctx context.Context, v any)
- func (s *ArticleGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ArticleGroupBy) StringX(ctx context.Context) string
- func (s *ArticleGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ArticleGroupBy) StringsX(ctx context.Context) []string
- type ArticleMutation
- func (m *ArticleMutation) AddField(name string, value ent.Value) error
- func (m *ArticleMutation) AddTagIDs(ids ...int)
- func (m *ArticleMutation) AddedEdges() []string
- func (m *ArticleMutation) AddedField(name string) (ent.Value, bool)
- func (m *ArticleMutation) AddedFields() []string
- func (m *ArticleMutation) AddedIDs(name string) []ent.Value
- func (m *ArticleMutation) ClearEdge(name string) error
- func (m *ArticleMutation) ClearField(name string) error
- func (m *ArticleMutation) ClearTags()
- func (m *ArticleMutation) ClearedEdges() []string
- func (m *ArticleMutation) ClearedFields() []string
- func (m ArticleMutation) Client() *Client
- func (m *ArticleMutation) Content() (r string, exists bool)
- func (m *ArticleMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ArticleMutation) EdgeCleared(name string) bool
- func (m *ArticleMutation) Field(name string) (ent.Value, bool)
- func (m *ArticleMutation) FieldCleared(name string) bool
- func (m *ArticleMutation) Fields() []string
- func (m *ArticleMutation) ID() (id int, exists bool)
- func (m *ArticleMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ArticleMutation) OldContent(ctx context.Context) (v string, err error)
- func (m *ArticleMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ArticleMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ArticleMutation) OldThumbnailImgURL(ctx context.Context) (v string, err error)
- func (m *ArticleMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *ArticleMutation) Op() Op
- func (m *ArticleMutation) RemoveTagIDs(ids ...int)
- func (m *ArticleMutation) RemovedEdges() []string
- func (m *ArticleMutation) RemovedIDs(name string) []ent.Value
- func (m *ArticleMutation) RemovedTagsIDs() (ids []int)
- func (m *ArticleMutation) ResetContent()
- func (m *ArticleMutation) ResetCreatedAt()
- func (m *ArticleMutation) ResetEdge(name string) error
- func (m *ArticleMutation) ResetField(name string) error
- func (m *ArticleMutation) ResetTags()
- func (m *ArticleMutation) ResetThumbnailImgURL()
- func (m *ArticleMutation) ResetTitle()
- func (m *ArticleMutation) SetContent(s string)
- func (m *ArticleMutation) SetCreatedAt(t time.Time)
- func (m *ArticleMutation) SetField(name string, value ent.Value) error
- func (m *ArticleMutation) SetOp(op Op)
- func (m *ArticleMutation) SetThumbnailImgURL(s string)
- func (m *ArticleMutation) SetTitle(s string)
- func (m *ArticleMutation) TagsCleared() bool
- func (m *ArticleMutation) TagsIDs() (ids []int)
- func (m *ArticleMutation) ThumbnailImgURL() (r string, exists bool)
- func (m *ArticleMutation) Title() (r string, exists bool)
- func (m ArticleMutation) Tx() (*Tx, error)
- func (m *ArticleMutation) Type() string
- func (m *ArticleMutation) Where(ps ...predicate.Article)
- func (m *ArticleMutation) WhereP(ps ...func(*sql.Selector))
- type ArticleQuery
- func (aq *ArticleQuery) Aggregate(fns ...AggregateFunc) *ArticleSelect
- func (aq *ArticleQuery) All(ctx context.Context) ([]*Article, error)
- func (aq *ArticleQuery) AllX(ctx context.Context) []*Article
- func (aq *ArticleQuery) Clone() *ArticleQuery
- func (aq *ArticleQuery) Count(ctx context.Context) (int, error)
- func (aq *ArticleQuery) CountX(ctx context.Context) int
- func (aq *ArticleQuery) Exist(ctx context.Context) (bool, error)
- func (aq *ArticleQuery) ExistX(ctx context.Context) bool
- func (aq *ArticleQuery) First(ctx context.Context) (*Article, error)
- func (aq *ArticleQuery) FirstID(ctx context.Context) (id int, err error)
- func (aq *ArticleQuery) FirstIDX(ctx context.Context) int
- func (aq *ArticleQuery) FirstX(ctx context.Context) *Article
- func (aq *ArticleQuery) GroupBy(field string, fields ...string) *ArticleGroupBy
- func (aq *ArticleQuery) IDs(ctx context.Context) (ids []int, err error)
- func (aq *ArticleQuery) IDsX(ctx context.Context) []int
- func (aq *ArticleQuery) Limit(limit int) *ArticleQuery
- func (aq *ArticleQuery) Offset(offset int) *ArticleQuery
- func (aq *ArticleQuery) Only(ctx context.Context) (*Article, error)
- func (aq *ArticleQuery) OnlyID(ctx context.Context) (id int, err error)
- func (aq *ArticleQuery) OnlyIDX(ctx context.Context) int
- func (aq *ArticleQuery) OnlyX(ctx context.Context) *Article
- func (aq *ArticleQuery) Order(o ...OrderFunc) *ArticleQuery
- func (aq *ArticleQuery) QueryTags() *TagQuery
- func (aq *ArticleQuery) Select(fields ...string) *ArticleSelect
- func (aq *ArticleQuery) Unique(unique bool) *ArticleQuery
- func (aq *ArticleQuery) Where(ps ...predicate.Article) *ArticleQuery
- func (aq *ArticleQuery) WithTags(opts ...func(*TagQuery)) *ArticleQuery
- type ArticleSelect
- func (as *ArticleSelect) Aggregate(fns ...AggregateFunc) *ArticleSelect
- func (s *ArticleSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ArticleSelect) BoolX(ctx context.Context) bool
- func (s *ArticleSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ArticleSelect) BoolsX(ctx context.Context) []bool
- func (s *ArticleSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ArticleSelect) Float64X(ctx context.Context) float64
- func (s *ArticleSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ArticleSelect) Float64sX(ctx context.Context) []float64
- func (s *ArticleSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ArticleSelect) IntX(ctx context.Context) int
- func (s *ArticleSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ArticleSelect) IntsX(ctx context.Context) []int
- func (as *ArticleSelect) Scan(ctx context.Context, v any) error
- func (s *ArticleSelect) ScanX(ctx context.Context, v any)
- func (s *ArticleSelect) String(ctx context.Context) (_ string, err error)
- func (s *ArticleSelect) StringX(ctx context.Context) string
- func (s *ArticleSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ArticleSelect) StringsX(ctx context.Context) []string
- type ArticleUpdate
- func (au *ArticleUpdate) AddTagIDs(ids ...int) *ArticleUpdate
- func (au *ArticleUpdate) AddTags(t ...*Tag) *ArticleUpdate
- func (au *ArticleUpdate) ClearTags() *ArticleUpdate
- func (au *ArticleUpdate) Exec(ctx context.Context) error
- func (au *ArticleUpdate) ExecX(ctx context.Context)
- func (au *ArticleUpdate) Mutation() *ArticleMutation
- func (au *ArticleUpdate) RemoveTagIDs(ids ...int) *ArticleUpdate
- func (au *ArticleUpdate) RemoveTags(t ...*Tag) *ArticleUpdate
- func (au *ArticleUpdate) Save(ctx context.Context) (int, error)
- func (au *ArticleUpdate) SaveX(ctx context.Context) int
- func (au *ArticleUpdate) SetContent(s string) *ArticleUpdate
- func (au *ArticleUpdate) SetCreatedAt(t time.Time) *ArticleUpdate
- func (au *ArticleUpdate) SetNillableCreatedAt(t *time.Time) *ArticleUpdate
- func (au *ArticleUpdate) SetNillableThumbnailImgURL(s *string) *ArticleUpdate
- func (au *ArticleUpdate) SetThumbnailImgURL(s string) *ArticleUpdate
- func (au *ArticleUpdate) SetTitle(s string) *ArticleUpdate
- func (au *ArticleUpdate) Where(ps ...predicate.Article) *ArticleUpdate
- type ArticleUpdateOne
- func (auo *ArticleUpdateOne) AddTagIDs(ids ...int) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) AddTags(t ...*Tag) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) ClearTags() *ArticleUpdateOne
- func (auo *ArticleUpdateOne) Exec(ctx context.Context) error
- func (auo *ArticleUpdateOne) ExecX(ctx context.Context)
- func (auo *ArticleUpdateOne) Mutation() *ArticleMutation
- func (auo *ArticleUpdateOne) RemoveTagIDs(ids ...int) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) RemoveTags(t ...*Tag) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) Save(ctx context.Context) (*Article, error)
- func (auo *ArticleUpdateOne) SaveX(ctx context.Context) *Article
- func (auo *ArticleUpdateOne) Select(field string, fields ...string) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetContent(s string) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetCreatedAt(t time.Time) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetNillableCreatedAt(t *time.Time) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetNillableThumbnailImgURL(s *string) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetThumbnailImgURL(s string) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetTitle(s string) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) Where(ps ...predicate.Article) *ArticleUpdateOne
- type Articles
- type BFPDataPoint
- type BFPDataPointClient
- func (c *BFPDataPointClient) Create() *BFPDataPointCreate
- func (c *BFPDataPointClient) CreateBulk(builders ...*BFPDataPointCreate) *BFPDataPointCreateBulk
- func (c *BFPDataPointClient) Delete() *BFPDataPointDelete
- func (c *BFPDataPointClient) DeleteOne(bdp *BFPDataPoint) *BFPDataPointDeleteOne
- func (c *BFPDataPointClient) DeleteOneID(id int) *BFPDataPointDeleteOne
- func (c *BFPDataPointClient) Get(ctx context.Context, id int) (*BFPDataPoint, error)
- func (c *BFPDataPointClient) GetX(ctx context.Context, id int) *BFPDataPoint
- func (c *BFPDataPointClient) Hooks() []Hook
- func (c *BFPDataPointClient) Intercept(interceptors ...Interceptor)
- func (c *BFPDataPointClient) Interceptors() []Interceptor
- func (c *BFPDataPointClient) Query() *BFPDataPointQuery
- func (c *BFPDataPointClient) QueryUser(bdp *BFPDataPoint) *UserQuery
- func (c *BFPDataPointClient) Update() *BFPDataPointUpdate
- func (c *BFPDataPointClient) UpdateOne(bdp *BFPDataPoint) *BFPDataPointUpdateOne
- func (c *BFPDataPointClient) UpdateOneID(id int) *BFPDataPointUpdateOne
- func (c *BFPDataPointClient) Use(hooks ...Hook)
- type BFPDataPointCreate
- func (bdpc *BFPDataPointCreate) Exec(ctx context.Context) error
- func (bdpc *BFPDataPointCreate) ExecX(ctx context.Context)
- func (bdpc *BFPDataPointCreate) Mutation() *BFPDataPointMutation
- func (bdpc *BFPDataPointCreate) Save(ctx context.Context) (*BFPDataPoint, error)
- func (bdpc *BFPDataPointCreate) SaveX(ctx context.Context) *BFPDataPoint
- func (bdpc *BFPDataPointCreate) SetCreatedAt(t time.Time) *BFPDataPointCreate
- func (bdpc *BFPDataPointCreate) SetFatPercentage(f float64) *BFPDataPointCreate
- func (bdpc *BFPDataPointCreate) SetNillableCreatedAt(t *time.Time) *BFPDataPointCreate
- func (bdpc *BFPDataPointCreate) SetNillableUserID(id *int) *BFPDataPointCreate
- func (bdpc *BFPDataPointCreate) SetTotalWeight(i int) *BFPDataPointCreate
- func (bdpc *BFPDataPointCreate) SetUser(u *User) *BFPDataPointCreate
- func (bdpc *BFPDataPointCreate) SetUserID(id int) *BFPDataPointCreate
- type BFPDataPointCreateBulk
- func (bdpcb *BFPDataPointCreateBulk) Exec(ctx context.Context) error
- func (bdpcb *BFPDataPointCreateBulk) ExecX(ctx context.Context)
- func (bdpcb *BFPDataPointCreateBulk) Save(ctx context.Context) ([]*BFPDataPoint, error)
- func (bdpcb *BFPDataPointCreateBulk) SaveX(ctx context.Context) []*BFPDataPoint
- type BFPDataPointDelete
- type BFPDataPointDeleteOne
- type BFPDataPointEdges
- type BFPDataPointGroupBy
- func (bdpgb *BFPDataPointGroupBy) Aggregate(fns ...AggregateFunc) *BFPDataPointGroupBy
- func (s *BFPDataPointGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BFPDataPointGroupBy) BoolX(ctx context.Context) bool
- func (s *BFPDataPointGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BFPDataPointGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BFPDataPointGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BFPDataPointGroupBy) Float64X(ctx context.Context) float64
- func (s *BFPDataPointGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BFPDataPointGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BFPDataPointGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BFPDataPointGroupBy) IntX(ctx context.Context) int
- func (s *BFPDataPointGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BFPDataPointGroupBy) IntsX(ctx context.Context) []int
- func (bdpgb *BFPDataPointGroupBy) Scan(ctx context.Context, v any) error
- func (s *BFPDataPointGroupBy) ScanX(ctx context.Context, v any)
- func (s *BFPDataPointGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BFPDataPointGroupBy) StringX(ctx context.Context) string
- func (s *BFPDataPointGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BFPDataPointGroupBy) StringsX(ctx context.Context) []string
- type BFPDataPointMutation
- func (m *BFPDataPointMutation) AddFatPercentage(f float64)
- func (m *BFPDataPointMutation) AddField(name string, value ent.Value) error
- func (m *BFPDataPointMutation) AddTotalWeight(i int)
- func (m *BFPDataPointMutation) AddedEdges() []string
- func (m *BFPDataPointMutation) AddedFatPercentage() (r float64, exists bool)
- func (m *BFPDataPointMutation) AddedField(name string) (ent.Value, bool)
- func (m *BFPDataPointMutation) AddedFields() []string
- func (m *BFPDataPointMutation) AddedIDs(name string) []ent.Value
- func (m *BFPDataPointMutation) AddedTotalWeight() (r int, exists bool)
- func (m *BFPDataPointMutation) ClearEdge(name string) error
- func (m *BFPDataPointMutation) ClearField(name string) error
- func (m *BFPDataPointMutation) ClearUser()
- func (m *BFPDataPointMutation) ClearedEdges() []string
- func (m *BFPDataPointMutation) ClearedFields() []string
- func (m BFPDataPointMutation) Client() *Client
- func (m *BFPDataPointMutation) CreatedAt() (r time.Time, exists bool)
- func (m *BFPDataPointMutation) EdgeCleared(name string) bool
- func (m *BFPDataPointMutation) FatPercentage() (r float64, exists bool)
- func (m *BFPDataPointMutation) Field(name string) (ent.Value, bool)
- func (m *BFPDataPointMutation) FieldCleared(name string) bool
- func (m *BFPDataPointMutation) Fields() []string
- func (m *BFPDataPointMutation) ID() (id int, exists bool)
- func (m *BFPDataPointMutation) IDs(ctx context.Context) ([]int, error)
- func (m *BFPDataPointMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *BFPDataPointMutation) OldFatPercentage(ctx context.Context) (v float64, err error)
- func (m *BFPDataPointMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BFPDataPointMutation) OldTotalWeight(ctx context.Context) (v int, err error)
- func (m *BFPDataPointMutation) Op() Op
- func (m *BFPDataPointMutation) RemovedEdges() []string
- func (m *BFPDataPointMutation) RemovedIDs(name string) []ent.Value
- func (m *BFPDataPointMutation) ResetCreatedAt()
- func (m *BFPDataPointMutation) ResetEdge(name string) error
- func (m *BFPDataPointMutation) ResetFatPercentage()
- func (m *BFPDataPointMutation) ResetField(name string) error
- func (m *BFPDataPointMutation) ResetTotalWeight()
- func (m *BFPDataPointMutation) ResetUser()
- func (m *BFPDataPointMutation) SetCreatedAt(t time.Time)
- func (m *BFPDataPointMutation) SetFatPercentage(f float64)
- func (m *BFPDataPointMutation) SetField(name string, value ent.Value) error
- func (m *BFPDataPointMutation) SetOp(op Op)
- func (m *BFPDataPointMutation) SetTotalWeight(i int)
- func (m *BFPDataPointMutation) SetUserID(id int)
- func (m *BFPDataPointMutation) TotalWeight() (r int, exists bool)
- func (m BFPDataPointMutation) Tx() (*Tx, error)
- func (m *BFPDataPointMutation) Type() string
- func (m *BFPDataPointMutation) UserCleared() bool
- func (m *BFPDataPointMutation) UserID() (id int, exists bool)
- func (m *BFPDataPointMutation) UserIDs() (ids []int)
- func (m *BFPDataPointMutation) Where(ps ...predicate.BFPDataPoint)
- func (m *BFPDataPointMutation) WhereP(ps ...func(*sql.Selector))
- type BFPDataPointQuery
- func (bdpq *BFPDataPointQuery) Aggregate(fns ...AggregateFunc) *BFPDataPointSelect
- func (bdpq *BFPDataPointQuery) All(ctx context.Context) ([]*BFPDataPoint, error)
- func (bdpq *BFPDataPointQuery) AllX(ctx context.Context) []*BFPDataPoint
- func (bdpq *BFPDataPointQuery) Clone() *BFPDataPointQuery
- func (bdpq *BFPDataPointQuery) Count(ctx context.Context) (int, error)
- func (bdpq *BFPDataPointQuery) CountX(ctx context.Context) int
- func (bdpq *BFPDataPointQuery) Exist(ctx context.Context) (bool, error)
- func (bdpq *BFPDataPointQuery) ExistX(ctx context.Context) bool
- func (bdpq *BFPDataPointQuery) First(ctx context.Context) (*BFPDataPoint, error)
- func (bdpq *BFPDataPointQuery) FirstID(ctx context.Context) (id int, err error)
- func (bdpq *BFPDataPointQuery) FirstIDX(ctx context.Context) int
- func (bdpq *BFPDataPointQuery) FirstX(ctx context.Context) *BFPDataPoint
- func (bdpq *BFPDataPointQuery) GroupBy(field string, fields ...string) *BFPDataPointGroupBy
- func (bdpq *BFPDataPointQuery) IDs(ctx context.Context) (ids []int, err error)
- func (bdpq *BFPDataPointQuery) IDsX(ctx context.Context) []int
- func (bdpq *BFPDataPointQuery) Limit(limit int) *BFPDataPointQuery
- func (bdpq *BFPDataPointQuery) Offset(offset int) *BFPDataPointQuery
- func (bdpq *BFPDataPointQuery) Only(ctx context.Context) (*BFPDataPoint, error)
- func (bdpq *BFPDataPointQuery) OnlyID(ctx context.Context) (id int, err error)
- func (bdpq *BFPDataPointQuery) OnlyIDX(ctx context.Context) int
- func (bdpq *BFPDataPointQuery) OnlyX(ctx context.Context) *BFPDataPoint
- func (bdpq *BFPDataPointQuery) Order(o ...OrderFunc) *BFPDataPointQuery
- func (bdpq *BFPDataPointQuery) QueryUser() *UserQuery
- func (bdpq *BFPDataPointQuery) Select(fields ...string) *BFPDataPointSelect
- func (bdpq *BFPDataPointQuery) Unique(unique bool) *BFPDataPointQuery
- func (bdpq *BFPDataPointQuery) Where(ps ...predicate.BFPDataPoint) *BFPDataPointQuery
- func (bdpq *BFPDataPointQuery) WithUser(opts ...func(*UserQuery)) *BFPDataPointQuery
- type BFPDataPointSelect
- func (bdps *BFPDataPointSelect) Aggregate(fns ...AggregateFunc) *BFPDataPointSelect
- func (s *BFPDataPointSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BFPDataPointSelect) BoolX(ctx context.Context) bool
- func (s *BFPDataPointSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BFPDataPointSelect) BoolsX(ctx context.Context) []bool
- func (s *BFPDataPointSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BFPDataPointSelect) Float64X(ctx context.Context) float64
- func (s *BFPDataPointSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BFPDataPointSelect) Float64sX(ctx context.Context) []float64
- func (s *BFPDataPointSelect) Int(ctx context.Context) (_ int, err error)
- func (s *BFPDataPointSelect) IntX(ctx context.Context) int
- func (s *BFPDataPointSelect) Ints(ctx context.Context) ([]int, error)
- func (s *BFPDataPointSelect) IntsX(ctx context.Context) []int
- func (bdps *BFPDataPointSelect) Scan(ctx context.Context, v any) error
- func (s *BFPDataPointSelect) ScanX(ctx context.Context, v any)
- func (s *BFPDataPointSelect) String(ctx context.Context) (_ string, err error)
- func (s *BFPDataPointSelect) StringX(ctx context.Context) string
- func (s *BFPDataPointSelect) Strings(ctx context.Context) ([]string, error)
- func (s *BFPDataPointSelect) StringsX(ctx context.Context) []string
- type BFPDataPointUpdate
- func (bdpu *BFPDataPointUpdate) AddFatPercentage(f float64) *BFPDataPointUpdate
- func (bdpu *BFPDataPointUpdate) AddTotalWeight(i int) *BFPDataPointUpdate
- func (bdpu *BFPDataPointUpdate) ClearUser() *BFPDataPointUpdate
- func (bdpu *BFPDataPointUpdate) Exec(ctx context.Context) error
- func (bdpu *BFPDataPointUpdate) ExecX(ctx context.Context)
- func (bdpu *BFPDataPointUpdate) Mutation() *BFPDataPointMutation
- func (bdpu *BFPDataPointUpdate) Save(ctx context.Context) (int, error)
- func (bdpu *BFPDataPointUpdate) SaveX(ctx context.Context) int
- func (bdpu *BFPDataPointUpdate) SetCreatedAt(t time.Time) *BFPDataPointUpdate
- func (bdpu *BFPDataPointUpdate) SetFatPercentage(f float64) *BFPDataPointUpdate
- func (bdpu *BFPDataPointUpdate) SetNillableCreatedAt(t *time.Time) *BFPDataPointUpdate
- func (bdpu *BFPDataPointUpdate) SetNillableUserID(id *int) *BFPDataPointUpdate
- func (bdpu *BFPDataPointUpdate) SetTotalWeight(i int) *BFPDataPointUpdate
- func (bdpu *BFPDataPointUpdate) SetUser(u *User) *BFPDataPointUpdate
- func (bdpu *BFPDataPointUpdate) SetUserID(id int) *BFPDataPointUpdate
- func (bdpu *BFPDataPointUpdate) Where(ps ...predicate.BFPDataPoint) *BFPDataPointUpdate
- type BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) AddFatPercentage(f float64) *BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) AddTotalWeight(i int) *BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) ClearUser() *BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) Exec(ctx context.Context) error
- func (bdpuo *BFPDataPointUpdateOne) ExecX(ctx context.Context)
- func (bdpuo *BFPDataPointUpdateOne) Mutation() *BFPDataPointMutation
- func (bdpuo *BFPDataPointUpdateOne) Save(ctx context.Context) (*BFPDataPoint, error)
- func (bdpuo *BFPDataPointUpdateOne) SaveX(ctx context.Context) *BFPDataPoint
- func (bdpuo *BFPDataPointUpdateOne) Select(field string, fields ...string) *BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) SetCreatedAt(t time.Time) *BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) SetFatPercentage(f float64) *BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) SetNillableCreatedAt(t *time.Time) *BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) SetNillableUserID(id *int) *BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) SetTotalWeight(i int) *BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) SetUser(u *User) *BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) SetUserID(id int) *BFPDataPointUpdateOne
- func (bdpuo *BFPDataPointUpdateOne) Where(ps ...predicate.BFPDataPoint) *BFPDataPointUpdateOne
- type BFPDataPoints
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type Meal
- type MealClient
- func (c *MealClient) Create() *MealCreate
- func (c *MealClient) CreateBulk(builders ...*MealCreate) *MealCreateBulk
- func (c *MealClient) Delete() *MealDelete
- func (c *MealClient) DeleteOne(m *Meal) *MealDeleteOne
- func (c *MealClient) DeleteOneID(id int) *MealDeleteOne
- func (c *MealClient) Get(ctx context.Context, id int) (*Meal, error)
- func (c *MealClient) GetX(ctx context.Context, id int) *Meal
- func (c *MealClient) Hooks() []Hook
- func (c *MealClient) Intercept(interceptors ...Interceptor)
- func (c *MealClient) Interceptors() []Interceptor
- func (c *MealClient) Query() *MealQuery
- func (c *MealClient) QueryUser(m *Meal) *UserQuery
- func (c *MealClient) Update() *MealUpdate
- func (c *MealClient) UpdateOne(m *Meal) *MealUpdateOne
- func (c *MealClient) UpdateOneID(id int) *MealUpdateOne
- func (c *MealClient) Use(hooks ...Hook)
- type MealCreate
- func (mc *MealCreate) Exec(ctx context.Context) error
- func (mc *MealCreate) ExecX(ctx context.Context)
- func (mc *MealCreate) Mutation() *MealMutation
- func (mc *MealCreate) Save(ctx context.Context) (*Meal, error)
- func (mc *MealCreate) SaveX(ctx context.Context) *Meal
- func (mc *MealCreate) SetCreatedAt(t time.Time) *MealCreate
- func (mc *MealCreate) SetImageURL(s string) *MealCreate
- func (mc *MealCreate) SetMealType(s string) *MealCreate
- func (mc *MealCreate) SetNillableCreatedAt(t *time.Time) *MealCreate
- func (mc *MealCreate) SetNillableImageURL(s *string) *MealCreate
- func (mc *MealCreate) SetNillableUserID(id *int) *MealCreate
- func (mc *MealCreate) SetUser(u *User) *MealCreate
- func (mc *MealCreate) SetUserID(id int) *MealCreate
- type MealCreateBulk
- type MealDelete
- type MealDeleteOne
- type MealEdges
- type MealGroupBy
- func (mgb *MealGroupBy) Aggregate(fns ...AggregateFunc) *MealGroupBy
- func (s *MealGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *MealGroupBy) BoolX(ctx context.Context) bool
- func (s *MealGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *MealGroupBy) BoolsX(ctx context.Context) []bool
- func (s *MealGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *MealGroupBy) Float64X(ctx context.Context) float64
- func (s *MealGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *MealGroupBy) Float64sX(ctx context.Context) []float64
- func (s *MealGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *MealGroupBy) IntX(ctx context.Context) int
- func (s *MealGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *MealGroupBy) IntsX(ctx context.Context) []int
- func (mgb *MealGroupBy) Scan(ctx context.Context, v any) error
- func (s *MealGroupBy) ScanX(ctx context.Context, v any)
- func (s *MealGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *MealGroupBy) StringX(ctx context.Context) string
- func (s *MealGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *MealGroupBy) StringsX(ctx context.Context) []string
- type MealMutation
- func (m *MealMutation) AddField(name string, value ent.Value) error
- func (m *MealMutation) AddedEdges() []string
- func (m *MealMutation) AddedField(name string) (ent.Value, bool)
- func (m *MealMutation) AddedFields() []string
- func (m *MealMutation) AddedIDs(name string) []ent.Value
- func (m *MealMutation) ClearEdge(name string) error
- func (m *MealMutation) ClearField(name string) error
- func (m *MealMutation) ClearUser()
- func (m *MealMutation) ClearedEdges() []string
- func (m *MealMutation) ClearedFields() []string
- func (m MealMutation) Client() *Client
- func (m *MealMutation) CreatedAt() (r time.Time, exists bool)
- func (m *MealMutation) EdgeCleared(name string) bool
- func (m *MealMutation) Field(name string) (ent.Value, bool)
- func (m *MealMutation) FieldCleared(name string) bool
- func (m *MealMutation) Fields() []string
- func (m *MealMutation) ID() (id int, exists bool)
- func (m *MealMutation) IDs(ctx context.Context) ([]int, error)
- func (m *MealMutation) ImageURL() (r string, exists bool)
- func (m *MealMutation) MealType() (r string, exists bool)
- func (m *MealMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *MealMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *MealMutation) OldImageURL(ctx context.Context) (v string, err error)
- func (m *MealMutation) OldMealType(ctx context.Context) (v string, err error)
- func (m *MealMutation) Op() Op
- func (m *MealMutation) RemovedEdges() []string
- func (m *MealMutation) RemovedIDs(name string) []ent.Value
- func (m *MealMutation) ResetCreatedAt()
- func (m *MealMutation) ResetEdge(name string) error
- func (m *MealMutation) ResetField(name string) error
- func (m *MealMutation) ResetImageURL()
- func (m *MealMutation) ResetMealType()
- func (m *MealMutation) ResetUser()
- func (m *MealMutation) SetCreatedAt(t time.Time)
- func (m *MealMutation) SetField(name string, value ent.Value) error
- func (m *MealMutation) SetImageURL(s string)
- func (m *MealMutation) SetMealType(s string)
- func (m *MealMutation) SetOp(op Op)
- func (m *MealMutation) SetUserID(id int)
- func (m MealMutation) Tx() (*Tx, error)
- func (m *MealMutation) Type() string
- func (m *MealMutation) UserCleared() bool
- func (m *MealMutation) UserID() (id int, exists bool)
- func (m *MealMutation) UserIDs() (ids []int)
- func (m *MealMutation) Where(ps ...predicate.Meal)
- func (m *MealMutation) WhereP(ps ...func(*sql.Selector))
- type MealQuery
- func (mq *MealQuery) Aggregate(fns ...AggregateFunc) *MealSelect
- func (mq *MealQuery) All(ctx context.Context) ([]*Meal, error)
- func (mq *MealQuery) AllX(ctx context.Context) []*Meal
- func (mq *MealQuery) Clone() *MealQuery
- func (mq *MealQuery) Count(ctx context.Context) (int, error)
- func (mq *MealQuery) CountX(ctx context.Context) int
- func (mq *MealQuery) Exist(ctx context.Context) (bool, error)
- func (mq *MealQuery) ExistX(ctx context.Context) bool
- func (mq *MealQuery) First(ctx context.Context) (*Meal, error)
- func (mq *MealQuery) FirstID(ctx context.Context) (id int, err error)
- func (mq *MealQuery) FirstIDX(ctx context.Context) int
- func (mq *MealQuery) FirstX(ctx context.Context) *Meal
- func (mq *MealQuery) GroupBy(field string, fields ...string) *MealGroupBy
- func (mq *MealQuery) IDs(ctx context.Context) (ids []int, err error)
- func (mq *MealQuery) IDsX(ctx context.Context) []int
- func (mq *MealQuery) Limit(limit int) *MealQuery
- func (mq *MealQuery) Offset(offset int) *MealQuery
- func (mq *MealQuery) Only(ctx context.Context) (*Meal, error)
- func (mq *MealQuery) OnlyID(ctx context.Context) (id int, err error)
- func (mq *MealQuery) OnlyIDX(ctx context.Context) int
- func (mq *MealQuery) OnlyX(ctx context.Context) *Meal
- func (mq *MealQuery) Order(o ...OrderFunc) *MealQuery
- func (mq *MealQuery) QueryUser() *UserQuery
- func (mq *MealQuery) Select(fields ...string) *MealSelect
- func (mq *MealQuery) Unique(unique bool) *MealQuery
- func (mq *MealQuery) Where(ps ...predicate.Meal) *MealQuery
- func (mq *MealQuery) WithUser(opts ...func(*UserQuery)) *MealQuery
- type MealSelect
- func (ms *MealSelect) Aggregate(fns ...AggregateFunc) *MealSelect
- func (s *MealSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *MealSelect) BoolX(ctx context.Context) bool
- func (s *MealSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *MealSelect) BoolsX(ctx context.Context) []bool
- func (s *MealSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *MealSelect) Float64X(ctx context.Context) float64
- func (s *MealSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *MealSelect) Float64sX(ctx context.Context) []float64
- func (s *MealSelect) Int(ctx context.Context) (_ int, err error)
- func (s *MealSelect) IntX(ctx context.Context) int
- func (s *MealSelect) Ints(ctx context.Context) ([]int, error)
- func (s *MealSelect) IntsX(ctx context.Context) []int
- func (ms *MealSelect) Scan(ctx context.Context, v any) error
- func (s *MealSelect) ScanX(ctx context.Context, v any)
- func (s *MealSelect) String(ctx context.Context) (_ string, err error)
- func (s *MealSelect) StringX(ctx context.Context) string
- func (s *MealSelect) Strings(ctx context.Context) ([]string, error)
- func (s *MealSelect) StringsX(ctx context.Context) []string
- type MealUpdate
- func (mu *MealUpdate) ClearUser() *MealUpdate
- func (mu *MealUpdate) Exec(ctx context.Context) error
- func (mu *MealUpdate) ExecX(ctx context.Context)
- func (mu *MealUpdate) Mutation() *MealMutation
- func (mu *MealUpdate) Save(ctx context.Context) (int, error)
- func (mu *MealUpdate) SaveX(ctx context.Context) int
- func (mu *MealUpdate) SetCreatedAt(t time.Time) *MealUpdate
- func (mu *MealUpdate) SetImageURL(s string) *MealUpdate
- func (mu *MealUpdate) SetMealType(s string) *MealUpdate
- func (mu *MealUpdate) SetNillableCreatedAt(t *time.Time) *MealUpdate
- func (mu *MealUpdate) SetNillableImageURL(s *string) *MealUpdate
- func (mu *MealUpdate) SetNillableUserID(id *int) *MealUpdate
- func (mu *MealUpdate) SetUser(u *User) *MealUpdate
- func (mu *MealUpdate) SetUserID(id int) *MealUpdate
- func (mu *MealUpdate) Where(ps ...predicate.Meal) *MealUpdate
- type MealUpdateOne
- func (muo *MealUpdateOne) ClearUser() *MealUpdateOne
- func (muo *MealUpdateOne) Exec(ctx context.Context) error
- func (muo *MealUpdateOne) ExecX(ctx context.Context)
- func (muo *MealUpdateOne) Mutation() *MealMutation
- func (muo *MealUpdateOne) Save(ctx context.Context) (*Meal, error)
- func (muo *MealUpdateOne) SaveX(ctx context.Context) *Meal
- func (muo *MealUpdateOne) Select(field string, fields ...string) *MealUpdateOne
- func (muo *MealUpdateOne) SetCreatedAt(t time.Time) *MealUpdateOne
- func (muo *MealUpdateOne) SetImageURL(s string) *MealUpdateOne
- func (muo *MealUpdateOne) SetMealType(s string) *MealUpdateOne
- func (muo *MealUpdateOne) SetNillableCreatedAt(t *time.Time) *MealUpdateOne
- func (muo *MealUpdateOne) SetNillableImageURL(s *string) *MealUpdateOne
- func (muo *MealUpdateOne) SetNillableUserID(id *int) *MealUpdateOne
- func (muo *MealUpdateOne) SetUser(u *User) *MealUpdateOne
- func (muo *MealUpdateOne) SetUserID(id int) *MealUpdateOne
- func (muo *MealUpdateOne) Where(ps ...predicate.Meal) *MealUpdateOne
- type Meals
- 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 Tag
- type TagClient
- func (c *TagClient) Create() *TagCreate
- func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk
- func (c *TagClient) Delete() *TagDelete
- func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne
- func (c *TagClient) DeleteOneID(id int) *TagDeleteOne
- func (c *TagClient) Get(ctx context.Context, id int) (*Tag, error)
- func (c *TagClient) GetX(ctx context.Context, id int) *Tag
- func (c *TagClient) Hooks() []Hook
- func (c *TagClient) Intercept(interceptors ...Interceptor)
- func (c *TagClient) Interceptors() []Interceptor
- func (c *TagClient) Query() *TagQuery
- func (c *TagClient) QueryArticle(t *Tag) *ArticleQuery
- func (c *TagClient) Update() *TagUpdate
- func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne
- func (c *TagClient) UpdateOneID(id int) *TagUpdateOne
- func (c *TagClient) Use(hooks ...Hook)
- type TagCreate
- func (tc *TagCreate) Exec(ctx context.Context) error
- func (tc *TagCreate) ExecX(ctx context.Context)
- func (tc *TagCreate) Mutation() *TagMutation
- func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)
- func (tc *TagCreate) SaveX(ctx context.Context) *Tag
- func (tc *TagCreate) SetArticle(a *Article) *TagCreate
- func (tc *TagCreate) SetArticleID(id int) *TagCreate
- func (tc *TagCreate) SetCreatedAt(t time.Time) *TagCreate
- func (tc *TagCreate) SetNillableArticleID(id *int) *TagCreate
- func (tc *TagCreate) SetNillableCreatedAt(t *time.Time) *TagCreate
- func (tc *TagCreate) SetTagName(s string) *TagCreate
- type TagCreateBulk
- type TagDelete
- type TagDeleteOne
- type TagEdges
- type TagGroupBy
- func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy
- func (s *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TagGroupBy) BoolX(ctx context.Context) bool
- func (s *TagGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TagGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TagGroupBy) Float64X(ctx context.Context) float64
- func (s *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TagGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TagGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TagGroupBy) IntX(ctx context.Context) int
- func (s *TagGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TagGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error
- func (s *TagGroupBy) ScanX(ctx context.Context, v any)
- func (s *TagGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TagGroupBy) StringX(ctx context.Context) string
- func (s *TagGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TagGroupBy) StringsX(ctx context.Context) []string
- type TagMutation
- func (m *TagMutation) AddField(name string, value ent.Value) error
- func (m *TagMutation) AddedEdges() []string
- func (m *TagMutation) AddedField(name string) (ent.Value, bool)
- func (m *TagMutation) AddedFields() []string
- func (m *TagMutation) AddedIDs(name string) []ent.Value
- func (m *TagMutation) ArticleCleared() bool
- func (m *TagMutation) ArticleID() (id int, exists bool)
- func (m *TagMutation) ArticleIDs() (ids []int)
- func (m *TagMutation) ClearArticle()
- func (m *TagMutation) ClearEdge(name string) error
- func (m *TagMutation) ClearField(name string) error
- func (m *TagMutation) ClearedEdges() []string
- func (m *TagMutation) ClearedFields() []string
- func (m TagMutation) Client() *Client
- func (m *TagMutation) CreatedAt() (r time.Time, exists bool)
- func (m *TagMutation) EdgeCleared(name string) bool
- func (m *TagMutation) Field(name string) (ent.Value, bool)
- func (m *TagMutation) FieldCleared(name string) bool
- func (m *TagMutation) Fields() []string
- func (m *TagMutation) ID() (id int, exists bool)
- func (m *TagMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TagMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TagMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TagMutation) OldTagName(ctx context.Context) (v string, err error)
- func (m *TagMutation) Op() Op
- func (m *TagMutation) RemovedEdges() []string
- func (m *TagMutation) RemovedIDs(name string) []ent.Value
- func (m *TagMutation) ResetArticle()
- func (m *TagMutation) ResetCreatedAt()
- func (m *TagMutation) ResetEdge(name string) error
- func (m *TagMutation) ResetField(name string) error
- func (m *TagMutation) ResetTagName()
- func (m *TagMutation) SetArticleID(id int)
- func (m *TagMutation) SetCreatedAt(t time.Time)
- func (m *TagMutation) SetField(name string, value ent.Value) error
- func (m *TagMutation) SetOp(op Op)
- func (m *TagMutation) SetTagName(s string)
- func (m *TagMutation) TagName() (r string, exists bool)
- func (m TagMutation) Tx() (*Tx, error)
- func (m *TagMutation) Type() string
- func (m *TagMutation) Where(ps ...predicate.Tag)
- func (m *TagMutation) WhereP(ps ...func(*sql.Selector))
- type TagQuery
- func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect
- func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)
- func (tq *TagQuery) AllX(ctx context.Context) []*Tag
- func (tq *TagQuery) Clone() *TagQuery
- func (tq *TagQuery) Count(ctx context.Context) (int, error)
- func (tq *TagQuery) CountX(ctx context.Context) int
- func (tq *TagQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TagQuery) ExistX(ctx context.Context) bool
- func (tq *TagQuery) First(ctx context.Context) (*Tag, error)
- func (tq *TagQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *TagQuery) FirstIDX(ctx context.Context) int
- func (tq *TagQuery) FirstX(ctx context.Context) *Tag
- func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy
- func (tq *TagQuery) IDs(ctx context.Context) (ids []int, err error)
- func (tq *TagQuery) IDsX(ctx context.Context) []int
- func (tq *TagQuery) Limit(limit int) *TagQuery
- func (tq *TagQuery) Offset(offset int) *TagQuery
- func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)
- func (tq *TagQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *TagQuery) OnlyIDX(ctx context.Context) int
- func (tq *TagQuery) OnlyX(ctx context.Context) *Tag
- func (tq *TagQuery) Order(o ...OrderFunc) *TagQuery
- func (tq *TagQuery) QueryArticle() *ArticleQuery
- func (tq *TagQuery) Select(fields ...string) *TagSelect
- func (tq *TagQuery) Unique(unique bool) *TagQuery
- func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery
- func (tq *TagQuery) WithArticle(opts ...func(*ArticleQuery)) *TagQuery
- type TagSelect
- func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect
- func (s *TagSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TagSelect) BoolX(ctx context.Context) bool
- func (s *TagSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TagSelect) BoolsX(ctx context.Context) []bool
- func (s *TagSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TagSelect) Float64X(ctx context.Context) float64
- func (s *TagSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TagSelect) Float64sX(ctx context.Context) []float64
- func (s *TagSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TagSelect) IntX(ctx context.Context) int
- func (s *TagSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TagSelect) IntsX(ctx context.Context) []int
- func (ts *TagSelect) Scan(ctx context.Context, v any) error
- func (s *TagSelect) ScanX(ctx context.Context, v any)
- func (s *TagSelect) String(ctx context.Context) (_ string, err error)
- func (s *TagSelect) StringX(ctx context.Context) string
- func (s *TagSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TagSelect) StringsX(ctx context.Context) []string
- type TagUpdate
- func (tu *TagUpdate) ClearArticle() *TagUpdate
- func (tu *TagUpdate) Exec(ctx context.Context) error
- func (tu *TagUpdate) ExecX(ctx context.Context)
- func (tu *TagUpdate) Mutation() *TagMutation
- func (tu *TagUpdate) Save(ctx context.Context) (int, error)
- func (tu *TagUpdate) SaveX(ctx context.Context) int
- func (tu *TagUpdate) SetArticle(a *Article) *TagUpdate
- func (tu *TagUpdate) SetArticleID(id int) *TagUpdate
- func (tu *TagUpdate) SetCreatedAt(t time.Time) *TagUpdate
- func (tu *TagUpdate) SetNillableArticleID(id *int) *TagUpdate
- func (tu *TagUpdate) SetNillableCreatedAt(t *time.Time) *TagUpdate
- func (tu *TagUpdate) SetTagName(s string) *TagUpdate
- func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate
- type TagUpdateOne
- func (tuo *TagUpdateOne) ClearArticle() *TagUpdateOne
- func (tuo *TagUpdateOne) Exec(ctx context.Context) error
- func (tuo *TagUpdateOne) ExecX(ctx context.Context)
- func (tuo *TagUpdateOne) Mutation() *TagMutation
- func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)
- func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag
- func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne
- func (tuo *TagUpdateOne) SetArticle(a *Article) *TagUpdateOne
- func (tuo *TagUpdateOne) SetArticleID(id int) *TagUpdateOne
- func (tuo *TagUpdateOne) SetCreatedAt(t time.Time) *TagUpdateOne
- func (tuo *TagUpdateOne) SetNillableArticleID(id *int) *TagUpdateOne
- func (tuo *TagUpdateOne) SetNillableCreatedAt(t *time.Time) *TagUpdateOne
- func (tuo *TagUpdateOne) SetTagName(s string) *TagUpdateOne
- func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne
- type Tags
- type TraverseFunc
- type Traverser
- type Tx
- type User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryAchievements(u *User) *AchievementQuery
- func (c *UserClient) QueryBFPs(u *User) *BFPDataPointQuery
- func (c *UserClient) QueryMeals(u *User) *MealQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddAchievementIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddAchievements(a ...*Achievement) *UserCreate
- func (uc *UserCreate) AddBFPIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddBFPs(b ...*BFPDataPoint) *UserCreate
- func (uc *UserCreate) AddMealIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddMeals(m ...*Meal) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetPassword(s string) *UserCreate
- func (uc *UserCreate) SetUserName(s string) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AchievementsCleared() bool
- func (m *UserMutation) AchievementsIDs() (ids []int)
- func (m *UserMutation) AddAchievementIDs(ids ...int)
- func (m *UserMutation) AddBFPIDs(ids ...int)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddMealIDs(ids ...int)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) BFPsCleared() bool
- func (m *UserMutation) BFPsIDs() (ids []int)
- func (m *UserMutation) ClearAchievements()
- func (m *UserMutation) ClearBFPs()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearMeals()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) MealsCleared() bool
- func (m *UserMutation) MealsIDs() (ids []int)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUserName(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) Password() (r string, exists bool)
- func (m *UserMutation) RemoveAchievementIDs(ids ...int)
- func (m *UserMutation) RemoveBFPIDs(ids ...int)
- func (m *UserMutation) RemoveMealIDs(ids ...int)
- func (m *UserMutation) RemovedAchievementsIDs() (ids []int)
- func (m *UserMutation) RemovedBFPsIDs() (ids []int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedMealsIDs() (ids []int)
- func (m *UserMutation) ResetAchievements()
- func (m *UserMutation) ResetBFPs()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetMeals()
- func (m *UserMutation) ResetPassword()
- func (m *UserMutation) ResetUserName()
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetPassword(s string)
- func (m *UserMutation) SetUserName(s string)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UserName() (r string, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (uq *UserQuery) QueryAchievements() *AchievementQuery
- func (uq *UserQuery) QueryBFPs() *BFPDataPointQuery
- func (uq *UserQuery) QueryMeals() *MealQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithAchievements(opts ...func(*AchievementQuery)) *UserQuery
- func (uq *UserQuery) WithBFPs(opts ...func(*BFPDataPointQuery)) *UserQuery
- func (uq *UserQuery) WithMeals(opts ...func(*MealQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddAchievementIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddAchievements(a ...*Achievement) *UserUpdate
- func (uu *UserUpdate) AddBFPIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddBFPs(b ...*BFPDataPoint) *UserUpdate
- func (uu *UserUpdate) AddMealIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddMeals(m ...*Meal) *UserUpdate
- func (uu *UserUpdate) ClearAchievements() *UserUpdate
- func (uu *UserUpdate) ClearBFPs() *UserUpdate
- func (uu *UserUpdate) ClearMeals() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveAchievementIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveAchievements(a ...*Achievement) *UserUpdate
- func (uu *UserUpdate) RemoveBFPIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveBFPs(b ...*BFPDataPoint) *UserUpdate
- func (uu *UserUpdate) RemoveMealIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveMeals(m ...*Meal) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetPassword(s string) *UserUpdate
- func (uu *UserUpdate) SetUserName(s string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddAchievementIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddAchievements(a ...*Achievement) *UserUpdateOne
- func (uuo *UserUpdateOne) AddBFPIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddBFPs(b ...*BFPDataPoint) *UserUpdateOne
- func (uuo *UserUpdateOne) AddMealIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddMeals(m ...*Meal) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearAchievements() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearBFPs() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearMeals() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveAchievementIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveAchievements(a ...*Achievement) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveBFPIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveBFPs(b ...*BFPDataPoint) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveMealIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveMeals(m ...*Meal) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUserName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeAchievement = "Achievement" TypeArticle = "Article" TypeBFPDataPoint = "BFPDataPoint" TypeMeal = "Meal" TypeTag = "Tag" TypeUser = "User" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type Achievement ¶
type Achievement struct { // ID of the ent. ID int `json:"id,omitempty"` // Status holds the value of the "status" field. Status string `json:"status,omitempty"` // ThumbnailImgURL holds the value of the "thumbnail_img_url" field. ThumbnailImgURL string `json:"thumbnail_img_url,omitempty"` // BfpGoal holds the value of the "bfp_goal" field. BfpGoal float64 `json:"bfp_goal,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the AchievementQuery when eager-loading is set. Edges AchievementEdges `json:"edges"` // contains filtered or unexported fields }
Achievement is the model entity for the Achievement schema.
func (*Achievement) QueryUser ¶
func (a *Achievement) QueryUser() *UserQuery
QueryUser queries the "user" edge of the Achievement entity.
func (*Achievement) String ¶
func (a *Achievement) String() string
String implements the fmt.Stringer.
func (*Achievement) Unwrap ¶
func (a *Achievement) Unwrap() *Achievement
Unwrap unwraps the Achievement 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 (*Achievement) Update ¶
func (a *Achievement) Update() *AchievementUpdateOne
Update returns a builder for updating this Achievement. Note that you need to call Achievement.Unwrap() before calling this method if this Achievement was returned from a transaction, and the transaction was committed or rolled back.
type AchievementClient ¶
type AchievementClient struct {
// contains filtered or unexported fields
}
AchievementClient is a client for the Achievement schema.
func NewAchievementClient ¶
func NewAchievementClient(c config) *AchievementClient
NewAchievementClient returns a client for the Achievement from the given config.
func (*AchievementClient) Create ¶
func (c *AchievementClient) Create() *AchievementCreate
Create returns a builder for creating a Achievement entity.
func (*AchievementClient) CreateBulk ¶
func (c *AchievementClient) CreateBulk(builders ...*AchievementCreate) *AchievementCreateBulk
CreateBulk returns a builder for creating a bulk of Achievement entities.
func (*AchievementClient) Delete ¶
func (c *AchievementClient) Delete() *AchievementDelete
Delete returns a delete builder for Achievement.
func (*AchievementClient) DeleteOne ¶
func (c *AchievementClient) DeleteOne(a *Achievement) *AchievementDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AchievementClient) DeleteOneID ¶
func (c *AchievementClient) DeleteOneID(id int) *AchievementDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AchievementClient) Get ¶
func (c *AchievementClient) Get(ctx context.Context, id int) (*Achievement, error)
Get returns a Achievement entity by its id.
func (*AchievementClient) GetX ¶
func (c *AchievementClient) GetX(ctx context.Context, id int) *Achievement
GetX is like Get, but panics if an error occurs.
func (*AchievementClient) Hooks ¶
func (c *AchievementClient) Hooks() []Hook
Hooks returns the client hooks.
func (*AchievementClient) Intercept ¶
func (c *AchievementClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `achievement.Intercept(f(g(h())))`.
func (*AchievementClient) Interceptors ¶
func (c *AchievementClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*AchievementClient) Query ¶
func (c *AchievementClient) Query() *AchievementQuery
Query returns a query builder for Achievement.
func (*AchievementClient) QueryUser ¶
func (c *AchievementClient) QueryUser(a *Achievement) *UserQuery
QueryUser queries the user edge of a Achievement.
func (*AchievementClient) Update ¶
func (c *AchievementClient) Update() *AchievementUpdate
Update returns an update builder for Achievement.
func (*AchievementClient) UpdateOne ¶
func (c *AchievementClient) UpdateOne(a *Achievement) *AchievementUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AchievementClient) UpdateOneID ¶
func (c *AchievementClient) UpdateOneID(id int) *AchievementUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AchievementClient) Use ¶
func (c *AchievementClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `achievement.Hooks(f(g(h())))`.
type AchievementCreate ¶
type AchievementCreate struct {
// contains filtered or unexported fields
}
AchievementCreate is the builder for creating a Achievement entity.
func (*AchievementCreate) Exec ¶
func (ac *AchievementCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AchievementCreate) ExecX ¶
func (ac *AchievementCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AchievementCreate) Mutation ¶
func (ac *AchievementCreate) Mutation() *AchievementMutation
Mutation returns the AchievementMutation object of the builder.
func (*AchievementCreate) Save ¶
func (ac *AchievementCreate) Save(ctx context.Context) (*Achievement, error)
Save creates the Achievement in the database.
func (*AchievementCreate) SaveX ¶
func (ac *AchievementCreate) SaveX(ctx context.Context) *Achievement
SaveX calls Save and panics if Save returns an error.
func (*AchievementCreate) SetBfpGoal ¶
func (ac *AchievementCreate) SetBfpGoal(f float64) *AchievementCreate
SetBfpGoal sets the "bfp_goal" field.
func (*AchievementCreate) SetCreatedAt ¶
func (ac *AchievementCreate) SetCreatedAt(t time.Time) *AchievementCreate
SetCreatedAt sets the "created_at" field.
func (*AchievementCreate) SetNillableCreatedAt ¶
func (ac *AchievementCreate) SetNillableCreatedAt(t *time.Time) *AchievementCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AchievementCreate) SetNillableStatus ¶
func (ac *AchievementCreate) SetNillableStatus(s *string) *AchievementCreate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*AchievementCreate) SetNillableThumbnailImgURL ¶
func (ac *AchievementCreate) SetNillableThumbnailImgURL(s *string) *AchievementCreate
SetNillableThumbnailImgURL sets the "thumbnail_img_url" field if the given value is not nil.
func (*AchievementCreate) SetNillableUserID ¶
func (ac *AchievementCreate) SetNillableUserID(id *int) *AchievementCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*AchievementCreate) SetStatus ¶
func (ac *AchievementCreate) SetStatus(s string) *AchievementCreate
SetStatus sets the "status" field.
func (*AchievementCreate) SetThumbnailImgURL ¶
func (ac *AchievementCreate) SetThumbnailImgURL(s string) *AchievementCreate
SetThumbnailImgURL sets the "thumbnail_img_url" field.
func (*AchievementCreate) SetUser ¶
func (ac *AchievementCreate) SetUser(u *User) *AchievementCreate
SetUser sets the "user" edge to the User entity.
func (*AchievementCreate) SetUserID ¶
func (ac *AchievementCreate) SetUserID(id int) *AchievementCreate
SetUserID sets the "user" edge to the User entity by ID.
type AchievementCreateBulk ¶
type AchievementCreateBulk struct {
// contains filtered or unexported fields
}
AchievementCreateBulk is the builder for creating many Achievement entities in bulk.
func (*AchievementCreateBulk) Exec ¶
func (acb *AchievementCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AchievementCreateBulk) ExecX ¶
func (acb *AchievementCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AchievementCreateBulk) Save ¶
func (acb *AchievementCreateBulk) Save(ctx context.Context) ([]*Achievement, error)
Save creates the Achievement entities in the database.
func (*AchievementCreateBulk) SaveX ¶
func (acb *AchievementCreateBulk) SaveX(ctx context.Context) []*Achievement
SaveX is like Save, but panics if an error occurs.
type AchievementDelete ¶
type AchievementDelete struct {
// contains filtered or unexported fields
}
AchievementDelete is the builder for deleting a Achievement entity.
func (*AchievementDelete) Exec ¶
func (ad *AchievementDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AchievementDelete) ExecX ¶
func (ad *AchievementDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AchievementDelete) Where ¶
func (ad *AchievementDelete) Where(ps ...predicate.Achievement) *AchievementDelete
Where appends a list predicates to the AchievementDelete builder.
type AchievementDeleteOne ¶
type AchievementDeleteOne struct {
// contains filtered or unexported fields
}
AchievementDeleteOne is the builder for deleting a single Achievement entity.
func (*AchievementDeleteOne) Exec ¶
func (ado *AchievementDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AchievementDeleteOne) ExecX ¶
func (ado *AchievementDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AchievementDeleteOne) Where ¶
func (ado *AchievementDeleteOne) Where(ps ...predicate.Achievement) *AchievementDeleteOne
Where appends a list predicates to the AchievementDelete builder.
type AchievementEdges ¶
type AchievementEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
AchievementEdges holds the relations/edges for other nodes in the graph.
func (AchievementEdges) UserOrErr ¶
func (e AchievementEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type AchievementGroupBy ¶
type AchievementGroupBy struct {
// contains filtered or unexported fields
}
AchievementGroupBy is the group-by builder for Achievement entities.
func (*AchievementGroupBy) Aggregate ¶
func (agb *AchievementGroupBy) Aggregate(fns ...AggregateFunc) *AchievementGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AchievementGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AchievementGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AchievementGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AchievementGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AchievementGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AchievementGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AchievementGroupBy) Scan ¶
func (agb *AchievementGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AchievementGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AchievementMutation ¶
type AchievementMutation struct {
// contains filtered or unexported fields
}
AchievementMutation represents an operation that mutates the Achievement nodes in the graph.
func (*AchievementMutation) AddBfpGoal ¶
func (m *AchievementMutation) AddBfpGoal(f float64)
AddBfpGoal adds f to the "bfp_goal" field.
func (*AchievementMutation) AddField ¶
func (m *AchievementMutation) 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 (*AchievementMutation) AddedBfpGoal ¶
func (m *AchievementMutation) AddedBfpGoal() (r float64, exists bool)
AddedBfpGoal returns the value that was added to the "bfp_goal" field in this mutation.
func (*AchievementMutation) AddedEdges ¶
func (m *AchievementMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AchievementMutation) AddedField ¶
func (m *AchievementMutation) 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 (*AchievementMutation) AddedFields ¶
func (m *AchievementMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AchievementMutation) AddedIDs ¶
func (m *AchievementMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AchievementMutation) BfpGoal ¶
func (m *AchievementMutation) BfpGoal() (r float64, exists bool)
BfpGoal returns the value of the "bfp_goal" field in the mutation.
func (*AchievementMutation) ClearEdge ¶
func (m *AchievementMutation) 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 (*AchievementMutation) ClearField ¶
func (m *AchievementMutation) 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 (*AchievementMutation) ClearUser ¶
func (m *AchievementMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*AchievementMutation) ClearedEdges ¶
func (m *AchievementMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AchievementMutation) ClearedFields ¶
func (m *AchievementMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AchievementMutation) Client ¶
func (m AchievementMutation) 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 (*AchievementMutation) CreatedAt ¶
func (m *AchievementMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*AchievementMutation) EdgeCleared ¶
func (m *AchievementMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AchievementMutation) Field ¶
func (m *AchievementMutation) 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 (*AchievementMutation) FieldCleared ¶
func (m *AchievementMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AchievementMutation) Fields ¶
func (m *AchievementMutation) 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 (*AchievementMutation) ID ¶
func (m *AchievementMutation) 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 (*AchievementMutation) IDs ¶
func (m *AchievementMutation) 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 (*AchievementMutation) OldBfpGoal ¶
func (m *AchievementMutation) OldBfpGoal(ctx context.Context) (v float64, err error)
OldBfpGoal returns the old "bfp_goal" field's value of the Achievement entity. If the Achievement 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 (*AchievementMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Achievement entity. If the Achievement 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 (*AchievementMutation) 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 (*AchievementMutation) OldStatus ¶
func (m *AchievementMutation) OldStatus(ctx context.Context) (v string, err error)
OldStatus returns the old "status" field's value of the Achievement entity. If the Achievement 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 (*AchievementMutation) OldThumbnailImgURL ¶
func (m *AchievementMutation) OldThumbnailImgURL(ctx context.Context) (v string, err error)
OldThumbnailImgURL returns the old "thumbnail_img_url" field's value of the Achievement entity. If the Achievement 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 (*AchievementMutation) Op ¶
func (m *AchievementMutation) Op() Op
Op returns the operation name.
func (*AchievementMutation) RemovedEdges ¶
func (m *AchievementMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AchievementMutation) RemovedIDs ¶
func (m *AchievementMutation) 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 (*AchievementMutation) ResetBfpGoal ¶
func (m *AchievementMutation) ResetBfpGoal()
ResetBfpGoal resets all changes to the "bfp_goal" field.
func (*AchievementMutation) ResetCreatedAt ¶
func (m *AchievementMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*AchievementMutation) ResetEdge ¶
func (m *AchievementMutation) 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 (*AchievementMutation) ResetField ¶
func (m *AchievementMutation) 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 (*AchievementMutation) ResetStatus ¶
func (m *AchievementMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*AchievementMutation) ResetThumbnailImgURL ¶
func (m *AchievementMutation) ResetThumbnailImgURL()
ResetThumbnailImgURL resets all changes to the "thumbnail_img_url" field.
func (*AchievementMutation) ResetUser ¶
func (m *AchievementMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*AchievementMutation) SetBfpGoal ¶
func (m *AchievementMutation) SetBfpGoal(f float64)
SetBfpGoal sets the "bfp_goal" field.
func (*AchievementMutation) SetCreatedAt ¶
func (m *AchievementMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*AchievementMutation) SetField ¶
func (m *AchievementMutation) 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 (*AchievementMutation) SetOp ¶
func (m *AchievementMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*AchievementMutation) SetStatus ¶
func (m *AchievementMutation) SetStatus(s string)
SetStatus sets the "status" field.
func (*AchievementMutation) SetThumbnailImgURL ¶
func (m *AchievementMutation) SetThumbnailImgURL(s string)
SetThumbnailImgURL sets the "thumbnail_img_url" field.
func (*AchievementMutation) SetUserID ¶
func (m *AchievementMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (*AchievementMutation) Status ¶
func (m *AchievementMutation) Status() (r string, exists bool)
Status returns the value of the "status" field in the mutation.
func (*AchievementMutation) ThumbnailImgURL ¶
func (m *AchievementMutation) ThumbnailImgURL() (r string, exists bool)
ThumbnailImgURL returns the value of the "thumbnail_img_url" field in the mutation.
func (AchievementMutation) Tx ¶
func (m AchievementMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AchievementMutation) Type ¶
func (m *AchievementMutation) Type() string
Type returns the node type of this mutation (Achievement).
func (*AchievementMutation) UserCleared ¶
func (m *AchievementMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*AchievementMutation) UserID ¶
func (m *AchievementMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*AchievementMutation) UserIDs ¶
func (m *AchievementMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*AchievementMutation) Where ¶
func (m *AchievementMutation) Where(ps ...predicate.Achievement)
Where appends a list predicates to the AchievementMutation builder.
func (*AchievementMutation) WhereP ¶
func (m *AchievementMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the AchievementMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type AchievementQuery ¶
type AchievementQuery struct {
// contains filtered or unexported fields
}
AchievementQuery is the builder for querying Achievement entities.
func (*AchievementQuery) Aggregate ¶
func (aq *AchievementQuery) Aggregate(fns ...AggregateFunc) *AchievementSelect
Aggregate returns a AchievementSelect configured with the given aggregations.
func (*AchievementQuery) All ¶
func (aq *AchievementQuery) All(ctx context.Context) ([]*Achievement, error)
All executes the query and returns a list of Achievements.
func (*AchievementQuery) AllX ¶
func (aq *AchievementQuery) AllX(ctx context.Context) []*Achievement
AllX is like All, but panics if an error occurs.
func (*AchievementQuery) Clone ¶
func (aq *AchievementQuery) Clone() *AchievementQuery
Clone returns a duplicate of the AchievementQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AchievementQuery) Count ¶
func (aq *AchievementQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AchievementQuery) CountX ¶
func (aq *AchievementQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AchievementQuery) Exist ¶
func (aq *AchievementQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AchievementQuery) ExistX ¶
func (aq *AchievementQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AchievementQuery) First ¶
func (aq *AchievementQuery) First(ctx context.Context) (*Achievement, error)
First returns the first Achievement entity from the query. Returns a *NotFoundError when no Achievement was found.
func (*AchievementQuery) FirstID ¶
func (aq *AchievementQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Achievement ID from the query. Returns a *NotFoundError when no Achievement ID was found.
func (*AchievementQuery) FirstIDX ¶
func (aq *AchievementQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*AchievementQuery) FirstX ¶
func (aq *AchievementQuery) FirstX(ctx context.Context) *Achievement
FirstX is like First, but panics if an error occurs.
func (*AchievementQuery) GroupBy ¶
func (aq *AchievementQuery) GroupBy(field string, fields ...string) *AchievementGroupBy
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 { Status string `json:"status,omitempty"` Count int `json:"count,omitempty"` } client.Achievement.Query(). GroupBy(achievement.FieldStatus). Aggregate(ent.Count()). Scan(ctx, &v)
func (*AchievementQuery) IDs ¶
func (aq *AchievementQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Achievement IDs.
func (*AchievementQuery) IDsX ¶
func (aq *AchievementQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*AchievementQuery) Limit ¶
func (aq *AchievementQuery) Limit(limit int) *AchievementQuery
Limit the number of records to be returned by this query.
func (*AchievementQuery) Offset ¶
func (aq *AchievementQuery) Offset(offset int) *AchievementQuery
Offset to start from.
func (*AchievementQuery) Only ¶
func (aq *AchievementQuery) Only(ctx context.Context) (*Achievement, error)
Only returns a single Achievement entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Achievement entity is found. Returns a *NotFoundError when no Achievement entities are found.
func (*AchievementQuery) OnlyID ¶
func (aq *AchievementQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Achievement ID in the query. Returns a *NotSingularError when more than one Achievement ID is found. Returns a *NotFoundError when no entities are found.
func (*AchievementQuery) OnlyIDX ¶
func (aq *AchievementQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AchievementQuery) OnlyX ¶
func (aq *AchievementQuery) OnlyX(ctx context.Context) *Achievement
OnlyX is like Only, but panics if an error occurs.
func (*AchievementQuery) Order ¶
func (aq *AchievementQuery) Order(o ...OrderFunc) *AchievementQuery
Order specifies how the records should be ordered.
func (*AchievementQuery) QueryUser ¶
func (aq *AchievementQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*AchievementQuery) Select ¶
func (aq *AchievementQuery) Select(fields ...string) *AchievementSelect
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 { Status string `json:"status,omitempty"` } client.Achievement.Query(). Select(achievement.FieldStatus). Scan(ctx, &v)
func (*AchievementQuery) Unique ¶
func (aq *AchievementQuery) Unique(unique bool) *AchievementQuery
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 (*AchievementQuery) Where ¶
func (aq *AchievementQuery) Where(ps ...predicate.Achievement) *AchievementQuery
Where adds a new predicate for the AchievementQuery builder.
func (*AchievementQuery) WithUser ¶
func (aq *AchievementQuery) WithUser(opts ...func(*UserQuery)) *AchievementQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type AchievementSelect ¶
type AchievementSelect struct { *AchievementQuery // contains filtered or unexported fields }
AchievementSelect is the builder for selecting fields of Achievement entities.
func (*AchievementSelect) Aggregate ¶
func (as *AchievementSelect) Aggregate(fns ...AggregateFunc) *AchievementSelect
Aggregate adds the given aggregation functions to the selector query.
func (*AchievementSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AchievementSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AchievementSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AchievementSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AchievementSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AchievementSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AchievementSelect) Scan ¶
func (as *AchievementSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AchievementSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AchievementUpdate ¶
type AchievementUpdate struct {
// contains filtered or unexported fields
}
AchievementUpdate is the builder for updating Achievement entities.
func (*AchievementUpdate) AddBfpGoal ¶
func (au *AchievementUpdate) AddBfpGoal(f float64) *AchievementUpdate
AddBfpGoal adds f to the "bfp_goal" field.
func (*AchievementUpdate) ClearUser ¶
func (au *AchievementUpdate) ClearUser() *AchievementUpdate
ClearUser clears the "user" edge to the User entity.
func (*AchievementUpdate) Exec ¶
func (au *AchievementUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AchievementUpdate) ExecX ¶
func (au *AchievementUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AchievementUpdate) Mutation ¶
func (au *AchievementUpdate) Mutation() *AchievementMutation
Mutation returns the AchievementMutation object of the builder.
func (*AchievementUpdate) Save ¶
func (au *AchievementUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AchievementUpdate) SaveX ¶
func (au *AchievementUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AchievementUpdate) SetBfpGoal ¶
func (au *AchievementUpdate) SetBfpGoal(f float64) *AchievementUpdate
SetBfpGoal sets the "bfp_goal" field.
func (*AchievementUpdate) SetCreatedAt ¶
func (au *AchievementUpdate) SetCreatedAt(t time.Time) *AchievementUpdate
SetCreatedAt sets the "created_at" field.
func (*AchievementUpdate) SetNillableCreatedAt ¶
func (au *AchievementUpdate) SetNillableCreatedAt(t *time.Time) *AchievementUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AchievementUpdate) SetNillableStatus ¶
func (au *AchievementUpdate) SetNillableStatus(s *string) *AchievementUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*AchievementUpdate) SetNillableThumbnailImgURL ¶
func (au *AchievementUpdate) SetNillableThumbnailImgURL(s *string) *AchievementUpdate
SetNillableThumbnailImgURL sets the "thumbnail_img_url" field if the given value is not nil.
func (*AchievementUpdate) SetNillableUserID ¶
func (au *AchievementUpdate) SetNillableUserID(id *int) *AchievementUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*AchievementUpdate) SetStatus ¶
func (au *AchievementUpdate) SetStatus(s string) *AchievementUpdate
SetStatus sets the "status" field.
func (*AchievementUpdate) SetThumbnailImgURL ¶
func (au *AchievementUpdate) SetThumbnailImgURL(s string) *AchievementUpdate
SetThumbnailImgURL sets the "thumbnail_img_url" field.
func (*AchievementUpdate) SetUser ¶
func (au *AchievementUpdate) SetUser(u *User) *AchievementUpdate
SetUser sets the "user" edge to the User entity.
func (*AchievementUpdate) SetUserID ¶
func (au *AchievementUpdate) SetUserID(id int) *AchievementUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*AchievementUpdate) Where ¶
func (au *AchievementUpdate) Where(ps ...predicate.Achievement) *AchievementUpdate
Where appends a list predicates to the AchievementUpdate builder.
type AchievementUpdateOne ¶
type AchievementUpdateOne struct {
// contains filtered or unexported fields
}
AchievementUpdateOne is the builder for updating a single Achievement entity.
func (*AchievementUpdateOne) AddBfpGoal ¶
func (auo *AchievementUpdateOne) AddBfpGoal(f float64) *AchievementUpdateOne
AddBfpGoal adds f to the "bfp_goal" field.
func (*AchievementUpdateOne) ClearUser ¶
func (auo *AchievementUpdateOne) ClearUser() *AchievementUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*AchievementUpdateOne) Exec ¶
func (auo *AchievementUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AchievementUpdateOne) ExecX ¶
func (auo *AchievementUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AchievementUpdateOne) Mutation ¶
func (auo *AchievementUpdateOne) Mutation() *AchievementMutation
Mutation returns the AchievementMutation object of the builder.
func (*AchievementUpdateOne) Save ¶
func (auo *AchievementUpdateOne) Save(ctx context.Context) (*Achievement, error)
Save executes the query and returns the updated Achievement entity.
func (*AchievementUpdateOne) SaveX ¶
func (auo *AchievementUpdateOne) SaveX(ctx context.Context) *Achievement
SaveX is like Save, but panics if an error occurs.
func (*AchievementUpdateOne) Select ¶
func (auo *AchievementUpdateOne) Select(field string, fields ...string) *AchievementUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AchievementUpdateOne) SetBfpGoal ¶
func (auo *AchievementUpdateOne) SetBfpGoal(f float64) *AchievementUpdateOne
SetBfpGoal sets the "bfp_goal" field.
func (*AchievementUpdateOne) SetCreatedAt ¶
func (auo *AchievementUpdateOne) SetCreatedAt(t time.Time) *AchievementUpdateOne
SetCreatedAt sets the "created_at" field.
func (*AchievementUpdateOne) SetNillableCreatedAt ¶
func (auo *AchievementUpdateOne) SetNillableCreatedAt(t *time.Time) *AchievementUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AchievementUpdateOne) SetNillableStatus ¶
func (auo *AchievementUpdateOne) SetNillableStatus(s *string) *AchievementUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*AchievementUpdateOne) SetNillableThumbnailImgURL ¶
func (auo *AchievementUpdateOne) SetNillableThumbnailImgURL(s *string) *AchievementUpdateOne
SetNillableThumbnailImgURL sets the "thumbnail_img_url" field if the given value is not nil.
func (*AchievementUpdateOne) SetNillableUserID ¶
func (auo *AchievementUpdateOne) SetNillableUserID(id *int) *AchievementUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*AchievementUpdateOne) SetStatus ¶
func (auo *AchievementUpdateOne) SetStatus(s string) *AchievementUpdateOne
SetStatus sets the "status" field.
func (*AchievementUpdateOne) SetThumbnailImgURL ¶
func (auo *AchievementUpdateOne) SetThumbnailImgURL(s string) *AchievementUpdateOne
SetThumbnailImgURL sets the "thumbnail_img_url" field.
func (*AchievementUpdateOne) SetUser ¶
func (auo *AchievementUpdateOne) SetUser(u *User) *AchievementUpdateOne
SetUser sets the "user" edge to the User entity.
func (*AchievementUpdateOne) SetUserID ¶
func (auo *AchievementUpdateOne) SetUserID(id int) *AchievementUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*AchievementUpdateOne) Where ¶
func (auo *AchievementUpdateOne) Where(ps ...predicate.Achievement) *AchievementUpdateOne
Where appends a list predicates to the AchievementUpdate builder.
type Achievements ¶
type Achievements []*Achievement
Achievements is a parsable slice of Achievement.
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 Article ¶
type Article struct { // ID of the ent. ID int `json:"id,omitempty"` // ThumbnailImgURL holds the value of the "thumbnail_img_url" field. ThumbnailImgURL string `json:"thumbnail_img_url,omitempty"` // Title holds the value of the "title" field. Title string `json:"title,omitempty"` // Content holds the value of the "content" field. Content string `json:"content,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ArticleQuery when eager-loading is set. Edges ArticleEdges `json:"edges"` // contains filtered or unexported fields }
Article is the model entity for the Article schema.
func (*Article) Unwrap ¶
Unwrap unwraps the Article 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 (*Article) Update ¶
func (a *Article) Update() *ArticleUpdateOne
Update returns a builder for updating this Article. Note that you need to call Article.Unwrap() before calling this method if this Article was returned from a transaction, and the transaction was committed or rolled back.
type ArticleClient ¶
type ArticleClient struct {
// contains filtered or unexported fields
}
ArticleClient is a client for the Article schema.
func NewArticleClient ¶
func NewArticleClient(c config) *ArticleClient
NewArticleClient returns a client for the Article from the given config.
func (*ArticleClient) Create ¶
func (c *ArticleClient) Create() *ArticleCreate
Create returns a builder for creating a Article entity.
func (*ArticleClient) CreateBulk ¶
func (c *ArticleClient) CreateBulk(builders ...*ArticleCreate) *ArticleCreateBulk
CreateBulk returns a builder for creating a bulk of Article entities.
func (*ArticleClient) Delete ¶
func (c *ArticleClient) Delete() *ArticleDelete
Delete returns a delete builder for Article.
func (*ArticleClient) DeleteOne ¶
func (c *ArticleClient) DeleteOne(a *Article) *ArticleDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ArticleClient) DeleteOneID ¶
func (c *ArticleClient) DeleteOneID(id int) *ArticleDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ArticleClient) GetX ¶
func (c *ArticleClient) GetX(ctx context.Context, id int) *Article
GetX is like Get, but panics if an error occurs.
func (*ArticleClient) Hooks ¶
func (c *ArticleClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ArticleClient) Intercept ¶
func (c *ArticleClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `article.Intercept(f(g(h())))`.
func (*ArticleClient) Interceptors ¶
func (c *ArticleClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ArticleClient) Query ¶
func (c *ArticleClient) Query() *ArticleQuery
Query returns a query builder for Article.
func (*ArticleClient) QueryTags ¶
func (c *ArticleClient) QueryTags(a *Article) *TagQuery
QueryTags queries the tags edge of a Article.
func (*ArticleClient) Update ¶
func (c *ArticleClient) Update() *ArticleUpdate
Update returns an update builder for Article.
func (*ArticleClient) UpdateOne ¶
func (c *ArticleClient) UpdateOne(a *Article) *ArticleUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ArticleClient) UpdateOneID ¶
func (c *ArticleClient) UpdateOneID(id int) *ArticleUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ArticleClient) Use ¶
func (c *ArticleClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `article.Hooks(f(g(h())))`.
type ArticleCreate ¶
type ArticleCreate struct {
// contains filtered or unexported fields
}
ArticleCreate is the builder for creating a Article entity.
func (*ArticleCreate) AddTagIDs ¶
func (ac *ArticleCreate) AddTagIDs(ids ...int) *ArticleCreate
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*ArticleCreate) AddTags ¶
func (ac *ArticleCreate) AddTags(t ...*Tag) *ArticleCreate
AddTags adds the "tags" edges to the Tag entity.
func (*ArticleCreate) Exec ¶
func (ac *ArticleCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleCreate) ExecX ¶
func (ac *ArticleCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleCreate) Mutation ¶
func (ac *ArticleCreate) Mutation() *ArticleMutation
Mutation returns the ArticleMutation object of the builder.
func (*ArticleCreate) Save ¶
func (ac *ArticleCreate) Save(ctx context.Context) (*Article, error)
Save creates the Article in the database.
func (*ArticleCreate) SaveX ¶
func (ac *ArticleCreate) SaveX(ctx context.Context) *Article
SaveX calls Save and panics if Save returns an error.
func (*ArticleCreate) SetContent ¶
func (ac *ArticleCreate) SetContent(s string) *ArticleCreate
SetContent sets the "content" field.
func (*ArticleCreate) SetCreatedAt ¶
func (ac *ArticleCreate) SetCreatedAt(t time.Time) *ArticleCreate
SetCreatedAt sets the "created_at" field.
func (*ArticleCreate) SetNillableCreatedAt ¶
func (ac *ArticleCreate) SetNillableCreatedAt(t *time.Time) *ArticleCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ArticleCreate) SetNillableThumbnailImgURL ¶
func (ac *ArticleCreate) SetNillableThumbnailImgURL(s *string) *ArticleCreate
SetNillableThumbnailImgURL sets the "thumbnail_img_url" field if the given value is not nil.
func (*ArticleCreate) SetThumbnailImgURL ¶
func (ac *ArticleCreate) SetThumbnailImgURL(s string) *ArticleCreate
SetThumbnailImgURL sets the "thumbnail_img_url" field.
func (*ArticleCreate) SetTitle ¶
func (ac *ArticleCreate) SetTitle(s string) *ArticleCreate
SetTitle sets the "title" field.
type ArticleCreateBulk ¶
type ArticleCreateBulk struct {
// contains filtered or unexported fields
}
ArticleCreateBulk is the builder for creating many Article entities in bulk.
func (*ArticleCreateBulk) Exec ¶
func (acb *ArticleCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleCreateBulk) ExecX ¶
func (acb *ArticleCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ArticleDelete ¶
type ArticleDelete struct {
// contains filtered or unexported fields
}
ArticleDelete is the builder for deleting a Article entity.
func (*ArticleDelete) Exec ¶
func (ad *ArticleDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ArticleDelete) ExecX ¶
func (ad *ArticleDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ArticleDelete) Where ¶
func (ad *ArticleDelete) Where(ps ...predicate.Article) *ArticleDelete
Where appends a list predicates to the ArticleDelete builder.
type ArticleDeleteOne ¶
type ArticleDeleteOne struct {
// contains filtered or unexported fields
}
ArticleDeleteOne is the builder for deleting a single Article entity.
func (*ArticleDeleteOne) Exec ¶
func (ado *ArticleDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ArticleDeleteOne) ExecX ¶
func (ado *ArticleDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleDeleteOne) Where ¶
func (ado *ArticleDeleteOne) Where(ps ...predicate.Article) *ArticleDeleteOne
Where appends a list predicates to the ArticleDelete builder.
type ArticleEdges ¶
type ArticleEdges struct { // Tags holds the value of the tags edge. Tags []*Tag `json:"tags,omitempty"` // contains filtered or unexported fields }
ArticleEdges holds the relations/edges for other nodes in the graph.
func (ArticleEdges) TagsOrErr ¶
func (e ArticleEdges) TagsOrErr() ([]*Tag, error)
TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading.
type ArticleGroupBy ¶
type ArticleGroupBy struct {
// contains filtered or unexported fields
}
ArticleGroupBy is the group-by builder for Article entities.
func (*ArticleGroupBy) Aggregate ¶
func (agb *ArticleGroupBy) Aggregate(fns ...AggregateFunc) *ArticleGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ArticleGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Scan ¶
func (agb *ArticleGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ArticleGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ArticleMutation ¶
type ArticleMutation struct {
// contains filtered or unexported fields
}
ArticleMutation represents an operation that mutates the Article nodes in the graph.
func (*ArticleMutation) AddField ¶
func (m *ArticleMutation) 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 (*ArticleMutation) AddTagIDs ¶
func (m *ArticleMutation) AddTagIDs(ids ...int)
AddTagIDs adds the "tags" edge to the Tag entity by ids.
func (*ArticleMutation) AddedEdges ¶
func (m *ArticleMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ArticleMutation) AddedField ¶
func (m *ArticleMutation) 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 (*ArticleMutation) AddedFields ¶
func (m *ArticleMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ArticleMutation) AddedIDs ¶
func (m *ArticleMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ArticleMutation) ClearEdge ¶
func (m *ArticleMutation) 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 (*ArticleMutation) ClearField ¶
func (m *ArticleMutation) 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 (*ArticleMutation) ClearTags ¶
func (m *ArticleMutation) ClearTags()
ClearTags clears the "tags" edge to the Tag entity.
func (*ArticleMutation) ClearedEdges ¶
func (m *ArticleMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ArticleMutation) ClearedFields ¶
func (m *ArticleMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ArticleMutation) Client ¶
func (m ArticleMutation) 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 (*ArticleMutation) Content ¶
func (m *ArticleMutation) Content() (r string, exists bool)
Content returns the value of the "content" field in the mutation.
func (*ArticleMutation) CreatedAt ¶
func (m *ArticleMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ArticleMutation) EdgeCleared ¶
func (m *ArticleMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ArticleMutation) Field ¶
func (m *ArticleMutation) 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 (*ArticleMutation) FieldCleared ¶
func (m *ArticleMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ArticleMutation) Fields ¶
func (m *ArticleMutation) 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 (*ArticleMutation) ID ¶
func (m *ArticleMutation) 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 (*ArticleMutation) IDs ¶
func (m *ArticleMutation) 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 (*ArticleMutation) OldContent ¶
func (m *ArticleMutation) OldContent(ctx context.Context) (v string, err error)
OldContent returns the old "content" field's value of the Article entity. If the Article 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 (*ArticleMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Article entity. If the Article 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 (*ArticleMutation) 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 (*ArticleMutation) OldThumbnailImgURL ¶
func (m *ArticleMutation) OldThumbnailImgURL(ctx context.Context) (v string, err error)
OldThumbnailImgURL returns the old "thumbnail_img_url" field's value of the Article entity. If the Article 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 (*ArticleMutation) OldTitle ¶
func (m *ArticleMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the Article entity. If the Article 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 (*ArticleMutation) RemoveTagIDs ¶
func (m *ArticleMutation) RemoveTagIDs(ids ...int)
RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.
func (*ArticleMutation) RemovedEdges ¶
func (m *ArticleMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ArticleMutation) RemovedIDs ¶
func (m *ArticleMutation) 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 (*ArticleMutation) RemovedTagsIDs ¶
func (m *ArticleMutation) RemovedTagsIDs() (ids []int)
RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.
func (*ArticleMutation) ResetContent ¶
func (m *ArticleMutation) ResetContent()
ResetContent resets all changes to the "content" field.
func (*ArticleMutation) ResetCreatedAt ¶
func (m *ArticleMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ArticleMutation) ResetEdge ¶
func (m *ArticleMutation) 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 (*ArticleMutation) ResetField ¶
func (m *ArticleMutation) 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 (*ArticleMutation) ResetTags ¶
func (m *ArticleMutation) ResetTags()
ResetTags resets all changes to the "tags" edge.
func (*ArticleMutation) ResetThumbnailImgURL ¶
func (m *ArticleMutation) ResetThumbnailImgURL()
ResetThumbnailImgURL resets all changes to the "thumbnail_img_url" field.
func (*ArticleMutation) ResetTitle ¶
func (m *ArticleMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*ArticleMutation) SetContent ¶
func (m *ArticleMutation) SetContent(s string)
SetContent sets the "content" field.
func (*ArticleMutation) SetCreatedAt ¶
func (m *ArticleMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ArticleMutation) SetField ¶
func (m *ArticleMutation) 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 (*ArticleMutation) SetOp ¶
func (m *ArticleMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ArticleMutation) SetThumbnailImgURL ¶
func (m *ArticleMutation) SetThumbnailImgURL(s string)
SetThumbnailImgURL sets the "thumbnail_img_url" field.
func (*ArticleMutation) SetTitle ¶
func (m *ArticleMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*ArticleMutation) TagsCleared ¶
func (m *ArticleMutation) TagsCleared() bool
TagsCleared reports if the "tags" edge to the Tag entity was cleared.
func (*ArticleMutation) TagsIDs ¶
func (m *ArticleMutation) TagsIDs() (ids []int)
TagsIDs returns the "tags" edge IDs in the mutation.
func (*ArticleMutation) ThumbnailImgURL ¶
func (m *ArticleMutation) ThumbnailImgURL() (r string, exists bool)
ThumbnailImgURL returns the value of the "thumbnail_img_url" field in the mutation.
func (*ArticleMutation) Title ¶
func (m *ArticleMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (ArticleMutation) Tx ¶
func (m ArticleMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ArticleMutation) Type ¶
func (m *ArticleMutation) Type() string
Type returns the node type of this mutation (Article).
func (*ArticleMutation) Where ¶
func (m *ArticleMutation) Where(ps ...predicate.Article)
Where appends a list predicates to the ArticleMutation builder.
func (*ArticleMutation) WhereP ¶
func (m *ArticleMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ArticleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ArticleQuery ¶
type ArticleQuery struct {
// contains filtered or unexported fields
}
ArticleQuery is the builder for querying Article entities.
func (*ArticleQuery) Aggregate ¶
func (aq *ArticleQuery) Aggregate(fns ...AggregateFunc) *ArticleSelect
Aggregate returns a ArticleSelect configured with the given aggregations.
func (*ArticleQuery) All ¶
func (aq *ArticleQuery) All(ctx context.Context) ([]*Article, error)
All executes the query and returns a list of Articles.
func (*ArticleQuery) AllX ¶
func (aq *ArticleQuery) AllX(ctx context.Context) []*Article
AllX is like All, but panics if an error occurs.
func (*ArticleQuery) Clone ¶
func (aq *ArticleQuery) Clone() *ArticleQuery
Clone returns a duplicate of the ArticleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ArticleQuery) Count ¶
func (aq *ArticleQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ArticleQuery) CountX ¶
func (aq *ArticleQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ArticleQuery) Exist ¶
func (aq *ArticleQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ArticleQuery) ExistX ¶
func (aq *ArticleQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ArticleQuery) First ¶
func (aq *ArticleQuery) First(ctx context.Context) (*Article, error)
First returns the first Article entity from the query. Returns a *NotFoundError when no Article was found.
func (*ArticleQuery) FirstID ¶
func (aq *ArticleQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Article ID from the query. Returns a *NotFoundError when no Article ID was found.
func (*ArticleQuery) FirstIDX ¶
func (aq *ArticleQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ArticleQuery) FirstX ¶
func (aq *ArticleQuery) FirstX(ctx context.Context) *Article
FirstX is like First, but panics if an error occurs.
func (*ArticleQuery) GroupBy ¶
func (aq *ArticleQuery) GroupBy(field string, fields ...string) *ArticleGroupBy
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 { ThumbnailImgURL string `json:"thumbnail_img_url,omitempty"` Count int `json:"count,omitempty"` } client.Article.Query(). GroupBy(article.FieldThumbnailImgURL). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ArticleQuery) IDs ¶
func (aq *ArticleQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Article IDs.
func (*ArticleQuery) IDsX ¶
func (aq *ArticleQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ArticleQuery) Limit ¶
func (aq *ArticleQuery) Limit(limit int) *ArticleQuery
Limit the number of records to be returned by this query.
func (*ArticleQuery) Offset ¶
func (aq *ArticleQuery) Offset(offset int) *ArticleQuery
Offset to start from.
func (*ArticleQuery) Only ¶
func (aq *ArticleQuery) Only(ctx context.Context) (*Article, error)
Only returns a single Article entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Article entity is found. Returns a *NotFoundError when no Article entities are found.
func (*ArticleQuery) OnlyID ¶
func (aq *ArticleQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Article ID in the query. Returns a *NotSingularError when more than one Article ID is found. Returns a *NotFoundError when no entities are found.
func (*ArticleQuery) OnlyIDX ¶
func (aq *ArticleQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ArticleQuery) OnlyX ¶
func (aq *ArticleQuery) OnlyX(ctx context.Context) *Article
OnlyX is like Only, but panics if an error occurs.
func (*ArticleQuery) Order ¶
func (aq *ArticleQuery) Order(o ...OrderFunc) *ArticleQuery
Order specifies how the records should be ordered.
func (*ArticleQuery) QueryTags ¶
func (aq *ArticleQuery) QueryTags() *TagQuery
QueryTags chains the current query on the "tags" edge.
func (*ArticleQuery) Select ¶
func (aq *ArticleQuery) Select(fields ...string) *ArticleSelect
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 { ThumbnailImgURL string `json:"thumbnail_img_url,omitempty"` } client.Article.Query(). Select(article.FieldThumbnailImgURL). Scan(ctx, &v)
func (*ArticleQuery) Unique ¶
func (aq *ArticleQuery) Unique(unique bool) *ArticleQuery
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 (*ArticleQuery) Where ¶
func (aq *ArticleQuery) Where(ps ...predicate.Article) *ArticleQuery
Where adds a new predicate for the ArticleQuery builder.
func (*ArticleQuery) WithTags ¶
func (aq *ArticleQuery) WithTags(opts ...func(*TagQuery)) *ArticleQuery
WithTags tells the query-builder to eager-load the nodes that are connected to the "tags" edge. The optional arguments are used to configure the query builder of the edge.
type ArticleSelect ¶
type ArticleSelect struct { *ArticleQuery // contains filtered or unexported fields }
ArticleSelect is the builder for selecting fields of Article entities.
func (*ArticleSelect) Aggregate ¶
func (as *ArticleSelect) Aggregate(fns ...AggregateFunc) *ArticleSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ArticleSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Scan ¶
func (as *ArticleSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ArticleSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ArticleUpdate ¶
type ArticleUpdate struct {
// contains filtered or unexported fields
}
ArticleUpdate is the builder for updating Article entities.
func (*ArticleUpdate) AddTagIDs ¶
func (au *ArticleUpdate) AddTagIDs(ids ...int) *ArticleUpdate
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*ArticleUpdate) AddTags ¶
func (au *ArticleUpdate) AddTags(t ...*Tag) *ArticleUpdate
AddTags adds the "tags" edges to the Tag entity.
func (*ArticleUpdate) ClearTags ¶
func (au *ArticleUpdate) ClearTags() *ArticleUpdate
ClearTags clears all "tags" edges to the Tag entity.
func (*ArticleUpdate) Exec ¶
func (au *ArticleUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleUpdate) ExecX ¶
func (au *ArticleUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleUpdate) Mutation ¶
func (au *ArticleUpdate) Mutation() *ArticleMutation
Mutation returns the ArticleMutation object of the builder.
func (*ArticleUpdate) RemoveTagIDs ¶
func (au *ArticleUpdate) RemoveTagIDs(ids ...int) *ArticleUpdate
RemoveTagIDs removes the "tags" edge to Tag entities by IDs.
func (*ArticleUpdate) RemoveTags ¶
func (au *ArticleUpdate) RemoveTags(t ...*Tag) *ArticleUpdate
RemoveTags removes "tags" edges to Tag entities.
func (*ArticleUpdate) Save ¶
func (au *ArticleUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ArticleUpdate) SaveX ¶
func (au *ArticleUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ArticleUpdate) SetContent ¶
func (au *ArticleUpdate) SetContent(s string) *ArticleUpdate
SetContent sets the "content" field.
func (*ArticleUpdate) SetCreatedAt ¶
func (au *ArticleUpdate) SetCreatedAt(t time.Time) *ArticleUpdate
SetCreatedAt sets the "created_at" field.
func (*ArticleUpdate) SetNillableCreatedAt ¶
func (au *ArticleUpdate) SetNillableCreatedAt(t *time.Time) *ArticleUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ArticleUpdate) SetNillableThumbnailImgURL ¶
func (au *ArticleUpdate) SetNillableThumbnailImgURL(s *string) *ArticleUpdate
SetNillableThumbnailImgURL sets the "thumbnail_img_url" field if the given value is not nil.
func (*ArticleUpdate) SetThumbnailImgURL ¶
func (au *ArticleUpdate) SetThumbnailImgURL(s string) *ArticleUpdate
SetThumbnailImgURL sets the "thumbnail_img_url" field.
func (*ArticleUpdate) SetTitle ¶
func (au *ArticleUpdate) SetTitle(s string) *ArticleUpdate
SetTitle sets the "title" field.
func (*ArticleUpdate) Where ¶
func (au *ArticleUpdate) Where(ps ...predicate.Article) *ArticleUpdate
Where appends a list predicates to the ArticleUpdate builder.
type ArticleUpdateOne ¶
type ArticleUpdateOne struct {
// contains filtered or unexported fields
}
ArticleUpdateOne is the builder for updating a single Article entity.
func (*ArticleUpdateOne) AddTagIDs ¶
func (auo *ArticleUpdateOne) AddTagIDs(ids ...int) *ArticleUpdateOne
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*ArticleUpdateOne) AddTags ¶
func (auo *ArticleUpdateOne) AddTags(t ...*Tag) *ArticleUpdateOne
AddTags adds the "tags" edges to the Tag entity.
func (*ArticleUpdateOne) ClearTags ¶
func (auo *ArticleUpdateOne) ClearTags() *ArticleUpdateOne
ClearTags clears all "tags" edges to the Tag entity.
func (*ArticleUpdateOne) Exec ¶
func (auo *ArticleUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ArticleUpdateOne) ExecX ¶
func (auo *ArticleUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleUpdateOne) Mutation ¶
func (auo *ArticleUpdateOne) Mutation() *ArticleMutation
Mutation returns the ArticleMutation object of the builder.
func (*ArticleUpdateOne) RemoveTagIDs ¶
func (auo *ArticleUpdateOne) RemoveTagIDs(ids ...int) *ArticleUpdateOne
RemoveTagIDs removes the "tags" edge to Tag entities by IDs.
func (*ArticleUpdateOne) RemoveTags ¶
func (auo *ArticleUpdateOne) RemoveTags(t ...*Tag) *ArticleUpdateOne
RemoveTags removes "tags" edges to Tag entities.
func (*ArticleUpdateOne) Save ¶
func (auo *ArticleUpdateOne) Save(ctx context.Context) (*Article, error)
Save executes the query and returns the updated Article entity.
func (*ArticleUpdateOne) SaveX ¶
func (auo *ArticleUpdateOne) SaveX(ctx context.Context) *Article
SaveX is like Save, but panics if an error occurs.
func (*ArticleUpdateOne) Select ¶
func (auo *ArticleUpdateOne) Select(field string, fields ...string) *ArticleUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ArticleUpdateOne) SetContent ¶
func (auo *ArticleUpdateOne) SetContent(s string) *ArticleUpdateOne
SetContent sets the "content" field.
func (*ArticleUpdateOne) SetCreatedAt ¶
func (auo *ArticleUpdateOne) SetCreatedAt(t time.Time) *ArticleUpdateOne
SetCreatedAt sets the "created_at" field.
func (*ArticleUpdateOne) SetNillableCreatedAt ¶
func (auo *ArticleUpdateOne) SetNillableCreatedAt(t *time.Time) *ArticleUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ArticleUpdateOne) SetNillableThumbnailImgURL ¶
func (auo *ArticleUpdateOne) SetNillableThumbnailImgURL(s *string) *ArticleUpdateOne
SetNillableThumbnailImgURL sets the "thumbnail_img_url" field if the given value is not nil.
func (*ArticleUpdateOne) SetThumbnailImgURL ¶
func (auo *ArticleUpdateOne) SetThumbnailImgURL(s string) *ArticleUpdateOne
SetThumbnailImgURL sets the "thumbnail_img_url" field.
func (*ArticleUpdateOne) SetTitle ¶
func (auo *ArticleUpdateOne) SetTitle(s string) *ArticleUpdateOne
SetTitle sets the "title" field.
func (*ArticleUpdateOne) Where ¶
func (auo *ArticleUpdateOne) Where(ps ...predicate.Article) *ArticleUpdateOne
Where appends a list predicates to the ArticleUpdate builder.
type BFPDataPoint ¶
type BFPDataPoint struct { // ID of the ent. ID int `json:"id,omitempty"` // FatPercentage holds the value of the "fat_percentage" field. FatPercentage float64 `json:"fat_percentage,omitempty"` // TotalWeight holds the value of the "total_weight" field. TotalWeight int `json:"total_weight,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the BFPDataPointQuery when eager-loading is set. Edges BFPDataPointEdges `json:"edges"` // contains filtered or unexported fields }
BFPDataPoint is the model entity for the BFPDataPoint schema.
func (*BFPDataPoint) QueryUser ¶
func (bdp *BFPDataPoint) QueryUser() *UserQuery
QueryUser queries the "user" edge of the BFPDataPoint entity.
func (*BFPDataPoint) String ¶
func (bdp *BFPDataPoint) String() string
String implements the fmt.Stringer.
func (*BFPDataPoint) Unwrap ¶
func (bdp *BFPDataPoint) Unwrap() *BFPDataPoint
Unwrap unwraps the BFPDataPoint 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 (*BFPDataPoint) Update ¶
func (bdp *BFPDataPoint) Update() *BFPDataPointUpdateOne
Update returns a builder for updating this BFPDataPoint. Note that you need to call BFPDataPoint.Unwrap() before calling this method if this BFPDataPoint was returned from a transaction, and the transaction was committed or rolled back.
type BFPDataPointClient ¶
type BFPDataPointClient struct {
// contains filtered or unexported fields
}
BFPDataPointClient is a client for the BFPDataPoint schema.
func NewBFPDataPointClient ¶
func NewBFPDataPointClient(c config) *BFPDataPointClient
NewBFPDataPointClient returns a client for the BFPDataPoint from the given config.
func (*BFPDataPointClient) Create ¶
func (c *BFPDataPointClient) Create() *BFPDataPointCreate
Create returns a builder for creating a BFPDataPoint entity.
func (*BFPDataPointClient) CreateBulk ¶
func (c *BFPDataPointClient) CreateBulk(builders ...*BFPDataPointCreate) *BFPDataPointCreateBulk
CreateBulk returns a builder for creating a bulk of BFPDataPoint entities.
func (*BFPDataPointClient) Delete ¶
func (c *BFPDataPointClient) Delete() *BFPDataPointDelete
Delete returns a delete builder for BFPDataPoint.
func (*BFPDataPointClient) DeleteOne ¶
func (c *BFPDataPointClient) DeleteOne(bdp *BFPDataPoint) *BFPDataPointDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*BFPDataPointClient) DeleteOneID ¶
func (c *BFPDataPointClient) DeleteOneID(id int) *BFPDataPointDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*BFPDataPointClient) Get ¶
func (c *BFPDataPointClient) Get(ctx context.Context, id int) (*BFPDataPoint, error)
Get returns a BFPDataPoint entity by its id.
func (*BFPDataPointClient) GetX ¶
func (c *BFPDataPointClient) GetX(ctx context.Context, id int) *BFPDataPoint
GetX is like Get, but panics if an error occurs.
func (*BFPDataPointClient) Hooks ¶
func (c *BFPDataPointClient) Hooks() []Hook
Hooks returns the client hooks.
func (*BFPDataPointClient) Intercept ¶
func (c *BFPDataPointClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `bfpdatapoint.Intercept(f(g(h())))`.
func (*BFPDataPointClient) Interceptors ¶
func (c *BFPDataPointClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*BFPDataPointClient) Query ¶
func (c *BFPDataPointClient) Query() *BFPDataPointQuery
Query returns a query builder for BFPDataPoint.
func (*BFPDataPointClient) QueryUser ¶
func (c *BFPDataPointClient) QueryUser(bdp *BFPDataPoint) *UserQuery
QueryUser queries the user edge of a BFPDataPoint.
func (*BFPDataPointClient) Update ¶
func (c *BFPDataPointClient) Update() *BFPDataPointUpdate
Update returns an update builder for BFPDataPoint.
func (*BFPDataPointClient) UpdateOne ¶
func (c *BFPDataPointClient) UpdateOne(bdp *BFPDataPoint) *BFPDataPointUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BFPDataPointClient) UpdateOneID ¶
func (c *BFPDataPointClient) UpdateOneID(id int) *BFPDataPointUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BFPDataPointClient) Use ¶
func (c *BFPDataPointClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `bfpdatapoint.Hooks(f(g(h())))`.
type BFPDataPointCreate ¶
type BFPDataPointCreate struct {
// contains filtered or unexported fields
}
BFPDataPointCreate is the builder for creating a BFPDataPoint entity.
func (*BFPDataPointCreate) Exec ¶
func (bdpc *BFPDataPointCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BFPDataPointCreate) ExecX ¶
func (bdpc *BFPDataPointCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BFPDataPointCreate) Mutation ¶
func (bdpc *BFPDataPointCreate) Mutation() *BFPDataPointMutation
Mutation returns the BFPDataPointMutation object of the builder.
func (*BFPDataPointCreate) Save ¶
func (bdpc *BFPDataPointCreate) Save(ctx context.Context) (*BFPDataPoint, error)
Save creates the BFPDataPoint in the database.
func (*BFPDataPointCreate) SaveX ¶
func (bdpc *BFPDataPointCreate) SaveX(ctx context.Context) *BFPDataPoint
SaveX calls Save and panics if Save returns an error.
func (*BFPDataPointCreate) SetCreatedAt ¶
func (bdpc *BFPDataPointCreate) SetCreatedAt(t time.Time) *BFPDataPointCreate
SetCreatedAt sets the "created_at" field.
func (*BFPDataPointCreate) SetFatPercentage ¶
func (bdpc *BFPDataPointCreate) SetFatPercentage(f float64) *BFPDataPointCreate
SetFatPercentage sets the "fat_percentage" field.
func (*BFPDataPointCreate) SetNillableCreatedAt ¶
func (bdpc *BFPDataPointCreate) SetNillableCreatedAt(t *time.Time) *BFPDataPointCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*BFPDataPointCreate) SetNillableUserID ¶
func (bdpc *BFPDataPointCreate) SetNillableUserID(id *int) *BFPDataPointCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*BFPDataPointCreate) SetTotalWeight ¶
func (bdpc *BFPDataPointCreate) SetTotalWeight(i int) *BFPDataPointCreate
SetTotalWeight sets the "total_weight" field.
func (*BFPDataPointCreate) SetUser ¶
func (bdpc *BFPDataPointCreate) SetUser(u *User) *BFPDataPointCreate
SetUser sets the "user" edge to the User entity.
func (*BFPDataPointCreate) SetUserID ¶
func (bdpc *BFPDataPointCreate) SetUserID(id int) *BFPDataPointCreate
SetUserID sets the "user" edge to the User entity by ID.
type BFPDataPointCreateBulk ¶
type BFPDataPointCreateBulk struct {
// contains filtered or unexported fields
}
BFPDataPointCreateBulk is the builder for creating many BFPDataPoint entities in bulk.
func (*BFPDataPointCreateBulk) Exec ¶
func (bdpcb *BFPDataPointCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BFPDataPointCreateBulk) ExecX ¶
func (bdpcb *BFPDataPointCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BFPDataPointCreateBulk) Save ¶
func (bdpcb *BFPDataPointCreateBulk) Save(ctx context.Context) ([]*BFPDataPoint, error)
Save creates the BFPDataPoint entities in the database.
func (*BFPDataPointCreateBulk) SaveX ¶
func (bdpcb *BFPDataPointCreateBulk) SaveX(ctx context.Context) []*BFPDataPoint
SaveX is like Save, but panics if an error occurs.
type BFPDataPointDelete ¶
type BFPDataPointDelete struct {
// contains filtered or unexported fields
}
BFPDataPointDelete is the builder for deleting a BFPDataPoint entity.
func (*BFPDataPointDelete) Exec ¶
func (bdpd *BFPDataPointDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BFPDataPointDelete) ExecX ¶
func (bdpd *BFPDataPointDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BFPDataPointDelete) Where ¶
func (bdpd *BFPDataPointDelete) Where(ps ...predicate.BFPDataPoint) *BFPDataPointDelete
Where appends a list predicates to the BFPDataPointDelete builder.
type BFPDataPointDeleteOne ¶
type BFPDataPointDeleteOne struct {
// contains filtered or unexported fields
}
BFPDataPointDeleteOne is the builder for deleting a single BFPDataPoint entity.
func (*BFPDataPointDeleteOne) Exec ¶
func (bdpdo *BFPDataPointDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BFPDataPointDeleteOne) ExecX ¶
func (bdpdo *BFPDataPointDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BFPDataPointDeleteOne) Where ¶
func (bdpdo *BFPDataPointDeleteOne) Where(ps ...predicate.BFPDataPoint) *BFPDataPointDeleteOne
Where appends a list predicates to the BFPDataPointDelete builder.
type BFPDataPointEdges ¶
type BFPDataPointEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
BFPDataPointEdges holds the relations/edges for other nodes in the graph.
func (BFPDataPointEdges) UserOrErr ¶
func (e BFPDataPointEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type BFPDataPointGroupBy ¶
type BFPDataPointGroupBy struct {
// contains filtered or unexported fields
}
BFPDataPointGroupBy is the group-by builder for BFPDataPoint entities.
func (*BFPDataPointGroupBy) Aggregate ¶
func (bdpgb *BFPDataPointGroupBy) Aggregate(fns ...AggregateFunc) *BFPDataPointGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BFPDataPointGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BFPDataPointGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BFPDataPointGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BFPDataPointGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BFPDataPointGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BFPDataPointGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BFPDataPointGroupBy) Scan ¶
func (bdpgb *BFPDataPointGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BFPDataPointGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BFPDataPointMutation ¶
type BFPDataPointMutation struct {
// contains filtered or unexported fields
}
BFPDataPointMutation represents an operation that mutates the BFPDataPoint nodes in the graph.
func (*BFPDataPointMutation) AddFatPercentage ¶
func (m *BFPDataPointMutation) AddFatPercentage(f float64)
AddFatPercentage adds f to the "fat_percentage" field.
func (*BFPDataPointMutation) AddField ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) AddTotalWeight ¶
func (m *BFPDataPointMutation) AddTotalWeight(i int)
AddTotalWeight adds i to the "total_weight" field.
func (*BFPDataPointMutation) AddedEdges ¶
func (m *BFPDataPointMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BFPDataPointMutation) AddedFatPercentage ¶
func (m *BFPDataPointMutation) AddedFatPercentage() (r float64, exists bool)
AddedFatPercentage returns the value that was added to the "fat_percentage" field in this mutation.
func (*BFPDataPointMutation) AddedField ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) AddedFields ¶
func (m *BFPDataPointMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BFPDataPointMutation) AddedIDs ¶
func (m *BFPDataPointMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BFPDataPointMutation) AddedTotalWeight ¶
func (m *BFPDataPointMutation) AddedTotalWeight() (r int, exists bool)
AddedTotalWeight returns the value that was added to the "total_weight" field in this mutation.
func (*BFPDataPointMutation) ClearEdge ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) ClearField ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) ClearUser ¶
func (m *BFPDataPointMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*BFPDataPointMutation) ClearedEdges ¶
func (m *BFPDataPointMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BFPDataPointMutation) ClearedFields ¶
func (m *BFPDataPointMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BFPDataPointMutation) Client ¶
func (m BFPDataPointMutation) 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 (*BFPDataPointMutation) CreatedAt ¶
func (m *BFPDataPointMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*BFPDataPointMutation) EdgeCleared ¶
func (m *BFPDataPointMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BFPDataPointMutation) FatPercentage ¶
func (m *BFPDataPointMutation) FatPercentage() (r float64, exists bool)
FatPercentage returns the value of the "fat_percentage" field in the mutation.
func (*BFPDataPointMutation) Field ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) FieldCleared ¶
func (m *BFPDataPointMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BFPDataPointMutation) Fields ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) ID ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) IDs ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the BFPDataPoint entity. If the BFPDataPoint 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 (*BFPDataPointMutation) OldFatPercentage ¶
func (m *BFPDataPointMutation) OldFatPercentage(ctx context.Context) (v float64, err error)
OldFatPercentage returns the old "fat_percentage" field's value of the BFPDataPoint entity. If the BFPDataPoint 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 (*BFPDataPointMutation) 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 (*BFPDataPointMutation) OldTotalWeight ¶
func (m *BFPDataPointMutation) OldTotalWeight(ctx context.Context) (v int, err error)
OldTotalWeight returns the old "total_weight" field's value of the BFPDataPoint entity. If the BFPDataPoint 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 (*BFPDataPointMutation) Op ¶
func (m *BFPDataPointMutation) Op() Op
Op returns the operation name.
func (*BFPDataPointMutation) RemovedEdges ¶
func (m *BFPDataPointMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BFPDataPointMutation) RemovedIDs ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) ResetCreatedAt ¶
func (m *BFPDataPointMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*BFPDataPointMutation) ResetEdge ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) ResetFatPercentage ¶
func (m *BFPDataPointMutation) ResetFatPercentage()
ResetFatPercentage resets all changes to the "fat_percentage" field.
func (*BFPDataPointMutation) ResetField ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) ResetTotalWeight ¶
func (m *BFPDataPointMutation) ResetTotalWeight()
ResetTotalWeight resets all changes to the "total_weight" field.
func (*BFPDataPointMutation) ResetUser ¶
func (m *BFPDataPointMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*BFPDataPointMutation) SetCreatedAt ¶
func (m *BFPDataPointMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*BFPDataPointMutation) SetFatPercentage ¶
func (m *BFPDataPointMutation) SetFatPercentage(f float64)
SetFatPercentage sets the "fat_percentage" field.
func (*BFPDataPointMutation) SetField ¶
func (m *BFPDataPointMutation) 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 (*BFPDataPointMutation) SetOp ¶
func (m *BFPDataPointMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*BFPDataPointMutation) SetTotalWeight ¶
func (m *BFPDataPointMutation) SetTotalWeight(i int)
SetTotalWeight sets the "total_weight" field.
func (*BFPDataPointMutation) SetUserID ¶
func (m *BFPDataPointMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (*BFPDataPointMutation) TotalWeight ¶
func (m *BFPDataPointMutation) TotalWeight() (r int, exists bool)
TotalWeight returns the value of the "total_weight" field in the mutation.
func (BFPDataPointMutation) Tx ¶
func (m BFPDataPointMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BFPDataPointMutation) Type ¶
func (m *BFPDataPointMutation) Type() string
Type returns the node type of this mutation (BFPDataPoint).
func (*BFPDataPointMutation) UserCleared ¶
func (m *BFPDataPointMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*BFPDataPointMutation) UserID ¶
func (m *BFPDataPointMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*BFPDataPointMutation) UserIDs ¶
func (m *BFPDataPointMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*BFPDataPointMutation) Where ¶
func (m *BFPDataPointMutation) Where(ps ...predicate.BFPDataPoint)
Where appends a list predicates to the BFPDataPointMutation builder.
func (*BFPDataPointMutation) WhereP ¶
func (m *BFPDataPointMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the BFPDataPointMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type BFPDataPointQuery ¶
type BFPDataPointQuery struct {
// contains filtered or unexported fields
}
BFPDataPointQuery is the builder for querying BFPDataPoint entities.
func (*BFPDataPointQuery) Aggregate ¶
func (bdpq *BFPDataPointQuery) Aggregate(fns ...AggregateFunc) *BFPDataPointSelect
Aggregate returns a BFPDataPointSelect configured with the given aggregations.
func (*BFPDataPointQuery) All ¶
func (bdpq *BFPDataPointQuery) All(ctx context.Context) ([]*BFPDataPoint, error)
All executes the query and returns a list of BFPDataPoints.
func (*BFPDataPointQuery) AllX ¶
func (bdpq *BFPDataPointQuery) AllX(ctx context.Context) []*BFPDataPoint
AllX is like All, but panics if an error occurs.
func (*BFPDataPointQuery) Clone ¶
func (bdpq *BFPDataPointQuery) Clone() *BFPDataPointQuery
Clone returns a duplicate of the BFPDataPointQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BFPDataPointQuery) Count ¶
func (bdpq *BFPDataPointQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*BFPDataPointQuery) CountX ¶
func (bdpq *BFPDataPointQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*BFPDataPointQuery) Exist ¶
func (bdpq *BFPDataPointQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*BFPDataPointQuery) ExistX ¶
func (bdpq *BFPDataPointQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*BFPDataPointQuery) First ¶
func (bdpq *BFPDataPointQuery) First(ctx context.Context) (*BFPDataPoint, error)
First returns the first BFPDataPoint entity from the query. Returns a *NotFoundError when no BFPDataPoint was found.
func (*BFPDataPointQuery) FirstID ¶
func (bdpq *BFPDataPointQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first BFPDataPoint ID from the query. Returns a *NotFoundError when no BFPDataPoint ID was found.
func (*BFPDataPointQuery) FirstIDX ¶
func (bdpq *BFPDataPointQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*BFPDataPointQuery) FirstX ¶
func (bdpq *BFPDataPointQuery) FirstX(ctx context.Context) *BFPDataPoint
FirstX is like First, but panics if an error occurs.
func (*BFPDataPointQuery) GroupBy ¶
func (bdpq *BFPDataPointQuery) GroupBy(field string, fields ...string) *BFPDataPointGroupBy
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 { FatPercentage float64 `json:"fat_percentage,omitempty"` Count int `json:"count,omitempty"` } client.BFPDataPoint.Query(). GroupBy(bfpdatapoint.FieldFatPercentage). Aggregate(ent.Count()). Scan(ctx, &v)
func (*BFPDataPointQuery) IDs ¶
func (bdpq *BFPDataPointQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of BFPDataPoint IDs.
func (*BFPDataPointQuery) IDsX ¶
func (bdpq *BFPDataPointQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*BFPDataPointQuery) Limit ¶
func (bdpq *BFPDataPointQuery) Limit(limit int) *BFPDataPointQuery
Limit the number of records to be returned by this query.
func (*BFPDataPointQuery) Offset ¶
func (bdpq *BFPDataPointQuery) Offset(offset int) *BFPDataPointQuery
Offset to start from.
func (*BFPDataPointQuery) Only ¶
func (bdpq *BFPDataPointQuery) Only(ctx context.Context) (*BFPDataPoint, error)
Only returns a single BFPDataPoint entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one BFPDataPoint entity is found. Returns a *NotFoundError when no BFPDataPoint entities are found.
func (*BFPDataPointQuery) OnlyID ¶
func (bdpq *BFPDataPointQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only BFPDataPoint ID in the query. Returns a *NotSingularError when more than one BFPDataPoint ID is found. Returns a *NotFoundError when no entities are found.
func (*BFPDataPointQuery) OnlyIDX ¶
func (bdpq *BFPDataPointQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*BFPDataPointQuery) OnlyX ¶
func (bdpq *BFPDataPointQuery) OnlyX(ctx context.Context) *BFPDataPoint
OnlyX is like Only, but panics if an error occurs.
func (*BFPDataPointQuery) Order ¶
func (bdpq *BFPDataPointQuery) Order(o ...OrderFunc) *BFPDataPointQuery
Order specifies how the records should be ordered.
func (*BFPDataPointQuery) QueryUser ¶
func (bdpq *BFPDataPointQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*BFPDataPointQuery) Select ¶
func (bdpq *BFPDataPointQuery) Select(fields ...string) *BFPDataPointSelect
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 { FatPercentage float64 `json:"fat_percentage,omitempty"` } client.BFPDataPoint.Query(). Select(bfpdatapoint.FieldFatPercentage). Scan(ctx, &v)
func (*BFPDataPointQuery) Unique ¶
func (bdpq *BFPDataPointQuery) Unique(unique bool) *BFPDataPointQuery
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 (*BFPDataPointQuery) Where ¶
func (bdpq *BFPDataPointQuery) Where(ps ...predicate.BFPDataPoint) *BFPDataPointQuery
Where adds a new predicate for the BFPDataPointQuery builder.
func (*BFPDataPointQuery) WithUser ¶
func (bdpq *BFPDataPointQuery) WithUser(opts ...func(*UserQuery)) *BFPDataPointQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type BFPDataPointSelect ¶
type BFPDataPointSelect struct { *BFPDataPointQuery // contains filtered or unexported fields }
BFPDataPointSelect is the builder for selecting fields of BFPDataPoint entities.
func (*BFPDataPointSelect) Aggregate ¶
func (bdps *BFPDataPointSelect) Aggregate(fns ...AggregateFunc) *BFPDataPointSelect
Aggregate adds the given aggregation functions to the selector query.
func (*BFPDataPointSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BFPDataPointSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BFPDataPointSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BFPDataPointSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BFPDataPointSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BFPDataPointSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BFPDataPointSelect) Scan ¶
func (bdps *BFPDataPointSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BFPDataPointSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BFPDataPointUpdate ¶
type BFPDataPointUpdate struct {
// contains filtered or unexported fields
}
BFPDataPointUpdate is the builder for updating BFPDataPoint entities.
func (*BFPDataPointUpdate) AddFatPercentage ¶
func (bdpu *BFPDataPointUpdate) AddFatPercentage(f float64) *BFPDataPointUpdate
AddFatPercentage adds f to the "fat_percentage" field.
func (*BFPDataPointUpdate) AddTotalWeight ¶
func (bdpu *BFPDataPointUpdate) AddTotalWeight(i int) *BFPDataPointUpdate
AddTotalWeight adds i to the "total_weight" field.
func (*BFPDataPointUpdate) ClearUser ¶
func (bdpu *BFPDataPointUpdate) ClearUser() *BFPDataPointUpdate
ClearUser clears the "user" edge to the User entity.
func (*BFPDataPointUpdate) Exec ¶
func (bdpu *BFPDataPointUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BFPDataPointUpdate) ExecX ¶
func (bdpu *BFPDataPointUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BFPDataPointUpdate) Mutation ¶
func (bdpu *BFPDataPointUpdate) Mutation() *BFPDataPointMutation
Mutation returns the BFPDataPointMutation object of the builder.
func (*BFPDataPointUpdate) Save ¶
func (bdpu *BFPDataPointUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BFPDataPointUpdate) SaveX ¶
func (bdpu *BFPDataPointUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BFPDataPointUpdate) SetCreatedAt ¶
func (bdpu *BFPDataPointUpdate) SetCreatedAt(t time.Time) *BFPDataPointUpdate
SetCreatedAt sets the "created_at" field.
func (*BFPDataPointUpdate) SetFatPercentage ¶
func (bdpu *BFPDataPointUpdate) SetFatPercentage(f float64) *BFPDataPointUpdate
SetFatPercentage sets the "fat_percentage" field.
func (*BFPDataPointUpdate) SetNillableCreatedAt ¶
func (bdpu *BFPDataPointUpdate) SetNillableCreatedAt(t *time.Time) *BFPDataPointUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*BFPDataPointUpdate) SetNillableUserID ¶
func (bdpu *BFPDataPointUpdate) SetNillableUserID(id *int) *BFPDataPointUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*BFPDataPointUpdate) SetTotalWeight ¶
func (bdpu *BFPDataPointUpdate) SetTotalWeight(i int) *BFPDataPointUpdate
SetTotalWeight sets the "total_weight" field.
func (*BFPDataPointUpdate) SetUser ¶
func (bdpu *BFPDataPointUpdate) SetUser(u *User) *BFPDataPointUpdate
SetUser sets the "user" edge to the User entity.
func (*BFPDataPointUpdate) SetUserID ¶
func (bdpu *BFPDataPointUpdate) SetUserID(id int) *BFPDataPointUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*BFPDataPointUpdate) Where ¶
func (bdpu *BFPDataPointUpdate) Where(ps ...predicate.BFPDataPoint) *BFPDataPointUpdate
Where appends a list predicates to the BFPDataPointUpdate builder.
type BFPDataPointUpdateOne ¶
type BFPDataPointUpdateOne struct {
// contains filtered or unexported fields
}
BFPDataPointUpdateOne is the builder for updating a single BFPDataPoint entity.
func (*BFPDataPointUpdateOne) AddFatPercentage ¶
func (bdpuo *BFPDataPointUpdateOne) AddFatPercentage(f float64) *BFPDataPointUpdateOne
AddFatPercentage adds f to the "fat_percentage" field.
func (*BFPDataPointUpdateOne) AddTotalWeight ¶
func (bdpuo *BFPDataPointUpdateOne) AddTotalWeight(i int) *BFPDataPointUpdateOne
AddTotalWeight adds i to the "total_weight" field.
func (*BFPDataPointUpdateOne) ClearUser ¶
func (bdpuo *BFPDataPointUpdateOne) ClearUser() *BFPDataPointUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*BFPDataPointUpdateOne) Exec ¶
func (bdpuo *BFPDataPointUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BFPDataPointUpdateOne) ExecX ¶
func (bdpuo *BFPDataPointUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BFPDataPointUpdateOne) Mutation ¶
func (bdpuo *BFPDataPointUpdateOne) Mutation() *BFPDataPointMutation
Mutation returns the BFPDataPointMutation object of the builder.
func (*BFPDataPointUpdateOne) Save ¶
func (bdpuo *BFPDataPointUpdateOne) Save(ctx context.Context) (*BFPDataPoint, error)
Save executes the query and returns the updated BFPDataPoint entity.
func (*BFPDataPointUpdateOne) SaveX ¶
func (bdpuo *BFPDataPointUpdateOne) SaveX(ctx context.Context) *BFPDataPoint
SaveX is like Save, but panics if an error occurs.
func (*BFPDataPointUpdateOne) Select ¶
func (bdpuo *BFPDataPointUpdateOne) Select(field string, fields ...string) *BFPDataPointUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BFPDataPointUpdateOne) SetCreatedAt ¶
func (bdpuo *BFPDataPointUpdateOne) SetCreatedAt(t time.Time) *BFPDataPointUpdateOne
SetCreatedAt sets the "created_at" field.
func (*BFPDataPointUpdateOne) SetFatPercentage ¶
func (bdpuo *BFPDataPointUpdateOne) SetFatPercentage(f float64) *BFPDataPointUpdateOne
SetFatPercentage sets the "fat_percentage" field.
func (*BFPDataPointUpdateOne) SetNillableCreatedAt ¶
func (bdpuo *BFPDataPointUpdateOne) SetNillableCreatedAt(t *time.Time) *BFPDataPointUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*BFPDataPointUpdateOne) SetNillableUserID ¶
func (bdpuo *BFPDataPointUpdateOne) SetNillableUserID(id *int) *BFPDataPointUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*BFPDataPointUpdateOne) SetTotalWeight ¶
func (bdpuo *BFPDataPointUpdateOne) SetTotalWeight(i int) *BFPDataPointUpdateOne
SetTotalWeight sets the "total_weight" field.
func (*BFPDataPointUpdateOne) SetUser ¶
func (bdpuo *BFPDataPointUpdateOne) SetUser(u *User) *BFPDataPointUpdateOne
SetUser sets the "user" edge to the User entity.
func (*BFPDataPointUpdateOne) SetUserID ¶
func (bdpuo *BFPDataPointUpdateOne) SetUserID(id int) *BFPDataPointUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*BFPDataPointUpdateOne) Where ¶
func (bdpuo *BFPDataPointUpdateOne) Where(ps ...predicate.BFPDataPoint) *BFPDataPointUpdateOne
Where appends a list predicates to the BFPDataPointUpdate builder.
type BFPDataPoints ¶
type BFPDataPoints []*BFPDataPoint
BFPDataPoints is a parsable slice of BFPDataPoint.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Achievement is the client for interacting with the Achievement builders. Achievement *AchievementClient // Article is the client for interacting with the Article builders. Article *ArticleClient // BFPDataPoint is the client for interacting with the BFPDataPoint builders. BFPDataPoint *BFPDataPointClient // Meal is the client for interacting with the Meal builders. Meal *MealClient // Tag is the client for interacting with the Tag builders. Tag *TagClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
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(). Achievement. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type Meal ¶
type Meal struct { // ID of the ent. ID int `json:"id,omitempty"` // MealType holds the value of the "meal_type" field. MealType string `json:"meal_type,omitempty"` // ImageURL holds the value of the "image_url" field. ImageURL string `json:"image_url,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the MealQuery when eager-loading is set. Edges MealEdges `json:"edges"` // contains filtered or unexported fields }
Meal is the model entity for the Meal schema.
func (*Meal) Unwrap ¶
Unwrap unwraps the Meal 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 (*Meal) Update ¶
func (m *Meal) Update() *MealUpdateOne
Update returns a builder for updating this Meal. Note that you need to call Meal.Unwrap() before calling this method if this Meal was returned from a transaction, and the transaction was committed or rolled back.
type MealClient ¶
type MealClient struct {
// contains filtered or unexported fields
}
MealClient is a client for the Meal schema.
func NewMealClient ¶
func NewMealClient(c config) *MealClient
NewMealClient returns a client for the Meal from the given config.
func (*MealClient) Create ¶
func (c *MealClient) Create() *MealCreate
Create returns a builder for creating a Meal entity.
func (*MealClient) CreateBulk ¶
func (c *MealClient) CreateBulk(builders ...*MealCreate) *MealCreateBulk
CreateBulk returns a builder for creating a bulk of Meal entities.
func (*MealClient) Delete ¶
func (c *MealClient) Delete() *MealDelete
Delete returns a delete builder for Meal.
func (*MealClient) DeleteOne ¶
func (c *MealClient) DeleteOne(m *Meal) *MealDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*MealClient) DeleteOneID ¶
func (c *MealClient) DeleteOneID(id int) *MealDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*MealClient) GetX ¶
func (c *MealClient) GetX(ctx context.Context, id int) *Meal
GetX is like Get, but panics if an error occurs.
func (*MealClient) Intercept ¶
func (c *MealClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `meal.Intercept(f(g(h())))`.
func (*MealClient) Interceptors ¶
func (c *MealClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*MealClient) Query ¶
func (c *MealClient) Query() *MealQuery
Query returns a query builder for Meal.
func (*MealClient) QueryUser ¶
func (c *MealClient) QueryUser(m *Meal) *UserQuery
QueryUser queries the user edge of a Meal.
func (*MealClient) Update ¶
func (c *MealClient) Update() *MealUpdate
Update returns an update builder for Meal.
func (*MealClient) UpdateOne ¶
func (c *MealClient) UpdateOne(m *Meal) *MealUpdateOne
UpdateOne returns an update builder for the given entity.
func (*MealClient) UpdateOneID ¶
func (c *MealClient) UpdateOneID(id int) *MealUpdateOne
UpdateOneID returns an update builder for the given id.
func (*MealClient) Use ¶
func (c *MealClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `meal.Hooks(f(g(h())))`.
type MealCreate ¶
type MealCreate struct {
// contains filtered or unexported fields
}
MealCreate is the builder for creating a Meal entity.
func (*MealCreate) Exec ¶
func (mc *MealCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*MealCreate) ExecX ¶
func (mc *MealCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MealCreate) Mutation ¶
func (mc *MealCreate) Mutation() *MealMutation
Mutation returns the MealMutation object of the builder.
func (*MealCreate) Save ¶
func (mc *MealCreate) Save(ctx context.Context) (*Meal, error)
Save creates the Meal in the database.
func (*MealCreate) SaveX ¶
func (mc *MealCreate) SaveX(ctx context.Context) *Meal
SaveX calls Save and panics if Save returns an error.
func (*MealCreate) SetCreatedAt ¶
func (mc *MealCreate) SetCreatedAt(t time.Time) *MealCreate
SetCreatedAt sets the "created_at" field.
func (*MealCreate) SetImageURL ¶
func (mc *MealCreate) SetImageURL(s string) *MealCreate
SetImageURL sets the "image_url" field.
func (*MealCreate) SetMealType ¶
func (mc *MealCreate) SetMealType(s string) *MealCreate
SetMealType sets the "meal_type" field.
func (*MealCreate) SetNillableCreatedAt ¶
func (mc *MealCreate) SetNillableCreatedAt(t *time.Time) *MealCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*MealCreate) SetNillableImageURL ¶
func (mc *MealCreate) SetNillableImageURL(s *string) *MealCreate
SetNillableImageURL sets the "image_url" field if the given value is not nil.
func (*MealCreate) SetNillableUserID ¶
func (mc *MealCreate) SetNillableUserID(id *int) *MealCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*MealCreate) SetUser ¶
func (mc *MealCreate) SetUser(u *User) *MealCreate
SetUser sets the "user" edge to the User entity.
func (*MealCreate) SetUserID ¶
func (mc *MealCreate) SetUserID(id int) *MealCreate
SetUserID sets the "user" edge to the User entity by ID.
type MealCreateBulk ¶
type MealCreateBulk struct {
// contains filtered or unexported fields
}
MealCreateBulk is the builder for creating many Meal entities in bulk.
func (*MealCreateBulk) Exec ¶
func (mcb *MealCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*MealCreateBulk) ExecX ¶
func (mcb *MealCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type MealDelete ¶
type MealDelete struct {
// contains filtered or unexported fields
}
MealDelete is the builder for deleting a Meal entity.
func (*MealDelete) Exec ¶
func (md *MealDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*MealDelete) ExecX ¶
func (md *MealDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*MealDelete) Where ¶
func (md *MealDelete) Where(ps ...predicate.Meal) *MealDelete
Where appends a list predicates to the MealDelete builder.
type MealDeleteOne ¶
type MealDeleteOne struct {
// contains filtered or unexported fields
}
MealDeleteOne is the builder for deleting a single Meal entity.
func (*MealDeleteOne) Exec ¶
func (mdo *MealDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*MealDeleteOne) ExecX ¶
func (mdo *MealDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MealDeleteOne) Where ¶
func (mdo *MealDeleteOne) Where(ps ...predicate.Meal) *MealDeleteOne
Where appends a list predicates to the MealDelete builder.
type MealEdges ¶
type MealEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
MealEdges holds the relations/edges for other nodes in the graph.
type MealGroupBy ¶
type MealGroupBy struct {
// contains filtered or unexported fields
}
MealGroupBy is the group-by builder for Meal entities.
func (*MealGroupBy) Aggregate ¶
func (mgb *MealGroupBy) Aggregate(fns ...AggregateFunc) *MealGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*MealGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MealGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MealGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MealGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MealGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MealGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MealGroupBy) Scan ¶
func (mgb *MealGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MealGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MealMutation ¶
type MealMutation struct {
// contains filtered or unexported fields
}
MealMutation represents an operation that mutates the Meal nodes in the graph.
func (*MealMutation) AddField ¶
func (m *MealMutation) 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 (*MealMutation) AddedEdges ¶
func (m *MealMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*MealMutation) AddedField ¶
func (m *MealMutation) 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 (*MealMutation) AddedFields ¶
func (m *MealMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*MealMutation) AddedIDs ¶
func (m *MealMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*MealMutation) ClearEdge ¶
func (m *MealMutation) 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 (*MealMutation) ClearField ¶
func (m *MealMutation) 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 (*MealMutation) ClearUser ¶
func (m *MealMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*MealMutation) ClearedEdges ¶
func (m *MealMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*MealMutation) ClearedFields ¶
func (m *MealMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (MealMutation) Client ¶
func (m MealMutation) 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 (*MealMutation) CreatedAt ¶
func (m *MealMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*MealMutation) EdgeCleared ¶
func (m *MealMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*MealMutation) Field ¶
func (m *MealMutation) 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 (*MealMutation) FieldCleared ¶
func (m *MealMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*MealMutation) Fields ¶
func (m *MealMutation) 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 (*MealMutation) ID ¶
func (m *MealMutation) 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 (*MealMutation) IDs ¶
func (m *MealMutation) 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 (*MealMutation) ImageURL ¶
func (m *MealMutation) ImageURL() (r string, exists bool)
ImageURL returns the value of the "image_url" field in the mutation.
func (*MealMutation) MealType ¶
func (m *MealMutation) MealType() (r string, exists bool)
MealType returns the value of the "meal_type" field in the mutation.
func (*MealMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Meal entity. If the Meal 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 (*MealMutation) 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 (*MealMutation) OldImageURL ¶
func (m *MealMutation) OldImageURL(ctx context.Context) (v string, err error)
OldImageURL returns the old "image_url" field's value of the Meal entity. If the Meal 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 (*MealMutation) OldMealType ¶
func (m *MealMutation) OldMealType(ctx context.Context) (v string, err error)
OldMealType returns the old "meal_type" field's value of the Meal entity. If the Meal 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 (*MealMutation) RemovedEdges ¶
func (m *MealMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*MealMutation) RemovedIDs ¶
func (m *MealMutation) 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 (*MealMutation) ResetCreatedAt ¶
func (m *MealMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*MealMutation) ResetEdge ¶
func (m *MealMutation) 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 (*MealMutation) ResetField ¶
func (m *MealMutation) 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 (*MealMutation) ResetImageURL ¶
func (m *MealMutation) ResetImageURL()
ResetImageURL resets all changes to the "image_url" field.
func (*MealMutation) ResetMealType ¶
func (m *MealMutation) ResetMealType()
ResetMealType resets all changes to the "meal_type" field.
func (*MealMutation) ResetUser ¶
func (m *MealMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*MealMutation) SetCreatedAt ¶
func (m *MealMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*MealMutation) SetField ¶
func (m *MealMutation) 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 (*MealMutation) SetImageURL ¶
func (m *MealMutation) SetImageURL(s string)
SetImageURL sets the "image_url" field.
func (*MealMutation) SetMealType ¶
func (m *MealMutation) SetMealType(s string)
SetMealType sets the "meal_type" field.
func (*MealMutation) SetOp ¶
func (m *MealMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*MealMutation) SetUserID ¶
func (m *MealMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (MealMutation) Tx ¶
func (m MealMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*MealMutation) Type ¶
func (m *MealMutation) Type() string
Type returns the node type of this mutation (Meal).
func (*MealMutation) UserCleared ¶
func (m *MealMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*MealMutation) UserID ¶
func (m *MealMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*MealMutation) UserIDs ¶
func (m *MealMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*MealMutation) Where ¶
func (m *MealMutation) Where(ps ...predicate.Meal)
Where appends a list predicates to the MealMutation builder.
func (*MealMutation) WhereP ¶
func (m *MealMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the MealMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type MealQuery ¶
type MealQuery struct {
// contains filtered or unexported fields
}
MealQuery is the builder for querying Meal entities.
func (*MealQuery) Aggregate ¶
func (mq *MealQuery) Aggregate(fns ...AggregateFunc) *MealSelect
Aggregate returns a MealSelect configured with the given aggregations.
func (*MealQuery) Clone ¶
Clone returns a duplicate of the MealQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*MealQuery) First ¶
First returns the first Meal entity from the query. Returns a *NotFoundError when no Meal was found.
func (*MealQuery) FirstID ¶
FirstID returns the first Meal ID from the query. Returns a *NotFoundError when no Meal ID was found.
func (*MealQuery) GroupBy ¶
func (mq *MealQuery) GroupBy(field string, fields ...string) *MealGroupBy
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 { MealType string `json:"meal_type,omitempty"` Count int `json:"count,omitempty"` } client.Meal.Query(). GroupBy(meal.FieldMealType). Aggregate(ent.Count()). Scan(ctx, &v)
func (*MealQuery) Only ¶
Only returns a single Meal entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Meal entity is found. Returns a *NotFoundError when no Meal entities are found.
func (*MealQuery) OnlyID ¶
OnlyID is like Only, but returns the only Meal ID in the query. Returns a *NotSingularError when more than one Meal ID is found. Returns a *NotFoundError when no entities are found.
func (*MealQuery) Select ¶
func (mq *MealQuery) Select(fields ...string) *MealSelect
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 { MealType string `json:"meal_type,omitempty"` } client.Meal.Query(). Select(meal.FieldMealType). Scan(ctx, &v)
func (*MealQuery) 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.
type MealSelect ¶
type MealSelect struct { *MealQuery // contains filtered or unexported fields }
MealSelect is the builder for selecting fields of Meal entities.
func (*MealSelect) Aggregate ¶
func (ms *MealSelect) Aggregate(fns ...AggregateFunc) *MealSelect
Aggregate adds the given aggregation functions to the selector query.
func (*MealSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MealSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MealSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MealSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MealSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MealSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MealSelect) Scan ¶
func (ms *MealSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MealSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MealUpdate ¶
type MealUpdate struct {
// contains filtered or unexported fields
}
MealUpdate is the builder for updating Meal entities.
func (*MealUpdate) ClearUser ¶
func (mu *MealUpdate) ClearUser() *MealUpdate
ClearUser clears the "user" edge to the User entity.
func (*MealUpdate) Exec ¶
func (mu *MealUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*MealUpdate) ExecX ¶
func (mu *MealUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MealUpdate) Mutation ¶
func (mu *MealUpdate) Mutation() *MealMutation
Mutation returns the MealMutation object of the builder.
func (*MealUpdate) Save ¶
func (mu *MealUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*MealUpdate) SaveX ¶
func (mu *MealUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*MealUpdate) SetCreatedAt ¶
func (mu *MealUpdate) SetCreatedAt(t time.Time) *MealUpdate
SetCreatedAt sets the "created_at" field.
func (*MealUpdate) SetImageURL ¶
func (mu *MealUpdate) SetImageURL(s string) *MealUpdate
SetImageURL sets the "image_url" field.
func (*MealUpdate) SetMealType ¶
func (mu *MealUpdate) SetMealType(s string) *MealUpdate
SetMealType sets the "meal_type" field.
func (*MealUpdate) SetNillableCreatedAt ¶
func (mu *MealUpdate) SetNillableCreatedAt(t *time.Time) *MealUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*MealUpdate) SetNillableImageURL ¶
func (mu *MealUpdate) SetNillableImageURL(s *string) *MealUpdate
SetNillableImageURL sets the "image_url" field if the given value is not nil.
func (*MealUpdate) SetNillableUserID ¶
func (mu *MealUpdate) SetNillableUserID(id *int) *MealUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*MealUpdate) SetUser ¶
func (mu *MealUpdate) SetUser(u *User) *MealUpdate
SetUser sets the "user" edge to the User entity.
func (*MealUpdate) SetUserID ¶
func (mu *MealUpdate) SetUserID(id int) *MealUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*MealUpdate) Where ¶
func (mu *MealUpdate) Where(ps ...predicate.Meal) *MealUpdate
Where appends a list predicates to the MealUpdate builder.
type MealUpdateOne ¶
type MealUpdateOne struct {
// contains filtered or unexported fields
}
MealUpdateOne is the builder for updating a single Meal entity.
func (*MealUpdateOne) ClearUser ¶
func (muo *MealUpdateOne) ClearUser() *MealUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*MealUpdateOne) Exec ¶
func (muo *MealUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*MealUpdateOne) ExecX ¶
func (muo *MealUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MealUpdateOne) Mutation ¶
func (muo *MealUpdateOne) Mutation() *MealMutation
Mutation returns the MealMutation object of the builder.
func (*MealUpdateOne) Save ¶
func (muo *MealUpdateOne) Save(ctx context.Context) (*Meal, error)
Save executes the query and returns the updated Meal entity.
func (*MealUpdateOne) SaveX ¶
func (muo *MealUpdateOne) SaveX(ctx context.Context) *Meal
SaveX is like Save, but panics if an error occurs.
func (*MealUpdateOne) Select ¶
func (muo *MealUpdateOne) Select(field string, fields ...string) *MealUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*MealUpdateOne) SetCreatedAt ¶
func (muo *MealUpdateOne) SetCreatedAt(t time.Time) *MealUpdateOne
SetCreatedAt sets the "created_at" field.
func (*MealUpdateOne) SetImageURL ¶
func (muo *MealUpdateOne) SetImageURL(s string) *MealUpdateOne
SetImageURL sets the "image_url" field.
func (*MealUpdateOne) SetMealType ¶
func (muo *MealUpdateOne) SetMealType(s string) *MealUpdateOne
SetMealType sets the "meal_type" field.
func (*MealUpdateOne) SetNillableCreatedAt ¶
func (muo *MealUpdateOne) SetNillableCreatedAt(t *time.Time) *MealUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*MealUpdateOne) SetNillableImageURL ¶
func (muo *MealUpdateOne) SetNillableImageURL(s *string) *MealUpdateOne
SetNillableImageURL sets the "image_url" field if the given value is not nil.
func (*MealUpdateOne) SetNillableUserID ¶
func (muo *MealUpdateOne) SetNillableUserID(id *int) *MealUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*MealUpdateOne) SetUser ¶
func (muo *MealUpdateOne) SetUser(u *User) *MealUpdateOne
SetUser sets the "user" edge to the User entity.
func (*MealUpdateOne) SetUserID ¶
func (muo *MealUpdateOne) SetUserID(id int) *MealUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*MealUpdateOne) Where ¶
func (muo *MealUpdateOne) Where(ps ...predicate.Meal) *MealUpdateOne
Where appends a list predicates to the MealUpdate builder.
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 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 Tag ¶
type Tag struct { // ID of the ent. ID int `json:"id,omitempty"` // TagName holds the value of the "tag_name" field. TagName string `json:"tag_name,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TagQuery when eager-loading is set. Edges TagEdges `json:"edges"` // contains filtered or unexported fields }
Tag is the model entity for the Tag schema.
func (*Tag) QueryArticle ¶
func (t *Tag) QueryArticle() *ArticleQuery
QueryArticle queries the "article" edge of the Tag entity.
func (*Tag) Unwrap ¶
Unwrap unwraps the Tag entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Tag) Update ¶
func (t *Tag) Update() *TagUpdateOne
Update returns a builder for updating this Tag. Note that you need to call Tag.Unwrap() before calling this method if this Tag was returned from a transaction, and the transaction was committed or rolled back.
type TagClient ¶
type TagClient struct {
// contains filtered or unexported fields
}
TagClient is a client for the Tag schema.
func NewTagClient ¶
func NewTagClient(c config) *TagClient
NewTagClient returns a client for the Tag from the given config.
func (*TagClient) CreateBulk ¶
func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk
CreateBulk returns a builder for creating a bulk of Tag entities.
func (*TagClient) DeleteOne ¶
func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TagClient) DeleteOneID ¶
func (c *TagClient) DeleteOneID(id int) *TagDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TagClient) Intercept ¶
func (c *TagClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tag.Intercept(f(g(h())))`.
func (*TagClient) Interceptors ¶
func (c *TagClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TagClient) QueryArticle ¶
func (c *TagClient) QueryArticle(t *Tag) *ArticleQuery
QueryArticle queries the article edge of a Tag.
func (*TagClient) UpdateOne ¶
func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TagClient) UpdateOneID ¶
func (c *TagClient) UpdateOneID(id int) *TagUpdateOne
UpdateOneID returns an update builder for the given id.
type TagCreate ¶
type TagCreate struct {
// contains filtered or unexported fields
}
TagCreate is the builder for creating a Tag entity.
func (*TagCreate) Mutation ¶
func (tc *TagCreate) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagCreate) SetArticle ¶
SetArticle sets the "article" edge to the Article entity.
func (*TagCreate) SetArticleID ¶
SetArticleID sets the "article" edge to the Article entity by ID.
func (*TagCreate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*TagCreate) SetNillableArticleID ¶
SetNillableArticleID sets the "article" edge to the Article entity by ID if the given value is not nil.
func (*TagCreate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*TagCreate) SetTagName ¶
SetTagName sets the "tag_name" field.
type TagCreateBulk ¶
type TagCreateBulk struct {
// contains filtered or unexported fields
}
TagCreateBulk is the builder for creating many Tag entities in bulk.
func (*TagCreateBulk) Exec ¶
func (tcb *TagCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TagCreateBulk) ExecX ¶
func (tcb *TagCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TagDelete ¶
type TagDelete struct {
// contains filtered or unexported fields
}
TagDelete is the builder for deleting a Tag entity.
func (*TagDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type TagDeleteOne ¶
type TagDeleteOne struct {
// contains filtered or unexported fields
}
TagDeleteOne is the builder for deleting a single Tag entity.
func (*TagDeleteOne) Exec ¶
func (tdo *TagDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TagDeleteOne) ExecX ¶
func (tdo *TagDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagDeleteOne) Where ¶
func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne
Where appends a list predicates to the TagDelete builder.
type TagEdges ¶
type TagEdges struct { // Article holds the value of the article edge. Article *Article `json:"article,omitempty"` // contains filtered or unexported fields }
TagEdges holds the relations/edges for other nodes in the graph.
func (TagEdges) ArticleOrErr ¶
ArticleOrErr returns the Article value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type TagGroupBy ¶
type TagGroupBy struct {
// contains filtered or unexported fields
}
TagGroupBy is the group-by builder for Tag entities.
func (*TagGroupBy) Aggregate ¶
func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TagGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Scan ¶
func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TagGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TagMutation ¶
type TagMutation struct {
// contains filtered or unexported fields
}
TagMutation represents an operation that mutates the Tag nodes in the graph.
func (*TagMutation) AddField ¶
func (m *TagMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*TagMutation) AddedEdges ¶
func (m *TagMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TagMutation) AddedField ¶
func (m *TagMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*TagMutation) AddedFields ¶
func (m *TagMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TagMutation) AddedIDs ¶
func (m *TagMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TagMutation) ArticleCleared ¶
func (m *TagMutation) ArticleCleared() bool
ArticleCleared reports if the "article" edge to the Article entity was cleared.
func (*TagMutation) ArticleID ¶
func (m *TagMutation) ArticleID() (id int, exists bool)
ArticleID returns the "article" edge ID in the mutation.
func (*TagMutation) ArticleIDs ¶
func (m *TagMutation) ArticleIDs() (ids []int)
ArticleIDs returns the "article" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ArticleID instead. It exists only for internal usage by the builders.
func (*TagMutation) ClearArticle ¶
func (m *TagMutation) ClearArticle()
ClearArticle clears the "article" edge to the Article entity.
func (*TagMutation) ClearEdge ¶
func (m *TagMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*TagMutation) ClearField ¶
func (m *TagMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*TagMutation) ClearedEdges ¶
func (m *TagMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TagMutation) ClearedFields ¶
func (m *TagMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TagMutation) Client ¶
func (m TagMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*TagMutation) CreatedAt ¶
func (m *TagMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*TagMutation) EdgeCleared ¶
func (m *TagMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TagMutation) Field ¶
func (m *TagMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*TagMutation) FieldCleared ¶
func (m *TagMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TagMutation) Fields ¶
func (m *TagMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*TagMutation) ID ¶
func (m *TagMutation) ID() (id 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 (*TagMutation) IDs ¶
func (m *TagMutation) 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 (*TagMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*TagMutation) OldTagName ¶
func (m *TagMutation) OldTagName(ctx context.Context) (v string, err error)
OldTagName returns the old "tag_name" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) RemovedEdges ¶
func (m *TagMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TagMutation) RemovedIDs ¶
func (m *TagMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*TagMutation) ResetArticle ¶
func (m *TagMutation) ResetArticle()
ResetArticle resets all changes to the "article" edge.
func (*TagMutation) ResetCreatedAt ¶
func (m *TagMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*TagMutation) ResetEdge ¶
func (m *TagMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*TagMutation) ResetField ¶
func (m *TagMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*TagMutation) ResetTagName ¶
func (m *TagMutation) ResetTagName()
ResetTagName resets all changes to the "tag_name" field.
func (*TagMutation) SetArticleID ¶
func (m *TagMutation) SetArticleID(id int)
SetArticleID sets the "article" edge to the Article entity by id.
func (*TagMutation) SetCreatedAt ¶
func (m *TagMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*TagMutation) SetField ¶
func (m *TagMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*TagMutation) SetOp ¶
func (m *TagMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TagMutation) SetTagName ¶
func (m *TagMutation) SetTagName(s string)
SetTagName sets the "tag_name" field.
func (*TagMutation) TagName ¶
func (m *TagMutation) TagName() (r string, exists bool)
TagName returns the value of the "tag_name" field in the mutation.
func (TagMutation) Tx ¶
func (m TagMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TagMutation) Type ¶
func (m *TagMutation) Type() string
Type returns the node type of this mutation (Tag).
func (*TagMutation) Where ¶
func (m *TagMutation) Where(ps ...predicate.Tag)
Where appends a list predicates to the TagMutation builder.
func (*TagMutation) WhereP ¶
func (m *TagMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TagQuery ¶
type TagQuery struct {
// contains filtered or unexported fields
}
TagQuery is the builder for querying Tag entities.
func (*TagQuery) Aggregate ¶
func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect
Aggregate returns a TagSelect configured with the given aggregations.
func (*TagQuery) Clone ¶
Clone returns a duplicate of the TagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TagQuery) First ¶
First returns the first Tag entity from the query. Returns a *NotFoundError when no Tag was found.
func (*TagQuery) FirstID ¶
FirstID returns the first Tag ID from the query. Returns a *NotFoundError when no Tag ID was found.
func (*TagQuery) GroupBy ¶
func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { TagName string `json:"tag_name,omitempty"` Count int `json:"count,omitempty"` } client.Tag.Query(). GroupBy(tag.FieldTagName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TagQuery) Only ¶
Only returns a single Tag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tag entity is found. Returns a *NotFoundError when no Tag entities are found.
func (*TagQuery) OnlyID ¶
OnlyID is like Only, but returns the only Tag ID in the query. Returns a *NotSingularError when more than one Tag ID is found. Returns a *NotFoundError when no entities are found.
func (*TagQuery) QueryArticle ¶
func (tq *TagQuery) QueryArticle() *ArticleQuery
QueryArticle chains the current query on the "article" edge.
func (*TagQuery) Select ¶
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { TagName string `json:"tag_name,omitempty"` } client.Tag.Query(). Select(tag.FieldTagName). Scan(ctx, &v)
func (*TagQuery) 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 (*TagQuery) WithArticle ¶
func (tq *TagQuery) WithArticle(opts ...func(*ArticleQuery)) *TagQuery
WithArticle tells the query-builder to eager-load the nodes that are connected to the "article" edge. The optional arguments are used to configure the query builder of the edge.
type TagSelect ¶
type TagSelect struct { *TagQuery // contains filtered or unexported fields }
TagSelect is the builder for selecting fields of Tag entities.
func (*TagSelect) Aggregate ¶
func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TagSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TagSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TagSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TagSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TagSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TagSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TagSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TagUpdate ¶
type TagUpdate struct {
// contains filtered or unexported fields
}
TagUpdate is the builder for updating Tag entities.
func (*TagUpdate) ClearArticle ¶
ClearArticle clears the "article" edge to the Article entity.
func (*TagUpdate) Mutation ¶
func (tu *TagUpdate) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*TagUpdate) SetArticle ¶
SetArticle sets the "article" edge to the Article entity.
func (*TagUpdate) SetArticleID ¶
SetArticleID sets the "article" edge to the Article entity by ID.
func (*TagUpdate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*TagUpdate) SetNillableArticleID ¶
SetNillableArticleID sets the "article" edge to the Article entity by ID if the given value is not nil.
func (*TagUpdate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*TagUpdate) SetTagName ¶
SetTagName sets the "tag_name" field.
type TagUpdateOne ¶
type TagUpdateOne struct {
// contains filtered or unexported fields
}
TagUpdateOne is the builder for updating a single Tag entity.
func (*TagUpdateOne) ClearArticle ¶
func (tuo *TagUpdateOne) ClearArticle() *TagUpdateOne
ClearArticle clears the "article" edge to the Article entity.
func (*TagUpdateOne) Exec ¶
func (tuo *TagUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TagUpdateOne) ExecX ¶
func (tuo *TagUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagUpdateOne) Mutation ¶
func (tuo *TagUpdateOne) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagUpdateOne) Save ¶
func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)
Save executes the query and returns the updated Tag entity.
func (*TagUpdateOne) SaveX ¶
func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag
SaveX is like Save, but panics if an error occurs.
func (*TagUpdateOne) Select ¶
func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TagUpdateOne) SetArticle ¶
func (tuo *TagUpdateOne) SetArticle(a *Article) *TagUpdateOne
SetArticle sets the "article" edge to the Article entity.
func (*TagUpdateOne) SetArticleID ¶
func (tuo *TagUpdateOne) SetArticleID(id int) *TagUpdateOne
SetArticleID sets the "article" edge to the Article entity by ID.
func (*TagUpdateOne) SetCreatedAt ¶
func (tuo *TagUpdateOne) SetCreatedAt(t time.Time) *TagUpdateOne
SetCreatedAt sets the "created_at" field.
func (*TagUpdateOne) SetNillableArticleID ¶
func (tuo *TagUpdateOne) SetNillableArticleID(id *int) *TagUpdateOne
SetNillableArticleID sets the "article" edge to the Article entity by ID if the given value is not nil.
func (*TagUpdateOne) SetNillableCreatedAt ¶
func (tuo *TagUpdateOne) SetNillableCreatedAt(t *time.Time) *TagUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*TagUpdateOne) SetTagName ¶
func (tuo *TagUpdateOne) SetTagName(s string) *TagUpdateOne
SetTagName sets the "tag_name" field.
func (*TagUpdateOne) Where ¶
func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne
Where appends a list predicates to the TagUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Achievement is the client for interacting with the Achievement builders. Achievement *AchievementClient // Article is the client for interacting with the Article builders. Article *ArticleClient // BFPDataPoint is the client for interacting with the BFPDataPoint builders. BFPDataPoint *BFPDataPointClient // Meal is the client for interacting with the Meal builders. Meal *MealClient // Tag is the client for interacting with the Tag builders. Tag *TagClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID int `json:"id,omitempty"` // UserName holds the value of the "user_name" field. UserName string `json:"user_name,omitempty"` // Password holds the value of the "password" field. Password string `json:"password,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) QueryAchievements ¶
func (u *User) QueryAchievements() *AchievementQuery
QueryAchievements queries the "achievements" edge of the User entity.
func (*User) QueryBFPs ¶
func (u *User) QueryBFPs() *BFPDataPointQuery
QueryBFPs queries the "BFPs" edge of the User entity.
func (*User) QueryMeals ¶
QueryMeals queries the "meals" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryAchievements ¶
func (c *UserClient) QueryAchievements(u *User) *AchievementQuery
QueryAchievements queries the achievements edge of a User.
func (*UserClient) QueryBFPs ¶
func (c *UserClient) QueryBFPs(u *User) *BFPDataPointQuery
QueryBFPs queries the BFPs edge of a User.
func (*UserClient) QueryMeals ¶
func (c *UserClient) QueryMeals(u *User) *MealQuery
QueryMeals queries the meals edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddAchievementIDs ¶
func (uc *UserCreate) AddAchievementIDs(ids ...int) *UserCreate
AddAchievementIDs adds the "achievements" edge to the Achievement entity by IDs.
func (*UserCreate) AddAchievements ¶
func (uc *UserCreate) AddAchievements(a ...*Achievement) *UserCreate
AddAchievements adds the "achievements" edges to the Achievement entity.
func (*UserCreate) AddBFPIDs ¶
func (uc *UserCreate) AddBFPIDs(ids ...int) *UserCreate
AddBFPIDs adds the "BFPs" edge to the BFPDataPoint entity by IDs.
func (*UserCreate) AddBFPs ¶
func (uc *UserCreate) AddBFPs(b ...*BFPDataPoint) *UserCreate
AddBFPs adds the "BFPs" edges to the BFPDataPoint entity.
func (*UserCreate) AddMealIDs ¶
func (uc *UserCreate) AddMealIDs(ids ...int) *UserCreate
AddMealIDs adds the "meals" edge to the Meal entity by IDs.
func (*UserCreate) AddMeals ¶
func (uc *UserCreate) AddMeals(m ...*Meal) *UserCreate
AddMeals adds the "meals" edges to the Meal entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetPassword ¶
func (uc *UserCreate) SetPassword(s string) *UserCreate
SetPassword sets the "password" field.
func (*UserCreate) SetUserName ¶
func (uc *UserCreate) SetUserName(s string) *UserCreate
SetUserName sets the "user_name" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct { // Meals holds the value of the meals edge. Meals []*Meal `json:"meals,omitempty"` // BFPs holds the value of the BFPs edge. BFPs []*BFPDataPoint `json:"BFPs,omitempty"` // Achievements holds the value of the achievements edge. Achievements []*Achievement `json:"achievements,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) AchievementsOrErr ¶
func (e UserEdges) AchievementsOrErr() ([]*Achievement, error)
AchievementsOrErr returns the Achievements value or an error if the edge was not loaded in eager-loading.
func (UserEdges) BFPsOrErr ¶
func (e UserEdges) BFPsOrErr() ([]*BFPDataPoint, error)
BFPsOrErr returns the BFPs value or an error if the edge was not loaded in eager-loading.
func (UserEdges) MealsOrErr ¶
MealsOrErr returns the Meals value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AchievementsCleared ¶
func (m *UserMutation) AchievementsCleared() bool
AchievementsCleared reports if the "achievements" edge to the Achievement entity was cleared.
func (*UserMutation) AchievementsIDs ¶
func (m *UserMutation) AchievementsIDs() (ids []int)
AchievementsIDs returns the "achievements" edge IDs in the mutation.
func (*UserMutation) AddAchievementIDs ¶
func (m *UserMutation) AddAchievementIDs(ids ...int)
AddAchievementIDs adds the "achievements" edge to the Achievement entity by ids.
func (*UserMutation) AddBFPIDs ¶
func (m *UserMutation) AddBFPIDs(ids ...int)
AddBFPIDs adds the "BFPs" edge to the BFPDataPoint entity by ids.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddMealIDs ¶
func (m *UserMutation) AddMealIDs(ids ...int)
AddMealIDs adds the "meals" edge to the Meal entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) BFPsCleared ¶
func (m *UserMutation) BFPsCleared() bool
BFPsCleared reports if the "BFPs" edge to the BFPDataPoint entity was cleared.
func (*UserMutation) BFPsIDs ¶
func (m *UserMutation) BFPsIDs() (ids []int)
BFPsIDs returns the "BFPs" edge IDs in the mutation.
func (*UserMutation) ClearAchievements ¶
func (m *UserMutation) ClearAchievements()
ClearAchievements clears the "achievements" edge to the Achievement entity.
func (*UserMutation) ClearBFPs ¶
func (m *UserMutation) ClearBFPs()
ClearBFPs clears the "BFPs" edge to the BFPDataPoint entity.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearMeals ¶
func (m *UserMutation) ClearMeals()
ClearMeals clears the "meals" edge to the Meal entity.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) MealsCleared ¶
func (m *UserMutation) MealsCleared() bool
MealsCleared reports if the "meals" edge to the Meal entity was cleared.
func (*UserMutation) MealsIDs ¶
func (m *UserMutation) MealsIDs() (ids []int)
MealsIDs returns the "meals" edge IDs in the mutation.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) OldPassword ¶
func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUserName ¶
func (m *UserMutation) OldUserName(ctx context.Context) (v string, err error)
OldUserName returns the old "user_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) Password ¶
func (m *UserMutation) Password() (r string, exists bool)
Password returns the value of the "password" field in the mutation.
func (*UserMutation) RemoveAchievementIDs ¶
func (m *UserMutation) RemoveAchievementIDs(ids ...int)
RemoveAchievementIDs removes the "achievements" edge to the Achievement entity by IDs.
func (*UserMutation) RemoveBFPIDs ¶
func (m *UserMutation) RemoveBFPIDs(ids ...int)
RemoveBFPIDs removes the "BFPs" edge to the BFPDataPoint entity by IDs.
func (*UserMutation) RemoveMealIDs ¶
func (m *UserMutation) RemoveMealIDs(ids ...int)
RemoveMealIDs removes the "meals" edge to the Meal entity by IDs.
func (*UserMutation) RemovedAchievementsIDs ¶
func (m *UserMutation) RemovedAchievementsIDs() (ids []int)
RemovedAchievements returns the removed IDs of the "achievements" edge to the Achievement entity.
func (*UserMutation) RemovedBFPsIDs ¶
func (m *UserMutation) RemovedBFPsIDs() (ids []int)
RemovedBFPs returns the removed IDs of the "BFPs" edge to the BFPDataPoint entity.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) RemovedMealsIDs ¶
func (m *UserMutation) RemovedMealsIDs() (ids []int)
RemovedMeals returns the removed IDs of the "meals" edge to the Meal entity.
func (*UserMutation) ResetAchievements ¶
func (m *UserMutation) ResetAchievements()
ResetAchievements resets all changes to the "achievements" edge.
func (*UserMutation) ResetBFPs ¶
func (m *UserMutation) ResetBFPs()
ResetBFPs resets all changes to the "BFPs" edge.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetMeals ¶
func (m *UserMutation) ResetMeals()
ResetMeals resets all changes to the "meals" edge.
func (*UserMutation) ResetPassword ¶
func (m *UserMutation) ResetPassword()
ResetPassword resets all changes to the "password" field.
func (*UserMutation) ResetUserName ¶
func (m *UserMutation) ResetUserName()
ResetUserName resets all changes to the "user_name" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPassword ¶
func (m *UserMutation) SetPassword(s string)
SetPassword sets the "password" field.
func (*UserMutation) SetUserName ¶
func (m *UserMutation) SetUserName(s string)
SetUserName sets the "user_name" field.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) UserName ¶
func (m *UserMutation) UserName() (r string, exists bool)
UserName returns the value of the "user_name" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { UserName string `json:"user_name,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldUserName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) QueryAchievements ¶
func (uq *UserQuery) QueryAchievements() *AchievementQuery
QueryAchievements chains the current query on the "achievements" edge.
func (*UserQuery) QueryBFPs ¶
func (uq *UserQuery) QueryBFPs() *BFPDataPointQuery
QueryBFPs chains the current query on the "BFPs" edge.
func (*UserQuery) QueryMeals ¶
QueryMeals chains the current query on the "meals" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { UserName string `json:"user_name,omitempty"` } client.User.Query(). Select(user.FieldUserName). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithAchievements ¶
func (uq *UserQuery) WithAchievements(opts ...func(*AchievementQuery)) *UserQuery
WithAchievements tells the query-builder to eager-load the nodes that are connected to the "achievements" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithBFPs ¶
func (uq *UserQuery) WithBFPs(opts ...func(*BFPDataPointQuery)) *UserQuery
WithBFPs tells the query-builder to eager-load the nodes that are connected to the "BFPs" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddAchievementIDs ¶
func (uu *UserUpdate) AddAchievementIDs(ids ...int) *UserUpdate
AddAchievementIDs adds the "achievements" edge to the Achievement entity by IDs.
func (*UserUpdate) AddAchievements ¶
func (uu *UserUpdate) AddAchievements(a ...*Achievement) *UserUpdate
AddAchievements adds the "achievements" edges to the Achievement entity.
func (*UserUpdate) AddBFPIDs ¶
func (uu *UserUpdate) AddBFPIDs(ids ...int) *UserUpdate
AddBFPIDs adds the "BFPs" edge to the BFPDataPoint entity by IDs.
func (*UserUpdate) AddBFPs ¶
func (uu *UserUpdate) AddBFPs(b ...*BFPDataPoint) *UserUpdate
AddBFPs adds the "BFPs" edges to the BFPDataPoint entity.
func (*UserUpdate) AddMealIDs ¶
func (uu *UserUpdate) AddMealIDs(ids ...int) *UserUpdate
AddMealIDs adds the "meals" edge to the Meal entity by IDs.
func (*UserUpdate) AddMeals ¶
func (uu *UserUpdate) AddMeals(m ...*Meal) *UserUpdate
AddMeals adds the "meals" edges to the Meal entity.
func (*UserUpdate) ClearAchievements ¶
func (uu *UserUpdate) ClearAchievements() *UserUpdate
ClearAchievements clears all "achievements" edges to the Achievement entity.
func (*UserUpdate) ClearBFPs ¶
func (uu *UserUpdate) ClearBFPs() *UserUpdate
ClearBFPs clears all "BFPs" edges to the BFPDataPoint entity.
func (*UserUpdate) ClearMeals ¶
func (uu *UserUpdate) ClearMeals() *UserUpdate
ClearMeals clears all "meals" edges to the Meal entity.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveAchievementIDs ¶
func (uu *UserUpdate) RemoveAchievementIDs(ids ...int) *UserUpdate
RemoveAchievementIDs removes the "achievements" edge to Achievement entities by IDs.
func (*UserUpdate) RemoveAchievements ¶
func (uu *UserUpdate) RemoveAchievements(a ...*Achievement) *UserUpdate
RemoveAchievements removes "achievements" edges to Achievement entities.
func (*UserUpdate) RemoveBFPIDs ¶
func (uu *UserUpdate) RemoveBFPIDs(ids ...int) *UserUpdate
RemoveBFPIDs removes the "BFPs" edge to BFPDataPoint entities by IDs.
func (*UserUpdate) RemoveBFPs ¶
func (uu *UserUpdate) RemoveBFPs(b ...*BFPDataPoint) *UserUpdate
RemoveBFPs removes "BFPs" edges to BFPDataPoint entities.
func (*UserUpdate) RemoveMealIDs ¶
func (uu *UserUpdate) RemoveMealIDs(ids ...int) *UserUpdate
RemoveMealIDs removes the "meals" edge to Meal entities by IDs.
func (*UserUpdate) RemoveMeals ¶
func (uu *UserUpdate) RemoveMeals(m ...*Meal) *UserUpdate
RemoveMeals removes "meals" edges to Meal entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetPassword ¶
func (uu *UserUpdate) SetPassword(s string) *UserUpdate
SetPassword sets the "password" field.
func (*UserUpdate) SetUserName ¶
func (uu *UserUpdate) SetUserName(s string) *UserUpdate
SetUserName sets the "user_name" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddAchievementIDs ¶
func (uuo *UserUpdateOne) AddAchievementIDs(ids ...int) *UserUpdateOne
AddAchievementIDs adds the "achievements" edge to the Achievement entity by IDs.
func (*UserUpdateOne) AddAchievements ¶
func (uuo *UserUpdateOne) AddAchievements(a ...*Achievement) *UserUpdateOne
AddAchievements adds the "achievements" edges to the Achievement entity.
func (*UserUpdateOne) AddBFPIDs ¶
func (uuo *UserUpdateOne) AddBFPIDs(ids ...int) *UserUpdateOne
AddBFPIDs adds the "BFPs" edge to the BFPDataPoint entity by IDs.
func (*UserUpdateOne) AddBFPs ¶
func (uuo *UserUpdateOne) AddBFPs(b ...*BFPDataPoint) *UserUpdateOne
AddBFPs adds the "BFPs" edges to the BFPDataPoint entity.
func (*UserUpdateOne) AddMealIDs ¶
func (uuo *UserUpdateOne) AddMealIDs(ids ...int) *UserUpdateOne
AddMealIDs adds the "meals" edge to the Meal entity by IDs.
func (*UserUpdateOne) AddMeals ¶
func (uuo *UserUpdateOne) AddMeals(m ...*Meal) *UserUpdateOne
AddMeals adds the "meals" edges to the Meal entity.
func (*UserUpdateOne) ClearAchievements ¶
func (uuo *UserUpdateOne) ClearAchievements() *UserUpdateOne
ClearAchievements clears all "achievements" edges to the Achievement entity.
func (*UserUpdateOne) ClearBFPs ¶
func (uuo *UserUpdateOne) ClearBFPs() *UserUpdateOne
ClearBFPs clears all "BFPs" edges to the BFPDataPoint entity.
func (*UserUpdateOne) ClearMeals ¶
func (uuo *UserUpdateOne) ClearMeals() *UserUpdateOne
ClearMeals clears all "meals" edges to the Meal entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveAchievementIDs ¶
func (uuo *UserUpdateOne) RemoveAchievementIDs(ids ...int) *UserUpdateOne
RemoveAchievementIDs removes the "achievements" edge to Achievement entities by IDs.
func (*UserUpdateOne) RemoveAchievements ¶
func (uuo *UserUpdateOne) RemoveAchievements(a ...*Achievement) *UserUpdateOne
RemoveAchievements removes "achievements" edges to Achievement entities.
func (*UserUpdateOne) RemoveBFPIDs ¶
func (uuo *UserUpdateOne) RemoveBFPIDs(ids ...int) *UserUpdateOne
RemoveBFPIDs removes the "BFPs" edge to BFPDataPoint entities by IDs.
func (*UserUpdateOne) RemoveBFPs ¶
func (uuo *UserUpdateOne) RemoveBFPs(b ...*BFPDataPoint) *UserUpdateOne
RemoveBFPs removes "BFPs" edges to BFPDataPoint entities.
func (*UserUpdateOne) RemoveMealIDs ¶
func (uuo *UserUpdateOne) RemoveMealIDs(ids ...int) *UserUpdateOne
RemoveMealIDs removes the "meals" edge to Meal entities by IDs.
func (*UserUpdateOne) RemoveMeals ¶
func (uuo *UserUpdateOne) RemoveMeals(m ...*Meal) *UserUpdateOne
RemoveMeals removes "meals" edges to Meal entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetPassword ¶
func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
SetPassword sets the "password" field.
func (*UserUpdateOne) SetUserName ¶
func (uuo *UserUpdateOne) SetUserName(s string) *UserUpdateOne
SetUserName sets the "user_name" field.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- achievement.go
- achievement_create.go
- achievement_delete.go
- achievement_query.go
- achievement_update.go
- article.go
- article_create.go
- article_delete.go
- article_query.go
- article_update.go
- bfpdatapoint.go
- bfpdatapoint_create.go
- bfpdatapoint_delete.go
- bfpdatapoint_query.go
- bfpdatapoint_update.go
- client.go
- ent.go
- generate.go
- meal.go
- meal_create.go
- meal_delete.go
- meal_query.go
- meal_update.go
- mutation.go
- runtime.go
- tag.go
- tag_create.go
- tag_delete.go
- tag_query.go
- tag_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go