Documentation ¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Article
- type ArticleClient
- func (c *ArticleClient) Create() *ArticleCreate
- func (c *ArticleClient) CreateBulk(builders ...*ArticleCreate) *ArticleCreateBulk
- func (c *ArticleClient) Delete() *ArticleDelete
- func (c *ArticleClient) DeleteOne(a *Article) *ArticleDeleteOne
- func (c *ArticleClient) DeleteOneID(id uuid.UUID) *ArticleDeleteOne
- func (c *ArticleClient) Get(ctx context.Context, id uuid.UUID) (*Article, error)
- func (c *ArticleClient) GetX(ctx context.Context, id uuid.UUID) *Article
- func (c *ArticleClient) Hooks() []Hook
- func (c *ArticleClient) Intercept(interceptors ...Interceptor)
- func (c *ArticleClient) Interceptors() []Interceptor
- func (c *ArticleClient) Query() *ArticleQuery
- func (c *ArticleClient) QueryReadArticles(a *Article) *ReadArticleQuery
- func (c *ArticleClient) QueryTags(a *Article) *ArticleTagQuery
- func (c *ArticleClient) Update() *ArticleUpdate
- func (c *ArticleClient) UpdateOne(a *Article) *ArticleUpdateOne
- func (c *ArticleClient) UpdateOneID(id uuid.UUID) *ArticleUpdateOne
- func (c *ArticleClient) Use(hooks ...Hook)
- type ArticleCreate
- func (ac *ArticleCreate) AddReadArticleIDs(ids ...uuid.UUID) *ArticleCreate
- func (ac *ArticleCreate) AddReadArticles(r ...*ReadArticle) *ArticleCreate
- func (ac *ArticleCreate) AddTagIDs(ids ...uuid.UUID) *ArticleCreate
- func (ac *ArticleCreate) AddTags(a ...*ArticleTag) *ArticleCreate
- func (ac *ArticleCreate) Exec(ctx context.Context) error
- func (ac *ArticleCreate) ExecX(ctx context.Context)
- func (ac *ArticleCreate) Mutation() *ArticleMutation
- func (ac *ArticleCreate) OnConflict(opts ...sql.ConflictOption) *ArticleUpsertOne
- func (ac *ArticleCreate) OnConflictColumns(columns ...string) *ArticleUpsertOne
- func (ac *ArticleCreate) Save(ctx context.Context) (*Article, error)
- func (ac *ArticleCreate) SaveX(ctx context.Context) *Article
- func (ac *ArticleCreate) SetCreatedAt(t time.Time) *ArticleCreate
- func (ac *ArticleCreate) SetDeletedAt(t time.Time) *ArticleCreate
- func (ac *ArticleCreate) SetDescription(s string) *ArticleCreate
- func (ac *ArticleCreate) SetID(u uuid.UUID) *ArticleCreate
- func (ac *ArticleCreate) SetNillableCreatedAt(t *time.Time) *ArticleCreate
- func (ac *ArticleCreate) SetNillableDeletedAt(t *time.Time) *ArticleCreate
- func (ac *ArticleCreate) SetNillableID(u *uuid.UUID) *ArticleCreate
- func (ac *ArticleCreate) SetNillableUpdatedAt(t *time.Time) *ArticleCreate
- func (ac *ArticleCreate) SetThumbnail(s string) *ArticleCreate
- func (ac *ArticleCreate) SetTitle(s string) *ArticleCreate
- func (ac *ArticleCreate) SetURL(s string) *ArticleCreate
- func (ac *ArticleCreate) SetUpdatedAt(t time.Time) *ArticleCreate
- type ArticleCreateBulk
- func (acb *ArticleCreateBulk) Exec(ctx context.Context) error
- func (acb *ArticleCreateBulk) ExecX(ctx context.Context)
- func (acb *ArticleCreateBulk) OnConflict(opts ...sql.ConflictOption) *ArticleUpsertBulk
- func (acb *ArticleCreateBulk) OnConflictColumns(columns ...string) *ArticleUpsertBulk
- func (acb *ArticleCreateBulk) Save(ctx context.Context) ([]*Article, error)
- func (acb *ArticleCreateBulk) SaveX(ctx context.Context) []*Article
- type ArticleDelete
- type ArticleDeleteOne
- type ArticleEdges
- type ArticleGroupBy
- func (agb *ArticleGroupBy) Aggregate(fns ...AggregateFunc) *ArticleGroupBy
- func (s *ArticleGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ArticleGroupBy) BoolX(ctx context.Context) bool
- func (s *ArticleGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ArticleGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ArticleGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ArticleGroupBy) Float64X(ctx context.Context) float64
- func (s *ArticleGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ArticleGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ArticleGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ArticleGroupBy) IntX(ctx context.Context) int
- func (s *ArticleGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ArticleGroupBy) IntsX(ctx context.Context) []int
- func (agb *ArticleGroupBy) Scan(ctx context.Context, v any) error
- func (s *ArticleGroupBy) ScanX(ctx context.Context, v any)
- func (s *ArticleGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ArticleGroupBy) StringX(ctx context.Context) string
- func (s *ArticleGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ArticleGroupBy) StringsX(ctx context.Context) []string
- type ArticleMutation
- func (m *ArticleMutation) AddField(name string, value ent.Value) error
- func (m *ArticleMutation) AddReadArticleIDs(ids ...uuid.UUID)
- func (m *ArticleMutation) AddTagIDs(ids ...uuid.UUID)
- func (m *ArticleMutation) AddedEdges() []string
- func (m *ArticleMutation) AddedField(name string) (ent.Value, bool)
- func (m *ArticleMutation) AddedFields() []string
- func (m *ArticleMutation) AddedIDs(name string) []ent.Value
- func (m *ArticleMutation) ClearDeletedAt()
- func (m *ArticleMutation) ClearEdge(name string) error
- func (m *ArticleMutation) ClearField(name string) error
- func (m *ArticleMutation) ClearReadArticles()
- func (m *ArticleMutation) ClearTags()
- func (m *ArticleMutation) ClearedEdges() []string
- func (m *ArticleMutation) ClearedFields() []string
- func (m ArticleMutation) Client() *Client
- func (m *ArticleMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ArticleMutation) DeletedAt() (r time.Time, exists bool)
- func (m *ArticleMutation) DeletedAtCleared() bool
- func (m *ArticleMutation) Description() (r string, exists bool)
- func (m *ArticleMutation) EdgeCleared(name string) bool
- func (m *ArticleMutation) Field(name string) (ent.Value, bool)
- func (m *ArticleMutation) FieldCleared(name string) bool
- func (m *ArticleMutation) Fields() []string
- func (m *ArticleMutation) ID() (id uuid.UUID, exists bool)
- func (m *ArticleMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *ArticleMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ArticleMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)
- func (m *ArticleMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *ArticleMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ArticleMutation) OldThumbnail(ctx context.Context) (v string, err error)
- func (m *ArticleMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *ArticleMutation) OldURL(ctx context.Context) (v string, err error)
- func (m *ArticleMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ArticleMutation) Op() Op
- func (m *ArticleMutation) ReadArticlesCleared() bool
- func (m *ArticleMutation) ReadArticlesIDs() (ids []uuid.UUID)
- func (m *ArticleMutation) RemoveReadArticleIDs(ids ...uuid.UUID)
- func (m *ArticleMutation) RemoveTagIDs(ids ...uuid.UUID)
- func (m *ArticleMutation) RemovedEdges() []string
- func (m *ArticleMutation) RemovedIDs(name string) []ent.Value
- func (m *ArticleMutation) RemovedReadArticlesIDs() (ids []uuid.UUID)
- func (m *ArticleMutation) RemovedTagsIDs() (ids []uuid.UUID)
- func (m *ArticleMutation) ResetCreatedAt()
- func (m *ArticleMutation) ResetDeletedAt()
- func (m *ArticleMutation) ResetDescription()
- func (m *ArticleMutation) ResetEdge(name string) error
- func (m *ArticleMutation) ResetField(name string) error
- func (m *ArticleMutation) ResetReadArticles()
- func (m *ArticleMutation) ResetTags()
- func (m *ArticleMutation) ResetThumbnail()
- func (m *ArticleMutation) ResetTitle()
- func (m *ArticleMutation) ResetURL()
- func (m *ArticleMutation) ResetUpdatedAt()
- func (m *ArticleMutation) SetCreatedAt(t time.Time)
- func (m *ArticleMutation) SetDeletedAt(t time.Time)
- func (m *ArticleMutation) SetDescription(s string)
- func (m *ArticleMutation) SetField(name string, value ent.Value) error
- func (m *ArticleMutation) SetID(id uuid.UUID)
- func (m *ArticleMutation) SetOp(op Op)
- func (m *ArticleMutation) SetThumbnail(s string)
- func (m *ArticleMutation) SetTitle(s string)
- func (m *ArticleMutation) SetURL(s string)
- func (m *ArticleMutation) SetUpdatedAt(t time.Time)
- func (m *ArticleMutation) TagsCleared() bool
- func (m *ArticleMutation) TagsIDs() (ids []uuid.UUID)
- func (m *ArticleMutation) Thumbnail() (r string, exists bool)
- func (m *ArticleMutation) Title() (r string, exists bool)
- func (m ArticleMutation) Tx() (*Tx, error)
- func (m *ArticleMutation) Type() string
- func (m *ArticleMutation) URL() (r string, exists bool)
- func (m *ArticleMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *ArticleMutation) Where(ps ...predicate.Article)
- func (m *ArticleMutation) WhereP(ps ...func(*sql.Selector))
- type ArticleQuery
- func (aq *ArticleQuery) Aggregate(fns ...AggregateFunc) *ArticleSelect
- func (aq *ArticleQuery) All(ctx context.Context) ([]*Article, error)
- func (aq *ArticleQuery) AllX(ctx context.Context) []*Article
- func (aq *ArticleQuery) Clone() *ArticleQuery
- func (aq *ArticleQuery) Count(ctx context.Context) (int, error)
- func (aq *ArticleQuery) CountX(ctx context.Context) int
- func (aq *ArticleQuery) Exist(ctx context.Context) (bool, error)
- func (aq *ArticleQuery) ExistX(ctx context.Context) bool
- func (aq *ArticleQuery) First(ctx context.Context) (*Article, error)
- func (aq *ArticleQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (aq *ArticleQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (aq *ArticleQuery) FirstX(ctx context.Context) *Article
- func (aq *ArticleQuery) GroupBy(field string, fields ...string) *ArticleGroupBy
- func (aq *ArticleQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (aq *ArticleQuery) IDsX(ctx context.Context) []uuid.UUID
- func (aq *ArticleQuery) Limit(limit int) *ArticleQuery
- func (aq *ArticleQuery) Offset(offset int) *ArticleQuery
- func (aq *ArticleQuery) Only(ctx context.Context) (*Article, error)
- func (aq *ArticleQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (aq *ArticleQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (aq *ArticleQuery) OnlyX(ctx context.Context) *Article
- func (aq *ArticleQuery) Order(o ...OrderFunc) *ArticleQuery
- func (aq *ArticleQuery) QueryReadArticles() *ReadArticleQuery
- func (aq *ArticleQuery) QueryTags() *ArticleTagQuery
- func (aq *ArticleQuery) Select(fields ...string) *ArticleSelect
- func (aq *ArticleQuery) Unique(unique bool) *ArticleQuery
- func (aq *ArticleQuery) Where(ps ...predicate.Article) *ArticleQuery
- func (aq *ArticleQuery) WithReadArticles(opts ...func(*ReadArticleQuery)) *ArticleQuery
- func (aq *ArticleQuery) WithTags(opts ...func(*ArticleTagQuery)) *ArticleQuery
- type ArticleSelect
- func (as *ArticleSelect) Aggregate(fns ...AggregateFunc) *ArticleSelect
- func (s *ArticleSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ArticleSelect) BoolX(ctx context.Context) bool
- func (s *ArticleSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ArticleSelect) BoolsX(ctx context.Context) []bool
- func (s *ArticleSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ArticleSelect) Float64X(ctx context.Context) float64
- func (s *ArticleSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ArticleSelect) Float64sX(ctx context.Context) []float64
- func (s *ArticleSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ArticleSelect) IntX(ctx context.Context) int
- func (s *ArticleSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ArticleSelect) IntsX(ctx context.Context) []int
- func (as *ArticleSelect) Scan(ctx context.Context, v any) error
- func (s *ArticleSelect) ScanX(ctx context.Context, v any)
- func (s *ArticleSelect) String(ctx context.Context) (_ string, err error)
- func (s *ArticleSelect) StringX(ctx context.Context) string
- func (s *ArticleSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ArticleSelect) StringsX(ctx context.Context) []string
- type ArticleTag
- type ArticleTagClient
- func (c *ArticleTagClient) Create() *ArticleTagCreate
- func (c *ArticleTagClient) CreateBulk(builders ...*ArticleTagCreate) *ArticleTagCreateBulk
- func (c *ArticleTagClient) Delete() *ArticleTagDelete
- func (c *ArticleTagClient) DeleteOne(at *ArticleTag) *ArticleTagDeleteOne
- func (c *ArticleTagClient) DeleteOneID(id uuid.UUID) *ArticleTagDeleteOne
- func (c *ArticleTagClient) Get(ctx context.Context, id uuid.UUID) (*ArticleTag, error)
- func (c *ArticleTagClient) GetX(ctx context.Context, id uuid.UUID) *ArticleTag
- func (c *ArticleTagClient) Hooks() []Hook
- func (c *ArticleTagClient) Intercept(interceptors ...Interceptor)
- func (c *ArticleTagClient) Interceptors() []Interceptor
- func (c *ArticleTagClient) Query() *ArticleTagQuery
- func (c *ArticleTagClient) QueryArticle(at *ArticleTag) *ArticleQuery
- func (c *ArticleTagClient) Update() *ArticleTagUpdate
- func (c *ArticleTagClient) UpdateOne(at *ArticleTag) *ArticleTagUpdateOne
- func (c *ArticleTagClient) UpdateOneID(id uuid.UUID) *ArticleTagUpdateOne
- func (c *ArticleTagClient) Use(hooks ...Hook)
- type ArticleTagCreate
- func (atc *ArticleTagCreate) Exec(ctx context.Context) error
- func (atc *ArticleTagCreate) ExecX(ctx context.Context)
- func (atc *ArticleTagCreate) Mutation() *ArticleTagMutation
- func (atc *ArticleTagCreate) OnConflict(opts ...sql.ConflictOption) *ArticleTagUpsertOne
- func (atc *ArticleTagCreate) OnConflictColumns(columns ...string) *ArticleTagUpsertOne
- func (atc *ArticleTagCreate) Save(ctx context.Context) (*ArticleTag, error)
- func (atc *ArticleTagCreate) SaveX(ctx context.Context) *ArticleTag
- func (atc *ArticleTagCreate) SetArticle(a *Article) *ArticleTagCreate
- func (atc *ArticleTagCreate) SetArticleID(u uuid.UUID) *ArticleTagCreate
- func (atc *ArticleTagCreate) SetCreatedAt(t time.Time) *ArticleTagCreate
- func (atc *ArticleTagCreate) SetID(u uuid.UUID) *ArticleTagCreate
- func (atc *ArticleTagCreate) SetNillableCreatedAt(t *time.Time) *ArticleTagCreate
- func (atc *ArticleTagCreate) SetNillableID(u *uuid.UUID) *ArticleTagCreate
- func (atc *ArticleTagCreate) SetNillableUpdatedAt(t *time.Time) *ArticleTagCreate
- func (atc *ArticleTagCreate) SetTag(s string) *ArticleTagCreate
- func (atc *ArticleTagCreate) SetUpdatedAt(t time.Time) *ArticleTagCreate
- type ArticleTagCreateBulk
- func (atcb *ArticleTagCreateBulk) Exec(ctx context.Context) error
- func (atcb *ArticleTagCreateBulk) ExecX(ctx context.Context)
- func (atcb *ArticleTagCreateBulk) OnConflict(opts ...sql.ConflictOption) *ArticleTagUpsertBulk
- func (atcb *ArticleTagCreateBulk) OnConflictColumns(columns ...string) *ArticleTagUpsertBulk
- func (atcb *ArticleTagCreateBulk) Save(ctx context.Context) ([]*ArticleTag, error)
- func (atcb *ArticleTagCreateBulk) SaveX(ctx context.Context) []*ArticleTag
- type ArticleTagDelete
- type ArticleTagDeleteOne
- type ArticleTagEdges
- type ArticleTagGroupBy
- func (atgb *ArticleTagGroupBy) Aggregate(fns ...AggregateFunc) *ArticleTagGroupBy
- func (s *ArticleTagGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ArticleTagGroupBy) BoolX(ctx context.Context) bool
- func (s *ArticleTagGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ArticleTagGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ArticleTagGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ArticleTagGroupBy) Float64X(ctx context.Context) float64
- func (s *ArticleTagGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ArticleTagGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ArticleTagGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ArticleTagGroupBy) IntX(ctx context.Context) int
- func (s *ArticleTagGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ArticleTagGroupBy) IntsX(ctx context.Context) []int
- func (atgb *ArticleTagGroupBy) Scan(ctx context.Context, v any) error
- func (s *ArticleTagGroupBy) ScanX(ctx context.Context, v any)
- func (s *ArticleTagGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ArticleTagGroupBy) StringX(ctx context.Context) string
- func (s *ArticleTagGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ArticleTagGroupBy) StringsX(ctx context.Context) []string
- type ArticleTagMutation
- func (m *ArticleTagMutation) AddField(name string, value ent.Value) error
- func (m *ArticleTagMutation) AddedEdges() []string
- func (m *ArticleTagMutation) AddedField(name string) (ent.Value, bool)
- func (m *ArticleTagMutation) AddedFields() []string
- func (m *ArticleTagMutation) AddedIDs(name string) []ent.Value
- func (m *ArticleTagMutation) ArticleCleared() bool
- func (m *ArticleTagMutation) ArticleID() (r uuid.UUID, exists bool)
- func (m *ArticleTagMutation) ArticleIDs() (ids []uuid.UUID)
- func (m *ArticleTagMutation) ClearArticle()
- func (m *ArticleTagMutation) ClearEdge(name string) error
- func (m *ArticleTagMutation) ClearField(name string) error
- func (m *ArticleTagMutation) ClearedEdges() []string
- func (m *ArticleTagMutation) ClearedFields() []string
- func (m ArticleTagMutation) Client() *Client
- func (m *ArticleTagMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ArticleTagMutation) EdgeCleared(name string) bool
- func (m *ArticleTagMutation) Field(name string) (ent.Value, bool)
- func (m *ArticleTagMutation) FieldCleared(name string) bool
- func (m *ArticleTagMutation) Fields() []string
- func (m *ArticleTagMutation) ID() (id uuid.UUID, exists bool)
- func (m *ArticleTagMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *ArticleTagMutation) OldArticleID(ctx context.Context) (v uuid.UUID, err error)
- func (m *ArticleTagMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ArticleTagMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ArticleTagMutation) OldTag(ctx context.Context) (v string, err error)
- func (m *ArticleTagMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ArticleTagMutation) Op() Op
- func (m *ArticleTagMutation) RemovedEdges() []string
- func (m *ArticleTagMutation) RemovedIDs(name string) []ent.Value
- func (m *ArticleTagMutation) ResetArticle()
- func (m *ArticleTagMutation) ResetArticleID()
- func (m *ArticleTagMutation) ResetCreatedAt()
- func (m *ArticleTagMutation) ResetEdge(name string) error
- func (m *ArticleTagMutation) ResetField(name string) error
- func (m *ArticleTagMutation) ResetTag()
- func (m *ArticleTagMutation) ResetUpdatedAt()
- func (m *ArticleTagMutation) SetArticleID(u uuid.UUID)
- func (m *ArticleTagMutation) SetCreatedAt(t time.Time)
- func (m *ArticleTagMutation) SetField(name string, value ent.Value) error
- func (m *ArticleTagMutation) SetID(id uuid.UUID)
- func (m *ArticleTagMutation) SetOp(op Op)
- func (m *ArticleTagMutation) SetTag(s string)
- func (m *ArticleTagMutation) SetUpdatedAt(t time.Time)
- func (m *ArticleTagMutation) Tag() (r string, exists bool)
- func (m ArticleTagMutation) Tx() (*Tx, error)
- func (m *ArticleTagMutation) Type() string
- func (m *ArticleTagMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *ArticleTagMutation) Where(ps ...predicate.ArticleTag)
- func (m *ArticleTagMutation) WhereP(ps ...func(*sql.Selector))
- type ArticleTagQuery
- func (atq *ArticleTagQuery) Aggregate(fns ...AggregateFunc) *ArticleTagSelect
- func (atq *ArticleTagQuery) All(ctx context.Context) ([]*ArticleTag, error)
- func (atq *ArticleTagQuery) AllX(ctx context.Context) []*ArticleTag
- func (atq *ArticleTagQuery) Clone() *ArticleTagQuery
- func (atq *ArticleTagQuery) Count(ctx context.Context) (int, error)
- func (atq *ArticleTagQuery) CountX(ctx context.Context) int
- func (atq *ArticleTagQuery) Exist(ctx context.Context) (bool, error)
- func (atq *ArticleTagQuery) ExistX(ctx context.Context) bool
- func (atq *ArticleTagQuery) First(ctx context.Context) (*ArticleTag, error)
- func (atq *ArticleTagQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (atq *ArticleTagQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (atq *ArticleTagQuery) FirstX(ctx context.Context) *ArticleTag
- func (atq *ArticleTagQuery) GroupBy(field string, fields ...string) *ArticleTagGroupBy
- func (atq *ArticleTagQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (atq *ArticleTagQuery) IDsX(ctx context.Context) []uuid.UUID
- func (atq *ArticleTagQuery) Limit(limit int) *ArticleTagQuery
- func (atq *ArticleTagQuery) Offset(offset int) *ArticleTagQuery
- func (atq *ArticleTagQuery) Only(ctx context.Context) (*ArticleTag, error)
- func (atq *ArticleTagQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (atq *ArticleTagQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (atq *ArticleTagQuery) OnlyX(ctx context.Context) *ArticleTag
- func (atq *ArticleTagQuery) Order(o ...OrderFunc) *ArticleTagQuery
- func (atq *ArticleTagQuery) QueryArticle() *ArticleQuery
- func (atq *ArticleTagQuery) Select(fields ...string) *ArticleTagSelect
- func (atq *ArticleTagQuery) Unique(unique bool) *ArticleTagQuery
- func (atq *ArticleTagQuery) Where(ps ...predicate.ArticleTag) *ArticleTagQuery
- func (atq *ArticleTagQuery) WithArticle(opts ...func(*ArticleQuery)) *ArticleTagQuery
- type ArticleTagSelect
- func (ats *ArticleTagSelect) Aggregate(fns ...AggregateFunc) *ArticleTagSelect
- func (s *ArticleTagSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ArticleTagSelect) BoolX(ctx context.Context) bool
- func (s *ArticleTagSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ArticleTagSelect) BoolsX(ctx context.Context) []bool
- func (s *ArticleTagSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ArticleTagSelect) Float64X(ctx context.Context) float64
- func (s *ArticleTagSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ArticleTagSelect) Float64sX(ctx context.Context) []float64
- func (s *ArticleTagSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ArticleTagSelect) IntX(ctx context.Context) int
- func (s *ArticleTagSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ArticleTagSelect) IntsX(ctx context.Context) []int
- func (ats *ArticleTagSelect) Scan(ctx context.Context, v any) error
- func (s *ArticleTagSelect) ScanX(ctx context.Context, v any)
- func (s *ArticleTagSelect) String(ctx context.Context) (_ string, err error)
- func (s *ArticleTagSelect) StringX(ctx context.Context) string
- func (s *ArticleTagSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ArticleTagSelect) StringsX(ctx context.Context) []string
- type ArticleTagUpdate
- func (atu *ArticleTagUpdate) ClearArticle() *ArticleTagUpdate
- func (atu *ArticleTagUpdate) Exec(ctx context.Context) error
- func (atu *ArticleTagUpdate) ExecX(ctx context.Context)
- func (atu *ArticleTagUpdate) Mutation() *ArticleTagMutation
- func (atu *ArticleTagUpdate) Save(ctx context.Context) (int, error)
- func (atu *ArticleTagUpdate) SaveX(ctx context.Context) int
- func (atu *ArticleTagUpdate) SetArticle(a *Article) *ArticleTagUpdate
- func (atu *ArticleTagUpdate) SetArticleID(u uuid.UUID) *ArticleTagUpdate
- func (atu *ArticleTagUpdate) SetCreatedAt(t time.Time) *ArticleTagUpdate
- func (atu *ArticleTagUpdate) SetNillableCreatedAt(t *time.Time) *ArticleTagUpdate
- func (atu *ArticleTagUpdate) SetTag(s string) *ArticleTagUpdate
- func (atu *ArticleTagUpdate) SetUpdatedAt(t time.Time) *ArticleTagUpdate
- func (atu *ArticleTagUpdate) Where(ps ...predicate.ArticleTag) *ArticleTagUpdate
- type ArticleTagUpdateOne
- func (atuo *ArticleTagUpdateOne) ClearArticle() *ArticleTagUpdateOne
- func (atuo *ArticleTagUpdateOne) Exec(ctx context.Context) error
- func (atuo *ArticleTagUpdateOne) ExecX(ctx context.Context)
- func (atuo *ArticleTagUpdateOne) Mutation() *ArticleTagMutation
- func (atuo *ArticleTagUpdateOne) Save(ctx context.Context) (*ArticleTag, error)
- func (atuo *ArticleTagUpdateOne) SaveX(ctx context.Context) *ArticleTag
- func (atuo *ArticleTagUpdateOne) Select(field string, fields ...string) *ArticleTagUpdateOne
- func (atuo *ArticleTagUpdateOne) SetArticle(a *Article) *ArticleTagUpdateOne
- func (atuo *ArticleTagUpdateOne) SetArticleID(u uuid.UUID) *ArticleTagUpdateOne
- func (atuo *ArticleTagUpdateOne) SetCreatedAt(t time.Time) *ArticleTagUpdateOne
- func (atuo *ArticleTagUpdateOne) SetNillableCreatedAt(t *time.Time) *ArticleTagUpdateOne
- func (atuo *ArticleTagUpdateOne) SetTag(s string) *ArticleTagUpdateOne
- func (atuo *ArticleTagUpdateOne) SetUpdatedAt(t time.Time) *ArticleTagUpdateOne
- func (atuo *ArticleTagUpdateOne) Where(ps ...predicate.ArticleTag) *ArticleTagUpdateOne
- type ArticleTagUpsert
- func (u *ArticleTagUpsert) SetArticleID(v uuid.UUID) *ArticleTagUpsert
- func (u *ArticleTagUpsert) SetCreatedAt(v time.Time) *ArticleTagUpsert
- func (u *ArticleTagUpsert) SetTag(v string) *ArticleTagUpsert
- func (u *ArticleTagUpsert) SetUpdatedAt(v time.Time) *ArticleTagUpsert
- func (u *ArticleTagUpsert) UpdateArticleID() *ArticleTagUpsert
- func (u *ArticleTagUpsert) UpdateCreatedAt() *ArticleTagUpsert
- func (u *ArticleTagUpsert) UpdateTag() *ArticleTagUpsert
- func (u *ArticleTagUpsert) UpdateUpdatedAt() *ArticleTagUpsert
- type ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) DoNothing() *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) Exec(ctx context.Context) error
- func (u *ArticleTagUpsertBulk) ExecX(ctx context.Context)
- func (u *ArticleTagUpsertBulk) Ignore() *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) SetArticleID(v uuid.UUID) *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) SetCreatedAt(v time.Time) *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) SetTag(v string) *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) SetUpdatedAt(v time.Time) *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) Update(set func(*ArticleTagUpsert)) *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) UpdateArticleID() *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) UpdateCreatedAt() *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) UpdateNewValues() *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) UpdateTag() *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) UpdateUpdatedAt() *ArticleTagUpsertBulk
- type ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) DoNothing() *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) Exec(ctx context.Context) error
- func (u *ArticleTagUpsertOne) ExecX(ctx context.Context)
- func (u *ArticleTagUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *ArticleTagUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *ArticleTagUpsertOne) Ignore() *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) SetArticleID(v uuid.UUID) *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) SetCreatedAt(v time.Time) *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) SetTag(v string) *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) SetUpdatedAt(v time.Time) *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) Update(set func(*ArticleTagUpsert)) *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) UpdateArticleID() *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) UpdateCreatedAt() *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) UpdateNewValues() *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) UpdateTag() *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) UpdateUpdatedAt() *ArticleTagUpsertOne
- type ArticleTags
- type ArticleUpdate
- func (au *ArticleUpdate) AddReadArticleIDs(ids ...uuid.UUID) *ArticleUpdate
- func (au *ArticleUpdate) AddReadArticles(r ...*ReadArticle) *ArticleUpdate
- func (au *ArticleUpdate) AddTagIDs(ids ...uuid.UUID) *ArticleUpdate
- func (au *ArticleUpdate) AddTags(a ...*ArticleTag) *ArticleUpdate
- func (au *ArticleUpdate) ClearDeletedAt() *ArticleUpdate
- func (au *ArticleUpdate) ClearReadArticles() *ArticleUpdate
- func (au *ArticleUpdate) ClearTags() *ArticleUpdate
- func (au *ArticleUpdate) Exec(ctx context.Context) error
- func (au *ArticleUpdate) ExecX(ctx context.Context)
- func (au *ArticleUpdate) Mutation() *ArticleMutation
- func (au *ArticleUpdate) RemoveReadArticleIDs(ids ...uuid.UUID) *ArticleUpdate
- func (au *ArticleUpdate) RemoveReadArticles(r ...*ReadArticle) *ArticleUpdate
- func (au *ArticleUpdate) RemoveTagIDs(ids ...uuid.UUID) *ArticleUpdate
- func (au *ArticleUpdate) RemoveTags(a ...*ArticleTag) *ArticleUpdate
- func (au *ArticleUpdate) Save(ctx context.Context) (int, error)
- func (au *ArticleUpdate) SaveX(ctx context.Context) int
- func (au *ArticleUpdate) SetCreatedAt(t time.Time) *ArticleUpdate
- func (au *ArticleUpdate) SetDeletedAt(t time.Time) *ArticleUpdate
- func (au *ArticleUpdate) SetDescription(s string) *ArticleUpdate
- func (au *ArticleUpdate) SetNillableCreatedAt(t *time.Time) *ArticleUpdate
- func (au *ArticleUpdate) SetNillableDeletedAt(t *time.Time) *ArticleUpdate
- func (au *ArticleUpdate) SetThumbnail(s string) *ArticleUpdate
- func (au *ArticleUpdate) SetTitle(s string) *ArticleUpdate
- func (au *ArticleUpdate) SetURL(s string) *ArticleUpdate
- func (au *ArticleUpdate) SetUpdatedAt(t time.Time) *ArticleUpdate
- func (au *ArticleUpdate) Where(ps ...predicate.Article) *ArticleUpdate
- type ArticleUpdateOne
- func (auo *ArticleUpdateOne) AddReadArticleIDs(ids ...uuid.UUID) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) AddReadArticles(r ...*ReadArticle) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) AddTagIDs(ids ...uuid.UUID) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) AddTags(a ...*ArticleTag) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) ClearDeletedAt() *ArticleUpdateOne
- func (auo *ArticleUpdateOne) ClearReadArticles() *ArticleUpdateOne
- func (auo *ArticleUpdateOne) ClearTags() *ArticleUpdateOne
- func (auo *ArticleUpdateOne) Exec(ctx context.Context) error
- func (auo *ArticleUpdateOne) ExecX(ctx context.Context)
- func (auo *ArticleUpdateOne) Mutation() *ArticleMutation
- func (auo *ArticleUpdateOne) RemoveReadArticleIDs(ids ...uuid.UUID) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) RemoveReadArticles(r ...*ReadArticle) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) RemoveTagIDs(ids ...uuid.UUID) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) RemoveTags(a ...*ArticleTag) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) Save(ctx context.Context) (*Article, error)
- func (auo *ArticleUpdateOne) SaveX(ctx context.Context) *Article
- func (auo *ArticleUpdateOne) Select(field string, fields ...string) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetCreatedAt(t time.Time) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetDeletedAt(t time.Time) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetDescription(s string) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetNillableCreatedAt(t *time.Time) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetNillableDeletedAt(t *time.Time) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetThumbnail(s string) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetTitle(s string) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetURL(s string) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetUpdatedAt(t time.Time) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) Where(ps ...predicate.Article) *ArticleUpdateOne
- type ArticleUpsert
- func (u *ArticleUpsert) ClearDeletedAt() *ArticleUpsert
- func (u *ArticleUpsert) SetCreatedAt(v time.Time) *ArticleUpsert
- func (u *ArticleUpsert) SetDeletedAt(v time.Time) *ArticleUpsert
- func (u *ArticleUpsert) SetDescription(v string) *ArticleUpsert
- func (u *ArticleUpsert) SetThumbnail(v string) *ArticleUpsert
- func (u *ArticleUpsert) SetTitle(v string) *ArticleUpsert
- func (u *ArticleUpsert) SetURL(v string) *ArticleUpsert
- func (u *ArticleUpsert) SetUpdatedAt(v time.Time) *ArticleUpsert
- func (u *ArticleUpsert) UpdateCreatedAt() *ArticleUpsert
- func (u *ArticleUpsert) UpdateDeletedAt() *ArticleUpsert
- func (u *ArticleUpsert) UpdateDescription() *ArticleUpsert
- func (u *ArticleUpsert) UpdateThumbnail() *ArticleUpsert
- func (u *ArticleUpsert) UpdateTitle() *ArticleUpsert
- func (u *ArticleUpsert) UpdateURL() *ArticleUpsert
- func (u *ArticleUpsert) UpdateUpdatedAt() *ArticleUpsert
- type ArticleUpsertBulk
- func (u *ArticleUpsertBulk) ClearDeletedAt() *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) DoNothing() *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) Exec(ctx context.Context) error
- func (u *ArticleUpsertBulk) ExecX(ctx context.Context)
- func (u *ArticleUpsertBulk) Ignore() *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) SetCreatedAt(v time.Time) *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) SetDeletedAt(v time.Time) *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) SetDescription(v string) *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) SetThumbnail(v string) *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) SetTitle(v string) *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) SetURL(v string) *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) SetUpdatedAt(v time.Time) *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) Update(set func(*ArticleUpsert)) *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) UpdateCreatedAt() *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) UpdateDeletedAt() *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) UpdateDescription() *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) UpdateNewValues() *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) UpdateThumbnail() *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) UpdateTitle() *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) UpdateURL() *ArticleUpsertBulk
- func (u *ArticleUpsertBulk) UpdateUpdatedAt() *ArticleUpsertBulk
- type ArticleUpsertOne
- func (u *ArticleUpsertOne) ClearDeletedAt() *ArticleUpsertOne
- func (u *ArticleUpsertOne) DoNothing() *ArticleUpsertOne
- func (u *ArticleUpsertOne) Exec(ctx context.Context) error
- func (u *ArticleUpsertOne) ExecX(ctx context.Context)
- func (u *ArticleUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *ArticleUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *ArticleUpsertOne) Ignore() *ArticleUpsertOne
- func (u *ArticleUpsertOne) SetCreatedAt(v time.Time) *ArticleUpsertOne
- func (u *ArticleUpsertOne) SetDeletedAt(v time.Time) *ArticleUpsertOne
- func (u *ArticleUpsertOne) SetDescription(v string) *ArticleUpsertOne
- func (u *ArticleUpsertOne) SetThumbnail(v string) *ArticleUpsertOne
- func (u *ArticleUpsertOne) SetTitle(v string) *ArticleUpsertOne
- func (u *ArticleUpsertOne) SetURL(v string) *ArticleUpsertOne
- func (u *ArticleUpsertOne) SetUpdatedAt(v time.Time) *ArticleUpsertOne
- func (u *ArticleUpsertOne) Update(set func(*ArticleUpsert)) *ArticleUpsertOne
- func (u *ArticleUpsertOne) UpdateCreatedAt() *ArticleUpsertOne
- func (u *ArticleUpsertOne) UpdateDeletedAt() *ArticleUpsertOne
- func (u *ArticleUpsertOne) UpdateDescription() *ArticleUpsertOne
- func (u *ArticleUpsertOne) UpdateNewValues() *ArticleUpsertOne
- func (u *ArticleUpsertOne) UpdateThumbnail() *ArticleUpsertOne
- func (u *ArticleUpsertOne) UpdateTitle() *ArticleUpsertOne
- func (u *ArticleUpsertOne) UpdateURL() *ArticleUpsertOne
- func (u *ArticleUpsertOne) UpdateUpdatedAt() *ArticleUpsertOne
- type Articles
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type 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 ReadArticle
- type ReadArticleClient
- func (c *ReadArticleClient) Create() *ReadArticleCreate
- func (c *ReadArticleClient) CreateBulk(builders ...*ReadArticleCreate) *ReadArticleCreateBulk
- func (c *ReadArticleClient) Delete() *ReadArticleDelete
- func (c *ReadArticleClient) DeleteOne(ra *ReadArticle) *ReadArticleDeleteOne
- func (c *ReadArticleClient) DeleteOneID(id uuid.UUID) *ReadArticleDeleteOne
- func (c *ReadArticleClient) Get(ctx context.Context, id uuid.UUID) (*ReadArticle, error)
- func (c *ReadArticleClient) GetX(ctx context.Context, id uuid.UUID) *ReadArticle
- func (c *ReadArticleClient) Hooks() []Hook
- func (c *ReadArticleClient) Intercept(interceptors ...Interceptor)
- func (c *ReadArticleClient) Interceptors() []Interceptor
- func (c *ReadArticleClient) Query() *ReadArticleQuery
- func (c *ReadArticleClient) QueryArticle(ra *ReadArticle) *ArticleQuery
- func (c *ReadArticleClient) Update() *ReadArticleUpdate
- func (c *ReadArticleClient) UpdateOne(ra *ReadArticle) *ReadArticleUpdateOne
- func (c *ReadArticleClient) UpdateOneID(id uuid.UUID) *ReadArticleUpdateOne
- func (c *ReadArticleClient) Use(hooks ...Hook)
- type ReadArticleCreate
- func (rac *ReadArticleCreate) Exec(ctx context.Context) error
- func (rac *ReadArticleCreate) ExecX(ctx context.Context)
- func (rac *ReadArticleCreate) Mutation() *ReadArticleMutation
- func (rac *ReadArticleCreate) OnConflict(opts ...sql.ConflictOption) *ReadArticleUpsertOne
- func (rac *ReadArticleCreate) OnConflictColumns(columns ...string) *ReadArticleUpsertOne
- func (rac *ReadArticleCreate) Save(ctx context.Context) (*ReadArticle, error)
- func (rac *ReadArticleCreate) SaveX(ctx context.Context) *ReadArticle
- func (rac *ReadArticleCreate) SetArticle(a *Article) *ReadArticleCreate
- func (rac *ReadArticleCreate) SetArticleID(u uuid.UUID) *ReadArticleCreate
- func (rac *ReadArticleCreate) SetID(u uuid.UUID) *ReadArticleCreate
- func (rac *ReadArticleCreate) SetNillableID(u *uuid.UUID) *ReadArticleCreate
- func (rac *ReadArticleCreate) SetNillableReadAt(t *time.Time) *ReadArticleCreate
- func (rac *ReadArticleCreate) SetReadAt(t time.Time) *ReadArticleCreate
- func (rac *ReadArticleCreate) SetUserID(u uuid.UUID) *ReadArticleCreate
- type ReadArticleCreateBulk
- func (racb *ReadArticleCreateBulk) Exec(ctx context.Context) error
- func (racb *ReadArticleCreateBulk) ExecX(ctx context.Context)
- func (racb *ReadArticleCreateBulk) OnConflict(opts ...sql.ConflictOption) *ReadArticleUpsertBulk
- func (racb *ReadArticleCreateBulk) OnConflictColumns(columns ...string) *ReadArticleUpsertBulk
- func (racb *ReadArticleCreateBulk) Save(ctx context.Context) ([]*ReadArticle, error)
- func (racb *ReadArticleCreateBulk) SaveX(ctx context.Context) []*ReadArticle
- type ReadArticleDelete
- type ReadArticleDeleteOne
- type ReadArticleEdges
- type ReadArticleGroupBy
- func (ragb *ReadArticleGroupBy) Aggregate(fns ...AggregateFunc) *ReadArticleGroupBy
- func (s *ReadArticleGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ReadArticleGroupBy) BoolX(ctx context.Context) bool
- func (s *ReadArticleGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ReadArticleGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ReadArticleGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ReadArticleGroupBy) Float64X(ctx context.Context) float64
- func (s *ReadArticleGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ReadArticleGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ReadArticleGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ReadArticleGroupBy) IntX(ctx context.Context) int
- func (s *ReadArticleGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ReadArticleGroupBy) IntsX(ctx context.Context) []int
- func (ragb *ReadArticleGroupBy) Scan(ctx context.Context, v any) error
- func (s *ReadArticleGroupBy) ScanX(ctx context.Context, v any)
- func (s *ReadArticleGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ReadArticleGroupBy) StringX(ctx context.Context) string
- func (s *ReadArticleGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ReadArticleGroupBy) StringsX(ctx context.Context) []string
- type ReadArticleMutation
- func (m *ReadArticleMutation) AddField(name string, value ent.Value) error
- func (m *ReadArticleMutation) AddedEdges() []string
- func (m *ReadArticleMutation) AddedField(name string) (ent.Value, bool)
- func (m *ReadArticleMutation) AddedFields() []string
- func (m *ReadArticleMutation) AddedIDs(name string) []ent.Value
- func (m *ReadArticleMutation) ArticleCleared() bool
- func (m *ReadArticleMutation) ArticleID() (r uuid.UUID, exists bool)
- func (m *ReadArticleMutation) ArticleIDs() (ids []uuid.UUID)
- func (m *ReadArticleMutation) ClearArticle()
- func (m *ReadArticleMutation) ClearEdge(name string) error
- func (m *ReadArticleMutation) ClearField(name string) error
- func (m *ReadArticleMutation) ClearedEdges() []string
- func (m *ReadArticleMutation) ClearedFields() []string
- func (m ReadArticleMutation) Client() *Client
- func (m *ReadArticleMutation) EdgeCleared(name string) bool
- func (m *ReadArticleMutation) Field(name string) (ent.Value, bool)
- func (m *ReadArticleMutation) FieldCleared(name string) bool
- func (m *ReadArticleMutation) Fields() []string
- func (m *ReadArticleMutation) ID() (id uuid.UUID, exists bool)
- func (m *ReadArticleMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *ReadArticleMutation) OldArticleID(ctx context.Context) (v uuid.UUID, err error)
- func (m *ReadArticleMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ReadArticleMutation) OldReadAt(ctx context.Context) (v time.Time, err error)
- func (m *ReadArticleMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)
- func (m *ReadArticleMutation) Op() Op
- func (m *ReadArticleMutation) ReadAt() (r time.Time, exists bool)
- func (m *ReadArticleMutation) RemovedEdges() []string
- func (m *ReadArticleMutation) RemovedIDs(name string) []ent.Value
- func (m *ReadArticleMutation) ResetArticle()
- func (m *ReadArticleMutation) ResetArticleID()
- func (m *ReadArticleMutation) ResetEdge(name string) error
- func (m *ReadArticleMutation) ResetField(name string) error
- func (m *ReadArticleMutation) ResetReadAt()
- func (m *ReadArticleMutation) ResetUserID()
- func (m *ReadArticleMutation) SetArticleID(u uuid.UUID)
- func (m *ReadArticleMutation) SetField(name string, value ent.Value) error
- func (m *ReadArticleMutation) SetID(id uuid.UUID)
- func (m *ReadArticleMutation) SetOp(op Op)
- func (m *ReadArticleMutation) SetReadAt(t time.Time)
- func (m *ReadArticleMutation) SetUserID(u uuid.UUID)
- func (m ReadArticleMutation) Tx() (*Tx, error)
- func (m *ReadArticleMutation) Type() string
- func (m *ReadArticleMutation) UserID() (r uuid.UUID, exists bool)
- func (m *ReadArticleMutation) Where(ps ...predicate.ReadArticle)
- func (m *ReadArticleMutation) WhereP(ps ...func(*sql.Selector))
- type ReadArticleQuery
- func (raq *ReadArticleQuery) Aggregate(fns ...AggregateFunc) *ReadArticleSelect
- func (raq *ReadArticleQuery) All(ctx context.Context) ([]*ReadArticle, error)
- func (raq *ReadArticleQuery) AllX(ctx context.Context) []*ReadArticle
- func (raq *ReadArticleQuery) Clone() *ReadArticleQuery
- func (raq *ReadArticleQuery) Count(ctx context.Context) (int, error)
- func (raq *ReadArticleQuery) CountX(ctx context.Context) int
- func (raq *ReadArticleQuery) Exist(ctx context.Context) (bool, error)
- func (raq *ReadArticleQuery) ExistX(ctx context.Context) bool
- func (raq *ReadArticleQuery) First(ctx context.Context) (*ReadArticle, error)
- func (raq *ReadArticleQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (raq *ReadArticleQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (raq *ReadArticleQuery) FirstX(ctx context.Context) *ReadArticle
- func (raq *ReadArticleQuery) GroupBy(field string, fields ...string) *ReadArticleGroupBy
- func (raq *ReadArticleQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (raq *ReadArticleQuery) IDsX(ctx context.Context) []uuid.UUID
- func (raq *ReadArticleQuery) Limit(limit int) *ReadArticleQuery
- func (raq *ReadArticleQuery) Offset(offset int) *ReadArticleQuery
- func (raq *ReadArticleQuery) Only(ctx context.Context) (*ReadArticle, error)
- func (raq *ReadArticleQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (raq *ReadArticleQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (raq *ReadArticleQuery) OnlyX(ctx context.Context) *ReadArticle
- func (raq *ReadArticleQuery) Order(o ...OrderFunc) *ReadArticleQuery
- func (raq *ReadArticleQuery) QueryArticle() *ArticleQuery
- func (raq *ReadArticleQuery) Select(fields ...string) *ReadArticleSelect
- func (raq *ReadArticleQuery) Unique(unique bool) *ReadArticleQuery
- func (raq *ReadArticleQuery) Where(ps ...predicate.ReadArticle) *ReadArticleQuery
- func (raq *ReadArticleQuery) WithArticle(opts ...func(*ArticleQuery)) *ReadArticleQuery
- type ReadArticleSelect
- func (ras *ReadArticleSelect) Aggregate(fns ...AggregateFunc) *ReadArticleSelect
- func (s *ReadArticleSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ReadArticleSelect) BoolX(ctx context.Context) bool
- func (s *ReadArticleSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ReadArticleSelect) BoolsX(ctx context.Context) []bool
- func (s *ReadArticleSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ReadArticleSelect) Float64X(ctx context.Context) float64
- func (s *ReadArticleSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ReadArticleSelect) Float64sX(ctx context.Context) []float64
- func (s *ReadArticleSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ReadArticleSelect) IntX(ctx context.Context) int
- func (s *ReadArticleSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ReadArticleSelect) IntsX(ctx context.Context) []int
- func (ras *ReadArticleSelect) Scan(ctx context.Context, v any) error
- func (s *ReadArticleSelect) ScanX(ctx context.Context, v any)
- func (s *ReadArticleSelect) String(ctx context.Context) (_ string, err error)
- func (s *ReadArticleSelect) StringX(ctx context.Context) string
- func (s *ReadArticleSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ReadArticleSelect) StringsX(ctx context.Context) []string
- type ReadArticleUpdate
- func (rau *ReadArticleUpdate) ClearArticle() *ReadArticleUpdate
- func (rau *ReadArticleUpdate) Exec(ctx context.Context) error
- func (rau *ReadArticleUpdate) ExecX(ctx context.Context)
- func (rau *ReadArticleUpdate) Mutation() *ReadArticleMutation
- func (rau *ReadArticleUpdate) Save(ctx context.Context) (int, error)
- func (rau *ReadArticleUpdate) SaveX(ctx context.Context) int
- func (rau *ReadArticleUpdate) SetArticle(a *Article) *ReadArticleUpdate
- func (rau *ReadArticleUpdate) SetArticleID(u uuid.UUID) *ReadArticleUpdate
- func (rau *ReadArticleUpdate) SetNillableReadAt(t *time.Time) *ReadArticleUpdate
- func (rau *ReadArticleUpdate) SetReadAt(t time.Time) *ReadArticleUpdate
- func (rau *ReadArticleUpdate) SetUserID(u uuid.UUID) *ReadArticleUpdate
- func (rau *ReadArticleUpdate) Where(ps ...predicate.ReadArticle) *ReadArticleUpdate
- type ReadArticleUpdateOne
- func (rauo *ReadArticleUpdateOne) ClearArticle() *ReadArticleUpdateOne
- func (rauo *ReadArticleUpdateOne) Exec(ctx context.Context) error
- func (rauo *ReadArticleUpdateOne) ExecX(ctx context.Context)
- func (rauo *ReadArticleUpdateOne) Mutation() *ReadArticleMutation
- func (rauo *ReadArticleUpdateOne) Save(ctx context.Context) (*ReadArticle, error)
- func (rauo *ReadArticleUpdateOne) SaveX(ctx context.Context) *ReadArticle
- func (rauo *ReadArticleUpdateOne) Select(field string, fields ...string) *ReadArticleUpdateOne
- func (rauo *ReadArticleUpdateOne) SetArticle(a *Article) *ReadArticleUpdateOne
- func (rauo *ReadArticleUpdateOne) SetArticleID(u uuid.UUID) *ReadArticleUpdateOne
- func (rauo *ReadArticleUpdateOne) SetNillableReadAt(t *time.Time) *ReadArticleUpdateOne
- func (rauo *ReadArticleUpdateOne) SetReadAt(t time.Time) *ReadArticleUpdateOne
- func (rauo *ReadArticleUpdateOne) SetUserID(u uuid.UUID) *ReadArticleUpdateOne
- func (rauo *ReadArticleUpdateOne) Where(ps ...predicate.ReadArticle) *ReadArticleUpdateOne
- type ReadArticleUpsert
- func (u *ReadArticleUpsert) SetArticleID(v uuid.UUID) *ReadArticleUpsert
- func (u *ReadArticleUpsert) SetReadAt(v time.Time) *ReadArticleUpsert
- func (u *ReadArticleUpsert) SetUserID(v uuid.UUID) *ReadArticleUpsert
- func (u *ReadArticleUpsert) UpdateArticleID() *ReadArticleUpsert
- func (u *ReadArticleUpsert) UpdateReadAt() *ReadArticleUpsert
- func (u *ReadArticleUpsert) UpdateUserID() *ReadArticleUpsert
- type ReadArticleUpsertBulk
- func (u *ReadArticleUpsertBulk) DoNothing() *ReadArticleUpsertBulk
- func (u *ReadArticleUpsertBulk) Exec(ctx context.Context) error
- func (u *ReadArticleUpsertBulk) ExecX(ctx context.Context)
- func (u *ReadArticleUpsertBulk) Ignore() *ReadArticleUpsertBulk
- func (u *ReadArticleUpsertBulk) SetArticleID(v uuid.UUID) *ReadArticleUpsertBulk
- func (u *ReadArticleUpsertBulk) SetReadAt(v time.Time) *ReadArticleUpsertBulk
- func (u *ReadArticleUpsertBulk) SetUserID(v uuid.UUID) *ReadArticleUpsertBulk
- func (u *ReadArticleUpsertBulk) Update(set func(*ReadArticleUpsert)) *ReadArticleUpsertBulk
- func (u *ReadArticleUpsertBulk) UpdateArticleID() *ReadArticleUpsertBulk
- func (u *ReadArticleUpsertBulk) UpdateNewValues() *ReadArticleUpsertBulk
- func (u *ReadArticleUpsertBulk) UpdateReadAt() *ReadArticleUpsertBulk
- func (u *ReadArticleUpsertBulk) UpdateUserID() *ReadArticleUpsertBulk
- type ReadArticleUpsertOne
- func (u *ReadArticleUpsertOne) DoNothing() *ReadArticleUpsertOne
- func (u *ReadArticleUpsertOne) Exec(ctx context.Context) error
- func (u *ReadArticleUpsertOne) ExecX(ctx context.Context)
- func (u *ReadArticleUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *ReadArticleUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *ReadArticleUpsertOne) Ignore() *ReadArticleUpsertOne
- func (u *ReadArticleUpsertOne) SetArticleID(v uuid.UUID) *ReadArticleUpsertOne
- func (u *ReadArticleUpsertOne) SetReadAt(v time.Time) *ReadArticleUpsertOne
- func (u *ReadArticleUpsertOne) SetUserID(v uuid.UUID) *ReadArticleUpsertOne
- func (u *ReadArticleUpsertOne) Update(set func(*ReadArticleUpsert)) *ReadArticleUpsertOne
- func (u *ReadArticleUpsertOne) UpdateArticleID() *ReadArticleUpsertOne
- func (u *ReadArticleUpsertOne) UpdateNewValues() *ReadArticleUpsertOne
- func (u *ReadArticleUpsertOne) UpdateReadAt() *ReadArticleUpsertOne
- func (u *ReadArticleUpsertOne) UpdateUserID() *ReadArticleUpsertOne
- type ReadArticles
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne
- func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
- func (uc *UserCreate) SetLastLoggedInAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate
- func (uc *UserCreate) SetNillableLastLoggedInAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
- type UserCreateBulk
- func (ucb *UserCreateBulk) Exec(ctx context.Context) error
- func (ucb *UserCreateBulk) ExecX(ctx context.Context)
- func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk
- func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk
- func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)
- func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User
- type UserDelete
- type UserDeleteOne
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id uuid.UUID, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *UserMutation) LastLoggedInAt() (r time.Time, exists bool)
- func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldLastLoggedInAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetLastLoggedInAt()
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetID(id uuid.UUID)
- func (m *UserMutation) SetLastLoggedInAt(t time.Time)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetUpdatedAt(t time.Time)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetLastLoggedInAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableLastLoggedInAt(t *time.Time) *UserUpdate
- func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLastLoggedInAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableLastLoggedInAt(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type UserUpsert
- func (u *UserUpsert) SetCreatedAt(v time.Time) *UserUpsert
- func (u *UserUpsert) SetLastLoggedInAt(v time.Time) *UserUpsert
- func (u *UserUpsert) SetUpdatedAt(v time.Time) *UserUpsert
- func (u *UserUpsert) UpdateCreatedAt() *UserUpsert
- func (u *UserUpsert) UpdateLastLoggedInAt() *UserUpsert
- func (u *UserUpsert) UpdateUpdatedAt() *UserUpsert
- type UserUpsertBulk
- func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk
- func (u *UserUpsertBulk) Exec(ctx context.Context) error
- func (u *UserUpsertBulk) ExecX(ctx context.Context)
- func (u *UserUpsertBulk) Ignore() *UserUpsertBulk
- func (u *UserUpsertBulk) SetCreatedAt(v time.Time) *UserUpsertBulk
- func (u *UserUpsertBulk) SetLastLoggedInAt(v time.Time) *UserUpsertBulk
- func (u *UserUpsertBulk) SetUpdatedAt(v time.Time) *UserUpsertBulk
- func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateCreatedAt() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateLastLoggedInAt() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateUpdatedAt() *UserUpsertBulk
- type UserUpsertOne
- func (u *UserUpsertOne) DoNothing() *UserUpsertOne
- func (u *UserUpsertOne) Exec(ctx context.Context) error
- func (u *UserUpsertOne) ExecX(ctx context.Context)
- func (u *UserUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *UserUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *UserUpsertOne) Ignore() *UserUpsertOne
- func (u *UserUpsertOne) SetCreatedAt(v time.Time) *UserUpsertOne
- func (u *UserUpsertOne) SetLastLoggedInAt(v time.Time) *UserUpsertOne
- func (u *UserUpsertOne) SetUpdatedAt(v time.Time) *UserUpsertOne
- func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne
- func (u *UserUpsertOne) UpdateCreatedAt() *UserUpsertOne
- func (u *UserUpsertOne) UpdateLastLoggedInAt() *UserUpsertOne
- func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne
- func (u *UserUpsertOne) UpdateUpdatedAt() *UserUpsertOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeArticle = "Article" TypeArticleTag = "ArticleTag" TypeReadArticle = "ReadArticle" TypeUser = "User" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Article ¶
type Article struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Title holds the value of the "title" field. Title string `json:"title,omitempty"` // URL holds the value of the "url" field. URL string `json:"url,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // Thumbnail holds the value of the "thumbnail" field. Thumbnail string `json:"thumbnail,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"` // DeletedAt holds the value of the "deleted_at" field. DeletedAt *time.Time `json:"deleted_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ArticleQuery when eager-loading is set. Edges ArticleEdges `json:"edges"` // contains filtered or unexported fields }
Article is the model entity for the Article schema.
func (*Article) QueryReadArticles ¶
func (a *Article) QueryReadArticles() *ReadArticleQuery
QueryReadArticles queries the "read_articles" edge of the Article entity.
func (*Article) QueryTags ¶
func (a *Article) QueryTags() *ArticleTagQuery
QueryTags queries the "tags" edge of the Article entity.
func (*Article) Unwrap ¶
Unwrap unwraps the Article entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Article) Update ¶
func (a *Article) Update() *ArticleUpdateOne
Update returns a builder for updating this Article. Note that you need to call Article.Unwrap() before calling this method if this Article was returned from a transaction, and the transaction was committed or rolled back.
type ArticleClient ¶
type ArticleClient struct {
// contains filtered or unexported fields
}
ArticleClient is a client for the Article schema.
func NewArticleClient ¶
func NewArticleClient(c config) *ArticleClient
NewArticleClient returns a client for the Article from the given config.
func (*ArticleClient) Create ¶
func (c *ArticleClient) Create() *ArticleCreate
Create returns a builder for creating a Article entity.
func (*ArticleClient) CreateBulk ¶
func (c *ArticleClient) CreateBulk(builders ...*ArticleCreate) *ArticleCreateBulk
CreateBulk returns a builder for creating a bulk of Article entities.
func (*ArticleClient) Delete ¶
func (c *ArticleClient) Delete() *ArticleDelete
Delete returns a delete builder for Article.
func (*ArticleClient) DeleteOne ¶
func (c *ArticleClient) DeleteOne(a *Article) *ArticleDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ArticleClient) DeleteOneID ¶
func (c *ArticleClient) DeleteOneID(id uuid.UUID) *ArticleDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ArticleClient) Hooks ¶
func (c *ArticleClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ArticleClient) Intercept ¶
func (c *ArticleClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `article.Intercept(f(g(h())))`.
func (*ArticleClient) Interceptors ¶
func (c *ArticleClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ArticleClient) Query ¶
func (c *ArticleClient) Query() *ArticleQuery
Query returns a query builder for Article.
func (*ArticleClient) QueryReadArticles ¶
func (c *ArticleClient) QueryReadArticles(a *Article) *ReadArticleQuery
QueryReadArticles queries the read_articles edge of a Article.
func (*ArticleClient) QueryTags ¶
func (c *ArticleClient) QueryTags(a *Article) *ArticleTagQuery
QueryTags queries the tags edge of a Article.
func (*ArticleClient) Update ¶
func (c *ArticleClient) Update() *ArticleUpdate
Update returns an update builder for Article.
func (*ArticleClient) UpdateOne ¶
func (c *ArticleClient) UpdateOne(a *Article) *ArticleUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ArticleClient) UpdateOneID ¶
func (c *ArticleClient) UpdateOneID(id uuid.UUID) *ArticleUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ArticleClient) Use ¶
func (c *ArticleClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `article.Hooks(f(g(h())))`.
type ArticleCreate ¶
type ArticleCreate struct {
// contains filtered or unexported fields
}
ArticleCreate is the builder for creating a Article entity.
func (*ArticleCreate) AddReadArticleIDs ¶
func (ac *ArticleCreate) AddReadArticleIDs(ids ...uuid.UUID) *ArticleCreate
AddReadArticleIDs adds the "read_articles" edge to the ReadArticle entity by IDs.
func (*ArticleCreate) AddReadArticles ¶
func (ac *ArticleCreate) AddReadArticles(r ...*ReadArticle) *ArticleCreate
AddReadArticles adds the "read_articles" edges to the ReadArticle entity.
func (*ArticleCreate) AddTagIDs ¶
func (ac *ArticleCreate) AddTagIDs(ids ...uuid.UUID) *ArticleCreate
AddTagIDs adds the "tags" edge to the ArticleTag entity by IDs.
func (*ArticleCreate) AddTags ¶
func (ac *ArticleCreate) AddTags(a ...*ArticleTag) *ArticleCreate
AddTags adds the "tags" edges to the ArticleTag entity.
func (*ArticleCreate) Exec ¶
func (ac *ArticleCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleCreate) ExecX ¶
func (ac *ArticleCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleCreate) Mutation ¶
func (ac *ArticleCreate) Mutation() *ArticleMutation
Mutation returns the ArticleMutation object of the builder.
func (*ArticleCreate) OnConflict ¶
func (ac *ArticleCreate) OnConflict(opts ...sql.ConflictOption) *ArticleUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Article.Create(). SetTitle(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ArticleUpsert) { SetTitle(v+v). }). Exec(ctx)
func (*ArticleCreate) OnConflictColumns ¶
func (ac *ArticleCreate) OnConflictColumns(columns ...string) *ArticleUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Article.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*ArticleCreate) Save ¶
func (ac *ArticleCreate) Save(ctx context.Context) (*Article, error)
Save creates the Article in the database.
func (*ArticleCreate) SaveX ¶
func (ac *ArticleCreate) SaveX(ctx context.Context) *Article
SaveX calls Save and panics if Save returns an error.
func (*ArticleCreate) SetCreatedAt ¶
func (ac *ArticleCreate) SetCreatedAt(t time.Time) *ArticleCreate
SetCreatedAt sets the "created_at" field.
func (*ArticleCreate) SetDeletedAt ¶
func (ac *ArticleCreate) SetDeletedAt(t time.Time) *ArticleCreate
SetDeletedAt sets the "deleted_at" field.
func (*ArticleCreate) SetDescription ¶
func (ac *ArticleCreate) SetDescription(s string) *ArticleCreate
SetDescription sets the "description" field.
func (*ArticleCreate) SetID ¶
func (ac *ArticleCreate) SetID(u uuid.UUID) *ArticleCreate
SetID sets the "id" field.
func (*ArticleCreate) SetNillableCreatedAt ¶
func (ac *ArticleCreate) SetNillableCreatedAt(t *time.Time) *ArticleCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ArticleCreate) SetNillableDeletedAt ¶
func (ac *ArticleCreate) SetNillableDeletedAt(t *time.Time) *ArticleCreate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*ArticleCreate) SetNillableID ¶
func (ac *ArticleCreate) SetNillableID(u *uuid.UUID) *ArticleCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*ArticleCreate) SetNillableUpdatedAt ¶
func (ac *ArticleCreate) SetNillableUpdatedAt(t *time.Time) *ArticleCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ArticleCreate) SetThumbnail ¶
func (ac *ArticleCreate) SetThumbnail(s string) *ArticleCreate
SetThumbnail sets the "thumbnail" field.
func (*ArticleCreate) SetTitle ¶
func (ac *ArticleCreate) SetTitle(s string) *ArticleCreate
SetTitle sets the "title" field.
func (*ArticleCreate) SetURL ¶
func (ac *ArticleCreate) SetURL(s string) *ArticleCreate
SetURL sets the "url" field.
func (*ArticleCreate) SetUpdatedAt ¶
func (ac *ArticleCreate) SetUpdatedAt(t time.Time) *ArticleCreate
SetUpdatedAt sets the "updated_at" field.
type ArticleCreateBulk ¶
type ArticleCreateBulk struct {
// contains filtered or unexported fields
}
ArticleCreateBulk is the builder for creating many Article entities in bulk.
func (*ArticleCreateBulk) Exec ¶
func (acb *ArticleCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleCreateBulk) ExecX ¶
func (acb *ArticleCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleCreateBulk) OnConflict ¶
func (acb *ArticleCreateBulk) OnConflict(opts ...sql.ConflictOption) *ArticleUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Article.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ArticleUpsert) { SetTitle(v+v). }). Exec(ctx)
func (*ArticleCreateBulk) OnConflictColumns ¶
func (acb *ArticleCreateBulk) OnConflictColumns(columns ...string) *ArticleUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Article.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type ArticleDelete ¶
type ArticleDelete struct {
// contains filtered or unexported fields
}
ArticleDelete is the builder for deleting a Article entity.
func (*ArticleDelete) Exec ¶
func (ad *ArticleDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ArticleDelete) ExecX ¶
func (ad *ArticleDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ArticleDelete) Where ¶
func (ad *ArticleDelete) Where(ps ...predicate.Article) *ArticleDelete
Where appends a list predicates to the ArticleDelete builder.
type ArticleDeleteOne ¶
type ArticleDeleteOne struct {
// contains filtered or unexported fields
}
ArticleDeleteOne is the builder for deleting a single Article entity.
func (*ArticleDeleteOne) Exec ¶
func (ado *ArticleDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ArticleDeleteOne) ExecX ¶
func (ado *ArticleDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleDeleteOne) Where ¶
func (ado *ArticleDeleteOne) Where(ps ...predicate.Article) *ArticleDeleteOne
Where appends a list predicates to the ArticleDelete builder.
type ArticleEdges ¶
type ArticleEdges struct { // Tags holds the value of the tags edge. Tags []*ArticleTag `json:"tags,omitempty"` // ReadArticles holds the value of the read_articles edge. ReadArticles []*ReadArticle `json:"read_articles,omitempty"` // contains filtered or unexported fields }
ArticleEdges holds the relations/edges for other nodes in the graph.
func (ArticleEdges) ReadArticlesOrErr ¶
func (e ArticleEdges) ReadArticlesOrErr() ([]*ReadArticle, error)
ReadArticlesOrErr returns the ReadArticles value or an error if the edge was not loaded in eager-loading.
func (ArticleEdges) TagsOrErr ¶
func (e ArticleEdges) TagsOrErr() ([]*ArticleTag, error)
TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading.
type ArticleGroupBy ¶
type ArticleGroupBy struct {
// contains filtered or unexported fields
}
ArticleGroupBy is the group-by builder for Article entities.
func (*ArticleGroupBy) Aggregate ¶
func (agb *ArticleGroupBy) Aggregate(fns ...AggregateFunc) *ArticleGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ArticleGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Scan ¶
func (agb *ArticleGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ArticleGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ArticleMutation ¶
type ArticleMutation struct {
// contains filtered or unexported fields
}
ArticleMutation represents an operation that mutates the Article nodes in the graph.
func (*ArticleMutation) AddField ¶
func (m *ArticleMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*ArticleMutation) AddReadArticleIDs ¶
func (m *ArticleMutation) AddReadArticleIDs(ids ...uuid.UUID)
AddReadArticleIDs adds the "read_articles" edge to the ReadArticle entity by ids.
func (*ArticleMutation) AddTagIDs ¶
func (m *ArticleMutation) AddTagIDs(ids ...uuid.UUID)
AddTagIDs adds the "tags" edge to the ArticleTag entity by ids.
func (*ArticleMutation) AddedEdges ¶
func (m *ArticleMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ArticleMutation) AddedField ¶
func (m *ArticleMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*ArticleMutation) AddedFields ¶
func (m *ArticleMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ArticleMutation) AddedIDs ¶
func (m *ArticleMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ArticleMutation) ClearDeletedAt ¶
func (m *ArticleMutation) ClearDeletedAt()
ClearDeletedAt clears the value of the "deleted_at" field.
func (*ArticleMutation) ClearEdge ¶
func (m *ArticleMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*ArticleMutation) ClearField ¶
func (m *ArticleMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*ArticleMutation) ClearReadArticles ¶
func (m *ArticleMutation) ClearReadArticles()
ClearReadArticles clears the "read_articles" edge to the ReadArticle entity.
func (*ArticleMutation) ClearTags ¶
func (m *ArticleMutation) ClearTags()
ClearTags clears the "tags" edge to the ArticleTag entity.
func (*ArticleMutation) ClearedEdges ¶
func (m *ArticleMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ArticleMutation) ClearedFields ¶
func (m *ArticleMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ArticleMutation) Client ¶
func (m ArticleMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*ArticleMutation) CreatedAt ¶
func (m *ArticleMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ArticleMutation) DeletedAt ¶
func (m *ArticleMutation) DeletedAt() (r time.Time, exists bool)
DeletedAt returns the value of the "deleted_at" field in the mutation.
func (*ArticleMutation) DeletedAtCleared ¶
func (m *ArticleMutation) DeletedAtCleared() bool
DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.
func (*ArticleMutation) Description ¶
func (m *ArticleMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*ArticleMutation) EdgeCleared ¶
func (m *ArticleMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ArticleMutation) Field ¶
func (m *ArticleMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*ArticleMutation) FieldCleared ¶
func (m *ArticleMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ArticleMutation) Fields ¶
func (m *ArticleMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*ArticleMutation) ID ¶
func (m *ArticleMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*ArticleMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*ArticleMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Article entity. If the Article object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ArticleMutation) OldDeletedAt ¶
OldDeletedAt returns the old "deleted_at" field's value of the Article entity. If the Article object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ArticleMutation) OldDescription ¶
func (m *ArticleMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Article entity. If the Article object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ArticleMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*ArticleMutation) OldThumbnail ¶
func (m *ArticleMutation) OldThumbnail(ctx context.Context) (v string, err error)
OldThumbnail returns the old "thumbnail" field's value of the Article entity. If the Article object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ArticleMutation) OldTitle ¶
func (m *ArticleMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the Article entity. If the Article object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ArticleMutation) OldURL ¶
func (m *ArticleMutation) OldURL(ctx context.Context) (v string, err error)
OldURL returns the old "url" field's value of the Article entity. If the Article object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ArticleMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Article entity. If the Article object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*ArticleMutation) ReadArticlesCleared ¶
func (m *ArticleMutation) ReadArticlesCleared() bool
ReadArticlesCleared reports if the "read_articles" edge to the ReadArticle entity was cleared.
func (*ArticleMutation) ReadArticlesIDs ¶
func (m *ArticleMutation) ReadArticlesIDs() (ids []uuid.UUID)
ReadArticlesIDs returns the "read_articles" edge IDs in the mutation.
func (*ArticleMutation) RemoveReadArticleIDs ¶
func (m *ArticleMutation) RemoveReadArticleIDs(ids ...uuid.UUID)
RemoveReadArticleIDs removes the "read_articles" edge to the ReadArticle entity by IDs.
func (*ArticleMutation) RemoveTagIDs ¶
func (m *ArticleMutation) RemoveTagIDs(ids ...uuid.UUID)
RemoveTagIDs removes the "tags" edge to the ArticleTag entity by IDs.
func (*ArticleMutation) RemovedEdges ¶
func (m *ArticleMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ArticleMutation) RemovedIDs ¶
func (m *ArticleMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*ArticleMutation) RemovedReadArticlesIDs ¶
func (m *ArticleMutation) RemovedReadArticlesIDs() (ids []uuid.UUID)
RemovedReadArticles returns the removed IDs of the "read_articles" edge to the ReadArticle entity.
func (*ArticleMutation) RemovedTagsIDs ¶
func (m *ArticleMutation) RemovedTagsIDs() (ids []uuid.UUID)
RemovedTags returns the removed IDs of the "tags" edge to the ArticleTag entity.
func (*ArticleMutation) ResetCreatedAt ¶
func (m *ArticleMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ArticleMutation) ResetDeletedAt ¶
func (m *ArticleMutation) ResetDeletedAt()
ResetDeletedAt resets all changes to the "deleted_at" field.
func (*ArticleMutation) ResetDescription ¶
func (m *ArticleMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*ArticleMutation) ResetEdge ¶
func (m *ArticleMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*ArticleMutation) ResetField ¶
func (m *ArticleMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*ArticleMutation) ResetReadArticles ¶
func (m *ArticleMutation) ResetReadArticles()
ResetReadArticles resets all changes to the "read_articles" edge.
func (*ArticleMutation) ResetTags ¶
func (m *ArticleMutation) ResetTags()
ResetTags resets all changes to the "tags" edge.
func (*ArticleMutation) ResetThumbnail ¶
func (m *ArticleMutation) ResetThumbnail()
ResetThumbnail resets all changes to the "thumbnail" field.
func (*ArticleMutation) ResetTitle ¶
func (m *ArticleMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*ArticleMutation) ResetURL ¶
func (m *ArticleMutation) ResetURL()
ResetURL resets all changes to the "url" field.
func (*ArticleMutation) ResetUpdatedAt ¶
func (m *ArticleMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*ArticleMutation) SetCreatedAt ¶
func (m *ArticleMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ArticleMutation) SetDeletedAt ¶
func (m *ArticleMutation) SetDeletedAt(t time.Time)
SetDeletedAt sets the "deleted_at" field.
func (*ArticleMutation) SetDescription ¶
func (m *ArticleMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*ArticleMutation) SetField ¶
func (m *ArticleMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*ArticleMutation) SetID ¶
func (m *ArticleMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Article entities.
func (*ArticleMutation) SetOp ¶
func (m *ArticleMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ArticleMutation) SetThumbnail ¶
func (m *ArticleMutation) SetThumbnail(s string)
SetThumbnail sets the "thumbnail" field.
func (*ArticleMutation) SetTitle ¶
func (m *ArticleMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*ArticleMutation) SetURL ¶
func (m *ArticleMutation) SetURL(s string)
SetURL sets the "url" field.
func (*ArticleMutation) SetUpdatedAt ¶
func (m *ArticleMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*ArticleMutation) TagsCleared ¶
func (m *ArticleMutation) TagsCleared() bool
TagsCleared reports if the "tags" edge to the ArticleTag entity was cleared.
func (*ArticleMutation) TagsIDs ¶
func (m *ArticleMutation) TagsIDs() (ids []uuid.UUID)
TagsIDs returns the "tags" edge IDs in the mutation.
func (*ArticleMutation) Thumbnail ¶
func (m *ArticleMutation) Thumbnail() (r string, exists bool)
Thumbnail returns the value of the "thumbnail" field in the mutation.
func (*ArticleMutation) Title ¶
func (m *ArticleMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (ArticleMutation) Tx ¶
func (m ArticleMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ArticleMutation) Type ¶
func (m *ArticleMutation) Type() string
Type returns the node type of this mutation (Article).
func (*ArticleMutation) URL ¶
func (m *ArticleMutation) URL() (r string, exists bool)
URL returns the value of the "url" field in the mutation.
func (*ArticleMutation) UpdatedAt ¶
func (m *ArticleMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*ArticleMutation) Where ¶
func (m *ArticleMutation) Where(ps ...predicate.Article)
Where appends a list predicates to the ArticleMutation builder.
func (*ArticleMutation) WhereP ¶
func (m *ArticleMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ArticleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ArticleQuery ¶
type ArticleQuery struct {
// contains filtered or unexported fields
}
ArticleQuery is the builder for querying Article entities.
func (*ArticleQuery) Aggregate ¶
func (aq *ArticleQuery) Aggregate(fns ...AggregateFunc) *ArticleSelect
Aggregate returns a ArticleSelect configured with the given aggregations.
func (*ArticleQuery) All ¶
func (aq *ArticleQuery) All(ctx context.Context) ([]*Article, error)
All executes the query and returns a list of Articles.
func (*ArticleQuery) AllX ¶
func (aq *ArticleQuery) AllX(ctx context.Context) []*Article
AllX is like All, but panics if an error occurs.
func (*ArticleQuery) Clone ¶
func (aq *ArticleQuery) Clone() *ArticleQuery
Clone returns a duplicate of the ArticleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ArticleQuery) Count ¶
func (aq *ArticleQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ArticleQuery) CountX ¶
func (aq *ArticleQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ArticleQuery) Exist ¶
func (aq *ArticleQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ArticleQuery) ExistX ¶
func (aq *ArticleQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ArticleQuery) First ¶
func (aq *ArticleQuery) First(ctx context.Context) (*Article, error)
First returns the first Article entity from the query. Returns a *NotFoundError when no Article was found.
func (*ArticleQuery) FirstID ¶
FirstID returns the first Article ID from the query. Returns a *NotFoundError when no Article ID was found.
func (*ArticleQuery) FirstIDX ¶
func (aq *ArticleQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*ArticleQuery) FirstX ¶
func (aq *ArticleQuery) FirstX(ctx context.Context) *Article
FirstX is like First, but panics if an error occurs.
func (*ArticleQuery) GroupBy ¶
func (aq *ArticleQuery) GroupBy(field string, fields ...string) *ArticleGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Title string `json:"title,omitempty"` Count int `json:"count,omitempty"` } client.Article.Query(). GroupBy(article.FieldTitle). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ArticleQuery) IDsX ¶
func (aq *ArticleQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*ArticleQuery) Limit ¶
func (aq *ArticleQuery) Limit(limit int) *ArticleQuery
Limit the number of records to be returned by this query.
func (*ArticleQuery) Offset ¶
func (aq *ArticleQuery) Offset(offset int) *ArticleQuery
Offset to start from.
func (*ArticleQuery) Only ¶
func (aq *ArticleQuery) Only(ctx context.Context) (*Article, error)
Only returns a single Article entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Article entity is found. Returns a *NotFoundError when no Article entities are found.
func (*ArticleQuery) OnlyID ¶
OnlyID is like Only, but returns the only Article ID in the query. Returns a *NotSingularError when more than one Article ID is found. Returns a *NotFoundError when no entities are found.
func (*ArticleQuery) OnlyIDX ¶
func (aq *ArticleQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ArticleQuery) OnlyX ¶
func (aq *ArticleQuery) OnlyX(ctx context.Context) *Article
OnlyX is like Only, but panics if an error occurs.
func (*ArticleQuery) Order ¶
func (aq *ArticleQuery) Order(o ...OrderFunc) *ArticleQuery
Order specifies how the records should be ordered.
func (*ArticleQuery) QueryReadArticles ¶
func (aq *ArticleQuery) QueryReadArticles() *ReadArticleQuery
QueryReadArticles chains the current query on the "read_articles" edge.
func (*ArticleQuery) QueryTags ¶
func (aq *ArticleQuery) QueryTags() *ArticleTagQuery
QueryTags chains the current query on the "tags" edge.
func (*ArticleQuery) Select ¶
func (aq *ArticleQuery) Select(fields ...string) *ArticleSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Title string `json:"title,omitempty"` } client.Article.Query(). Select(article.FieldTitle). Scan(ctx, &v)
func (*ArticleQuery) Unique ¶
func (aq *ArticleQuery) Unique(unique bool) *ArticleQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*ArticleQuery) Where ¶
func (aq *ArticleQuery) Where(ps ...predicate.Article) *ArticleQuery
Where adds a new predicate for the ArticleQuery builder.
func (*ArticleQuery) WithReadArticles ¶
func (aq *ArticleQuery) WithReadArticles(opts ...func(*ReadArticleQuery)) *ArticleQuery
WithReadArticles tells the query-builder to eager-load the nodes that are connected to the "read_articles" edge. The optional arguments are used to configure the query builder of the edge.
func (*ArticleQuery) WithTags ¶
func (aq *ArticleQuery) WithTags(opts ...func(*ArticleTagQuery)) *ArticleQuery
WithTags tells the query-builder to eager-load the nodes that are connected to the "tags" edge. The optional arguments are used to configure the query builder of the edge.
type ArticleSelect ¶
type ArticleSelect struct { *ArticleQuery // contains filtered or unexported fields }
ArticleSelect is the builder for selecting fields of Article entities.
func (*ArticleSelect) Aggregate ¶
func (as *ArticleSelect) Aggregate(fns ...AggregateFunc) *ArticleSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ArticleSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ArticleSelect) Scan ¶
func (as *ArticleSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ArticleSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ArticleTag ¶
type ArticleTag struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Tag holds the value of the "tag" field. Tag string `json:"tag,omitempty"` // ArticleID holds the value of the "article_id" field. ArticleID uuid.UUID `json:"article_id,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 ArticleTagQuery when eager-loading is set. Edges ArticleTagEdges `json:"edges"` // contains filtered or unexported fields }
ArticleTag is the model entity for the ArticleTag schema.
func (*ArticleTag) QueryArticle ¶
func (at *ArticleTag) QueryArticle() *ArticleQuery
QueryArticle queries the "article" edge of the ArticleTag entity.
func (*ArticleTag) String ¶
func (at *ArticleTag) String() string
String implements the fmt.Stringer.
func (*ArticleTag) Unwrap ¶
func (at *ArticleTag) Unwrap() *ArticleTag
Unwrap unwraps the ArticleTag 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 (*ArticleTag) Update ¶
func (at *ArticleTag) Update() *ArticleTagUpdateOne
Update returns a builder for updating this ArticleTag. Note that you need to call ArticleTag.Unwrap() before calling this method if this ArticleTag was returned from a transaction, and the transaction was committed or rolled back.
type ArticleTagClient ¶
type ArticleTagClient struct {
// contains filtered or unexported fields
}
ArticleTagClient is a client for the ArticleTag schema.
func NewArticleTagClient ¶
func NewArticleTagClient(c config) *ArticleTagClient
NewArticleTagClient returns a client for the ArticleTag from the given config.
func (*ArticleTagClient) Create ¶
func (c *ArticleTagClient) Create() *ArticleTagCreate
Create returns a builder for creating a ArticleTag entity.
func (*ArticleTagClient) CreateBulk ¶
func (c *ArticleTagClient) CreateBulk(builders ...*ArticleTagCreate) *ArticleTagCreateBulk
CreateBulk returns a builder for creating a bulk of ArticleTag entities.
func (*ArticleTagClient) Delete ¶
func (c *ArticleTagClient) Delete() *ArticleTagDelete
Delete returns a delete builder for ArticleTag.
func (*ArticleTagClient) DeleteOne ¶
func (c *ArticleTagClient) DeleteOne(at *ArticleTag) *ArticleTagDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ArticleTagClient) DeleteOneID ¶
func (c *ArticleTagClient) DeleteOneID(id uuid.UUID) *ArticleTagDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ArticleTagClient) Get ¶
func (c *ArticleTagClient) Get(ctx context.Context, id uuid.UUID) (*ArticleTag, error)
Get returns a ArticleTag entity by its id.
func (*ArticleTagClient) GetX ¶
func (c *ArticleTagClient) GetX(ctx context.Context, id uuid.UUID) *ArticleTag
GetX is like Get, but panics if an error occurs.
func (*ArticleTagClient) Hooks ¶
func (c *ArticleTagClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ArticleTagClient) Intercept ¶
func (c *ArticleTagClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `articletag.Intercept(f(g(h())))`.
func (*ArticleTagClient) Interceptors ¶
func (c *ArticleTagClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ArticleTagClient) Query ¶
func (c *ArticleTagClient) Query() *ArticleTagQuery
Query returns a query builder for ArticleTag.
func (*ArticleTagClient) QueryArticle ¶
func (c *ArticleTagClient) QueryArticle(at *ArticleTag) *ArticleQuery
QueryArticle queries the article edge of a ArticleTag.
func (*ArticleTagClient) Update ¶
func (c *ArticleTagClient) Update() *ArticleTagUpdate
Update returns an update builder for ArticleTag.
func (*ArticleTagClient) UpdateOne ¶
func (c *ArticleTagClient) UpdateOne(at *ArticleTag) *ArticleTagUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ArticleTagClient) UpdateOneID ¶
func (c *ArticleTagClient) UpdateOneID(id uuid.UUID) *ArticleTagUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ArticleTagClient) Use ¶
func (c *ArticleTagClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `articletag.Hooks(f(g(h())))`.
type ArticleTagCreate ¶
type ArticleTagCreate struct {
// contains filtered or unexported fields
}
ArticleTagCreate is the builder for creating a ArticleTag entity.
func (*ArticleTagCreate) Exec ¶
func (atc *ArticleTagCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleTagCreate) ExecX ¶
func (atc *ArticleTagCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleTagCreate) Mutation ¶
func (atc *ArticleTagCreate) Mutation() *ArticleTagMutation
Mutation returns the ArticleTagMutation object of the builder.
func (*ArticleTagCreate) OnConflict ¶
func (atc *ArticleTagCreate) OnConflict(opts ...sql.ConflictOption) *ArticleTagUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.ArticleTag.Create(). SetTag(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ArticleTagUpsert) { SetTag(v+v). }). Exec(ctx)
func (*ArticleTagCreate) OnConflictColumns ¶
func (atc *ArticleTagCreate) OnConflictColumns(columns ...string) *ArticleTagUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.ArticleTag.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*ArticleTagCreate) Save ¶
func (atc *ArticleTagCreate) Save(ctx context.Context) (*ArticleTag, error)
Save creates the ArticleTag in the database.
func (*ArticleTagCreate) SaveX ¶
func (atc *ArticleTagCreate) SaveX(ctx context.Context) *ArticleTag
SaveX calls Save and panics if Save returns an error.
func (*ArticleTagCreate) SetArticle ¶
func (atc *ArticleTagCreate) SetArticle(a *Article) *ArticleTagCreate
SetArticle sets the "article" edge to the Article entity.
func (*ArticleTagCreate) SetArticleID ¶
func (atc *ArticleTagCreate) SetArticleID(u uuid.UUID) *ArticleTagCreate
SetArticleID sets the "article_id" field.
func (*ArticleTagCreate) SetCreatedAt ¶
func (atc *ArticleTagCreate) SetCreatedAt(t time.Time) *ArticleTagCreate
SetCreatedAt sets the "created_at" field.
func (*ArticleTagCreate) SetID ¶
func (atc *ArticleTagCreate) SetID(u uuid.UUID) *ArticleTagCreate
SetID sets the "id" field.
func (*ArticleTagCreate) SetNillableCreatedAt ¶
func (atc *ArticleTagCreate) SetNillableCreatedAt(t *time.Time) *ArticleTagCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ArticleTagCreate) SetNillableID ¶
func (atc *ArticleTagCreate) SetNillableID(u *uuid.UUID) *ArticleTagCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*ArticleTagCreate) SetNillableUpdatedAt ¶
func (atc *ArticleTagCreate) SetNillableUpdatedAt(t *time.Time) *ArticleTagCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ArticleTagCreate) SetTag ¶
func (atc *ArticleTagCreate) SetTag(s string) *ArticleTagCreate
SetTag sets the "tag" field.
func (*ArticleTagCreate) SetUpdatedAt ¶
func (atc *ArticleTagCreate) SetUpdatedAt(t time.Time) *ArticleTagCreate
SetUpdatedAt sets the "updated_at" field.
type ArticleTagCreateBulk ¶
type ArticleTagCreateBulk struct {
// contains filtered or unexported fields
}
ArticleTagCreateBulk is the builder for creating many ArticleTag entities in bulk.
func (*ArticleTagCreateBulk) Exec ¶
func (atcb *ArticleTagCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleTagCreateBulk) ExecX ¶
func (atcb *ArticleTagCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleTagCreateBulk) OnConflict ¶
func (atcb *ArticleTagCreateBulk) OnConflict(opts ...sql.ConflictOption) *ArticleTagUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.ArticleTag.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ArticleTagUpsert) { SetTag(v+v). }). Exec(ctx)
func (*ArticleTagCreateBulk) OnConflictColumns ¶
func (atcb *ArticleTagCreateBulk) OnConflictColumns(columns ...string) *ArticleTagUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.ArticleTag.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*ArticleTagCreateBulk) Save ¶
func (atcb *ArticleTagCreateBulk) Save(ctx context.Context) ([]*ArticleTag, error)
Save creates the ArticleTag entities in the database.
func (*ArticleTagCreateBulk) SaveX ¶
func (atcb *ArticleTagCreateBulk) SaveX(ctx context.Context) []*ArticleTag
SaveX is like Save, but panics if an error occurs.
type ArticleTagDelete ¶
type ArticleTagDelete struct {
// contains filtered or unexported fields
}
ArticleTagDelete is the builder for deleting a ArticleTag entity.
func (*ArticleTagDelete) Exec ¶
func (atd *ArticleTagDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ArticleTagDelete) ExecX ¶
func (atd *ArticleTagDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ArticleTagDelete) Where ¶
func (atd *ArticleTagDelete) Where(ps ...predicate.ArticleTag) *ArticleTagDelete
Where appends a list predicates to the ArticleTagDelete builder.
type ArticleTagDeleteOne ¶
type ArticleTagDeleteOne struct {
// contains filtered or unexported fields
}
ArticleTagDeleteOne is the builder for deleting a single ArticleTag entity.
func (*ArticleTagDeleteOne) Exec ¶
func (atdo *ArticleTagDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ArticleTagDeleteOne) ExecX ¶
func (atdo *ArticleTagDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleTagDeleteOne) Where ¶
func (atdo *ArticleTagDeleteOne) Where(ps ...predicate.ArticleTag) *ArticleTagDeleteOne
Where appends a list predicates to the ArticleTagDelete builder.
type ArticleTagEdges ¶
type ArticleTagEdges struct { // Article holds the value of the article edge. Article *Article `json:"article,omitempty"` // contains filtered or unexported fields }
ArticleTagEdges holds the relations/edges for other nodes in the graph.
func (ArticleTagEdges) ArticleOrErr ¶
func (e ArticleTagEdges) ArticleOrErr() (*Article, error)
ArticleOrErr returns the Article value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ArticleTagGroupBy ¶
type ArticleTagGroupBy struct {
// contains filtered or unexported fields
}
ArticleTagGroupBy is the group-by builder for ArticleTag entities.
func (*ArticleTagGroupBy) Aggregate ¶
func (atgb *ArticleTagGroupBy) Aggregate(fns ...AggregateFunc) *ArticleTagGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ArticleTagGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ArticleTagGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ArticleTagGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ArticleTagGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ArticleTagGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ArticleTagGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ArticleTagGroupBy) Scan ¶
func (atgb *ArticleTagGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ArticleTagGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ArticleTagMutation ¶
type ArticleTagMutation struct {
// contains filtered or unexported fields
}
ArticleTagMutation represents an operation that mutates the ArticleTag nodes in the graph.
func (*ArticleTagMutation) AddField ¶
func (m *ArticleTagMutation) 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 (*ArticleTagMutation) AddedEdges ¶
func (m *ArticleTagMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ArticleTagMutation) AddedField ¶
func (m *ArticleTagMutation) 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 (*ArticleTagMutation) AddedFields ¶
func (m *ArticleTagMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ArticleTagMutation) AddedIDs ¶
func (m *ArticleTagMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ArticleTagMutation) ArticleCleared ¶
func (m *ArticleTagMutation) ArticleCleared() bool
ArticleCleared reports if the "article" edge to the Article entity was cleared.
func (*ArticleTagMutation) ArticleID ¶
func (m *ArticleTagMutation) ArticleID() (r uuid.UUID, exists bool)
ArticleID returns the value of the "article_id" field in the mutation.
func (*ArticleTagMutation) ArticleIDs ¶
func (m *ArticleTagMutation) ArticleIDs() (ids []uuid.UUID)
ArticleIDs returns the "article" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ArticleID instead. It exists only for internal usage by the builders.
func (*ArticleTagMutation) ClearArticle ¶
func (m *ArticleTagMutation) ClearArticle()
ClearArticle clears the "article" edge to the Article entity.
func (*ArticleTagMutation) ClearEdge ¶
func (m *ArticleTagMutation) 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 (*ArticleTagMutation) ClearField ¶
func (m *ArticleTagMutation) 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 (*ArticleTagMutation) ClearedEdges ¶
func (m *ArticleTagMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ArticleTagMutation) ClearedFields ¶
func (m *ArticleTagMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ArticleTagMutation) Client ¶
func (m ArticleTagMutation) 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 (*ArticleTagMutation) CreatedAt ¶
func (m *ArticleTagMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ArticleTagMutation) EdgeCleared ¶
func (m *ArticleTagMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ArticleTagMutation) Field ¶
func (m *ArticleTagMutation) 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 (*ArticleTagMutation) FieldCleared ¶
func (m *ArticleTagMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ArticleTagMutation) Fields ¶
func (m *ArticleTagMutation) 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 (*ArticleTagMutation) ID ¶
func (m *ArticleTagMutation) ID() (id uuid.UUID, 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 (*ArticleTagMutation) IDs ¶
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 (*ArticleTagMutation) OldArticleID ¶
OldArticleID returns the old "article_id" field's value of the ArticleTag entity. If the ArticleTag 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 (*ArticleTagMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the ArticleTag entity. If the ArticleTag 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 (*ArticleTagMutation) 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 (*ArticleTagMutation) OldTag ¶
func (m *ArticleTagMutation) OldTag(ctx context.Context) (v string, err error)
OldTag returns the old "tag" field's value of the ArticleTag entity. If the ArticleTag 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 (*ArticleTagMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the ArticleTag entity. If the ArticleTag 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 (*ArticleTagMutation) RemovedEdges ¶
func (m *ArticleTagMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ArticleTagMutation) RemovedIDs ¶
func (m *ArticleTagMutation) 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 (*ArticleTagMutation) ResetArticle ¶
func (m *ArticleTagMutation) ResetArticle()
ResetArticle resets all changes to the "article" edge.
func (*ArticleTagMutation) ResetArticleID ¶
func (m *ArticleTagMutation) ResetArticleID()
ResetArticleID resets all changes to the "article_id" field.
func (*ArticleTagMutation) ResetCreatedAt ¶
func (m *ArticleTagMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ArticleTagMutation) ResetEdge ¶
func (m *ArticleTagMutation) 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 (*ArticleTagMutation) ResetField ¶
func (m *ArticleTagMutation) 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 (*ArticleTagMutation) ResetTag ¶
func (m *ArticleTagMutation) ResetTag()
ResetTag resets all changes to the "tag" field.
func (*ArticleTagMutation) ResetUpdatedAt ¶
func (m *ArticleTagMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*ArticleTagMutation) SetArticleID ¶
func (m *ArticleTagMutation) SetArticleID(u uuid.UUID)
SetArticleID sets the "article_id" field.
func (*ArticleTagMutation) SetCreatedAt ¶
func (m *ArticleTagMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ArticleTagMutation) SetField ¶
func (m *ArticleTagMutation) 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 (*ArticleTagMutation) SetID ¶
func (m *ArticleTagMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of ArticleTag entities.
func (*ArticleTagMutation) SetOp ¶
func (m *ArticleTagMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ArticleTagMutation) SetTag ¶
func (m *ArticleTagMutation) SetTag(s string)
SetTag sets the "tag" field.
func (*ArticleTagMutation) SetUpdatedAt ¶
func (m *ArticleTagMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*ArticleTagMutation) Tag ¶
func (m *ArticleTagMutation) Tag() (r string, exists bool)
Tag returns the value of the "tag" field in the mutation.
func (ArticleTagMutation) Tx ¶
func (m ArticleTagMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ArticleTagMutation) Type ¶
func (m *ArticleTagMutation) Type() string
Type returns the node type of this mutation (ArticleTag).
func (*ArticleTagMutation) UpdatedAt ¶
func (m *ArticleTagMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*ArticleTagMutation) Where ¶
func (m *ArticleTagMutation) Where(ps ...predicate.ArticleTag)
Where appends a list predicates to the ArticleTagMutation builder.
func (*ArticleTagMutation) WhereP ¶
func (m *ArticleTagMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ArticleTagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ArticleTagQuery ¶
type ArticleTagQuery struct {
// contains filtered or unexported fields
}
ArticleTagQuery is the builder for querying ArticleTag entities.
func (*ArticleTagQuery) Aggregate ¶
func (atq *ArticleTagQuery) Aggregate(fns ...AggregateFunc) *ArticleTagSelect
Aggregate returns a ArticleTagSelect configured with the given aggregations.
func (*ArticleTagQuery) All ¶
func (atq *ArticleTagQuery) All(ctx context.Context) ([]*ArticleTag, error)
All executes the query and returns a list of ArticleTags.
func (*ArticleTagQuery) AllX ¶
func (atq *ArticleTagQuery) AllX(ctx context.Context) []*ArticleTag
AllX is like All, but panics if an error occurs.
func (*ArticleTagQuery) Clone ¶
func (atq *ArticleTagQuery) Clone() *ArticleTagQuery
Clone returns a duplicate of the ArticleTagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ArticleTagQuery) Count ¶
func (atq *ArticleTagQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ArticleTagQuery) CountX ¶
func (atq *ArticleTagQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ArticleTagQuery) Exist ¶
func (atq *ArticleTagQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ArticleTagQuery) ExistX ¶
func (atq *ArticleTagQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ArticleTagQuery) First ¶
func (atq *ArticleTagQuery) First(ctx context.Context) (*ArticleTag, error)
First returns the first ArticleTag entity from the query. Returns a *NotFoundError when no ArticleTag was found.
func (*ArticleTagQuery) FirstID ¶
FirstID returns the first ArticleTag ID from the query. Returns a *NotFoundError when no ArticleTag ID was found.
func (*ArticleTagQuery) FirstIDX ¶
func (atq *ArticleTagQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*ArticleTagQuery) FirstX ¶
func (atq *ArticleTagQuery) FirstX(ctx context.Context) *ArticleTag
FirstX is like First, but panics if an error occurs.
func (*ArticleTagQuery) GroupBy ¶
func (atq *ArticleTagQuery) GroupBy(field string, fields ...string) *ArticleTagGroupBy
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 { Tag string `json:"tag,omitempty"` Count int `json:"count,omitempty"` } client.ArticleTag.Query(). GroupBy(articletag.FieldTag). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ArticleTagQuery) IDsX ¶
func (atq *ArticleTagQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*ArticleTagQuery) Limit ¶
func (atq *ArticleTagQuery) Limit(limit int) *ArticleTagQuery
Limit the number of records to be returned by this query.
func (*ArticleTagQuery) Offset ¶
func (atq *ArticleTagQuery) Offset(offset int) *ArticleTagQuery
Offset to start from.
func (*ArticleTagQuery) Only ¶
func (atq *ArticleTagQuery) Only(ctx context.Context) (*ArticleTag, error)
Only returns a single ArticleTag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ArticleTag entity is found. Returns a *NotFoundError when no ArticleTag entities are found.
func (*ArticleTagQuery) OnlyID ¶
OnlyID is like Only, but returns the only ArticleTag ID in the query. Returns a *NotSingularError when more than one ArticleTag ID is found. Returns a *NotFoundError when no entities are found.
func (*ArticleTagQuery) OnlyIDX ¶
func (atq *ArticleTagQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ArticleTagQuery) OnlyX ¶
func (atq *ArticleTagQuery) OnlyX(ctx context.Context) *ArticleTag
OnlyX is like Only, but panics if an error occurs.
func (*ArticleTagQuery) Order ¶
func (atq *ArticleTagQuery) Order(o ...OrderFunc) *ArticleTagQuery
Order specifies how the records should be ordered.
func (*ArticleTagQuery) QueryArticle ¶
func (atq *ArticleTagQuery) QueryArticle() *ArticleQuery
QueryArticle chains the current query on the "article" edge.
func (*ArticleTagQuery) Select ¶
func (atq *ArticleTagQuery) Select(fields ...string) *ArticleTagSelect
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 { Tag string `json:"tag,omitempty"` } client.ArticleTag.Query(). Select(articletag.FieldTag). Scan(ctx, &v)
func (*ArticleTagQuery) Unique ¶
func (atq *ArticleTagQuery) Unique(unique bool) *ArticleTagQuery
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 (*ArticleTagQuery) Where ¶
func (atq *ArticleTagQuery) Where(ps ...predicate.ArticleTag) *ArticleTagQuery
Where adds a new predicate for the ArticleTagQuery builder.
func (*ArticleTagQuery) WithArticle ¶
func (atq *ArticleTagQuery) WithArticle(opts ...func(*ArticleQuery)) *ArticleTagQuery
WithArticle tells the query-builder to eager-load the nodes that are connected to the "article" edge. The optional arguments are used to configure the query builder of the edge.
type ArticleTagSelect ¶
type ArticleTagSelect struct { *ArticleTagQuery // contains filtered or unexported fields }
ArticleTagSelect is the builder for selecting fields of ArticleTag entities.
func (*ArticleTagSelect) Aggregate ¶
func (ats *ArticleTagSelect) Aggregate(fns ...AggregateFunc) *ArticleTagSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ArticleTagSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ArticleTagSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ArticleTagSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ArticleTagSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ArticleTagSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ArticleTagSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ArticleTagSelect) Scan ¶
func (ats *ArticleTagSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ArticleTagSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ArticleTagUpdate ¶
type ArticleTagUpdate struct {
// contains filtered or unexported fields
}
ArticleTagUpdate is the builder for updating ArticleTag entities.
func (*ArticleTagUpdate) ClearArticle ¶
func (atu *ArticleTagUpdate) ClearArticle() *ArticleTagUpdate
ClearArticle clears the "article" edge to the Article entity.
func (*ArticleTagUpdate) Exec ¶
func (atu *ArticleTagUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleTagUpdate) ExecX ¶
func (atu *ArticleTagUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleTagUpdate) Mutation ¶
func (atu *ArticleTagUpdate) Mutation() *ArticleTagMutation
Mutation returns the ArticleTagMutation object of the builder.
func (*ArticleTagUpdate) Save ¶
func (atu *ArticleTagUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ArticleTagUpdate) SaveX ¶
func (atu *ArticleTagUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ArticleTagUpdate) SetArticle ¶
func (atu *ArticleTagUpdate) SetArticle(a *Article) *ArticleTagUpdate
SetArticle sets the "article" edge to the Article entity.
func (*ArticleTagUpdate) SetArticleID ¶
func (atu *ArticleTagUpdate) SetArticleID(u uuid.UUID) *ArticleTagUpdate
SetArticleID sets the "article_id" field.
func (*ArticleTagUpdate) SetCreatedAt ¶
func (atu *ArticleTagUpdate) SetCreatedAt(t time.Time) *ArticleTagUpdate
SetCreatedAt sets the "created_at" field.
func (*ArticleTagUpdate) SetNillableCreatedAt ¶
func (atu *ArticleTagUpdate) SetNillableCreatedAt(t *time.Time) *ArticleTagUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ArticleTagUpdate) SetTag ¶
func (atu *ArticleTagUpdate) SetTag(s string) *ArticleTagUpdate
SetTag sets the "tag" field.
func (*ArticleTagUpdate) SetUpdatedAt ¶
func (atu *ArticleTagUpdate) SetUpdatedAt(t time.Time) *ArticleTagUpdate
SetUpdatedAt sets the "updated_at" field.
func (*ArticleTagUpdate) Where ¶
func (atu *ArticleTagUpdate) Where(ps ...predicate.ArticleTag) *ArticleTagUpdate
Where appends a list predicates to the ArticleTagUpdate builder.
type ArticleTagUpdateOne ¶
type ArticleTagUpdateOne struct {
// contains filtered or unexported fields
}
ArticleTagUpdateOne is the builder for updating a single ArticleTag entity.
func (*ArticleTagUpdateOne) ClearArticle ¶
func (atuo *ArticleTagUpdateOne) ClearArticle() *ArticleTagUpdateOne
ClearArticle clears the "article" edge to the Article entity.
func (*ArticleTagUpdateOne) Exec ¶
func (atuo *ArticleTagUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ArticleTagUpdateOne) ExecX ¶
func (atuo *ArticleTagUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleTagUpdateOne) Mutation ¶
func (atuo *ArticleTagUpdateOne) Mutation() *ArticleTagMutation
Mutation returns the ArticleTagMutation object of the builder.
func (*ArticleTagUpdateOne) Save ¶
func (atuo *ArticleTagUpdateOne) Save(ctx context.Context) (*ArticleTag, error)
Save executes the query and returns the updated ArticleTag entity.
func (*ArticleTagUpdateOne) SaveX ¶
func (atuo *ArticleTagUpdateOne) SaveX(ctx context.Context) *ArticleTag
SaveX is like Save, but panics if an error occurs.
func (*ArticleTagUpdateOne) Select ¶
func (atuo *ArticleTagUpdateOne) Select(field string, fields ...string) *ArticleTagUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ArticleTagUpdateOne) SetArticle ¶
func (atuo *ArticleTagUpdateOne) SetArticle(a *Article) *ArticleTagUpdateOne
SetArticle sets the "article" edge to the Article entity.
func (*ArticleTagUpdateOne) SetArticleID ¶
func (atuo *ArticleTagUpdateOne) SetArticleID(u uuid.UUID) *ArticleTagUpdateOne
SetArticleID sets the "article_id" field.
func (*ArticleTagUpdateOne) SetCreatedAt ¶
func (atuo *ArticleTagUpdateOne) SetCreatedAt(t time.Time) *ArticleTagUpdateOne
SetCreatedAt sets the "created_at" field.
func (*ArticleTagUpdateOne) SetNillableCreatedAt ¶
func (atuo *ArticleTagUpdateOne) SetNillableCreatedAt(t *time.Time) *ArticleTagUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ArticleTagUpdateOne) SetTag ¶
func (atuo *ArticleTagUpdateOne) SetTag(s string) *ArticleTagUpdateOne
SetTag sets the "tag" field.
func (*ArticleTagUpdateOne) SetUpdatedAt ¶
func (atuo *ArticleTagUpdateOne) SetUpdatedAt(t time.Time) *ArticleTagUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*ArticleTagUpdateOne) Where ¶
func (atuo *ArticleTagUpdateOne) Where(ps ...predicate.ArticleTag) *ArticleTagUpdateOne
Where appends a list predicates to the ArticleTagUpdate builder.
type ArticleTagUpsert ¶
ArticleTagUpsert is the "OnConflict" setter.
func (*ArticleTagUpsert) SetArticleID ¶
func (u *ArticleTagUpsert) SetArticleID(v uuid.UUID) *ArticleTagUpsert
SetArticleID sets the "article_id" field.
func (*ArticleTagUpsert) SetCreatedAt ¶
func (u *ArticleTagUpsert) SetCreatedAt(v time.Time) *ArticleTagUpsert
SetCreatedAt sets the "created_at" field.
func (*ArticleTagUpsert) SetTag ¶
func (u *ArticleTagUpsert) SetTag(v string) *ArticleTagUpsert
SetTag sets the "tag" field.
func (*ArticleTagUpsert) SetUpdatedAt ¶
func (u *ArticleTagUpsert) SetUpdatedAt(v time.Time) *ArticleTagUpsert
SetUpdatedAt sets the "updated_at" field.
func (*ArticleTagUpsert) UpdateArticleID ¶
func (u *ArticleTagUpsert) UpdateArticleID() *ArticleTagUpsert
UpdateArticleID sets the "article_id" field to the value that was provided on create.
func (*ArticleTagUpsert) UpdateCreatedAt ¶
func (u *ArticleTagUpsert) UpdateCreatedAt() *ArticleTagUpsert
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*ArticleTagUpsert) UpdateTag ¶
func (u *ArticleTagUpsert) UpdateTag() *ArticleTagUpsert
UpdateTag sets the "tag" field to the value that was provided on create.
func (*ArticleTagUpsert) UpdateUpdatedAt ¶
func (u *ArticleTagUpsert) UpdateUpdatedAt() *ArticleTagUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type ArticleTagUpsertBulk ¶
type ArticleTagUpsertBulk struct {
// contains filtered or unexported fields
}
ArticleTagUpsertBulk is the builder for "upsert"-ing a bulk of ArticleTag nodes.
func (*ArticleTagUpsertBulk) DoNothing ¶
func (u *ArticleTagUpsertBulk) DoNothing() *ArticleTagUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ArticleTagUpsertBulk) Exec ¶
func (u *ArticleTagUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleTagUpsertBulk) ExecX ¶
func (u *ArticleTagUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleTagUpsertBulk) Ignore ¶
func (u *ArticleTagUpsertBulk) Ignore() *ArticleTagUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.ArticleTag.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ArticleTagUpsertBulk) SetArticleID ¶
func (u *ArticleTagUpsertBulk) SetArticleID(v uuid.UUID) *ArticleTagUpsertBulk
SetArticleID sets the "article_id" field.
func (*ArticleTagUpsertBulk) SetCreatedAt ¶
func (u *ArticleTagUpsertBulk) SetCreatedAt(v time.Time) *ArticleTagUpsertBulk
SetCreatedAt sets the "created_at" field.
func (*ArticleTagUpsertBulk) SetTag ¶
func (u *ArticleTagUpsertBulk) SetTag(v string) *ArticleTagUpsertBulk
SetTag sets the "tag" field.
func (*ArticleTagUpsertBulk) SetUpdatedAt ¶
func (u *ArticleTagUpsertBulk) SetUpdatedAt(v time.Time) *ArticleTagUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*ArticleTagUpsertBulk) Update ¶
func (u *ArticleTagUpsertBulk) Update(set func(*ArticleTagUpsert)) *ArticleTagUpsertBulk
Update allows overriding fields `UPDATE` values. See the ArticleTagCreateBulk.OnConflict documentation for more info.
func (*ArticleTagUpsertBulk) UpdateArticleID ¶
func (u *ArticleTagUpsertBulk) UpdateArticleID() *ArticleTagUpsertBulk
UpdateArticleID sets the "article_id" field to the value that was provided on create.
func (*ArticleTagUpsertBulk) UpdateCreatedAt ¶
func (u *ArticleTagUpsertBulk) UpdateCreatedAt() *ArticleTagUpsertBulk
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*ArticleTagUpsertBulk) UpdateNewValues ¶
func (u *ArticleTagUpsertBulk) UpdateNewValues() *ArticleTagUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.ArticleTag.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(articletag.FieldID) }), ). Exec(ctx)
func (*ArticleTagUpsertBulk) UpdateTag ¶
func (u *ArticleTagUpsertBulk) UpdateTag() *ArticleTagUpsertBulk
UpdateTag sets the "tag" field to the value that was provided on create.
func (*ArticleTagUpsertBulk) UpdateUpdatedAt ¶
func (u *ArticleTagUpsertBulk) UpdateUpdatedAt() *ArticleTagUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type ArticleTagUpsertOne ¶
type ArticleTagUpsertOne struct {
// contains filtered or unexported fields
}
ArticleTagUpsertOne is the builder for "upsert"-ing
one ArticleTag node.
func (*ArticleTagUpsertOne) DoNothing ¶
func (u *ArticleTagUpsertOne) DoNothing() *ArticleTagUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ArticleTagUpsertOne) Exec ¶
func (u *ArticleTagUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleTagUpsertOne) ExecX ¶
func (u *ArticleTagUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleTagUpsertOne) ID ¶
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*ArticleTagUpsertOne) IDX ¶
func (u *ArticleTagUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*ArticleTagUpsertOne) Ignore ¶
func (u *ArticleTagUpsertOne) Ignore() *ArticleTagUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.ArticleTag.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ArticleTagUpsertOne) SetArticleID ¶
func (u *ArticleTagUpsertOne) SetArticleID(v uuid.UUID) *ArticleTagUpsertOne
SetArticleID sets the "article_id" field.
func (*ArticleTagUpsertOne) SetCreatedAt ¶
func (u *ArticleTagUpsertOne) SetCreatedAt(v time.Time) *ArticleTagUpsertOne
SetCreatedAt sets the "created_at" field.
func (*ArticleTagUpsertOne) SetTag ¶
func (u *ArticleTagUpsertOne) SetTag(v string) *ArticleTagUpsertOne
SetTag sets the "tag" field.
func (*ArticleTagUpsertOne) SetUpdatedAt ¶
func (u *ArticleTagUpsertOne) SetUpdatedAt(v time.Time) *ArticleTagUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*ArticleTagUpsertOne) Update ¶
func (u *ArticleTagUpsertOne) Update(set func(*ArticleTagUpsert)) *ArticleTagUpsertOne
Update allows overriding fields `UPDATE` values. See the ArticleTagCreate.OnConflict documentation for more info.
func (*ArticleTagUpsertOne) UpdateArticleID ¶
func (u *ArticleTagUpsertOne) UpdateArticleID() *ArticleTagUpsertOne
UpdateArticleID sets the "article_id" field to the value that was provided on create.
func (*ArticleTagUpsertOne) UpdateCreatedAt ¶
func (u *ArticleTagUpsertOne) UpdateCreatedAt() *ArticleTagUpsertOne
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*ArticleTagUpsertOne) UpdateNewValues ¶
func (u *ArticleTagUpsertOne) UpdateNewValues() *ArticleTagUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.ArticleTag.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(articletag.FieldID) }), ). Exec(ctx)
func (*ArticleTagUpsertOne) UpdateTag ¶
func (u *ArticleTagUpsertOne) UpdateTag() *ArticleTagUpsertOne
UpdateTag sets the "tag" field to the value that was provided on create.
func (*ArticleTagUpsertOne) UpdateUpdatedAt ¶
func (u *ArticleTagUpsertOne) UpdateUpdatedAt() *ArticleTagUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type ArticleUpdate ¶
type ArticleUpdate struct {
// contains filtered or unexported fields
}
ArticleUpdate is the builder for updating Article entities.
func (*ArticleUpdate) AddReadArticleIDs ¶
func (au *ArticleUpdate) AddReadArticleIDs(ids ...uuid.UUID) *ArticleUpdate
AddReadArticleIDs adds the "read_articles" edge to the ReadArticle entity by IDs.
func (*ArticleUpdate) AddReadArticles ¶
func (au *ArticleUpdate) AddReadArticles(r ...*ReadArticle) *ArticleUpdate
AddReadArticles adds the "read_articles" edges to the ReadArticle entity.
func (*ArticleUpdate) AddTagIDs ¶
func (au *ArticleUpdate) AddTagIDs(ids ...uuid.UUID) *ArticleUpdate
AddTagIDs adds the "tags" edge to the ArticleTag entity by IDs.
func (*ArticleUpdate) AddTags ¶
func (au *ArticleUpdate) AddTags(a ...*ArticleTag) *ArticleUpdate
AddTags adds the "tags" edges to the ArticleTag entity.
func (*ArticleUpdate) ClearDeletedAt ¶
func (au *ArticleUpdate) ClearDeletedAt() *ArticleUpdate
ClearDeletedAt clears the value of the "deleted_at" field.
func (*ArticleUpdate) ClearReadArticles ¶
func (au *ArticleUpdate) ClearReadArticles() *ArticleUpdate
ClearReadArticles clears all "read_articles" edges to the ReadArticle entity.
func (*ArticleUpdate) ClearTags ¶
func (au *ArticleUpdate) ClearTags() *ArticleUpdate
ClearTags clears all "tags" edges to the ArticleTag entity.
func (*ArticleUpdate) Exec ¶
func (au *ArticleUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleUpdate) ExecX ¶
func (au *ArticleUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleUpdate) Mutation ¶
func (au *ArticleUpdate) Mutation() *ArticleMutation
Mutation returns the ArticleMutation object of the builder.
func (*ArticleUpdate) RemoveReadArticleIDs ¶
func (au *ArticleUpdate) RemoveReadArticleIDs(ids ...uuid.UUID) *ArticleUpdate
RemoveReadArticleIDs removes the "read_articles" edge to ReadArticle entities by IDs.
func (*ArticleUpdate) RemoveReadArticles ¶
func (au *ArticleUpdate) RemoveReadArticles(r ...*ReadArticle) *ArticleUpdate
RemoveReadArticles removes "read_articles" edges to ReadArticle entities.
func (*ArticleUpdate) RemoveTagIDs ¶
func (au *ArticleUpdate) RemoveTagIDs(ids ...uuid.UUID) *ArticleUpdate
RemoveTagIDs removes the "tags" edge to ArticleTag entities by IDs.
func (*ArticleUpdate) RemoveTags ¶
func (au *ArticleUpdate) RemoveTags(a ...*ArticleTag) *ArticleUpdate
RemoveTags removes "tags" edges to ArticleTag entities.
func (*ArticleUpdate) Save ¶
func (au *ArticleUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ArticleUpdate) SaveX ¶
func (au *ArticleUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ArticleUpdate) SetCreatedAt ¶
func (au *ArticleUpdate) SetCreatedAt(t time.Time) *ArticleUpdate
SetCreatedAt sets the "created_at" field.
func (*ArticleUpdate) SetDeletedAt ¶
func (au *ArticleUpdate) SetDeletedAt(t time.Time) *ArticleUpdate
SetDeletedAt sets the "deleted_at" field.
func (*ArticleUpdate) SetDescription ¶
func (au *ArticleUpdate) SetDescription(s string) *ArticleUpdate
SetDescription sets the "description" field.
func (*ArticleUpdate) SetNillableCreatedAt ¶
func (au *ArticleUpdate) SetNillableCreatedAt(t *time.Time) *ArticleUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ArticleUpdate) SetNillableDeletedAt ¶
func (au *ArticleUpdate) SetNillableDeletedAt(t *time.Time) *ArticleUpdate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*ArticleUpdate) SetThumbnail ¶
func (au *ArticleUpdate) SetThumbnail(s string) *ArticleUpdate
SetThumbnail sets the "thumbnail" field.
func (*ArticleUpdate) SetTitle ¶
func (au *ArticleUpdate) SetTitle(s string) *ArticleUpdate
SetTitle sets the "title" field.
func (*ArticleUpdate) SetURL ¶
func (au *ArticleUpdate) SetURL(s string) *ArticleUpdate
SetURL sets the "url" field.
func (*ArticleUpdate) SetUpdatedAt ¶
func (au *ArticleUpdate) SetUpdatedAt(t time.Time) *ArticleUpdate
SetUpdatedAt sets the "updated_at" field.
func (*ArticleUpdate) Where ¶
func (au *ArticleUpdate) Where(ps ...predicate.Article) *ArticleUpdate
Where appends a list predicates to the ArticleUpdate builder.
type ArticleUpdateOne ¶
type ArticleUpdateOne struct {
// contains filtered or unexported fields
}
ArticleUpdateOne is the builder for updating a single Article entity.
func (*ArticleUpdateOne) AddReadArticleIDs ¶
func (auo *ArticleUpdateOne) AddReadArticleIDs(ids ...uuid.UUID) *ArticleUpdateOne
AddReadArticleIDs adds the "read_articles" edge to the ReadArticle entity by IDs.
func (*ArticleUpdateOne) AddReadArticles ¶
func (auo *ArticleUpdateOne) AddReadArticles(r ...*ReadArticle) *ArticleUpdateOne
AddReadArticles adds the "read_articles" edges to the ReadArticle entity.
func (*ArticleUpdateOne) AddTagIDs ¶
func (auo *ArticleUpdateOne) AddTagIDs(ids ...uuid.UUID) *ArticleUpdateOne
AddTagIDs adds the "tags" edge to the ArticleTag entity by IDs.
func (*ArticleUpdateOne) AddTags ¶
func (auo *ArticleUpdateOne) AddTags(a ...*ArticleTag) *ArticleUpdateOne
AddTags adds the "tags" edges to the ArticleTag entity.
func (*ArticleUpdateOne) ClearDeletedAt ¶
func (auo *ArticleUpdateOne) ClearDeletedAt() *ArticleUpdateOne
ClearDeletedAt clears the value of the "deleted_at" field.
func (*ArticleUpdateOne) ClearReadArticles ¶
func (auo *ArticleUpdateOne) ClearReadArticles() *ArticleUpdateOne
ClearReadArticles clears all "read_articles" edges to the ReadArticle entity.
func (*ArticleUpdateOne) ClearTags ¶
func (auo *ArticleUpdateOne) ClearTags() *ArticleUpdateOne
ClearTags clears all "tags" edges to the ArticleTag entity.
func (*ArticleUpdateOne) Exec ¶
func (auo *ArticleUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ArticleUpdateOne) ExecX ¶
func (auo *ArticleUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleUpdateOne) Mutation ¶
func (auo *ArticleUpdateOne) Mutation() *ArticleMutation
Mutation returns the ArticleMutation object of the builder.
func (*ArticleUpdateOne) RemoveReadArticleIDs ¶
func (auo *ArticleUpdateOne) RemoveReadArticleIDs(ids ...uuid.UUID) *ArticleUpdateOne
RemoveReadArticleIDs removes the "read_articles" edge to ReadArticle entities by IDs.
func (*ArticleUpdateOne) RemoveReadArticles ¶
func (auo *ArticleUpdateOne) RemoveReadArticles(r ...*ReadArticle) *ArticleUpdateOne
RemoveReadArticles removes "read_articles" edges to ReadArticle entities.
func (*ArticleUpdateOne) RemoveTagIDs ¶
func (auo *ArticleUpdateOne) RemoveTagIDs(ids ...uuid.UUID) *ArticleUpdateOne
RemoveTagIDs removes the "tags" edge to ArticleTag entities by IDs.
func (*ArticleUpdateOne) RemoveTags ¶
func (auo *ArticleUpdateOne) RemoveTags(a ...*ArticleTag) *ArticleUpdateOne
RemoveTags removes "tags" edges to ArticleTag entities.
func (*ArticleUpdateOne) Save ¶
func (auo *ArticleUpdateOne) Save(ctx context.Context) (*Article, error)
Save executes the query and returns the updated Article entity.
func (*ArticleUpdateOne) SaveX ¶
func (auo *ArticleUpdateOne) SaveX(ctx context.Context) *Article
SaveX is like Save, but panics if an error occurs.
func (*ArticleUpdateOne) Select ¶
func (auo *ArticleUpdateOne) Select(field string, fields ...string) *ArticleUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ArticleUpdateOne) SetCreatedAt ¶
func (auo *ArticleUpdateOne) SetCreatedAt(t time.Time) *ArticleUpdateOne
SetCreatedAt sets the "created_at" field.
func (*ArticleUpdateOne) SetDeletedAt ¶
func (auo *ArticleUpdateOne) SetDeletedAt(t time.Time) *ArticleUpdateOne
SetDeletedAt sets the "deleted_at" field.
func (*ArticleUpdateOne) SetDescription ¶
func (auo *ArticleUpdateOne) SetDescription(s string) *ArticleUpdateOne
SetDescription sets the "description" field.
func (*ArticleUpdateOne) SetNillableCreatedAt ¶
func (auo *ArticleUpdateOne) SetNillableCreatedAt(t *time.Time) *ArticleUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ArticleUpdateOne) SetNillableDeletedAt ¶
func (auo *ArticleUpdateOne) SetNillableDeletedAt(t *time.Time) *ArticleUpdateOne
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*ArticleUpdateOne) SetThumbnail ¶
func (auo *ArticleUpdateOne) SetThumbnail(s string) *ArticleUpdateOne
SetThumbnail sets the "thumbnail" field.
func (*ArticleUpdateOne) SetTitle ¶
func (auo *ArticleUpdateOne) SetTitle(s string) *ArticleUpdateOne
SetTitle sets the "title" field.
func (*ArticleUpdateOne) SetURL ¶
func (auo *ArticleUpdateOne) SetURL(s string) *ArticleUpdateOne
SetURL sets the "url" field.
func (*ArticleUpdateOne) SetUpdatedAt ¶
func (auo *ArticleUpdateOne) SetUpdatedAt(t time.Time) *ArticleUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*ArticleUpdateOne) Where ¶
func (auo *ArticleUpdateOne) Where(ps ...predicate.Article) *ArticleUpdateOne
Where appends a list predicates to the ArticleUpdate builder.
type ArticleUpsert ¶
ArticleUpsert is the "OnConflict" setter.
func (*ArticleUpsert) ClearDeletedAt ¶
func (u *ArticleUpsert) ClearDeletedAt() *ArticleUpsert
ClearDeletedAt clears the value of the "deleted_at" field.
func (*ArticleUpsert) SetCreatedAt ¶
func (u *ArticleUpsert) SetCreatedAt(v time.Time) *ArticleUpsert
SetCreatedAt sets the "created_at" field.
func (*ArticleUpsert) SetDeletedAt ¶
func (u *ArticleUpsert) SetDeletedAt(v time.Time) *ArticleUpsert
SetDeletedAt sets the "deleted_at" field.
func (*ArticleUpsert) SetDescription ¶
func (u *ArticleUpsert) SetDescription(v string) *ArticleUpsert
SetDescription sets the "description" field.
func (*ArticleUpsert) SetThumbnail ¶
func (u *ArticleUpsert) SetThumbnail(v string) *ArticleUpsert
SetThumbnail sets the "thumbnail" field.
func (*ArticleUpsert) SetTitle ¶
func (u *ArticleUpsert) SetTitle(v string) *ArticleUpsert
SetTitle sets the "title" field.
func (*ArticleUpsert) SetURL ¶
func (u *ArticleUpsert) SetURL(v string) *ArticleUpsert
SetURL sets the "url" field.
func (*ArticleUpsert) SetUpdatedAt ¶
func (u *ArticleUpsert) SetUpdatedAt(v time.Time) *ArticleUpsert
SetUpdatedAt sets the "updated_at" field.
func (*ArticleUpsert) UpdateCreatedAt ¶
func (u *ArticleUpsert) UpdateCreatedAt() *ArticleUpsert
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*ArticleUpsert) UpdateDeletedAt ¶
func (u *ArticleUpsert) UpdateDeletedAt() *ArticleUpsert
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*ArticleUpsert) UpdateDescription ¶
func (u *ArticleUpsert) UpdateDescription() *ArticleUpsert
UpdateDescription sets the "description" field to the value that was provided on create.
func (*ArticleUpsert) UpdateThumbnail ¶
func (u *ArticleUpsert) UpdateThumbnail() *ArticleUpsert
UpdateThumbnail sets the "thumbnail" field to the value that was provided on create.
func (*ArticleUpsert) UpdateTitle ¶
func (u *ArticleUpsert) UpdateTitle() *ArticleUpsert
UpdateTitle sets the "title" field to the value that was provided on create.
func (*ArticleUpsert) UpdateURL ¶
func (u *ArticleUpsert) UpdateURL() *ArticleUpsert
UpdateURL sets the "url" field to the value that was provided on create.
func (*ArticleUpsert) UpdateUpdatedAt ¶
func (u *ArticleUpsert) UpdateUpdatedAt() *ArticleUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type ArticleUpsertBulk ¶
type ArticleUpsertBulk struct {
// contains filtered or unexported fields
}
ArticleUpsertBulk is the builder for "upsert"-ing a bulk of Article nodes.
func (*ArticleUpsertBulk) ClearDeletedAt ¶
func (u *ArticleUpsertBulk) ClearDeletedAt() *ArticleUpsertBulk
ClearDeletedAt clears the value of the "deleted_at" field.
func (*ArticleUpsertBulk) DoNothing ¶
func (u *ArticleUpsertBulk) DoNothing() *ArticleUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ArticleUpsertBulk) Exec ¶
func (u *ArticleUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleUpsertBulk) ExecX ¶
func (u *ArticleUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleUpsertBulk) Ignore ¶
func (u *ArticleUpsertBulk) Ignore() *ArticleUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Article.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ArticleUpsertBulk) SetCreatedAt ¶
func (u *ArticleUpsertBulk) SetCreatedAt(v time.Time) *ArticleUpsertBulk
SetCreatedAt sets the "created_at" field.
func (*ArticleUpsertBulk) SetDeletedAt ¶
func (u *ArticleUpsertBulk) SetDeletedAt(v time.Time) *ArticleUpsertBulk
SetDeletedAt sets the "deleted_at" field.
func (*ArticleUpsertBulk) SetDescription ¶
func (u *ArticleUpsertBulk) SetDescription(v string) *ArticleUpsertBulk
SetDescription sets the "description" field.
func (*ArticleUpsertBulk) SetThumbnail ¶
func (u *ArticleUpsertBulk) SetThumbnail(v string) *ArticleUpsertBulk
SetThumbnail sets the "thumbnail" field.
func (*ArticleUpsertBulk) SetTitle ¶
func (u *ArticleUpsertBulk) SetTitle(v string) *ArticleUpsertBulk
SetTitle sets the "title" field.
func (*ArticleUpsertBulk) SetURL ¶
func (u *ArticleUpsertBulk) SetURL(v string) *ArticleUpsertBulk
SetURL sets the "url" field.
func (*ArticleUpsertBulk) SetUpdatedAt ¶
func (u *ArticleUpsertBulk) SetUpdatedAt(v time.Time) *ArticleUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*ArticleUpsertBulk) Update ¶
func (u *ArticleUpsertBulk) Update(set func(*ArticleUpsert)) *ArticleUpsertBulk
Update allows overriding fields `UPDATE` values. See the ArticleCreateBulk.OnConflict documentation for more info.
func (*ArticleUpsertBulk) UpdateCreatedAt ¶
func (u *ArticleUpsertBulk) UpdateCreatedAt() *ArticleUpsertBulk
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*ArticleUpsertBulk) UpdateDeletedAt ¶
func (u *ArticleUpsertBulk) UpdateDeletedAt() *ArticleUpsertBulk
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*ArticleUpsertBulk) UpdateDescription ¶
func (u *ArticleUpsertBulk) UpdateDescription() *ArticleUpsertBulk
UpdateDescription sets the "description" field to the value that was provided on create.
func (*ArticleUpsertBulk) UpdateNewValues ¶
func (u *ArticleUpsertBulk) UpdateNewValues() *ArticleUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Article.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(article.FieldID) }), ). Exec(ctx)
func (*ArticleUpsertBulk) UpdateThumbnail ¶
func (u *ArticleUpsertBulk) UpdateThumbnail() *ArticleUpsertBulk
UpdateThumbnail sets the "thumbnail" field to the value that was provided on create.
func (*ArticleUpsertBulk) UpdateTitle ¶
func (u *ArticleUpsertBulk) UpdateTitle() *ArticleUpsertBulk
UpdateTitle sets the "title" field to the value that was provided on create.
func (*ArticleUpsertBulk) UpdateURL ¶
func (u *ArticleUpsertBulk) UpdateURL() *ArticleUpsertBulk
UpdateURL sets the "url" field to the value that was provided on create.
func (*ArticleUpsertBulk) UpdateUpdatedAt ¶
func (u *ArticleUpsertBulk) UpdateUpdatedAt() *ArticleUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type ArticleUpsertOne ¶
type ArticleUpsertOne struct {
// contains filtered or unexported fields
}
ArticleUpsertOne is the builder for "upsert"-ing
one Article node.
func (*ArticleUpsertOne) ClearDeletedAt ¶
func (u *ArticleUpsertOne) ClearDeletedAt() *ArticleUpsertOne
ClearDeletedAt clears the value of the "deleted_at" field.
func (*ArticleUpsertOne) DoNothing ¶
func (u *ArticleUpsertOne) DoNothing() *ArticleUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ArticleUpsertOne) Exec ¶
func (u *ArticleUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleUpsertOne) ExecX ¶
func (u *ArticleUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ArticleUpsertOne) IDX ¶
func (u *ArticleUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*ArticleUpsertOne) Ignore ¶
func (u *ArticleUpsertOne) Ignore() *ArticleUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Article.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ArticleUpsertOne) SetCreatedAt ¶
func (u *ArticleUpsertOne) SetCreatedAt(v time.Time) *ArticleUpsertOne
SetCreatedAt sets the "created_at" field.
func (*ArticleUpsertOne) SetDeletedAt ¶
func (u *ArticleUpsertOne) SetDeletedAt(v time.Time) *ArticleUpsertOne
SetDeletedAt sets the "deleted_at" field.
func (*ArticleUpsertOne) SetDescription ¶
func (u *ArticleUpsertOne) SetDescription(v string) *ArticleUpsertOne
SetDescription sets the "description" field.
func (*ArticleUpsertOne) SetThumbnail ¶
func (u *ArticleUpsertOne) SetThumbnail(v string) *ArticleUpsertOne
SetThumbnail sets the "thumbnail" field.
func (*ArticleUpsertOne) SetTitle ¶
func (u *ArticleUpsertOne) SetTitle(v string) *ArticleUpsertOne
SetTitle sets the "title" field.
func (*ArticleUpsertOne) SetURL ¶
func (u *ArticleUpsertOne) SetURL(v string) *ArticleUpsertOne
SetURL sets the "url" field.
func (*ArticleUpsertOne) SetUpdatedAt ¶
func (u *ArticleUpsertOne) SetUpdatedAt(v time.Time) *ArticleUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*ArticleUpsertOne) Update ¶
func (u *ArticleUpsertOne) Update(set func(*ArticleUpsert)) *ArticleUpsertOne
Update allows overriding fields `UPDATE` values. See the ArticleCreate.OnConflict documentation for more info.
func (*ArticleUpsertOne) UpdateCreatedAt ¶
func (u *ArticleUpsertOne) UpdateCreatedAt() *ArticleUpsertOne
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*ArticleUpsertOne) UpdateDeletedAt ¶
func (u *ArticleUpsertOne) UpdateDeletedAt() *ArticleUpsertOne
UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
func (*ArticleUpsertOne) UpdateDescription ¶
func (u *ArticleUpsertOne) UpdateDescription() *ArticleUpsertOne
UpdateDescription sets the "description" field to the value that was provided on create.
func (*ArticleUpsertOne) UpdateNewValues ¶
func (u *ArticleUpsertOne) UpdateNewValues() *ArticleUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.Article.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(article.FieldID) }), ). Exec(ctx)
func (*ArticleUpsertOne) UpdateThumbnail ¶
func (u *ArticleUpsertOne) UpdateThumbnail() *ArticleUpsertOne
UpdateThumbnail sets the "thumbnail" field to the value that was provided on create.
func (*ArticleUpsertOne) UpdateTitle ¶
func (u *ArticleUpsertOne) UpdateTitle() *ArticleUpsertOne
UpdateTitle sets the "title" field to the value that was provided on create.
func (*ArticleUpsertOne) UpdateURL ¶
func (u *ArticleUpsertOne) UpdateURL() *ArticleUpsertOne
UpdateURL sets the "url" field to the value that was provided on create.
func (*ArticleUpsertOne) UpdateUpdatedAt ¶
func (u *ArticleUpsertOne) UpdateUpdatedAt() *ArticleUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Article is the client for interacting with the Article builders. Article *ArticleClient // ArticleTag is the client for interacting with the ArticleTag builders. ArticleTag *ArticleTagClient // ReadArticle is the client for interacting with the ReadArticle builders. ReadArticle *ReadArticleClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Article. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type ReadArticle ¶
type ReadArticle struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // ArticleID holds the value of the "article_id" field. ArticleID uuid.UUID `json:"article_id,omitempty"` // UserID holds the value of the "user_id" field. UserID uuid.UUID `json:"user_id,omitempty"` // ReadAt holds the value of the "read_at" field. ReadAt time.Time `json:"read_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ReadArticleQuery when eager-loading is set. Edges ReadArticleEdges `json:"edges"` // contains filtered or unexported fields }
ReadArticle is the model entity for the ReadArticle schema.
func (*ReadArticle) QueryArticle ¶
func (ra *ReadArticle) QueryArticle() *ArticleQuery
QueryArticle queries the "article" edge of the ReadArticle entity.
func (*ReadArticle) String ¶
func (ra *ReadArticle) String() string
String implements the fmt.Stringer.
func (*ReadArticle) Unwrap ¶
func (ra *ReadArticle) Unwrap() *ReadArticle
Unwrap unwraps the ReadArticle 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 (*ReadArticle) Update ¶
func (ra *ReadArticle) Update() *ReadArticleUpdateOne
Update returns a builder for updating this ReadArticle. Note that you need to call ReadArticle.Unwrap() before calling this method if this ReadArticle was returned from a transaction, and the transaction was committed or rolled back.
type ReadArticleClient ¶
type ReadArticleClient struct {
// contains filtered or unexported fields
}
ReadArticleClient is a client for the ReadArticle schema.
func NewReadArticleClient ¶
func NewReadArticleClient(c config) *ReadArticleClient
NewReadArticleClient returns a client for the ReadArticle from the given config.
func (*ReadArticleClient) Create ¶
func (c *ReadArticleClient) Create() *ReadArticleCreate
Create returns a builder for creating a ReadArticle entity.
func (*ReadArticleClient) CreateBulk ¶
func (c *ReadArticleClient) CreateBulk(builders ...*ReadArticleCreate) *ReadArticleCreateBulk
CreateBulk returns a builder for creating a bulk of ReadArticle entities.
func (*ReadArticleClient) Delete ¶
func (c *ReadArticleClient) Delete() *ReadArticleDelete
Delete returns a delete builder for ReadArticle.
func (*ReadArticleClient) DeleteOne ¶
func (c *ReadArticleClient) DeleteOne(ra *ReadArticle) *ReadArticleDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ReadArticleClient) DeleteOneID ¶
func (c *ReadArticleClient) DeleteOneID(id uuid.UUID) *ReadArticleDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ReadArticleClient) Get ¶
func (c *ReadArticleClient) Get(ctx context.Context, id uuid.UUID) (*ReadArticle, error)
Get returns a ReadArticle entity by its id.
func (*ReadArticleClient) GetX ¶
func (c *ReadArticleClient) GetX(ctx context.Context, id uuid.UUID) *ReadArticle
GetX is like Get, but panics if an error occurs.
func (*ReadArticleClient) Hooks ¶
func (c *ReadArticleClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ReadArticleClient) Intercept ¶
func (c *ReadArticleClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `readarticle.Intercept(f(g(h())))`.
func (*ReadArticleClient) Interceptors ¶
func (c *ReadArticleClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ReadArticleClient) Query ¶
func (c *ReadArticleClient) Query() *ReadArticleQuery
Query returns a query builder for ReadArticle.
func (*ReadArticleClient) QueryArticle ¶
func (c *ReadArticleClient) QueryArticle(ra *ReadArticle) *ArticleQuery
QueryArticle queries the article edge of a ReadArticle.
func (*ReadArticleClient) Update ¶
func (c *ReadArticleClient) Update() *ReadArticleUpdate
Update returns an update builder for ReadArticle.
func (*ReadArticleClient) UpdateOne ¶
func (c *ReadArticleClient) UpdateOne(ra *ReadArticle) *ReadArticleUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ReadArticleClient) UpdateOneID ¶
func (c *ReadArticleClient) UpdateOneID(id uuid.UUID) *ReadArticleUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ReadArticleClient) Use ¶
func (c *ReadArticleClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `readarticle.Hooks(f(g(h())))`.
type ReadArticleCreate ¶
type ReadArticleCreate struct {
// contains filtered or unexported fields
}
ReadArticleCreate is the builder for creating a ReadArticle entity.
func (*ReadArticleCreate) Exec ¶
func (rac *ReadArticleCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ReadArticleCreate) ExecX ¶
func (rac *ReadArticleCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ReadArticleCreate) Mutation ¶
func (rac *ReadArticleCreate) Mutation() *ReadArticleMutation
Mutation returns the ReadArticleMutation object of the builder.
func (*ReadArticleCreate) OnConflict ¶
func (rac *ReadArticleCreate) OnConflict(opts ...sql.ConflictOption) *ReadArticleUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.ReadArticle.Create(). SetArticleID(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ReadArticleUpsert) { SetArticleID(v+v). }). Exec(ctx)
func (*ReadArticleCreate) OnConflictColumns ¶
func (rac *ReadArticleCreate) OnConflictColumns(columns ...string) *ReadArticleUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.ReadArticle.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*ReadArticleCreate) Save ¶
func (rac *ReadArticleCreate) Save(ctx context.Context) (*ReadArticle, error)
Save creates the ReadArticle in the database.
func (*ReadArticleCreate) SaveX ¶
func (rac *ReadArticleCreate) SaveX(ctx context.Context) *ReadArticle
SaveX calls Save and panics if Save returns an error.
func (*ReadArticleCreate) SetArticle ¶
func (rac *ReadArticleCreate) SetArticle(a *Article) *ReadArticleCreate
SetArticle sets the "article" edge to the Article entity.
func (*ReadArticleCreate) SetArticleID ¶
func (rac *ReadArticleCreate) SetArticleID(u uuid.UUID) *ReadArticleCreate
SetArticleID sets the "article_id" field.
func (*ReadArticleCreate) SetID ¶
func (rac *ReadArticleCreate) SetID(u uuid.UUID) *ReadArticleCreate
SetID sets the "id" field.
func (*ReadArticleCreate) SetNillableID ¶
func (rac *ReadArticleCreate) SetNillableID(u *uuid.UUID) *ReadArticleCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*ReadArticleCreate) SetNillableReadAt ¶
func (rac *ReadArticleCreate) SetNillableReadAt(t *time.Time) *ReadArticleCreate
SetNillableReadAt sets the "read_at" field if the given value is not nil.
func (*ReadArticleCreate) SetReadAt ¶
func (rac *ReadArticleCreate) SetReadAt(t time.Time) *ReadArticleCreate
SetReadAt sets the "read_at" field.
func (*ReadArticleCreate) SetUserID ¶
func (rac *ReadArticleCreate) SetUserID(u uuid.UUID) *ReadArticleCreate
SetUserID sets the "user_id" field.
type ReadArticleCreateBulk ¶
type ReadArticleCreateBulk struct {
// contains filtered or unexported fields
}
ReadArticleCreateBulk is the builder for creating many ReadArticle entities in bulk.
func (*ReadArticleCreateBulk) Exec ¶
func (racb *ReadArticleCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ReadArticleCreateBulk) ExecX ¶
func (racb *ReadArticleCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ReadArticleCreateBulk) OnConflict ¶
func (racb *ReadArticleCreateBulk) OnConflict(opts ...sql.ConflictOption) *ReadArticleUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.ReadArticle.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.ReadArticleUpsert) { SetArticleID(v+v). }). Exec(ctx)
func (*ReadArticleCreateBulk) OnConflictColumns ¶
func (racb *ReadArticleCreateBulk) OnConflictColumns(columns ...string) *ReadArticleUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.ReadArticle.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*ReadArticleCreateBulk) Save ¶
func (racb *ReadArticleCreateBulk) Save(ctx context.Context) ([]*ReadArticle, error)
Save creates the ReadArticle entities in the database.
func (*ReadArticleCreateBulk) SaveX ¶
func (racb *ReadArticleCreateBulk) SaveX(ctx context.Context) []*ReadArticle
SaveX is like Save, but panics if an error occurs.
type ReadArticleDelete ¶
type ReadArticleDelete struct {
// contains filtered or unexported fields
}
ReadArticleDelete is the builder for deleting a ReadArticle entity.
func (*ReadArticleDelete) Exec ¶
func (rad *ReadArticleDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ReadArticleDelete) ExecX ¶
func (rad *ReadArticleDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ReadArticleDelete) Where ¶
func (rad *ReadArticleDelete) Where(ps ...predicate.ReadArticle) *ReadArticleDelete
Where appends a list predicates to the ReadArticleDelete builder.
type ReadArticleDeleteOne ¶
type ReadArticleDeleteOne struct {
// contains filtered or unexported fields
}
ReadArticleDeleteOne is the builder for deleting a single ReadArticle entity.
func (*ReadArticleDeleteOne) Exec ¶
func (rado *ReadArticleDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ReadArticleDeleteOne) ExecX ¶
func (rado *ReadArticleDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ReadArticleDeleteOne) Where ¶
func (rado *ReadArticleDeleteOne) Where(ps ...predicate.ReadArticle) *ReadArticleDeleteOne
Where appends a list predicates to the ReadArticleDelete builder.
type ReadArticleEdges ¶
type ReadArticleEdges struct { // Article holds the value of the article edge. Article *Article `json:"article,omitempty"` // contains filtered or unexported fields }
ReadArticleEdges holds the relations/edges for other nodes in the graph.
func (ReadArticleEdges) ArticleOrErr ¶
func (e ReadArticleEdges) ArticleOrErr() (*Article, error)
ArticleOrErr returns the Article value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ReadArticleGroupBy ¶
type ReadArticleGroupBy struct {
// contains filtered or unexported fields
}
ReadArticleGroupBy is the group-by builder for ReadArticle entities.
func (*ReadArticleGroupBy) Aggregate ¶
func (ragb *ReadArticleGroupBy) Aggregate(fns ...AggregateFunc) *ReadArticleGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ReadArticleGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ReadArticleGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ReadArticleGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ReadArticleGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ReadArticleGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ReadArticleGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ReadArticleGroupBy) Scan ¶
func (ragb *ReadArticleGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ReadArticleGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ReadArticleMutation ¶
type ReadArticleMutation struct {
// contains filtered or unexported fields
}
ReadArticleMutation represents an operation that mutates the ReadArticle nodes in the graph.
func (*ReadArticleMutation) AddField ¶
func (m *ReadArticleMutation) 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 (*ReadArticleMutation) AddedEdges ¶
func (m *ReadArticleMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ReadArticleMutation) AddedField ¶
func (m *ReadArticleMutation) 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 (*ReadArticleMutation) AddedFields ¶
func (m *ReadArticleMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ReadArticleMutation) AddedIDs ¶
func (m *ReadArticleMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ReadArticleMutation) ArticleCleared ¶
func (m *ReadArticleMutation) ArticleCleared() bool
ArticleCleared reports if the "article" edge to the Article entity was cleared.
func (*ReadArticleMutation) ArticleID ¶
func (m *ReadArticleMutation) ArticleID() (r uuid.UUID, exists bool)
ArticleID returns the value of the "article_id" field in the mutation.
func (*ReadArticleMutation) ArticleIDs ¶
func (m *ReadArticleMutation) ArticleIDs() (ids []uuid.UUID)
ArticleIDs returns the "article" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ArticleID instead. It exists only for internal usage by the builders.
func (*ReadArticleMutation) ClearArticle ¶
func (m *ReadArticleMutation) ClearArticle()
ClearArticle clears the "article" edge to the Article entity.
func (*ReadArticleMutation) ClearEdge ¶
func (m *ReadArticleMutation) 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 (*ReadArticleMutation) ClearField ¶
func (m *ReadArticleMutation) 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 (*ReadArticleMutation) ClearedEdges ¶
func (m *ReadArticleMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ReadArticleMutation) ClearedFields ¶
func (m *ReadArticleMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ReadArticleMutation) Client ¶
func (m ReadArticleMutation) 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 (*ReadArticleMutation) EdgeCleared ¶
func (m *ReadArticleMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ReadArticleMutation) Field ¶
func (m *ReadArticleMutation) 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 (*ReadArticleMutation) FieldCleared ¶
func (m *ReadArticleMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ReadArticleMutation) Fields ¶
func (m *ReadArticleMutation) 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 (*ReadArticleMutation) ID ¶
func (m *ReadArticleMutation) ID() (id uuid.UUID, 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 (*ReadArticleMutation) IDs ¶
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 (*ReadArticleMutation) OldArticleID ¶
OldArticleID returns the old "article_id" field's value of the ReadArticle entity. If the ReadArticle 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 (*ReadArticleMutation) 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 (*ReadArticleMutation) OldReadAt ¶
OldReadAt returns the old "read_at" field's value of the ReadArticle entity. If the ReadArticle 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 (*ReadArticleMutation) OldUserID ¶
OldUserID returns the old "user_id" field's value of the ReadArticle entity. If the ReadArticle 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 (*ReadArticleMutation) Op ¶
func (m *ReadArticleMutation) Op() Op
Op returns the operation name.
func (*ReadArticleMutation) ReadAt ¶
func (m *ReadArticleMutation) ReadAt() (r time.Time, exists bool)
ReadAt returns the value of the "read_at" field in the mutation.
func (*ReadArticleMutation) RemovedEdges ¶
func (m *ReadArticleMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ReadArticleMutation) RemovedIDs ¶
func (m *ReadArticleMutation) 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 (*ReadArticleMutation) ResetArticle ¶
func (m *ReadArticleMutation) ResetArticle()
ResetArticle resets all changes to the "article" edge.
func (*ReadArticleMutation) ResetArticleID ¶
func (m *ReadArticleMutation) ResetArticleID()
ResetArticleID resets all changes to the "article_id" field.
func (*ReadArticleMutation) ResetEdge ¶
func (m *ReadArticleMutation) 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 (*ReadArticleMutation) ResetField ¶
func (m *ReadArticleMutation) 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 (*ReadArticleMutation) ResetReadAt ¶
func (m *ReadArticleMutation) ResetReadAt()
ResetReadAt resets all changes to the "read_at" field.
func (*ReadArticleMutation) ResetUserID ¶
func (m *ReadArticleMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*ReadArticleMutation) SetArticleID ¶
func (m *ReadArticleMutation) SetArticleID(u uuid.UUID)
SetArticleID sets the "article_id" field.
func (*ReadArticleMutation) SetField ¶
func (m *ReadArticleMutation) 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 (*ReadArticleMutation) SetID ¶
func (m *ReadArticleMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of ReadArticle entities.
func (*ReadArticleMutation) SetOp ¶
func (m *ReadArticleMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ReadArticleMutation) SetReadAt ¶
func (m *ReadArticleMutation) SetReadAt(t time.Time)
SetReadAt sets the "read_at" field.
func (*ReadArticleMutation) SetUserID ¶
func (m *ReadArticleMutation) SetUserID(u uuid.UUID)
SetUserID sets the "user_id" field.
func (ReadArticleMutation) Tx ¶
func (m ReadArticleMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ReadArticleMutation) Type ¶
func (m *ReadArticleMutation) Type() string
Type returns the node type of this mutation (ReadArticle).
func (*ReadArticleMutation) UserID ¶
func (m *ReadArticleMutation) UserID() (r uuid.UUID, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*ReadArticleMutation) Where ¶
func (m *ReadArticleMutation) Where(ps ...predicate.ReadArticle)
Where appends a list predicates to the ReadArticleMutation builder.
func (*ReadArticleMutation) WhereP ¶
func (m *ReadArticleMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ReadArticleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ReadArticleQuery ¶
type ReadArticleQuery struct {
// contains filtered or unexported fields
}
ReadArticleQuery is the builder for querying ReadArticle entities.
func (*ReadArticleQuery) Aggregate ¶
func (raq *ReadArticleQuery) Aggregate(fns ...AggregateFunc) *ReadArticleSelect
Aggregate returns a ReadArticleSelect configured with the given aggregations.
func (*ReadArticleQuery) All ¶
func (raq *ReadArticleQuery) All(ctx context.Context) ([]*ReadArticle, error)
All executes the query and returns a list of ReadArticles.
func (*ReadArticleQuery) AllX ¶
func (raq *ReadArticleQuery) AllX(ctx context.Context) []*ReadArticle
AllX is like All, but panics if an error occurs.
func (*ReadArticleQuery) Clone ¶
func (raq *ReadArticleQuery) Clone() *ReadArticleQuery
Clone returns a duplicate of the ReadArticleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ReadArticleQuery) Count ¶
func (raq *ReadArticleQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ReadArticleQuery) CountX ¶
func (raq *ReadArticleQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ReadArticleQuery) Exist ¶
func (raq *ReadArticleQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ReadArticleQuery) ExistX ¶
func (raq *ReadArticleQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ReadArticleQuery) First ¶
func (raq *ReadArticleQuery) First(ctx context.Context) (*ReadArticle, error)
First returns the first ReadArticle entity from the query. Returns a *NotFoundError when no ReadArticle was found.
func (*ReadArticleQuery) FirstID ¶
FirstID returns the first ReadArticle ID from the query. Returns a *NotFoundError when no ReadArticle ID was found.
func (*ReadArticleQuery) FirstIDX ¶
func (raq *ReadArticleQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*ReadArticleQuery) FirstX ¶
func (raq *ReadArticleQuery) FirstX(ctx context.Context) *ReadArticle
FirstX is like First, but panics if an error occurs.
func (*ReadArticleQuery) GroupBy ¶
func (raq *ReadArticleQuery) GroupBy(field string, fields ...string) *ReadArticleGroupBy
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 { ArticleID uuid.UUID `json:"article_id,omitempty"` Count int `json:"count,omitempty"` } client.ReadArticle.Query(). GroupBy(readarticle.FieldArticleID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ReadArticleQuery) IDsX ¶
func (raq *ReadArticleQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*ReadArticleQuery) Limit ¶
func (raq *ReadArticleQuery) Limit(limit int) *ReadArticleQuery
Limit the number of records to be returned by this query.
func (*ReadArticleQuery) Offset ¶
func (raq *ReadArticleQuery) Offset(offset int) *ReadArticleQuery
Offset to start from.
func (*ReadArticleQuery) Only ¶
func (raq *ReadArticleQuery) Only(ctx context.Context) (*ReadArticle, error)
Only returns a single ReadArticle entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ReadArticle entity is found. Returns a *NotFoundError when no ReadArticle entities are found.
func (*ReadArticleQuery) OnlyID ¶
OnlyID is like Only, but returns the only ReadArticle ID in the query. Returns a *NotSingularError when more than one ReadArticle ID is found. Returns a *NotFoundError when no entities are found.
func (*ReadArticleQuery) OnlyIDX ¶
func (raq *ReadArticleQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ReadArticleQuery) OnlyX ¶
func (raq *ReadArticleQuery) OnlyX(ctx context.Context) *ReadArticle
OnlyX is like Only, but panics if an error occurs.
func (*ReadArticleQuery) Order ¶
func (raq *ReadArticleQuery) Order(o ...OrderFunc) *ReadArticleQuery
Order specifies how the records should be ordered.
func (*ReadArticleQuery) QueryArticle ¶
func (raq *ReadArticleQuery) QueryArticle() *ArticleQuery
QueryArticle chains the current query on the "article" edge.
func (*ReadArticleQuery) Select ¶
func (raq *ReadArticleQuery) Select(fields ...string) *ReadArticleSelect
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 { ArticleID uuid.UUID `json:"article_id,omitempty"` } client.ReadArticle.Query(). Select(readarticle.FieldArticleID). Scan(ctx, &v)
func (*ReadArticleQuery) Unique ¶
func (raq *ReadArticleQuery) Unique(unique bool) *ReadArticleQuery
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 (*ReadArticleQuery) Where ¶
func (raq *ReadArticleQuery) Where(ps ...predicate.ReadArticle) *ReadArticleQuery
Where adds a new predicate for the ReadArticleQuery builder.
func (*ReadArticleQuery) WithArticle ¶
func (raq *ReadArticleQuery) WithArticle(opts ...func(*ArticleQuery)) *ReadArticleQuery
WithArticle tells the query-builder to eager-load the nodes that are connected to the "article" edge. The optional arguments are used to configure the query builder of the edge.
type ReadArticleSelect ¶
type ReadArticleSelect struct { *ReadArticleQuery // contains filtered or unexported fields }
ReadArticleSelect is the builder for selecting fields of ReadArticle entities.
func (*ReadArticleSelect) Aggregate ¶
func (ras *ReadArticleSelect) Aggregate(fns ...AggregateFunc) *ReadArticleSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ReadArticleSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ReadArticleSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ReadArticleSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ReadArticleSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ReadArticleSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ReadArticleSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ReadArticleSelect) Scan ¶
func (ras *ReadArticleSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ReadArticleSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ReadArticleUpdate ¶
type ReadArticleUpdate struct {
// contains filtered or unexported fields
}
ReadArticleUpdate is the builder for updating ReadArticle entities.
func (*ReadArticleUpdate) ClearArticle ¶
func (rau *ReadArticleUpdate) ClearArticle() *ReadArticleUpdate
ClearArticle clears the "article" edge to the Article entity.
func (*ReadArticleUpdate) Exec ¶
func (rau *ReadArticleUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ReadArticleUpdate) ExecX ¶
func (rau *ReadArticleUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ReadArticleUpdate) Mutation ¶
func (rau *ReadArticleUpdate) Mutation() *ReadArticleMutation
Mutation returns the ReadArticleMutation object of the builder.
func (*ReadArticleUpdate) Save ¶
func (rau *ReadArticleUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ReadArticleUpdate) SaveX ¶
func (rau *ReadArticleUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ReadArticleUpdate) SetArticle ¶
func (rau *ReadArticleUpdate) SetArticle(a *Article) *ReadArticleUpdate
SetArticle sets the "article" edge to the Article entity.
func (*ReadArticleUpdate) SetArticleID ¶
func (rau *ReadArticleUpdate) SetArticleID(u uuid.UUID) *ReadArticleUpdate
SetArticleID sets the "article_id" field.
func (*ReadArticleUpdate) SetNillableReadAt ¶
func (rau *ReadArticleUpdate) SetNillableReadAt(t *time.Time) *ReadArticleUpdate
SetNillableReadAt sets the "read_at" field if the given value is not nil.
func (*ReadArticleUpdate) SetReadAt ¶
func (rau *ReadArticleUpdate) SetReadAt(t time.Time) *ReadArticleUpdate
SetReadAt sets the "read_at" field.
func (*ReadArticleUpdate) SetUserID ¶
func (rau *ReadArticleUpdate) SetUserID(u uuid.UUID) *ReadArticleUpdate
SetUserID sets the "user_id" field.
func (*ReadArticleUpdate) Where ¶
func (rau *ReadArticleUpdate) Where(ps ...predicate.ReadArticle) *ReadArticleUpdate
Where appends a list predicates to the ReadArticleUpdate builder.
type ReadArticleUpdateOne ¶
type ReadArticleUpdateOne struct {
// contains filtered or unexported fields
}
ReadArticleUpdateOne is the builder for updating a single ReadArticle entity.
func (*ReadArticleUpdateOne) ClearArticle ¶
func (rauo *ReadArticleUpdateOne) ClearArticle() *ReadArticleUpdateOne
ClearArticle clears the "article" edge to the Article entity.
func (*ReadArticleUpdateOne) Exec ¶
func (rauo *ReadArticleUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ReadArticleUpdateOne) ExecX ¶
func (rauo *ReadArticleUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ReadArticleUpdateOne) Mutation ¶
func (rauo *ReadArticleUpdateOne) Mutation() *ReadArticleMutation
Mutation returns the ReadArticleMutation object of the builder.
func (*ReadArticleUpdateOne) Save ¶
func (rauo *ReadArticleUpdateOne) Save(ctx context.Context) (*ReadArticle, error)
Save executes the query and returns the updated ReadArticle entity.
func (*ReadArticleUpdateOne) SaveX ¶
func (rauo *ReadArticleUpdateOne) SaveX(ctx context.Context) *ReadArticle
SaveX is like Save, but panics if an error occurs.
func (*ReadArticleUpdateOne) Select ¶
func (rauo *ReadArticleUpdateOne) Select(field string, fields ...string) *ReadArticleUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ReadArticleUpdateOne) SetArticle ¶
func (rauo *ReadArticleUpdateOne) SetArticle(a *Article) *ReadArticleUpdateOne
SetArticle sets the "article" edge to the Article entity.
func (*ReadArticleUpdateOne) SetArticleID ¶
func (rauo *ReadArticleUpdateOne) SetArticleID(u uuid.UUID) *ReadArticleUpdateOne
SetArticleID sets the "article_id" field.
func (*ReadArticleUpdateOne) SetNillableReadAt ¶
func (rauo *ReadArticleUpdateOne) SetNillableReadAt(t *time.Time) *ReadArticleUpdateOne
SetNillableReadAt sets the "read_at" field if the given value is not nil.
func (*ReadArticleUpdateOne) SetReadAt ¶
func (rauo *ReadArticleUpdateOne) SetReadAt(t time.Time) *ReadArticleUpdateOne
SetReadAt sets the "read_at" field.
func (*ReadArticleUpdateOne) SetUserID ¶
func (rauo *ReadArticleUpdateOne) SetUserID(u uuid.UUID) *ReadArticleUpdateOne
SetUserID sets the "user_id" field.
func (*ReadArticleUpdateOne) Where ¶
func (rauo *ReadArticleUpdateOne) Where(ps ...predicate.ReadArticle) *ReadArticleUpdateOne
Where appends a list predicates to the ReadArticleUpdate builder.
type ReadArticleUpsert ¶
ReadArticleUpsert is the "OnConflict" setter.
func (*ReadArticleUpsert) SetArticleID ¶
func (u *ReadArticleUpsert) SetArticleID(v uuid.UUID) *ReadArticleUpsert
SetArticleID sets the "article_id" field.
func (*ReadArticleUpsert) SetReadAt ¶
func (u *ReadArticleUpsert) SetReadAt(v time.Time) *ReadArticleUpsert
SetReadAt sets the "read_at" field.
func (*ReadArticleUpsert) SetUserID ¶
func (u *ReadArticleUpsert) SetUserID(v uuid.UUID) *ReadArticleUpsert
SetUserID sets the "user_id" field.
func (*ReadArticleUpsert) UpdateArticleID ¶
func (u *ReadArticleUpsert) UpdateArticleID() *ReadArticleUpsert
UpdateArticleID sets the "article_id" field to the value that was provided on create.
func (*ReadArticleUpsert) UpdateReadAt ¶
func (u *ReadArticleUpsert) UpdateReadAt() *ReadArticleUpsert
UpdateReadAt sets the "read_at" field to the value that was provided on create.
func (*ReadArticleUpsert) UpdateUserID ¶
func (u *ReadArticleUpsert) UpdateUserID() *ReadArticleUpsert
UpdateUserID sets the "user_id" field to the value that was provided on create.
type ReadArticleUpsertBulk ¶
type ReadArticleUpsertBulk struct {
// contains filtered or unexported fields
}
ReadArticleUpsertBulk is the builder for "upsert"-ing a bulk of ReadArticle nodes.
func (*ReadArticleUpsertBulk) DoNothing ¶
func (u *ReadArticleUpsertBulk) DoNothing() *ReadArticleUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ReadArticleUpsertBulk) Exec ¶
func (u *ReadArticleUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ReadArticleUpsertBulk) ExecX ¶
func (u *ReadArticleUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ReadArticleUpsertBulk) Ignore ¶
func (u *ReadArticleUpsertBulk) Ignore() *ReadArticleUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.ReadArticle.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ReadArticleUpsertBulk) SetArticleID ¶
func (u *ReadArticleUpsertBulk) SetArticleID(v uuid.UUID) *ReadArticleUpsertBulk
SetArticleID sets the "article_id" field.
func (*ReadArticleUpsertBulk) SetReadAt ¶
func (u *ReadArticleUpsertBulk) SetReadAt(v time.Time) *ReadArticleUpsertBulk
SetReadAt sets the "read_at" field.
func (*ReadArticleUpsertBulk) SetUserID ¶
func (u *ReadArticleUpsertBulk) SetUserID(v uuid.UUID) *ReadArticleUpsertBulk
SetUserID sets the "user_id" field.
func (*ReadArticleUpsertBulk) Update ¶
func (u *ReadArticleUpsertBulk) Update(set func(*ReadArticleUpsert)) *ReadArticleUpsertBulk
Update allows overriding fields `UPDATE` values. See the ReadArticleCreateBulk.OnConflict documentation for more info.
func (*ReadArticleUpsertBulk) UpdateArticleID ¶
func (u *ReadArticleUpsertBulk) UpdateArticleID() *ReadArticleUpsertBulk
UpdateArticleID sets the "article_id" field to the value that was provided on create.
func (*ReadArticleUpsertBulk) UpdateNewValues ¶
func (u *ReadArticleUpsertBulk) UpdateNewValues() *ReadArticleUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.ReadArticle.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(readarticle.FieldID) }), ). Exec(ctx)
func (*ReadArticleUpsertBulk) UpdateReadAt ¶
func (u *ReadArticleUpsertBulk) UpdateReadAt() *ReadArticleUpsertBulk
UpdateReadAt sets the "read_at" field to the value that was provided on create.
func (*ReadArticleUpsertBulk) UpdateUserID ¶
func (u *ReadArticleUpsertBulk) UpdateUserID() *ReadArticleUpsertBulk
UpdateUserID sets the "user_id" field to the value that was provided on create.
type ReadArticleUpsertOne ¶
type ReadArticleUpsertOne struct {
// contains filtered or unexported fields
}
ReadArticleUpsertOne is the builder for "upsert"-ing
one ReadArticle node.
func (*ReadArticleUpsertOne) DoNothing ¶
func (u *ReadArticleUpsertOne) DoNothing() *ReadArticleUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ReadArticleUpsertOne) Exec ¶
func (u *ReadArticleUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*ReadArticleUpsertOne) ExecX ¶
func (u *ReadArticleUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ReadArticleUpsertOne) ID ¶
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*ReadArticleUpsertOne) IDX ¶
func (u *ReadArticleUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*ReadArticleUpsertOne) Ignore ¶
func (u *ReadArticleUpsertOne) Ignore() *ReadArticleUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.ReadArticle.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ReadArticleUpsertOne) SetArticleID ¶
func (u *ReadArticleUpsertOne) SetArticleID(v uuid.UUID) *ReadArticleUpsertOne
SetArticleID sets the "article_id" field.
func (*ReadArticleUpsertOne) SetReadAt ¶
func (u *ReadArticleUpsertOne) SetReadAt(v time.Time) *ReadArticleUpsertOne
SetReadAt sets the "read_at" field.
func (*ReadArticleUpsertOne) SetUserID ¶
func (u *ReadArticleUpsertOne) SetUserID(v uuid.UUID) *ReadArticleUpsertOne
SetUserID sets the "user_id" field.
func (*ReadArticleUpsertOne) Update ¶
func (u *ReadArticleUpsertOne) Update(set func(*ReadArticleUpsert)) *ReadArticleUpsertOne
Update allows overriding fields `UPDATE` values. See the ReadArticleCreate.OnConflict documentation for more info.
func (*ReadArticleUpsertOne) UpdateArticleID ¶
func (u *ReadArticleUpsertOne) UpdateArticleID() *ReadArticleUpsertOne
UpdateArticleID sets the "article_id" field to the value that was provided on create.
func (*ReadArticleUpsertOne) UpdateNewValues ¶
func (u *ReadArticleUpsertOne) UpdateNewValues() *ReadArticleUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.ReadArticle.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(readarticle.FieldID) }), ). Exec(ctx)
func (*ReadArticleUpsertOne) UpdateReadAt ¶
func (u *ReadArticleUpsertOne) UpdateReadAt() *ReadArticleUpsertOne
UpdateReadAt sets the "read_at" field to the value that was provided on create.
func (*ReadArticleUpsertOne) UpdateUserID ¶
func (u *ReadArticleUpsertOne) UpdateUserID() *ReadArticleUpsertOne
UpdateUserID sets the "user_id" field to the value that was provided on create.
type ReadArticles ¶
type ReadArticles []*ReadArticle
ReadArticles is a parsable slice of ReadArticle.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Article is the client for interacting with the Article builders. Article *ArticleClient // ArticleTag is the client for interacting with the ArticleTag builders. ArticleTag *ArticleTagClient // ReadArticle is the client for interacting with the ReadArticle builders. ReadArticle *ReadArticleClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // LastLoggedInAt holds the value of the "last_logged_in_at" field. LastLoggedInAt time.Time `json:"last_logged_in_at,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"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) OnConflict ¶
func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.User.Create(). SetLastLoggedInAt(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.UserUpsert) { SetLastLoggedInAt(v+v). }). Exec(ctx)
func (*UserCreate) OnConflictColumns ¶
func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetCreatedAt ¶
func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
SetCreatedAt sets the "created_at" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetLastLoggedInAt ¶
func (uc *UserCreate) SetLastLoggedInAt(t time.Time) *UserCreate
SetLastLoggedInAt sets the "last_logged_in_at" field.
func (*UserCreate) SetNillableCreatedAt ¶
func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserCreate) SetNillableID ¶
func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*UserCreate) SetNillableLastLoggedInAt ¶
func (uc *UserCreate) SetNillableLastLoggedInAt(t *time.Time) *UserCreate
SetNillableLastLoggedInAt sets the "last_logged_in_at" field if the given value is not nil.
func (*UserCreate) SetNillableUpdatedAt ¶
func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserCreate) SetUpdatedAt ¶
func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
SetUpdatedAt sets the "updated_at" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreateBulk) OnConflict ¶
func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.User.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.UserUpsert) { SetLastLoggedInAt(v+v). }). Exec(ctx)
func (*UserCreateBulk) OnConflictColumns ¶
func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) CreatedAt ¶
func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) LastLoggedInAt ¶
func (m *UserMutation) LastLoggedInAt() (r time.Time, exists bool)
LastLoggedInAt returns the value of the "last_logged_in_at" field in the mutation.
func (*UserMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) OldLastLoggedInAt ¶
OldLastLoggedInAt returns the old "last_logged_in_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) ResetCreatedAt ¶
func (m *UserMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetLastLoggedInAt ¶
func (m *UserMutation) ResetLastLoggedInAt()
ResetLastLoggedInAt resets all changes to the "last_logged_in_at" field.
func (*UserMutation) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetLastLoggedInAt ¶
func (m *UserMutation) SetLastLoggedInAt(t time.Time)
SetLastLoggedInAt sets the "last_logged_in_at" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetUpdatedAt ¶
func (m *UserMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) UpdatedAt ¶
func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { LastLoggedInAt time.Time `json:"last_logged_in_at,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldLastLoggedInAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { LastLoggedInAt time.Time `json:"last_logged_in_at,omitempty"` } client.User.Query(). Select(user.FieldLastLoggedInAt). Scan(ctx, &v)
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetCreatedAt ¶
func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate
SetCreatedAt sets the "created_at" field.
func (*UserUpdate) SetLastLoggedInAt ¶
func (uu *UserUpdate) SetLastLoggedInAt(t time.Time) *UserUpdate
SetLastLoggedInAt sets the "last_logged_in_at" field.
func (*UserUpdate) SetNillableCreatedAt ¶
func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserUpdate) SetNillableLastLoggedInAt ¶
func (uu *UserUpdate) SetNillableLastLoggedInAt(t *time.Time) *UserUpdate
SetNillableLastLoggedInAt sets the "last_logged_in_at" field if the given value is not nil.
func (*UserUpdate) SetUpdatedAt ¶
func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetCreatedAt ¶
func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne
SetCreatedAt sets the "created_at" field.
func (*UserUpdateOne) SetLastLoggedInAt ¶
func (uuo *UserUpdateOne) SetLastLoggedInAt(t time.Time) *UserUpdateOne
SetLastLoggedInAt sets the "last_logged_in_at" field.
func (*UserUpdateOne) SetNillableCreatedAt ¶
func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserUpdateOne) SetNillableLastLoggedInAt ¶
func (uuo *UserUpdateOne) SetNillableLastLoggedInAt(t *time.Time) *UserUpdateOne
SetNillableLastLoggedInAt sets the "last_logged_in_at" field if the given value is not nil.
func (*UserUpdateOne) SetUpdatedAt ¶
func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type UserUpsert ¶
UserUpsert is the "OnConflict" setter.
func (*UserUpsert) SetCreatedAt ¶
func (u *UserUpsert) SetCreatedAt(v time.Time) *UserUpsert
SetCreatedAt sets the "created_at" field.
func (*UserUpsert) SetLastLoggedInAt ¶
func (u *UserUpsert) SetLastLoggedInAt(v time.Time) *UserUpsert
SetLastLoggedInAt sets the "last_logged_in_at" field.
func (*UserUpsert) SetUpdatedAt ¶
func (u *UserUpsert) SetUpdatedAt(v time.Time) *UserUpsert
SetUpdatedAt sets the "updated_at" field.
func (*UserUpsert) UpdateCreatedAt ¶
func (u *UserUpsert) UpdateCreatedAt() *UserUpsert
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*UserUpsert) UpdateLastLoggedInAt ¶
func (u *UserUpsert) UpdateLastLoggedInAt() *UserUpsert
UpdateLastLoggedInAt sets the "last_logged_in_at" field to the value that was provided on create.
func (*UserUpsert) UpdateUpdatedAt ¶
func (u *UserUpsert) UpdateUpdatedAt() *UserUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type UserUpsertBulk ¶
type UserUpsertBulk struct {
// contains filtered or unexported fields
}
UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.
func (*UserUpsertBulk) DoNothing ¶
func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserUpsertBulk) Exec ¶
func (u *UserUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpsertBulk) ExecX ¶
func (u *UserUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpsertBulk) Ignore ¶
func (u *UserUpsertBulk) Ignore() *UserUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserUpsertBulk) SetCreatedAt ¶
func (u *UserUpsertBulk) SetCreatedAt(v time.Time) *UserUpsertBulk
SetCreatedAt sets the "created_at" field.
func (*UserUpsertBulk) SetLastLoggedInAt ¶
func (u *UserUpsertBulk) SetLastLoggedInAt(v time.Time) *UserUpsertBulk
SetLastLoggedInAt sets the "last_logged_in_at" field.
func (*UserUpsertBulk) SetUpdatedAt ¶
func (u *UserUpsertBulk) SetUpdatedAt(v time.Time) *UserUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*UserUpsertBulk) Update ¶
func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk
Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.
func (*UserUpsertBulk) UpdateCreatedAt ¶
func (u *UserUpsertBulk) UpdateCreatedAt() *UserUpsertBulk
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*UserUpsertBulk) UpdateLastLoggedInAt ¶
func (u *UserUpsertBulk) UpdateLastLoggedInAt() *UserUpsertBulk
UpdateLastLoggedInAt sets the "last_logged_in_at" field to the value that was provided on create.
func (*UserUpsertBulk) UpdateNewValues ¶
func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.User.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(user.FieldID) }), ). Exec(ctx)
func (*UserUpsertBulk) UpdateUpdatedAt ¶
func (u *UserUpsertBulk) UpdateUpdatedAt() *UserUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type UserUpsertOne ¶
type UserUpsertOne struct {
// contains filtered or unexported fields
}
UserUpsertOne is the builder for "upsert"-ing
one User node.
func (*UserUpsertOne) DoNothing ¶
func (u *UserUpsertOne) DoNothing() *UserUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserUpsertOne) Exec ¶
func (u *UserUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpsertOne) ExecX ¶
func (u *UserUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpsertOne) IDX ¶
func (u *UserUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*UserUpsertOne) Ignore ¶
func (u *UserUpsertOne) Ignore() *UserUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserUpsertOne) SetCreatedAt ¶
func (u *UserUpsertOne) SetCreatedAt(v time.Time) *UserUpsertOne
SetCreatedAt sets the "created_at" field.
func (*UserUpsertOne) SetLastLoggedInAt ¶
func (u *UserUpsertOne) SetLastLoggedInAt(v time.Time) *UserUpsertOne
SetLastLoggedInAt sets the "last_logged_in_at" field.
func (*UserUpsertOne) SetUpdatedAt ¶
func (u *UserUpsertOne) SetUpdatedAt(v time.Time) *UserUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpsertOne) Update ¶
func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne
Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.
func (*UserUpsertOne) UpdateCreatedAt ¶
func (u *UserUpsertOne) UpdateCreatedAt() *UserUpsertOne
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*UserUpsertOne) UpdateLastLoggedInAt ¶
func (u *UserUpsertOne) UpdateLastLoggedInAt() *UserUpsertOne
UpdateLastLoggedInAt sets the "last_logged_in_at" field to the value that was provided on create.
func (*UserUpsertOne) UpdateNewValues ¶
func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.User.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(user.FieldID) }), ). Exec(ctx)
func (*UserUpsertOne) UpdateUpdatedAt ¶
func (u *UserUpsertOne) UpdateUpdatedAt() *UserUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- article.go
- article_create.go
- article_delete.go
- article_query.go
- article_update.go
- articletag.go
- articletag_create.go
- articletag_delete.go
- articletag_query.go
- articletag_update.go
- client.go
- ent.go
- generate.go
- mutation.go
- readarticle.go
- readarticle_create.go
- readarticle_delete.go
- readarticle_query.go
- readarticle_update.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go