Documentation
¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- 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 Histories
- type History
- type HistoryClient
- func (c *HistoryClient) Create() *HistoryCreate
- func (c *HistoryClient) CreateBulk(builders ...*HistoryCreate) *HistoryCreateBulk
- func (c *HistoryClient) Delete() *HistoryDelete
- func (c *HistoryClient) DeleteOne(h *History) *HistoryDeleteOne
- func (c *HistoryClient) DeleteOneID(id int) *HistoryDeleteOne
- func (c *HistoryClient) Get(ctx context.Context, id int) (*History, error)
- func (c *HistoryClient) GetX(ctx context.Context, id int) *History
- func (c *HistoryClient) Hooks() []Hook
- func (c *HistoryClient) Intercept(interceptors ...Interceptor)
- func (c *HistoryClient) Interceptors() []Interceptor
- func (c *HistoryClient) MapCreateBulk(slice any, setFunc func(*HistoryCreate, int)) *HistoryCreateBulk
- func (c *HistoryClient) Query() *HistoryQuery
- func (c *HistoryClient) QueryItem(h *History) *MetaQuery
- func (c *HistoryClient) QueryUser(h *History) *UserQuery
- func (c *HistoryClient) Update() *HistoryUpdate
- func (c *HistoryClient) UpdateOne(h *History) *HistoryUpdateOne
- func (c *HistoryClient) UpdateOneID(id int) *HistoryUpdateOne
- func (c *HistoryClient) Use(hooks ...Hook)
- type HistoryCreate
- func (hc *HistoryCreate) Exec(ctx context.Context) error
- func (hc *HistoryCreate) ExecX(ctx context.Context)
- func (hc *HistoryCreate) Mutation() *HistoryMutation
- func (hc *HistoryCreate) OnConflict(opts ...sql.ConflictOption) *HistoryUpsertOne
- func (hc *HistoryCreate) OnConflictColumns(columns ...string) *HistoryUpsertOne
- func (hc *HistoryCreate) Save(ctx context.Context) (*History, error)
- func (hc *HistoryCreate) SaveX(ctx context.Context) *History
- func (hc *HistoryCreate) SetCreateTime(t time.Time) *HistoryCreate
- func (hc *HistoryCreate) SetItem(m *Meta) *HistoryCreate
- func (hc *HistoryCreate) SetItemID(id int) *HistoryCreate
- func (hc *HistoryCreate) SetNillableCreateTime(t *time.Time) *HistoryCreate
- func (hc *HistoryCreate) SetNillableItemID(id *int) *HistoryCreate
- func (hc *HistoryCreate) SetNillableUserID(id *int) *HistoryCreate
- func (hc *HistoryCreate) SetUser(u *User) *HistoryCreate
- func (hc *HistoryCreate) SetUserID(id int) *HistoryCreate
- type HistoryCreateBulk
- func (hcb *HistoryCreateBulk) Exec(ctx context.Context) error
- func (hcb *HistoryCreateBulk) ExecX(ctx context.Context)
- func (hcb *HistoryCreateBulk) OnConflict(opts ...sql.ConflictOption) *HistoryUpsertBulk
- func (hcb *HistoryCreateBulk) OnConflictColumns(columns ...string) *HistoryUpsertBulk
- func (hcb *HistoryCreateBulk) Save(ctx context.Context) ([]*History, error)
- func (hcb *HistoryCreateBulk) SaveX(ctx context.Context) []*History
- type HistoryDelete
- type HistoryDeleteOne
- type HistoryEdges
- type HistoryGroupBy
- func (hgb *HistoryGroupBy) Aggregate(fns ...AggregateFunc) *HistoryGroupBy
- func (s *HistoryGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *HistoryGroupBy) BoolX(ctx context.Context) bool
- func (s *HistoryGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *HistoryGroupBy) BoolsX(ctx context.Context) []bool
- func (s *HistoryGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *HistoryGroupBy) Float64X(ctx context.Context) float64
- func (s *HistoryGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *HistoryGroupBy) Float64sX(ctx context.Context) []float64
- func (s *HistoryGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *HistoryGroupBy) IntX(ctx context.Context) int
- func (s *HistoryGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *HistoryGroupBy) IntsX(ctx context.Context) []int
- func (hgb *HistoryGroupBy) Scan(ctx context.Context, v any) error
- func (s *HistoryGroupBy) ScanX(ctx context.Context, v any)
- func (s *HistoryGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *HistoryGroupBy) StringX(ctx context.Context) string
- func (s *HistoryGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *HistoryGroupBy) StringsX(ctx context.Context) []string
- type HistoryMutation
- func (m *HistoryMutation) AddField(name string, value ent.Value) error
- func (m *HistoryMutation) AddedEdges() []string
- func (m *HistoryMutation) AddedField(name string) (ent.Value, bool)
- func (m *HistoryMutation) AddedFields() []string
- func (m *HistoryMutation) AddedIDs(name string) []ent.Value
- func (m *HistoryMutation) ClearEdge(name string) error
- func (m *HistoryMutation) ClearField(name string) error
- func (m *HistoryMutation) ClearItem()
- func (m *HistoryMutation) ClearUser()
- func (m *HistoryMutation) ClearedEdges() []string
- func (m *HistoryMutation) ClearedFields() []string
- func (m HistoryMutation) Client() *Client
- func (m *HistoryMutation) CreateTime() (r time.Time, exists bool)
- func (m *HistoryMutation) EdgeCleared(name string) bool
- func (m *HistoryMutation) Field(name string) (ent.Value, bool)
- func (m *HistoryMutation) FieldCleared(name string) bool
- func (m *HistoryMutation) Fields() []string
- func (m *HistoryMutation) ID() (id int, exists bool)
- func (m *HistoryMutation) IDs(ctx context.Context) ([]int, error)
- func (m *HistoryMutation) ItemCleared() bool
- func (m *HistoryMutation) ItemID() (id int, exists bool)
- func (m *HistoryMutation) ItemIDs() (ids []int)
- func (m *HistoryMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *HistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *HistoryMutation) Op() Op
- func (m *HistoryMutation) RemovedEdges() []string
- func (m *HistoryMutation) RemovedIDs(name string) []ent.Value
- func (m *HistoryMutation) ResetCreateTime()
- func (m *HistoryMutation) ResetEdge(name string) error
- func (m *HistoryMutation) ResetField(name string) error
- func (m *HistoryMutation) ResetItem()
- func (m *HistoryMutation) ResetUser()
- func (m *HistoryMutation) SetCreateTime(t time.Time)
- func (m *HistoryMutation) SetField(name string, value ent.Value) error
- func (m *HistoryMutation) SetItemID(id int)
- func (m *HistoryMutation) SetOp(op Op)
- func (m *HistoryMutation) SetUserID(id int)
- func (m HistoryMutation) Tx() (*Tx, error)
- func (m *HistoryMutation) Type() string
- func (m *HistoryMutation) UserCleared() bool
- func (m *HistoryMutation) UserID() (id int, exists bool)
- func (m *HistoryMutation) UserIDs() (ids []int)
- func (m *HistoryMutation) Where(ps ...predicate.History)
- func (m *HistoryMutation) WhereP(ps ...func(*sql.Selector))
- type HistoryQuery
- func (hq *HistoryQuery) Aggregate(fns ...AggregateFunc) *HistorySelect
- func (hq *HistoryQuery) All(ctx context.Context) ([]*History, error)
- func (hq *HistoryQuery) AllX(ctx context.Context) []*History
- func (hq *HistoryQuery) Clone() *HistoryQuery
- func (hq *HistoryQuery) Count(ctx context.Context) (int, error)
- func (hq *HistoryQuery) CountX(ctx context.Context) int
- func (hq *HistoryQuery) Exist(ctx context.Context) (bool, error)
- func (hq *HistoryQuery) ExistX(ctx context.Context) bool
- func (hq *HistoryQuery) First(ctx context.Context) (*History, error)
- func (hq *HistoryQuery) FirstID(ctx context.Context) (id int, err error)
- func (hq *HistoryQuery) FirstIDX(ctx context.Context) int
- func (hq *HistoryQuery) FirstX(ctx context.Context) *History
- func (hq *HistoryQuery) GroupBy(field string, fields ...string) *HistoryGroupBy
- func (hq *HistoryQuery) IDs(ctx context.Context) (ids []int, err error)
- func (hq *HistoryQuery) IDsX(ctx context.Context) []int
- func (hq *HistoryQuery) Limit(limit int) *HistoryQuery
- func (hq *HistoryQuery) Offset(offset int) *HistoryQuery
- func (hq *HistoryQuery) Only(ctx context.Context) (*History, error)
- func (hq *HistoryQuery) OnlyID(ctx context.Context) (id int, err error)
- func (hq *HistoryQuery) OnlyIDX(ctx context.Context) int
- func (hq *HistoryQuery) OnlyX(ctx context.Context) *History
- func (hq *HistoryQuery) Order(o ...history.OrderOption) *HistoryQuery
- func (hq *HistoryQuery) QueryItem() *MetaQuery
- func (hq *HistoryQuery) QueryUser() *UserQuery
- func (hq *HistoryQuery) Select(fields ...string) *HistorySelect
- func (hq *HistoryQuery) Unique(unique bool) *HistoryQuery
- func (hq *HistoryQuery) Where(ps ...predicate.History) *HistoryQuery
- func (hq *HistoryQuery) WithItem(opts ...func(*MetaQuery)) *HistoryQuery
- func (hq *HistoryQuery) WithUser(opts ...func(*UserQuery)) *HistoryQuery
- type HistorySelect
- func (hs *HistorySelect) Aggregate(fns ...AggregateFunc) *HistorySelect
- func (s *HistorySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *HistorySelect) BoolX(ctx context.Context) bool
- func (s *HistorySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *HistorySelect) BoolsX(ctx context.Context) []bool
- func (s *HistorySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *HistorySelect) Float64X(ctx context.Context) float64
- func (s *HistorySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *HistorySelect) Float64sX(ctx context.Context) []float64
- func (s *HistorySelect) Int(ctx context.Context) (_ int, err error)
- func (s *HistorySelect) IntX(ctx context.Context) int
- func (s *HistorySelect) Ints(ctx context.Context) ([]int, error)
- func (s *HistorySelect) IntsX(ctx context.Context) []int
- func (hs *HistorySelect) Scan(ctx context.Context, v any) error
- func (s *HistorySelect) ScanX(ctx context.Context, v any)
- func (s *HistorySelect) String(ctx context.Context) (_ string, err error)
- func (s *HistorySelect) StringX(ctx context.Context) string
- func (s *HistorySelect) Strings(ctx context.Context) ([]string, error)
- func (s *HistorySelect) StringsX(ctx context.Context) []string
- type HistoryUpdate
- func (hu *HistoryUpdate) ClearItem() *HistoryUpdate
- func (hu *HistoryUpdate) ClearUser() *HistoryUpdate
- func (hu *HistoryUpdate) Exec(ctx context.Context) error
- func (hu *HistoryUpdate) ExecX(ctx context.Context)
- func (hu *HistoryUpdate) Mutation() *HistoryMutation
- func (hu *HistoryUpdate) Save(ctx context.Context) (int, error)
- func (hu *HistoryUpdate) SaveX(ctx context.Context) int
- func (hu *HistoryUpdate) SetCreateTime(t time.Time) *HistoryUpdate
- func (hu *HistoryUpdate) SetItem(m *Meta) *HistoryUpdate
- func (hu *HistoryUpdate) SetItemID(id int) *HistoryUpdate
- func (hu *HistoryUpdate) SetNillableCreateTime(t *time.Time) *HistoryUpdate
- func (hu *HistoryUpdate) SetNillableItemID(id *int) *HistoryUpdate
- func (hu *HistoryUpdate) SetNillableUserID(id *int) *HistoryUpdate
- func (hu *HistoryUpdate) SetUser(u *User) *HistoryUpdate
- func (hu *HistoryUpdate) SetUserID(id int) *HistoryUpdate
- func (hu *HistoryUpdate) Where(ps ...predicate.History) *HistoryUpdate
- type HistoryUpdateOne
- func (huo *HistoryUpdateOne) ClearItem() *HistoryUpdateOne
- func (huo *HistoryUpdateOne) ClearUser() *HistoryUpdateOne
- func (huo *HistoryUpdateOne) Exec(ctx context.Context) error
- func (huo *HistoryUpdateOne) ExecX(ctx context.Context)
- func (huo *HistoryUpdateOne) Mutation() *HistoryMutation
- func (huo *HistoryUpdateOne) Save(ctx context.Context) (*History, error)
- func (huo *HistoryUpdateOne) SaveX(ctx context.Context) *History
- func (huo *HistoryUpdateOne) Select(field string, fields ...string) *HistoryUpdateOne
- func (huo *HistoryUpdateOne) SetCreateTime(t time.Time) *HistoryUpdateOne
- func (huo *HistoryUpdateOne) SetItem(m *Meta) *HistoryUpdateOne
- func (huo *HistoryUpdateOne) SetItemID(id int) *HistoryUpdateOne
- func (huo *HistoryUpdateOne) SetNillableCreateTime(t *time.Time) *HistoryUpdateOne
- func (huo *HistoryUpdateOne) SetNillableItemID(id *int) *HistoryUpdateOne
- func (huo *HistoryUpdateOne) SetNillableUserID(id *int) *HistoryUpdateOne
- func (huo *HistoryUpdateOne) SetUser(u *User) *HistoryUpdateOne
- func (huo *HistoryUpdateOne) SetUserID(id int) *HistoryUpdateOne
- func (huo *HistoryUpdateOne) Where(ps ...predicate.History) *HistoryUpdateOne
- type HistoryUpsert
- type HistoryUpsertBulk
- func (u *HistoryUpsertBulk) DoNothing() *HistoryUpsertBulk
- func (u *HistoryUpsertBulk) Exec(ctx context.Context) error
- func (u *HistoryUpsertBulk) ExecX(ctx context.Context)
- func (u *HistoryUpsertBulk) Ignore() *HistoryUpsertBulk
- func (u *HistoryUpsertBulk) SetCreateTime(v time.Time) *HistoryUpsertBulk
- func (u *HistoryUpsertBulk) Update(set func(*HistoryUpsert)) *HistoryUpsertBulk
- func (u *HistoryUpsertBulk) UpdateCreateTime() *HistoryUpsertBulk
- func (u *HistoryUpsertBulk) UpdateNewValues() *HistoryUpsertBulk
- type HistoryUpsertOne
- func (u *HistoryUpsertOne) DoNothing() *HistoryUpsertOne
- func (u *HistoryUpsertOne) Exec(ctx context.Context) error
- func (u *HistoryUpsertOne) ExecX(ctx context.Context)
- func (u *HistoryUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *HistoryUpsertOne) IDX(ctx context.Context) int
- func (u *HistoryUpsertOne) Ignore() *HistoryUpsertOne
- func (u *HistoryUpsertOne) SetCreateTime(v time.Time) *HistoryUpsertOne
- func (u *HistoryUpsertOne) Update(set func(*HistoryUpsert)) *HistoryUpsertOne
- func (u *HistoryUpsertOne) UpdateCreateTime() *HistoryUpsertOne
- func (u *HistoryUpsertOne) UpdateNewValues() *HistoryUpsertOne
- type Hook
- type InterceptFunc
- type Interceptor
- type Meta
- func (m *Meta) QueryFavoriteOfUser() *UserQuery
- func (m *Meta) QueryHistories() *HistoryQuery
- func (m *Meta) QueryProgress() *ProgressQuery
- func (m *Meta) QueryTags() *TagQuery
- func (m *Meta) String() string
- func (m *Meta) Unwrap() *Meta
- func (m *Meta) Update() *MetaUpdateOne
- func (m *Meta) Value(name string) (ent.Value, error)
- type MetaClient
- func (c *MetaClient) Create() *MetaCreate
- func (c *MetaClient) CreateBulk(builders ...*MetaCreate) *MetaCreateBulk
- func (c *MetaClient) Delete() *MetaDelete
- func (c *MetaClient) DeleteOne(m *Meta) *MetaDeleteOne
- func (c *MetaClient) DeleteOneID(id int) *MetaDeleteOne
- func (c *MetaClient) Get(ctx context.Context, id int) (*Meta, error)
- func (c *MetaClient) GetX(ctx context.Context, id int) *Meta
- func (c *MetaClient) Hooks() []Hook
- func (c *MetaClient) Intercept(interceptors ...Interceptor)
- func (c *MetaClient) Interceptors() []Interceptor
- func (c *MetaClient) MapCreateBulk(slice any, setFunc func(*MetaCreate, int)) *MetaCreateBulk
- func (c *MetaClient) Query() *MetaQuery
- func (c *MetaClient) QueryFavoriteOfUser(m *Meta) *UserQuery
- func (c *MetaClient) QueryHistories(m *Meta) *HistoryQuery
- func (c *MetaClient) QueryProgress(m *Meta) *ProgressQuery
- func (c *MetaClient) QueryTags(m *Meta) *TagQuery
- func (c *MetaClient) Update() *MetaUpdate
- func (c *MetaClient) UpdateOne(m *Meta) *MetaUpdateOne
- func (c *MetaClient) UpdateOneID(id int) *MetaUpdateOne
- func (c *MetaClient) Use(hooks ...Hook)
- type MetaCreate
- func (mc *MetaCreate) AddFavoriteOfUser(u ...*User) *MetaCreate
- func (mc *MetaCreate) AddFavoriteOfUserIDs(ids ...int) *MetaCreate
- func (mc *MetaCreate) AddHistories(h ...*History) *MetaCreate
- func (mc *MetaCreate) AddHistoryIDs(ids ...int) *MetaCreate
- func (mc *MetaCreate) AddProgresIDs(ids ...int) *MetaCreate
- func (mc *MetaCreate) AddProgress(p ...*Progress) *MetaCreate
- func (mc *MetaCreate) AddTagIDs(ids ...int) *MetaCreate
- func (mc *MetaCreate) AddTags(t ...*Tag) *MetaCreate
- func (mc *MetaCreate) Exec(ctx context.Context) error
- func (mc *MetaCreate) ExecX(ctx context.Context)
- func (mc *MetaCreate) Mutation() *MetaMutation
- func (mc *MetaCreate) OnConflict(opts ...sql.ConflictOption) *MetaUpsertOne
- func (mc *MetaCreate) OnConflictColumns(columns ...string) *MetaUpsertOne
- func (mc *MetaCreate) Save(ctx context.Context) (*Meta, error)
- func (mc *MetaCreate) SaveX(ctx context.Context) *Meta
- func (mc *MetaCreate) SetActive(b bool) *MetaCreate
- func (mc *MetaCreate) SetContainerType(mt meta.ContainerType) *MetaCreate
- func (mc *MetaCreate) SetCreateTime(t time.Time) *MetaCreate
- func (mc *MetaCreate) SetFavorite(b bool) *MetaCreate
- func (mc *MetaCreate) SetFileIndices(i []int) *MetaCreate
- func (mc *MetaCreate) SetHidden(b bool) *MetaCreate
- func (mc *MetaCreate) SetName(s string) *MetaCreate
- func (mc *MetaCreate) SetNillableActive(b *bool) *MetaCreate
- func (mc *MetaCreate) SetNillableContainerType(mt *meta.ContainerType) *MetaCreate
- func (mc *MetaCreate) SetNillableCreateTime(t *time.Time) *MetaCreate
- func (mc *MetaCreate) SetNillableFavorite(b *bool) *MetaCreate
- func (mc *MetaCreate) SetNillableHidden(b *bool) *MetaCreate
- func (mc *MetaCreate) SetNillableRead(b *bool) *MetaCreate
- func (mc *MetaCreate) SetNillableThumbnailHeight(i *int) *MetaCreate
- func (mc *MetaCreate) SetNillableThumbnailIndex(i *int) *MetaCreate
- func (mc *MetaCreate) SetNillableThumbnailWidth(i *int) *MetaCreate
- func (mc *MetaCreate) SetNillableThumbnailX(i *int) *MetaCreate
- func (mc *MetaCreate) SetNillableThumbnailY(i *int) *MetaCreate
- func (mc *MetaCreate) SetRead(b bool) *MetaCreate
- func (mc *MetaCreate) SetThumbnailHeight(i int) *MetaCreate
- func (mc *MetaCreate) SetThumbnailIndex(i int) *MetaCreate
- func (mc *MetaCreate) SetThumbnailWidth(i int) *MetaCreate
- func (mc *MetaCreate) SetThumbnailX(i int) *MetaCreate
- func (mc *MetaCreate) SetThumbnailY(i int) *MetaCreate
- type MetaCreateBulk
- func (mcb *MetaCreateBulk) Exec(ctx context.Context) error
- func (mcb *MetaCreateBulk) ExecX(ctx context.Context)
- func (mcb *MetaCreateBulk) OnConflict(opts ...sql.ConflictOption) *MetaUpsertBulk
- func (mcb *MetaCreateBulk) OnConflictColumns(columns ...string) *MetaUpsertBulk
- func (mcb *MetaCreateBulk) Save(ctx context.Context) ([]*Meta, error)
- func (mcb *MetaCreateBulk) SaveX(ctx context.Context) []*Meta
- type MetaDelete
- type MetaDeleteOne
- type MetaEdges
- type MetaGroupBy
- func (mgb *MetaGroupBy) Aggregate(fns ...AggregateFunc) *MetaGroupBy
- func (s *MetaGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *MetaGroupBy) BoolX(ctx context.Context) bool
- func (s *MetaGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *MetaGroupBy) BoolsX(ctx context.Context) []bool
- func (s *MetaGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *MetaGroupBy) Float64X(ctx context.Context) float64
- func (s *MetaGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *MetaGroupBy) Float64sX(ctx context.Context) []float64
- func (s *MetaGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *MetaGroupBy) IntX(ctx context.Context) int
- func (s *MetaGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *MetaGroupBy) IntsX(ctx context.Context) []int
- func (mgb *MetaGroupBy) Scan(ctx context.Context, v any) error
- func (s *MetaGroupBy) ScanX(ctx context.Context, v any)
- func (s *MetaGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *MetaGroupBy) StringX(ctx context.Context) string
- func (s *MetaGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *MetaGroupBy) StringsX(ctx context.Context) []string
- type MetaMutation
- func (m *MetaMutation) Active() (r bool, exists bool)
- func (m *MetaMutation) AddFavoriteOfUserIDs(ids ...int)
- func (m *MetaMutation) AddField(name string, value ent.Value) error
- func (m *MetaMutation) AddHistoryIDs(ids ...int)
- func (m *MetaMutation) AddProgresIDs(ids ...int)
- func (m *MetaMutation) AddTagIDs(ids ...int)
- func (m *MetaMutation) AddThumbnailHeight(i int)
- func (m *MetaMutation) AddThumbnailIndex(i int)
- func (m *MetaMutation) AddThumbnailWidth(i int)
- func (m *MetaMutation) AddThumbnailX(i int)
- func (m *MetaMutation) AddThumbnailY(i int)
- func (m *MetaMutation) AddedEdges() []string
- func (m *MetaMutation) AddedField(name string) (ent.Value, bool)
- func (m *MetaMutation) AddedFields() []string
- func (m *MetaMutation) AddedIDs(name string) []ent.Value
- func (m *MetaMutation) AddedThumbnailHeight() (r int, exists bool)
- func (m *MetaMutation) AddedThumbnailIndex() (r int, exists bool)
- func (m *MetaMutation) AddedThumbnailWidth() (r int, exists bool)
- func (m *MetaMutation) AddedThumbnailX() (r int, exists bool)
- func (m *MetaMutation) AddedThumbnailY() (r int, exists bool)
- func (m *MetaMutation) AppendFileIndices(i []int)
- func (m *MetaMutation) AppendedFileIndices() ([]int, bool)
- func (m *MetaMutation) ClearEdge(name string) error
- func (m *MetaMutation) ClearFavoriteOfUser()
- func (m *MetaMutation) ClearField(name string) error
- func (m *MetaMutation) ClearHistories()
- func (m *MetaMutation) ClearProgress()
- func (m *MetaMutation) ClearTags()
- func (m *MetaMutation) ClearThumbnailHeight()
- func (m *MetaMutation) ClearThumbnailIndex()
- func (m *MetaMutation) ClearThumbnailWidth()
- func (m *MetaMutation) ClearThumbnailX()
- func (m *MetaMutation) ClearThumbnailY()
- func (m *MetaMutation) ClearedEdges() []string
- func (m *MetaMutation) ClearedFields() []string
- func (m MetaMutation) Client() *Client
- func (m *MetaMutation) ContainerType() (r meta.ContainerType, exists bool)
- func (m *MetaMutation) CreateTime() (r time.Time, exists bool)
- func (m *MetaMutation) EdgeCleared(name string) bool
- func (m *MetaMutation) Favorite() (r bool, exists bool)
- func (m *MetaMutation) FavoriteOfUserCleared() bool
- func (m *MetaMutation) FavoriteOfUserIDs() (ids []int)
- func (m *MetaMutation) Field(name string) (ent.Value, bool)
- func (m *MetaMutation) FieldCleared(name string) bool
- func (m *MetaMutation) Fields() []string
- func (m *MetaMutation) FileIndices() (r []int, exists bool)
- func (m *MetaMutation) Hidden() (r bool, exists bool)
- func (m *MetaMutation) HistoriesCleared() bool
- func (m *MetaMutation) HistoriesIDs() (ids []int)
- func (m *MetaMutation) ID() (id int, exists bool)
- func (m *MetaMutation) IDs(ctx context.Context) ([]int, error)
- func (m *MetaMutation) Name() (r string, exists bool)
- func (m *MetaMutation) OldActive(ctx context.Context) (v bool, err error)
- func (m *MetaMutation) OldContainerType(ctx context.Context) (v meta.ContainerType, err error)
- func (m *MetaMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *MetaMutation) OldFavorite(ctx context.Context) (v bool, err error)
- func (m *MetaMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *MetaMutation) OldFileIndices(ctx context.Context) (v []int, err error)
- func (m *MetaMutation) OldHidden(ctx context.Context) (v bool, err error)
- func (m *MetaMutation) OldName(ctx context.Context) (v string, err error)
- func (m *MetaMutation) OldRead(ctx context.Context) (v bool, err error)
- func (m *MetaMutation) OldThumbnailHeight(ctx context.Context) (v int, err error)
- func (m *MetaMutation) OldThumbnailIndex(ctx context.Context) (v int, err error)
- func (m *MetaMutation) OldThumbnailWidth(ctx context.Context) (v int, err error)
- func (m *MetaMutation) OldThumbnailX(ctx context.Context) (v int, err error)
- func (m *MetaMutation) OldThumbnailY(ctx context.Context) (v int, err error)
- func (m *MetaMutation) Op() Op
- func (m *MetaMutation) ProgressCleared() bool
- func (m *MetaMutation) ProgressIDs() (ids []int)
- func (m *MetaMutation) Read() (r bool, exists bool)
- func (m *MetaMutation) RemoveFavoriteOfUserIDs(ids ...int)
- func (m *MetaMutation) RemoveHistoryIDs(ids ...int)
- func (m *MetaMutation) RemoveProgresIDs(ids ...int)
- func (m *MetaMutation) RemoveTagIDs(ids ...int)
- func (m *MetaMutation) RemovedEdges() []string
- func (m *MetaMutation) RemovedFavoriteOfUserIDs() (ids []int)
- func (m *MetaMutation) RemovedHistoriesIDs() (ids []int)
- func (m *MetaMutation) RemovedIDs(name string) []ent.Value
- func (m *MetaMutation) RemovedProgressIDs() (ids []int)
- func (m *MetaMutation) RemovedTagsIDs() (ids []int)
- func (m *MetaMutation) ResetActive()
- func (m *MetaMutation) ResetContainerType()
- func (m *MetaMutation) ResetCreateTime()
- func (m *MetaMutation) ResetEdge(name string) error
- func (m *MetaMutation) ResetFavorite()
- func (m *MetaMutation) ResetFavoriteOfUser()
- func (m *MetaMutation) ResetField(name string) error
- func (m *MetaMutation) ResetFileIndices()
- func (m *MetaMutation) ResetHidden()
- func (m *MetaMutation) ResetHistories()
- func (m *MetaMutation) ResetName()
- func (m *MetaMutation) ResetProgress()
- func (m *MetaMutation) ResetRead()
- func (m *MetaMutation) ResetTags()
- func (m *MetaMutation) ResetThumbnailHeight()
- func (m *MetaMutation) ResetThumbnailIndex()
- func (m *MetaMutation) ResetThumbnailWidth()
- func (m *MetaMutation) ResetThumbnailX()
- func (m *MetaMutation) ResetThumbnailY()
- func (m *MetaMutation) SetActive(b bool)
- func (m *MetaMutation) SetContainerType(mt meta.ContainerType)
- func (m *MetaMutation) SetCreateTime(t time.Time)
- func (m *MetaMutation) SetFavorite(b bool)
- func (m *MetaMutation) SetField(name string, value ent.Value) error
- func (m *MetaMutation) SetFileIndices(i []int)
- func (m *MetaMutation) SetHidden(b bool)
- func (m *MetaMutation) SetName(s string)
- func (m *MetaMutation) SetOp(op Op)
- func (m *MetaMutation) SetRead(b bool)
- func (m *MetaMutation) SetThumbnailHeight(i int)
- func (m *MetaMutation) SetThumbnailIndex(i int)
- func (m *MetaMutation) SetThumbnailWidth(i int)
- func (m *MetaMutation) SetThumbnailX(i int)
- func (m *MetaMutation) SetThumbnailY(i int)
- func (m *MetaMutation) TagsCleared() bool
- func (m *MetaMutation) TagsIDs() (ids []int)
- func (m *MetaMutation) ThumbnailHeight() (r int, exists bool)
- func (m *MetaMutation) ThumbnailHeightCleared() bool
- func (m *MetaMutation) ThumbnailIndex() (r int, exists bool)
- func (m *MetaMutation) ThumbnailIndexCleared() bool
- func (m *MetaMutation) ThumbnailWidth() (r int, exists bool)
- func (m *MetaMutation) ThumbnailWidthCleared() bool
- func (m *MetaMutation) ThumbnailX() (r int, exists bool)
- func (m *MetaMutation) ThumbnailXCleared() bool
- func (m *MetaMutation) ThumbnailY() (r int, exists bool)
- func (m *MetaMutation) ThumbnailYCleared() bool
- func (m MetaMutation) Tx() (*Tx, error)
- func (m *MetaMutation) Type() string
- func (m *MetaMutation) Where(ps ...predicate.Meta)
- func (m *MetaMutation) WhereP(ps ...func(*sql.Selector))
- type MetaQuery
- func (mq *MetaQuery) Aggregate(fns ...AggregateFunc) *MetaSelect
- func (mq *MetaQuery) All(ctx context.Context) ([]*Meta, error)
- func (mq *MetaQuery) AllX(ctx context.Context) []*Meta
- func (mq *MetaQuery) Clone() *MetaQuery
- func (mq *MetaQuery) Count(ctx context.Context) (int, error)
- func (mq *MetaQuery) CountX(ctx context.Context) int
- func (mq *MetaQuery) Exist(ctx context.Context) (bool, error)
- func (mq *MetaQuery) ExistX(ctx context.Context) bool
- func (mq *MetaQuery) First(ctx context.Context) (*Meta, error)
- func (mq *MetaQuery) FirstID(ctx context.Context) (id int, err error)
- func (mq *MetaQuery) FirstIDX(ctx context.Context) int
- func (mq *MetaQuery) FirstX(ctx context.Context) *Meta
- func (mq *MetaQuery) GroupBy(field string, fields ...string) *MetaGroupBy
- func (mq *MetaQuery) IDs(ctx context.Context) (ids []int, err error)
- func (mq *MetaQuery) IDsX(ctx context.Context) []int
- func (mq *MetaQuery) Limit(limit int) *MetaQuery
- func (mq *MetaQuery) Offset(offset int) *MetaQuery
- func (mq *MetaQuery) Only(ctx context.Context) (*Meta, error)
- func (mq *MetaQuery) OnlyID(ctx context.Context) (id int, err error)
- func (mq *MetaQuery) OnlyIDX(ctx context.Context) int
- func (mq *MetaQuery) OnlyX(ctx context.Context) *Meta
- func (mq *MetaQuery) Order(o ...meta.OrderOption) *MetaQuery
- func (mq *MetaQuery) QueryFavoriteOfUser() *UserQuery
- func (mq *MetaQuery) QueryHistories() *HistoryQuery
- func (mq *MetaQuery) QueryProgress() *ProgressQuery
- func (mq *MetaQuery) QueryTags() *TagQuery
- func (mq *MetaQuery) Select(fields ...string) *MetaSelect
- func (mq *MetaQuery) Unique(unique bool) *MetaQuery
- func (mq *MetaQuery) Where(ps ...predicate.Meta) *MetaQuery
- func (mq *MetaQuery) WithFavoriteOfUser(opts ...func(*UserQuery)) *MetaQuery
- func (mq *MetaQuery) WithHistories(opts ...func(*HistoryQuery)) *MetaQuery
- func (mq *MetaQuery) WithProgress(opts ...func(*ProgressQuery)) *MetaQuery
- func (mq *MetaQuery) WithTags(opts ...func(*TagQuery)) *MetaQuery
- type MetaSelect
- func (ms *MetaSelect) Aggregate(fns ...AggregateFunc) *MetaSelect
- func (s *MetaSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *MetaSelect) BoolX(ctx context.Context) bool
- func (s *MetaSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *MetaSelect) BoolsX(ctx context.Context) []bool
- func (s *MetaSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *MetaSelect) Float64X(ctx context.Context) float64
- func (s *MetaSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *MetaSelect) Float64sX(ctx context.Context) []float64
- func (s *MetaSelect) Int(ctx context.Context) (_ int, err error)
- func (s *MetaSelect) IntX(ctx context.Context) int
- func (s *MetaSelect) Ints(ctx context.Context) ([]int, error)
- func (s *MetaSelect) IntsX(ctx context.Context) []int
- func (ms *MetaSelect) Scan(ctx context.Context, v any) error
- func (s *MetaSelect) ScanX(ctx context.Context, v any)
- func (s *MetaSelect) String(ctx context.Context) (_ string, err error)
- func (s *MetaSelect) StringX(ctx context.Context) string
- func (s *MetaSelect) Strings(ctx context.Context) ([]string, error)
- func (s *MetaSelect) StringsX(ctx context.Context) []string
- type MetaSlice
- type MetaUpdate
- func (mu *MetaUpdate) AddFavoriteOfUser(u ...*User) *MetaUpdate
- func (mu *MetaUpdate) AddFavoriteOfUserIDs(ids ...int) *MetaUpdate
- func (mu *MetaUpdate) AddHistories(h ...*History) *MetaUpdate
- func (mu *MetaUpdate) AddHistoryIDs(ids ...int) *MetaUpdate
- func (mu *MetaUpdate) AddProgresIDs(ids ...int) *MetaUpdate
- func (mu *MetaUpdate) AddProgress(p ...*Progress) *MetaUpdate
- func (mu *MetaUpdate) AddTagIDs(ids ...int) *MetaUpdate
- func (mu *MetaUpdate) AddTags(t ...*Tag) *MetaUpdate
- func (mu *MetaUpdate) AddThumbnailHeight(i int) *MetaUpdate
- func (mu *MetaUpdate) AddThumbnailIndex(i int) *MetaUpdate
- func (mu *MetaUpdate) AddThumbnailWidth(i int) *MetaUpdate
- func (mu *MetaUpdate) AddThumbnailX(i int) *MetaUpdate
- func (mu *MetaUpdate) AddThumbnailY(i int) *MetaUpdate
- func (mu *MetaUpdate) AppendFileIndices(i []int) *MetaUpdate
- func (mu *MetaUpdate) ClearFavoriteOfUser() *MetaUpdate
- func (mu *MetaUpdate) ClearHistories() *MetaUpdate
- func (mu *MetaUpdate) ClearProgress() *MetaUpdate
- func (mu *MetaUpdate) ClearTags() *MetaUpdate
- func (mu *MetaUpdate) ClearThumbnailHeight() *MetaUpdate
- func (mu *MetaUpdate) ClearThumbnailIndex() *MetaUpdate
- func (mu *MetaUpdate) ClearThumbnailWidth() *MetaUpdate
- func (mu *MetaUpdate) ClearThumbnailX() *MetaUpdate
- func (mu *MetaUpdate) ClearThumbnailY() *MetaUpdate
- func (mu *MetaUpdate) Exec(ctx context.Context) error
- func (mu *MetaUpdate) ExecX(ctx context.Context)
- func (mu *MetaUpdate) Mutation() *MetaMutation
- func (mu *MetaUpdate) RemoveFavoriteOfUser(u ...*User) *MetaUpdate
- func (mu *MetaUpdate) RemoveFavoriteOfUserIDs(ids ...int) *MetaUpdate
- func (mu *MetaUpdate) RemoveHistories(h ...*History) *MetaUpdate
- func (mu *MetaUpdate) RemoveHistoryIDs(ids ...int) *MetaUpdate
- func (mu *MetaUpdate) RemoveProgresIDs(ids ...int) *MetaUpdate
- func (mu *MetaUpdate) RemoveProgress(p ...*Progress) *MetaUpdate
- func (mu *MetaUpdate) RemoveTagIDs(ids ...int) *MetaUpdate
- func (mu *MetaUpdate) RemoveTags(t ...*Tag) *MetaUpdate
- func (mu *MetaUpdate) Save(ctx context.Context) (int, error)
- func (mu *MetaUpdate) SaveX(ctx context.Context) int
- func (mu *MetaUpdate) SetActive(b bool) *MetaUpdate
- func (mu *MetaUpdate) SetContainerType(mt meta.ContainerType) *MetaUpdate
- func (mu *MetaUpdate) SetCreateTime(t time.Time) *MetaUpdate
- func (mu *MetaUpdate) SetFavorite(b bool) *MetaUpdate
- func (mu *MetaUpdate) SetFileIndices(i []int) *MetaUpdate
- func (mu *MetaUpdate) SetHidden(b bool) *MetaUpdate
- func (mu *MetaUpdate) SetName(s string) *MetaUpdate
- func (mu *MetaUpdate) SetNillableActive(b *bool) *MetaUpdate
- func (mu *MetaUpdate) SetNillableContainerType(mt *meta.ContainerType) *MetaUpdate
- func (mu *MetaUpdate) SetNillableCreateTime(t *time.Time) *MetaUpdate
- func (mu *MetaUpdate) SetNillableFavorite(b *bool) *MetaUpdate
- func (mu *MetaUpdate) SetNillableHidden(b *bool) *MetaUpdate
- func (mu *MetaUpdate) SetNillableName(s *string) *MetaUpdate
- func (mu *MetaUpdate) SetNillableRead(b *bool) *MetaUpdate
- func (mu *MetaUpdate) SetNillableThumbnailHeight(i *int) *MetaUpdate
- func (mu *MetaUpdate) SetNillableThumbnailIndex(i *int) *MetaUpdate
- func (mu *MetaUpdate) SetNillableThumbnailWidth(i *int) *MetaUpdate
- func (mu *MetaUpdate) SetNillableThumbnailX(i *int) *MetaUpdate
- func (mu *MetaUpdate) SetNillableThumbnailY(i *int) *MetaUpdate
- func (mu *MetaUpdate) SetRead(b bool) *MetaUpdate
- func (mu *MetaUpdate) SetThumbnailHeight(i int) *MetaUpdate
- func (mu *MetaUpdate) SetThumbnailIndex(i int) *MetaUpdate
- func (mu *MetaUpdate) SetThumbnailWidth(i int) *MetaUpdate
- func (mu *MetaUpdate) SetThumbnailX(i int) *MetaUpdate
- func (mu *MetaUpdate) SetThumbnailY(i int) *MetaUpdate
- func (mu *MetaUpdate) Where(ps ...predicate.Meta) *MetaUpdate
- type MetaUpdateOne
- func (muo *MetaUpdateOne) AddFavoriteOfUser(u ...*User) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddFavoriteOfUserIDs(ids ...int) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddHistories(h ...*History) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddHistoryIDs(ids ...int) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddProgresIDs(ids ...int) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddProgress(p ...*Progress) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddTagIDs(ids ...int) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddTags(t ...*Tag) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddThumbnailHeight(i int) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddThumbnailIndex(i int) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddThumbnailWidth(i int) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddThumbnailX(i int) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddThumbnailY(i int) *MetaUpdateOne
- func (muo *MetaUpdateOne) AppendFileIndices(i []int) *MetaUpdateOne
- func (muo *MetaUpdateOne) ClearFavoriteOfUser() *MetaUpdateOne
- func (muo *MetaUpdateOne) ClearHistories() *MetaUpdateOne
- func (muo *MetaUpdateOne) ClearProgress() *MetaUpdateOne
- func (muo *MetaUpdateOne) ClearTags() *MetaUpdateOne
- func (muo *MetaUpdateOne) ClearThumbnailHeight() *MetaUpdateOne
- func (muo *MetaUpdateOne) ClearThumbnailIndex() *MetaUpdateOne
- func (muo *MetaUpdateOne) ClearThumbnailWidth() *MetaUpdateOne
- func (muo *MetaUpdateOne) ClearThumbnailX() *MetaUpdateOne
- func (muo *MetaUpdateOne) ClearThumbnailY() *MetaUpdateOne
- func (muo *MetaUpdateOne) Exec(ctx context.Context) error
- func (muo *MetaUpdateOne) ExecX(ctx context.Context)
- func (muo *MetaUpdateOne) Mutation() *MetaMutation
- func (muo *MetaUpdateOne) RemoveFavoriteOfUser(u ...*User) *MetaUpdateOne
- func (muo *MetaUpdateOne) RemoveFavoriteOfUserIDs(ids ...int) *MetaUpdateOne
- func (muo *MetaUpdateOne) RemoveHistories(h ...*History) *MetaUpdateOne
- func (muo *MetaUpdateOne) RemoveHistoryIDs(ids ...int) *MetaUpdateOne
- func (muo *MetaUpdateOne) RemoveProgresIDs(ids ...int) *MetaUpdateOne
- func (muo *MetaUpdateOne) RemoveProgress(p ...*Progress) *MetaUpdateOne
- func (muo *MetaUpdateOne) RemoveTagIDs(ids ...int) *MetaUpdateOne
- func (muo *MetaUpdateOne) RemoveTags(t ...*Tag) *MetaUpdateOne
- func (muo *MetaUpdateOne) Save(ctx context.Context) (*Meta, error)
- func (muo *MetaUpdateOne) SaveX(ctx context.Context) *Meta
- func (muo *MetaUpdateOne) Select(field string, fields ...string) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetActive(b bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetContainerType(mt meta.ContainerType) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetCreateTime(t time.Time) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetFavorite(b bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetFileIndices(i []int) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetHidden(b bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetName(s string) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableActive(b *bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableContainerType(mt *meta.ContainerType) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableCreateTime(t *time.Time) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableFavorite(b *bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableHidden(b *bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableName(s *string) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableRead(b *bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableThumbnailHeight(i *int) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableThumbnailIndex(i *int) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableThumbnailWidth(i *int) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableThumbnailX(i *int) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableThumbnailY(i *int) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetRead(b bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetThumbnailHeight(i int) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetThumbnailIndex(i int) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetThumbnailWidth(i int) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetThumbnailX(i int) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetThumbnailY(i int) *MetaUpdateOne
- func (muo *MetaUpdateOne) Where(ps ...predicate.Meta) *MetaUpdateOne
- type MetaUpsert
- func (u *MetaUpsert) AddThumbnailHeight(v int) *MetaUpsert
- func (u *MetaUpsert) AddThumbnailIndex(v int) *MetaUpsert
- func (u *MetaUpsert) AddThumbnailWidth(v int) *MetaUpsert
- func (u *MetaUpsert) AddThumbnailX(v int) *MetaUpsert
- func (u *MetaUpsert) AddThumbnailY(v int) *MetaUpsert
- func (u *MetaUpsert) ClearThumbnailHeight() *MetaUpsert
- func (u *MetaUpsert) ClearThumbnailIndex() *MetaUpsert
- func (u *MetaUpsert) ClearThumbnailWidth() *MetaUpsert
- func (u *MetaUpsert) ClearThumbnailX() *MetaUpsert
- func (u *MetaUpsert) ClearThumbnailY() *MetaUpsert
- func (u *MetaUpsert) SetActive(v bool) *MetaUpsert
- func (u *MetaUpsert) SetContainerType(v meta.ContainerType) *MetaUpsert
- func (u *MetaUpsert) SetCreateTime(v time.Time) *MetaUpsert
- func (u *MetaUpsert) SetFavorite(v bool) *MetaUpsert
- func (u *MetaUpsert) SetFileIndices(v []int) *MetaUpsert
- func (u *MetaUpsert) SetHidden(v bool) *MetaUpsert
- func (u *MetaUpsert) SetName(v string) *MetaUpsert
- func (u *MetaUpsert) SetRead(v bool) *MetaUpsert
- func (u *MetaUpsert) SetThumbnailHeight(v int) *MetaUpsert
- func (u *MetaUpsert) SetThumbnailIndex(v int) *MetaUpsert
- func (u *MetaUpsert) SetThumbnailWidth(v int) *MetaUpsert
- func (u *MetaUpsert) SetThumbnailX(v int) *MetaUpsert
- func (u *MetaUpsert) SetThumbnailY(v int) *MetaUpsert
- func (u *MetaUpsert) UpdateActive() *MetaUpsert
- func (u *MetaUpsert) UpdateContainerType() *MetaUpsert
- func (u *MetaUpsert) UpdateCreateTime() *MetaUpsert
- func (u *MetaUpsert) UpdateFavorite() *MetaUpsert
- func (u *MetaUpsert) UpdateFileIndices() *MetaUpsert
- func (u *MetaUpsert) UpdateHidden() *MetaUpsert
- func (u *MetaUpsert) UpdateName() *MetaUpsert
- func (u *MetaUpsert) UpdateRead() *MetaUpsert
- func (u *MetaUpsert) UpdateThumbnailHeight() *MetaUpsert
- func (u *MetaUpsert) UpdateThumbnailIndex() *MetaUpsert
- func (u *MetaUpsert) UpdateThumbnailWidth() *MetaUpsert
- func (u *MetaUpsert) UpdateThumbnailX() *MetaUpsert
- func (u *MetaUpsert) UpdateThumbnailY() *MetaUpsert
- type MetaUpsertBulk
- func (u *MetaUpsertBulk) AddThumbnailHeight(v int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) AddThumbnailIndex(v int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) AddThumbnailWidth(v int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) AddThumbnailX(v int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) AddThumbnailY(v int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) ClearThumbnailHeight() *MetaUpsertBulk
- func (u *MetaUpsertBulk) ClearThumbnailIndex() *MetaUpsertBulk
- func (u *MetaUpsertBulk) ClearThumbnailWidth() *MetaUpsertBulk
- func (u *MetaUpsertBulk) ClearThumbnailX() *MetaUpsertBulk
- func (u *MetaUpsertBulk) ClearThumbnailY() *MetaUpsertBulk
- func (u *MetaUpsertBulk) DoNothing() *MetaUpsertBulk
- func (u *MetaUpsertBulk) Exec(ctx context.Context) error
- func (u *MetaUpsertBulk) ExecX(ctx context.Context)
- func (u *MetaUpsertBulk) Ignore() *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetActive(v bool) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetContainerType(v meta.ContainerType) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetCreateTime(v time.Time) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetFavorite(v bool) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetFileIndices(v []int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetHidden(v bool) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetName(v string) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetRead(v bool) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetThumbnailHeight(v int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetThumbnailIndex(v int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetThumbnailWidth(v int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetThumbnailX(v int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetThumbnailY(v int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) Update(set func(*MetaUpsert)) *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateActive() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateContainerType() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateCreateTime() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateFavorite() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateFileIndices() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateHidden() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateName() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateNewValues() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateRead() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateThumbnailHeight() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateThumbnailIndex() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateThumbnailWidth() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateThumbnailX() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateThumbnailY() *MetaUpsertBulk
- type MetaUpsertOne
- func (u *MetaUpsertOne) AddThumbnailHeight(v int) *MetaUpsertOne
- func (u *MetaUpsertOne) AddThumbnailIndex(v int) *MetaUpsertOne
- func (u *MetaUpsertOne) AddThumbnailWidth(v int) *MetaUpsertOne
- func (u *MetaUpsertOne) AddThumbnailX(v int) *MetaUpsertOne
- func (u *MetaUpsertOne) AddThumbnailY(v int) *MetaUpsertOne
- func (u *MetaUpsertOne) ClearThumbnailHeight() *MetaUpsertOne
- func (u *MetaUpsertOne) ClearThumbnailIndex() *MetaUpsertOne
- func (u *MetaUpsertOne) ClearThumbnailWidth() *MetaUpsertOne
- func (u *MetaUpsertOne) ClearThumbnailX() *MetaUpsertOne
- func (u *MetaUpsertOne) ClearThumbnailY() *MetaUpsertOne
- func (u *MetaUpsertOne) DoNothing() *MetaUpsertOne
- func (u *MetaUpsertOne) Exec(ctx context.Context) error
- func (u *MetaUpsertOne) ExecX(ctx context.Context)
- func (u *MetaUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *MetaUpsertOne) IDX(ctx context.Context) int
- func (u *MetaUpsertOne) Ignore() *MetaUpsertOne
- func (u *MetaUpsertOne) SetActive(v bool) *MetaUpsertOne
- func (u *MetaUpsertOne) SetContainerType(v meta.ContainerType) *MetaUpsertOne
- func (u *MetaUpsertOne) SetCreateTime(v time.Time) *MetaUpsertOne
- func (u *MetaUpsertOne) SetFavorite(v bool) *MetaUpsertOne
- func (u *MetaUpsertOne) SetFileIndices(v []int) *MetaUpsertOne
- func (u *MetaUpsertOne) SetHidden(v bool) *MetaUpsertOne
- func (u *MetaUpsertOne) SetName(v string) *MetaUpsertOne
- func (u *MetaUpsertOne) SetRead(v bool) *MetaUpsertOne
- func (u *MetaUpsertOne) SetThumbnailHeight(v int) *MetaUpsertOne
- func (u *MetaUpsertOne) SetThumbnailIndex(v int) *MetaUpsertOne
- func (u *MetaUpsertOne) SetThumbnailWidth(v int) *MetaUpsertOne
- func (u *MetaUpsertOne) SetThumbnailX(v int) *MetaUpsertOne
- func (u *MetaUpsertOne) SetThumbnailY(v int) *MetaUpsertOne
- func (u *MetaUpsertOne) Update(set func(*MetaUpsert)) *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateActive() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateContainerType() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateCreateTime() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateFavorite() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateFileIndices() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateHidden() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateName() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateNewValues() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateRead() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateThumbnailHeight() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateThumbnailIndex() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateThumbnailWidth() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateThumbnailX() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateThumbnailY() *MetaUpsertOne
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Progress
- type ProgressClient
- func (c *ProgressClient) Create() *ProgressCreate
- func (c *ProgressClient) CreateBulk(builders ...*ProgressCreate) *ProgressCreateBulk
- func (c *ProgressClient) Delete() *ProgressDelete
- func (c *ProgressClient) DeleteOne(pr *Progress) *ProgressDeleteOne
- func (c *ProgressClient) DeleteOneID(id int) *ProgressDeleteOne
- func (c *ProgressClient) Get(ctx context.Context, id int) (*Progress, error)
- func (c *ProgressClient) GetX(ctx context.Context, id int) *Progress
- func (c *ProgressClient) Hooks() []Hook
- func (c *ProgressClient) Intercept(interceptors ...Interceptor)
- func (c *ProgressClient) Interceptors() []Interceptor
- func (c *ProgressClient) MapCreateBulk(slice any, setFunc func(*ProgressCreate, int)) *ProgressCreateBulk
- func (c *ProgressClient) Query() *ProgressQuery
- func (c *ProgressClient) QueryItem(pr *Progress) *MetaQuery
- func (c *ProgressClient) QueryUser(pr *Progress) *UserQuery
- func (c *ProgressClient) Update() *ProgressUpdate
- func (c *ProgressClient) UpdateOne(pr *Progress) *ProgressUpdateOne
- func (c *ProgressClient) UpdateOneID(id int) *ProgressUpdateOne
- func (c *ProgressClient) Use(hooks ...Hook)
- type ProgressCreate
- func (pc *ProgressCreate) Exec(ctx context.Context) error
- func (pc *ProgressCreate) ExecX(ctx context.Context)
- func (pc *ProgressCreate) Mutation() *ProgressMutation
- func (pc *ProgressCreate) OnConflict(opts ...sql.ConflictOption) *ProgressUpsertOne
- func (pc *ProgressCreate) OnConflictColumns(columns ...string) *ProgressUpsertOne
- func (pc *ProgressCreate) Save(ctx context.Context) (*Progress, error)
- func (pc *ProgressCreate) SaveX(ctx context.Context) *Progress
- func (pc *ProgressCreate) SetItem(m *Meta) *ProgressCreate
- func (pc *ProgressCreate) SetItemID(i int) *ProgressCreate
- func (pc *ProgressCreate) SetNillableItemID(i *int) *ProgressCreate
- func (pc *ProgressCreate) SetNillablePage(i *int) *ProgressCreate
- func (pc *ProgressCreate) SetNillableUserID(i *int) *ProgressCreate
- func (pc *ProgressCreate) SetPage(i int) *ProgressCreate
- func (pc *ProgressCreate) SetUser(u *User) *ProgressCreate
- func (pc *ProgressCreate) SetUserID(i int) *ProgressCreate
- type ProgressCreateBulk
- func (pcb *ProgressCreateBulk) Exec(ctx context.Context) error
- func (pcb *ProgressCreateBulk) ExecX(ctx context.Context)
- func (pcb *ProgressCreateBulk) OnConflict(opts ...sql.ConflictOption) *ProgressUpsertBulk
- func (pcb *ProgressCreateBulk) OnConflictColumns(columns ...string) *ProgressUpsertBulk
- func (pcb *ProgressCreateBulk) Save(ctx context.Context) ([]*Progress, error)
- func (pcb *ProgressCreateBulk) SaveX(ctx context.Context) []*Progress
- type ProgressDelete
- type ProgressDeleteOne
- type ProgressEdges
- type ProgressGroupBy
- func (pgb *ProgressGroupBy) Aggregate(fns ...AggregateFunc) *ProgressGroupBy
- func (s *ProgressGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProgressGroupBy) BoolX(ctx context.Context) bool
- func (s *ProgressGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ProgressGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ProgressGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProgressGroupBy) Float64X(ctx context.Context) float64
- func (s *ProgressGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProgressGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ProgressGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ProgressGroupBy) IntX(ctx context.Context) int
- func (s *ProgressGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ProgressGroupBy) IntsX(ctx context.Context) []int
- func (pgb *ProgressGroupBy) Scan(ctx context.Context, v any) error
- func (s *ProgressGroupBy) ScanX(ctx context.Context, v any)
- func (s *ProgressGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ProgressGroupBy) StringX(ctx context.Context) string
- func (s *ProgressGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ProgressGroupBy) StringsX(ctx context.Context) []string
- type ProgressMutation
- func (m *ProgressMutation) AddField(name string, value ent.Value) error
- func (m *ProgressMutation) AddPage(i int)
- func (m *ProgressMutation) AddedEdges() []string
- func (m *ProgressMutation) AddedField(name string) (ent.Value, bool)
- func (m *ProgressMutation) AddedFields() []string
- func (m *ProgressMutation) AddedIDs(name string) []ent.Value
- func (m *ProgressMutation) AddedPage() (r int, exists bool)
- func (m *ProgressMutation) ClearEdge(name string) error
- func (m *ProgressMutation) ClearField(name string) error
- func (m *ProgressMutation) ClearItem()
- func (m *ProgressMutation) ClearItemID()
- func (m *ProgressMutation) ClearUser()
- func (m *ProgressMutation) ClearUserID()
- func (m *ProgressMutation) ClearedEdges() []string
- func (m *ProgressMutation) ClearedFields() []string
- func (m ProgressMutation) Client() *Client
- func (m *ProgressMutation) EdgeCleared(name string) bool
- func (m *ProgressMutation) Field(name string) (ent.Value, bool)
- func (m *ProgressMutation) FieldCleared(name string) bool
- func (m *ProgressMutation) Fields() []string
- func (m *ProgressMutation) ID() (id int, exists bool)
- func (m *ProgressMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ProgressMutation) ItemCleared() bool
- func (m *ProgressMutation) ItemID() (r int, exists bool)
- func (m *ProgressMutation) ItemIDCleared() bool
- func (m *ProgressMutation) ItemIDs() (ids []int)
- func (m *ProgressMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ProgressMutation) OldItemID(ctx context.Context) (v int, err error)
- func (m *ProgressMutation) OldPage(ctx context.Context) (v int, err error)
- func (m *ProgressMutation) OldUserID(ctx context.Context) (v int, err error)
- func (m *ProgressMutation) Op() Op
- func (m *ProgressMutation) Page() (r int, exists bool)
- func (m *ProgressMutation) RemovedEdges() []string
- func (m *ProgressMutation) RemovedIDs(name string) []ent.Value
- func (m *ProgressMutation) ResetEdge(name string) error
- func (m *ProgressMutation) ResetField(name string) error
- func (m *ProgressMutation) ResetItem()
- func (m *ProgressMutation) ResetItemID()
- func (m *ProgressMutation) ResetPage()
- func (m *ProgressMutation) ResetUser()
- func (m *ProgressMutation) ResetUserID()
- func (m *ProgressMutation) SetField(name string, value ent.Value) error
- func (m *ProgressMutation) SetItemID(i int)
- func (m *ProgressMutation) SetOp(op Op)
- func (m *ProgressMutation) SetPage(i int)
- func (m *ProgressMutation) SetUserID(i int)
- func (m ProgressMutation) Tx() (*Tx, error)
- func (m *ProgressMutation) Type() string
- func (m *ProgressMutation) UserCleared() bool
- func (m *ProgressMutation) UserID() (r int, exists bool)
- func (m *ProgressMutation) UserIDCleared() bool
- func (m *ProgressMutation) UserIDs() (ids []int)
- func (m *ProgressMutation) Where(ps ...predicate.Progress)
- func (m *ProgressMutation) WhereP(ps ...func(*sql.Selector))
- type ProgressQuery
- func (pq *ProgressQuery) Aggregate(fns ...AggregateFunc) *ProgressSelect
- func (pq *ProgressQuery) All(ctx context.Context) ([]*Progress, error)
- func (pq *ProgressQuery) AllX(ctx context.Context) []*Progress
- func (pq *ProgressQuery) Clone() *ProgressQuery
- func (pq *ProgressQuery) Count(ctx context.Context) (int, error)
- func (pq *ProgressQuery) CountX(ctx context.Context) int
- func (pq *ProgressQuery) Exist(ctx context.Context) (bool, error)
- func (pq *ProgressQuery) ExistX(ctx context.Context) bool
- func (pq *ProgressQuery) First(ctx context.Context) (*Progress, error)
- func (pq *ProgressQuery) FirstID(ctx context.Context) (id int, err error)
- func (pq *ProgressQuery) FirstIDX(ctx context.Context) int
- func (pq *ProgressQuery) FirstX(ctx context.Context) *Progress
- func (pq *ProgressQuery) GroupBy(field string, fields ...string) *ProgressGroupBy
- func (pq *ProgressQuery) IDs(ctx context.Context) (ids []int, err error)
- func (pq *ProgressQuery) IDsX(ctx context.Context) []int
- func (pq *ProgressQuery) Limit(limit int) *ProgressQuery
- func (pq *ProgressQuery) Offset(offset int) *ProgressQuery
- func (pq *ProgressQuery) Only(ctx context.Context) (*Progress, error)
- func (pq *ProgressQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pq *ProgressQuery) OnlyIDX(ctx context.Context) int
- func (pq *ProgressQuery) OnlyX(ctx context.Context) *Progress
- func (pq *ProgressQuery) Order(o ...progress.OrderOption) *ProgressQuery
- func (pq *ProgressQuery) QueryItem() *MetaQuery
- func (pq *ProgressQuery) QueryUser() *UserQuery
- func (pq *ProgressQuery) Select(fields ...string) *ProgressSelect
- func (pq *ProgressQuery) Unique(unique bool) *ProgressQuery
- func (pq *ProgressQuery) Where(ps ...predicate.Progress) *ProgressQuery
- func (pq *ProgressQuery) WithItem(opts ...func(*MetaQuery)) *ProgressQuery
- func (pq *ProgressQuery) WithUser(opts ...func(*UserQuery)) *ProgressQuery
- type ProgressSelect
- func (ps *ProgressSelect) Aggregate(fns ...AggregateFunc) *ProgressSelect
- func (s *ProgressSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProgressSelect) BoolX(ctx context.Context) bool
- func (s *ProgressSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ProgressSelect) BoolsX(ctx context.Context) []bool
- func (s *ProgressSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProgressSelect) Float64X(ctx context.Context) float64
- func (s *ProgressSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProgressSelect) Float64sX(ctx context.Context) []float64
- func (s *ProgressSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ProgressSelect) IntX(ctx context.Context) int
- func (s *ProgressSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ProgressSelect) IntsX(ctx context.Context) []int
- func (ps *ProgressSelect) Scan(ctx context.Context, v any) error
- func (s *ProgressSelect) ScanX(ctx context.Context, v any)
- func (s *ProgressSelect) String(ctx context.Context) (_ string, err error)
- func (s *ProgressSelect) StringX(ctx context.Context) string
- func (s *ProgressSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ProgressSelect) StringsX(ctx context.Context) []string
- type ProgressUpdate
- func (pu *ProgressUpdate) AddPage(i int) *ProgressUpdate
- func (pu *ProgressUpdate) ClearItem() *ProgressUpdate
- func (pu *ProgressUpdate) ClearItemID() *ProgressUpdate
- func (pu *ProgressUpdate) ClearUser() *ProgressUpdate
- func (pu *ProgressUpdate) ClearUserID() *ProgressUpdate
- func (pu *ProgressUpdate) Exec(ctx context.Context) error
- func (pu *ProgressUpdate) ExecX(ctx context.Context)
- func (pu *ProgressUpdate) Mutation() *ProgressMutation
- func (pu *ProgressUpdate) Save(ctx context.Context) (int, error)
- func (pu *ProgressUpdate) SaveX(ctx context.Context) int
- func (pu *ProgressUpdate) SetItem(m *Meta) *ProgressUpdate
- func (pu *ProgressUpdate) SetItemID(i int) *ProgressUpdate
- func (pu *ProgressUpdate) SetNillableItemID(i *int) *ProgressUpdate
- func (pu *ProgressUpdate) SetNillablePage(i *int) *ProgressUpdate
- func (pu *ProgressUpdate) SetNillableUserID(i *int) *ProgressUpdate
- func (pu *ProgressUpdate) SetPage(i int) *ProgressUpdate
- func (pu *ProgressUpdate) SetUser(u *User) *ProgressUpdate
- func (pu *ProgressUpdate) SetUserID(i int) *ProgressUpdate
- func (pu *ProgressUpdate) Where(ps ...predicate.Progress) *ProgressUpdate
- type ProgressUpdateOne
- func (puo *ProgressUpdateOne) AddPage(i int) *ProgressUpdateOne
- func (puo *ProgressUpdateOne) ClearItem() *ProgressUpdateOne
- func (puo *ProgressUpdateOne) ClearItemID() *ProgressUpdateOne
- func (puo *ProgressUpdateOne) ClearUser() *ProgressUpdateOne
- func (puo *ProgressUpdateOne) ClearUserID() *ProgressUpdateOne
- func (puo *ProgressUpdateOne) Exec(ctx context.Context) error
- func (puo *ProgressUpdateOne) ExecX(ctx context.Context)
- func (puo *ProgressUpdateOne) Mutation() *ProgressMutation
- func (puo *ProgressUpdateOne) Save(ctx context.Context) (*Progress, error)
- func (puo *ProgressUpdateOne) SaveX(ctx context.Context) *Progress
- func (puo *ProgressUpdateOne) Select(field string, fields ...string) *ProgressUpdateOne
- func (puo *ProgressUpdateOne) SetItem(m *Meta) *ProgressUpdateOne
- func (puo *ProgressUpdateOne) SetItemID(i int) *ProgressUpdateOne
- func (puo *ProgressUpdateOne) SetNillableItemID(i *int) *ProgressUpdateOne
- func (puo *ProgressUpdateOne) SetNillablePage(i *int) *ProgressUpdateOne
- func (puo *ProgressUpdateOne) SetNillableUserID(i *int) *ProgressUpdateOne
- func (puo *ProgressUpdateOne) SetPage(i int) *ProgressUpdateOne
- func (puo *ProgressUpdateOne) SetUser(u *User) *ProgressUpdateOne
- func (puo *ProgressUpdateOne) SetUserID(i int) *ProgressUpdateOne
- func (puo *ProgressUpdateOne) Where(ps ...predicate.Progress) *ProgressUpdateOne
- type ProgressUpsert
- func (u *ProgressUpsert) AddPage(v int) *ProgressUpsert
- func (u *ProgressUpsert) ClearItemID() *ProgressUpsert
- func (u *ProgressUpsert) ClearUserID() *ProgressUpsert
- func (u *ProgressUpsert) SetItemID(v int) *ProgressUpsert
- func (u *ProgressUpsert) SetPage(v int) *ProgressUpsert
- func (u *ProgressUpsert) SetUserID(v int) *ProgressUpsert
- func (u *ProgressUpsert) UpdateItemID() *ProgressUpsert
- func (u *ProgressUpsert) UpdatePage() *ProgressUpsert
- func (u *ProgressUpsert) UpdateUserID() *ProgressUpsert
- type ProgressUpsertBulk
- func (u *ProgressUpsertBulk) AddPage(v int) *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) ClearItemID() *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) ClearUserID() *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) DoNothing() *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) Exec(ctx context.Context) error
- func (u *ProgressUpsertBulk) ExecX(ctx context.Context)
- func (u *ProgressUpsertBulk) Ignore() *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) SetItemID(v int) *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) SetPage(v int) *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) SetUserID(v int) *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) Update(set func(*ProgressUpsert)) *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) UpdateItemID() *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) UpdateNewValues() *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) UpdatePage() *ProgressUpsertBulk
- func (u *ProgressUpsertBulk) UpdateUserID() *ProgressUpsertBulk
- type ProgressUpsertOne
- func (u *ProgressUpsertOne) AddPage(v int) *ProgressUpsertOne
- func (u *ProgressUpsertOne) ClearItemID() *ProgressUpsertOne
- func (u *ProgressUpsertOne) ClearUserID() *ProgressUpsertOne
- func (u *ProgressUpsertOne) DoNothing() *ProgressUpsertOne
- func (u *ProgressUpsertOne) Exec(ctx context.Context) error
- func (u *ProgressUpsertOne) ExecX(ctx context.Context)
- func (u *ProgressUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *ProgressUpsertOne) IDX(ctx context.Context) int
- func (u *ProgressUpsertOne) Ignore() *ProgressUpsertOne
- func (u *ProgressUpsertOne) SetItemID(v int) *ProgressUpsertOne
- func (u *ProgressUpsertOne) SetPage(v int) *ProgressUpsertOne
- func (u *ProgressUpsertOne) SetUserID(v int) *ProgressUpsertOne
- func (u *ProgressUpsertOne) Update(set func(*ProgressUpsert)) *ProgressUpsertOne
- func (u *ProgressUpsertOne) UpdateItemID() *ProgressUpsertOne
- func (u *ProgressUpsertOne) UpdateNewValues() *ProgressUpsertOne
- func (u *ProgressUpsertOne) UpdatePage() *ProgressUpsertOne
- func (u *ProgressUpsertOne) UpdateUserID() *ProgressUpsertOne
- type Progresses
- 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) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk
- func (c *TagClient) Query() *TagQuery
- func (c *TagClient) QueryFavoriteOfUser(t *Tag) *UserQuery
- func (c *TagClient) QueryMeta(t *Tag) *MetaQuery
- 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) AddFavoriteOfUser(u ...*User) *TagCreate
- func (tc *TagCreate) AddFavoriteOfUserIDs(ids ...int) *TagCreate
- func (tc *TagCreate) AddMeta(m ...*Meta) *TagCreate
- func (tc *TagCreate) AddMetumIDs(ids ...int) *TagCreate
- func (tc *TagCreate) Exec(ctx context.Context) error
- func (tc *TagCreate) ExecX(ctx context.Context)
- func (tc *TagCreate) Mutation() *TagMutation
- func (tc *TagCreate) OnConflict(opts ...sql.ConflictOption) *TagUpsertOne
- func (tc *TagCreate) OnConflictColumns(columns ...string) *TagUpsertOne
- func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)
- func (tc *TagCreate) SaveX(ctx context.Context) *Tag
- func (tc *TagCreate) SetFavorite(b bool) *TagCreate
- func (tc *TagCreate) SetHidden(b bool) *TagCreate
- func (tc *TagCreate) SetName(s string) *TagCreate
- func (tc *TagCreate) SetNillableFavorite(b *bool) *TagCreate
- func (tc *TagCreate) SetNillableHidden(b *bool) *TagCreate
- type TagCreateBulk
- func (tcb *TagCreateBulk) Exec(ctx context.Context) error
- func (tcb *TagCreateBulk) ExecX(ctx context.Context)
- func (tcb *TagCreateBulk) OnConflict(opts ...sql.ConflictOption) *TagUpsertBulk
- func (tcb *TagCreateBulk) OnConflictColumns(columns ...string) *TagUpsertBulk
- func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)
- func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag
- 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) AddFavoriteOfUserIDs(ids ...int)
- func (m *TagMutation) AddField(name string, value ent.Value) error
- func (m *TagMutation) AddMetumIDs(ids ...int)
- 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) ClearEdge(name string) error
- func (m *TagMutation) ClearFavoriteOfUser()
- func (m *TagMutation) ClearField(name string) error
- func (m *TagMutation) ClearMeta()
- func (m *TagMutation) ClearedEdges() []string
- func (m *TagMutation) ClearedFields() []string
- func (m TagMutation) Client() *Client
- func (m *TagMutation) EdgeCleared(name string) bool
- func (m *TagMutation) Favorite() (r bool, exists bool)
- func (m *TagMutation) FavoriteOfUserCleared() bool
- func (m *TagMutation) FavoriteOfUserIDs() (ids []int)
- func (m *TagMutation) Field(name string) (ent.Value, bool)
- func (m *TagMutation) FieldCleared(name string) bool
- func (m *TagMutation) Fields() []string
- func (m *TagMutation) Hidden() (r bool, exists bool)
- func (m *TagMutation) ID() (id int, exists bool)
- func (m *TagMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TagMutation) MetaCleared() bool
- func (m *TagMutation) MetaIDs() (ids []int)
- func (m *TagMutation) Name() (r string, exists bool)
- func (m *TagMutation) OldFavorite(ctx context.Context) (v bool, err error)
- func (m *TagMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TagMutation) OldHidden(ctx context.Context) (v bool, err error)
- func (m *TagMutation) OldName(ctx context.Context) (v string, err error)
- func (m *TagMutation) Op() Op
- func (m *TagMutation) RemoveFavoriteOfUserIDs(ids ...int)
- func (m *TagMutation) RemoveMetumIDs(ids ...int)
- func (m *TagMutation) RemovedEdges() []string
- func (m *TagMutation) RemovedFavoriteOfUserIDs() (ids []int)
- func (m *TagMutation) RemovedIDs(name string) []ent.Value
- func (m *TagMutation) RemovedMetaIDs() (ids []int)
- func (m *TagMutation) ResetEdge(name string) error
- func (m *TagMutation) ResetFavorite()
- func (m *TagMutation) ResetFavoriteOfUser()
- func (m *TagMutation) ResetField(name string) error
- func (m *TagMutation) ResetHidden()
- func (m *TagMutation) ResetMeta()
- func (m *TagMutation) ResetName()
- func (m *TagMutation) SetFavorite(b bool)
- func (m *TagMutation) SetField(name string, value ent.Value) error
- func (m *TagMutation) SetHidden(b bool)
- func (m *TagMutation) SetName(s string)
- func (m *TagMutation) SetOp(op Op)
- 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 ...tag.OrderOption) *TagQuery
- func (tq *TagQuery) QueryFavoriteOfUser() *UserQuery
- func (tq *TagQuery) QueryMeta() *MetaQuery
- 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) WithFavoriteOfUser(opts ...func(*UserQuery)) *TagQuery
- func (tq *TagQuery) WithMeta(opts ...func(*MetaQuery)) *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) AddFavoriteOfUser(u ...*User) *TagUpdate
- func (tu *TagUpdate) AddFavoriteOfUserIDs(ids ...int) *TagUpdate
- func (tu *TagUpdate) AddMeta(m ...*Meta) *TagUpdate
- func (tu *TagUpdate) AddMetumIDs(ids ...int) *TagUpdate
- func (tu *TagUpdate) ClearFavoriteOfUser() *TagUpdate
- func (tu *TagUpdate) ClearMeta() *TagUpdate
- func (tu *TagUpdate) Exec(ctx context.Context) error
- func (tu *TagUpdate) ExecX(ctx context.Context)
- func (tu *TagUpdate) Mutation() *TagMutation
- func (tu *TagUpdate) RemoveFavoriteOfUser(u ...*User) *TagUpdate
- func (tu *TagUpdate) RemoveFavoriteOfUserIDs(ids ...int) *TagUpdate
- func (tu *TagUpdate) RemoveMeta(m ...*Meta) *TagUpdate
- func (tu *TagUpdate) RemoveMetumIDs(ids ...int) *TagUpdate
- func (tu *TagUpdate) Save(ctx context.Context) (int, error)
- func (tu *TagUpdate) SaveX(ctx context.Context) int
- func (tu *TagUpdate) SetFavorite(b bool) *TagUpdate
- func (tu *TagUpdate) SetHidden(b bool) *TagUpdate
- func (tu *TagUpdate) SetName(s string) *TagUpdate
- func (tu *TagUpdate) SetNillableFavorite(b *bool) *TagUpdate
- func (tu *TagUpdate) SetNillableHidden(b *bool) *TagUpdate
- func (tu *TagUpdate) SetNillableName(s *string) *TagUpdate
- func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate
- type TagUpdateOne
- func (tuo *TagUpdateOne) AddFavoriteOfUser(u ...*User) *TagUpdateOne
- func (tuo *TagUpdateOne) AddFavoriteOfUserIDs(ids ...int) *TagUpdateOne
- func (tuo *TagUpdateOne) AddMeta(m ...*Meta) *TagUpdateOne
- func (tuo *TagUpdateOne) AddMetumIDs(ids ...int) *TagUpdateOne
- func (tuo *TagUpdateOne) ClearFavoriteOfUser() *TagUpdateOne
- func (tuo *TagUpdateOne) ClearMeta() *TagUpdateOne
- func (tuo *TagUpdateOne) Exec(ctx context.Context) error
- func (tuo *TagUpdateOne) ExecX(ctx context.Context)
- func (tuo *TagUpdateOne) Mutation() *TagMutation
- func (tuo *TagUpdateOne) RemoveFavoriteOfUser(u ...*User) *TagUpdateOne
- func (tuo *TagUpdateOne) RemoveFavoriteOfUserIDs(ids ...int) *TagUpdateOne
- func (tuo *TagUpdateOne) RemoveMeta(m ...*Meta) *TagUpdateOne
- func (tuo *TagUpdateOne) RemoveMetumIDs(ids ...int) *TagUpdateOne
- 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) SetFavorite(b bool) *TagUpdateOne
- func (tuo *TagUpdateOne) SetHidden(b bool) *TagUpdateOne
- func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne
- func (tuo *TagUpdateOne) SetNillableFavorite(b *bool) *TagUpdateOne
- func (tuo *TagUpdateOne) SetNillableHidden(b *bool) *TagUpdateOne
- func (tuo *TagUpdateOne) SetNillableName(s *string) *TagUpdateOne
- func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne
- type TagUpsert
- type TagUpsertBulk
- func (u *TagUpsertBulk) DoNothing() *TagUpsertBulk
- func (u *TagUpsertBulk) Exec(ctx context.Context) error
- func (u *TagUpsertBulk) ExecX(ctx context.Context)
- func (u *TagUpsertBulk) Ignore() *TagUpsertBulk
- func (u *TagUpsertBulk) SetFavorite(v bool) *TagUpsertBulk
- func (u *TagUpsertBulk) SetHidden(v bool) *TagUpsertBulk
- func (u *TagUpsertBulk) SetName(v string) *TagUpsertBulk
- func (u *TagUpsertBulk) Update(set func(*TagUpsert)) *TagUpsertBulk
- func (u *TagUpsertBulk) UpdateFavorite() *TagUpsertBulk
- func (u *TagUpsertBulk) UpdateHidden() *TagUpsertBulk
- func (u *TagUpsertBulk) UpdateName() *TagUpsertBulk
- func (u *TagUpsertBulk) UpdateNewValues() *TagUpsertBulk
- type TagUpsertOne
- func (u *TagUpsertOne) DoNothing() *TagUpsertOne
- func (u *TagUpsertOne) Exec(ctx context.Context) error
- func (u *TagUpsertOne) ExecX(ctx context.Context)
- func (u *TagUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *TagUpsertOne) IDX(ctx context.Context) int
- func (u *TagUpsertOne) Ignore() *TagUpsertOne
- func (u *TagUpsertOne) SetFavorite(v bool) *TagUpsertOne
- func (u *TagUpsertOne) SetHidden(v bool) *TagUpsertOne
- func (u *TagUpsertOne) SetName(v string) *TagUpsertOne
- func (u *TagUpsertOne) Update(set func(*TagUpsert)) *TagUpsertOne
- func (u *TagUpsertOne) UpdateFavorite() *TagUpsertOne
- func (u *TagUpsertOne) UpdateHidden() *TagUpsertOne
- func (u *TagUpsertOne) UpdateName() *TagUpsertOne
- func (u *TagUpsertOne) UpdateNewValues() *TagUpsertOne
- type Tags
- type TraverseFunc
- type Traverser
- type Tx
- type User
- func (u *User) QueryFavoriteItems() *MetaQuery
- func (u *User) QueryFavoriteTags() *TagQuery
- func (u *User) QueryHistories() *HistoryQuery
- func (u *User) QueryProgress() *ProgressQuery
- func (u *User) String() string
- func (u *User) Unwrap() *User
- func (u *User) Update() *UserUpdateOne
- func (u *User) Value(name string) (ent.Value, error)
- 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) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryFavoriteItems(u *User) *MetaQuery
- func (c *UserClient) QueryFavoriteTags(u *User) *TagQuery
- func (c *UserClient) QueryHistories(u *User) *HistoryQuery
- func (c *UserClient) QueryProgress(u *User) *ProgressQuery
- 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) AddFavoriteItemIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddFavoriteItems(m ...*Meta) *UserCreate
- func (uc *UserCreate) AddFavoriteTagIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddFavoriteTags(t ...*Tag) *UserCreate
- func (uc *UserCreate) AddHistories(h ...*History) *UserCreate
- func (uc *UserCreate) AddHistoryIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddProgresIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddProgress(p ...*Progress) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne
- func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetActive(b bool) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetNillableActive(b *bool) *UserCreate
- type UserCreateBulk
- func (ucb *UserCreateBulk) Exec(ctx context.Context) error
- func (ucb *UserCreateBulk) ExecX(ctx context.Context)
- func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk
- func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk
- func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)
- func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) Active() (r bool, exists bool)
- func (m *UserMutation) AddFavoriteItemIDs(ids ...int)
- func (m *UserMutation) AddFavoriteTagIDs(ids ...int)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddHistoryIDs(ids ...int)
- func (m *UserMutation) AddProgresIDs(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) ClearEdge(name string) error
- func (m *UserMutation) ClearFavoriteItems()
- func (m *UserMutation) ClearFavoriteTags()
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearHistories()
- func (m *UserMutation) ClearProgress()
- 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) Email() (r string, exists bool)
- func (m *UserMutation) FavoriteItemsCleared() bool
- func (m *UserMutation) FavoriteItemsIDs() (ids []int)
- func (m *UserMutation) FavoriteTagsCleared() bool
- func (m *UserMutation) FavoriteTagsIDs() (ids []int)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) HistoriesCleared() bool
- func (m *UserMutation) HistoriesIDs() (ids []int)
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) OldActive(ctx context.Context) (v bool, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) ProgressCleared() bool
- func (m *UserMutation) ProgressIDs() (ids []int)
- func (m *UserMutation) RemoveFavoriteItemIDs(ids ...int)
- func (m *UserMutation) RemoveFavoriteTagIDs(ids ...int)
- func (m *UserMutation) RemoveHistoryIDs(ids ...int)
- func (m *UserMutation) RemoveProgresIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedFavoriteItemsIDs() (ids []int)
- func (m *UserMutation) RemovedFavoriteTagsIDs() (ids []int)
- func (m *UserMutation) RemovedHistoriesIDs() (ids []int)
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedProgressIDs() (ids []int)
- func (m *UserMutation) ResetActive()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetFavoriteItems()
- func (m *UserMutation) ResetFavoriteTags()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetHistories()
- func (m *UserMutation) ResetProgress()
- func (m *UserMutation) SetActive(b bool)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetOp(op Op)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- 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 ...user.OrderOption) *UserQuery
- func (uq *UserQuery) QueryFavoriteItems() *MetaQuery
- func (uq *UserQuery) QueryFavoriteTags() *TagQuery
- func (uq *UserQuery) QueryHistories() *HistoryQuery
- func (uq *UserQuery) QueryProgress() *ProgressQuery
- 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) WithFavoriteItems(opts ...func(*MetaQuery)) *UserQuery
- func (uq *UserQuery) WithFavoriteTags(opts ...func(*TagQuery)) *UserQuery
- func (uq *UserQuery) WithHistories(opts ...func(*HistoryQuery)) *UserQuery
- func (uq *UserQuery) WithProgress(opts ...func(*ProgressQuery)) *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) AddFavoriteItemIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddFavoriteItems(m ...*Meta) *UserUpdate
- func (uu *UserUpdate) AddFavoriteTagIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddFavoriteTags(t ...*Tag) *UserUpdate
- func (uu *UserUpdate) AddHistories(h ...*History) *UserUpdate
- func (uu *UserUpdate) AddHistoryIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddProgresIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddProgress(p ...*Progress) *UserUpdate
- func (uu *UserUpdate) ClearFavoriteItems() *UserUpdate
- func (uu *UserUpdate) ClearFavoriteTags() *UserUpdate
- func (uu *UserUpdate) ClearHistories() *UserUpdate
- func (uu *UserUpdate) ClearProgress() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveFavoriteItemIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveFavoriteItems(m ...*Meta) *UserUpdate
- func (uu *UserUpdate) RemoveFavoriteTagIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveFavoriteTags(t ...*Tag) *UserUpdate
- func (uu *UserUpdate) RemoveHistories(h ...*History) *UserUpdate
- func (uu *UserUpdate) RemoveHistoryIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveProgresIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveProgress(p ...*Progress) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetActive(b bool) *UserUpdate
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableActive(b *bool) *UserUpdate
- func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddFavoriteItemIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddFavoriteItems(m ...*Meta) *UserUpdateOne
- func (uuo *UserUpdateOne) AddFavoriteTagIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddFavoriteTags(t ...*Tag) *UserUpdateOne
- func (uuo *UserUpdateOne) AddHistories(h ...*History) *UserUpdateOne
- func (uuo *UserUpdateOne) AddHistoryIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddProgresIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddProgress(p ...*Progress) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearFavoriteItems() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearFavoriteTags() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearHistories() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearProgress() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveFavoriteItemIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveFavoriteItems(m ...*Meta) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveFavoriteTagIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveFavoriteTags(t ...*Tag) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveHistories(h ...*History) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveHistoryIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveProgresIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveProgress(p ...*Progress) *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) SetActive(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableActive(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type UserUpsert
- type UserUpsertBulk
- func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk
- func (u *UserUpsertBulk) Exec(ctx context.Context) error
- func (u *UserUpsertBulk) ExecX(ctx context.Context)
- func (u *UserUpsertBulk) Ignore() *UserUpsertBulk
- func (u *UserUpsertBulk) SetActive(v bool) *UserUpsertBulk
- func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk
- func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateActive() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk
- type UserUpsertOne
- func (u *UserUpsertOne) DoNothing() *UserUpsertOne
- func (u *UserUpsertOne) Exec(ctx context.Context) error
- func (u *UserUpsertOne) ExecX(ctx context.Context)
- func (u *UserUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *UserUpsertOne) IDX(ctx context.Context) int
- func (u *UserUpsertOne) Ignore() *UserUpsertOne
- func (u *UserUpsertOne) SetActive(v bool) *UserUpsertOne
- func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne
- func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne
- func (u *UserUpsertOne) UpdateActive() *UserUpsertOne
- func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne
- func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeHistory = "History" TypeMeta = "Meta" TypeProgress = "Progress" TypeTag = "Tag" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
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 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 Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // History is the client for interacting with the History builders. History *HistoryClient // Meta is the client for interacting with the Meta builders. Meta *MetaClient // Progress is the client for interacting with the Progress builders. Progress *ProgressClient // 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(). History. 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 History ¶
type History struct { // ID of the ent. ID int `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the HistoryQuery when eager-loading is set. Edges HistoryEdges `json:"edges"` // contains filtered or unexported fields }
History is the model entity for the History schema.
func (*History) Unwrap ¶
Unwrap unwraps the History 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 (*History) Update ¶
func (h *History) Update() *HistoryUpdateOne
Update returns a builder for updating this History. Note that you need to call History.Unwrap() before calling this method if this History was returned from a transaction, and the transaction was committed or rolled back.
type HistoryClient ¶
type HistoryClient struct {
// contains filtered or unexported fields
}
HistoryClient is a client for the History schema.
func NewHistoryClient ¶
func NewHistoryClient(c config) *HistoryClient
NewHistoryClient returns a client for the History from the given config.
func (*HistoryClient) Create ¶
func (c *HistoryClient) Create() *HistoryCreate
Create returns a builder for creating a History entity.
func (*HistoryClient) CreateBulk ¶
func (c *HistoryClient) CreateBulk(builders ...*HistoryCreate) *HistoryCreateBulk
CreateBulk returns a builder for creating a bulk of History entities.
func (*HistoryClient) Delete ¶
func (c *HistoryClient) Delete() *HistoryDelete
Delete returns a delete builder for History.
func (*HistoryClient) DeleteOne ¶
func (c *HistoryClient) DeleteOne(h *History) *HistoryDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*HistoryClient) DeleteOneID ¶
func (c *HistoryClient) DeleteOneID(id int) *HistoryDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*HistoryClient) GetX ¶
func (c *HistoryClient) GetX(ctx context.Context, id int) *History
GetX is like Get, but panics if an error occurs.
func (*HistoryClient) Hooks ¶
func (c *HistoryClient) Hooks() []Hook
Hooks returns the client hooks.
func (*HistoryClient) Intercept ¶
func (c *HistoryClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `history.Intercept(f(g(h())))`.
func (*HistoryClient) Interceptors ¶
func (c *HistoryClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*HistoryClient) MapCreateBulk ¶
func (c *HistoryClient) MapCreateBulk(slice any, setFunc func(*HistoryCreate, int)) *HistoryCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*HistoryClient) Query ¶
func (c *HistoryClient) Query() *HistoryQuery
Query returns a query builder for History.
func (*HistoryClient) QueryItem ¶
func (c *HistoryClient) QueryItem(h *History) *MetaQuery
QueryItem queries the item edge of a History.
func (*HistoryClient) QueryUser ¶
func (c *HistoryClient) QueryUser(h *History) *UserQuery
QueryUser queries the user edge of a History.
func (*HistoryClient) Update ¶
func (c *HistoryClient) Update() *HistoryUpdate
Update returns an update builder for History.
func (*HistoryClient) UpdateOne ¶
func (c *HistoryClient) UpdateOne(h *History) *HistoryUpdateOne
UpdateOne returns an update builder for the given entity.
func (*HistoryClient) UpdateOneID ¶
func (c *HistoryClient) UpdateOneID(id int) *HistoryUpdateOne
UpdateOneID returns an update builder for the given id.
func (*HistoryClient) Use ¶
func (c *HistoryClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `history.Hooks(f(g(h())))`.
type HistoryCreate ¶
type HistoryCreate struct {
// contains filtered or unexported fields
}
HistoryCreate is the builder for creating a History entity.
func (*HistoryCreate) Exec ¶
func (hc *HistoryCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*HistoryCreate) ExecX ¶
func (hc *HistoryCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*HistoryCreate) Mutation ¶
func (hc *HistoryCreate) Mutation() *HistoryMutation
Mutation returns the HistoryMutation object of the builder.
func (*HistoryCreate) OnConflict ¶
func (hc *HistoryCreate) OnConflict(opts ...sql.ConflictOption) *HistoryUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.History.Create(). SetCreateTime(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.HistoryUpsert) { SetCreateTime(v+v). }). Exec(ctx)
func (*HistoryCreate) OnConflictColumns ¶
func (hc *HistoryCreate) OnConflictColumns(columns ...string) *HistoryUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.History.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*HistoryCreate) Save ¶
func (hc *HistoryCreate) Save(ctx context.Context) (*History, error)
Save creates the History in the database.
func (*HistoryCreate) SaveX ¶
func (hc *HistoryCreate) SaveX(ctx context.Context) *History
SaveX calls Save and panics if Save returns an error.
func (*HistoryCreate) SetCreateTime ¶
func (hc *HistoryCreate) SetCreateTime(t time.Time) *HistoryCreate
SetCreateTime sets the "create_time" field.
func (*HistoryCreate) SetItem ¶
func (hc *HistoryCreate) SetItem(m *Meta) *HistoryCreate
SetItem sets the "item" edge to the Meta entity.
func (*HistoryCreate) SetItemID ¶
func (hc *HistoryCreate) SetItemID(id int) *HistoryCreate
SetItemID sets the "item" edge to the Meta entity by ID.
func (*HistoryCreate) SetNillableCreateTime ¶
func (hc *HistoryCreate) SetNillableCreateTime(t *time.Time) *HistoryCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*HistoryCreate) SetNillableItemID ¶
func (hc *HistoryCreate) SetNillableItemID(id *int) *HistoryCreate
SetNillableItemID sets the "item" edge to the Meta entity by ID if the given value is not nil.
func (*HistoryCreate) SetNillableUserID ¶
func (hc *HistoryCreate) SetNillableUserID(id *int) *HistoryCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*HistoryCreate) SetUser ¶
func (hc *HistoryCreate) SetUser(u *User) *HistoryCreate
SetUser sets the "user" edge to the User entity.
func (*HistoryCreate) SetUserID ¶
func (hc *HistoryCreate) SetUserID(id int) *HistoryCreate
SetUserID sets the "user" edge to the User entity by ID.
type HistoryCreateBulk ¶
type HistoryCreateBulk struct {
// contains filtered or unexported fields
}
HistoryCreateBulk is the builder for creating many History entities in bulk.
func (*HistoryCreateBulk) Exec ¶
func (hcb *HistoryCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*HistoryCreateBulk) ExecX ¶
func (hcb *HistoryCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*HistoryCreateBulk) OnConflict ¶
func (hcb *HistoryCreateBulk) OnConflict(opts ...sql.ConflictOption) *HistoryUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.History.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.HistoryUpsert) { SetCreateTime(v+v). }). Exec(ctx)
func (*HistoryCreateBulk) OnConflictColumns ¶
func (hcb *HistoryCreateBulk) OnConflictColumns(columns ...string) *HistoryUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.History.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type HistoryDelete ¶
type HistoryDelete struct {
// contains filtered or unexported fields
}
HistoryDelete is the builder for deleting a History entity.
func (*HistoryDelete) Exec ¶
func (hd *HistoryDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*HistoryDelete) ExecX ¶
func (hd *HistoryDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*HistoryDelete) Where ¶
func (hd *HistoryDelete) Where(ps ...predicate.History) *HistoryDelete
Where appends a list predicates to the HistoryDelete builder.
type HistoryDeleteOne ¶
type HistoryDeleteOne struct {
// contains filtered or unexported fields
}
HistoryDeleteOne is the builder for deleting a single History entity.
func (*HistoryDeleteOne) Exec ¶
func (hdo *HistoryDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*HistoryDeleteOne) ExecX ¶
func (hdo *HistoryDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*HistoryDeleteOne) Where ¶
func (hdo *HistoryDeleteOne) Where(ps ...predicate.History) *HistoryDeleteOne
Where appends a list predicates to the HistoryDelete builder.
type HistoryEdges ¶
type HistoryEdges struct { // Item holds the value of the item edge. Item *Meta `json:"item,omitempty"` // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
HistoryEdges holds the relations/edges for other nodes in the graph.
func (HistoryEdges) ItemOrErr ¶
func (e HistoryEdges) ItemOrErr() (*Meta, error)
ItemOrErr returns the Item value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (HistoryEdges) UserOrErr ¶
func (e HistoryEdges) 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 HistoryGroupBy ¶
type HistoryGroupBy struct {
// contains filtered or unexported fields
}
HistoryGroupBy is the group-by builder for History entities.
func (*HistoryGroupBy) Aggregate ¶
func (hgb *HistoryGroupBy) Aggregate(fns ...AggregateFunc) *HistoryGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*HistoryGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*HistoryGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*HistoryGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*HistoryGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*HistoryGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*HistoryGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*HistoryGroupBy) Scan ¶
func (hgb *HistoryGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*HistoryGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type HistoryMutation ¶
type HistoryMutation struct {
// contains filtered or unexported fields
}
HistoryMutation represents an operation that mutates the History nodes in the graph.
func (*HistoryMutation) AddField ¶
func (m *HistoryMutation) 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 (*HistoryMutation) AddedEdges ¶
func (m *HistoryMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*HistoryMutation) AddedField ¶
func (m *HistoryMutation) 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 (*HistoryMutation) AddedFields ¶
func (m *HistoryMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*HistoryMutation) AddedIDs ¶
func (m *HistoryMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*HistoryMutation) ClearEdge ¶
func (m *HistoryMutation) 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 (*HistoryMutation) ClearField ¶
func (m *HistoryMutation) 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 (*HistoryMutation) ClearItem ¶
func (m *HistoryMutation) ClearItem()
ClearItem clears the "item" edge to the Meta entity.
func (*HistoryMutation) ClearUser ¶
func (m *HistoryMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*HistoryMutation) ClearedEdges ¶
func (m *HistoryMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*HistoryMutation) ClearedFields ¶
func (m *HistoryMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (HistoryMutation) Client ¶
func (m HistoryMutation) 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 (*HistoryMutation) CreateTime ¶
func (m *HistoryMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*HistoryMutation) EdgeCleared ¶
func (m *HistoryMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*HistoryMutation) Field ¶
func (m *HistoryMutation) 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 (*HistoryMutation) FieldCleared ¶
func (m *HistoryMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*HistoryMutation) Fields ¶
func (m *HistoryMutation) 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 (*HistoryMutation) ID ¶
func (m *HistoryMutation) 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 (*HistoryMutation) IDs ¶
func (m *HistoryMutation) 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 (*HistoryMutation) ItemCleared ¶
func (m *HistoryMutation) ItemCleared() bool
ItemCleared reports if the "item" edge to the Meta entity was cleared.
func (*HistoryMutation) ItemID ¶
func (m *HistoryMutation) ItemID() (id int, exists bool)
ItemID returns the "item" edge ID in the mutation.
func (*HistoryMutation) ItemIDs ¶
func (m *HistoryMutation) ItemIDs() (ids []int)
ItemIDs returns the "item" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ItemID instead. It exists only for internal usage by the builders.
func (*HistoryMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the History entity. If the History 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 (*HistoryMutation) 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 (*HistoryMutation) RemovedEdges ¶
func (m *HistoryMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*HistoryMutation) RemovedIDs ¶
func (m *HistoryMutation) 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 (*HistoryMutation) ResetCreateTime ¶
func (m *HistoryMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*HistoryMutation) ResetEdge ¶
func (m *HistoryMutation) 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 (*HistoryMutation) ResetField ¶
func (m *HistoryMutation) 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 (*HistoryMutation) ResetItem ¶
func (m *HistoryMutation) ResetItem()
ResetItem resets all changes to the "item" edge.
func (*HistoryMutation) ResetUser ¶
func (m *HistoryMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*HistoryMutation) SetCreateTime ¶
func (m *HistoryMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*HistoryMutation) SetField ¶
func (m *HistoryMutation) 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 (*HistoryMutation) SetItemID ¶
func (m *HistoryMutation) SetItemID(id int)
SetItemID sets the "item" edge to the Meta entity by id.
func (*HistoryMutation) SetOp ¶
func (m *HistoryMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*HistoryMutation) SetUserID ¶
func (m *HistoryMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (HistoryMutation) Tx ¶
func (m HistoryMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*HistoryMutation) Type ¶
func (m *HistoryMutation) Type() string
Type returns the node type of this mutation (History).
func (*HistoryMutation) UserCleared ¶
func (m *HistoryMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*HistoryMutation) UserID ¶
func (m *HistoryMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*HistoryMutation) UserIDs ¶
func (m *HistoryMutation) 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 (*HistoryMutation) Where ¶
func (m *HistoryMutation) Where(ps ...predicate.History)
Where appends a list predicates to the HistoryMutation builder.
func (*HistoryMutation) WhereP ¶
func (m *HistoryMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the HistoryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type HistoryQuery ¶
type HistoryQuery struct {
// contains filtered or unexported fields
}
HistoryQuery is the builder for querying History entities.
func (*HistoryQuery) Aggregate ¶
func (hq *HistoryQuery) Aggregate(fns ...AggregateFunc) *HistorySelect
Aggregate returns a HistorySelect configured with the given aggregations.
func (*HistoryQuery) All ¶
func (hq *HistoryQuery) All(ctx context.Context) ([]*History, error)
All executes the query and returns a list of Histories.
func (*HistoryQuery) AllX ¶
func (hq *HistoryQuery) AllX(ctx context.Context) []*History
AllX is like All, but panics if an error occurs.
func (*HistoryQuery) Clone ¶
func (hq *HistoryQuery) Clone() *HistoryQuery
Clone returns a duplicate of the HistoryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*HistoryQuery) Count ¶
func (hq *HistoryQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*HistoryQuery) CountX ¶
func (hq *HistoryQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*HistoryQuery) Exist ¶
func (hq *HistoryQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*HistoryQuery) ExistX ¶
func (hq *HistoryQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*HistoryQuery) First ¶
func (hq *HistoryQuery) First(ctx context.Context) (*History, error)
First returns the first History entity from the query. Returns a *NotFoundError when no History was found.
func (*HistoryQuery) FirstID ¶
func (hq *HistoryQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first History ID from the query. Returns a *NotFoundError when no History ID was found.
func (*HistoryQuery) FirstIDX ¶
func (hq *HistoryQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*HistoryQuery) FirstX ¶
func (hq *HistoryQuery) FirstX(ctx context.Context) *History
FirstX is like First, but panics if an error occurs.
func (*HistoryQuery) GroupBy ¶
func (hq *HistoryQuery) GroupBy(field string, fields ...string) *HistoryGroupBy
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 { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.History.Query(). GroupBy(history.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*HistoryQuery) IDs ¶
func (hq *HistoryQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of History IDs.
func (*HistoryQuery) IDsX ¶
func (hq *HistoryQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*HistoryQuery) Limit ¶
func (hq *HistoryQuery) Limit(limit int) *HistoryQuery
Limit the number of records to be returned by this query.
func (*HistoryQuery) Offset ¶
func (hq *HistoryQuery) Offset(offset int) *HistoryQuery
Offset to start from.
func (*HistoryQuery) Only ¶
func (hq *HistoryQuery) Only(ctx context.Context) (*History, error)
Only returns a single History entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one History entity is found. Returns a *NotFoundError when no History entities are found.
func (*HistoryQuery) OnlyID ¶
func (hq *HistoryQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only History ID in the query. Returns a *NotSingularError when more than one History ID is found. Returns a *NotFoundError when no entities are found.
func (*HistoryQuery) OnlyIDX ¶
func (hq *HistoryQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*HistoryQuery) OnlyX ¶
func (hq *HistoryQuery) OnlyX(ctx context.Context) *History
OnlyX is like Only, but panics if an error occurs.
func (*HistoryQuery) Order ¶
func (hq *HistoryQuery) Order(o ...history.OrderOption) *HistoryQuery
Order specifies how the records should be ordered.
func (*HistoryQuery) QueryItem ¶
func (hq *HistoryQuery) QueryItem() *MetaQuery
QueryItem chains the current query on the "item" edge.
func (*HistoryQuery) QueryUser ¶
func (hq *HistoryQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*HistoryQuery) Select ¶
func (hq *HistoryQuery) Select(fields ...string) *HistorySelect
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 { CreateTime time.Time `json:"create_time,omitempty"` } client.History.Query(). Select(history.FieldCreateTime). Scan(ctx, &v)
func (*HistoryQuery) Unique ¶
func (hq *HistoryQuery) Unique(unique bool) *HistoryQuery
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 (*HistoryQuery) Where ¶
func (hq *HistoryQuery) Where(ps ...predicate.History) *HistoryQuery
Where adds a new predicate for the HistoryQuery builder.
func (*HistoryQuery) WithItem ¶
func (hq *HistoryQuery) WithItem(opts ...func(*MetaQuery)) *HistoryQuery
WithItem tells the query-builder to eager-load the nodes that are connected to the "item" edge. The optional arguments are used to configure the query builder of the edge.
func (*HistoryQuery) WithUser ¶
func (hq *HistoryQuery) WithUser(opts ...func(*UserQuery)) *HistoryQuery
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 HistorySelect ¶
type HistorySelect struct { *HistoryQuery // contains filtered or unexported fields }
HistorySelect is the builder for selecting fields of History entities.
func (*HistorySelect) Aggregate ¶
func (hs *HistorySelect) Aggregate(fns ...AggregateFunc) *HistorySelect
Aggregate adds the given aggregation functions to the selector query.
func (*HistorySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*HistorySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*HistorySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*HistorySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*HistorySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*HistorySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*HistorySelect) Scan ¶
func (hs *HistorySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*HistorySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type HistoryUpdate ¶
type HistoryUpdate struct {
// contains filtered or unexported fields
}
HistoryUpdate is the builder for updating History entities.
func (*HistoryUpdate) ClearItem ¶
func (hu *HistoryUpdate) ClearItem() *HistoryUpdate
ClearItem clears the "item" edge to the Meta entity.
func (*HistoryUpdate) ClearUser ¶
func (hu *HistoryUpdate) ClearUser() *HistoryUpdate
ClearUser clears the "user" edge to the User entity.
func (*HistoryUpdate) Exec ¶
func (hu *HistoryUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*HistoryUpdate) ExecX ¶
func (hu *HistoryUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*HistoryUpdate) Mutation ¶
func (hu *HistoryUpdate) Mutation() *HistoryMutation
Mutation returns the HistoryMutation object of the builder.
func (*HistoryUpdate) Save ¶
func (hu *HistoryUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*HistoryUpdate) SaveX ¶
func (hu *HistoryUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*HistoryUpdate) SetCreateTime ¶
func (hu *HistoryUpdate) SetCreateTime(t time.Time) *HistoryUpdate
SetCreateTime sets the "create_time" field.
func (*HistoryUpdate) SetItem ¶
func (hu *HistoryUpdate) SetItem(m *Meta) *HistoryUpdate
SetItem sets the "item" edge to the Meta entity.
func (*HistoryUpdate) SetItemID ¶
func (hu *HistoryUpdate) SetItemID(id int) *HistoryUpdate
SetItemID sets the "item" edge to the Meta entity by ID.
func (*HistoryUpdate) SetNillableCreateTime ¶
func (hu *HistoryUpdate) SetNillableCreateTime(t *time.Time) *HistoryUpdate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*HistoryUpdate) SetNillableItemID ¶
func (hu *HistoryUpdate) SetNillableItemID(id *int) *HistoryUpdate
SetNillableItemID sets the "item" edge to the Meta entity by ID if the given value is not nil.
func (*HistoryUpdate) SetNillableUserID ¶
func (hu *HistoryUpdate) SetNillableUserID(id *int) *HistoryUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*HistoryUpdate) SetUser ¶
func (hu *HistoryUpdate) SetUser(u *User) *HistoryUpdate
SetUser sets the "user" edge to the User entity.
func (*HistoryUpdate) SetUserID ¶
func (hu *HistoryUpdate) SetUserID(id int) *HistoryUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*HistoryUpdate) Where ¶
func (hu *HistoryUpdate) Where(ps ...predicate.History) *HistoryUpdate
Where appends a list predicates to the HistoryUpdate builder.
type HistoryUpdateOne ¶
type HistoryUpdateOne struct {
// contains filtered or unexported fields
}
HistoryUpdateOne is the builder for updating a single History entity.
func (*HistoryUpdateOne) ClearItem ¶
func (huo *HistoryUpdateOne) ClearItem() *HistoryUpdateOne
ClearItem clears the "item" edge to the Meta entity.
func (*HistoryUpdateOne) ClearUser ¶
func (huo *HistoryUpdateOne) ClearUser() *HistoryUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*HistoryUpdateOne) Exec ¶
func (huo *HistoryUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*HistoryUpdateOne) ExecX ¶
func (huo *HistoryUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*HistoryUpdateOne) Mutation ¶
func (huo *HistoryUpdateOne) Mutation() *HistoryMutation
Mutation returns the HistoryMutation object of the builder.
func (*HistoryUpdateOne) Save ¶
func (huo *HistoryUpdateOne) Save(ctx context.Context) (*History, error)
Save executes the query and returns the updated History entity.
func (*HistoryUpdateOne) SaveX ¶
func (huo *HistoryUpdateOne) SaveX(ctx context.Context) *History
SaveX is like Save, but panics if an error occurs.
func (*HistoryUpdateOne) Select ¶
func (huo *HistoryUpdateOne) Select(field string, fields ...string) *HistoryUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*HistoryUpdateOne) SetCreateTime ¶
func (huo *HistoryUpdateOne) SetCreateTime(t time.Time) *HistoryUpdateOne
SetCreateTime sets the "create_time" field.
func (*HistoryUpdateOne) SetItem ¶
func (huo *HistoryUpdateOne) SetItem(m *Meta) *HistoryUpdateOne
SetItem sets the "item" edge to the Meta entity.
func (*HistoryUpdateOne) SetItemID ¶
func (huo *HistoryUpdateOne) SetItemID(id int) *HistoryUpdateOne
SetItemID sets the "item" edge to the Meta entity by ID.
func (*HistoryUpdateOne) SetNillableCreateTime ¶
func (huo *HistoryUpdateOne) SetNillableCreateTime(t *time.Time) *HistoryUpdateOne
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*HistoryUpdateOne) SetNillableItemID ¶
func (huo *HistoryUpdateOne) SetNillableItemID(id *int) *HistoryUpdateOne
SetNillableItemID sets the "item" edge to the Meta entity by ID if the given value is not nil.
func (*HistoryUpdateOne) SetNillableUserID ¶
func (huo *HistoryUpdateOne) SetNillableUserID(id *int) *HistoryUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*HistoryUpdateOne) SetUser ¶
func (huo *HistoryUpdateOne) SetUser(u *User) *HistoryUpdateOne
SetUser sets the "user" edge to the User entity.
func (*HistoryUpdateOne) SetUserID ¶
func (huo *HistoryUpdateOne) SetUserID(id int) *HistoryUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*HistoryUpdateOne) Where ¶
func (huo *HistoryUpdateOne) Where(ps ...predicate.History) *HistoryUpdateOne
Where appends a list predicates to the HistoryUpdate builder.
type HistoryUpsert ¶
HistoryUpsert is the "OnConflict" setter.
func (*HistoryUpsert) SetCreateTime ¶
func (u *HistoryUpsert) SetCreateTime(v time.Time) *HistoryUpsert
SetCreateTime sets the "create_time" field.
func (*HistoryUpsert) UpdateCreateTime ¶
func (u *HistoryUpsert) UpdateCreateTime() *HistoryUpsert
UpdateCreateTime sets the "create_time" field to the value that was provided on create.
type HistoryUpsertBulk ¶
type HistoryUpsertBulk struct {
// contains filtered or unexported fields
}
HistoryUpsertBulk is the builder for "upsert"-ing a bulk of History nodes.
func (*HistoryUpsertBulk) DoNothing ¶
func (u *HistoryUpsertBulk) DoNothing() *HistoryUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*HistoryUpsertBulk) Exec ¶
func (u *HistoryUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*HistoryUpsertBulk) ExecX ¶
func (u *HistoryUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*HistoryUpsertBulk) Ignore ¶
func (u *HistoryUpsertBulk) Ignore() *HistoryUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.History.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*HistoryUpsertBulk) SetCreateTime ¶
func (u *HistoryUpsertBulk) SetCreateTime(v time.Time) *HistoryUpsertBulk
SetCreateTime sets the "create_time" field.
func (*HistoryUpsertBulk) Update ¶
func (u *HistoryUpsertBulk) Update(set func(*HistoryUpsert)) *HistoryUpsertBulk
Update allows overriding fields `UPDATE` values. See the HistoryCreateBulk.OnConflict documentation for more info.
func (*HistoryUpsertBulk) UpdateCreateTime ¶
func (u *HistoryUpsertBulk) UpdateCreateTime() *HistoryUpsertBulk
UpdateCreateTime sets the "create_time" field to the value that was provided on create.
func (*HistoryUpsertBulk) UpdateNewValues ¶
func (u *HistoryUpsertBulk) UpdateNewValues() *HistoryUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.History.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
type HistoryUpsertOne ¶
type HistoryUpsertOne struct {
// contains filtered or unexported fields
}
HistoryUpsertOne is the builder for "upsert"-ing
one History node.
func (*HistoryUpsertOne) DoNothing ¶
func (u *HistoryUpsertOne) DoNothing() *HistoryUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*HistoryUpsertOne) Exec ¶
func (u *HistoryUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*HistoryUpsertOne) ExecX ¶
func (u *HistoryUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*HistoryUpsertOne) ID ¶
func (u *HistoryUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*HistoryUpsertOne) IDX ¶
func (u *HistoryUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*HistoryUpsertOne) Ignore ¶
func (u *HistoryUpsertOne) Ignore() *HistoryUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.History.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*HistoryUpsertOne) SetCreateTime ¶
func (u *HistoryUpsertOne) SetCreateTime(v time.Time) *HistoryUpsertOne
SetCreateTime sets the "create_time" field.
func (*HistoryUpsertOne) Update ¶
func (u *HistoryUpsertOne) Update(set func(*HistoryUpsert)) *HistoryUpsertOne
Update allows overriding fields `UPDATE` values. See the HistoryCreate.OnConflict documentation for more info.
func (*HistoryUpsertOne) UpdateCreateTime ¶
func (u *HistoryUpsertOne) UpdateCreateTime() *HistoryUpsertOne
UpdateCreateTime sets the "create_time" field to the value that was provided on create.
func (*HistoryUpsertOne) UpdateNewValues ¶
func (u *HistoryUpsertOne) UpdateNewValues() *HistoryUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.History.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
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 Meta ¶
type Meta struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // Favorite holds the value of the "favorite" field. Favorite bool `json:"favorite,omitempty"` // FileIndices holds the value of the "file_indices" field. FileIndices []int `json:"file_indices,omitempty"` // Read holds the value of the "read" field. Read bool `json:"read,omitempty"` // Active holds the value of the "active" field. Active bool `json:"active,omitempty"` // Hidden holds the value of the "hidden" field. Hidden bool `json:"hidden,omitempty"` // ContainerType holds the value of the "container_type" field. ContainerType meta.ContainerType `json:"container_type,omitempty"` // ThumbnailIndex holds the value of the "thumbnail_index" field. ThumbnailIndex int `json:"thumbnail_index,omitempty"` // ThumbnailX holds the value of the "thumbnail_x" field. ThumbnailX int `json:"thumbnail_x,omitempty"` // ThumbnailY holds the value of the "thumbnail_y" field. ThumbnailY int `json:"thumbnail_y,omitempty"` // ThumbnailWidth holds the value of the "thumbnail_width" field. ThumbnailWidth int `json:"thumbnail_width,omitempty"` // ThumbnailHeight holds the value of the "thumbnail_height" field. ThumbnailHeight int `json:"thumbnail_height,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the MetaQuery when eager-loading is set. Edges MetaEdges `json:"edges"` // contains filtered or unexported fields }
Meta is the model entity for the Meta schema.
func (*Meta) QueryFavoriteOfUser ¶
QueryFavoriteOfUser queries the "favorite_of_user" edge of the Meta entity.
func (*Meta) QueryHistories ¶
func (m *Meta) QueryHistories() *HistoryQuery
QueryHistories queries the "histories" edge of the Meta entity.
func (*Meta) QueryProgress ¶
func (m *Meta) QueryProgress() *ProgressQuery
QueryProgress queries the "progress" edge of the Meta entity.
func (*Meta) Unwrap ¶
Unwrap unwraps the Meta 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 (*Meta) Update ¶
func (m *Meta) Update() *MetaUpdateOne
Update returns a builder for updating this Meta. Note that you need to call Meta.Unwrap() before calling this method if this Meta was returned from a transaction, and the transaction was committed or rolled back.
type MetaClient ¶
type MetaClient struct {
// contains filtered or unexported fields
}
MetaClient is a client for the Meta schema.
func NewMetaClient ¶
func NewMetaClient(c config) *MetaClient
NewMetaClient returns a client for the Meta from the given config.
func (*MetaClient) Create ¶
func (c *MetaClient) Create() *MetaCreate
Create returns a builder for creating a Meta entity.
func (*MetaClient) CreateBulk ¶
func (c *MetaClient) CreateBulk(builders ...*MetaCreate) *MetaCreateBulk
CreateBulk returns a builder for creating a bulk of Meta entities.
func (*MetaClient) Delete ¶
func (c *MetaClient) Delete() *MetaDelete
Delete returns a delete builder for Meta.
func (*MetaClient) DeleteOne ¶
func (c *MetaClient) DeleteOne(m *Meta) *MetaDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*MetaClient) DeleteOneID ¶
func (c *MetaClient) DeleteOneID(id int) *MetaDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*MetaClient) GetX ¶
func (c *MetaClient) GetX(ctx context.Context, id int) *Meta
GetX is like Get, but panics if an error occurs.
func (*MetaClient) Intercept ¶
func (c *MetaClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `meta.Intercept(f(g(h())))`.
func (*MetaClient) Interceptors ¶
func (c *MetaClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*MetaClient) MapCreateBulk ¶
func (c *MetaClient) MapCreateBulk(slice any, setFunc func(*MetaCreate, int)) *MetaCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*MetaClient) Query ¶
func (c *MetaClient) Query() *MetaQuery
Query returns a query builder for Meta.
func (*MetaClient) QueryFavoriteOfUser ¶
func (c *MetaClient) QueryFavoriteOfUser(m *Meta) *UserQuery
QueryFavoriteOfUser queries the favorite_of_user edge of a Meta.
func (*MetaClient) QueryHistories ¶
func (c *MetaClient) QueryHistories(m *Meta) *HistoryQuery
QueryHistories queries the histories edge of a Meta.
func (*MetaClient) QueryProgress ¶
func (c *MetaClient) QueryProgress(m *Meta) *ProgressQuery
QueryProgress queries the progress edge of a Meta.
func (*MetaClient) QueryTags ¶
func (c *MetaClient) QueryTags(m *Meta) *TagQuery
QueryTags queries the tags edge of a Meta.
func (*MetaClient) Update ¶
func (c *MetaClient) Update() *MetaUpdate
Update returns an update builder for Meta.
func (*MetaClient) UpdateOne ¶
func (c *MetaClient) UpdateOne(m *Meta) *MetaUpdateOne
UpdateOne returns an update builder for the given entity.
func (*MetaClient) UpdateOneID ¶
func (c *MetaClient) UpdateOneID(id int) *MetaUpdateOne
UpdateOneID returns an update builder for the given id.
func (*MetaClient) Use ¶
func (c *MetaClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `meta.Hooks(f(g(h())))`.
type MetaCreate ¶
type MetaCreate struct {
// contains filtered or unexported fields
}
MetaCreate is the builder for creating a Meta entity.
func (*MetaCreate) AddFavoriteOfUser ¶
func (mc *MetaCreate) AddFavoriteOfUser(u ...*User) *MetaCreate
AddFavoriteOfUser adds the "favorite_of_user" edges to the User entity.
func (*MetaCreate) AddFavoriteOfUserIDs ¶
func (mc *MetaCreate) AddFavoriteOfUserIDs(ids ...int) *MetaCreate
AddFavoriteOfUserIDs adds the "favorite_of_user" edge to the User entity by IDs.
func (*MetaCreate) AddHistories ¶
func (mc *MetaCreate) AddHistories(h ...*History) *MetaCreate
AddHistories adds the "histories" edges to the History entity.
func (*MetaCreate) AddHistoryIDs ¶
func (mc *MetaCreate) AddHistoryIDs(ids ...int) *MetaCreate
AddHistoryIDs adds the "histories" edge to the History entity by IDs.
func (*MetaCreate) AddProgresIDs ¶
func (mc *MetaCreate) AddProgresIDs(ids ...int) *MetaCreate
AddProgresIDs adds the "progress" edge to the Progress entity by IDs.
func (*MetaCreate) AddProgress ¶
func (mc *MetaCreate) AddProgress(p ...*Progress) *MetaCreate
AddProgress adds the "progress" edges to the Progress entity.
func (*MetaCreate) AddTagIDs ¶
func (mc *MetaCreate) AddTagIDs(ids ...int) *MetaCreate
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*MetaCreate) AddTags ¶
func (mc *MetaCreate) AddTags(t ...*Tag) *MetaCreate
AddTags adds the "tags" edges to the Tag entity.
func (*MetaCreate) Exec ¶
func (mc *MetaCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*MetaCreate) ExecX ¶
func (mc *MetaCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MetaCreate) Mutation ¶
func (mc *MetaCreate) Mutation() *MetaMutation
Mutation returns the MetaMutation object of the builder.
func (*MetaCreate) OnConflict ¶
func (mc *MetaCreate) OnConflict(opts ...sql.ConflictOption) *MetaUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Meta.Create(). SetName(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.MetaUpsert) { SetName(v+v). }). Exec(ctx)
func (*MetaCreate) OnConflictColumns ¶
func (mc *MetaCreate) OnConflictColumns(columns ...string) *MetaUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Meta.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*MetaCreate) Save ¶
func (mc *MetaCreate) Save(ctx context.Context) (*Meta, error)
Save creates the Meta in the database.
func (*MetaCreate) SaveX ¶
func (mc *MetaCreate) SaveX(ctx context.Context) *Meta
SaveX calls Save and panics if Save returns an error.
func (*MetaCreate) SetActive ¶
func (mc *MetaCreate) SetActive(b bool) *MetaCreate
SetActive sets the "active" field.
func (*MetaCreate) SetContainerType ¶
func (mc *MetaCreate) SetContainerType(mt meta.ContainerType) *MetaCreate
SetContainerType sets the "container_type" field.
func (*MetaCreate) SetCreateTime ¶
func (mc *MetaCreate) SetCreateTime(t time.Time) *MetaCreate
SetCreateTime sets the "create_time" field.
func (*MetaCreate) SetFavorite ¶
func (mc *MetaCreate) SetFavorite(b bool) *MetaCreate
SetFavorite sets the "favorite" field.
func (*MetaCreate) SetFileIndices ¶
func (mc *MetaCreate) SetFileIndices(i []int) *MetaCreate
SetFileIndices sets the "file_indices" field.
func (*MetaCreate) SetHidden ¶
func (mc *MetaCreate) SetHidden(b bool) *MetaCreate
SetHidden sets the "hidden" field.
func (*MetaCreate) SetName ¶
func (mc *MetaCreate) SetName(s string) *MetaCreate
SetName sets the "name" field.
func (*MetaCreate) SetNillableActive ¶
func (mc *MetaCreate) SetNillableActive(b *bool) *MetaCreate
SetNillableActive sets the "active" field if the given value is not nil.
func (*MetaCreate) SetNillableContainerType ¶
func (mc *MetaCreate) SetNillableContainerType(mt *meta.ContainerType) *MetaCreate
SetNillableContainerType sets the "container_type" field if the given value is not nil.
func (*MetaCreate) SetNillableCreateTime ¶
func (mc *MetaCreate) SetNillableCreateTime(t *time.Time) *MetaCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*MetaCreate) SetNillableFavorite ¶
func (mc *MetaCreate) SetNillableFavorite(b *bool) *MetaCreate
SetNillableFavorite sets the "favorite" field if the given value is not nil.
func (*MetaCreate) SetNillableHidden ¶
func (mc *MetaCreate) SetNillableHidden(b *bool) *MetaCreate
SetNillableHidden sets the "hidden" field if the given value is not nil.
func (*MetaCreate) SetNillableRead ¶
func (mc *MetaCreate) SetNillableRead(b *bool) *MetaCreate
SetNillableRead sets the "read" field if the given value is not nil.
func (*MetaCreate) SetNillableThumbnailHeight ¶
func (mc *MetaCreate) SetNillableThumbnailHeight(i *int) *MetaCreate
SetNillableThumbnailHeight sets the "thumbnail_height" field if the given value is not nil.
func (*MetaCreate) SetNillableThumbnailIndex ¶
func (mc *MetaCreate) SetNillableThumbnailIndex(i *int) *MetaCreate
SetNillableThumbnailIndex sets the "thumbnail_index" field if the given value is not nil.
func (*MetaCreate) SetNillableThumbnailWidth ¶
func (mc *MetaCreate) SetNillableThumbnailWidth(i *int) *MetaCreate
SetNillableThumbnailWidth sets the "thumbnail_width" field if the given value is not nil.
func (*MetaCreate) SetNillableThumbnailX ¶
func (mc *MetaCreate) SetNillableThumbnailX(i *int) *MetaCreate
SetNillableThumbnailX sets the "thumbnail_x" field if the given value is not nil.
func (*MetaCreate) SetNillableThumbnailY ¶
func (mc *MetaCreate) SetNillableThumbnailY(i *int) *MetaCreate
SetNillableThumbnailY sets the "thumbnail_y" field if the given value is not nil.
func (*MetaCreate) SetRead ¶
func (mc *MetaCreate) SetRead(b bool) *MetaCreate
SetRead sets the "read" field.
func (*MetaCreate) SetThumbnailHeight ¶
func (mc *MetaCreate) SetThumbnailHeight(i int) *MetaCreate
SetThumbnailHeight sets the "thumbnail_height" field.
func (*MetaCreate) SetThumbnailIndex ¶
func (mc *MetaCreate) SetThumbnailIndex(i int) *MetaCreate
SetThumbnailIndex sets the "thumbnail_index" field.
func (*MetaCreate) SetThumbnailWidth ¶
func (mc *MetaCreate) SetThumbnailWidth(i int) *MetaCreate
SetThumbnailWidth sets the "thumbnail_width" field.
func (*MetaCreate) SetThumbnailX ¶
func (mc *MetaCreate) SetThumbnailX(i int) *MetaCreate
SetThumbnailX sets the "thumbnail_x" field.
func (*MetaCreate) SetThumbnailY ¶
func (mc *MetaCreate) SetThumbnailY(i int) *MetaCreate
SetThumbnailY sets the "thumbnail_y" field.
type MetaCreateBulk ¶
type MetaCreateBulk struct {
// contains filtered or unexported fields
}
MetaCreateBulk is the builder for creating many Meta entities in bulk.
func (*MetaCreateBulk) Exec ¶
func (mcb *MetaCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*MetaCreateBulk) ExecX ¶
func (mcb *MetaCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MetaCreateBulk) OnConflict ¶
func (mcb *MetaCreateBulk) OnConflict(opts ...sql.ConflictOption) *MetaUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Meta.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.MetaUpsert) { SetName(v+v). }). Exec(ctx)
func (*MetaCreateBulk) OnConflictColumns ¶
func (mcb *MetaCreateBulk) OnConflictColumns(columns ...string) *MetaUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Meta.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type MetaDelete ¶
type MetaDelete struct {
// contains filtered or unexported fields
}
MetaDelete is the builder for deleting a Meta entity.
func (*MetaDelete) Exec ¶
func (md *MetaDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*MetaDelete) ExecX ¶
func (md *MetaDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*MetaDelete) Where ¶
func (md *MetaDelete) Where(ps ...predicate.Meta) *MetaDelete
Where appends a list predicates to the MetaDelete builder.
type MetaDeleteOne ¶
type MetaDeleteOne struct {
// contains filtered or unexported fields
}
MetaDeleteOne is the builder for deleting a single Meta entity.
func (*MetaDeleteOne) Exec ¶
func (mdo *MetaDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*MetaDeleteOne) ExecX ¶
func (mdo *MetaDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MetaDeleteOne) Where ¶
func (mdo *MetaDeleteOne) Where(ps ...predicate.Meta) *MetaDeleteOne
Where appends a list predicates to the MetaDelete builder.
type MetaEdges ¶
type MetaEdges struct { // Tags holds the value of the tags edge. Tags []*Tag `json:"tags,omitempty"` // Histories holds the value of the histories edge. Histories []*History `json:"histories,omitempty"` // FavoriteOfUser holds the value of the favorite_of_user edge. FavoriteOfUser []*User `json:"favorite_of_user,omitempty"` // Progress holds the value of the progress edge. Progress []*Progress `json:"progress,omitempty"` // contains filtered or unexported fields }
MetaEdges holds the relations/edges for other nodes in the graph.
func (MetaEdges) FavoriteOfUserOrErr ¶
FavoriteOfUserOrErr returns the FavoriteOfUser value or an error if the edge was not loaded in eager-loading.
func (MetaEdges) HistoriesOrErr ¶
HistoriesOrErr returns the Histories value or an error if the edge was not loaded in eager-loading.
func (MetaEdges) ProgressOrErr ¶
ProgressOrErr returns the Progress value or an error if the edge was not loaded in eager-loading.
type MetaGroupBy ¶
type MetaGroupBy struct {
// contains filtered or unexported fields
}
MetaGroupBy is the group-by builder for Meta entities.
func (*MetaGroupBy) Aggregate ¶
func (mgb *MetaGroupBy) Aggregate(fns ...AggregateFunc) *MetaGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*MetaGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MetaGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MetaGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MetaGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MetaGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MetaGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MetaGroupBy) Scan ¶
func (mgb *MetaGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MetaGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MetaMutation ¶
type MetaMutation struct {
// contains filtered or unexported fields
}
MetaMutation represents an operation that mutates the Meta nodes in the graph.
func (*MetaMutation) Active ¶
func (m *MetaMutation) Active() (r bool, exists bool)
Active returns the value of the "active" field in the mutation.
func (*MetaMutation) AddFavoriteOfUserIDs ¶
func (m *MetaMutation) AddFavoriteOfUserIDs(ids ...int)
AddFavoriteOfUserIDs adds the "favorite_of_user" edge to the User entity by ids.
func (*MetaMutation) AddField ¶
func (m *MetaMutation) 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 (*MetaMutation) AddHistoryIDs ¶
func (m *MetaMutation) AddHistoryIDs(ids ...int)
AddHistoryIDs adds the "histories" edge to the History entity by ids.
func (*MetaMutation) AddProgresIDs ¶
func (m *MetaMutation) AddProgresIDs(ids ...int)
AddProgresIDs adds the "progress" edge to the Progress entity by ids.
func (*MetaMutation) AddTagIDs ¶
func (m *MetaMutation) AddTagIDs(ids ...int)
AddTagIDs adds the "tags" edge to the Tag entity by ids.
func (*MetaMutation) AddThumbnailHeight ¶
func (m *MetaMutation) AddThumbnailHeight(i int)
AddThumbnailHeight adds i to the "thumbnail_height" field.
func (*MetaMutation) AddThumbnailIndex ¶
func (m *MetaMutation) AddThumbnailIndex(i int)
AddThumbnailIndex adds i to the "thumbnail_index" field.
func (*MetaMutation) AddThumbnailWidth ¶
func (m *MetaMutation) AddThumbnailWidth(i int)
AddThumbnailWidth adds i to the "thumbnail_width" field.
func (*MetaMutation) AddThumbnailX ¶
func (m *MetaMutation) AddThumbnailX(i int)
AddThumbnailX adds i to the "thumbnail_x" field.
func (*MetaMutation) AddThumbnailY ¶
func (m *MetaMutation) AddThumbnailY(i int)
AddThumbnailY adds i to the "thumbnail_y" field.
func (*MetaMutation) AddedEdges ¶
func (m *MetaMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*MetaMutation) AddedField ¶
func (m *MetaMutation) 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 (*MetaMutation) AddedFields ¶
func (m *MetaMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*MetaMutation) AddedIDs ¶
func (m *MetaMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*MetaMutation) AddedThumbnailHeight ¶
func (m *MetaMutation) AddedThumbnailHeight() (r int, exists bool)
AddedThumbnailHeight returns the value that was added to the "thumbnail_height" field in this mutation.
func (*MetaMutation) AddedThumbnailIndex ¶
func (m *MetaMutation) AddedThumbnailIndex() (r int, exists bool)
AddedThumbnailIndex returns the value that was added to the "thumbnail_index" field in this mutation.
func (*MetaMutation) AddedThumbnailWidth ¶
func (m *MetaMutation) AddedThumbnailWidth() (r int, exists bool)
AddedThumbnailWidth returns the value that was added to the "thumbnail_width" field in this mutation.
func (*MetaMutation) AddedThumbnailX ¶
func (m *MetaMutation) AddedThumbnailX() (r int, exists bool)
AddedThumbnailX returns the value that was added to the "thumbnail_x" field in this mutation.
func (*MetaMutation) AddedThumbnailY ¶
func (m *MetaMutation) AddedThumbnailY() (r int, exists bool)
AddedThumbnailY returns the value that was added to the "thumbnail_y" field in this mutation.
func (*MetaMutation) AppendFileIndices ¶
func (m *MetaMutation) AppendFileIndices(i []int)
AppendFileIndices adds i to the "file_indices" field.
func (*MetaMutation) AppendedFileIndices ¶
func (m *MetaMutation) AppendedFileIndices() ([]int, bool)
AppendedFileIndices returns the list of values that were appended to the "file_indices" field in this mutation.
func (*MetaMutation) ClearEdge ¶
func (m *MetaMutation) 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 (*MetaMutation) ClearFavoriteOfUser ¶
func (m *MetaMutation) ClearFavoriteOfUser()
ClearFavoriteOfUser clears the "favorite_of_user" edge to the User entity.
func (*MetaMutation) ClearField ¶
func (m *MetaMutation) 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 (*MetaMutation) ClearHistories ¶
func (m *MetaMutation) ClearHistories()
ClearHistories clears the "histories" edge to the History entity.
func (*MetaMutation) ClearProgress ¶
func (m *MetaMutation) ClearProgress()
ClearProgress clears the "progress" edge to the Progress entity.
func (*MetaMutation) ClearTags ¶
func (m *MetaMutation) ClearTags()
ClearTags clears the "tags" edge to the Tag entity.
func (*MetaMutation) ClearThumbnailHeight ¶
func (m *MetaMutation) ClearThumbnailHeight()
ClearThumbnailHeight clears the value of the "thumbnail_height" field.
func (*MetaMutation) ClearThumbnailIndex ¶
func (m *MetaMutation) ClearThumbnailIndex()
ClearThumbnailIndex clears the value of the "thumbnail_index" field.
func (*MetaMutation) ClearThumbnailWidth ¶
func (m *MetaMutation) ClearThumbnailWidth()
ClearThumbnailWidth clears the value of the "thumbnail_width" field.
func (*MetaMutation) ClearThumbnailX ¶
func (m *MetaMutation) ClearThumbnailX()
ClearThumbnailX clears the value of the "thumbnail_x" field.
func (*MetaMutation) ClearThumbnailY ¶
func (m *MetaMutation) ClearThumbnailY()
ClearThumbnailY clears the value of the "thumbnail_y" field.
func (*MetaMutation) ClearedEdges ¶
func (m *MetaMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*MetaMutation) ClearedFields ¶
func (m *MetaMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (MetaMutation) Client ¶
func (m MetaMutation) 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 (*MetaMutation) ContainerType ¶
func (m *MetaMutation) ContainerType() (r meta.ContainerType, exists bool)
ContainerType returns the value of the "container_type" field in the mutation.
func (*MetaMutation) CreateTime ¶
func (m *MetaMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*MetaMutation) EdgeCleared ¶
func (m *MetaMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*MetaMutation) Favorite ¶
func (m *MetaMutation) Favorite() (r bool, exists bool)
Favorite returns the value of the "favorite" field in the mutation.
func (*MetaMutation) FavoriteOfUserCleared ¶
func (m *MetaMutation) FavoriteOfUserCleared() bool
FavoriteOfUserCleared reports if the "favorite_of_user" edge to the User entity was cleared.
func (*MetaMutation) FavoriteOfUserIDs ¶
func (m *MetaMutation) FavoriteOfUserIDs() (ids []int)
FavoriteOfUserIDs returns the "favorite_of_user" edge IDs in the mutation.
func (*MetaMutation) Field ¶
func (m *MetaMutation) 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 (*MetaMutation) FieldCleared ¶
func (m *MetaMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*MetaMutation) Fields ¶
func (m *MetaMutation) 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 (*MetaMutation) FileIndices ¶
func (m *MetaMutation) FileIndices() (r []int, exists bool)
FileIndices returns the value of the "file_indices" field in the mutation.
func (*MetaMutation) Hidden ¶
func (m *MetaMutation) Hidden() (r bool, exists bool)
Hidden returns the value of the "hidden" field in the mutation.
func (*MetaMutation) HistoriesCleared ¶
func (m *MetaMutation) HistoriesCleared() bool
HistoriesCleared reports if the "histories" edge to the History entity was cleared.
func (*MetaMutation) HistoriesIDs ¶
func (m *MetaMutation) HistoriesIDs() (ids []int)
HistoriesIDs returns the "histories" edge IDs in the mutation.
func (*MetaMutation) ID ¶
func (m *MetaMutation) 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 (*MetaMutation) IDs ¶
func (m *MetaMutation) 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 (*MetaMutation) Name ¶
func (m *MetaMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*MetaMutation) OldActive ¶
func (m *MetaMutation) OldActive(ctx context.Context) (v bool, err error)
OldActive returns the old "active" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldContainerType ¶
func (m *MetaMutation) OldContainerType(ctx context.Context) (v meta.ContainerType, err error)
OldContainerType returns the old "container_type" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldFavorite ¶
func (m *MetaMutation) OldFavorite(ctx context.Context) (v bool, err error)
OldFavorite returns the old "favorite" field's value of the Meta entity. If the Meta 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 (*MetaMutation) 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 (*MetaMutation) OldFileIndices ¶
func (m *MetaMutation) OldFileIndices(ctx context.Context) (v []int, err error)
OldFileIndices returns the old "file_indices" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldHidden ¶
func (m *MetaMutation) OldHidden(ctx context.Context) (v bool, err error)
OldHidden returns the old "hidden" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldName ¶
func (m *MetaMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldRead ¶
func (m *MetaMutation) OldRead(ctx context.Context) (v bool, err error)
OldRead returns the old "read" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldThumbnailHeight ¶
func (m *MetaMutation) OldThumbnailHeight(ctx context.Context) (v int, err error)
OldThumbnailHeight returns the old "thumbnail_height" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldThumbnailIndex ¶
func (m *MetaMutation) OldThumbnailIndex(ctx context.Context) (v int, err error)
OldThumbnailIndex returns the old "thumbnail_index" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldThumbnailWidth ¶
func (m *MetaMutation) OldThumbnailWidth(ctx context.Context) (v int, err error)
OldThumbnailWidth returns the old "thumbnail_width" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldThumbnailX ¶
func (m *MetaMutation) OldThumbnailX(ctx context.Context) (v int, err error)
OldThumbnailX returns the old "thumbnail_x" field's value of the Meta entity. If the Meta 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 (*MetaMutation) OldThumbnailY ¶
func (m *MetaMutation) OldThumbnailY(ctx context.Context) (v int, err error)
OldThumbnailY returns the old "thumbnail_y" field's value of the Meta entity. If the Meta 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 (*MetaMutation) ProgressCleared ¶
func (m *MetaMutation) ProgressCleared() bool
ProgressCleared reports if the "progress" edge to the Progress entity was cleared.
func (*MetaMutation) ProgressIDs ¶
func (m *MetaMutation) ProgressIDs() (ids []int)
ProgressIDs returns the "progress" edge IDs in the mutation.
func (*MetaMutation) Read ¶
func (m *MetaMutation) Read() (r bool, exists bool)
Read returns the value of the "read" field in the mutation.
func (*MetaMutation) RemoveFavoriteOfUserIDs ¶
func (m *MetaMutation) RemoveFavoriteOfUserIDs(ids ...int)
RemoveFavoriteOfUserIDs removes the "favorite_of_user" edge to the User entity by IDs.
func (*MetaMutation) RemoveHistoryIDs ¶
func (m *MetaMutation) RemoveHistoryIDs(ids ...int)
RemoveHistoryIDs removes the "histories" edge to the History entity by IDs.
func (*MetaMutation) RemoveProgresIDs ¶
func (m *MetaMutation) RemoveProgresIDs(ids ...int)
RemoveProgresIDs removes the "progress" edge to the Progress entity by IDs.
func (*MetaMutation) RemoveTagIDs ¶
func (m *MetaMutation) RemoveTagIDs(ids ...int)
RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.
func (*MetaMutation) RemovedEdges ¶
func (m *MetaMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*MetaMutation) RemovedFavoriteOfUserIDs ¶
func (m *MetaMutation) RemovedFavoriteOfUserIDs() (ids []int)
RemovedFavoriteOfUser returns the removed IDs of the "favorite_of_user" edge to the User entity.
func (*MetaMutation) RemovedHistoriesIDs ¶
func (m *MetaMutation) RemovedHistoriesIDs() (ids []int)
RemovedHistories returns the removed IDs of the "histories" edge to the History entity.
func (*MetaMutation) RemovedIDs ¶
func (m *MetaMutation) 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 (*MetaMutation) RemovedProgressIDs ¶
func (m *MetaMutation) RemovedProgressIDs() (ids []int)
RemovedProgress returns the removed IDs of the "progress" edge to the Progress entity.
func (*MetaMutation) RemovedTagsIDs ¶
func (m *MetaMutation) RemovedTagsIDs() (ids []int)
RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.
func (*MetaMutation) ResetActive ¶
func (m *MetaMutation) ResetActive()
ResetActive resets all changes to the "active" field.
func (*MetaMutation) ResetContainerType ¶
func (m *MetaMutation) ResetContainerType()
ResetContainerType resets all changes to the "container_type" field.
func (*MetaMutation) ResetCreateTime ¶
func (m *MetaMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*MetaMutation) ResetEdge ¶
func (m *MetaMutation) 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 (*MetaMutation) ResetFavorite ¶
func (m *MetaMutation) ResetFavorite()
ResetFavorite resets all changes to the "favorite" field.
func (*MetaMutation) ResetFavoriteOfUser ¶
func (m *MetaMutation) ResetFavoriteOfUser()
ResetFavoriteOfUser resets all changes to the "favorite_of_user" edge.
func (*MetaMutation) ResetField ¶
func (m *MetaMutation) 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 (*MetaMutation) ResetFileIndices ¶
func (m *MetaMutation) ResetFileIndices()
ResetFileIndices resets all changes to the "file_indices" field.
func (*MetaMutation) ResetHidden ¶
func (m *MetaMutation) ResetHidden()
ResetHidden resets all changes to the "hidden" field.
func (*MetaMutation) ResetHistories ¶
func (m *MetaMutation) ResetHistories()
ResetHistories resets all changes to the "histories" edge.
func (*MetaMutation) ResetName ¶
func (m *MetaMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*MetaMutation) ResetProgress ¶
func (m *MetaMutation) ResetProgress()
ResetProgress resets all changes to the "progress" edge.
func (*MetaMutation) ResetRead ¶
func (m *MetaMutation) ResetRead()
ResetRead resets all changes to the "read" field.
func (*MetaMutation) ResetTags ¶
func (m *MetaMutation) ResetTags()
ResetTags resets all changes to the "tags" edge.
func (*MetaMutation) ResetThumbnailHeight ¶
func (m *MetaMutation) ResetThumbnailHeight()
ResetThumbnailHeight resets all changes to the "thumbnail_height" field.
func (*MetaMutation) ResetThumbnailIndex ¶
func (m *MetaMutation) ResetThumbnailIndex()
ResetThumbnailIndex resets all changes to the "thumbnail_index" field.
func (*MetaMutation) ResetThumbnailWidth ¶
func (m *MetaMutation) ResetThumbnailWidth()
ResetThumbnailWidth resets all changes to the "thumbnail_width" field.
func (*MetaMutation) ResetThumbnailX ¶
func (m *MetaMutation) ResetThumbnailX()
ResetThumbnailX resets all changes to the "thumbnail_x" field.
func (*MetaMutation) ResetThumbnailY ¶
func (m *MetaMutation) ResetThumbnailY()
ResetThumbnailY resets all changes to the "thumbnail_y" field.
func (*MetaMutation) SetActive ¶
func (m *MetaMutation) SetActive(b bool)
SetActive sets the "active" field.
func (*MetaMutation) SetContainerType ¶
func (m *MetaMutation) SetContainerType(mt meta.ContainerType)
SetContainerType sets the "container_type" field.
func (*MetaMutation) SetCreateTime ¶
func (m *MetaMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*MetaMutation) SetFavorite ¶
func (m *MetaMutation) SetFavorite(b bool)
SetFavorite sets the "favorite" field.
func (*MetaMutation) SetField ¶
func (m *MetaMutation) 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 (*MetaMutation) SetFileIndices ¶
func (m *MetaMutation) SetFileIndices(i []int)
SetFileIndices sets the "file_indices" field.
func (*MetaMutation) SetHidden ¶
func (m *MetaMutation) SetHidden(b bool)
SetHidden sets the "hidden" field.
func (*MetaMutation) SetName ¶
func (m *MetaMutation) SetName(s string)
SetName sets the "name" field.
func (*MetaMutation) SetOp ¶
func (m *MetaMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*MetaMutation) SetRead ¶
func (m *MetaMutation) SetRead(b bool)
SetRead sets the "read" field.
func (*MetaMutation) SetThumbnailHeight ¶
func (m *MetaMutation) SetThumbnailHeight(i int)
SetThumbnailHeight sets the "thumbnail_height" field.
func (*MetaMutation) SetThumbnailIndex ¶
func (m *MetaMutation) SetThumbnailIndex(i int)
SetThumbnailIndex sets the "thumbnail_index" field.
func (*MetaMutation) SetThumbnailWidth ¶
func (m *MetaMutation) SetThumbnailWidth(i int)
SetThumbnailWidth sets the "thumbnail_width" field.
func (*MetaMutation) SetThumbnailX ¶
func (m *MetaMutation) SetThumbnailX(i int)
SetThumbnailX sets the "thumbnail_x" field.
func (*MetaMutation) SetThumbnailY ¶
func (m *MetaMutation) SetThumbnailY(i int)
SetThumbnailY sets the "thumbnail_y" field.
func (*MetaMutation) TagsCleared ¶
func (m *MetaMutation) TagsCleared() bool
TagsCleared reports if the "tags" edge to the Tag entity was cleared.
func (*MetaMutation) TagsIDs ¶
func (m *MetaMutation) TagsIDs() (ids []int)
TagsIDs returns the "tags" edge IDs in the mutation.
func (*MetaMutation) ThumbnailHeight ¶
func (m *MetaMutation) ThumbnailHeight() (r int, exists bool)
ThumbnailHeight returns the value of the "thumbnail_height" field in the mutation.
func (*MetaMutation) ThumbnailHeightCleared ¶
func (m *MetaMutation) ThumbnailHeightCleared() bool
ThumbnailHeightCleared returns if the "thumbnail_height" field was cleared in this mutation.
func (*MetaMutation) ThumbnailIndex ¶
func (m *MetaMutation) ThumbnailIndex() (r int, exists bool)
ThumbnailIndex returns the value of the "thumbnail_index" field in the mutation.
func (*MetaMutation) ThumbnailIndexCleared ¶
func (m *MetaMutation) ThumbnailIndexCleared() bool
ThumbnailIndexCleared returns if the "thumbnail_index" field was cleared in this mutation.
func (*MetaMutation) ThumbnailWidth ¶
func (m *MetaMutation) ThumbnailWidth() (r int, exists bool)
ThumbnailWidth returns the value of the "thumbnail_width" field in the mutation.
func (*MetaMutation) ThumbnailWidthCleared ¶
func (m *MetaMutation) ThumbnailWidthCleared() bool
ThumbnailWidthCleared returns if the "thumbnail_width" field was cleared in this mutation.
func (*MetaMutation) ThumbnailX ¶
func (m *MetaMutation) ThumbnailX() (r int, exists bool)
ThumbnailX returns the value of the "thumbnail_x" field in the mutation.
func (*MetaMutation) ThumbnailXCleared ¶
func (m *MetaMutation) ThumbnailXCleared() bool
ThumbnailXCleared returns if the "thumbnail_x" field was cleared in this mutation.
func (*MetaMutation) ThumbnailY ¶
func (m *MetaMutation) ThumbnailY() (r int, exists bool)
ThumbnailY returns the value of the "thumbnail_y" field in the mutation.
func (*MetaMutation) ThumbnailYCleared ¶
func (m *MetaMutation) ThumbnailYCleared() bool
ThumbnailYCleared returns if the "thumbnail_y" field was cleared in this mutation.
func (MetaMutation) Tx ¶
func (m MetaMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*MetaMutation) Type ¶
func (m *MetaMutation) Type() string
Type returns the node type of this mutation (Meta).
func (*MetaMutation) Where ¶
func (m *MetaMutation) Where(ps ...predicate.Meta)
Where appends a list predicates to the MetaMutation builder.
func (*MetaMutation) WhereP ¶
func (m *MetaMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the MetaMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type MetaQuery ¶
type MetaQuery struct {
// contains filtered or unexported fields
}
MetaQuery is the builder for querying Meta entities.
func (*MetaQuery) Aggregate ¶
func (mq *MetaQuery) Aggregate(fns ...AggregateFunc) *MetaSelect
Aggregate returns a MetaSelect configured with the given aggregations.
func (*MetaQuery) Clone ¶
Clone returns a duplicate of the MetaQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*MetaQuery) First ¶
First returns the first Meta entity from the query. Returns a *NotFoundError when no Meta was found.
func (*MetaQuery) FirstID ¶
FirstID returns the first Meta ID from the query. Returns a *NotFoundError when no Meta ID was found.
func (*MetaQuery) GroupBy ¶
func (mq *MetaQuery) GroupBy(field string, fields ...string) *MetaGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Meta.Query(). GroupBy(meta.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*MetaQuery) Only ¶
Only returns a single Meta entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Meta entity is found. Returns a *NotFoundError when no Meta entities are found.
func (*MetaQuery) OnlyID ¶
OnlyID is like Only, but returns the only Meta ID in the query. Returns a *NotSingularError when more than one Meta ID is found. Returns a *NotFoundError when no entities are found.
func (*MetaQuery) Order ¶
func (mq *MetaQuery) Order(o ...meta.OrderOption) *MetaQuery
Order specifies how the records should be ordered.
func (*MetaQuery) QueryFavoriteOfUser ¶
QueryFavoriteOfUser chains the current query on the "favorite_of_user" edge.
func (*MetaQuery) QueryHistories ¶
func (mq *MetaQuery) QueryHistories() *HistoryQuery
QueryHistories chains the current query on the "histories" edge.
func (*MetaQuery) QueryProgress ¶
func (mq *MetaQuery) QueryProgress() *ProgressQuery
QueryProgress chains the current query on the "progress" edge.
func (*MetaQuery) Select ¶
func (mq *MetaQuery) Select(fields ...string) *MetaSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Meta.Query(). Select(meta.FieldName). Scan(ctx, &v)
func (*MetaQuery) 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 (*MetaQuery) WithFavoriteOfUser ¶
WithFavoriteOfUser tells the query-builder to eager-load the nodes that are connected to the "favorite_of_user" edge. The optional arguments are used to configure the query builder of the edge.
func (*MetaQuery) WithHistories ¶
func (mq *MetaQuery) WithHistories(opts ...func(*HistoryQuery)) *MetaQuery
WithHistories tells the query-builder to eager-load the nodes that are connected to the "histories" edge. The optional arguments are used to configure the query builder of the edge.
func (*MetaQuery) WithProgress ¶
func (mq *MetaQuery) WithProgress(opts ...func(*ProgressQuery)) *MetaQuery
WithProgress tells the query-builder to eager-load the nodes that are connected to the "progress" edge. The optional arguments are used to configure the query builder of the edge.
type MetaSelect ¶
type MetaSelect struct { *MetaQuery // contains filtered or unexported fields }
MetaSelect is the builder for selecting fields of Meta entities.
func (*MetaSelect) Aggregate ¶
func (ms *MetaSelect) Aggregate(fns ...AggregateFunc) *MetaSelect
Aggregate adds the given aggregation functions to the selector query.
func (*MetaSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MetaSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MetaSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MetaSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MetaSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MetaSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MetaSelect) Scan ¶
func (ms *MetaSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MetaSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MetaUpdate ¶
type MetaUpdate struct {
// contains filtered or unexported fields
}
MetaUpdate is the builder for updating Meta entities.
func (*MetaUpdate) AddFavoriteOfUser ¶
func (mu *MetaUpdate) AddFavoriteOfUser(u ...*User) *MetaUpdate
AddFavoriteOfUser adds the "favorite_of_user" edges to the User entity.
func (*MetaUpdate) AddFavoriteOfUserIDs ¶
func (mu *MetaUpdate) AddFavoriteOfUserIDs(ids ...int) *MetaUpdate
AddFavoriteOfUserIDs adds the "favorite_of_user" edge to the User entity by IDs.
func (*MetaUpdate) AddHistories ¶
func (mu *MetaUpdate) AddHistories(h ...*History) *MetaUpdate
AddHistories adds the "histories" edges to the History entity.
func (*MetaUpdate) AddHistoryIDs ¶
func (mu *MetaUpdate) AddHistoryIDs(ids ...int) *MetaUpdate
AddHistoryIDs adds the "histories" edge to the History entity by IDs.
func (*MetaUpdate) AddProgresIDs ¶
func (mu *MetaUpdate) AddProgresIDs(ids ...int) *MetaUpdate
AddProgresIDs adds the "progress" edge to the Progress entity by IDs.
func (*MetaUpdate) AddProgress ¶
func (mu *MetaUpdate) AddProgress(p ...*Progress) *MetaUpdate
AddProgress adds the "progress" edges to the Progress entity.
func (*MetaUpdate) AddTagIDs ¶
func (mu *MetaUpdate) AddTagIDs(ids ...int) *MetaUpdate
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*MetaUpdate) AddTags ¶
func (mu *MetaUpdate) AddTags(t ...*Tag) *MetaUpdate
AddTags adds the "tags" edges to the Tag entity.
func (*MetaUpdate) AddThumbnailHeight ¶
func (mu *MetaUpdate) AddThumbnailHeight(i int) *MetaUpdate
AddThumbnailHeight adds i to the "thumbnail_height" field.
func (*MetaUpdate) AddThumbnailIndex ¶
func (mu *MetaUpdate) AddThumbnailIndex(i int) *MetaUpdate
AddThumbnailIndex adds i to the "thumbnail_index" field.
func (*MetaUpdate) AddThumbnailWidth ¶
func (mu *MetaUpdate) AddThumbnailWidth(i int) *MetaUpdate
AddThumbnailWidth adds i to the "thumbnail_width" field.
func (*MetaUpdate) AddThumbnailX ¶
func (mu *MetaUpdate) AddThumbnailX(i int) *MetaUpdate
AddThumbnailX adds i to the "thumbnail_x" field.
func (*MetaUpdate) AddThumbnailY ¶
func (mu *MetaUpdate) AddThumbnailY(i int) *MetaUpdate
AddThumbnailY adds i to the "thumbnail_y" field.
func (*MetaUpdate) AppendFileIndices ¶
func (mu *MetaUpdate) AppendFileIndices(i []int) *MetaUpdate
AppendFileIndices appends i to the "file_indices" field.
func (*MetaUpdate) ClearFavoriteOfUser ¶
func (mu *MetaUpdate) ClearFavoriteOfUser() *MetaUpdate
ClearFavoriteOfUser clears all "favorite_of_user" edges to the User entity.
func (*MetaUpdate) ClearHistories ¶
func (mu *MetaUpdate) ClearHistories() *MetaUpdate
ClearHistories clears all "histories" edges to the History entity.
func (*MetaUpdate) ClearProgress ¶
func (mu *MetaUpdate) ClearProgress() *MetaUpdate
ClearProgress clears all "progress" edges to the Progress entity.
func (*MetaUpdate) ClearTags ¶
func (mu *MetaUpdate) ClearTags() *MetaUpdate
ClearTags clears all "tags" edges to the Tag entity.
func (*MetaUpdate) ClearThumbnailHeight ¶
func (mu *MetaUpdate) ClearThumbnailHeight() *MetaUpdate
ClearThumbnailHeight clears the value of the "thumbnail_height" field.
func (*MetaUpdate) ClearThumbnailIndex ¶
func (mu *MetaUpdate) ClearThumbnailIndex() *MetaUpdate
ClearThumbnailIndex clears the value of the "thumbnail_index" field.
func (*MetaUpdate) ClearThumbnailWidth ¶
func (mu *MetaUpdate) ClearThumbnailWidth() *MetaUpdate
ClearThumbnailWidth clears the value of the "thumbnail_width" field.
func (*MetaUpdate) ClearThumbnailX ¶
func (mu *MetaUpdate) ClearThumbnailX() *MetaUpdate
ClearThumbnailX clears the value of the "thumbnail_x" field.
func (*MetaUpdate) ClearThumbnailY ¶
func (mu *MetaUpdate) ClearThumbnailY() *MetaUpdate
ClearThumbnailY clears the value of the "thumbnail_y" field.
func (*MetaUpdate) Exec ¶
func (mu *MetaUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*MetaUpdate) ExecX ¶
func (mu *MetaUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MetaUpdate) Mutation ¶
func (mu *MetaUpdate) Mutation() *MetaMutation
Mutation returns the MetaMutation object of the builder.
func (*MetaUpdate) RemoveFavoriteOfUser ¶
func (mu *MetaUpdate) RemoveFavoriteOfUser(u ...*User) *MetaUpdate
RemoveFavoriteOfUser removes "favorite_of_user" edges to User entities.
func (*MetaUpdate) RemoveFavoriteOfUserIDs ¶
func (mu *MetaUpdate) RemoveFavoriteOfUserIDs(ids ...int) *MetaUpdate
RemoveFavoriteOfUserIDs removes the "favorite_of_user" edge to User entities by IDs.
func (*MetaUpdate) RemoveHistories ¶
func (mu *MetaUpdate) RemoveHistories(h ...*History) *MetaUpdate
RemoveHistories removes "histories" edges to History entities.
func (*MetaUpdate) RemoveHistoryIDs ¶
func (mu *MetaUpdate) RemoveHistoryIDs(ids ...int) *MetaUpdate
RemoveHistoryIDs removes the "histories" edge to History entities by IDs.
func (*MetaUpdate) RemoveProgresIDs ¶
func (mu *MetaUpdate) RemoveProgresIDs(ids ...int) *MetaUpdate
RemoveProgresIDs removes the "progress" edge to Progress entities by IDs.
func (*MetaUpdate) RemoveProgress ¶
func (mu *MetaUpdate) RemoveProgress(p ...*Progress) *MetaUpdate
RemoveProgress removes "progress" edges to Progress entities.
func (*MetaUpdate) RemoveTagIDs ¶
func (mu *MetaUpdate) RemoveTagIDs(ids ...int) *MetaUpdate
RemoveTagIDs removes the "tags" edge to Tag entities by IDs.
func (*MetaUpdate) RemoveTags ¶
func (mu *MetaUpdate) RemoveTags(t ...*Tag) *MetaUpdate
RemoveTags removes "tags" edges to Tag entities.
func (*MetaUpdate) Save ¶
func (mu *MetaUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*MetaUpdate) SaveX ¶
func (mu *MetaUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*MetaUpdate) SetActive ¶
func (mu *MetaUpdate) SetActive(b bool) *MetaUpdate
SetActive sets the "active" field.
func (*MetaUpdate) SetContainerType ¶
func (mu *MetaUpdate) SetContainerType(mt meta.ContainerType) *MetaUpdate
SetContainerType sets the "container_type" field.
func (*MetaUpdate) SetCreateTime ¶
func (mu *MetaUpdate) SetCreateTime(t time.Time) *MetaUpdate
SetCreateTime sets the "create_time" field.
func (*MetaUpdate) SetFavorite ¶
func (mu *MetaUpdate) SetFavorite(b bool) *MetaUpdate
SetFavorite sets the "favorite" field.
func (*MetaUpdate) SetFileIndices ¶
func (mu *MetaUpdate) SetFileIndices(i []int) *MetaUpdate
SetFileIndices sets the "file_indices" field.
func (*MetaUpdate) SetHidden ¶
func (mu *MetaUpdate) SetHidden(b bool) *MetaUpdate
SetHidden sets the "hidden" field.
func (*MetaUpdate) SetName ¶
func (mu *MetaUpdate) SetName(s string) *MetaUpdate
SetName sets the "name" field.
func (*MetaUpdate) SetNillableActive ¶
func (mu *MetaUpdate) SetNillableActive(b *bool) *MetaUpdate
SetNillableActive sets the "active" field if the given value is not nil.
func (*MetaUpdate) SetNillableContainerType ¶
func (mu *MetaUpdate) SetNillableContainerType(mt *meta.ContainerType) *MetaUpdate
SetNillableContainerType sets the "container_type" field if the given value is not nil.
func (*MetaUpdate) SetNillableCreateTime ¶
func (mu *MetaUpdate) SetNillableCreateTime(t *time.Time) *MetaUpdate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*MetaUpdate) SetNillableFavorite ¶
func (mu *MetaUpdate) SetNillableFavorite(b *bool) *MetaUpdate
SetNillableFavorite sets the "favorite" field if the given value is not nil.
func (*MetaUpdate) SetNillableHidden ¶
func (mu *MetaUpdate) SetNillableHidden(b *bool) *MetaUpdate
SetNillableHidden sets the "hidden" field if the given value is not nil.
func (*MetaUpdate) SetNillableName ¶
func (mu *MetaUpdate) SetNillableName(s *string) *MetaUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*MetaUpdate) SetNillableRead ¶
func (mu *MetaUpdate) SetNillableRead(b *bool) *MetaUpdate
SetNillableRead sets the "read" field if the given value is not nil.
func (*MetaUpdate) SetNillableThumbnailHeight ¶
func (mu *MetaUpdate) SetNillableThumbnailHeight(i *int) *MetaUpdate
SetNillableThumbnailHeight sets the "thumbnail_height" field if the given value is not nil.
func (*MetaUpdate) SetNillableThumbnailIndex ¶
func (mu *MetaUpdate) SetNillableThumbnailIndex(i *int) *MetaUpdate
SetNillableThumbnailIndex sets the "thumbnail_index" field if the given value is not nil.
func (*MetaUpdate) SetNillableThumbnailWidth ¶
func (mu *MetaUpdate) SetNillableThumbnailWidth(i *int) *MetaUpdate
SetNillableThumbnailWidth sets the "thumbnail_width" field if the given value is not nil.
func (*MetaUpdate) SetNillableThumbnailX ¶
func (mu *MetaUpdate) SetNillableThumbnailX(i *int) *MetaUpdate
SetNillableThumbnailX sets the "thumbnail_x" field if the given value is not nil.
func (*MetaUpdate) SetNillableThumbnailY ¶
func (mu *MetaUpdate) SetNillableThumbnailY(i *int) *MetaUpdate
SetNillableThumbnailY sets the "thumbnail_y" field if the given value is not nil.
func (*MetaUpdate) SetRead ¶
func (mu *MetaUpdate) SetRead(b bool) *MetaUpdate
SetRead sets the "read" field.
func (*MetaUpdate) SetThumbnailHeight ¶
func (mu *MetaUpdate) SetThumbnailHeight(i int) *MetaUpdate
SetThumbnailHeight sets the "thumbnail_height" field.
func (*MetaUpdate) SetThumbnailIndex ¶
func (mu *MetaUpdate) SetThumbnailIndex(i int) *MetaUpdate
SetThumbnailIndex sets the "thumbnail_index" field.
func (*MetaUpdate) SetThumbnailWidth ¶
func (mu *MetaUpdate) SetThumbnailWidth(i int) *MetaUpdate
SetThumbnailWidth sets the "thumbnail_width" field.
func (*MetaUpdate) SetThumbnailX ¶
func (mu *MetaUpdate) SetThumbnailX(i int) *MetaUpdate
SetThumbnailX sets the "thumbnail_x" field.
func (*MetaUpdate) SetThumbnailY ¶
func (mu *MetaUpdate) SetThumbnailY(i int) *MetaUpdate
SetThumbnailY sets the "thumbnail_y" field.
func (*MetaUpdate) Where ¶
func (mu *MetaUpdate) Where(ps ...predicate.Meta) *MetaUpdate
Where appends a list predicates to the MetaUpdate builder.
type MetaUpdateOne ¶
type MetaUpdateOne struct {
// contains filtered or unexported fields
}
MetaUpdateOne is the builder for updating a single Meta entity.
func (*MetaUpdateOne) AddFavoriteOfUser ¶
func (muo *MetaUpdateOne) AddFavoriteOfUser(u ...*User) *MetaUpdateOne
AddFavoriteOfUser adds the "favorite_of_user" edges to the User entity.
func (*MetaUpdateOne) AddFavoriteOfUserIDs ¶
func (muo *MetaUpdateOne) AddFavoriteOfUserIDs(ids ...int) *MetaUpdateOne
AddFavoriteOfUserIDs adds the "favorite_of_user" edge to the User entity by IDs.
func (*MetaUpdateOne) AddHistories ¶
func (muo *MetaUpdateOne) AddHistories(h ...*History) *MetaUpdateOne
AddHistories adds the "histories" edges to the History entity.
func (*MetaUpdateOne) AddHistoryIDs ¶
func (muo *MetaUpdateOne) AddHistoryIDs(ids ...int) *MetaUpdateOne
AddHistoryIDs adds the "histories" edge to the History entity by IDs.
func (*MetaUpdateOne) AddProgresIDs ¶
func (muo *MetaUpdateOne) AddProgresIDs(ids ...int) *MetaUpdateOne
AddProgresIDs adds the "progress" edge to the Progress entity by IDs.
func (*MetaUpdateOne) AddProgress ¶
func (muo *MetaUpdateOne) AddProgress(p ...*Progress) *MetaUpdateOne
AddProgress adds the "progress" edges to the Progress entity.
func (*MetaUpdateOne) AddTagIDs ¶
func (muo *MetaUpdateOne) AddTagIDs(ids ...int) *MetaUpdateOne
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*MetaUpdateOne) AddTags ¶
func (muo *MetaUpdateOne) AddTags(t ...*Tag) *MetaUpdateOne
AddTags adds the "tags" edges to the Tag entity.
func (*MetaUpdateOne) AddThumbnailHeight ¶
func (muo *MetaUpdateOne) AddThumbnailHeight(i int) *MetaUpdateOne
AddThumbnailHeight adds i to the "thumbnail_height" field.
func (*MetaUpdateOne) AddThumbnailIndex ¶
func (muo *MetaUpdateOne) AddThumbnailIndex(i int) *MetaUpdateOne
AddThumbnailIndex adds i to the "thumbnail_index" field.
func (*MetaUpdateOne) AddThumbnailWidth ¶
func (muo *MetaUpdateOne) AddThumbnailWidth(i int) *MetaUpdateOne
AddThumbnailWidth adds i to the "thumbnail_width" field.
func (*MetaUpdateOne) AddThumbnailX ¶
func (muo *MetaUpdateOne) AddThumbnailX(i int) *MetaUpdateOne
AddThumbnailX adds i to the "thumbnail_x" field.
func (*MetaUpdateOne) AddThumbnailY ¶
func (muo *MetaUpdateOne) AddThumbnailY(i int) *MetaUpdateOne
AddThumbnailY adds i to the "thumbnail_y" field.
func (*MetaUpdateOne) AppendFileIndices ¶
func (muo *MetaUpdateOne) AppendFileIndices(i []int) *MetaUpdateOne
AppendFileIndices appends i to the "file_indices" field.
func (*MetaUpdateOne) ClearFavoriteOfUser ¶
func (muo *MetaUpdateOne) ClearFavoriteOfUser() *MetaUpdateOne
ClearFavoriteOfUser clears all "favorite_of_user" edges to the User entity.
func (*MetaUpdateOne) ClearHistories ¶
func (muo *MetaUpdateOne) ClearHistories() *MetaUpdateOne
ClearHistories clears all "histories" edges to the History entity.
func (*MetaUpdateOne) ClearProgress ¶
func (muo *MetaUpdateOne) ClearProgress() *MetaUpdateOne
ClearProgress clears all "progress" edges to the Progress entity.
func (*MetaUpdateOne) ClearTags ¶
func (muo *MetaUpdateOne) ClearTags() *MetaUpdateOne
ClearTags clears all "tags" edges to the Tag entity.
func (*MetaUpdateOne) ClearThumbnailHeight ¶
func (muo *MetaUpdateOne) ClearThumbnailHeight() *MetaUpdateOne
ClearThumbnailHeight clears the value of the "thumbnail_height" field.
func (*MetaUpdateOne) ClearThumbnailIndex ¶
func (muo *MetaUpdateOne) ClearThumbnailIndex() *MetaUpdateOne
ClearThumbnailIndex clears the value of the "thumbnail_index" field.
func (*MetaUpdateOne) ClearThumbnailWidth ¶
func (muo *MetaUpdateOne) ClearThumbnailWidth() *MetaUpdateOne
ClearThumbnailWidth clears the value of the "thumbnail_width" field.
func (*MetaUpdateOne) ClearThumbnailX ¶
func (muo *MetaUpdateOne) ClearThumbnailX() *MetaUpdateOne
ClearThumbnailX clears the value of the "thumbnail_x" field.
func (*MetaUpdateOne) ClearThumbnailY ¶
func (muo *MetaUpdateOne) ClearThumbnailY() *MetaUpdateOne
ClearThumbnailY clears the value of the "thumbnail_y" field.
func (*MetaUpdateOne) Exec ¶
func (muo *MetaUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*MetaUpdateOne) ExecX ¶
func (muo *MetaUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MetaUpdateOne) Mutation ¶
func (muo *MetaUpdateOne) Mutation() *MetaMutation
Mutation returns the MetaMutation object of the builder.
func (*MetaUpdateOne) RemoveFavoriteOfUser ¶
func (muo *MetaUpdateOne) RemoveFavoriteOfUser(u ...*User) *MetaUpdateOne
RemoveFavoriteOfUser removes "favorite_of_user" edges to User entities.
func (*MetaUpdateOne) RemoveFavoriteOfUserIDs ¶
func (muo *MetaUpdateOne) RemoveFavoriteOfUserIDs(ids ...int) *MetaUpdateOne
RemoveFavoriteOfUserIDs removes the "favorite_of_user" edge to User entities by IDs.
func (*MetaUpdateOne) RemoveHistories ¶
func (muo *MetaUpdateOne) RemoveHistories(h ...*History) *MetaUpdateOne
RemoveHistories removes "histories" edges to History entities.
func (*MetaUpdateOne) RemoveHistoryIDs ¶
func (muo *MetaUpdateOne) RemoveHistoryIDs(ids ...int) *MetaUpdateOne
RemoveHistoryIDs removes the "histories" edge to History entities by IDs.
func (*MetaUpdateOne) RemoveProgresIDs ¶
func (muo *MetaUpdateOne) RemoveProgresIDs(ids ...int) *MetaUpdateOne
RemoveProgresIDs removes the "progress" edge to Progress entities by IDs.
func (*MetaUpdateOne) RemoveProgress ¶
func (muo *MetaUpdateOne) RemoveProgress(p ...*Progress) *MetaUpdateOne
RemoveProgress removes "progress" edges to Progress entities.
func (*MetaUpdateOne) RemoveTagIDs ¶
func (muo *MetaUpdateOne) RemoveTagIDs(ids ...int) *MetaUpdateOne
RemoveTagIDs removes the "tags" edge to Tag entities by IDs.
func (*MetaUpdateOne) RemoveTags ¶
func (muo *MetaUpdateOne) RemoveTags(t ...*Tag) *MetaUpdateOne
RemoveTags removes "tags" edges to Tag entities.
func (*MetaUpdateOne) Save ¶
func (muo *MetaUpdateOne) Save(ctx context.Context) (*Meta, error)
Save executes the query and returns the updated Meta entity.
func (*MetaUpdateOne) SaveX ¶
func (muo *MetaUpdateOne) SaveX(ctx context.Context) *Meta
SaveX is like Save, but panics if an error occurs.
func (*MetaUpdateOne) Select ¶
func (muo *MetaUpdateOne) Select(field string, fields ...string) *MetaUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*MetaUpdateOne) SetActive ¶
func (muo *MetaUpdateOne) SetActive(b bool) *MetaUpdateOne
SetActive sets the "active" field.
func (*MetaUpdateOne) SetContainerType ¶
func (muo *MetaUpdateOne) SetContainerType(mt meta.ContainerType) *MetaUpdateOne
SetContainerType sets the "container_type" field.
func (*MetaUpdateOne) SetCreateTime ¶
func (muo *MetaUpdateOne) SetCreateTime(t time.Time) *MetaUpdateOne
SetCreateTime sets the "create_time" field.
func (*MetaUpdateOne) SetFavorite ¶
func (muo *MetaUpdateOne) SetFavorite(b bool) *MetaUpdateOne
SetFavorite sets the "favorite" field.
func (*MetaUpdateOne) SetFileIndices ¶
func (muo *MetaUpdateOne) SetFileIndices(i []int) *MetaUpdateOne
SetFileIndices sets the "file_indices" field.
func (*MetaUpdateOne) SetHidden ¶
func (muo *MetaUpdateOne) SetHidden(b bool) *MetaUpdateOne
SetHidden sets the "hidden" field.
func (*MetaUpdateOne) SetName ¶
func (muo *MetaUpdateOne) SetName(s string) *MetaUpdateOne
SetName sets the "name" field.
func (*MetaUpdateOne) SetNillableActive ¶
func (muo *MetaUpdateOne) SetNillableActive(b *bool) *MetaUpdateOne
SetNillableActive sets the "active" field if the given value is not nil.
func (*MetaUpdateOne) SetNillableContainerType ¶
func (muo *MetaUpdateOne) SetNillableContainerType(mt *meta.ContainerType) *MetaUpdateOne
SetNillableContainerType sets the "container_type" field if the given value is not nil.
func (*MetaUpdateOne) SetNillableCreateTime ¶
func (muo *MetaUpdateOne) SetNillableCreateTime(t *time.Time) *MetaUpdateOne
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*MetaUpdateOne) SetNillableFavorite ¶
func (muo *MetaUpdateOne) SetNillableFavorite(b *bool) *MetaUpdateOne
SetNillableFavorite sets the "favorite" field if the given value is not nil.
func (*MetaUpdateOne) SetNillableHidden ¶
func (muo *MetaUpdateOne) SetNillableHidden(b *bool) *MetaUpdateOne
SetNillableHidden sets the "hidden" field if the given value is not nil.
func (*MetaUpdateOne) SetNillableName ¶
func (muo *MetaUpdateOne) SetNillableName(s *string) *MetaUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*MetaUpdateOne) SetNillableRead ¶
func (muo *MetaUpdateOne) SetNillableRead(b *bool) *MetaUpdateOne
SetNillableRead sets the "read" field if the given value is not nil.
func (*MetaUpdateOne) SetNillableThumbnailHeight ¶
func (muo *MetaUpdateOne) SetNillableThumbnailHeight(i *int) *MetaUpdateOne
SetNillableThumbnailHeight sets the "thumbnail_height" field if the given value is not nil.
func (*MetaUpdateOne) SetNillableThumbnailIndex ¶
func (muo *MetaUpdateOne) SetNillableThumbnailIndex(i *int) *MetaUpdateOne
SetNillableThumbnailIndex sets the "thumbnail_index" field if the given value is not nil.
func (*MetaUpdateOne) SetNillableThumbnailWidth ¶
func (muo *MetaUpdateOne) SetNillableThumbnailWidth(i *int) *MetaUpdateOne
SetNillableThumbnailWidth sets the "thumbnail_width" field if the given value is not nil.
func (*MetaUpdateOne) SetNillableThumbnailX ¶
func (muo *MetaUpdateOne) SetNillableThumbnailX(i *int) *MetaUpdateOne
SetNillableThumbnailX sets the "thumbnail_x" field if the given value is not nil.
func (*MetaUpdateOne) SetNillableThumbnailY ¶
func (muo *MetaUpdateOne) SetNillableThumbnailY(i *int) *MetaUpdateOne
SetNillableThumbnailY sets the "thumbnail_y" field if the given value is not nil.
func (*MetaUpdateOne) SetRead ¶
func (muo *MetaUpdateOne) SetRead(b bool) *MetaUpdateOne
SetRead sets the "read" field.
func (*MetaUpdateOne) SetThumbnailHeight ¶
func (muo *MetaUpdateOne) SetThumbnailHeight(i int) *MetaUpdateOne
SetThumbnailHeight sets the "thumbnail_height" field.
func (*MetaUpdateOne) SetThumbnailIndex ¶
func (muo *MetaUpdateOne) SetThumbnailIndex(i int) *MetaUpdateOne
SetThumbnailIndex sets the "thumbnail_index" field.
func (*MetaUpdateOne) SetThumbnailWidth ¶
func (muo *MetaUpdateOne) SetThumbnailWidth(i int) *MetaUpdateOne
SetThumbnailWidth sets the "thumbnail_width" field.
func (*MetaUpdateOne) SetThumbnailX ¶
func (muo *MetaUpdateOne) SetThumbnailX(i int) *MetaUpdateOne
SetThumbnailX sets the "thumbnail_x" field.
func (*MetaUpdateOne) SetThumbnailY ¶
func (muo *MetaUpdateOne) SetThumbnailY(i int) *MetaUpdateOne
SetThumbnailY sets the "thumbnail_y" field.
func (*MetaUpdateOne) Where ¶
func (muo *MetaUpdateOne) Where(ps ...predicate.Meta) *MetaUpdateOne
Where appends a list predicates to the MetaUpdate builder.
type MetaUpsert ¶
MetaUpsert is the "OnConflict" setter.
func (*MetaUpsert) AddThumbnailHeight ¶
func (u *MetaUpsert) AddThumbnailHeight(v int) *MetaUpsert
AddThumbnailHeight adds v to the "thumbnail_height" field.
func (*MetaUpsert) AddThumbnailIndex ¶
func (u *MetaUpsert) AddThumbnailIndex(v int) *MetaUpsert
AddThumbnailIndex adds v to the "thumbnail_index" field.
func (*MetaUpsert) AddThumbnailWidth ¶
func (u *MetaUpsert) AddThumbnailWidth(v int) *MetaUpsert
AddThumbnailWidth adds v to the "thumbnail_width" field.
func (*MetaUpsert) AddThumbnailX ¶
func (u *MetaUpsert) AddThumbnailX(v int) *MetaUpsert
AddThumbnailX adds v to the "thumbnail_x" field.
func (*MetaUpsert) AddThumbnailY ¶
func (u *MetaUpsert) AddThumbnailY(v int) *MetaUpsert
AddThumbnailY adds v to the "thumbnail_y" field.
func (*MetaUpsert) ClearThumbnailHeight ¶
func (u *MetaUpsert) ClearThumbnailHeight() *MetaUpsert
ClearThumbnailHeight clears the value of the "thumbnail_height" field.
func (*MetaUpsert) ClearThumbnailIndex ¶
func (u *MetaUpsert) ClearThumbnailIndex() *MetaUpsert
ClearThumbnailIndex clears the value of the "thumbnail_index" field.
func (*MetaUpsert) ClearThumbnailWidth ¶
func (u *MetaUpsert) ClearThumbnailWidth() *MetaUpsert
ClearThumbnailWidth clears the value of the "thumbnail_width" field.
func (*MetaUpsert) ClearThumbnailX ¶
func (u *MetaUpsert) ClearThumbnailX() *MetaUpsert
ClearThumbnailX clears the value of the "thumbnail_x" field.
func (*MetaUpsert) ClearThumbnailY ¶
func (u *MetaUpsert) ClearThumbnailY() *MetaUpsert
ClearThumbnailY clears the value of the "thumbnail_y" field.
func (*MetaUpsert) SetActive ¶
func (u *MetaUpsert) SetActive(v bool) *MetaUpsert
SetActive sets the "active" field.
func (*MetaUpsert) SetContainerType ¶
func (u *MetaUpsert) SetContainerType(v meta.ContainerType) *MetaUpsert
SetContainerType sets the "container_type" field.
func (*MetaUpsert) SetCreateTime ¶
func (u *MetaUpsert) SetCreateTime(v time.Time) *MetaUpsert
SetCreateTime sets the "create_time" field.
func (*MetaUpsert) SetFavorite ¶
func (u *MetaUpsert) SetFavorite(v bool) *MetaUpsert
SetFavorite sets the "favorite" field.
func (*MetaUpsert) SetFileIndices ¶
func (u *MetaUpsert) SetFileIndices(v []int) *MetaUpsert
SetFileIndices sets the "file_indices" field.
func (*MetaUpsert) SetHidden ¶
func (u *MetaUpsert) SetHidden(v bool) *MetaUpsert
SetHidden sets the "hidden" field.
func (*MetaUpsert) SetName ¶
func (u *MetaUpsert) SetName(v string) *MetaUpsert
SetName sets the "name" field.
func (*MetaUpsert) SetRead ¶
func (u *MetaUpsert) SetRead(v bool) *MetaUpsert
SetRead sets the "read" field.
func (*MetaUpsert) SetThumbnailHeight ¶
func (u *MetaUpsert) SetThumbnailHeight(v int) *MetaUpsert
SetThumbnailHeight sets the "thumbnail_height" field.
func (*MetaUpsert) SetThumbnailIndex ¶
func (u *MetaUpsert) SetThumbnailIndex(v int) *MetaUpsert
SetThumbnailIndex sets the "thumbnail_index" field.
func (*MetaUpsert) SetThumbnailWidth ¶
func (u *MetaUpsert) SetThumbnailWidth(v int) *MetaUpsert
SetThumbnailWidth sets the "thumbnail_width" field.
func (*MetaUpsert) SetThumbnailX ¶
func (u *MetaUpsert) SetThumbnailX(v int) *MetaUpsert
SetThumbnailX sets the "thumbnail_x" field.
func (*MetaUpsert) SetThumbnailY ¶
func (u *MetaUpsert) SetThumbnailY(v int) *MetaUpsert
SetThumbnailY sets the "thumbnail_y" field.
func (*MetaUpsert) UpdateActive ¶
func (u *MetaUpsert) UpdateActive() *MetaUpsert
UpdateActive sets the "active" field to the value that was provided on create.
func (*MetaUpsert) UpdateContainerType ¶
func (u *MetaUpsert) UpdateContainerType() *MetaUpsert
UpdateContainerType sets the "container_type" field to the value that was provided on create.
func (*MetaUpsert) UpdateCreateTime ¶
func (u *MetaUpsert) UpdateCreateTime() *MetaUpsert
UpdateCreateTime sets the "create_time" field to the value that was provided on create.
func (*MetaUpsert) UpdateFavorite ¶
func (u *MetaUpsert) UpdateFavorite() *MetaUpsert
UpdateFavorite sets the "favorite" field to the value that was provided on create.
func (*MetaUpsert) UpdateFileIndices ¶
func (u *MetaUpsert) UpdateFileIndices() *MetaUpsert
UpdateFileIndices sets the "file_indices" field to the value that was provided on create.
func (*MetaUpsert) UpdateHidden ¶
func (u *MetaUpsert) UpdateHidden() *MetaUpsert
UpdateHidden sets the "hidden" field to the value that was provided on create.
func (*MetaUpsert) UpdateName ¶
func (u *MetaUpsert) UpdateName() *MetaUpsert
UpdateName sets the "name" field to the value that was provided on create.
func (*MetaUpsert) UpdateRead ¶
func (u *MetaUpsert) UpdateRead() *MetaUpsert
UpdateRead sets the "read" field to the value that was provided on create.
func (*MetaUpsert) UpdateThumbnailHeight ¶
func (u *MetaUpsert) UpdateThumbnailHeight() *MetaUpsert
UpdateThumbnailHeight sets the "thumbnail_height" field to the value that was provided on create.
func (*MetaUpsert) UpdateThumbnailIndex ¶
func (u *MetaUpsert) UpdateThumbnailIndex() *MetaUpsert
UpdateThumbnailIndex sets the "thumbnail_index" field to the value that was provided on create.
func (*MetaUpsert) UpdateThumbnailWidth ¶
func (u *MetaUpsert) UpdateThumbnailWidth() *MetaUpsert
UpdateThumbnailWidth sets the "thumbnail_width" field to the value that was provided on create.
func (*MetaUpsert) UpdateThumbnailX ¶
func (u *MetaUpsert) UpdateThumbnailX() *MetaUpsert
UpdateThumbnailX sets the "thumbnail_x" field to the value that was provided on create.
func (*MetaUpsert) UpdateThumbnailY ¶
func (u *MetaUpsert) UpdateThumbnailY() *MetaUpsert
UpdateThumbnailY sets the "thumbnail_y" field to the value that was provided on create.
type MetaUpsertBulk ¶
type MetaUpsertBulk struct {
// contains filtered or unexported fields
}
MetaUpsertBulk is the builder for "upsert"-ing a bulk of Meta nodes.
func (*MetaUpsertBulk) AddThumbnailHeight ¶
func (u *MetaUpsertBulk) AddThumbnailHeight(v int) *MetaUpsertBulk
AddThumbnailHeight adds v to the "thumbnail_height" field.
func (*MetaUpsertBulk) AddThumbnailIndex ¶
func (u *MetaUpsertBulk) AddThumbnailIndex(v int) *MetaUpsertBulk
AddThumbnailIndex adds v to the "thumbnail_index" field.
func (*MetaUpsertBulk) AddThumbnailWidth ¶
func (u *MetaUpsertBulk) AddThumbnailWidth(v int) *MetaUpsertBulk
AddThumbnailWidth adds v to the "thumbnail_width" field.
func (*MetaUpsertBulk) AddThumbnailX ¶
func (u *MetaUpsertBulk) AddThumbnailX(v int) *MetaUpsertBulk
AddThumbnailX adds v to the "thumbnail_x" field.
func (*MetaUpsertBulk) AddThumbnailY ¶
func (u *MetaUpsertBulk) AddThumbnailY(v int) *MetaUpsertBulk
AddThumbnailY adds v to the "thumbnail_y" field.
func (*MetaUpsertBulk) ClearThumbnailHeight ¶
func (u *MetaUpsertBulk) ClearThumbnailHeight() *MetaUpsertBulk
ClearThumbnailHeight clears the value of the "thumbnail_height" field.
func (*MetaUpsertBulk) ClearThumbnailIndex ¶
func (u *MetaUpsertBulk) ClearThumbnailIndex() *MetaUpsertBulk
ClearThumbnailIndex clears the value of the "thumbnail_index" field.
func (*MetaUpsertBulk) ClearThumbnailWidth ¶
func (u *MetaUpsertBulk) ClearThumbnailWidth() *MetaUpsertBulk
ClearThumbnailWidth clears the value of the "thumbnail_width" field.
func (*MetaUpsertBulk) ClearThumbnailX ¶
func (u *MetaUpsertBulk) ClearThumbnailX() *MetaUpsertBulk
ClearThumbnailX clears the value of the "thumbnail_x" field.
func (*MetaUpsertBulk) ClearThumbnailY ¶
func (u *MetaUpsertBulk) ClearThumbnailY() *MetaUpsertBulk
ClearThumbnailY clears the value of the "thumbnail_y" field.
func (*MetaUpsertBulk) DoNothing ¶
func (u *MetaUpsertBulk) DoNothing() *MetaUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*MetaUpsertBulk) Exec ¶
func (u *MetaUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*MetaUpsertBulk) ExecX ¶
func (u *MetaUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MetaUpsertBulk) Ignore ¶
func (u *MetaUpsertBulk) Ignore() *MetaUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Meta.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*MetaUpsertBulk) SetActive ¶
func (u *MetaUpsertBulk) SetActive(v bool) *MetaUpsertBulk
SetActive sets the "active" field.
func (*MetaUpsertBulk) SetContainerType ¶
func (u *MetaUpsertBulk) SetContainerType(v meta.ContainerType) *MetaUpsertBulk
SetContainerType sets the "container_type" field.
func (*MetaUpsertBulk) SetCreateTime ¶
func (u *MetaUpsertBulk) SetCreateTime(v time.Time) *MetaUpsertBulk
SetCreateTime sets the "create_time" field.
func (*MetaUpsertBulk) SetFavorite ¶
func (u *MetaUpsertBulk) SetFavorite(v bool) *MetaUpsertBulk
SetFavorite sets the "favorite" field.
func (*MetaUpsertBulk) SetFileIndices ¶
func (u *MetaUpsertBulk) SetFileIndices(v []int) *MetaUpsertBulk
SetFileIndices sets the "file_indices" field.
func (*MetaUpsertBulk) SetHidden ¶
func (u *MetaUpsertBulk) SetHidden(v bool) *MetaUpsertBulk
SetHidden sets the "hidden" field.
func (*MetaUpsertBulk) SetName ¶
func (u *MetaUpsertBulk) SetName(v string) *MetaUpsertBulk
SetName sets the "name" field.
func (*MetaUpsertBulk) SetRead ¶
func (u *MetaUpsertBulk) SetRead(v bool) *MetaUpsertBulk
SetRead sets the "read" field.
func (*MetaUpsertBulk) SetThumbnailHeight ¶
func (u *MetaUpsertBulk) SetThumbnailHeight(v int) *MetaUpsertBulk
SetThumbnailHeight sets the "thumbnail_height" field.
func (*MetaUpsertBulk) SetThumbnailIndex ¶
func (u *MetaUpsertBulk) SetThumbnailIndex(v int) *MetaUpsertBulk
SetThumbnailIndex sets the "thumbnail_index" field.
func (*MetaUpsertBulk) SetThumbnailWidth ¶
func (u *MetaUpsertBulk) SetThumbnailWidth(v int) *MetaUpsertBulk
SetThumbnailWidth sets the "thumbnail_width" field.
func (*MetaUpsertBulk) SetThumbnailX ¶
func (u *MetaUpsertBulk) SetThumbnailX(v int) *MetaUpsertBulk
SetThumbnailX sets the "thumbnail_x" field.
func (*MetaUpsertBulk) SetThumbnailY ¶
func (u *MetaUpsertBulk) SetThumbnailY(v int) *MetaUpsertBulk
SetThumbnailY sets the "thumbnail_y" field.
func (*MetaUpsertBulk) Update ¶
func (u *MetaUpsertBulk) Update(set func(*MetaUpsert)) *MetaUpsertBulk
Update allows overriding fields `UPDATE` values. See the MetaCreateBulk.OnConflict documentation for more info.
func (*MetaUpsertBulk) UpdateActive ¶
func (u *MetaUpsertBulk) UpdateActive() *MetaUpsertBulk
UpdateActive sets the "active" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateContainerType ¶
func (u *MetaUpsertBulk) UpdateContainerType() *MetaUpsertBulk
UpdateContainerType sets the "container_type" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateCreateTime ¶
func (u *MetaUpsertBulk) UpdateCreateTime() *MetaUpsertBulk
UpdateCreateTime sets the "create_time" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateFavorite ¶
func (u *MetaUpsertBulk) UpdateFavorite() *MetaUpsertBulk
UpdateFavorite sets the "favorite" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateFileIndices ¶
func (u *MetaUpsertBulk) UpdateFileIndices() *MetaUpsertBulk
UpdateFileIndices sets the "file_indices" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateHidden ¶
func (u *MetaUpsertBulk) UpdateHidden() *MetaUpsertBulk
UpdateHidden sets the "hidden" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateName ¶
func (u *MetaUpsertBulk) UpdateName() *MetaUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateNewValues ¶
func (u *MetaUpsertBulk) UpdateNewValues() *MetaUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Meta.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*MetaUpsertBulk) UpdateRead ¶
func (u *MetaUpsertBulk) UpdateRead() *MetaUpsertBulk
UpdateRead sets the "read" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateThumbnailHeight ¶
func (u *MetaUpsertBulk) UpdateThumbnailHeight() *MetaUpsertBulk
UpdateThumbnailHeight sets the "thumbnail_height" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateThumbnailIndex ¶
func (u *MetaUpsertBulk) UpdateThumbnailIndex() *MetaUpsertBulk
UpdateThumbnailIndex sets the "thumbnail_index" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateThumbnailWidth ¶
func (u *MetaUpsertBulk) UpdateThumbnailWidth() *MetaUpsertBulk
UpdateThumbnailWidth sets the "thumbnail_width" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateThumbnailX ¶
func (u *MetaUpsertBulk) UpdateThumbnailX() *MetaUpsertBulk
UpdateThumbnailX sets the "thumbnail_x" field to the value that was provided on create.
func (*MetaUpsertBulk) UpdateThumbnailY ¶
func (u *MetaUpsertBulk) UpdateThumbnailY() *MetaUpsertBulk
UpdateThumbnailY sets the "thumbnail_y" field to the value that was provided on create.
type MetaUpsertOne ¶
type MetaUpsertOne struct {
// contains filtered or unexported fields
}
MetaUpsertOne is the builder for "upsert"-ing
one Meta node.
func (*MetaUpsertOne) AddThumbnailHeight ¶
func (u *MetaUpsertOne) AddThumbnailHeight(v int) *MetaUpsertOne
AddThumbnailHeight adds v to the "thumbnail_height" field.
func (*MetaUpsertOne) AddThumbnailIndex ¶
func (u *MetaUpsertOne) AddThumbnailIndex(v int) *MetaUpsertOne
AddThumbnailIndex adds v to the "thumbnail_index" field.
func (*MetaUpsertOne) AddThumbnailWidth ¶
func (u *MetaUpsertOne) AddThumbnailWidth(v int) *MetaUpsertOne
AddThumbnailWidth adds v to the "thumbnail_width" field.
func (*MetaUpsertOne) AddThumbnailX ¶
func (u *MetaUpsertOne) AddThumbnailX(v int) *MetaUpsertOne
AddThumbnailX adds v to the "thumbnail_x" field.
func (*MetaUpsertOne) AddThumbnailY ¶
func (u *MetaUpsertOne) AddThumbnailY(v int) *MetaUpsertOne
AddThumbnailY adds v to the "thumbnail_y" field.
func (*MetaUpsertOne) ClearThumbnailHeight ¶
func (u *MetaUpsertOne) ClearThumbnailHeight() *MetaUpsertOne
ClearThumbnailHeight clears the value of the "thumbnail_height" field.
func (*MetaUpsertOne) ClearThumbnailIndex ¶
func (u *MetaUpsertOne) ClearThumbnailIndex() *MetaUpsertOne
ClearThumbnailIndex clears the value of the "thumbnail_index" field.
func (*MetaUpsertOne) ClearThumbnailWidth ¶
func (u *MetaUpsertOne) ClearThumbnailWidth() *MetaUpsertOne
ClearThumbnailWidth clears the value of the "thumbnail_width" field.
func (*MetaUpsertOne) ClearThumbnailX ¶
func (u *MetaUpsertOne) ClearThumbnailX() *MetaUpsertOne
ClearThumbnailX clears the value of the "thumbnail_x" field.
func (*MetaUpsertOne) ClearThumbnailY ¶
func (u *MetaUpsertOne) ClearThumbnailY() *MetaUpsertOne
ClearThumbnailY clears the value of the "thumbnail_y" field.
func (*MetaUpsertOne) DoNothing ¶
func (u *MetaUpsertOne) DoNothing() *MetaUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*MetaUpsertOne) Exec ¶
func (u *MetaUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*MetaUpsertOne) ExecX ¶
func (u *MetaUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MetaUpsertOne) ID ¶
func (u *MetaUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*MetaUpsertOne) IDX ¶
func (u *MetaUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*MetaUpsertOne) Ignore ¶
func (u *MetaUpsertOne) Ignore() *MetaUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Meta.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*MetaUpsertOne) SetActive ¶
func (u *MetaUpsertOne) SetActive(v bool) *MetaUpsertOne
SetActive sets the "active" field.
func (*MetaUpsertOne) SetContainerType ¶
func (u *MetaUpsertOne) SetContainerType(v meta.ContainerType) *MetaUpsertOne
SetContainerType sets the "container_type" field.
func (*MetaUpsertOne) SetCreateTime ¶
func (u *MetaUpsertOne) SetCreateTime(v time.Time) *MetaUpsertOne
SetCreateTime sets the "create_time" field.
func (*MetaUpsertOne) SetFavorite ¶
func (u *MetaUpsertOne) SetFavorite(v bool) *MetaUpsertOne
SetFavorite sets the "favorite" field.
func (*MetaUpsertOne) SetFileIndices ¶
func (u *MetaUpsertOne) SetFileIndices(v []int) *MetaUpsertOne
SetFileIndices sets the "file_indices" field.
func (*MetaUpsertOne) SetHidden ¶
func (u *MetaUpsertOne) SetHidden(v bool) *MetaUpsertOne
SetHidden sets the "hidden" field.
func (*MetaUpsertOne) SetName ¶
func (u *MetaUpsertOne) SetName(v string) *MetaUpsertOne
SetName sets the "name" field.
func (*MetaUpsertOne) SetRead ¶
func (u *MetaUpsertOne) SetRead(v bool) *MetaUpsertOne
SetRead sets the "read" field.
func (*MetaUpsertOne) SetThumbnailHeight ¶
func (u *MetaUpsertOne) SetThumbnailHeight(v int) *MetaUpsertOne
SetThumbnailHeight sets the "thumbnail_height" field.
func (*MetaUpsertOne) SetThumbnailIndex ¶
func (u *MetaUpsertOne) SetThumbnailIndex(v int) *MetaUpsertOne
SetThumbnailIndex sets the "thumbnail_index" field.
func (*MetaUpsertOne) SetThumbnailWidth ¶
func (u *MetaUpsertOne) SetThumbnailWidth(v int) *MetaUpsertOne
SetThumbnailWidth sets the "thumbnail_width" field.
func (*MetaUpsertOne) SetThumbnailX ¶
func (u *MetaUpsertOne) SetThumbnailX(v int) *MetaUpsertOne
SetThumbnailX sets the "thumbnail_x" field.
func (*MetaUpsertOne) SetThumbnailY ¶
func (u *MetaUpsertOne) SetThumbnailY(v int) *MetaUpsertOne
SetThumbnailY sets the "thumbnail_y" field.
func (*MetaUpsertOne) Update ¶
func (u *MetaUpsertOne) Update(set func(*MetaUpsert)) *MetaUpsertOne
Update allows overriding fields `UPDATE` values. See the MetaCreate.OnConflict documentation for more info.
func (*MetaUpsertOne) UpdateActive ¶
func (u *MetaUpsertOne) UpdateActive() *MetaUpsertOne
UpdateActive sets the "active" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateContainerType ¶
func (u *MetaUpsertOne) UpdateContainerType() *MetaUpsertOne
UpdateContainerType sets the "container_type" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateCreateTime ¶
func (u *MetaUpsertOne) UpdateCreateTime() *MetaUpsertOne
UpdateCreateTime sets the "create_time" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateFavorite ¶
func (u *MetaUpsertOne) UpdateFavorite() *MetaUpsertOne
UpdateFavorite sets the "favorite" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateFileIndices ¶
func (u *MetaUpsertOne) UpdateFileIndices() *MetaUpsertOne
UpdateFileIndices sets the "file_indices" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateHidden ¶
func (u *MetaUpsertOne) UpdateHidden() *MetaUpsertOne
UpdateHidden sets the "hidden" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateName ¶
func (u *MetaUpsertOne) UpdateName() *MetaUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateNewValues ¶
func (u *MetaUpsertOne) UpdateNewValues() *MetaUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Meta.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*MetaUpsertOne) UpdateRead ¶
func (u *MetaUpsertOne) UpdateRead() *MetaUpsertOne
UpdateRead sets the "read" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateThumbnailHeight ¶
func (u *MetaUpsertOne) UpdateThumbnailHeight() *MetaUpsertOne
UpdateThumbnailHeight sets the "thumbnail_height" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateThumbnailIndex ¶
func (u *MetaUpsertOne) UpdateThumbnailIndex() *MetaUpsertOne
UpdateThumbnailIndex sets the "thumbnail_index" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateThumbnailWidth ¶
func (u *MetaUpsertOne) UpdateThumbnailWidth() *MetaUpsertOne
UpdateThumbnailWidth sets the "thumbnail_width" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateThumbnailX ¶
func (u *MetaUpsertOne) UpdateThumbnailX() *MetaUpsertOne
UpdateThumbnailX sets the "thumbnail_x" field to the value that was provided on create.
func (*MetaUpsertOne) UpdateThumbnailY ¶
func (u *MetaUpsertOne) UpdateThumbnailY() *MetaUpsertOne
UpdateThumbnailY sets the "thumbnail_y" field to the value that was provided on create.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type Progress ¶
type Progress struct { // ID of the ent. ID int `json:"id,omitempty"` // Page holds the value of the "page" field. Page int `json:"page,omitempty"` // ItemID holds the value of the "item_id" field. ItemID int `json:"item_id,omitempty"` // UserID holds the value of the "user_id" field. UserID int `json:"user_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ProgressQuery when eager-loading is set. Edges ProgressEdges `json:"edges"` // contains filtered or unexported fields }
Progress is the model entity for the Progress schema.
func (*Progress) Unwrap ¶
Unwrap unwraps the Progress 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 (*Progress) Update ¶
func (pr *Progress) Update() *ProgressUpdateOne
Update returns a builder for updating this Progress. Note that you need to call Progress.Unwrap() before calling this method if this Progress was returned from a transaction, and the transaction was committed or rolled back.
type ProgressClient ¶
type ProgressClient struct {
// contains filtered or unexported fields
}
ProgressClient is a client for the Progress schema.
func NewProgressClient ¶
func NewProgressClient(c config) *ProgressClient
NewProgressClient returns a client for the Progress from the given config.
func (*ProgressClient) Create ¶
func (c *ProgressClient) Create() *ProgressCreate
Create returns a builder for creating a Progress entity.
func (*ProgressClient) CreateBulk ¶
func (c *ProgressClient) CreateBulk(builders ...*ProgressCreate) *ProgressCreateBulk
CreateBulk returns a builder for creating a bulk of Progress entities.
func (*ProgressClient) Delete ¶
func (c *ProgressClient) Delete() *ProgressDelete
Delete returns a delete builder for Progress.
func (*ProgressClient) DeleteOne ¶
func (c *ProgressClient) DeleteOne(pr *Progress) *ProgressDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ProgressClient) DeleteOneID ¶
func (c *ProgressClient) DeleteOneID(id int) *ProgressDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ProgressClient) GetX ¶
func (c *ProgressClient) GetX(ctx context.Context, id int) *Progress
GetX is like Get, but panics if an error occurs.
func (*ProgressClient) Hooks ¶
func (c *ProgressClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ProgressClient) Intercept ¶
func (c *ProgressClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `progress.Intercept(f(g(h())))`.
func (*ProgressClient) Interceptors ¶
func (c *ProgressClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ProgressClient) MapCreateBulk ¶
func (c *ProgressClient) MapCreateBulk(slice any, setFunc func(*ProgressCreate, int)) *ProgressCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*ProgressClient) Query ¶
func (c *ProgressClient) Query() *ProgressQuery
Query returns a query builder for Progress.
func (*ProgressClient) QueryItem ¶
func (c *ProgressClient) QueryItem(pr *Progress) *MetaQuery
QueryItem queries the item edge of a Progress.
func (*ProgressClient) QueryUser ¶
func (c *ProgressClient) QueryUser(pr *Progress) *UserQuery
QueryUser queries the user edge of a Progress.
func (*ProgressClient) Update ¶
func (c *ProgressClient) Update() *ProgressUpdate
Update returns an update builder for Progress.
func (*ProgressClient) UpdateOne ¶
func (c *ProgressClient) UpdateOne(pr *Progress) *ProgressUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ProgressClient) UpdateOneID ¶
func (c *ProgressClient) UpdateOneID(id int) *ProgressUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ProgressClient) Use ¶
func (c *ProgressClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `progress.Hooks(f(g(h())))`.
type ProgressCreate ¶
type ProgressCreate struct {
// contains filtered or unexported fields
}
ProgressCreate is the builder for creating a Progress entity.
func (*ProgressCreate) Exec ¶
func (pc *ProgressCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProgressCreate) ExecX ¶
func (pc *ProgressCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProgressCreate) Mutation ¶
func (pc *ProgressCreate) Mutation() *ProgressMutation
Mutation returns the ProgressMutation object of the builder.
func (*ProgressCreate) OnConflict ¶
func (pc *ProgressCreate) OnConflict(opts ...sql.ConflictOption) *ProgressUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Progress.Create(). SetPage(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ProgressUpsert) { SetPage(v+v). }). Exec(ctx)
func (*ProgressCreate) OnConflictColumns ¶
func (pc *ProgressCreate) OnConflictColumns(columns ...string) *ProgressUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Progress.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*ProgressCreate) Save ¶
func (pc *ProgressCreate) Save(ctx context.Context) (*Progress, error)
Save creates the Progress in the database.
func (*ProgressCreate) SaveX ¶
func (pc *ProgressCreate) SaveX(ctx context.Context) *Progress
SaveX calls Save and panics if Save returns an error.
func (*ProgressCreate) SetItem ¶
func (pc *ProgressCreate) SetItem(m *Meta) *ProgressCreate
SetItem sets the "item" edge to the Meta entity.
func (*ProgressCreate) SetItemID ¶
func (pc *ProgressCreate) SetItemID(i int) *ProgressCreate
SetItemID sets the "item_id" field.
func (*ProgressCreate) SetNillableItemID ¶
func (pc *ProgressCreate) SetNillableItemID(i *int) *ProgressCreate
SetNillableItemID sets the "item_id" field if the given value is not nil.
func (*ProgressCreate) SetNillablePage ¶
func (pc *ProgressCreate) SetNillablePage(i *int) *ProgressCreate
SetNillablePage sets the "page" field if the given value is not nil.
func (*ProgressCreate) SetNillableUserID ¶
func (pc *ProgressCreate) SetNillableUserID(i *int) *ProgressCreate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*ProgressCreate) SetPage ¶
func (pc *ProgressCreate) SetPage(i int) *ProgressCreate
SetPage sets the "page" field.
func (*ProgressCreate) SetUser ¶
func (pc *ProgressCreate) SetUser(u *User) *ProgressCreate
SetUser sets the "user" edge to the User entity.
func (*ProgressCreate) SetUserID ¶
func (pc *ProgressCreate) SetUserID(i int) *ProgressCreate
SetUserID sets the "user_id" field.
type ProgressCreateBulk ¶
type ProgressCreateBulk struct {
// contains filtered or unexported fields
}
ProgressCreateBulk is the builder for creating many Progress entities in bulk.
func (*ProgressCreateBulk) Exec ¶
func (pcb *ProgressCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProgressCreateBulk) ExecX ¶
func (pcb *ProgressCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProgressCreateBulk) OnConflict ¶
func (pcb *ProgressCreateBulk) OnConflict(opts ...sql.ConflictOption) *ProgressUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Progress.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ProgressUpsert) { SetPage(v+v). }). Exec(ctx)
func (*ProgressCreateBulk) OnConflictColumns ¶
func (pcb *ProgressCreateBulk) OnConflictColumns(columns ...string) *ProgressUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Progress.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type ProgressDelete ¶
type ProgressDelete struct {
// contains filtered or unexported fields
}
ProgressDelete is the builder for deleting a Progress entity.
func (*ProgressDelete) Exec ¶
func (pd *ProgressDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ProgressDelete) ExecX ¶
func (pd *ProgressDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ProgressDelete) Where ¶
func (pd *ProgressDelete) Where(ps ...predicate.Progress) *ProgressDelete
Where appends a list predicates to the ProgressDelete builder.
type ProgressDeleteOne ¶
type ProgressDeleteOne struct {
// contains filtered or unexported fields
}
ProgressDeleteOne is the builder for deleting a single Progress entity.
func (*ProgressDeleteOne) Exec ¶
func (pdo *ProgressDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ProgressDeleteOne) ExecX ¶
func (pdo *ProgressDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProgressDeleteOne) Where ¶
func (pdo *ProgressDeleteOne) Where(ps ...predicate.Progress) *ProgressDeleteOne
Where appends a list predicates to the ProgressDelete builder.
type ProgressEdges ¶
type ProgressEdges struct { // Item holds the value of the item edge. Item *Meta `json:"item,omitempty"` // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
ProgressEdges holds the relations/edges for other nodes in the graph.
func (ProgressEdges) ItemOrErr ¶
func (e ProgressEdges) ItemOrErr() (*Meta, error)
ItemOrErr returns the Item value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ProgressEdges) UserOrErr ¶
func (e ProgressEdges) 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 ProgressGroupBy ¶
type ProgressGroupBy struct {
// contains filtered or unexported fields
}
ProgressGroupBy is the group-by builder for Progress entities.
func (*ProgressGroupBy) Aggregate ¶
func (pgb *ProgressGroupBy) Aggregate(fns ...AggregateFunc) *ProgressGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ProgressGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProgressGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProgressGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProgressGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProgressGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProgressGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProgressGroupBy) Scan ¶
func (pgb *ProgressGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProgressGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProgressMutation ¶
type ProgressMutation struct {
// contains filtered or unexported fields
}
ProgressMutation represents an operation that mutates the Progress nodes in the graph.
func (*ProgressMutation) AddField ¶
func (m *ProgressMutation) 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 (*ProgressMutation) AddPage ¶
func (m *ProgressMutation) AddPage(i int)
AddPage adds i to the "page" field.
func (*ProgressMutation) AddedEdges ¶
func (m *ProgressMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ProgressMutation) AddedField ¶
func (m *ProgressMutation) 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 (*ProgressMutation) AddedFields ¶
func (m *ProgressMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ProgressMutation) AddedIDs ¶
func (m *ProgressMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ProgressMutation) AddedPage ¶
func (m *ProgressMutation) AddedPage() (r int, exists bool)
AddedPage returns the value that was added to the "page" field in this mutation.
func (*ProgressMutation) ClearEdge ¶
func (m *ProgressMutation) 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 (*ProgressMutation) ClearField ¶
func (m *ProgressMutation) 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 (*ProgressMutation) ClearItem ¶
func (m *ProgressMutation) ClearItem()
ClearItem clears the "item" edge to the Meta entity.
func (*ProgressMutation) ClearItemID ¶
func (m *ProgressMutation) ClearItemID()
ClearItemID clears the value of the "item_id" field.
func (*ProgressMutation) ClearUser ¶
func (m *ProgressMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*ProgressMutation) ClearUserID ¶
func (m *ProgressMutation) ClearUserID()
ClearUserID clears the value of the "user_id" field.
func (*ProgressMutation) ClearedEdges ¶
func (m *ProgressMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ProgressMutation) ClearedFields ¶
func (m *ProgressMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ProgressMutation) Client ¶
func (m ProgressMutation) 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 (*ProgressMutation) EdgeCleared ¶
func (m *ProgressMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ProgressMutation) Field ¶
func (m *ProgressMutation) 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 (*ProgressMutation) FieldCleared ¶
func (m *ProgressMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ProgressMutation) Fields ¶
func (m *ProgressMutation) 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 (*ProgressMutation) ID ¶
func (m *ProgressMutation) 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 (*ProgressMutation) IDs ¶
func (m *ProgressMutation) 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 (*ProgressMutation) ItemCleared ¶
func (m *ProgressMutation) ItemCleared() bool
ItemCleared reports if the "item" edge to the Meta entity was cleared.
func (*ProgressMutation) ItemID ¶
func (m *ProgressMutation) ItemID() (r int, exists bool)
ItemID returns the value of the "item_id" field in the mutation.
func (*ProgressMutation) ItemIDCleared ¶
func (m *ProgressMutation) ItemIDCleared() bool
ItemIDCleared returns if the "item_id" field was cleared in this mutation.
func (*ProgressMutation) ItemIDs ¶
func (m *ProgressMutation) ItemIDs() (ids []int)
ItemIDs returns the "item" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ItemID instead. It exists only for internal usage by the builders.
func (*ProgressMutation) 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 (*ProgressMutation) OldItemID ¶
func (m *ProgressMutation) OldItemID(ctx context.Context) (v int, err error)
OldItemID returns the old "item_id" field's value of the Progress entity. If the Progress 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 (*ProgressMutation) OldPage ¶
func (m *ProgressMutation) OldPage(ctx context.Context) (v int, err error)
OldPage returns the old "page" field's value of the Progress entity. If the Progress 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 (*ProgressMutation) OldUserID ¶
func (m *ProgressMutation) OldUserID(ctx context.Context) (v int, err error)
OldUserID returns the old "user_id" field's value of the Progress entity. If the Progress 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 (*ProgressMutation) Page ¶
func (m *ProgressMutation) Page() (r int, exists bool)
Page returns the value of the "page" field in the mutation.
func (*ProgressMutation) RemovedEdges ¶
func (m *ProgressMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ProgressMutation) RemovedIDs ¶
func (m *ProgressMutation) 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 (*ProgressMutation) ResetEdge ¶
func (m *ProgressMutation) 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 (*ProgressMutation) ResetField ¶
func (m *ProgressMutation) 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 (*ProgressMutation) ResetItem ¶
func (m *ProgressMutation) ResetItem()
ResetItem resets all changes to the "item" edge.
func (*ProgressMutation) ResetItemID ¶
func (m *ProgressMutation) ResetItemID()
ResetItemID resets all changes to the "item_id" field.
func (*ProgressMutation) ResetPage ¶
func (m *ProgressMutation) ResetPage()
ResetPage resets all changes to the "page" field.
func (*ProgressMutation) ResetUser ¶
func (m *ProgressMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*ProgressMutation) ResetUserID ¶
func (m *ProgressMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*ProgressMutation) SetField ¶
func (m *ProgressMutation) 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 (*ProgressMutation) SetItemID ¶
func (m *ProgressMutation) SetItemID(i int)
SetItemID sets the "item_id" field.
func (*ProgressMutation) SetOp ¶
func (m *ProgressMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ProgressMutation) SetPage ¶
func (m *ProgressMutation) SetPage(i int)
SetPage sets the "page" field.
func (*ProgressMutation) SetUserID ¶
func (m *ProgressMutation) SetUserID(i int)
SetUserID sets the "user_id" field.
func (ProgressMutation) Tx ¶
func (m ProgressMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ProgressMutation) Type ¶
func (m *ProgressMutation) Type() string
Type returns the node type of this mutation (Progress).
func (*ProgressMutation) UserCleared ¶
func (m *ProgressMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*ProgressMutation) UserID ¶
func (m *ProgressMutation) UserID() (r int, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*ProgressMutation) UserIDCleared ¶
func (m *ProgressMutation) UserIDCleared() bool
UserIDCleared returns if the "user_id" field was cleared in this mutation.
func (*ProgressMutation) UserIDs ¶
func (m *ProgressMutation) 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 (*ProgressMutation) Where ¶
func (m *ProgressMutation) Where(ps ...predicate.Progress)
Where appends a list predicates to the ProgressMutation builder.
func (*ProgressMutation) WhereP ¶
func (m *ProgressMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ProgressMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ProgressQuery ¶
type ProgressQuery struct {
// contains filtered or unexported fields
}
ProgressQuery is the builder for querying Progress entities.
func (*ProgressQuery) Aggregate ¶
func (pq *ProgressQuery) Aggregate(fns ...AggregateFunc) *ProgressSelect
Aggregate returns a ProgressSelect configured with the given aggregations.
func (*ProgressQuery) All ¶
func (pq *ProgressQuery) All(ctx context.Context) ([]*Progress, error)
All executes the query and returns a list of Progresses.
func (*ProgressQuery) AllX ¶
func (pq *ProgressQuery) AllX(ctx context.Context) []*Progress
AllX is like All, but panics if an error occurs.
func (*ProgressQuery) Clone ¶
func (pq *ProgressQuery) Clone() *ProgressQuery
Clone returns a duplicate of the ProgressQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ProgressQuery) Count ¶
func (pq *ProgressQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ProgressQuery) CountX ¶
func (pq *ProgressQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ProgressQuery) Exist ¶
func (pq *ProgressQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ProgressQuery) ExistX ¶
func (pq *ProgressQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ProgressQuery) First ¶
func (pq *ProgressQuery) First(ctx context.Context) (*Progress, error)
First returns the first Progress entity from the query. Returns a *NotFoundError when no Progress was found.
func (*ProgressQuery) FirstID ¶
func (pq *ProgressQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Progress ID from the query. Returns a *NotFoundError when no Progress ID was found.
func (*ProgressQuery) FirstIDX ¶
func (pq *ProgressQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ProgressQuery) FirstX ¶
func (pq *ProgressQuery) FirstX(ctx context.Context) *Progress
FirstX is like First, but panics if an error occurs.
func (*ProgressQuery) GroupBy ¶
func (pq *ProgressQuery) GroupBy(field string, fields ...string) *ProgressGroupBy
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 { Page int `json:"page,omitempty"` Count int `json:"count,omitempty"` } client.Progress.Query(). GroupBy(progress.FieldPage). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ProgressQuery) IDs ¶
func (pq *ProgressQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Progress IDs.
func (*ProgressQuery) IDsX ¶
func (pq *ProgressQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ProgressQuery) Limit ¶
func (pq *ProgressQuery) Limit(limit int) *ProgressQuery
Limit the number of records to be returned by this query.
func (*ProgressQuery) Offset ¶
func (pq *ProgressQuery) Offset(offset int) *ProgressQuery
Offset to start from.
func (*ProgressQuery) Only ¶
func (pq *ProgressQuery) Only(ctx context.Context) (*Progress, error)
Only returns a single Progress entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Progress entity is found. Returns a *NotFoundError when no Progress entities are found.
func (*ProgressQuery) OnlyID ¶
func (pq *ProgressQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Progress ID in the query. Returns a *NotSingularError when more than one Progress ID is found. Returns a *NotFoundError when no entities are found.
func (*ProgressQuery) OnlyIDX ¶
func (pq *ProgressQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ProgressQuery) OnlyX ¶
func (pq *ProgressQuery) OnlyX(ctx context.Context) *Progress
OnlyX is like Only, but panics if an error occurs.
func (*ProgressQuery) Order ¶
func (pq *ProgressQuery) Order(o ...progress.OrderOption) *ProgressQuery
Order specifies how the records should be ordered.
func (*ProgressQuery) QueryItem ¶
func (pq *ProgressQuery) QueryItem() *MetaQuery
QueryItem chains the current query on the "item" edge.
func (*ProgressQuery) QueryUser ¶
func (pq *ProgressQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*ProgressQuery) Select ¶
func (pq *ProgressQuery) Select(fields ...string) *ProgressSelect
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 { Page int `json:"page,omitempty"` } client.Progress.Query(). Select(progress.FieldPage). Scan(ctx, &v)
func (*ProgressQuery) Unique ¶
func (pq *ProgressQuery) Unique(unique bool) *ProgressQuery
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 (*ProgressQuery) Where ¶
func (pq *ProgressQuery) Where(ps ...predicate.Progress) *ProgressQuery
Where adds a new predicate for the ProgressQuery builder.
func (*ProgressQuery) WithItem ¶
func (pq *ProgressQuery) WithItem(opts ...func(*MetaQuery)) *ProgressQuery
WithItem tells the query-builder to eager-load the nodes that are connected to the "item" edge. The optional arguments are used to configure the query builder of the edge.
func (*ProgressQuery) WithUser ¶
func (pq *ProgressQuery) WithUser(opts ...func(*UserQuery)) *ProgressQuery
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 ProgressSelect ¶
type ProgressSelect struct { *ProgressQuery // contains filtered or unexported fields }
ProgressSelect is the builder for selecting fields of Progress entities.
func (*ProgressSelect) Aggregate ¶
func (ps *ProgressSelect) Aggregate(fns ...AggregateFunc) *ProgressSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ProgressSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProgressSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProgressSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProgressSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProgressSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProgressSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProgressSelect) Scan ¶
func (ps *ProgressSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProgressSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProgressUpdate ¶
type ProgressUpdate struct {
// contains filtered or unexported fields
}
ProgressUpdate is the builder for updating Progress entities.
func (*ProgressUpdate) AddPage ¶
func (pu *ProgressUpdate) AddPage(i int) *ProgressUpdate
AddPage adds i to the "page" field.
func (*ProgressUpdate) ClearItem ¶
func (pu *ProgressUpdate) ClearItem() *ProgressUpdate
ClearItem clears the "item" edge to the Meta entity.
func (*ProgressUpdate) ClearItemID ¶
func (pu *ProgressUpdate) ClearItemID() *ProgressUpdate
ClearItemID clears the value of the "item_id" field.
func (*ProgressUpdate) ClearUser ¶
func (pu *ProgressUpdate) ClearUser() *ProgressUpdate
ClearUser clears the "user" edge to the User entity.
func (*ProgressUpdate) ClearUserID ¶
func (pu *ProgressUpdate) ClearUserID() *ProgressUpdate
ClearUserID clears the value of the "user_id" field.
func (*ProgressUpdate) Exec ¶
func (pu *ProgressUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProgressUpdate) ExecX ¶
func (pu *ProgressUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProgressUpdate) Mutation ¶
func (pu *ProgressUpdate) Mutation() *ProgressMutation
Mutation returns the ProgressMutation object of the builder.
func (*ProgressUpdate) Save ¶
func (pu *ProgressUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ProgressUpdate) SaveX ¶
func (pu *ProgressUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ProgressUpdate) SetItem ¶
func (pu *ProgressUpdate) SetItem(m *Meta) *ProgressUpdate
SetItem sets the "item" edge to the Meta entity.
func (*ProgressUpdate) SetItemID ¶
func (pu *ProgressUpdate) SetItemID(i int) *ProgressUpdate
SetItemID sets the "item_id" field.
func (*ProgressUpdate) SetNillableItemID ¶
func (pu *ProgressUpdate) SetNillableItemID(i *int) *ProgressUpdate
SetNillableItemID sets the "item_id" field if the given value is not nil.
func (*ProgressUpdate) SetNillablePage ¶
func (pu *ProgressUpdate) SetNillablePage(i *int) *ProgressUpdate
SetNillablePage sets the "page" field if the given value is not nil.
func (*ProgressUpdate) SetNillableUserID ¶
func (pu *ProgressUpdate) SetNillableUserID(i *int) *ProgressUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*ProgressUpdate) SetPage ¶
func (pu *ProgressUpdate) SetPage(i int) *ProgressUpdate
SetPage sets the "page" field.
func (*ProgressUpdate) SetUser ¶
func (pu *ProgressUpdate) SetUser(u *User) *ProgressUpdate
SetUser sets the "user" edge to the User entity.
func (*ProgressUpdate) SetUserID ¶
func (pu *ProgressUpdate) SetUserID(i int) *ProgressUpdate
SetUserID sets the "user_id" field.
func (*ProgressUpdate) Where ¶
func (pu *ProgressUpdate) Where(ps ...predicate.Progress) *ProgressUpdate
Where appends a list predicates to the ProgressUpdate builder.
type ProgressUpdateOne ¶
type ProgressUpdateOne struct {
// contains filtered or unexported fields
}
ProgressUpdateOne is the builder for updating a single Progress entity.
func (*ProgressUpdateOne) AddPage ¶
func (puo *ProgressUpdateOne) AddPage(i int) *ProgressUpdateOne
AddPage adds i to the "page" field.
func (*ProgressUpdateOne) ClearItem ¶
func (puo *ProgressUpdateOne) ClearItem() *ProgressUpdateOne
ClearItem clears the "item" edge to the Meta entity.
func (*ProgressUpdateOne) ClearItemID ¶
func (puo *ProgressUpdateOne) ClearItemID() *ProgressUpdateOne
ClearItemID clears the value of the "item_id" field.
func (*ProgressUpdateOne) ClearUser ¶
func (puo *ProgressUpdateOne) ClearUser() *ProgressUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*ProgressUpdateOne) ClearUserID ¶
func (puo *ProgressUpdateOne) ClearUserID() *ProgressUpdateOne
ClearUserID clears the value of the "user_id" field.
func (*ProgressUpdateOne) Exec ¶
func (puo *ProgressUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ProgressUpdateOne) ExecX ¶
func (puo *ProgressUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProgressUpdateOne) Mutation ¶
func (puo *ProgressUpdateOne) Mutation() *ProgressMutation
Mutation returns the ProgressMutation object of the builder.
func (*ProgressUpdateOne) Save ¶
func (puo *ProgressUpdateOne) Save(ctx context.Context) (*Progress, error)
Save executes the query and returns the updated Progress entity.
func (*ProgressUpdateOne) SaveX ¶
func (puo *ProgressUpdateOne) SaveX(ctx context.Context) *Progress
SaveX is like Save, but panics if an error occurs.
func (*ProgressUpdateOne) Select ¶
func (puo *ProgressUpdateOne) Select(field string, fields ...string) *ProgressUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ProgressUpdateOne) SetItem ¶
func (puo *ProgressUpdateOne) SetItem(m *Meta) *ProgressUpdateOne
SetItem sets the "item" edge to the Meta entity.
func (*ProgressUpdateOne) SetItemID ¶
func (puo *ProgressUpdateOne) SetItemID(i int) *ProgressUpdateOne
SetItemID sets the "item_id" field.
func (*ProgressUpdateOne) SetNillableItemID ¶
func (puo *ProgressUpdateOne) SetNillableItemID(i *int) *ProgressUpdateOne
SetNillableItemID sets the "item_id" field if the given value is not nil.
func (*ProgressUpdateOne) SetNillablePage ¶
func (puo *ProgressUpdateOne) SetNillablePage(i *int) *ProgressUpdateOne
SetNillablePage sets the "page" field if the given value is not nil.
func (*ProgressUpdateOne) SetNillableUserID ¶
func (puo *ProgressUpdateOne) SetNillableUserID(i *int) *ProgressUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*ProgressUpdateOne) SetPage ¶
func (puo *ProgressUpdateOne) SetPage(i int) *ProgressUpdateOne
SetPage sets the "page" field.
func (*ProgressUpdateOne) SetUser ¶
func (puo *ProgressUpdateOne) SetUser(u *User) *ProgressUpdateOne
SetUser sets the "user" edge to the User entity.
func (*ProgressUpdateOne) SetUserID ¶
func (puo *ProgressUpdateOne) SetUserID(i int) *ProgressUpdateOne
SetUserID sets the "user_id" field.
func (*ProgressUpdateOne) Where ¶
func (puo *ProgressUpdateOne) Where(ps ...predicate.Progress) *ProgressUpdateOne
Where appends a list predicates to the ProgressUpdate builder.
type ProgressUpsert ¶
ProgressUpsert is the "OnConflict" setter.
func (*ProgressUpsert) AddPage ¶
func (u *ProgressUpsert) AddPage(v int) *ProgressUpsert
AddPage adds v to the "page" field.
func (*ProgressUpsert) ClearItemID ¶
func (u *ProgressUpsert) ClearItemID() *ProgressUpsert
ClearItemID clears the value of the "item_id" field.
func (*ProgressUpsert) ClearUserID ¶
func (u *ProgressUpsert) ClearUserID() *ProgressUpsert
ClearUserID clears the value of the "user_id" field.
func (*ProgressUpsert) SetItemID ¶
func (u *ProgressUpsert) SetItemID(v int) *ProgressUpsert
SetItemID sets the "item_id" field.
func (*ProgressUpsert) SetPage ¶
func (u *ProgressUpsert) SetPage(v int) *ProgressUpsert
SetPage sets the "page" field.
func (*ProgressUpsert) SetUserID ¶
func (u *ProgressUpsert) SetUserID(v int) *ProgressUpsert
SetUserID sets the "user_id" field.
func (*ProgressUpsert) UpdateItemID ¶
func (u *ProgressUpsert) UpdateItemID() *ProgressUpsert
UpdateItemID sets the "item_id" field to the value that was provided on create.
func (*ProgressUpsert) UpdatePage ¶
func (u *ProgressUpsert) UpdatePage() *ProgressUpsert
UpdatePage sets the "page" field to the value that was provided on create.
func (*ProgressUpsert) UpdateUserID ¶
func (u *ProgressUpsert) UpdateUserID() *ProgressUpsert
UpdateUserID sets the "user_id" field to the value that was provided on create.
type ProgressUpsertBulk ¶
type ProgressUpsertBulk struct {
// contains filtered or unexported fields
}
ProgressUpsertBulk is the builder for "upsert"-ing a bulk of Progress nodes.
func (*ProgressUpsertBulk) AddPage ¶
func (u *ProgressUpsertBulk) AddPage(v int) *ProgressUpsertBulk
AddPage adds v to the "page" field.
func (*ProgressUpsertBulk) ClearItemID ¶
func (u *ProgressUpsertBulk) ClearItemID() *ProgressUpsertBulk
ClearItemID clears the value of the "item_id" field.
func (*ProgressUpsertBulk) ClearUserID ¶
func (u *ProgressUpsertBulk) ClearUserID() *ProgressUpsertBulk
ClearUserID clears the value of the "user_id" field.
func (*ProgressUpsertBulk) DoNothing ¶
func (u *ProgressUpsertBulk) DoNothing() *ProgressUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ProgressUpsertBulk) Exec ¶
func (u *ProgressUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProgressUpsertBulk) ExecX ¶
func (u *ProgressUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProgressUpsertBulk) Ignore ¶
func (u *ProgressUpsertBulk) Ignore() *ProgressUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Progress.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ProgressUpsertBulk) SetItemID ¶
func (u *ProgressUpsertBulk) SetItemID(v int) *ProgressUpsertBulk
SetItemID sets the "item_id" field.
func (*ProgressUpsertBulk) SetPage ¶
func (u *ProgressUpsertBulk) SetPage(v int) *ProgressUpsertBulk
SetPage sets the "page" field.
func (*ProgressUpsertBulk) SetUserID ¶
func (u *ProgressUpsertBulk) SetUserID(v int) *ProgressUpsertBulk
SetUserID sets the "user_id" field.
func (*ProgressUpsertBulk) Update ¶
func (u *ProgressUpsertBulk) Update(set func(*ProgressUpsert)) *ProgressUpsertBulk
Update allows overriding fields `UPDATE` values. See the ProgressCreateBulk.OnConflict documentation for more info.
func (*ProgressUpsertBulk) UpdateItemID ¶
func (u *ProgressUpsertBulk) UpdateItemID() *ProgressUpsertBulk
UpdateItemID sets the "item_id" field to the value that was provided on create.
func (*ProgressUpsertBulk) UpdateNewValues ¶
func (u *ProgressUpsertBulk) UpdateNewValues() *ProgressUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Progress.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*ProgressUpsertBulk) UpdatePage ¶
func (u *ProgressUpsertBulk) UpdatePage() *ProgressUpsertBulk
UpdatePage sets the "page" field to the value that was provided on create.
func (*ProgressUpsertBulk) UpdateUserID ¶
func (u *ProgressUpsertBulk) UpdateUserID() *ProgressUpsertBulk
UpdateUserID sets the "user_id" field to the value that was provided on create.
type ProgressUpsertOne ¶
type ProgressUpsertOne struct {
// contains filtered or unexported fields
}
ProgressUpsertOne is the builder for "upsert"-ing
one Progress node.
func (*ProgressUpsertOne) AddPage ¶
func (u *ProgressUpsertOne) AddPage(v int) *ProgressUpsertOne
AddPage adds v to the "page" field.
func (*ProgressUpsertOne) ClearItemID ¶
func (u *ProgressUpsertOne) ClearItemID() *ProgressUpsertOne
ClearItemID clears the value of the "item_id" field.
func (*ProgressUpsertOne) ClearUserID ¶
func (u *ProgressUpsertOne) ClearUserID() *ProgressUpsertOne
ClearUserID clears the value of the "user_id" field.
func (*ProgressUpsertOne) DoNothing ¶
func (u *ProgressUpsertOne) DoNothing() *ProgressUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ProgressUpsertOne) Exec ¶
func (u *ProgressUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*ProgressUpsertOne) ExecX ¶
func (u *ProgressUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProgressUpsertOne) ID ¶
func (u *ProgressUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*ProgressUpsertOne) IDX ¶
func (u *ProgressUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*ProgressUpsertOne) Ignore ¶
func (u *ProgressUpsertOne) Ignore() *ProgressUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Progress.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ProgressUpsertOne) SetItemID ¶
func (u *ProgressUpsertOne) SetItemID(v int) *ProgressUpsertOne
SetItemID sets the "item_id" field.
func (*ProgressUpsertOne) SetPage ¶
func (u *ProgressUpsertOne) SetPage(v int) *ProgressUpsertOne
SetPage sets the "page" field.
func (*ProgressUpsertOne) SetUserID ¶
func (u *ProgressUpsertOne) SetUserID(v int) *ProgressUpsertOne
SetUserID sets the "user_id" field.
func (*ProgressUpsertOne) Update ¶
func (u *ProgressUpsertOne) Update(set func(*ProgressUpsert)) *ProgressUpsertOne
Update allows overriding fields `UPDATE` values. See the ProgressCreate.OnConflict documentation for more info.
func (*ProgressUpsertOne) UpdateItemID ¶
func (u *ProgressUpsertOne) UpdateItemID() *ProgressUpsertOne
UpdateItemID sets the "item_id" field to the value that was provided on create.
func (*ProgressUpsertOne) UpdateNewValues ¶
func (u *ProgressUpsertOne) UpdateNewValues() *ProgressUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Progress.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*ProgressUpsertOne) UpdatePage ¶
func (u *ProgressUpsertOne) UpdatePage() *ProgressUpsertOne
UpdatePage sets the "page" field to the value that was provided on create.
func (*ProgressUpsertOne) UpdateUserID ¶
func (u *ProgressUpsertOne) UpdateUserID() *ProgressUpsertOne
UpdateUserID sets the "user_id" field to the value that was provided on create.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type Tag ¶
type Tag struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Favorite holds the value of the "favorite" field. Favorite bool `json:"favorite,omitempty"` // Hidden holds the value of the "hidden" field. Hidden bool `json:"hidden,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) QueryFavoriteOfUser ¶
QueryFavoriteOfUser queries the "favorite_of_user" 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) MapCreateBulk ¶
func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*TagClient) QueryFavoriteOfUser ¶
QueryFavoriteOfUser queries the favorite_of_user 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) AddFavoriteOfUser ¶
AddFavoriteOfUser adds the "favorite_of_user" edges to the User entity.
func (*TagCreate) AddFavoriteOfUserIDs ¶
AddFavoriteOfUserIDs adds the "favorite_of_user" edge to the User entity by IDs.
func (*TagCreate) AddMetumIDs ¶
AddMetumIDs adds the "meta" edge to the Meta entity by IDs.
func (*TagCreate) Mutation ¶
func (tc *TagCreate) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagCreate) OnConflict ¶
func (tc *TagCreate) OnConflict(opts ...sql.ConflictOption) *TagUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Tag.Create(). SetName(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.TagUpsert) { SetName(v+v). }). Exec(ctx)
func (*TagCreate) OnConflictColumns ¶
func (tc *TagCreate) OnConflictColumns(columns ...string) *TagUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Tag.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*TagCreate) SetFavorite ¶
SetFavorite sets the "favorite" field.
func (*TagCreate) SetNillableFavorite ¶
SetNillableFavorite sets the "favorite" field if the given value is not nil.
func (*TagCreate) SetNillableHidden ¶
SetNillableHidden sets the "hidden" field if the given value is not nil.
type TagCreateBulk ¶
type TagCreateBulk struct {
// contains filtered or unexported fields
}
TagCreateBulk is the builder for creating many Tag entities in bulk.
func (*TagCreateBulk) Exec ¶
func (tcb *TagCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TagCreateBulk) ExecX ¶
func (tcb *TagCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagCreateBulk) OnConflict ¶
func (tcb *TagCreateBulk) OnConflict(opts ...sql.ConflictOption) *TagUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Tag.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.TagUpsert) { SetName(v+v). }). Exec(ctx)
func (*TagCreateBulk) OnConflictColumns ¶
func (tcb *TagCreateBulk) OnConflictColumns(columns ...string) *TagUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Tag.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
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 { // Meta holds the value of the meta edge. Meta []*Meta `json:"meta,omitempty"` // FavoriteOfUser holds the value of the favorite_of_user edge. FavoriteOfUser []*User `json:"favorite_of_user,omitempty"` // contains filtered or unexported fields }
TagEdges holds the relations/edges for other nodes in the graph.
func (TagEdges) FavoriteOfUserOrErr ¶
FavoriteOfUserOrErr returns the FavoriteOfUser value or an error if the edge was not loaded in eager-loading.
type TagGroupBy ¶
type TagGroupBy struct {
// contains filtered or unexported fields
}
TagGroupBy is the group-by builder for Tag entities.
func (*TagGroupBy) Aggregate ¶
func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TagGroupBy) Bool ¶
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) AddFavoriteOfUserIDs ¶
func (m *TagMutation) AddFavoriteOfUserIDs(ids ...int)
AddFavoriteOfUserIDs adds the "favorite_of_user" edge to the User entity by ids.
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) AddMetumIDs ¶
func (m *TagMutation) AddMetumIDs(ids ...int)
AddMetumIDs adds the "meta" edge to the Meta entity by ids.
func (*TagMutation) AddedEdges ¶
func (m *TagMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TagMutation) AddedField ¶
func (m *TagMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*TagMutation) AddedFields ¶
func (m *TagMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TagMutation) AddedIDs ¶
func (m *TagMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TagMutation) ClearEdge ¶
func (m *TagMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*TagMutation) ClearFavoriteOfUser ¶
func (m *TagMutation) ClearFavoriteOfUser()
ClearFavoriteOfUser clears the "favorite_of_user" edge to the User entity.
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) ClearMeta ¶
func (m *TagMutation) ClearMeta()
ClearMeta clears the "meta" edge to the Meta entity.
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) 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) Favorite ¶
func (m *TagMutation) Favorite() (r bool, exists bool)
Favorite returns the value of the "favorite" field in the mutation.
func (*TagMutation) FavoriteOfUserCleared ¶
func (m *TagMutation) FavoriteOfUserCleared() bool
FavoriteOfUserCleared reports if the "favorite_of_user" edge to the User entity was cleared.
func (*TagMutation) FavoriteOfUserIDs ¶
func (m *TagMutation) FavoriteOfUserIDs() (ids []int)
FavoriteOfUserIDs returns the "favorite_of_user" edge IDs in the 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) Hidden ¶
func (m *TagMutation) Hidden() (r bool, exists bool)
Hidden returns the value of the "hidden" field in the mutation.
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) MetaCleared ¶
func (m *TagMutation) MetaCleared() bool
MetaCleared reports if the "meta" edge to the Meta entity was cleared.
func (*TagMutation) MetaIDs ¶
func (m *TagMutation) MetaIDs() (ids []int)
MetaIDs returns the "meta" edge IDs in the mutation.
func (*TagMutation) Name ¶
func (m *TagMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*TagMutation) OldFavorite ¶
func (m *TagMutation) OldFavorite(ctx context.Context) (v bool, err error)
OldFavorite returns the old "favorite" 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) OldHidden ¶
func (m *TagMutation) OldHidden(ctx context.Context) (v bool, err error)
OldHidden returns the old "hidden" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) OldName ¶
func (m *TagMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) RemoveFavoriteOfUserIDs ¶
func (m *TagMutation) RemoveFavoriteOfUserIDs(ids ...int)
RemoveFavoriteOfUserIDs removes the "favorite_of_user" edge to the User entity by IDs.
func (*TagMutation) RemoveMetumIDs ¶
func (m *TagMutation) RemoveMetumIDs(ids ...int)
RemoveMetumIDs removes the "meta" edge to the Meta entity by IDs.
func (*TagMutation) RemovedEdges ¶
func (m *TagMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TagMutation) RemovedFavoriteOfUserIDs ¶
func (m *TagMutation) RemovedFavoriteOfUserIDs() (ids []int)
RemovedFavoriteOfUser returns the removed IDs of the "favorite_of_user" edge to the User entity.
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) RemovedMetaIDs ¶
func (m *TagMutation) RemovedMetaIDs() (ids []int)
RemovedMeta returns the removed IDs of the "meta" edge to the Meta entity.
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) ResetFavorite ¶
func (m *TagMutation) ResetFavorite()
ResetFavorite resets all changes to the "favorite" field.
func (*TagMutation) ResetFavoriteOfUser ¶
func (m *TagMutation) ResetFavoriteOfUser()
ResetFavoriteOfUser resets all changes to the "favorite_of_user" edge.
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) ResetHidden ¶
func (m *TagMutation) ResetHidden()
ResetHidden resets all changes to the "hidden" field.
func (*TagMutation) ResetMeta ¶
func (m *TagMutation) ResetMeta()
ResetMeta resets all changes to the "meta" edge.
func (*TagMutation) ResetName ¶
func (m *TagMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*TagMutation) SetFavorite ¶
func (m *TagMutation) SetFavorite(b bool)
SetFavorite sets the "favorite" 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) SetHidden ¶
func (m *TagMutation) SetHidden(b bool)
SetHidden sets the "hidden" field.
func (*TagMutation) SetName ¶
func (m *TagMutation) SetName(s string)
SetName sets the "name" field.
func (*TagMutation) SetOp ¶
func (m *TagMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (TagMutation) 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 { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Tag.Query(). GroupBy(tag.FieldName). 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) Order ¶
func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery
Order specifies how the records should be ordered.
func (*TagQuery) QueryFavoriteOfUser ¶
QueryFavoriteOfUser chains the current query on the "favorite_of_user" 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 { Name string `json:"name,omitempty"` } client.Tag.Query(). Select(tag.FieldName). 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) WithFavoriteOfUser ¶
WithFavoriteOfUser tells the query-builder to eager-load the nodes that are connected to the "favorite_of_user" 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) AddFavoriteOfUser ¶
AddFavoriteOfUser adds the "favorite_of_user" edges to the User entity.
func (*TagUpdate) AddFavoriteOfUserIDs ¶
AddFavoriteOfUserIDs adds the "favorite_of_user" edge to the User entity by IDs.
func (*TagUpdate) AddMetumIDs ¶
AddMetumIDs adds the "meta" edge to the Meta entity by IDs.
func (*TagUpdate) ClearFavoriteOfUser ¶
ClearFavoriteOfUser clears all "favorite_of_user" edges to the User entity.
func (*TagUpdate) Mutation ¶
func (tu *TagUpdate) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagUpdate) RemoveFavoriteOfUser ¶
RemoveFavoriteOfUser removes "favorite_of_user" edges to User entities.
func (*TagUpdate) RemoveFavoriteOfUserIDs ¶
RemoveFavoriteOfUserIDs removes the "favorite_of_user" edge to User entities by IDs.
func (*TagUpdate) RemoveMeta ¶
RemoveMeta removes "meta" edges to Meta entities.
func (*TagUpdate) RemoveMetumIDs ¶
RemoveMetumIDs removes the "meta" edge to Meta entities by IDs.
func (*TagUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*TagUpdate) SetFavorite ¶
SetFavorite sets the "favorite" field.
func (*TagUpdate) SetNillableFavorite ¶
SetNillableFavorite sets the "favorite" field if the given value is not nil.
func (*TagUpdate) SetNillableHidden ¶
SetNillableHidden sets the "hidden" field if the given value is not nil.
func (*TagUpdate) SetNillableName ¶
SetNillableName sets the "name" field if the given value is not nil.
type TagUpdateOne ¶
type TagUpdateOne struct {
// contains filtered or unexported fields
}
TagUpdateOne is the builder for updating a single Tag entity.
func (*TagUpdateOne) AddFavoriteOfUser ¶
func (tuo *TagUpdateOne) AddFavoriteOfUser(u ...*User) *TagUpdateOne
AddFavoriteOfUser adds the "favorite_of_user" edges to the User entity.
func (*TagUpdateOne) AddFavoriteOfUserIDs ¶
func (tuo *TagUpdateOne) AddFavoriteOfUserIDs(ids ...int) *TagUpdateOne
AddFavoriteOfUserIDs adds the "favorite_of_user" edge to the User entity by IDs.
func (*TagUpdateOne) AddMeta ¶
func (tuo *TagUpdateOne) AddMeta(m ...*Meta) *TagUpdateOne
AddMeta adds the "meta" edges to the Meta entity.
func (*TagUpdateOne) AddMetumIDs ¶
func (tuo *TagUpdateOne) AddMetumIDs(ids ...int) *TagUpdateOne
AddMetumIDs adds the "meta" edge to the Meta entity by IDs.
func (*TagUpdateOne) ClearFavoriteOfUser ¶
func (tuo *TagUpdateOne) ClearFavoriteOfUser() *TagUpdateOne
ClearFavoriteOfUser clears all "favorite_of_user" edges to the User entity.
func (*TagUpdateOne) ClearMeta ¶
func (tuo *TagUpdateOne) ClearMeta() *TagUpdateOne
ClearMeta clears all "meta" edges to the Meta 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) RemoveFavoriteOfUser ¶
func (tuo *TagUpdateOne) RemoveFavoriteOfUser(u ...*User) *TagUpdateOne
RemoveFavoriteOfUser removes "favorite_of_user" edges to User entities.
func (*TagUpdateOne) RemoveFavoriteOfUserIDs ¶
func (tuo *TagUpdateOne) RemoveFavoriteOfUserIDs(ids ...int) *TagUpdateOne
RemoveFavoriteOfUserIDs removes the "favorite_of_user" edge to User entities by IDs.
func (*TagUpdateOne) RemoveMeta ¶
func (tuo *TagUpdateOne) RemoveMeta(m ...*Meta) *TagUpdateOne
RemoveMeta removes "meta" edges to Meta entities.
func (*TagUpdateOne) RemoveMetumIDs ¶
func (tuo *TagUpdateOne) RemoveMetumIDs(ids ...int) *TagUpdateOne
RemoveMetumIDs removes the "meta" edge to Meta entities by IDs.
func (*TagUpdateOne) Save ¶
func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)
Save executes the query and returns the updated Tag entity.
func (*TagUpdateOne) SaveX ¶
func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag
SaveX is like Save, but panics if an error occurs.
func (*TagUpdateOne) Select ¶
func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TagUpdateOne) SetFavorite ¶
func (tuo *TagUpdateOne) SetFavorite(b bool) *TagUpdateOne
SetFavorite sets the "favorite" field.
func (*TagUpdateOne) SetHidden ¶
func (tuo *TagUpdateOne) SetHidden(b bool) *TagUpdateOne
SetHidden sets the "hidden" field.
func (*TagUpdateOne) SetName ¶
func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne
SetName sets the "name" field.
func (*TagUpdateOne) SetNillableFavorite ¶
func (tuo *TagUpdateOne) SetNillableFavorite(b *bool) *TagUpdateOne
SetNillableFavorite sets the "favorite" field if the given value is not nil.
func (*TagUpdateOne) SetNillableHidden ¶
func (tuo *TagUpdateOne) SetNillableHidden(b *bool) *TagUpdateOne
SetNillableHidden sets the "hidden" field if the given value is not nil.
func (*TagUpdateOne) SetNillableName ¶
func (tuo *TagUpdateOne) SetNillableName(s *string) *TagUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*TagUpdateOne) Where ¶
func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne
Where appends a list predicates to the TagUpdate builder.
type TagUpsert ¶
TagUpsert is the "OnConflict" setter.
func (*TagUpsert) SetFavorite ¶
SetFavorite sets the "favorite" field.
func (*TagUpsert) UpdateFavorite ¶
UpdateFavorite sets the "favorite" field to the value that was provided on create.
func (*TagUpsert) UpdateHidden ¶
UpdateHidden sets the "hidden" field to the value that was provided on create.
func (*TagUpsert) UpdateName ¶
UpdateName sets the "name" field to the value that was provided on create.
type TagUpsertBulk ¶
type TagUpsertBulk struct {
// contains filtered or unexported fields
}
TagUpsertBulk is the builder for "upsert"-ing a bulk of Tag nodes.
func (*TagUpsertBulk) DoNothing ¶
func (u *TagUpsertBulk) DoNothing() *TagUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*TagUpsertBulk) Exec ¶
func (u *TagUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TagUpsertBulk) ExecX ¶
func (u *TagUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagUpsertBulk) Ignore ¶
func (u *TagUpsertBulk) Ignore() *TagUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Tag.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*TagUpsertBulk) SetFavorite ¶
func (u *TagUpsertBulk) SetFavorite(v bool) *TagUpsertBulk
SetFavorite sets the "favorite" field.
func (*TagUpsertBulk) SetHidden ¶
func (u *TagUpsertBulk) SetHidden(v bool) *TagUpsertBulk
SetHidden sets the "hidden" field.
func (*TagUpsertBulk) SetName ¶
func (u *TagUpsertBulk) SetName(v string) *TagUpsertBulk
SetName sets the "name" field.
func (*TagUpsertBulk) Update ¶
func (u *TagUpsertBulk) Update(set func(*TagUpsert)) *TagUpsertBulk
Update allows overriding fields `UPDATE` values. See the TagCreateBulk.OnConflict documentation for more info.
func (*TagUpsertBulk) UpdateFavorite ¶
func (u *TagUpsertBulk) UpdateFavorite() *TagUpsertBulk
UpdateFavorite sets the "favorite" field to the value that was provided on create.
func (*TagUpsertBulk) UpdateHidden ¶
func (u *TagUpsertBulk) UpdateHidden() *TagUpsertBulk
UpdateHidden sets the "hidden" field to the value that was provided on create.
func (*TagUpsertBulk) UpdateName ¶
func (u *TagUpsertBulk) UpdateName() *TagUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*TagUpsertBulk) UpdateNewValues ¶
func (u *TagUpsertBulk) UpdateNewValues() *TagUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Tag.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
type TagUpsertOne ¶
type TagUpsertOne struct {
// contains filtered or unexported fields
}
TagUpsertOne is the builder for "upsert"-ing
one Tag node.
func (*TagUpsertOne) DoNothing ¶
func (u *TagUpsertOne) DoNothing() *TagUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*TagUpsertOne) Exec ¶
func (u *TagUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*TagUpsertOne) ExecX ¶
func (u *TagUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagUpsertOne) ID ¶
func (u *TagUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*TagUpsertOne) IDX ¶
func (u *TagUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*TagUpsertOne) Ignore ¶
func (u *TagUpsertOne) Ignore() *TagUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Tag.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*TagUpsertOne) SetFavorite ¶
func (u *TagUpsertOne) SetFavorite(v bool) *TagUpsertOne
SetFavorite sets the "favorite" field.
func (*TagUpsertOne) SetHidden ¶
func (u *TagUpsertOne) SetHidden(v bool) *TagUpsertOne
SetHidden sets the "hidden" field.
func (*TagUpsertOne) SetName ¶
func (u *TagUpsertOne) SetName(v string) *TagUpsertOne
SetName sets the "name" field.
func (*TagUpsertOne) Update ¶
func (u *TagUpsertOne) Update(set func(*TagUpsert)) *TagUpsertOne
Update allows overriding fields `UPDATE` values. See the TagCreate.OnConflict documentation for more info.
func (*TagUpsertOne) UpdateFavorite ¶
func (u *TagUpsertOne) UpdateFavorite() *TagUpsertOne
UpdateFavorite sets the "favorite" field to the value that was provided on create.
func (*TagUpsertOne) UpdateHidden ¶
func (u *TagUpsertOne) UpdateHidden() *TagUpsertOne
UpdateHidden sets the "hidden" field to the value that was provided on create.
func (*TagUpsertOne) UpdateName ¶
func (u *TagUpsertOne) UpdateName() *TagUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*TagUpsertOne) UpdateNewValues ¶
func (u *TagUpsertOne) UpdateNewValues() *TagUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Tag.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // History is the client for interacting with the History builders. History *HistoryClient // Meta is the client for interacting with the Meta builders. Meta *MetaClient // Progress is the client for interacting with the Progress builders. Progress *ProgressClient // 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"` // Email holds the value of the "email" field. Email string `json:"email,omitempty"` // Active holds the value of the "active" field. Active bool `json:"active,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) QueryFavoriteItems ¶
QueryFavoriteItems queries the "favorite_items" edge of the User entity.
func (*User) QueryFavoriteTags ¶
QueryFavoriteTags queries the "favorite_tags" edge of the User entity.
func (*User) QueryHistories ¶
func (u *User) QueryHistories() *HistoryQuery
QueryHistories queries the "histories" edge of the User entity.
func (*User) QueryProgress ¶
func (u *User) QueryProgress() *ProgressQuery
QueryProgress queries the "progress" 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) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryFavoriteItems ¶
func (c *UserClient) QueryFavoriteItems(u *User) *MetaQuery
QueryFavoriteItems queries the favorite_items edge of a User.
func (*UserClient) QueryFavoriteTags ¶
func (c *UserClient) QueryFavoriteTags(u *User) *TagQuery
QueryFavoriteTags queries the favorite_tags edge of a User.
func (*UserClient) QueryHistories ¶
func (c *UserClient) QueryHistories(u *User) *HistoryQuery
QueryHistories queries the histories edge of a User.
func (*UserClient) QueryProgress ¶
func (c *UserClient) QueryProgress(u *User) *ProgressQuery
QueryProgress queries the progress 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) AddFavoriteItemIDs ¶
func (uc *UserCreate) AddFavoriteItemIDs(ids ...int) *UserCreate
AddFavoriteItemIDs adds the "favorite_items" edge to the Meta entity by IDs.
func (*UserCreate) AddFavoriteItems ¶
func (uc *UserCreate) AddFavoriteItems(m ...*Meta) *UserCreate
AddFavoriteItems adds the "favorite_items" edges to the Meta entity.
func (*UserCreate) AddFavoriteTagIDs ¶
func (uc *UserCreate) AddFavoriteTagIDs(ids ...int) *UserCreate
AddFavoriteTagIDs adds the "favorite_tags" edge to the Tag entity by IDs.
func (*UserCreate) AddFavoriteTags ¶
func (uc *UserCreate) AddFavoriteTags(t ...*Tag) *UserCreate
AddFavoriteTags adds the "favorite_tags" edges to the Tag entity.
func (*UserCreate) AddHistories ¶
func (uc *UserCreate) AddHistories(h ...*History) *UserCreate
AddHistories adds the "histories" edges to the History entity.
func (*UserCreate) AddHistoryIDs ¶
func (uc *UserCreate) AddHistoryIDs(ids ...int) *UserCreate
AddHistoryIDs adds the "histories" edge to the History entity by IDs.
func (*UserCreate) AddProgresIDs ¶
func (uc *UserCreate) AddProgresIDs(ids ...int) *UserCreate
AddProgresIDs adds the "progress" edge to the Progress entity by IDs.
func (*UserCreate) AddProgress ¶
func (uc *UserCreate) AddProgress(p ...*Progress) *UserCreate
AddProgress adds the "progress" edges to the Progress entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) OnConflict ¶
func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.User.Create(). SetEmail(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.UserUpsert) { SetEmail(v+v). }). Exec(ctx)
func (*UserCreate) OnConflictColumns ¶
func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetActive ¶
func (uc *UserCreate) SetActive(b bool) *UserCreate
SetActive sets the "active" field.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetNillableActive ¶
func (uc *UserCreate) SetNillableActive(b *bool) *UserCreate
SetNillableActive sets the "active" field if the given value is not nil.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreateBulk) OnConflict ¶
func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.User.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.UserUpsert) { SetEmail(v+v). }). Exec(ctx)
func (*UserCreateBulk) OnConflictColumns ¶
func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
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 { // FavoriteItems holds the value of the favorite_items edge. FavoriteItems []*Meta `json:"favorite_items,omitempty"` // FavoriteTags holds the value of the favorite_tags edge. FavoriteTags []*Tag `json:"favorite_tags,omitempty"` // Histories holds the value of the histories edge. Histories []*History `json:"histories,omitempty"` // Progress holds the value of the progress edge. Progress []*Progress `json:"progress,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) FavoriteItemsOrErr ¶
FavoriteItemsOrErr returns the FavoriteItems value or an error if the edge was not loaded in eager-loading.
func (UserEdges) FavoriteTagsOrErr ¶
FavoriteTagsOrErr returns the FavoriteTags value or an error if the edge was not loaded in eager-loading.
func (UserEdges) HistoriesOrErr ¶
HistoriesOrErr returns the Histories value or an error if the edge was not loaded in eager-loading.
func (UserEdges) ProgressOrErr ¶
ProgressOrErr returns the Progress 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) Active ¶
func (m *UserMutation) Active() (r bool, exists bool)
Active returns the value of the "active" field in the mutation.
func (*UserMutation) AddFavoriteItemIDs ¶
func (m *UserMutation) AddFavoriteItemIDs(ids ...int)
AddFavoriteItemIDs adds the "favorite_items" edge to the Meta entity by ids.
func (*UserMutation) AddFavoriteTagIDs ¶
func (m *UserMutation) AddFavoriteTagIDs(ids ...int)
AddFavoriteTagIDs adds the "favorite_tags" edge to the Tag 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) AddHistoryIDs ¶
func (m *UserMutation) AddHistoryIDs(ids ...int)
AddHistoryIDs adds the "histories" edge to the History entity by ids.
func (*UserMutation) AddProgresIDs ¶
func (m *UserMutation) AddProgresIDs(ids ...int)
AddProgresIDs adds the "progress" edge to the Progress 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) 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) ClearFavoriteItems ¶
func (m *UserMutation) ClearFavoriteItems()
ClearFavoriteItems clears the "favorite_items" edge to the Meta entity.
func (*UserMutation) ClearFavoriteTags ¶
func (m *UserMutation) ClearFavoriteTags()
ClearFavoriteTags clears the "favorite_tags" edge to the Tag entity.
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) ClearHistories ¶
func (m *UserMutation) ClearHistories()
ClearHistories clears the "histories" edge to the History entity.
func (*UserMutation) ClearProgress ¶
func (m *UserMutation) ClearProgress()
ClearProgress clears the "progress" edge to the Progress 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) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) FavoriteItemsCleared ¶
func (m *UserMutation) FavoriteItemsCleared() bool
FavoriteItemsCleared reports if the "favorite_items" edge to the Meta entity was cleared.
func (*UserMutation) FavoriteItemsIDs ¶
func (m *UserMutation) FavoriteItemsIDs() (ids []int)
FavoriteItemsIDs returns the "favorite_items" edge IDs in the mutation.
func (*UserMutation) FavoriteTagsCleared ¶
func (m *UserMutation) FavoriteTagsCleared() bool
FavoriteTagsCleared reports if the "favorite_tags" edge to the Tag entity was cleared.
func (*UserMutation) FavoriteTagsIDs ¶
func (m *UserMutation) FavoriteTagsIDs() (ids []int)
FavoriteTagsIDs returns the "favorite_tags" edge IDs in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) HistoriesCleared ¶
func (m *UserMutation) HistoriesCleared() bool
HistoriesCleared reports if the "histories" edge to the History entity was cleared.
func (*UserMutation) HistoriesIDs ¶
func (m *UserMutation) HistoriesIDs() (ids []int)
HistoriesIDs returns the "histories" edge IDs in the mutation.
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) OldActive ¶
func (m *UserMutation) OldActive(ctx context.Context) (v bool, err error)
OldActive returns the old "active" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) ProgressCleared ¶
func (m *UserMutation) ProgressCleared() bool
ProgressCleared reports if the "progress" edge to the Progress entity was cleared.
func (*UserMutation) ProgressIDs ¶
func (m *UserMutation) ProgressIDs() (ids []int)
ProgressIDs returns the "progress" edge IDs in the mutation.
func (*UserMutation) RemoveFavoriteItemIDs ¶
func (m *UserMutation) RemoveFavoriteItemIDs(ids ...int)
RemoveFavoriteItemIDs removes the "favorite_items" edge to the Meta entity by IDs.
func (*UserMutation) RemoveFavoriteTagIDs ¶
func (m *UserMutation) RemoveFavoriteTagIDs(ids ...int)
RemoveFavoriteTagIDs removes the "favorite_tags" edge to the Tag entity by IDs.
func (*UserMutation) RemoveHistoryIDs ¶
func (m *UserMutation) RemoveHistoryIDs(ids ...int)
RemoveHistoryIDs removes the "histories" edge to the History entity by IDs.
func (*UserMutation) RemoveProgresIDs ¶
func (m *UserMutation) RemoveProgresIDs(ids ...int)
RemoveProgresIDs removes the "progress" edge to the Progress entity by IDs.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedFavoriteItemsIDs ¶
func (m *UserMutation) RemovedFavoriteItemsIDs() (ids []int)
RemovedFavoriteItems returns the removed IDs of the "favorite_items" edge to the Meta entity.
func (*UserMutation) RemovedFavoriteTagsIDs ¶
func (m *UserMutation) RemovedFavoriteTagsIDs() (ids []int)
RemovedFavoriteTags returns the removed IDs of the "favorite_tags" edge to the Tag entity.
func (*UserMutation) RemovedHistoriesIDs ¶
func (m *UserMutation) RemovedHistoriesIDs() (ids []int)
RemovedHistories returns the removed IDs of the "histories" edge to the History entity.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) RemovedProgressIDs ¶
func (m *UserMutation) RemovedProgressIDs() (ids []int)
RemovedProgress returns the removed IDs of the "progress" edge to the Progress entity.
func (*UserMutation) ResetActive ¶
func (m *UserMutation) ResetActive()
ResetActive resets all changes to the "active" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetFavoriteItems ¶
func (m *UserMutation) ResetFavoriteItems()
ResetFavoriteItems resets all changes to the "favorite_items" edge.
func (*UserMutation) ResetFavoriteTags ¶
func (m *UserMutation) ResetFavoriteTags()
ResetFavoriteTags resets all changes to the "favorite_tags" edge.
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) ResetHistories ¶
func (m *UserMutation) ResetHistories()
ResetHistories resets all changes to the "histories" edge.
func (*UserMutation) ResetProgress ¶
func (m *UserMutation) ResetProgress()
ResetProgress resets all changes to the "progress" edge.
func (*UserMutation) SetActive ¶
func (m *UserMutation) SetActive(b bool)
SetActive sets the "active" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
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) 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 { Email string `json:"email,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldEmail). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryFavoriteItems ¶
QueryFavoriteItems chains the current query on the "favorite_items" edge.
func (*UserQuery) QueryFavoriteTags ¶
QueryFavoriteTags chains the current query on the "favorite_tags" edge.
func (*UserQuery) QueryHistories ¶
func (uq *UserQuery) QueryHistories() *HistoryQuery
QueryHistories chains the current query on the "histories" edge.
func (*UserQuery) QueryProgress ¶
func (uq *UserQuery) QueryProgress() *ProgressQuery
QueryProgress chains the current query on the "progress" 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 { Email string `json:"email,omitempty"` } client.User.Query(). Select(user.FieldEmail). 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) WithFavoriteItems ¶
WithFavoriteItems tells the query-builder to eager-load the nodes that are connected to the "favorite_items" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithFavoriteTags ¶
WithFavoriteTags tells the query-builder to eager-load the nodes that are connected to the "favorite_tags" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithHistories ¶
func (uq *UserQuery) WithHistories(opts ...func(*HistoryQuery)) *UserQuery
WithHistories tells the query-builder to eager-load the nodes that are connected to the "histories" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithProgress ¶
func (uq *UserQuery) WithProgress(opts ...func(*ProgressQuery)) *UserQuery
WithProgress tells the query-builder to eager-load the nodes that are connected to the "progress" 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) AddFavoriteItemIDs ¶
func (uu *UserUpdate) AddFavoriteItemIDs(ids ...int) *UserUpdate
AddFavoriteItemIDs adds the "favorite_items" edge to the Meta entity by IDs.
func (*UserUpdate) AddFavoriteItems ¶
func (uu *UserUpdate) AddFavoriteItems(m ...*Meta) *UserUpdate
AddFavoriteItems adds the "favorite_items" edges to the Meta entity.
func (*UserUpdate) AddFavoriteTagIDs ¶
func (uu *UserUpdate) AddFavoriteTagIDs(ids ...int) *UserUpdate
AddFavoriteTagIDs adds the "favorite_tags" edge to the Tag entity by IDs.
func (*UserUpdate) AddFavoriteTags ¶
func (uu *UserUpdate) AddFavoriteTags(t ...*Tag) *UserUpdate
AddFavoriteTags adds the "favorite_tags" edges to the Tag entity.
func (*UserUpdate) AddHistories ¶
func (uu *UserUpdate) AddHistories(h ...*History) *UserUpdate
AddHistories adds the "histories" edges to the History entity.
func (*UserUpdate) AddHistoryIDs ¶
func (uu *UserUpdate) AddHistoryIDs(ids ...int) *UserUpdate
AddHistoryIDs adds the "histories" edge to the History entity by IDs.
func (*UserUpdate) AddProgresIDs ¶
func (uu *UserUpdate) AddProgresIDs(ids ...int) *UserUpdate
AddProgresIDs adds the "progress" edge to the Progress entity by IDs.
func (*UserUpdate) AddProgress ¶
func (uu *UserUpdate) AddProgress(p ...*Progress) *UserUpdate
AddProgress adds the "progress" edges to the Progress entity.
func (*UserUpdate) ClearFavoriteItems ¶
func (uu *UserUpdate) ClearFavoriteItems() *UserUpdate
ClearFavoriteItems clears all "favorite_items" edges to the Meta entity.
func (*UserUpdate) ClearFavoriteTags ¶
func (uu *UserUpdate) ClearFavoriteTags() *UserUpdate
ClearFavoriteTags clears all "favorite_tags" edges to the Tag entity.
func (*UserUpdate) ClearHistories ¶
func (uu *UserUpdate) ClearHistories() *UserUpdate
ClearHistories clears all "histories" edges to the History entity.
func (*UserUpdate) ClearProgress ¶
func (uu *UserUpdate) ClearProgress() *UserUpdate
ClearProgress clears all "progress" edges to the Progress 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) RemoveFavoriteItemIDs ¶
func (uu *UserUpdate) RemoveFavoriteItemIDs(ids ...int) *UserUpdate
RemoveFavoriteItemIDs removes the "favorite_items" edge to Meta entities by IDs.
func (*UserUpdate) RemoveFavoriteItems ¶
func (uu *UserUpdate) RemoveFavoriteItems(m ...*Meta) *UserUpdate
RemoveFavoriteItems removes "favorite_items" edges to Meta entities.
func (*UserUpdate) RemoveFavoriteTagIDs ¶
func (uu *UserUpdate) RemoveFavoriteTagIDs(ids ...int) *UserUpdate
RemoveFavoriteTagIDs removes the "favorite_tags" edge to Tag entities by IDs.
func (*UserUpdate) RemoveFavoriteTags ¶
func (uu *UserUpdate) RemoveFavoriteTags(t ...*Tag) *UserUpdate
RemoveFavoriteTags removes "favorite_tags" edges to Tag entities.
func (*UserUpdate) RemoveHistories ¶
func (uu *UserUpdate) RemoveHistories(h ...*History) *UserUpdate
RemoveHistories removes "histories" edges to History entities.
func (*UserUpdate) RemoveHistoryIDs ¶
func (uu *UserUpdate) RemoveHistoryIDs(ids ...int) *UserUpdate
RemoveHistoryIDs removes the "histories" edge to History entities by IDs.
func (*UserUpdate) RemoveProgresIDs ¶
func (uu *UserUpdate) RemoveProgresIDs(ids ...int) *UserUpdate
RemoveProgresIDs removes the "progress" edge to Progress entities by IDs.
func (*UserUpdate) RemoveProgress ¶
func (uu *UserUpdate) RemoveProgress(p ...*Progress) *UserUpdate
RemoveProgress removes "progress" edges to Progress 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) SetActive ¶
func (uu *UserUpdate) SetActive(b bool) *UserUpdate
SetActive sets the "active" field.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetNillableActive ¶
func (uu *UserUpdate) SetNillableActive(b *bool) *UserUpdate
SetNillableActive sets the "active" field if the given value is not nil.
func (*UserUpdate) SetNillableEmail ¶
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
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) AddFavoriteItemIDs ¶
func (uuo *UserUpdateOne) AddFavoriteItemIDs(ids ...int) *UserUpdateOne
AddFavoriteItemIDs adds the "favorite_items" edge to the Meta entity by IDs.
func (*UserUpdateOne) AddFavoriteItems ¶
func (uuo *UserUpdateOne) AddFavoriteItems(m ...*Meta) *UserUpdateOne
AddFavoriteItems adds the "favorite_items" edges to the Meta entity.
func (*UserUpdateOne) AddFavoriteTagIDs ¶
func (uuo *UserUpdateOne) AddFavoriteTagIDs(ids ...int) *UserUpdateOne
AddFavoriteTagIDs adds the "favorite_tags" edge to the Tag entity by IDs.
func (*UserUpdateOne) AddFavoriteTags ¶
func (uuo *UserUpdateOne) AddFavoriteTags(t ...*Tag) *UserUpdateOne
AddFavoriteTags adds the "favorite_tags" edges to the Tag entity.
func (*UserUpdateOne) AddHistories ¶
func (uuo *UserUpdateOne) AddHistories(h ...*History) *UserUpdateOne
AddHistories adds the "histories" edges to the History entity.
func (*UserUpdateOne) AddHistoryIDs ¶
func (uuo *UserUpdateOne) AddHistoryIDs(ids ...int) *UserUpdateOne
AddHistoryIDs adds the "histories" edge to the History entity by IDs.
func (*UserUpdateOne) AddProgresIDs ¶
func (uuo *UserUpdateOne) AddProgresIDs(ids ...int) *UserUpdateOne
AddProgresIDs adds the "progress" edge to the Progress entity by IDs.
func (*UserUpdateOne) AddProgress ¶
func (uuo *UserUpdateOne) AddProgress(p ...*Progress) *UserUpdateOne
AddProgress adds the "progress" edges to the Progress entity.
func (*UserUpdateOne) ClearFavoriteItems ¶
func (uuo *UserUpdateOne) ClearFavoriteItems() *UserUpdateOne
ClearFavoriteItems clears all "favorite_items" edges to the Meta entity.
func (*UserUpdateOne) ClearFavoriteTags ¶
func (uuo *UserUpdateOne) ClearFavoriteTags() *UserUpdateOne
ClearFavoriteTags clears all "favorite_tags" edges to the Tag entity.
func (*UserUpdateOne) ClearHistories ¶
func (uuo *UserUpdateOne) ClearHistories() *UserUpdateOne
ClearHistories clears all "histories" edges to the History entity.
func (*UserUpdateOne) ClearProgress ¶
func (uuo *UserUpdateOne) ClearProgress() *UserUpdateOne
ClearProgress clears all "progress" edges to the Progress 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) RemoveFavoriteItemIDs ¶
func (uuo *UserUpdateOne) RemoveFavoriteItemIDs(ids ...int) *UserUpdateOne
RemoveFavoriteItemIDs removes the "favorite_items" edge to Meta entities by IDs.
func (*UserUpdateOne) RemoveFavoriteItems ¶
func (uuo *UserUpdateOne) RemoveFavoriteItems(m ...*Meta) *UserUpdateOne
RemoveFavoriteItems removes "favorite_items" edges to Meta entities.
func (*UserUpdateOne) RemoveFavoriteTagIDs ¶
func (uuo *UserUpdateOne) RemoveFavoriteTagIDs(ids ...int) *UserUpdateOne
RemoveFavoriteTagIDs removes the "favorite_tags" edge to Tag entities by IDs.
func (*UserUpdateOne) RemoveFavoriteTags ¶
func (uuo *UserUpdateOne) RemoveFavoriteTags(t ...*Tag) *UserUpdateOne
RemoveFavoriteTags removes "favorite_tags" edges to Tag entities.
func (*UserUpdateOne) RemoveHistories ¶
func (uuo *UserUpdateOne) RemoveHistories(h ...*History) *UserUpdateOne
RemoveHistories removes "histories" edges to History entities.
func (*UserUpdateOne) RemoveHistoryIDs ¶
func (uuo *UserUpdateOne) RemoveHistoryIDs(ids ...int) *UserUpdateOne
RemoveHistoryIDs removes the "histories" edge to History entities by IDs.
func (*UserUpdateOne) RemoveProgresIDs ¶
func (uuo *UserUpdateOne) RemoveProgresIDs(ids ...int) *UserUpdateOne
RemoveProgresIDs removes the "progress" edge to Progress entities by IDs.
func (*UserUpdateOne) RemoveProgress ¶
func (uuo *UserUpdateOne) RemoveProgress(p ...*Progress) *UserUpdateOne
RemoveProgress removes "progress" edges to Progress 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) SetActive ¶
func (uuo *UserUpdateOne) SetActive(b bool) *UserUpdateOne
SetActive sets the "active" field.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetNillableActive ¶
func (uuo *UserUpdateOne) SetNillableActive(b *bool) *UserUpdateOne
SetNillableActive sets the "active" field if the given value is not nil.
func (*UserUpdateOne) SetNillableEmail ¶
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type UserUpsert ¶
UserUpsert is the "OnConflict" setter.
func (*UserUpsert) SetActive ¶
func (u *UserUpsert) SetActive(v bool) *UserUpsert
SetActive sets the "active" field.
func (*UserUpsert) SetEmail ¶
func (u *UserUpsert) SetEmail(v string) *UserUpsert
SetEmail sets the "email" field.
func (*UserUpsert) UpdateActive ¶
func (u *UserUpsert) UpdateActive() *UserUpsert
UpdateActive sets the "active" field to the value that was provided on create.
func (*UserUpsert) UpdateEmail ¶
func (u *UserUpsert) UpdateEmail() *UserUpsert
UpdateEmail sets the "email" field to the value that was provided on create.
type UserUpsertBulk ¶
type UserUpsertBulk struct {
// contains filtered or unexported fields
}
UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.
func (*UserUpsertBulk) DoNothing ¶
func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserUpsertBulk) Exec ¶
func (u *UserUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpsertBulk) ExecX ¶
func (u *UserUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpsertBulk) Ignore ¶
func (u *UserUpsertBulk) Ignore() *UserUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserUpsertBulk) SetActive ¶
func (u *UserUpsertBulk) SetActive(v bool) *UserUpsertBulk
SetActive sets the "active" field.
func (*UserUpsertBulk) SetEmail ¶
func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk
SetEmail sets the "email" field.
func (*UserUpsertBulk) Update ¶
func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk
Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.
func (*UserUpsertBulk) UpdateActive ¶
func (u *UserUpsertBulk) UpdateActive() *UserUpsertBulk
UpdateActive sets the "active" field to the value that was provided on create.
func (*UserUpsertBulk) UpdateEmail ¶
func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk
UpdateEmail sets the "email" field to the value that was provided on create.
func (*UserUpsertBulk) UpdateNewValues ¶
func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.User.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
type UserUpsertOne ¶
type UserUpsertOne struct {
// contains filtered or unexported fields
}
UserUpsertOne is the builder for "upsert"-ing
one User node.
func (*UserUpsertOne) DoNothing ¶
func (u *UserUpsertOne) DoNothing() *UserUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserUpsertOne) Exec ¶
func (u *UserUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpsertOne) ExecX ¶
func (u *UserUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpsertOne) ID ¶
func (u *UserUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*UserUpsertOne) IDX ¶
func (u *UserUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*UserUpsertOne) Ignore ¶
func (u *UserUpsertOne) Ignore() *UserUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserUpsertOne) SetActive ¶
func (u *UserUpsertOne) SetActive(v bool) *UserUpsertOne
SetActive sets the "active" field.
func (*UserUpsertOne) SetEmail ¶
func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne
SetEmail sets the "email" field.
func (*UserUpsertOne) Update ¶
func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne
Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.
func (*UserUpsertOne) UpdateActive ¶
func (u *UserUpsertOne) UpdateActive() *UserUpsertOne
UpdateActive sets the "active" field to the value that was provided on create.
func (*UserUpsertOne) UpdateEmail ¶
func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne
UpdateEmail sets the "email" field to the value that was provided on create.
func (*UserUpsertOne) UpdateNewValues ¶
func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.User.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
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
¶
- client.go
- ent.go
- generate.go
- history.go
- history_create.go
- history_delete.go
- history_query.go
- history_update.go
- meta.go
- meta_create.go
- meta_delete.go
- meta_query.go
- meta_update.go
- mutation.go
- progress.go
- progress_create.go
- progress_delete.go
- progress_query.go
- progress_update.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