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 Banner
- type BannerClient
- func (c *BannerClient) Create() *BannerCreate
- func (c *BannerClient) CreateBulk(builders ...*BannerCreate) *BannerCreateBulk
- func (c *BannerClient) Delete() *BannerDelete
- func (c *BannerClient) DeleteOne(b *Banner) *BannerDeleteOne
- func (c *BannerClient) DeleteOneID(id int) *BannerDeleteOne
- func (c *BannerClient) Get(ctx context.Context, id int) (*Banner, error)
- func (c *BannerClient) GetX(ctx context.Context, id int) *Banner
- func (c *BannerClient) Hooks() []Hook
- func (c *BannerClient) Intercept(interceptors ...Interceptor)
- func (c *BannerClient) Interceptors() []Interceptor
- func (c *BannerClient) MapCreateBulk(slice any, setFunc func(*BannerCreate, int)) *BannerCreateBulk
- func (c *BannerClient) Query() *BannerQuery
- func (c *BannerClient) QueryFeature(b *Banner) *FeatureQuery
- func (c *BannerClient) QueryTags(b *Banner) *TagQuery
- func (c *BannerClient) Update() *BannerUpdate
- func (c *BannerClient) UpdateOne(b *Banner) *BannerUpdateOne
- func (c *BannerClient) UpdateOneID(id int) *BannerUpdateOne
- func (c *BannerClient) Use(hooks ...Hook)
- type BannerCreate
- func (bc *BannerCreate) AddFeature(f ...*Feature) *BannerCreate
- func (bc *BannerCreate) AddFeatureIDs(ids ...int) *BannerCreate
- func (bc *BannerCreate) AddTagIDs(ids ...int) *BannerCreate
- func (bc *BannerCreate) AddTags(t ...*Tag) *BannerCreate
- func (bc *BannerCreate) Exec(ctx context.Context) error
- func (bc *BannerCreate) ExecX(ctx context.Context)
- func (bc *BannerCreate) Mutation() *BannerMutation
- func (bc *BannerCreate) Save(ctx context.Context) (*Banner, error)
- func (bc *BannerCreate) SaveX(ctx context.Context) *Banner
- func (bc *BannerCreate) SetContent(m map[string]interface{}) *BannerCreate
- func (bc *BannerCreate) SetCreatedAt(t time.Time) *BannerCreate
- func (bc *BannerCreate) SetIsActive(b bool) *BannerCreate
- func (bc *BannerCreate) SetNillableCreatedAt(t *time.Time) *BannerCreate
- func (bc *BannerCreate) SetNillableIsActive(b *bool) *BannerCreate
- func (bc *BannerCreate) SetNillableUpdatedAt(t *time.Time) *BannerCreate
- func (bc *BannerCreate) SetUpdatedAt(t time.Time) *BannerCreate
- type BannerCreateBulk
- type BannerDelete
- type BannerDeleteOne
- type BannerEdges
- type BannerGroupBy
- func (bgb *BannerGroupBy) Aggregate(fns ...AggregateFunc) *BannerGroupBy
- func (s *BannerGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BannerGroupBy) BoolX(ctx context.Context) bool
- func (s *BannerGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BannerGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BannerGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BannerGroupBy) Float64X(ctx context.Context) float64
- func (s *BannerGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BannerGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BannerGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BannerGroupBy) IntX(ctx context.Context) int
- func (s *BannerGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BannerGroupBy) IntsX(ctx context.Context) []int
- func (bgb *BannerGroupBy) Scan(ctx context.Context, v any) error
- func (s *BannerGroupBy) ScanX(ctx context.Context, v any)
- func (s *BannerGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BannerGroupBy) StringX(ctx context.Context) string
- func (s *BannerGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BannerGroupBy) StringsX(ctx context.Context) []string
- type BannerMutation
- func (m *BannerMutation) AddFeatureIDs(ids ...int)
- func (m *BannerMutation) AddField(name string, value ent.Value) error
- func (m *BannerMutation) AddTagIDs(ids ...int)
- func (m *BannerMutation) AddedEdges() []string
- func (m *BannerMutation) AddedField(name string) (ent.Value, bool)
- func (m *BannerMutation) AddedFields() []string
- func (m *BannerMutation) AddedIDs(name string) []ent.Value
- func (m *BannerMutation) ClearEdge(name string) error
- func (m *BannerMutation) ClearFeature()
- func (m *BannerMutation) ClearField(name string) error
- func (m *BannerMutation) ClearTags()
- func (m *BannerMutation) ClearedEdges() []string
- func (m *BannerMutation) ClearedFields() []string
- func (m BannerMutation) Client() *Client
- func (m *BannerMutation) Content() (r map[string]interface{}, exists bool)
- func (m *BannerMutation) CreatedAt() (r time.Time, exists bool)
- func (m *BannerMutation) EdgeCleared(name string) bool
- func (m *BannerMutation) FeatureCleared() bool
- func (m *BannerMutation) FeatureIDs() (ids []int)
- func (m *BannerMutation) Field(name string) (ent.Value, bool)
- func (m *BannerMutation) FieldCleared(name string) bool
- func (m *BannerMutation) Fields() []string
- func (m *BannerMutation) ID() (id int, exists bool)
- func (m *BannerMutation) IDs(ctx context.Context) ([]int, error)
- func (m *BannerMutation) IsActive() (r bool, exists bool)
- func (m *BannerMutation) OldContent(ctx context.Context) (v map[string]interface{}, err error)
- func (m *BannerMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *BannerMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BannerMutation) OldIsActive(ctx context.Context) (v bool, err error)
- func (m *BannerMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *BannerMutation) Op() Op
- func (m *BannerMutation) RemoveFeatureIDs(ids ...int)
- func (m *BannerMutation) RemoveTagIDs(ids ...int)
- func (m *BannerMutation) RemovedEdges() []string
- func (m *BannerMutation) RemovedFeatureIDs() (ids []int)
- func (m *BannerMutation) RemovedIDs(name string) []ent.Value
- func (m *BannerMutation) RemovedTagsIDs() (ids []int)
- func (m *BannerMutation) ResetContent()
- func (m *BannerMutation) ResetCreatedAt()
- func (m *BannerMutation) ResetEdge(name string) error
- func (m *BannerMutation) ResetFeature()
- func (m *BannerMutation) ResetField(name string) error
- func (m *BannerMutation) ResetIsActive()
- func (m *BannerMutation) ResetTags()
- func (m *BannerMutation) ResetUpdatedAt()
- func (m *BannerMutation) SetContent(value map[string]interface{})
- func (m *BannerMutation) SetCreatedAt(t time.Time)
- func (m *BannerMutation) SetField(name string, value ent.Value) error
- func (m *BannerMutation) SetIsActive(b bool)
- func (m *BannerMutation) SetOp(op Op)
- func (m *BannerMutation) SetUpdatedAt(t time.Time)
- func (m *BannerMutation) TagsCleared() bool
- func (m *BannerMutation) TagsIDs() (ids []int)
- func (m BannerMutation) Tx() (*Tx, error)
- func (m *BannerMutation) Type() string
- func (m *BannerMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *BannerMutation) Where(ps ...predicate.Banner)
- func (m *BannerMutation) WhereP(ps ...func(*sql.Selector))
- type BannerQuery
- func (bq *BannerQuery) Aggregate(fns ...AggregateFunc) *BannerSelect
- func (bq *BannerQuery) All(ctx context.Context) ([]*Banner, error)
- func (bq *BannerQuery) AllX(ctx context.Context) []*Banner
- func (bq *BannerQuery) Clone() *BannerQuery
- func (bq *BannerQuery) Count(ctx context.Context) (int, error)
- func (bq *BannerQuery) CountX(ctx context.Context) int
- func (bq *BannerQuery) Exist(ctx context.Context) (bool, error)
- func (bq *BannerQuery) ExistX(ctx context.Context) bool
- func (bq *BannerQuery) First(ctx context.Context) (*Banner, error)
- func (bq *BannerQuery) FirstID(ctx context.Context) (id int, err error)
- func (bq *BannerQuery) FirstIDX(ctx context.Context) int
- func (bq *BannerQuery) FirstX(ctx context.Context) *Banner
- func (bq *BannerQuery) GroupBy(field string, fields ...string) *BannerGroupBy
- func (bq *BannerQuery) IDs(ctx context.Context) (ids []int, err error)
- func (bq *BannerQuery) IDsX(ctx context.Context) []int
- func (bq *BannerQuery) Limit(limit int) *BannerQuery
- func (bq *BannerQuery) Offset(offset int) *BannerQuery
- func (bq *BannerQuery) Only(ctx context.Context) (*Banner, error)
- func (bq *BannerQuery) OnlyID(ctx context.Context) (id int, err error)
- func (bq *BannerQuery) OnlyIDX(ctx context.Context) int
- func (bq *BannerQuery) OnlyX(ctx context.Context) *Banner
- func (bq *BannerQuery) Order(o ...banner.OrderOption) *BannerQuery
- func (bq *BannerQuery) QueryFeature() *FeatureQuery
- func (bq *BannerQuery) QueryTags() *TagQuery
- func (bq *BannerQuery) Select(fields ...string) *BannerSelect
- func (bq *BannerQuery) Unique(unique bool) *BannerQuery
- func (bq *BannerQuery) Where(ps ...predicate.Banner) *BannerQuery
- func (bq *BannerQuery) WithFeature(opts ...func(*FeatureQuery)) *BannerQuery
- func (bq *BannerQuery) WithTags(opts ...func(*TagQuery)) *BannerQuery
- type BannerSelect
- func (bs *BannerSelect) Aggregate(fns ...AggregateFunc) *BannerSelect
- func (s *BannerSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BannerSelect) BoolX(ctx context.Context) bool
- func (s *BannerSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BannerSelect) BoolsX(ctx context.Context) []bool
- func (s *BannerSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BannerSelect) Float64X(ctx context.Context) float64
- func (s *BannerSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BannerSelect) Float64sX(ctx context.Context) []float64
- func (s *BannerSelect) Int(ctx context.Context) (_ int, err error)
- func (s *BannerSelect) IntX(ctx context.Context) int
- func (s *BannerSelect) Ints(ctx context.Context) ([]int, error)
- func (s *BannerSelect) IntsX(ctx context.Context) []int
- func (bs *BannerSelect) Scan(ctx context.Context, v any) error
- func (s *BannerSelect) ScanX(ctx context.Context, v any)
- func (s *BannerSelect) String(ctx context.Context) (_ string, err error)
- func (s *BannerSelect) StringX(ctx context.Context) string
- func (s *BannerSelect) Strings(ctx context.Context) ([]string, error)
- func (s *BannerSelect) StringsX(ctx context.Context) []string
- type BannerUpdate
- func (bu *BannerUpdate) AddFeature(f ...*Feature) *BannerUpdate
- func (bu *BannerUpdate) AddFeatureIDs(ids ...int) *BannerUpdate
- func (bu *BannerUpdate) AddTagIDs(ids ...int) *BannerUpdate
- func (bu *BannerUpdate) AddTags(t ...*Tag) *BannerUpdate
- func (bu *BannerUpdate) ClearFeature() *BannerUpdate
- func (bu *BannerUpdate) ClearTags() *BannerUpdate
- func (bu *BannerUpdate) Exec(ctx context.Context) error
- func (bu *BannerUpdate) ExecX(ctx context.Context)
- func (bu *BannerUpdate) Mutation() *BannerMutation
- func (bu *BannerUpdate) RemoveFeature(f ...*Feature) *BannerUpdate
- func (bu *BannerUpdate) RemoveFeatureIDs(ids ...int) *BannerUpdate
- func (bu *BannerUpdate) RemoveTagIDs(ids ...int) *BannerUpdate
- func (bu *BannerUpdate) RemoveTags(t ...*Tag) *BannerUpdate
- func (bu *BannerUpdate) Save(ctx context.Context) (int, error)
- func (bu *BannerUpdate) SaveX(ctx context.Context) int
- func (bu *BannerUpdate) SetContent(m map[string]interface{}) *BannerUpdate
- func (bu *BannerUpdate) SetIsActive(b bool) *BannerUpdate
- func (bu *BannerUpdate) SetNillableIsActive(b *bool) *BannerUpdate
- func (bu *BannerUpdate) SetNillableUpdatedAt(t *time.Time) *BannerUpdate
- func (bu *BannerUpdate) SetUpdatedAt(t time.Time) *BannerUpdate
- func (bu *BannerUpdate) Where(ps ...predicate.Banner) *BannerUpdate
- type BannerUpdateOne
- func (buo *BannerUpdateOne) AddFeature(f ...*Feature) *BannerUpdateOne
- func (buo *BannerUpdateOne) AddFeatureIDs(ids ...int) *BannerUpdateOne
- func (buo *BannerUpdateOne) AddTagIDs(ids ...int) *BannerUpdateOne
- func (buo *BannerUpdateOne) AddTags(t ...*Tag) *BannerUpdateOne
- func (buo *BannerUpdateOne) ClearFeature() *BannerUpdateOne
- func (buo *BannerUpdateOne) ClearTags() *BannerUpdateOne
- func (buo *BannerUpdateOne) Exec(ctx context.Context) error
- func (buo *BannerUpdateOne) ExecX(ctx context.Context)
- func (buo *BannerUpdateOne) Mutation() *BannerMutation
- func (buo *BannerUpdateOne) RemoveFeature(f ...*Feature) *BannerUpdateOne
- func (buo *BannerUpdateOne) RemoveFeatureIDs(ids ...int) *BannerUpdateOne
- func (buo *BannerUpdateOne) RemoveTagIDs(ids ...int) *BannerUpdateOne
- func (buo *BannerUpdateOne) RemoveTags(t ...*Tag) *BannerUpdateOne
- func (buo *BannerUpdateOne) Save(ctx context.Context) (*Banner, error)
- func (buo *BannerUpdateOne) SaveX(ctx context.Context) *Banner
- func (buo *BannerUpdateOne) Select(field string, fields ...string) *BannerUpdateOne
- func (buo *BannerUpdateOne) SetContent(m map[string]interface{}) *BannerUpdateOne
- func (buo *BannerUpdateOne) SetIsActive(b bool) *BannerUpdateOne
- func (buo *BannerUpdateOne) SetNillableIsActive(b *bool) *BannerUpdateOne
- func (buo *BannerUpdateOne) SetNillableUpdatedAt(t *time.Time) *BannerUpdateOne
- func (buo *BannerUpdateOne) SetUpdatedAt(t time.Time) *BannerUpdateOne
- func (buo *BannerUpdateOne) Where(ps ...predicate.Banner) *BannerUpdateOne
- type Banners
- 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 Feature
- type FeatureClient
- func (c *FeatureClient) Create() *FeatureCreate
- func (c *FeatureClient) CreateBulk(builders ...*FeatureCreate) *FeatureCreateBulk
- func (c *FeatureClient) Delete() *FeatureDelete
- func (c *FeatureClient) DeleteOne(f *Feature) *FeatureDeleteOne
- func (c *FeatureClient) DeleteOneID(id int) *FeatureDeleteOne
- func (c *FeatureClient) Get(ctx context.Context, id int) (*Feature, error)
- func (c *FeatureClient) GetX(ctx context.Context, id int) *Feature
- func (c *FeatureClient) Hooks() []Hook
- func (c *FeatureClient) Intercept(interceptors ...Interceptor)
- func (c *FeatureClient) Interceptors() []Interceptor
- func (c *FeatureClient) MapCreateBulk(slice any, setFunc func(*FeatureCreate, int)) *FeatureCreateBulk
- func (c *FeatureClient) Query() *FeatureQuery
- func (c *FeatureClient) QueryBanners(f *Feature) *BannerQuery
- func (c *FeatureClient) Update() *FeatureUpdate
- func (c *FeatureClient) UpdateOne(f *Feature) *FeatureUpdateOne
- func (c *FeatureClient) UpdateOneID(id int) *FeatureUpdateOne
- func (c *FeatureClient) Use(hooks ...Hook)
- type FeatureCreate
- func (fc *FeatureCreate) AddBannerIDs(ids ...int) *FeatureCreate
- func (fc *FeatureCreate) AddBanners(b ...*Banner) *FeatureCreate
- func (fc *FeatureCreate) Exec(ctx context.Context) error
- func (fc *FeatureCreate) ExecX(ctx context.Context)
- func (fc *FeatureCreate) Mutation() *FeatureMutation
- func (fc *FeatureCreate) Save(ctx context.Context) (*Feature, error)
- func (fc *FeatureCreate) SaveX(ctx context.Context) *Feature
- func (fc *FeatureCreate) SetCreatedAt(t time.Time) *FeatureCreate
- func (fc *FeatureCreate) SetFeatureName(s string) *FeatureCreate
- func (fc *FeatureCreate) SetNillableCreatedAt(t *time.Time) *FeatureCreate
- func (fc *FeatureCreate) SetNillableUpdatedAt(t *time.Time) *FeatureCreate
- func (fc *FeatureCreate) SetUpdatedAt(t time.Time) *FeatureCreate
- type FeatureCreateBulk
- type FeatureDelete
- type FeatureDeleteOne
- type FeatureEdges
- type FeatureGroupBy
- func (fgb *FeatureGroupBy) Aggregate(fns ...AggregateFunc) *FeatureGroupBy
- func (s *FeatureGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FeatureGroupBy) BoolX(ctx context.Context) bool
- func (s *FeatureGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FeatureGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FeatureGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FeatureGroupBy) Float64X(ctx context.Context) float64
- func (s *FeatureGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FeatureGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FeatureGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FeatureGroupBy) IntX(ctx context.Context) int
- func (s *FeatureGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FeatureGroupBy) IntsX(ctx context.Context) []int
- func (fgb *FeatureGroupBy) Scan(ctx context.Context, v any) error
- func (s *FeatureGroupBy) ScanX(ctx context.Context, v any)
- func (s *FeatureGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FeatureGroupBy) StringX(ctx context.Context) string
- func (s *FeatureGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FeatureGroupBy) StringsX(ctx context.Context) []string
- type FeatureMutation
- func (m *FeatureMutation) AddBannerIDs(ids ...int)
- func (m *FeatureMutation) AddField(name string, value ent.Value) error
- func (m *FeatureMutation) AddedEdges() []string
- func (m *FeatureMutation) AddedField(name string) (ent.Value, bool)
- func (m *FeatureMutation) AddedFields() []string
- func (m *FeatureMutation) AddedIDs(name string) []ent.Value
- func (m *FeatureMutation) BannersCleared() bool
- func (m *FeatureMutation) BannersIDs() (ids []int)
- func (m *FeatureMutation) ClearBanners()
- func (m *FeatureMutation) ClearEdge(name string) error
- func (m *FeatureMutation) ClearField(name string) error
- func (m *FeatureMutation) ClearedEdges() []string
- func (m *FeatureMutation) ClearedFields() []string
- func (m FeatureMutation) Client() *Client
- func (m *FeatureMutation) CreatedAt() (r time.Time, exists bool)
- func (m *FeatureMutation) EdgeCleared(name string) bool
- func (m *FeatureMutation) FeatureName() (r string, exists bool)
- func (m *FeatureMutation) Field(name string) (ent.Value, bool)
- func (m *FeatureMutation) FieldCleared(name string) bool
- func (m *FeatureMutation) Fields() []string
- func (m *FeatureMutation) ID() (id int, exists bool)
- func (m *FeatureMutation) IDs(ctx context.Context) ([]int, error)
- func (m *FeatureMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FeatureMutation) OldFeatureName(ctx context.Context) (v string, err error)
- func (m *FeatureMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FeatureMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FeatureMutation) Op() Op
- func (m *FeatureMutation) RemoveBannerIDs(ids ...int)
- func (m *FeatureMutation) RemovedBannersIDs() (ids []int)
- func (m *FeatureMutation) RemovedEdges() []string
- func (m *FeatureMutation) RemovedIDs(name string) []ent.Value
- func (m *FeatureMutation) ResetBanners()
- func (m *FeatureMutation) ResetCreatedAt()
- func (m *FeatureMutation) ResetEdge(name string) error
- func (m *FeatureMutation) ResetFeatureName()
- func (m *FeatureMutation) ResetField(name string) error
- func (m *FeatureMutation) ResetUpdatedAt()
- func (m *FeatureMutation) SetCreatedAt(t time.Time)
- func (m *FeatureMutation) SetFeatureName(s string)
- func (m *FeatureMutation) SetField(name string, value ent.Value) error
- func (m *FeatureMutation) SetOp(op Op)
- func (m *FeatureMutation) SetUpdatedAt(t time.Time)
- func (m FeatureMutation) Tx() (*Tx, error)
- func (m *FeatureMutation) Type() string
- func (m *FeatureMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *FeatureMutation) Where(ps ...predicate.Feature)
- func (m *FeatureMutation) WhereP(ps ...func(*sql.Selector))
- type FeatureQuery
- func (fq *FeatureQuery) Aggregate(fns ...AggregateFunc) *FeatureSelect
- func (fq *FeatureQuery) All(ctx context.Context) ([]*Feature, error)
- func (fq *FeatureQuery) AllX(ctx context.Context) []*Feature
- func (fq *FeatureQuery) Clone() *FeatureQuery
- func (fq *FeatureQuery) Count(ctx context.Context) (int, error)
- func (fq *FeatureQuery) CountX(ctx context.Context) int
- func (fq *FeatureQuery) Exist(ctx context.Context) (bool, error)
- func (fq *FeatureQuery) ExistX(ctx context.Context) bool
- func (fq *FeatureQuery) First(ctx context.Context) (*Feature, error)
- func (fq *FeatureQuery) FirstID(ctx context.Context) (id int, err error)
- func (fq *FeatureQuery) FirstIDX(ctx context.Context) int
- func (fq *FeatureQuery) FirstX(ctx context.Context) *Feature
- func (fq *FeatureQuery) GroupBy(field string, fields ...string) *FeatureGroupBy
- func (fq *FeatureQuery) IDs(ctx context.Context) (ids []int, err error)
- func (fq *FeatureQuery) IDsX(ctx context.Context) []int
- func (fq *FeatureQuery) Limit(limit int) *FeatureQuery
- func (fq *FeatureQuery) Offset(offset int) *FeatureQuery
- func (fq *FeatureQuery) Only(ctx context.Context) (*Feature, error)
- func (fq *FeatureQuery) OnlyID(ctx context.Context) (id int, err error)
- func (fq *FeatureQuery) OnlyIDX(ctx context.Context) int
- func (fq *FeatureQuery) OnlyX(ctx context.Context) *Feature
- func (fq *FeatureQuery) Order(o ...feature.OrderOption) *FeatureQuery
- func (fq *FeatureQuery) QueryBanners() *BannerQuery
- func (fq *FeatureQuery) Select(fields ...string) *FeatureSelect
- func (fq *FeatureQuery) Unique(unique bool) *FeatureQuery
- func (fq *FeatureQuery) Where(ps ...predicate.Feature) *FeatureQuery
- func (fq *FeatureQuery) WithBanners(opts ...func(*BannerQuery)) *FeatureQuery
- type FeatureSelect
- func (fs *FeatureSelect) Aggregate(fns ...AggregateFunc) *FeatureSelect
- func (s *FeatureSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FeatureSelect) BoolX(ctx context.Context) bool
- func (s *FeatureSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FeatureSelect) BoolsX(ctx context.Context) []bool
- func (s *FeatureSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FeatureSelect) Float64X(ctx context.Context) float64
- func (s *FeatureSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FeatureSelect) Float64sX(ctx context.Context) []float64
- func (s *FeatureSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FeatureSelect) IntX(ctx context.Context) int
- func (s *FeatureSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FeatureSelect) IntsX(ctx context.Context) []int
- func (fs *FeatureSelect) Scan(ctx context.Context, v any) error
- func (s *FeatureSelect) ScanX(ctx context.Context, v any)
- func (s *FeatureSelect) String(ctx context.Context) (_ string, err error)
- func (s *FeatureSelect) StringX(ctx context.Context) string
- func (s *FeatureSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FeatureSelect) StringsX(ctx context.Context) []string
- type FeatureUpdate
- func (fu *FeatureUpdate) AddBannerIDs(ids ...int) *FeatureUpdate
- func (fu *FeatureUpdate) AddBanners(b ...*Banner) *FeatureUpdate
- func (fu *FeatureUpdate) ClearBanners() *FeatureUpdate
- func (fu *FeatureUpdate) Exec(ctx context.Context) error
- func (fu *FeatureUpdate) ExecX(ctx context.Context)
- func (fu *FeatureUpdate) Mutation() *FeatureMutation
- func (fu *FeatureUpdate) RemoveBannerIDs(ids ...int) *FeatureUpdate
- func (fu *FeatureUpdate) RemoveBanners(b ...*Banner) *FeatureUpdate
- func (fu *FeatureUpdate) Save(ctx context.Context) (int, error)
- func (fu *FeatureUpdate) SaveX(ctx context.Context) int
- func (fu *FeatureUpdate) SetFeatureName(s string) *FeatureUpdate
- func (fu *FeatureUpdate) SetNillableFeatureName(s *string) *FeatureUpdate
- func (fu *FeatureUpdate) SetNillableUpdatedAt(t *time.Time) *FeatureUpdate
- func (fu *FeatureUpdate) SetUpdatedAt(t time.Time) *FeatureUpdate
- func (fu *FeatureUpdate) Where(ps ...predicate.Feature) *FeatureUpdate
- type FeatureUpdateOne
- func (fuo *FeatureUpdateOne) AddBannerIDs(ids ...int) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) AddBanners(b ...*Banner) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) ClearBanners() *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) Exec(ctx context.Context) error
- func (fuo *FeatureUpdateOne) ExecX(ctx context.Context)
- func (fuo *FeatureUpdateOne) Mutation() *FeatureMutation
- func (fuo *FeatureUpdateOne) RemoveBannerIDs(ids ...int) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) RemoveBanners(b ...*Banner) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) Save(ctx context.Context) (*Feature, error)
- func (fuo *FeatureUpdateOne) SaveX(ctx context.Context) *Feature
- func (fuo *FeatureUpdateOne) Select(field string, fields ...string) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) SetFeatureName(s string) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) SetNillableFeatureName(s *string) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) SetNillableUpdatedAt(t *time.Time) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) SetUpdatedAt(t time.Time) *FeatureUpdateOne
- func (fuo *FeatureUpdateOne) Where(ps ...predicate.Feature) *FeatureUpdateOne
- type Features
- type Hook
- type InterceptFunc
- type Interceptor
- 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) QueryBanners(t *Tag) *BannerQuery
- 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) AddBannerIDs(ids ...int) *TagCreate
- func (tc *TagCreate) AddBanners(b ...*Banner) *TagCreate
- func (tc *TagCreate) Exec(ctx context.Context) error
- func (tc *TagCreate) ExecX(ctx context.Context)
- func (tc *TagCreate) Mutation() *TagMutation
- func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)
- func (tc *TagCreate) SaveX(ctx context.Context) *Tag
- func (tc *TagCreate) SetCreatedAt(t time.Time) *TagCreate
- func (tc *TagCreate) SetNillableCreatedAt(t *time.Time) *TagCreate
- func (tc *TagCreate) SetNillableUpdatedAt(t *time.Time) *TagCreate
- func (tc *TagCreate) SetTagName(s string) *TagCreate
- func (tc *TagCreate) SetUpdatedAt(t time.Time) *TagCreate
- type TagCreateBulk
- type TagDelete
- type TagDeleteOne
- type TagEdges
- type TagGroupBy
- func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy
- func (s *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TagGroupBy) BoolX(ctx context.Context) bool
- func (s *TagGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TagGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TagGroupBy) Float64X(ctx context.Context) float64
- func (s *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TagGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TagGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TagGroupBy) IntX(ctx context.Context) int
- func (s *TagGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TagGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error
- func (s *TagGroupBy) ScanX(ctx context.Context, v any)
- func (s *TagGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TagGroupBy) StringX(ctx context.Context) string
- func (s *TagGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TagGroupBy) StringsX(ctx context.Context) []string
- type TagMutation
- func (m *TagMutation) AddBannerIDs(ids ...int)
- func (m *TagMutation) AddField(name string, value ent.Value) error
- func (m *TagMutation) AddedEdges() []string
- func (m *TagMutation) AddedField(name string) (ent.Value, bool)
- func (m *TagMutation) AddedFields() []string
- func (m *TagMutation) AddedIDs(name string) []ent.Value
- func (m *TagMutation) BannersCleared() bool
- func (m *TagMutation) BannersIDs() (ids []int)
- func (m *TagMutation) ClearBanners()
- func (m *TagMutation) ClearEdge(name string) error
- func (m *TagMutation) ClearField(name string) error
- func (m *TagMutation) ClearedEdges() []string
- func (m *TagMutation) ClearedFields() []string
- func (m TagMutation) Client() *Client
- func (m *TagMutation) CreatedAt() (r time.Time, exists bool)
- func (m *TagMutation) EdgeCleared(name string) bool
- func (m *TagMutation) Field(name string) (ent.Value, bool)
- func (m *TagMutation) FieldCleared(name string) bool
- func (m *TagMutation) Fields() []string
- func (m *TagMutation) ID() (id int, exists bool)
- func (m *TagMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TagMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TagMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TagMutation) OldTagName(ctx context.Context) (v string, err error)
- func (m *TagMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TagMutation) Op() Op
- func (m *TagMutation) RemoveBannerIDs(ids ...int)
- func (m *TagMutation) RemovedBannersIDs() (ids []int)
- func (m *TagMutation) RemovedEdges() []string
- func (m *TagMutation) RemovedIDs(name string) []ent.Value
- func (m *TagMutation) ResetBanners()
- func (m *TagMutation) ResetCreatedAt()
- func (m *TagMutation) ResetEdge(name string) error
- func (m *TagMutation) ResetField(name string) error
- func (m *TagMutation) ResetTagName()
- func (m *TagMutation) ResetUpdatedAt()
- func (m *TagMutation) SetCreatedAt(t time.Time)
- func (m *TagMutation) SetField(name string, value ent.Value) error
- func (m *TagMutation) SetOp(op Op)
- func (m *TagMutation) SetTagName(s string)
- func (m *TagMutation) SetUpdatedAt(t time.Time)
- func (m *TagMutation) TagName() (r string, exists bool)
- func (m TagMutation) Tx() (*Tx, error)
- func (m *TagMutation) Type() string
- func (m *TagMutation) UpdatedAt() (r time.Time, exists bool)
- 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) QueryBanners() *BannerQuery
- 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) WithBanners(opts ...func(*BannerQuery)) *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) AddBannerIDs(ids ...int) *TagUpdate
- func (tu *TagUpdate) AddBanners(b ...*Banner) *TagUpdate
- func (tu *TagUpdate) ClearBanners() *TagUpdate
- func (tu *TagUpdate) Exec(ctx context.Context) error
- func (tu *TagUpdate) ExecX(ctx context.Context)
- func (tu *TagUpdate) Mutation() *TagMutation
- func (tu *TagUpdate) RemoveBannerIDs(ids ...int) *TagUpdate
- func (tu *TagUpdate) RemoveBanners(b ...*Banner) *TagUpdate
- func (tu *TagUpdate) Save(ctx context.Context) (int, error)
- func (tu *TagUpdate) SaveX(ctx context.Context) int
- func (tu *TagUpdate) SetNillableTagName(s *string) *TagUpdate
- func (tu *TagUpdate) SetNillableUpdatedAt(t *time.Time) *TagUpdate
- func (tu *TagUpdate) SetTagName(s string) *TagUpdate
- func (tu *TagUpdate) SetUpdatedAt(t time.Time) *TagUpdate
- func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate
- type TagUpdateOne
- func (tuo *TagUpdateOne) AddBannerIDs(ids ...int) *TagUpdateOne
- func (tuo *TagUpdateOne) AddBanners(b ...*Banner) *TagUpdateOne
- func (tuo *TagUpdateOne) ClearBanners() *TagUpdateOne
- func (tuo *TagUpdateOne) Exec(ctx context.Context) error
- func (tuo *TagUpdateOne) ExecX(ctx context.Context)
- func (tuo *TagUpdateOne) Mutation() *TagMutation
- func (tuo *TagUpdateOne) RemoveBannerIDs(ids ...int) *TagUpdateOne
- func (tuo *TagUpdateOne) RemoveBanners(b ...*Banner) *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) SetNillableTagName(s *string) *TagUpdateOne
- func (tuo *TagUpdateOne) SetNillableUpdatedAt(t *time.Time) *TagUpdateOne
- func (tuo *TagUpdateOne) SetTagName(s string) *TagUpdateOne
- func (tuo *TagUpdateOne) SetUpdatedAt(t time.Time) *TagUpdateOne
- func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne
- 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. TypeBanner = "Banner" TypeFeature = "Feature" 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 Banner ¶
type Banner struct { // ID of the ent. ID int `json:"id,omitempty"` // Content holds the value of the "content" field. Content map[string]interface{} `json:"content,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // IsActive holds the value of the "is_active" field. IsActive bool `json:"is_active,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the BannerQuery when eager-loading is set. Edges BannerEdges `json:"edges"` // contains filtered or unexported fields }
Banner is the model entity for the Banner schema.
func (*Banner) QueryFeature ¶
func (b *Banner) QueryFeature() *FeatureQuery
QueryFeature queries the "feature" edge of the Banner entity.
func (*Banner) Unwrap ¶
Unwrap unwraps the Banner 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 (*Banner) Update ¶
func (b *Banner) Update() *BannerUpdateOne
Update returns a builder for updating this Banner. Note that you need to call Banner.Unwrap() before calling this method if this Banner was returned from a transaction, and the transaction was committed or rolled back.
type BannerClient ¶
type BannerClient struct {
// contains filtered or unexported fields
}
BannerClient is a client for the Banner schema.
func NewBannerClient ¶
func NewBannerClient(c config) *BannerClient
NewBannerClient returns a client for the Banner from the given config.
func (*BannerClient) Create ¶
func (c *BannerClient) Create() *BannerCreate
Create returns a builder for creating a Banner entity.
func (*BannerClient) CreateBulk ¶
func (c *BannerClient) CreateBulk(builders ...*BannerCreate) *BannerCreateBulk
CreateBulk returns a builder for creating a bulk of Banner entities.
func (*BannerClient) Delete ¶
func (c *BannerClient) Delete() *BannerDelete
Delete returns a delete builder for Banner.
func (*BannerClient) DeleteOne ¶
func (c *BannerClient) DeleteOne(b *Banner) *BannerDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*BannerClient) DeleteOneID ¶
func (c *BannerClient) DeleteOneID(id int) *BannerDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*BannerClient) GetX ¶
func (c *BannerClient) GetX(ctx context.Context, id int) *Banner
GetX is like Get, but panics if an error occurs.
func (*BannerClient) Intercept ¶
func (c *BannerClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `banner.Intercept(f(g(h())))`.
func (*BannerClient) Interceptors ¶
func (c *BannerClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*BannerClient) MapCreateBulk ¶
func (c *BannerClient) MapCreateBulk(slice any, setFunc func(*BannerCreate, int)) *BannerCreateBulk
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 (*BannerClient) Query ¶
func (c *BannerClient) Query() *BannerQuery
Query returns a query builder for Banner.
func (*BannerClient) QueryFeature ¶
func (c *BannerClient) QueryFeature(b *Banner) *FeatureQuery
QueryFeature queries the feature edge of a Banner.
func (*BannerClient) QueryTags ¶
func (c *BannerClient) QueryTags(b *Banner) *TagQuery
QueryTags queries the tags edge of a Banner.
func (*BannerClient) Update ¶
func (c *BannerClient) Update() *BannerUpdate
Update returns an update builder for Banner.
func (*BannerClient) UpdateOne ¶
func (c *BannerClient) UpdateOne(b *Banner) *BannerUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BannerClient) UpdateOneID ¶
func (c *BannerClient) UpdateOneID(id int) *BannerUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BannerClient) Use ¶
func (c *BannerClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `banner.Hooks(f(g(h())))`.
type BannerCreate ¶
type BannerCreate struct {
// contains filtered or unexported fields
}
BannerCreate is the builder for creating a Banner entity.
func (*BannerCreate) AddFeature ¶
func (bc *BannerCreate) AddFeature(f ...*Feature) *BannerCreate
AddFeature adds the "feature" edges to the Feature entity.
func (*BannerCreate) AddFeatureIDs ¶
func (bc *BannerCreate) AddFeatureIDs(ids ...int) *BannerCreate
AddFeatureIDs adds the "feature" edge to the Feature entity by IDs.
func (*BannerCreate) AddTagIDs ¶
func (bc *BannerCreate) AddTagIDs(ids ...int) *BannerCreate
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*BannerCreate) AddTags ¶
func (bc *BannerCreate) AddTags(t ...*Tag) *BannerCreate
AddTags adds the "tags" edges to the Tag entity.
func (*BannerCreate) Exec ¶
func (bc *BannerCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BannerCreate) ExecX ¶
func (bc *BannerCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BannerCreate) Mutation ¶
func (bc *BannerCreate) Mutation() *BannerMutation
Mutation returns the BannerMutation object of the builder.
func (*BannerCreate) Save ¶
func (bc *BannerCreate) Save(ctx context.Context) (*Banner, error)
Save creates the Banner in the database.
func (*BannerCreate) SaveX ¶
func (bc *BannerCreate) SaveX(ctx context.Context) *Banner
SaveX calls Save and panics if Save returns an error.
func (*BannerCreate) SetContent ¶
func (bc *BannerCreate) SetContent(m map[string]interface{}) *BannerCreate
SetContent sets the "content" field.
func (*BannerCreate) SetCreatedAt ¶
func (bc *BannerCreate) SetCreatedAt(t time.Time) *BannerCreate
SetCreatedAt sets the "created_at" field.
func (*BannerCreate) SetIsActive ¶
func (bc *BannerCreate) SetIsActive(b bool) *BannerCreate
SetIsActive sets the "is_active" field.
func (*BannerCreate) SetNillableCreatedAt ¶
func (bc *BannerCreate) SetNillableCreatedAt(t *time.Time) *BannerCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*BannerCreate) SetNillableIsActive ¶
func (bc *BannerCreate) SetNillableIsActive(b *bool) *BannerCreate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*BannerCreate) SetNillableUpdatedAt ¶
func (bc *BannerCreate) SetNillableUpdatedAt(t *time.Time) *BannerCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*BannerCreate) SetUpdatedAt ¶
func (bc *BannerCreate) SetUpdatedAt(t time.Time) *BannerCreate
SetUpdatedAt sets the "updated_at" field.
type BannerCreateBulk ¶
type BannerCreateBulk struct {
// contains filtered or unexported fields
}
BannerCreateBulk is the builder for creating many Banner entities in bulk.
func (*BannerCreateBulk) Exec ¶
func (bcb *BannerCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BannerCreateBulk) ExecX ¶
func (bcb *BannerCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type BannerDelete ¶
type BannerDelete struct {
// contains filtered or unexported fields
}
BannerDelete is the builder for deleting a Banner entity.
func (*BannerDelete) Exec ¶
func (bd *BannerDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BannerDelete) ExecX ¶
func (bd *BannerDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BannerDelete) Where ¶
func (bd *BannerDelete) Where(ps ...predicate.Banner) *BannerDelete
Where appends a list predicates to the BannerDelete builder.
type BannerDeleteOne ¶
type BannerDeleteOne struct {
// contains filtered or unexported fields
}
BannerDeleteOne is the builder for deleting a single Banner entity.
func (*BannerDeleteOne) Exec ¶
func (bdo *BannerDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BannerDeleteOne) ExecX ¶
func (bdo *BannerDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BannerDeleteOne) Where ¶
func (bdo *BannerDeleteOne) Where(ps ...predicate.Banner) *BannerDeleteOne
Where appends a list predicates to the BannerDelete builder.
type BannerEdges ¶
type BannerEdges struct { // Tags holds the value of the tags edge. Tags []*Tag `json:"tags,omitempty"` // Feature holds the value of the feature edge. Feature []*Feature `json:"feature,omitempty"` // contains filtered or unexported fields }
BannerEdges holds the relations/edges for other nodes in the graph.
func (BannerEdges) FeatureOrErr ¶
func (e BannerEdges) FeatureOrErr() ([]*Feature, error)
FeatureOrErr returns the Feature value or an error if the edge was not loaded in eager-loading.
func (BannerEdges) TagsOrErr ¶
func (e BannerEdges) TagsOrErr() ([]*Tag, error)
TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading.
type BannerGroupBy ¶
type BannerGroupBy struct {
// contains filtered or unexported fields
}
BannerGroupBy is the group-by builder for Banner entities.
func (*BannerGroupBy) Aggregate ¶
func (bgb *BannerGroupBy) Aggregate(fns ...AggregateFunc) *BannerGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BannerGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BannerGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BannerGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BannerGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BannerGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BannerGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BannerGroupBy) Scan ¶
func (bgb *BannerGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BannerGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BannerMutation ¶
type BannerMutation struct {
// contains filtered or unexported fields
}
BannerMutation represents an operation that mutates the Banner nodes in the graph.
func (*BannerMutation) AddFeatureIDs ¶
func (m *BannerMutation) AddFeatureIDs(ids ...int)
AddFeatureIDs adds the "feature" edge to the Feature entity by ids.
func (*BannerMutation) AddField ¶
func (m *BannerMutation) 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 (*BannerMutation) AddTagIDs ¶
func (m *BannerMutation) AddTagIDs(ids ...int)
AddTagIDs adds the "tags" edge to the Tag entity by ids.
func (*BannerMutation) AddedEdges ¶
func (m *BannerMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BannerMutation) AddedField ¶
func (m *BannerMutation) 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 (*BannerMutation) AddedFields ¶
func (m *BannerMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BannerMutation) AddedIDs ¶
func (m *BannerMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BannerMutation) ClearEdge ¶
func (m *BannerMutation) 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 (*BannerMutation) ClearFeature ¶
func (m *BannerMutation) ClearFeature()
ClearFeature clears the "feature" edge to the Feature entity.
func (*BannerMutation) ClearField ¶
func (m *BannerMutation) 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 (*BannerMutation) ClearTags ¶
func (m *BannerMutation) ClearTags()
ClearTags clears the "tags" edge to the Tag entity.
func (*BannerMutation) ClearedEdges ¶
func (m *BannerMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BannerMutation) ClearedFields ¶
func (m *BannerMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BannerMutation) Client ¶
func (m BannerMutation) 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 (*BannerMutation) Content ¶
func (m *BannerMutation) Content() (r map[string]interface{}, exists bool)
Content returns the value of the "content" field in the mutation.
func (*BannerMutation) CreatedAt ¶
func (m *BannerMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*BannerMutation) EdgeCleared ¶
func (m *BannerMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BannerMutation) FeatureCleared ¶
func (m *BannerMutation) FeatureCleared() bool
FeatureCleared reports if the "feature" edge to the Feature entity was cleared.
func (*BannerMutation) FeatureIDs ¶
func (m *BannerMutation) FeatureIDs() (ids []int)
FeatureIDs returns the "feature" edge IDs in the mutation.
func (*BannerMutation) Field ¶
func (m *BannerMutation) 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 (*BannerMutation) FieldCleared ¶
func (m *BannerMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BannerMutation) Fields ¶
func (m *BannerMutation) 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 (*BannerMutation) ID ¶
func (m *BannerMutation) 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 (*BannerMutation) IDs ¶
func (m *BannerMutation) 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 (*BannerMutation) IsActive ¶
func (m *BannerMutation) IsActive() (r bool, exists bool)
IsActive returns the value of the "is_active" field in the mutation.
func (*BannerMutation) OldContent ¶
func (m *BannerMutation) OldContent(ctx context.Context) (v map[string]interface{}, err error)
OldContent returns the old "content" field's value of the Banner entity. If the Banner 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 (*BannerMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Banner entity. If the Banner 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 (*BannerMutation) 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 (*BannerMutation) OldIsActive ¶
func (m *BannerMutation) OldIsActive(ctx context.Context) (v bool, err error)
OldIsActive returns the old "is_active" field's value of the Banner entity. If the Banner 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 (*BannerMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Banner entity. If the Banner 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 (*BannerMutation) RemoveFeatureIDs ¶
func (m *BannerMutation) RemoveFeatureIDs(ids ...int)
RemoveFeatureIDs removes the "feature" edge to the Feature entity by IDs.
func (*BannerMutation) RemoveTagIDs ¶
func (m *BannerMutation) RemoveTagIDs(ids ...int)
RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.
func (*BannerMutation) RemovedEdges ¶
func (m *BannerMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BannerMutation) RemovedFeatureIDs ¶
func (m *BannerMutation) RemovedFeatureIDs() (ids []int)
RemovedFeature returns the removed IDs of the "feature" edge to the Feature entity.
func (*BannerMutation) RemovedIDs ¶
func (m *BannerMutation) 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 (*BannerMutation) RemovedTagsIDs ¶
func (m *BannerMutation) RemovedTagsIDs() (ids []int)
RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.
func (*BannerMutation) ResetContent ¶
func (m *BannerMutation) ResetContent()
ResetContent resets all changes to the "content" field.
func (*BannerMutation) ResetCreatedAt ¶
func (m *BannerMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*BannerMutation) ResetEdge ¶
func (m *BannerMutation) 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 (*BannerMutation) ResetFeature ¶
func (m *BannerMutation) ResetFeature()
ResetFeature resets all changes to the "feature" edge.
func (*BannerMutation) ResetField ¶
func (m *BannerMutation) 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 (*BannerMutation) ResetIsActive ¶
func (m *BannerMutation) ResetIsActive()
ResetIsActive resets all changes to the "is_active" field.
func (*BannerMutation) ResetTags ¶
func (m *BannerMutation) ResetTags()
ResetTags resets all changes to the "tags" edge.
func (*BannerMutation) ResetUpdatedAt ¶
func (m *BannerMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*BannerMutation) SetContent ¶
func (m *BannerMutation) SetContent(value map[string]interface{})
SetContent sets the "content" field.
func (*BannerMutation) SetCreatedAt ¶
func (m *BannerMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*BannerMutation) SetField ¶
func (m *BannerMutation) 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 (*BannerMutation) SetIsActive ¶
func (m *BannerMutation) SetIsActive(b bool)
SetIsActive sets the "is_active" field.
func (*BannerMutation) SetOp ¶
func (m *BannerMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*BannerMutation) SetUpdatedAt ¶
func (m *BannerMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*BannerMutation) TagsCleared ¶
func (m *BannerMutation) TagsCleared() bool
TagsCleared reports if the "tags" edge to the Tag entity was cleared.
func (*BannerMutation) TagsIDs ¶
func (m *BannerMutation) TagsIDs() (ids []int)
TagsIDs returns the "tags" edge IDs in the mutation.
func (BannerMutation) Tx ¶
func (m BannerMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BannerMutation) Type ¶
func (m *BannerMutation) Type() string
Type returns the node type of this mutation (Banner).
func (*BannerMutation) UpdatedAt ¶
func (m *BannerMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*BannerMutation) Where ¶
func (m *BannerMutation) Where(ps ...predicate.Banner)
Where appends a list predicates to the BannerMutation builder.
func (*BannerMutation) WhereP ¶
func (m *BannerMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the BannerMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type BannerQuery ¶
type BannerQuery struct {
// contains filtered or unexported fields
}
BannerQuery is the builder for querying Banner entities.
func (*BannerQuery) Aggregate ¶
func (bq *BannerQuery) Aggregate(fns ...AggregateFunc) *BannerSelect
Aggregate returns a BannerSelect configured with the given aggregations.
func (*BannerQuery) All ¶
func (bq *BannerQuery) All(ctx context.Context) ([]*Banner, error)
All executes the query and returns a list of Banners.
func (*BannerQuery) AllX ¶
func (bq *BannerQuery) AllX(ctx context.Context) []*Banner
AllX is like All, but panics if an error occurs.
func (*BannerQuery) Clone ¶
func (bq *BannerQuery) Clone() *BannerQuery
Clone returns a duplicate of the BannerQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BannerQuery) Count ¶
func (bq *BannerQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*BannerQuery) CountX ¶
func (bq *BannerQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*BannerQuery) Exist ¶
func (bq *BannerQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*BannerQuery) ExistX ¶
func (bq *BannerQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*BannerQuery) First ¶
func (bq *BannerQuery) First(ctx context.Context) (*Banner, error)
First returns the first Banner entity from the query. Returns a *NotFoundError when no Banner was found.
func (*BannerQuery) FirstID ¶
func (bq *BannerQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Banner ID from the query. Returns a *NotFoundError when no Banner ID was found.
func (*BannerQuery) FirstIDX ¶
func (bq *BannerQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*BannerQuery) FirstX ¶
func (bq *BannerQuery) FirstX(ctx context.Context) *Banner
FirstX is like First, but panics if an error occurs.
func (*BannerQuery) GroupBy ¶
func (bq *BannerQuery) GroupBy(field string, fields ...string) *BannerGroupBy
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 { Content map[string]interface {} `json:"content,omitempty"` Count int `json:"count,omitempty"` } client.Banner.Query(). GroupBy(banner.FieldContent). Aggregate(ent.Count()). Scan(ctx, &v)
func (*BannerQuery) IDs ¶
func (bq *BannerQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Banner IDs.
func (*BannerQuery) IDsX ¶
func (bq *BannerQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*BannerQuery) Limit ¶
func (bq *BannerQuery) Limit(limit int) *BannerQuery
Limit the number of records to be returned by this query.
func (*BannerQuery) Offset ¶
func (bq *BannerQuery) Offset(offset int) *BannerQuery
Offset to start from.
func (*BannerQuery) Only ¶
func (bq *BannerQuery) Only(ctx context.Context) (*Banner, error)
Only returns a single Banner entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Banner entity is found. Returns a *NotFoundError when no Banner entities are found.
func (*BannerQuery) OnlyID ¶
func (bq *BannerQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Banner ID in the query. Returns a *NotSingularError when more than one Banner ID is found. Returns a *NotFoundError when no entities are found.
func (*BannerQuery) OnlyIDX ¶
func (bq *BannerQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*BannerQuery) OnlyX ¶
func (bq *BannerQuery) OnlyX(ctx context.Context) *Banner
OnlyX is like Only, but panics if an error occurs.
func (*BannerQuery) Order ¶
func (bq *BannerQuery) Order(o ...banner.OrderOption) *BannerQuery
Order specifies how the records should be ordered.
func (*BannerQuery) QueryFeature ¶
func (bq *BannerQuery) QueryFeature() *FeatureQuery
QueryFeature chains the current query on the "feature" edge.
func (*BannerQuery) QueryTags ¶
func (bq *BannerQuery) QueryTags() *TagQuery
QueryTags chains the current query on the "tags" edge.
func (*BannerQuery) Select ¶
func (bq *BannerQuery) Select(fields ...string) *BannerSelect
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 { Content map[string]interface {} `json:"content,omitempty"` } client.Banner.Query(). Select(banner.FieldContent). Scan(ctx, &v)
func (*BannerQuery) Unique ¶
func (bq *BannerQuery) Unique(unique bool) *BannerQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*BannerQuery) Where ¶
func (bq *BannerQuery) Where(ps ...predicate.Banner) *BannerQuery
Where adds a new predicate for the BannerQuery builder.
func (*BannerQuery) WithFeature ¶
func (bq *BannerQuery) WithFeature(opts ...func(*FeatureQuery)) *BannerQuery
WithFeature tells the query-builder to eager-load the nodes that are connected to the "feature" edge. The optional arguments are used to configure the query builder of the edge.
func (*BannerQuery) WithTags ¶
func (bq *BannerQuery) WithTags(opts ...func(*TagQuery)) *BannerQuery
WithTags tells the query-builder to eager-load the nodes that are connected to the "tags" edge. The optional arguments are used to configure the query builder of the edge.
type BannerSelect ¶
type BannerSelect struct { *BannerQuery // contains filtered or unexported fields }
BannerSelect is the builder for selecting fields of Banner entities.
func (*BannerSelect) Aggregate ¶
func (bs *BannerSelect) Aggregate(fns ...AggregateFunc) *BannerSelect
Aggregate adds the given aggregation functions to the selector query.
func (*BannerSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BannerSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BannerSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BannerSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BannerSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BannerSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BannerSelect) Scan ¶
func (bs *BannerSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BannerSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BannerUpdate ¶
type BannerUpdate struct {
// contains filtered or unexported fields
}
BannerUpdate is the builder for updating Banner entities.
func (*BannerUpdate) AddFeature ¶
func (bu *BannerUpdate) AddFeature(f ...*Feature) *BannerUpdate
AddFeature adds the "feature" edges to the Feature entity.
func (*BannerUpdate) AddFeatureIDs ¶
func (bu *BannerUpdate) AddFeatureIDs(ids ...int) *BannerUpdate
AddFeatureIDs adds the "feature" edge to the Feature entity by IDs.
func (*BannerUpdate) AddTagIDs ¶
func (bu *BannerUpdate) AddTagIDs(ids ...int) *BannerUpdate
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*BannerUpdate) AddTags ¶
func (bu *BannerUpdate) AddTags(t ...*Tag) *BannerUpdate
AddTags adds the "tags" edges to the Tag entity.
func (*BannerUpdate) ClearFeature ¶
func (bu *BannerUpdate) ClearFeature() *BannerUpdate
ClearFeature clears all "feature" edges to the Feature entity.
func (*BannerUpdate) ClearTags ¶
func (bu *BannerUpdate) ClearTags() *BannerUpdate
ClearTags clears all "tags" edges to the Tag entity.
func (*BannerUpdate) Exec ¶
func (bu *BannerUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BannerUpdate) ExecX ¶
func (bu *BannerUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BannerUpdate) Mutation ¶
func (bu *BannerUpdate) Mutation() *BannerMutation
Mutation returns the BannerMutation object of the builder.
func (*BannerUpdate) RemoveFeature ¶
func (bu *BannerUpdate) RemoveFeature(f ...*Feature) *BannerUpdate
RemoveFeature removes "feature" edges to Feature entities.
func (*BannerUpdate) RemoveFeatureIDs ¶
func (bu *BannerUpdate) RemoveFeatureIDs(ids ...int) *BannerUpdate
RemoveFeatureIDs removes the "feature" edge to Feature entities by IDs.
func (*BannerUpdate) RemoveTagIDs ¶
func (bu *BannerUpdate) RemoveTagIDs(ids ...int) *BannerUpdate
RemoveTagIDs removes the "tags" edge to Tag entities by IDs.
func (*BannerUpdate) RemoveTags ¶
func (bu *BannerUpdate) RemoveTags(t ...*Tag) *BannerUpdate
RemoveTags removes "tags" edges to Tag entities.
func (*BannerUpdate) Save ¶
func (bu *BannerUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BannerUpdate) SaveX ¶
func (bu *BannerUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BannerUpdate) SetContent ¶
func (bu *BannerUpdate) SetContent(m map[string]interface{}) *BannerUpdate
SetContent sets the "content" field.
func (*BannerUpdate) SetIsActive ¶
func (bu *BannerUpdate) SetIsActive(b bool) *BannerUpdate
SetIsActive sets the "is_active" field.
func (*BannerUpdate) SetNillableIsActive ¶
func (bu *BannerUpdate) SetNillableIsActive(b *bool) *BannerUpdate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*BannerUpdate) SetNillableUpdatedAt ¶
func (bu *BannerUpdate) SetNillableUpdatedAt(t *time.Time) *BannerUpdate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*BannerUpdate) SetUpdatedAt ¶
func (bu *BannerUpdate) SetUpdatedAt(t time.Time) *BannerUpdate
SetUpdatedAt sets the "updated_at" field.
func (*BannerUpdate) Where ¶
func (bu *BannerUpdate) Where(ps ...predicate.Banner) *BannerUpdate
Where appends a list predicates to the BannerUpdate builder.
type BannerUpdateOne ¶
type BannerUpdateOne struct {
// contains filtered or unexported fields
}
BannerUpdateOne is the builder for updating a single Banner entity.
func (*BannerUpdateOne) AddFeature ¶
func (buo *BannerUpdateOne) AddFeature(f ...*Feature) *BannerUpdateOne
AddFeature adds the "feature" edges to the Feature entity.
func (*BannerUpdateOne) AddFeatureIDs ¶
func (buo *BannerUpdateOne) AddFeatureIDs(ids ...int) *BannerUpdateOne
AddFeatureIDs adds the "feature" edge to the Feature entity by IDs.
func (*BannerUpdateOne) AddTagIDs ¶
func (buo *BannerUpdateOne) AddTagIDs(ids ...int) *BannerUpdateOne
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*BannerUpdateOne) AddTags ¶
func (buo *BannerUpdateOne) AddTags(t ...*Tag) *BannerUpdateOne
AddTags adds the "tags" edges to the Tag entity.
func (*BannerUpdateOne) ClearFeature ¶
func (buo *BannerUpdateOne) ClearFeature() *BannerUpdateOne
ClearFeature clears all "feature" edges to the Feature entity.
func (*BannerUpdateOne) ClearTags ¶
func (buo *BannerUpdateOne) ClearTags() *BannerUpdateOne
ClearTags clears all "tags" edges to the Tag entity.
func (*BannerUpdateOne) Exec ¶
func (buo *BannerUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BannerUpdateOne) ExecX ¶
func (buo *BannerUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BannerUpdateOne) Mutation ¶
func (buo *BannerUpdateOne) Mutation() *BannerMutation
Mutation returns the BannerMutation object of the builder.
func (*BannerUpdateOne) RemoveFeature ¶
func (buo *BannerUpdateOne) RemoveFeature(f ...*Feature) *BannerUpdateOne
RemoveFeature removes "feature" edges to Feature entities.
func (*BannerUpdateOne) RemoveFeatureIDs ¶
func (buo *BannerUpdateOne) RemoveFeatureIDs(ids ...int) *BannerUpdateOne
RemoveFeatureIDs removes the "feature" edge to Feature entities by IDs.
func (*BannerUpdateOne) RemoveTagIDs ¶
func (buo *BannerUpdateOne) RemoveTagIDs(ids ...int) *BannerUpdateOne
RemoveTagIDs removes the "tags" edge to Tag entities by IDs.
func (*BannerUpdateOne) RemoveTags ¶
func (buo *BannerUpdateOne) RemoveTags(t ...*Tag) *BannerUpdateOne
RemoveTags removes "tags" edges to Tag entities.
func (*BannerUpdateOne) Save ¶
func (buo *BannerUpdateOne) Save(ctx context.Context) (*Banner, error)
Save executes the query and returns the updated Banner entity.
func (*BannerUpdateOne) SaveX ¶
func (buo *BannerUpdateOne) SaveX(ctx context.Context) *Banner
SaveX is like Save, but panics if an error occurs.
func (*BannerUpdateOne) Select ¶
func (buo *BannerUpdateOne) Select(field string, fields ...string) *BannerUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BannerUpdateOne) SetContent ¶
func (buo *BannerUpdateOne) SetContent(m map[string]interface{}) *BannerUpdateOne
SetContent sets the "content" field.
func (*BannerUpdateOne) SetIsActive ¶
func (buo *BannerUpdateOne) SetIsActive(b bool) *BannerUpdateOne
SetIsActive sets the "is_active" field.
func (*BannerUpdateOne) SetNillableIsActive ¶
func (buo *BannerUpdateOne) SetNillableIsActive(b *bool) *BannerUpdateOne
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*BannerUpdateOne) SetNillableUpdatedAt ¶
func (buo *BannerUpdateOne) SetNillableUpdatedAt(t *time.Time) *BannerUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*BannerUpdateOne) SetUpdatedAt ¶
func (buo *BannerUpdateOne) SetUpdatedAt(t time.Time) *BannerUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*BannerUpdateOne) Where ¶
func (buo *BannerUpdateOne) Where(ps ...predicate.Banner) *BannerUpdateOne
Where appends a list predicates to the BannerUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Banner is the client for interacting with the Banner builders. Banner *BannerClient // Feature is the client for interacting with the Feature builders. Feature *FeatureClient // 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(). Banner. 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 Feature ¶
type Feature struct { // ID of the ent. ID int `json:"id,omitempty"` // FeatureName holds the value of the "feature_name" field. FeatureName string `json:"feature_name,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the FeatureQuery when eager-loading is set. Edges FeatureEdges `json:"edges"` // contains filtered or unexported fields }
Feature is the model entity for the Feature schema.
func (*Feature) QueryBanners ¶
func (f *Feature) QueryBanners() *BannerQuery
QueryBanners queries the "banners" edge of the Feature entity.
func (*Feature) Unwrap ¶
Unwrap unwraps the Feature 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 (*Feature) Update ¶
func (f *Feature) Update() *FeatureUpdateOne
Update returns a builder for updating this Feature. Note that you need to call Feature.Unwrap() before calling this method if this Feature was returned from a transaction, and the transaction was committed or rolled back.
type FeatureClient ¶
type FeatureClient struct {
// contains filtered or unexported fields
}
FeatureClient is a client for the Feature schema.
func NewFeatureClient ¶
func NewFeatureClient(c config) *FeatureClient
NewFeatureClient returns a client for the Feature from the given config.
func (*FeatureClient) Create ¶
func (c *FeatureClient) Create() *FeatureCreate
Create returns a builder for creating a Feature entity.
func (*FeatureClient) CreateBulk ¶
func (c *FeatureClient) CreateBulk(builders ...*FeatureCreate) *FeatureCreateBulk
CreateBulk returns a builder for creating a bulk of Feature entities.
func (*FeatureClient) Delete ¶
func (c *FeatureClient) Delete() *FeatureDelete
Delete returns a delete builder for Feature.
func (*FeatureClient) DeleteOne ¶
func (c *FeatureClient) DeleteOne(f *Feature) *FeatureDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*FeatureClient) DeleteOneID ¶
func (c *FeatureClient) DeleteOneID(id int) *FeatureDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*FeatureClient) GetX ¶
func (c *FeatureClient) GetX(ctx context.Context, id int) *Feature
GetX is like Get, but panics if an error occurs.
func (*FeatureClient) Hooks ¶
func (c *FeatureClient) Hooks() []Hook
Hooks returns the client hooks.
func (*FeatureClient) Intercept ¶
func (c *FeatureClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `feature.Intercept(f(g(h())))`.
func (*FeatureClient) Interceptors ¶
func (c *FeatureClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*FeatureClient) MapCreateBulk ¶
func (c *FeatureClient) MapCreateBulk(slice any, setFunc func(*FeatureCreate, int)) *FeatureCreateBulk
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 (*FeatureClient) Query ¶
func (c *FeatureClient) Query() *FeatureQuery
Query returns a query builder for Feature.
func (*FeatureClient) QueryBanners ¶
func (c *FeatureClient) QueryBanners(f *Feature) *BannerQuery
QueryBanners queries the banners edge of a Feature.
func (*FeatureClient) Update ¶
func (c *FeatureClient) Update() *FeatureUpdate
Update returns an update builder for Feature.
func (*FeatureClient) UpdateOne ¶
func (c *FeatureClient) UpdateOne(f *Feature) *FeatureUpdateOne
UpdateOne returns an update builder for the given entity.
func (*FeatureClient) UpdateOneID ¶
func (c *FeatureClient) UpdateOneID(id int) *FeatureUpdateOne
UpdateOneID returns an update builder for the given id.
func (*FeatureClient) Use ¶
func (c *FeatureClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `feature.Hooks(f(g(h())))`.
type FeatureCreate ¶
type FeatureCreate struct {
// contains filtered or unexported fields
}
FeatureCreate is the builder for creating a Feature entity.
func (*FeatureCreate) AddBannerIDs ¶
func (fc *FeatureCreate) AddBannerIDs(ids ...int) *FeatureCreate
AddBannerIDs adds the "banners" edge to the Banner entity by IDs.
func (*FeatureCreate) AddBanners ¶
func (fc *FeatureCreate) AddBanners(b ...*Banner) *FeatureCreate
AddBanners adds the "banners" edges to the Banner entity.
func (*FeatureCreate) Exec ¶
func (fc *FeatureCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*FeatureCreate) ExecX ¶
func (fc *FeatureCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FeatureCreate) Mutation ¶
func (fc *FeatureCreate) Mutation() *FeatureMutation
Mutation returns the FeatureMutation object of the builder.
func (*FeatureCreate) Save ¶
func (fc *FeatureCreate) Save(ctx context.Context) (*Feature, error)
Save creates the Feature in the database.
func (*FeatureCreate) SaveX ¶
func (fc *FeatureCreate) SaveX(ctx context.Context) *Feature
SaveX calls Save and panics if Save returns an error.
func (*FeatureCreate) SetCreatedAt ¶
func (fc *FeatureCreate) SetCreatedAt(t time.Time) *FeatureCreate
SetCreatedAt sets the "created_at" field.
func (*FeatureCreate) SetFeatureName ¶
func (fc *FeatureCreate) SetFeatureName(s string) *FeatureCreate
SetFeatureName sets the "feature_name" field.
func (*FeatureCreate) SetNillableCreatedAt ¶
func (fc *FeatureCreate) SetNillableCreatedAt(t *time.Time) *FeatureCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*FeatureCreate) SetNillableUpdatedAt ¶
func (fc *FeatureCreate) SetNillableUpdatedAt(t *time.Time) *FeatureCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*FeatureCreate) SetUpdatedAt ¶
func (fc *FeatureCreate) SetUpdatedAt(t time.Time) *FeatureCreate
SetUpdatedAt sets the "updated_at" field.
type FeatureCreateBulk ¶
type FeatureCreateBulk struct {
// contains filtered or unexported fields
}
FeatureCreateBulk is the builder for creating many Feature entities in bulk.
func (*FeatureCreateBulk) Exec ¶
func (fcb *FeatureCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FeatureCreateBulk) ExecX ¶
func (fcb *FeatureCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type FeatureDelete ¶
type FeatureDelete struct {
// contains filtered or unexported fields
}
FeatureDelete is the builder for deleting a Feature entity.
func (*FeatureDelete) Exec ¶
func (fd *FeatureDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*FeatureDelete) ExecX ¶
func (fd *FeatureDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FeatureDelete) Where ¶
func (fd *FeatureDelete) Where(ps ...predicate.Feature) *FeatureDelete
Where appends a list predicates to the FeatureDelete builder.
type FeatureDeleteOne ¶
type FeatureDeleteOne struct {
// contains filtered or unexported fields
}
FeatureDeleteOne is the builder for deleting a single Feature entity.
func (*FeatureDeleteOne) Exec ¶
func (fdo *FeatureDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*FeatureDeleteOne) ExecX ¶
func (fdo *FeatureDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FeatureDeleteOne) Where ¶
func (fdo *FeatureDeleteOne) Where(ps ...predicate.Feature) *FeatureDeleteOne
Where appends a list predicates to the FeatureDelete builder.
type FeatureEdges ¶
type FeatureEdges struct { // Banners holds the value of the banners edge. Banners []*Banner `json:"banners,omitempty"` // contains filtered or unexported fields }
FeatureEdges holds the relations/edges for other nodes in the graph.
func (FeatureEdges) BannersOrErr ¶
func (e FeatureEdges) BannersOrErr() ([]*Banner, error)
BannersOrErr returns the Banners value or an error if the edge was not loaded in eager-loading.
type FeatureGroupBy ¶
type FeatureGroupBy struct {
// contains filtered or unexported fields
}
FeatureGroupBy is the group-by builder for Feature entities.
func (*FeatureGroupBy) Aggregate ¶
func (fgb *FeatureGroupBy) Aggregate(fns ...AggregateFunc) *FeatureGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*FeatureGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FeatureGroupBy) Scan ¶
func (fgb *FeatureGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FeatureGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FeatureMutation ¶
type FeatureMutation struct {
// contains filtered or unexported fields
}
FeatureMutation represents an operation that mutates the Feature nodes in the graph.
func (*FeatureMutation) AddBannerIDs ¶
func (m *FeatureMutation) AddBannerIDs(ids ...int)
AddBannerIDs adds the "banners" edge to the Banner entity by ids.
func (*FeatureMutation) AddField ¶
func (m *FeatureMutation) 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 (*FeatureMutation) AddedEdges ¶
func (m *FeatureMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*FeatureMutation) AddedField ¶
func (m *FeatureMutation) 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 (*FeatureMutation) AddedFields ¶
func (m *FeatureMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*FeatureMutation) AddedIDs ¶
func (m *FeatureMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*FeatureMutation) BannersCleared ¶
func (m *FeatureMutation) BannersCleared() bool
BannersCleared reports if the "banners" edge to the Banner entity was cleared.
func (*FeatureMutation) BannersIDs ¶
func (m *FeatureMutation) BannersIDs() (ids []int)
BannersIDs returns the "banners" edge IDs in the mutation.
func (*FeatureMutation) ClearBanners ¶
func (m *FeatureMutation) ClearBanners()
ClearBanners clears the "banners" edge to the Banner entity.
func (*FeatureMutation) ClearEdge ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ClearField ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ClearedEdges ¶
func (m *FeatureMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*FeatureMutation) ClearedFields ¶
func (m *FeatureMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (FeatureMutation) Client ¶
func (m FeatureMutation) 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 (*FeatureMutation) CreatedAt ¶
func (m *FeatureMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*FeatureMutation) EdgeCleared ¶
func (m *FeatureMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*FeatureMutation) FeatureName ¶
func (m *FeatureMutation) FeatureName() (r string, exists bool)
FeatureName returns the value of the "feature_name" field in the mutation.
func (*FeatureMutation) Field ¶
func (m *FeatureMutation) 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 (*FeatureMutation) FieldCleared ¶
func (m *FeatureMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*FeatureMutation) Fields ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ID ¶
func (m *FeatureMutation) 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 (*FeatureMutation) IDs ¶
func (m *FeatureMutation) 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 (*FeatureMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) OldFeatureName ¶
func (m *FeatureMutation) OldFeatureName(ctx context.Context) (v string, err error)
OldFeatureName returns the old "feature_name" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) 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 (*FeatureMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Feature entity. If the Feature 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 (*FeatureMutation) RemoveBannerIDs ¶
func (m *FeatureMutation) RemoveBannerIDs(ids ...int)
RemoveBannerIDs removes the "banners" edge to the Banner entity by IDs.
func (*FeatureMutation) RemovedBannersIDs ¶
func (m *FeatureMutation) RemovedBannersIDs() (ids []int)
RemovedBanners returns the removed IDs of the "banners" edge to the Banner entity.
func (*FeatureMutation) RemovedEdges ¶
func (m *FeatureMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*FeatureMutation) RemovedIDs ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ResetBanners ¶
func (m *FeatureMutation) ResetBanners()
ResetBanners resets all changes to the "banners" edge.
func (*FeatureMutation) ResetCreatedAt ¶
func (m *FeatureMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*FeatureMutation) ResetEdge ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ResetFeatureName ¶
func (m *FeatureMutation) ResetFeatureName()
ResetFeatureName resets all changes to the "feature_name" field.
func (*FeatureMutation) ResetField ¶
func (m *FeatureMutation) 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 (*FeatureMutation) ResetUpdatedAt ¶
func (m *FeatureMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*FeatureMutation) SetCreatedAt ¶
func (m *FeatureMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*FeatureMutation) SetFeatureName ¶
func (m *FeatureMutation) SetFeatureName(s string)
SetFeatureName sets the "feature_name" field.
func (*FeatureMutation) SetField ¶
func (m *FeatureMutation) 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 (*FeatureMutation) SetOp ¶
func (m *FeatureMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*FeatureMutation) SetUpdatedAt ¶
func (m *FeatureMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (FeatureMutation) Tx ¶
func (m FeatureMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*FeatureMutation) Type ¶
func (m *FeatureMutation) Type() string
Type returns the node type of this mutation (Feature).
func (*FeatureMutation) UpdatedAt ¶
func (m *FeatureMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*FeatureMutation) Where ¶
func (m *FeatureMutation) Where(ps ...predicate.Feature)
Where appends a list predicates to the FeatureMutation builder.
func (*FeatureMutation) WhereP ¶
func (m *FeatureMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the FeatureMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type FeatureQuery ¶
type FeatureQuery struct {
// contains filtered or unexported fields
}
FeatureQuery is the builder for querying Feature entities.
func (*FeatureQuery) Aggregate ¶
func (fq *FeatureQuery) Aggregate(fns ...AggregateFunc) *FeatureSelect
Aggregate returns a FeatureSelect configured with the given aggregations.
func (*FeatureQuery) All ¶
func (fq *FeatureQuery) All(ctx context.Context) ([]*Feature, error)
All executes the query and returns a list of Features.
func (*FeatureQuery) AllX ¶
func (fq *FeatureQuery) AllX(ctx context.Context) []*Feature
AllX is like All, but panics if an error occurs.
func (*FeatureQuery) Clone ¶
func (fq *FeatureQuery) Clone() *FeatureQuery
Clone returns a duplicate of the FeatureQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*FeatureQuery) Count ¶
func (fq *FeatureQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*FeatureQuery) CountX ¶
func (fq *FeatureQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*FeatureQuery) Exist ¶
func (fq *FeatureQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*FeatureQuery) ExistX ¶
func (fq *FeatureQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*FeatureQuery) First ¶
func (fq *FeatureQuery) First(ctx context.Context) (*Feature, error)
First returns the first Feature entity from the query. Returns a *NotFoundError when no Feature was found.
func (*FeatureQuery) FirstID ¶
func (fq *FeatureQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Feature ID from the query. Returns a *NotFoundError when no Feature ID was found.
func (*FeatureQuery) FirstIDX ¶
func (fq *FeatureQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*FeatureQuery) FirstX ¶
func (fq *FeatureQuery) FirstX(ctx context.Context) *Feature
FirstX is like First, but panics if an error occurs.
func (*FeatureQuery) GroupBy ¶
func (fq *FeatureQuery) GroupBy(field string, fields ...string) *FeatureGroupBy
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 { FeatureName string `json:"feature_name,omitempty"` Count int `json:"count,omitempty"` } client.Feature.Query(). GroupBy(feature.FieldFeatureName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*FeatureQuery) IDs ¶
func (fq *FeatureQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Feature IDs.
func (*FeatureQuery) IDsX ¶
func (fq *FeatureQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*FeatureQuery) Limit ¶
func (fq *FeatureQuery) Limit(limit int) *FeatureQuery
Limit the number of records to be returned by this query.
func (*FeatureQuery) Offset ¶
func (fq *FeatureQuery) Offset(offset int) *FeatureQuery
Offset to start from.
func (*FeatureQuery) Only ¶
func (fq *FeatureQuery) Only(ctx context.Context) (*Feature, error)
Only returns a single Feature entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Feature entity is found. Returns a *NotFoundError when no Feature entities are found.
func (*FeatureQuery) OnlyID ¶
func (fq *FeatureQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Feature ID in the query. Returns a *NotSingularError when more than one Feature ID is found. Returns a *NotFoundError when no entities are found.
func (*FeatureQuery) OnlyIDX ¶
func (fq *FeatureQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*FeatureQuery) OnlyX ¶
func (fq *FeatureQuery) OnlyX(ctx context.Context) *Feature
OnlyX is like Only, but panics if an error occurs.
func (*FeatureQuery) Order ¶
func (fq *FeatureQuery) Order(o ...feature.OrderOption) *FeatureQuery
Order specifies how the records should be ordered.
func (*FeatureQuery) QueryBanners ¶
func (fq *FeatureQuery) QueryBanners() *BannerQuery
QueryBanners chains the current query on the "banners" edge.
func (*FeatureQuery) Select ¶
func (fq *FeatureQuery) Select(fields ...string) *FeatureSelect
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 { FeatureName string `json:"feature_name,omitempty"` } client.Feature.Query(). Select(feature.FieldFeatureName). Scan(ctx, &v)
func (*FeatureQuery) Unique ¶
func (fq *FeatureQuery) Unique(unique bool) *FeatureQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*FeatureQuery) Where ¶
func (fq *FeatureQuery) Where(ps ...predicate.Feature) *FeatureQuery
Where adds a new predicate for the FeatureQuery builder.
func (*FeatureQuery) WithBanners ¶
func (fq *FeatureQuery) WithBanners(opts ...func(*BannerQuery)) *FeatureQuery
WithBanners tells the query-builder to eager-load the nodes that are connected to the "banners" edge. The optional arguments are used to configure the query builder of the edge.
type FeatureSelect ¶
type FeatureSelect struct { *FeatureQuery // contains filtered or unexported fields }
FeatureSelect is the builder for selecting fields of Feature entities.
func (*FeatureSelect) Aggregate ¶
func (fs *FeatureSelect) Aggregate(fns ...AggregateFunc) *FeatureSelect
Aggregate adds the given aggregation functions to the selector query.
func (*FeatureSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FeatureSelect) Scan ¶
func (fs *FeatureSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FeatureSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FeatureUpdate ¶
type FeatureUpdate struct {
// contains filtered or unexported fields
}
FeatureUpdate is the builder for updating Feature entities.
func (*FeatureUpdate) AddBannerIDs ¶
func (fu *FeatureUpdate) AddBannerIDs(ids ...int) *FeatureUpdate
AddBannerIDs adds the "banners" edge to the Banner entity by IDs.
func (*FeatureUpdate) AddBanners ¶
func (fu *FeatureUpdate) AddBanners(b ...*Banner) *FeatureUpdate
AddBanners adds the "banners" edges to the Banner entity.
func (*FeatureUpdate) ClearBanners ¶
func (fu *FeatureUpdate) ClearBanners() *FeatureUpdate
ClearBanners clears all "banners" edges to the Banner entity.
func (*FeatureUpdate) Exec ¶
func (fu *FeatureUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FeatureUpdate) ExecX ¶
func (fu *FeatureUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FeatureUpdate) Mutation ¶
func (fu *FeatureUpdate) Mutation() *FeatureMutation
Mutation returns the FeatureMutation object of the builder.
func (*FeatureUpdate) RemoveBannerIDs ¶
func (fu *FeatureUpdate) RemoveBannerIDs(ids ...int) *FeatureUpdate
RemoveBannerIDs removes the "banners" edge to Banner entities by IDs.
func (*FeatureUpdate) RemoveBanners ¶
func (fu *FeatureUpdate) RemoveBanners(b ...*Banner) *FeatureUpdate
RemoveBanners removes "banners" edges to Banner entities.
func (*FeatureUpdate) Save ¶
func (fu *FeatureUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*FeatureUpdate) SaveX ¶
func (fu *FeatureUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*FeatureUpdate) SetFeatureName ¶
func (fu *FeatureUpdate) SetFeatureName(s string) *FeatureUpdate
SetFeatureName sets the "feature_name" field.
func (*FeatureUpdate) SetNillableFeatureName ¶
func (fu *FeatureUpdate) SetNillableFeatureName(s *string) *FeatureUpdate
SetNillableFeatureName sets the "feature_name" field if the given value is not nil.
func (*FeatureUpdate) SetNillableUpdatedAt ¶
func (fu *FeatureUpdate) SetNillableUpdatedAt(t *time.Time) *FeatureUpdate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*FeatureUpdate) SetUpdatedAt ¶
func (fu *FeatureUpdate) SetUpdatedAt(t time.Time) *FeatureUpdate
SetUpdatedAt sets the "updated_at" field.
func (*FeatureUpdate) Where ¶
func (fu *FeatureUpdate) Where(ps ...predicate.Feature) *FeatureUpdate
Where appends a list predicates to the FeatureUpdate builder.
type FeatureUpdateOne ¶
type FeatureUpdateOne struct {
// contains filtered or unexported fields
}
FeatureUpdateOne is the builder for updating a single Feature entity.
func (*FeatureUpdateOne) AddBannerIDs ¶
func (fuo *FeatureUpdateOne) AddBannerIDs(ids ...int) *FeatureUpdateOne
AddBannerIDs adds the "banners" edge to the Banner entity by IDs.
func (*FeatureUpdateOne) AddBanners ¶
func (fuo *FeatureUpdateOne) AddBanners(b ...*Banner) *FeatureUpdateOne
AddBanners adds the "banners" edges to the Banner entity.
func (*FeatureUpdateOne) ClearBanners ¶
func (fuo *FeatureUpdateOne) ClearBanners() *FeatureUpdateOne
ClearBanners clears all "banners" edges to the Banner entity.
func (*FeatureUpdateOne) Exec ¶
func (fuo *FeatureUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FeatureUpdateOne) ExecX ¶
func (fuo *FeatureUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FeatureUpdateOne) Mutation ¶
func (fuo *FeatureUpdateOne) Mutation() *FeatureMutation
Mutation returns the FeatureMutation object of the builder.
func (*FeatureUpdateOne) RemoveBannerIDs ¶
func (fuo *FeatureUpdateOne) RemoveBannerIDs(ids ...int) *FeatureUpdateOne
RemoveBannerIDs removes the "banners" edge to Banner entities by IDs.
func (*FeatureUpdateOne) RemoveBanners ¶
func (fuo *FeatureUpdateOne) RemoveBanners(b ...*Banner) *FeatureUpdateOne
RemoveBanners removes "banners" edges to Banner entities.
func (*FeatureUpdateOne) Save ¶
func (fuo *FeatureUpdateOne) Save(ctx context.Context) (*Feature, error)
Save executes the query and returns the updated Feature entity.
func (*FeatureUpdateOne) SaveX ¶
func (fuo *FeatureUpdateOne) SaveX(ctx context.Context) *Feature
SaveX is like Save, but panics if an error occurs.
func (*FeatureUpdateOne) Select ¶
func (fuo *FeatureUpdateOne) Select(field string, fields ...string) *FeatureUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*FeatureUpdateOne) SetFeatureName ¶
func (fuo *FeatureUpdateOne) SetFeatureName(s string) *FeatureUpdateOne
SetFeatureName sets the "feature_name" field.
func (*FeatureUpdateOne) SetNillableFeatureName ¶
func (fuo *FeatureUpdateOne) SetNillableFeatureName(s *string) *FeatureUpdateOne
SetNillableFeatureName sets the "feature_name" field if the given value is not nil.
func (*FeatureUpdateOne) SetNillableUpdatedAt ¶
func (fuo *FeatureUpdateOne) SetNillableUpdatedAt(t *time.Time) *FeatureUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*FeatureUpdateOne) SetUpdatedAt ¶
func (fuo *FeatureUpdateOne) SetUpdatedAt(t time.Time) *FeatureUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*FeatureUpdateOne) Where ¶
func (fuo *FeatureUpdateOne) Where(ps ...predicate.Feature) *FeatureUpdateOne
Where appends a list predicates to the FeatureUpdate builder.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type 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"` // TagName holds the value of the "tag_name" field. TagName string `json:"tag_name,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TagQuery when eager-loading is set. Edges TagEdges `json:"edges"` // contains filtered or unexported fields }
Tag is the model entity for the Tag schema.
func (*Tag) QueryBanners ¶
func (t *Tag) QueryBanners() *BannerQuery
QueryBanners queries the "banners" edge of the Tag entity.
func (*Tag) Unwrap ¶
Unwrap unwraps the Tag entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Tag) Update ¶
func (t *Tag) Update() *TagUpdateOne
Update returns a builder for updating this Tag. Note that you need to call Tag.Unwrap() before calling this method if this Tag was returned from a transaction, and the transaction was committed or rolled back.
type TagClient ¶
type TagClient struct {
// contains filtered or unexported fields
}
TagClient is a client for the Tag schema.
func NewTagClient ¶
func NewTagClient(c config) *TagClient
NewTagClient returns a client for the Tag from the given config.
func (*TagClient) CreateBulk ¶
func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk
CreateBulk returns a builder for creating a bulk of Tag entities.
func (*TagClient) DeleteOne ¶
func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TagClient) DeleteOneID ¶
func (c *TagClient) DeleteOneID(id int) *TagDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TagClient) Intercept ¶
func (c *TagClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tag.Intercept(f(g(h())))`.
func (*TagClient) Interceptors ¶
func (c *TagClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TagClient) MapCreateBulk ¶
func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*TagClient) QueryBanners ¶
func (c *TagClient) QueryBanners(t *Tag) *BannerQuery
QueryBanners queries the banners edge of a Tag.
func (*TagClient) UpdateOne ¶
func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TagClient) UpdateOneID ¶
func (c *TagClient) UpdateOneID(id int) *TagUpdateOne
UpdateOneID returns an update builder for the given id.
type TagCreate ¶
type TagCreate struct {
// contains filtered or unexported fields
}
TagCreate is the builder for creating a Tag entity.
func (*TagCreate) AddBannerIDs ¶
AddBannerIDs adds the "banners" edge to the Banner entity by IDs.
func (*TagCreate) AddBanners ¶
AddBanners adds the "banners" edges to the Banner entity.
func (*TagCreate) Mutation ¶
func (tc *TagCreate) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagCreate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*TagCreate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*TagCreate) SetNillableUpdatedAt ¶
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*TagCreate) SetTagName ¶
SetTagName sets the "tag_name" field.
type TagCreateBulk ¶
type TagCreateBulk struct {
// contains filtered or unexported fields
}
TagCreateBulk is the builder for creating many Tag entities in bulk.
func (*TagCreateBulk) Exec ¶
func (tcb *TagCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TagCreateBulk) ExecX ¶
func (tcb *TagCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TagDelete ¶
type TagDelete struct {
// contains filtered or unexported fields
}
TagDelete is the builder for deleting a Tag entity.
func (*TagDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type TagDeleteOne ¶
type TagDeleteOne struct {
// contains filtered or unexported fields
}
TagDeleteOne is the builder for deleting a single Tag entity.
func (*TagDeleteOne) Exec ¶
func (tdo *TagDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TagDeleteOne) ExecX ¶
func (tdo *TagDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagDeleteOne) Where ¶
func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne
Where appends a list predicates to the TagDelete builder.
type TagEdges ¶
type TagEdges struct { // Banners holds the value of the banners edge. Banners []*Banner `json:"banners,omitempty"` // contains filtered or unexported fields }
TagEdges holds the relations/edges for other nodes in the graph.
func (TagEdges) BannersOrErr ¶
BannersOrErr returns the Banners value or an error if the edge was not loaded in eager-loading.
type TagGroupBy ¶
type TagGroupBy struct {
// contains filtered or unexported fields
}
TagGroupBy is the group-by builder for Tag entities.
func (*TagGroupBy) Aggregate ¶
func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TagGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Scan ¶
func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TagGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TagMutation ¶
type TagMutation struct {
// contains filtered or unexported fields
}
TagMutation represents an operation that mutates the Tag nodes in the graph.
func (*TagMutation) AddBannerIDs ¶
func (m *TagMutation) AddBannerIDs(ids ...int)
AddBannerIDs adds the "banners" edge to the Banner entity by ids.
func (*TagMutation) AddField ¶
func (m *TagMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*TagMutation) 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) BannersCleared ¶
func (m *TagMutation) BannersCleared() bool
BannersCleared reports if the "banners" edge to the Banner entity was cleared.
func (*TagMutation) BannersIDs ¶
func (m *TagMutation) BannersIDs() (ids []int)
BannersIDs returns the "banners" edge IDs in the mutation.
func (*TagMutation) ClearBanners ¶
func (m *TagMutation) ClearBanners()
ClearBanners clears the "banners" edge to the Banner entity.
func (*TagMutation) ClearEdge ¶
func (m *TagMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*TagMutation) ClearField ¶
func (m *TagMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*TagMutation) ClearedEdges ¶
func (m *TagMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TagMutation) ClearedFields ¶
func (m *TagMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TagMutation) Client ¶
func (m TagMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*TagMutation) CreatedAt ¶
func (m *TagMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*TagMutation) EdgeCleared ¶
func (m *TagMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TagMutation) Field ¶
func (m *TagMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*TagMutation) FieldCleared ¶
func (m *TagMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TagMutation) Fields ¶
func (m *TagMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*TagMutation) ID ¶
func (m *TagMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*TagMutation) IDs ¶
func (m *TagMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*TagMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*TagMutation) OldTagName ¶
func (m *TagMutation) OldTagName(ctx context.Context) (v string, err error)
OldTagName returns the old "tag_name" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) RemoveBannerIDs ¶
func (m *TagMutation) RemoveBannerIDs(ids ...int)
RemoveBannerIDs removes the "banners" edge to the Banner entity by IDs.
func (*TagMutation) RemovedBannersIDs ¶
func (m *TagMutation) RemovedBannersIDs() (ids []int)
RemovedBanners returns the removed IDs of the "banners" edge to the Banner entity.
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) ResetBanners ¶
func (m *TagMutation) ResetBanners()
ResetBanners resets all changes to the "banners" edge.
func (*TagMutation) ResetCreatedAt ¶
func (m *TagMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*TagMutation) ResetEdge ¶
func (m *TagMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*TagMutation) ResetField ¶
func (m *TagMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*TagMutation) ResetTagName ¶
func (m *TagMutation) ResetTagName()
ResetTagName resets all changes to the "tag_name" field.
func (*TagMutation) ResetUpdatedAt ¶
func (m *TagMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*TagMutation) SetCreatedAt ¶
func (m *TagMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*TagMutation) SetField ¶
func (m *TagMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*TagMutation) SetOp ¶
func (m *TagMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TagMutation) SetTagName ¶
func (m *TagMutation) SetTagName(s string)
SetTagName sets the "tag_name" field.
func (*TagMutation) SetUpdatedAt ¶
func (m *TagMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*TagMutation) TagName ¶
func (m *TagMutation) TagName() (r string, exists bool)
TagName returns the value of the "tag_name" field in the mutation.
func (TagMutation) Tx ¶
func (m TagMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TagMutation) Type ¶
func (m *TagMutation) Type() string
Type returns the node type of this mutation (Tag).
func (*TagMutation) UpdatedAt ¶
func (m *TagMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*TagMutation) Where ¶
func (m *TagMutation) Where(ps ...predicate.Tag)
Where appends a list predicates to the TagMutation builder.
func (*TagMutation) WhereP ¶
func (m *TagMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TagQuery ¶
type TagQuery struct {
// contains filtered or unexported fields
}
TagQuery is the builder for querying Tag entities.
func (*TagQuery) Aggregate ¶
func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect
Aggregate returns a TagSelect configured with the given aggregations.
func (*TagQuery) Clone ¶
Clone returns a duplicate of the TagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TagQuery) First ¶
First returns the first Tag entity from the query. Returns a *NotFoundError when no Tag was found.
func (*TagQuery) FirstID ¶
FirstID returns the first Tag ID from the query. Returns a *NotFoundError when no Tag ID was found.
func (*TagQuery) GroupBy ¶
func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { TagName string `json:"tag_name,omitempty"` Count int `json:"count,omitempty"` } client.Tag.Query(). GroupBy(tag.FieldTagName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TagQuery) Only ¶
Only returns a single Tag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tag entity is found. Returns a *NotFoundError when no Tag entities are found.
func (*TagQuery) OnlyID ¶
OnlyID is like Only, but returns the only Tag ID in the query. Returns a *NotSingularError when more than one Tag ID is found. Returns a *NotFoundError when no entities are found.
func (*TagQuery) Order ¶
func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery
Order specifies how the records should be ordered.
func (*TagQuery) QueryBanners ¶
func (tq *TagQuery) QueryBanners() *BannerQuery
QueryBanners chains the current query on the "banners" edge.
func (*TagQuery) Select ¶
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { TagName string `json:"tag_name,omitempty"` } client.Tag.Query(). Select(tag.FieldTagName). Scan(ctx, &v)
func (*TagQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*TagQuery) WithBanners ¶
func (tq *TagQuery) WithBanners(opts ...func(*BannerQuery)) *TagQuery
WithBanners tells the query-builder to eager-load the nodes that are connected to the "banners" edge. The optional arguments are used to configure the query builder of the edge.
type TagSelect ¶
type TagSelect struct { *TagQuery // contains filtered or unexported fields }
TagSelect is the builder for selecting fields of Tag entities.
func (*TagSelect) Aggregate ¶
func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TagSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TagSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TagSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TagSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TagSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TagSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TagSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TagUpdate ¶
type TagUpdate struct {
// contains filtered or unexported fields
}
TagUpdate is the builder for updating Tag entities.
func (*TagUpdate) AddBannerIDs ¶
AddBannerIDs adds the "banners" edge to the Banner entity by IDs.
func (*TagUpdate) AddBanners ¶
AddBanners adds the "banners" edges to the Banner entity.
func (*TagUpdate) ClearBanners ¶
ClearBanners clears all "banners" edges to the Banner entity.
func (*TagUpdate) Mutation ¶
func (tu *TagUpdate) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagUpdate) RemoveBannerIDs ¶
RemoveBannerIDs removes the "banners" edge to Banner entities by IDs.
func (*TagUpdate) RemoveBanners ¶
RemoveBanners removes "banners" edges to Banner entities.
func (*TagUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*TagUpdate) SetNillableTagName ¶
SetNillableTagName sets the "tag_name" field if the given value is not nil.
func (*TagUpdate) SetNillableUpdatedAt ¶
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*TagUpdate) SetTagName ¶
SetTagName sets the "tag_name" field.
func (*TagUpdate) SetUpdatedAt ¶
SetUpdatedAt sets the "updated_at" field.
type TagUpdateOne ¶
type TagUpdateOne struct {
// contains filtered or unexported fields
}
TagUpdateOne is the builder for updating a single Tag entity.
func (*TagUpdateOne) AddBannerIDs ¶
func (tuo *TagUpdateOne) AddBannerIDs(ids ...int) *TagUpdateOne
AddBannerIDs adds the "banners" edge to the Banner entity by IDs.
func (*TagUpdateOne) AddBanners ¶
func (tuo *TagUpdateOne) AddBanners(b ...*Banner) *TagUpdateOne
AddBanners adds the "banners" edges to the Banner entity.
func (*TagUpdateOne) ClearBanners ¶
func (tuo *TagUpdateOne) ClearBanners() *TagUpdateOne
ClearBanners clears all "banners" edges to the Banner entity.
func (*TagUpdateOne) Exec ¶
func (tuo *TagUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TagUpdateOne) ExecX ¶
func (tuo *TagUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagUpdateOne) Mutation ¶
func (tuo *TagUpdateOne) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagUpdateOne) RemoveBannerIDs ¶
func (tuo *TagUpdateOne) RemoveBannerIDs(ids ...int) *TagUpdateOne
RemoveBannerIDs removes the "banners" edge to Banner entities by IDs.
func (*TagUpdateOne) RemoveBanners ¶
func (tuo *TagUpdateOne) RemoveBanners(b ...*Banner) *TagUpdateOne
RemoveBanners removes "banners" edges to Banner entities.
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) SetNillableTagName ¶
func (tuo *TagUpdateOne) SetNillableTagName(s *string) *TagUpdateOne
SetNillableTagName sets the "tag_name" field if the given value is not nil.
func (*TagUpdateOne) SetNillableUpdatedAt ¶
func (tuo *TagUpdateOne) SetNillableUpdatedAt(t *time.Time) *TagUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*TagUpdateOne) SetTagName ¶
func (tuo *TagUpdateOne) SetTagName(s string) *TagUpdateOne
SetTagName sets the "tag_name" field.
func (*TagUpdateOne) SetUpdatedAt ¶
func (tuo *TagUpdateOne) SetUpdatedAt(t time.Time) *TagUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*TagUpdateOne) Where ¶
func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne
Where appends a list predicates to the TagUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Banner is the client for interacting with the Banner builders. Banner *BannerClient // Feature is the client for interacting with the Feature builders. Feature *FeatureClient // 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.