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 Hook
- type InterceptFunc
- type Interceptor
- type Meta
- 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) 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) 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) SetCreateTime(t time.Time) *MetaCreate
- func (mc *MetaCreate) SetFavorite(b bool) *MetaCreate
- func (mc *MetaCreate) SetFileIndices(i []int) *MetaCreate
- func (mc *MetaCreate) SetName(s string) *MetaCreate
- func (mc *MetaCreate) SetNillableActive(b *bool) *MetaCreate
- func (mc *MetaCreate) SetNillableCreateTime(t *time.Time) *MetaCreate
- func (mc *MetaCreate) SetNillableFavorite(b *bool) *MetaCreate
- func (mc *MetaCreate) SetNillableRead(b *bool) *MetaCreate
- func (mc *MetaCreate) SetRead(b bool) *MetaCreate
- func (mc *MetaCreate) SetThumbnail(b []byte) *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) AddField(name string, value ent.Value) error
- func (m *MetaMutation) AddTagIDs(ids ...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) AppendFileIndices(i []int)
- func (m *MetaMutation) AppendedFileIndices() ([]int, bool)
- func (m *MetaMutation) ClearEdge(name string) error
- func (m *MetaMutation) ClearField(name string) error
- func (m *MetaMutation) ClearTags()
- func (m *MetaMutation) ClearThumbnail()
- func (m *MetaMutation) ClearedEdges() []string
- func (m *MetaMutation) ClearedFields() []string
- func (m MetaMutation) Client() *Client
- 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) 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) 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) 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) OldName(ctx context.Context) (v string, err error)
- func (m *MetaMutation) OldRead(ctx context.Context) (v bool, err error)
- func (m *MetaMutation) OldThumbnail(ctx context.Context) (v []byte, err error)
- func (m *MetaMutation) Op() Op
- func (m *MetaMutation) Read() (r bool, exists bool)
- func (m *MetaMutation) RemoveTagIDs(ids ...int)
- func (m *MetaMutation) RemovedEdges() []string
- func (m *MetaMutation) RemovedIDs(name string) []ent.Value
- func (m *MetaMutation) RemovedTagsIDs() (ids []int)
- func (m *MetaMutation) ResetActive()
- func (m *MetaMutation) ResetCreateTime()
- func (m *MetaMutation) ResetEdge(name string) error
- func (m *MetaMutation) ResetFavorite()
- func (m *MetaMutation) ResetField(name string) error
- func (m *MetaMutation) ResetFileIndices()
- func (m *MetaMutation) ResetName()
- func (m *MetaMutation) ResetRead()
- func (m *MetaMutation) ResetTags()
- func (m *MetaMutation) ResetThumbnail()
- func (m *MetaMutation) SetActive(b bool)
- 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) SetName(s string)
- func (m *MetaMutation) SetOp(op Op)
- func (m *MetaMutation) SetRead(b bool)
- func (m *MetaMutation) SetThumbnail(b []byte)
- func (m *MetaMutation) TagsCleared() bool
- func (m *MetaMutation) TagsIDs() (ids []int)
- func (m *MetaMutation) Thumbnail() (r []byte, exists bool)
- func (m *MetaMutation) ThumbnailCleared() 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) 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) 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) AddTagIDs(ids ...int) *MetaUpdate
- func (mu *MetaUpdate) AddTags(t ...*Tag) *MetaUpdate
- func (mu *MetaUpdate) AppendFileIndices(i []int) *MetaUpdate
- func (mu *MetaUpdate) ClearTags() *MetaUpdate
- func (mu *MetaUpdate) ClearThumbnail() *MetaUpdate
- func (mu *MetaUpdate) Exec(ctx context.Context) error
- func (mu *MetaUpdate) ExecX(ctx context.Context)
- func (mu *MetaUpdate) Mutation() *MetaMutation
- 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) SetCreateTime(t time.Time) *MetaUpdate
- func (mu *MetaUpdate) SetFavorite(b bool) *MetaUpdate
- func (mu *MetaUpdate) SetFileIndices(i []int) *MetaUpdate
- func (mu *MetaUpdate) SetName(s string) *MetaUpdate
- func (mu *MetaUpdate) SetNillableActive(b *bool) *MetaUpdate
- func (mu *MetaUpdate) SetNillableCreateTime(t *time.Time) *MetaUpdate
- func (mu *MetaUpdate) SetNillableFavorite(b *bool) *MetaUpdate
- func (mu *MetaUpdate) SetNillableName(s *string) *MetaUpdate
- func (mu *MetaUpdate) SetNillableRead(b *bool) *MetaUpdate
- func (mu *MetaUpdate) SetRead(b bool) *MetaUpdate
- func (mu *MetaUpdate) SetThumbnail(b []byte) *MetaUpdate
- func (mu *MetaUpdate) Where(ps ...predicate.Meta) *MetaUpdate
- type MetaUpdateOne
- func (muo *MetaUpdateOne) AddTagIDs(ids ...int) *MetaUpdateOne
- func (muo *MetaUpdateOne) AddTags(t ...*Tag) *MetaUpdateOne
- func (muo *MetaUpdateOne) AppendFileIndices(i []int) *MetaUpdateOne
- func (muo *MetaUpdateOne) ClearTags() *MetaUpdateOne
- func (muo *MetaUpdateOne) ClearThumbnail() *MetaUpdateOne
- func (muo *MetaUpdateOne) Exec(ctx context.Context) error
- func (muo *MetaUpdateOne) ExecX(ctx context.Context)
- func (muo *MetaUpdateOne) Mutation() *MetaMutation
- 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) SetCreateTime(t time.Time) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetFavorite(b bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetFileIndices(i []int) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetName(s string) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableActive(b *bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableCreateTime(t *time.Time) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableFavorite(b *bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableName(s *string) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetNillableRead(b *bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetRead(b bool) *MetaUpdateOne
- func (muo *MetaUpdateOne) SetThumbnail(b []byte) *MetaUpdateOne
- func (muo *MetaUpdateOne) Where(ps ...predicate.Meta) *MetaUpdateOne
- type MetaUpsert
- func (u *MetaUpsert) ClearThumbnail() *MetaUpsert
- func (u *MetaUpsert) SetActive(v bool) *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) SetName(v string) *MetaUpsert
- func (u *MetaUpsert) SetRead(v bool) *MetaUpsert
- func (u *MetaUpsert) SetThumbnail(v []byte) *MetaUpsert
- func (u *MetaUpsert) UpdateActive() *MetaUpsert
- func (u *MetaUpsert) UpdateCreateTime() *MetaUpsert
- func (u *MetaUpsert) UpdateFavorite() *MetaUpsert
- func (u *MetaUpsert) UpdateFileIndices() *MetaUpsert
- func (u *MetaUpsert) UpdateName() *MetaUpsert
- func (u *MetaUpsert) UpdateRead() *MetaUpsert
- func (u *MetaUpsert) UpdateThumbnail() *MetaUpsert
- type MetaUpsertBulk
- func (u *MetaUpsertBulk) ClearThumbnail() *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) SetCreateTime(v time.Time) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetFavorite(v bool) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetFileIndices(v []int) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetName(v string) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetRead(v bool) *MetaUpsertBulk
- func (u *MetaUpsertBulk) SetThumbnail(v []byte) *MetaUpsertBulk
- func (u *MetaUpsertBulk) Update(set func(*MetaUpsert)) *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateActive() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateCreateTime() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateFavorite() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateFileIndices() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateName() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateNewValues() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateRead() *MetaUpsertBulk
- func (u *MetaUpsertBulk) UpdateThumbnail() *MetaUpsertBulk
- type MetaUpsertOne
- func (u *MetaUpsertOne) ClearThumbnail() *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) SetCreateTime(v time.Time) *MetaUpsertOne
- func (u *MetaUpsertOne) SetFavorite(v bool) *MetaUpsertOne
- func (u *MetaUpsertOne) SetFileIndices(v []int) *MetaUpsertOne
- func (u *MetaUpsertOne) SetName(v string) *MetaUpsertOne
- func (u *MetaUpsertOne) SetRead(v bool) *MetaUpsertOne
- func (u *MetaUpsertOne) SetThumbnail(v []byte) *MetaUpsertOne
- func (u *MetaUpsertOne) Update(set func(*MetaUpsert)) *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateActive() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateCreateTime() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateFavorite() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateFileIndices() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateName() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateNewValues() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateRead() *MetaUpsertOne
- func (u *MetaUpsertOne) UpdateThumbnail() *MetaUpsertOne
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tag
- type TagClient
- func (c *TagClient) Create() *TagCreate
- func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk
- func (c *TagClient) Delete() *TagDelete
- func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne
- func (c *TagClient) DeleteOneID(id int) *TagDeleteOne
- func (c *TagClient) Get(ctx context.Context, id int) (*Tag, error)
- func (c *TagClient) GetX(ctx context.Context, id int) *Tag
- func (c *TagClient) Hooks() []Hook
- func (c *TagClient) Intercept(interceptors ...Interceptor)
- func (c *TagClient) Interceptors() []Interceptor
- func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk
- func (c *TagClient) Query() *TagQuery
- 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) 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
- func (tc *TagCreate) SetThumbnail(b []byte) *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) 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) ClearField(name string) error
- func (m *TagMutation) ClearMeta()
- func (m *TagMutation) ClearThumbnail()
- 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) 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) OldThumbnail(ctx context.Context) (v []byte, err error)
- func (m *TagMutation) Op() Op
- func (m *TagMutation) RemoveMetumIDs(ids ...int)
- func (m *TagMutation) RemovedEdges() []string
- 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) ResetField(name string) error
- func (m *TagMutation) ResetHidden()
- func (m *TagMutation) ResetMeta()
- func (m *TagMutation) ResetName()
- func (m *TagMutation) ResetThumbnail()
- 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) SetThumbnail(b []byte)
- func (m *TagMutation) Thumbnail() (r []byte, exists bool)
- func (m *TagMutation) ThumbnailCleared() bool
- func (m TagMutation) Tx() (*Tx, error)
- func (m *TagMutation) Type() string
- func (m *TagMutation) Where(ps ...predicate.Tag)
- func (m *TagMutation) WhereP(ps ...func(*sql.Selector))
- type TagQuery
- func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect
- func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)
- func (tq *TagQuery) AllX(ctx context.Context) []*Tag
- func (tq *TagQuery) Clone() *TagQuery
- func (tq *TagQuery) Count(ctx context.Context) (int, error)
- func (tq *TagQuery) CountX(ctx context.Context) int
- func (tq *TagQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TagQuery) ExistX(ctx context.Context) bool
- func (tq *TagQuery) First(ctx context.Context) (*Tag, error)
- func (tq *TagQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *TagQuery) FirstIDX(ctx context.Context) int
- func (tq *TagQuery) FirstX(ctx context.Context) *Tag
- func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy
- func (tq *TagQuery) IDs(ctx context.Context) (ids []int, err error)
- func (tq *TagQuery) IDsX(ctx context.Context) []int
- func (tq *TagQuery) Limit(limit int) *TagQuery
- func (tq *TagQuery) Offset(offset int) *TagQuery
- func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)
- func (tq *TagQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *TagQuery) OnlyIDX(ctx context.Context) int
- func (tq *TagQuery) OnlyX(ctx context.Context) *Tag
- func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery
- 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) 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) AddMeta(m ...*Meta) *TagUpdate
- func (tu *TagUpdate) AddMetumIDs(ids ...int) *TagUpdate
- func (tu *TagUpdate) ClearMeta() *TagUpdate
- func (tu *TagUpdate) ClearThumbnail() *TagUpdate
- func (tu *TagUpdate) Exec(ctx context.Context) error
- func (tu *TagUpdate) ExecX(ctx context.Context)
- func (tu *TagUpdate) Mutation() *TagMutation
- 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) SetThumbnail(b []byte) *TagUpdate
- func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate
- type TagUpdateOne
- func (tuo *TagUpdateOne) AddMeta(m ...*Meta) *TagUpdateOne
- func (tuo *TagUpdateOne) AddMetumIDs(ids ...int) *TagUpdateOne
- func (tuo *TagUpdateOne) ClearMeta() *TagUpdateOne
- func (tuo *TagUpdateOne) ClearThumbnail() *TagUpdateOne
- func (tuo *TagUpdateOne) Exec(ctx context.Context) error
- func (tuo *TagUpdateOne) ExecX(ctx context.Context)
- func (tuo *TagUpdateOne) Mutation() *TagMutation
- 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) SetThumbnail(b []byte) *TagUpdateOne
- func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne
- type TagUpsert
- func (u *TagUpsert) ClearThumbnail() *TagUpsert
- func (u *TagUpsert) SetFavorite(v bool) *TagUpsert
- func (u *TagUpsert) SetHidden(v bool) *TagUpsert
- func (u *TagUpsert) SetName(v string) *TagUpsert
- func (u *TagUpsert) SetThumbnail(v []byte) *TagUpsert
- func (u *TagUpsert) UpdateFavorite() *TagUpsert
- func (u *TagUpsert) UpdateHidden() *TagUpsert
- func (u *TagUpsert) UpdateName() *TagUpsert
- func (u *TagUpsert) UpdateThumbnail() *TagUpsert
- type TagUpsertBulk
- func (u *TagUpsertBulk) ClearThumbnail() *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) SetThumbnail(v []byte) *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
- func (u *TagUpsertBulk) UpdateThumbnail() *TagUpsertBulk
- type TagUpsertOne
- func (u *TagUpsertOne) ClearThumbnail() *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) SetThumbnail(v []byte) *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
- func (u *TagUpsertOne) UpdateThumbnail() *TagUpsertOne
- type Tags
- type TraverseFunc
- type Traverser
- type Tx
- 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. TypeMeta = "Meta" TypeTag = "Tag" )
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 // Meta is the client for interacting with the Meta builders. Meta *MetaClient // Tag is the client for interacting with the Tag builders. Tag *TagClient // 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(). Meta. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type 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"` // Thumbnail holds the value of the "thumbnail" field. Thumbnail []byte `json:"-"` // 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"` // 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) 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) 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) 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) 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) 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) 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) SetNillableRead ¶
func (mc *MetaCreate) SetNillableRead(b *bool) *MetaCreate
SetNillableRead sets the "read" 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) SetThumbnail ¶
func (mc *MetaCreate) SetThumbnail(b []byte) *MetaCreate
SetThumbnail sets the "thumbnail" 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"` // contains filtered or unexported fields }
MetaEdges holds the relations/edges for other nodes in the graph.
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) 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) AddTagIDs ¶
func (m *MetaMutation) AddTagIDs(ids ...int)
AddTagIDs adds the "tags" edge to the Tag entity by ids.
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) 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) 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) ClearTags ¶
func (m *MetaMutation) ClearTags()
ClearTags clears the "tags" edge to the Tag entity.
func (*MetaMutation) ClearThumbnail ¶
func (m *MetaMutation) ClearThumbnail()
ClearThumbnail clears the value of the "thumbnail" 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) 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) 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) 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) 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) 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) OldThumbnail ¶
func (m *MetaMutation) OldThumbnail(ctx context.Context) (v []byte, err error)
OldThumbnail returns the old "thumbnail" 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) Read ¶
func (m *MetaMutation) Read() (r bool, exists bool)
Read returns the value of the "read" field in the mutation.
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) 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) 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) 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) 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) ResetName ¶
func (m *MetaMutation) ResetName()
ResetName resets all changes to the "name" field.
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) ResetThumbnail ¶
func (m *MetaMutation) ResetThumbnail()
ResetThumbnail resets all changes to the "thumbnail" field.
func (*MetaMutation) SetActive ¶
func (m *MetaMutation) SetActive(b bool)
SetActive sets the "active" 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) 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) SetThumbnail ¶
func (m *MetaMutation) SetThumbnail(b []byte)
SetThumbnail sets the "thumbnail" 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) Thumbnail ¶
func (m *MetaMutation) Thumbnail() (r []byte, exists bool)
Thumbnail returns the value of the "thumbnail" field in the mutation.
func (*MetaMutation) ThumbnailCleared ¶
func (m *MetaMutation) ThumbnailCleared() bool
ThumbnailCleared returns if the "thumbnail" 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) 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.
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) 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) AppendFileIndices ¶
func (mu *MetaUpdate) AppendFileIndices(i []int) *MetaUpdate
AppendFileIndices appends i to the "file_indices" field.
func (*MetaUpdate) ClearTags ¶
func (mu *MetaUpdate) ClearTags() *MetaUpdate
ClearTags clears all "tags" edges to the Tag entity.
func (*MetaUpdate) ClearThumbnail ¶
func (mu *MetaUpdate) ClearThumbnail() *MetaUpdate
ClearThumbnail clears the value of the "thumbnail" 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) 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) 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) 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) 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) 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) SetRead ¶
func (mu *MetaUpdate) SetRead(b bool) *MetaUpdate
SetRead sets the "read" field.
func (*MetaUpdate) SetThumbnail ¶
func (mu *MetaUpdate) SetThumbnail(b []byte) *MetaUpdate
SetThumbnail sets the "thumbnail" 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) 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) AppendFileIndices ¶
func (muo *MetaUpdateOne) AppendFileIndices(i []int) *MetaUpdateOne
AppendFileIndices appends i to the "file_indices" field.
func (*MetaUpdateOne) ClearTags ¶
func (muo *MetaUpdateOne) ClearTags() *MetaUpdateOne
ClearTags clears all "tags" edges to the Tag entity.
func (*MetaUpdateOne) ClearThumbnail ¶
func (muo *MetaUpdateOne) ClearThumbnail() *MetaUpdateOne
ClearThumbnail clears the value of the "thumbnail" 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) 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) 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) 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) 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) 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) SetRead ¶
func (muo *MetaUpdateOne) SetRead(b bool) *MetaUpdateOne
SetRead sets the "read" field.
func (*MetaUpdateOne) SetThumbnail ¶
func (muo *MetaUpdateOne) SetThumbnail(b []byte) *MetaUpdateOne
SetThumbnail sets the "thumbnail" 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) ClearThumbnail ¶
func (u *MetaUpsert) ClearThumbnail() *MetaUpsert
ClearThumbnail clears the value of the "thumbnail" field.
func (*MetaUpsert) SetActive ¶
func (u *MetaUpsert) SetActive(v bool) *MetaUpsert
SetActive sets the "active" 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) 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) SetThumbnail ¶
func (u *MetaUpsert) SetThumbnail(v []byte) *MetaUpsert
SetThumbnail sets the "thumbnail" field.
func (*MetaUpsert) UpdateActive ¶
func (u *MetaUpsert) UpdateActive() *MetaUpsert
UpdateActive sets the "active" 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) 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) UpdateThumbnail ¶
func (u *MetaUpsert) UpdateThumbnail() *MetaUpsert
UpdateThumbnail sets the "thumbnail" 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) ClearThumbnail ¶
func (u *MetaUpsertBulk) ClearThumbnail() *MetaUpsertBulk
ClearThumbnail clears the value of the "thumbnail" 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) 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) 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) SetThumbnail ¶
func (u *MetaUpsertBulk) SetThumbnail(v []byte) *MetaUpsertBulk
SetThumbnail sets the "thumbnail" 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) 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) 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) UpdateThumbnail ¶
func (u *MetaUpsertBulk) UpdateThumbnail() *MetaUpsertBulk
UpdateThumbnail sets the "thumbnail" 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) ClearThumbnail ¶
func (u *MetaUpsertOne) ClearThumbnail() *MetaUpsertOne
ClearThumbnail clears the value of the "thumbnail" 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) 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) 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) SetThumbnail ¶
func (u *MetaUpsertOne) SetThumbnail(v []byte) *MetaUpsertOne
SetThumbnail sets the "thumbnail" 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) 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) 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) UpdateThumbnail ¶
func (u *MetaUpsertOne) UpdateThumbnail() *MetaUpsertOne
UpdateThumbnail sets the "thumbnail" field to the value that was provided on create.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type 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"` // Thumbnail holds the value of the "thumbnail" field. Thumbnail []byte `json:"-"` // 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) 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) 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) 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.
func (*TagCreate) SetThumbnail ¶
SetThumbnail sets the "thumbnail" field.
type TagCreateBulk ¶
type TagCreateBulk struct {
// contains filtered or unexported fields
}
TagCreateBulk is the builder for creating many Tag entities in bulk.
func (*TagCreateBulk) Exec ¶
func (tcb *TagCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TagCreateBulk) ExecX ¶
func (tcb *TagCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
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"` // contains filtered or unexported fields }
TagEdges holds the relations/edges for other nodes in the graph.
type TagGroupBy ¶
type TagGroupBy struct {
// contains filtered or unexported fields
}
TagGroupBy is the group-by builder for Tag entities.
func (*TagGroupBy) Aggregate ¶
func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TagGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Scan ¶
func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TagGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TagMutation ¶
type TagMutation struct {
// contains filtered or unexported fields
}
TagMutation represents an operation that mutates the Tag nodes in the graph.
func (*TagMutation) AddField ¶
func (m *TagMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*TagMutation) 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) 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) ClearThumbnail ¶
func (m *TagMutation) ClearThumbnail()
ClearThumbnail clears the value of the "thumbnail" field.
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) 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) OldThumbnail ¶
func (m *TagMutation) OldThumbnail(ctx context.Context) (v []byte, err error)
OldThumbnail returns the old "thumbnail" 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) 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) 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) 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) ResetThumbnail ¶
func (m *TagMutation) ResetThumbnail()
ResetThumbnail resets all changes to the "thumbnail" 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) SetThumbnail ¶
func (m *TagMutation) SetThumbnail(b []byte)
SetThumbnail sets the "thumbnail" field.
func (*TagMutation) Thumbnail ¶
func (m *TagMutation) Thumbnail() (r []byte, exists bool)
Thumbnail returns the value of the "thumbnail" field in the mutation.
func (*TagMutation) ThumbnailCleared ¶
func (m *TagMutation) ThumbnailCleared() bool
ThumbnailCleared returns if the "thumbnail" field was cleared in this mutation.
func (TagMutation) Tx ¶
func (m TagMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TagMutation) Type ¶
func (m *TagMutation) Type() string
Type returns the node type of this mutation (Tag).
func (*TagMutation) Where ¶
func (m *TagMutation) Where(ps ...predicate.Tag)
Where appends a list predicates to the TagMutation builder.
func (*TagMutation) WhereP ¶
func (m *TagMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TagQuery ¶
type TagQuery struct {
// contains filtered or unexported fields
}
TagQuery is the builder for querying Tag entities.
func (*TagQuery) Aggregate ¶
func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect
Aggregate returns a TagSelect configured with the given aggregations.
func (*TagQuery) Clone ¶
Clone returns a duplicate of the TagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TagQuery) First ¶
First returns the first Tag entity from the query. Returns a *NotFoundError when no Tag was found.
func (*TagQuery) FirstID ¶
FirstID returns the first Tag ID from the query. Returns a *NotFoundError when no Tag ID was found.
func (*TagQuery) GroupBy ¶
func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { 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) 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.
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) AddMetumIDs ¶
AddMetumIDs adds the "meta" edge to the Meta entity by IDs.
func (*TagUpdate) ClearThumbnail ¶
ClearThumbnail clears the value of the "thumbnail" field.
func (*TagUpdate) Mutation ¶
func (tu *TagUpdate) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
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.
func (*TagUpdate) SetThumbnail ¶
SetThumbnail sets the "thumbnail" field.
type TagUpdateOne ¶
type TagUpdateOne struct {
// contains filtered or unexported fields
}
TagUpdateOne is the builder for updating a single Tag entity.
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) ClearMeta ¶
func (tuo *TagUpdateOne) ClearMeta() *TagUpdateOne
ClearMeta clears all "meta" edges to the Meta entity.
func (*TagUpdateOne) ClearThumbnail ¶
func (tuo *TagUpdateOne) ClearThumbnail() *TagUpdateOne
ClearThumbnail clears the value of the "thumbnail" field.
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) 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) SetThumbnail ¶
func (tuo *TagUpdateOne) SetThumbnail(b []byte) *TagUpdateOne
SetThumbnail sets the "thumbnail" field.
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) ClearThumbnail ¶
ClearThumbnail clears the value of the "thumbnail" field.
func (*TagUpsert) SetFavorite ¶
SetFavorite sets the "favorite" field.
func (*TagUpsert) SetThumbnail ¶
SetThumbnail sets the "thumbnail" 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.
func (*TagUpsert) UpdateThumbnail ¶
UpdateThumbnail sets the "thumbnail" 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) ClearThumbnail ¶
func (u *TagUpsertBulk) ClearThumbnail() *TagUpsertBulk
ClearThumbnail clears the value of the "thumbnail" field.
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) SetThumbnail ¶
func (u *TagUpsertBulk) SetThumbnail(v []byte) *TagUpsertBulk
SetThumbnail sets the "thumbnail" 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)
func (*TagUpsertBulk) UpdateThumbnail ¶
func (u *TagUpsertBulk) UpdateThumbnail() *TagUpsertBulk
UpdateThumbnail sets the "thumbnail" field to the value that was provided on create.
type TagUpsertOne ¶
type TagUpsertOne struct {
// contains filtered or unexported fields
}
TagUpsertOne is the builder for "upsert"-ing
one Tag node.
func (*TagUpsertOne) ClearThumbnail ¶
func (u *TagUpsertOne) ClearThumbnail() *TagUpsertOne
ClearThumbnail clears the value of the "thumbnail" field.
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) SetThumbnail ¶
func (u *TagUpsertOne) SetThumbnail(v []byte) *TagUpsertOne
SetThumbnail sets the "thumbnail" 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)
func (*TagUpsertOne) UpdateThumbnail ¶
func (u *TagUpsertOne) UpdateThumbnail() *TagUpsertOne
UpdateThumbnail sets the "thumbnail" field to the value that was provided on create.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Meta is the client for interacting with the Meta builders. Meta *MetaClient // Tag is the client for interacting with the Tag builders. Tag *TagClient // 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 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.