Documentation ¶
Index ¶
- Constants
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Article
- func (c *Article) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *Article) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (a *Article) QueryTags() *ArticleTagQuery
- func (a *Article) QueryUserArticles() *UserArticleQuery
- func (a *Article) String() string
- func (a *Article) Unwrap() *Article
- func (a *Article) Update() *ArticleUpdateOne
- func (a *Article) Value(name string) (ent.Value, error)
- 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) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (c *ArticleClient) QueryTags(a *Article) *ArticleTagQuery
- func (c *ArticleClient) QueryUserArticles(a *Article) *UserArticleQuery
- 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) AddTagIDs(ids ...uuid.UUID) *ArticleCreate
- func (ac *ArticleCreate) AddTags(a ...*ArticleTag) *ArticleCreate
- func (ac *ArticleCreate) AddUserArticleIDs(ids ...uuid.UUID) *ArticleCreate
- func (ac *ArticleCreate) AddUserArticles(u ...*UserArticle) *ArticleCreate
- func (ac *ArticleCreate) Exec(ctx context.Context) error
- func (c *ArticleCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, 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 (c *ArticleCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- 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) SetDescription(s string) *ArticleCreate
- func (ac *ArticleCreate) SetID(u uuid.UUID) *ArticleCreate
- func (ac *ArticleCreate) SetNillableCreatedAt(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 (c *ArticleCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (acb *ArticleCreateBulk) ExecX(ctx context.Context)
- func (acb *ArticleCreateBulk) OnConflict(opts ...sql.ConflictOption) *ArticleUpsertBulk
- func (acb *ArticleCreateBulk) OnConflictColumns(columns ...string) *ArticleUpsertBulk
- func (c *ArticleCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (acb *ArticleCreateBulk) Save(ctx context.Context) ([]*Article, error)
- func (acb *ArticleCreateBulk) SaveX(ctx context.Context) []*Article
- type ArticleDelete
- func (ad *ArticleDelete) Exec(ctx context.Context) (int, error)
- func (c *ArticleDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (ad *ArticleDelete) ExecX(ctx context.Context) int
- func (c *ArticleDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ad *ArticleDelete) Where(ps ...predicate.Article) *ArticleDelete
- type ArticleDeleteOne
- type ArticleEdges
- type ArticleGroupBy
- func (agb *ArticleGroupBy) Aggregate(fns ...AggregateFunc) *ArticleGroupBy
- func (s *ArticleGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ArticleGroupBy) BoolX(ctx context.Context) bool
- func (s *ArticleGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ArticleGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ArticleGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ArticleGroupBy) Float64X(ctx context.Context) float64
- func (s *ArticleGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ArticleGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ArticleGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ArticleGroupBy) IntX(ctx context.Context) int
- func (s *ArticleGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ArticleGroupBy) IntsX(ctx context.Context) []int
- func (agb *ArticleGroupBy) Scan(ctx context.Context, v any) error
- func (s *ArticleGroupBy) ScanX(ctx context.Context, v any)
- func (s *ArticleGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ArticleGroupBy) StringX(ctx context.Context) string
- func (s *ArticleGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ArticleGroupBy) StringsX(ctx context.Context) []string
- type ArticleMutation
- func (m *ArticleMutation) AddField(name string, value ent.Value) error
- func (m *ArticleMutation) AddTagIDs(ids ...uuid.UUID)
- func (m *ArticleMutation) AddUserArticleIDs(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) ClearEdge(name string) error
- func (m *ArticleMutation) ClearField(name string) error
- func (m *ArticleMutation) ClearTags()
- func (m *ArticleMutation) ClearUserArticles()
- 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) Description() (r string, exists bool)
- func (m *ArticleMutation) EdgeCleared(name string) bool
- func (c *ArticleMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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) 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 (c *ArticleMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (m *ArticleMutation) RemoveTagIDs(ids ...uuid.UUID)
- func (m *ArticleMutation) RemoveUserArticleIDs(ids ...uuid.UUID)
- func (m *ArticleMutation) RemovedEdges() []string
- func (m *ArticleMutation) RemovedIDs(name string) []ent.Value
- func (m *ArticleMutation) RemovedTagsIDs() (ids []uuid.UUID)
- func (m *ArticleMutation) RemovedUserArticlesIDs() (ids []uuid.UUID)
- func (m *ArticleMutation) ResetCreatedAt()
- func (m *ArticleMutation) ResetDescription()
- func (m *ArticleMutation) ResetEdge(name string) error
- func (m *ArticleMutation) ResetField(name string) error
- func (m *ArticleMutation) ResetTags()
- func (m *ArticleMutation) ResetThumbnail()
- func (m *ArticleMutation) ResetTitle()
- func (m *ArticleMutation) ResetURL()
- func (m *ArticleMutation) ResetUpdatedAt()
- func (m *ArticleMutation) ResetUserArticles()
- func (m *ArticleMutation) SetCreatedAt(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) UserArticlesCleared() bool
- func (m *ArticleMutation) UserArticlesIDs() (ids []uuid.UUID)
- 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 (c *ArticleQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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) ForShare(opts ...sql.LockOption) *ArticleQuery
- func (aq *ArticleQuery) ForUpdate(opts ...sql.LockOption) *ArticleQuery
- 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 ...article.OrderOption) *ArticleQuery
- func (c *ArticleQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (aq *ArticleQuery) QueryTags() *ArticleTagQuery
- func (aq *ArticleQuery) QueryUserArticles() *UserArticleQuery
- func (aq *ArticleQuery) Select(fields ...string) *ArticleSelect
- func (aq *ArticleQuery) Unique(unique bool) *ArticleQuery
- func (aq *ArticleQuery) Where(ps ...predicate.Article) *ArticleQuery
- func (aq *ArticleQuery) WithTags(opts ...func(*ArticleTagQuery)) *ArticleQuery
- func (aq *ArticleQuery) WithUserArticles(opts ...func(*UserArticleQuery)) *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 (c ArticleSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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 (c ArticleSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- 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
- func (c *ArticleTag) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (at *ArticleTag) QueryArticle() *ArticleQuery
- func (c *ArticleTag) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (at *ArticleTag) String() string
- func (at *ArticleTag) Unwrap() *ArticleTag
- func (at *ArticleTag) Update() *ArticleTagUpdateOne
- func (at *ArticleTag) Value(name string) (ent.Value, error)
- 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) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- 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 (c *ArticleTagCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, 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 (c *ArticleTagCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- 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) SetID(u uuid.UUID) *ArticleTagCreate
- func (atc *ArticleTagCreate) SetNillableID(u *uuid.UUID) *ArticleTagCreate
- func (atc *ArticleTagCreate) SetTag(s string) *ArticleTagCreate
- type ArticleTagCreateBulk
- func (atcb *ArticleTagCreateBulk) Exec(ctx context.Context) error
- func (c *ArticleTagCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (atcb *ArticleTagCreateBulk) ExecX(ctx context.Context)
- func (atcb *ArticleTagCreateBulk) OnConflict(opts ...sql.ConflictOption) *ArticleTagUpsertBulk
- func (atcb *ArticleTagCreateBulk) OnConflictColumns(columns ...string) *ArticleTagUpsertBulk
- func (c *ArticleTagCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (atcb *ArticleTagCreateBulk) Save(ctx context.Context) ([]*ArticleTag, error)
- func (atcb *ArticleTagCreateBulk) SaveX(ctx context.Context) []*ArticleTag
- type ArticleTagDelete
- func (atd *ArticleTagDelete) Exec(ctx context.Context) (int, error)
- func (c *ArticleTagDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (atd *ArticleTagDelete) ExecX(ctx context.Context) int
- func (c *ArticleTagDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (atd *ArticleTagDelete) Where(ps ...predicate.ArticleTag) *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) EdgeCleared(name string) bool
- func (c *ArticleTagMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ArticleTagMutation) OldTag(ctx context.Context) (v string, err error)
- func (m *ArticleTagMutation) Op() Op
- func (c *ArticleTagMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (m *ArticleTagMutation) RemovedEdges() []string
- func (m *ArticleTagMutation) RemovedIDs(name string) []ent.Value
- func (m *ArticleTagMutation) ResetArticle()
- func (m *ArticleTagMutation) ResetArticleID()
- func (m *ArticleTagMutation) ResetEdge(name string) error
- func (m *ArticleTagMutation) ResetField(name string) error
- func (m *ArticleTagMutation) ResetTag()
- func (m *ArticleTagMutation) SetArticleID(u uuid.UUID)
- 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) Tag() (r string, exists bool)
- func (m ArticleTagMutation) Tx() (*Tx, error)
- func (m *ArticleTagMutation) Type() string
- 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 (c *ArticleTagQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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) ForShare(opts ...sql.LockOption) *ArticleTagQuery
- func (atq *ArticleTagQuery) ForUpdate(opts ...sql.LockOption) *ArticleTagQuery
- 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 ...articletag.OrderOption) *ArticleTagQuery
- func (atq *ArticleTagQuery) QueryArticle() *ArticleQuery
- func (c *ArticleTagQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- 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 (c ArticleTagSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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 (c ArticleTagSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- 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 (c *ArticleTagUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (atu *ArticleTagUpdate) ExecX(ctx context.Context)
- func (atu *ArticleTagUpdate) Mutation() *ArticleTagMutation
- func (c *ArticleTagUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- 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) SetTag(s string) *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 (c *ArticleTagUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (atuo *ArticleTagUpdateOne) ExecX(ctx context.Context)
- func (atuo *ArticleTagUpdateOne) Mutation() *ArticleTagMutation
- func (c *ArticleTagUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- 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) SetTag(s string) *ArticleTagUpdateOne
- func (atuo *ArticleTagUpdateOne) Where(ps ...predicate.ArticleTag) *ArticleTagUpdateOne
- type 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) SetTag(v string) *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) Update(set func(*ArticleTagUpsert)) *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) UpdateArticleID() *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) UpdateNewValues() *ArticleTagUpsertBulk
- func (u *ArticleTagUpsertBulk) UpdateTag() *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) SetTag(v string) *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) Update(set func(*ArticleTagUpsert)) *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) UpdateArticleID() *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) UpdateNewValues() *ArticleTagUpsertOne
- func (u *ArticleTagUpsertOne) UpdateTag() *ArticleTagUpsertOne
- type ArticleTags
- type ArticleUpdate
- func (au *ArticleUpdate) AddTagIDs(ids ...uuid.UUID) *ArticleUpdate
- func (au *ArticleUpdate) AddTags(a ...*ArticleTag) *ArticleUpdate
- func (au *ArticleUpdate) AddUserArticleIDs(ids ...uuid.UUID) *ArticleUpdate
- func (au *ArticleUpdate) AddUserArticles(u ...*UserArticle) *ArticleUpdate
- func (au *ArticleUpdate) ClearTags() *ArticleUpdate
- func (au *ArticleUpdate) ClearUserArticles() *ArticleUpdate
- func (au *ArticleUpdate) Exec(ctx context.Context) error
- func (c *ArticleUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (au *ArticleUpdate) ExecX(ctx context.Context)
- func (au *ArticleUpdate) Mutation() *ArticleMutation
- func (c *ArticleUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (au *ArticleUpdate) RemoveTagIDs(ids ...uuid.UUID) *ArticleUpdate
- func (au *ArticleUpdate) RemoveTags(a ...*ArticleTag) *ArticleUpdate
- func (au *ArticleUpdate) RemoveUserArticleIDs(ids ...uuid.UUID) *ArticleUpdate
- func (au *ArticleUpdate) RemoveUserArticles(u ...*UserArticle) *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) SetDescription(s string) *ArticleUpdate
- func (au *ArticleUpdate) SetNillableCreatedAt(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) AddTagIDs(ids ...uuid.UUID) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) AddTags(a ...*ArticleTag) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) AddUserArticleIDs(ids ...uuid.UUID) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) AddUserArticles(u ...*UserArticle) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) ClearTags() *ArticleUpdateOne
- func (auo *ArticleUpdateOne) ClearUserArticles() *ArticleUpdateOne
- func (auo *ArticleUpdateOne) Exec(ctx context.Context) error
- func (c *ArticleUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (auo *ArticleUpdateOne) ExecX(ctx context.Context)
- func (auo *ArticleUpdateOne) Mutation() *ArticleMutation
- func (c *ArticleUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (auo *ArticleUpdateOne) RemoveTagIDs(ids ...uuid.UUID) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) RemoveTags(a ...*ArticleTag) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) RemoveUserArticleIDs(ids ...uuid.UUID) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) RemoveUserArticles(u ...*UserArticle) *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) SetDescription(s string) *ArticleUpdateOne
- func (auo *ArticleUpdateOne) SetNillableCreatedAt(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) SetCreatedAt(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) 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) 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) 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) 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) 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) 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) 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) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, 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 RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- func (tx *Tx) Client() *Client
- func (tx *Tx) Commit() error
- func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (tx *Tx) OnCommit(f CommitHook)
- func (tx *Tx) OnRollback(f RollbackHook)
- func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (tx *Tx) Rollback() error
- type User
- func (c *User) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *User) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (u *User) QueryUserArticles() *UserArticleQuery
- func (u *User) String() string
- func (u *User) Unwrap() *User
- func (u *User) Update() *UserUpdateOne
- func (u *User) Value(name string) (ent.Value, error)
- type UserArticle
- func (c *UserArticle) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (ua *UserArticle) QueryArticle() *ArticleQuery
- func (c *UserArticle) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ua *UserArticle) QueryUser() *UserQuery
- func (ua *UserArticle) String() string
- func (ua *UserArticle) Unwrap() *UserArticle
- func (ua *UserArticle) Update() *UserArticleUpdateOne
- func (ua *UserArticle) Value(name string) (ent.Value, error)
- type UserArticleClient
- func (c *UserArticleClient) Create() *UserArticleCreate
- func (c *UserArticleClient) CreateBulk(builders ...*UserArticleCreate) *UserArticleCreateBulk
- func (c *UserArticleClient) Delete() *UserArticleDelete
- func (c *UserArticleClient) DeleteOne(ua *UserArticle) *UserArticleDeleteOne
- func (c *UserArticleClient) DeleteOneID(id uuid.UUID) *UserArticleDeleteOne
- func (c *UserArticleClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *UserArticleClient) Get(ctx context.Context, id uuid.UUID) (*UserArticle, error)
- func (c *UserArticleClient) GetX(ctx context.Context, id uuid.UUID) *UserArticle
- func (c *UserArticleClient) Hooks() []Hook
- func (c *UserArticleClient) Intercept(interceptors ...Interceptor)
- func (c *UserArticleClient) Interceptors() []Interceptor
- func (c *UserArticleClient) Query() *UserArticleQuery
- func (c *UserArticleClient) QueryArticle(ua *UserArticle) *ArticleQuery
- func (c *UserArticleClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (c *UserArticleClient) QueryUser(ua *UserArticle) *UserQuery
- func (c *UserArticleClient) Update() *UserArticleUpdate
- func (c *UserArticleClient) UpdateOne(ua *UserArticle) *UserArticleUpdateOne
- func (c *UserArticleClient) UpdateOneID(id uuid.UUID) *UserArticleUpdateOne
- func (c *UserArticleClient) Use(hooks ...Hook)
- type UserArticleCreate
- func (uac *UserArticleCreate) Exec(ctx context.Context) error
- func (c *UserArticleCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (uac *UserArticleCreate) ExecX(ctx context.Context)
- func (uac *UserArticleCreate) Mutation() *UserArticleMutation
- func (uac *UserArticleCreate) OnConflict(opts ...sql.ConflictOption) *UserArticleUpsertOne
- func (uac *UserArticleCreate) OnConflictColumns(columns ...string) *UserArticleUpsertOne
- func (c *UserArticleCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (uac *UserArticleCreate) Save(ctx context.Context) (*UserArticle, error)
- func (uac *UserArticleCreate) SaveX(ctx context.Context) *UserArticle
- func (uac *UserArticleCreate) SetArticle(a *Article) *UserArticleCreate
- func (uac *UserArticleCreate) SetArticleID(u uuid.UUID) *UserArticleCreate
- func (uac *UserArticleCreate) SetCreatedAt(t time.Time) *UserArticleCreate
- func (uac *UserArticleCreate) SetID(u uuid.UUID) *UserArticleCreate
- func (uac *UserArticleCreate) SetNillableCreatedAt(t *time.Time) *UserArticleCreate
- func (uac *UserArticleCreate) SetNillableID(u *uuid.UUID) *UserArticleCreate
- func (uac *UserArticleCreate) SetNillableUpdatedAt(t *time.Time) *UserArticleCreate
- func (uac *UserArticleCreate) SetUpdatedAt(t time.Time) *UserArticleCreate
- func (uac *UserArticleCreate) SetUser(u *User) *UserArticleCreate
- func (uac *UserArticleCreate) SetUserID(u uuid.UUID) *UserArticleCreate
- type UserArticleCreateBulk
- func (uacb *UserArticleCreateBulk) Exec(ctx context.Context) error
- func (c *UserArticleCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (uacb *UserArticleCreateBulk) ExecX(ctx context.Context)
- func (uacb *UserArticleCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserArticleUpsertBulk
- func (uacb *UserArticleCreateBulk) OnConflictColumns(columns ...string) *UserArticleUpsertBulk
- func (c *UserArticleCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (uacb *UserArticleCreateBulk) Save(ctx context.Context) ([]*UserArticle, error)
- func (uacb *UserArticleCreateBulk) SaveX(ctx context.Context) []*UserArticle
- type UserArticleDelete
- func (uad *UserArticleDelete) Exec(ctx context.Context) (int, error)
- func (c *UserArticleDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (uad *UserArticleDelete) ExecX(ctx context.Context) int
- func (c *UserArticleDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (uad *UserArticleDelete) Where(ps ...predicate.UserArticle) *UserArticleDelete
- type UserArticleDeleteOne
- type UserArticleEdges
- type UserArticleGroupBy
- func (uagb *UserArticleGroupBy) Aggregate(fns ...AggregateFunc) *UserArticleGroupBy
- func (s *UserArticleGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserArticleGroupBy) BoolX(ctx context.Context) bool
- func (s *UserArticleGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserArticleGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserArticleGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserArticleGroupBy) Float64X(ctx context.Context) float64
- func (s *UserArticleGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserArticleGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserArticleGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserArticleGroupBy) IntX(ctx context.Context) int
- func (s *UserArticleGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserArticleGroupBy) IntsX(ctx context.Context) []int
- func (uagb *UserArticleGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserArticleGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserArticleGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserArticleGroupBy) StringX(ctx context.Context) string
- func (s *UserArticleGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserArticleGroupBy) StringsX(ctx context.Context) []string
- type UserArticleMutation
- func (m *UserArticleMutation) AddField(name string, value ent.Value) error
- func (m *UserArticleMutation) AddedEdges() []string
- func (m *UserArticleMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserArticleMutation) AddedFields() []string
- func (m *UserArticleMutation) AddedIDs(name string) []ent.Value
- func (m *UserArticleMutation) ArticleCleared() bool
- func (m *UserArticleMutation) ArticleID() (r uuid.UUID, exists bool)
- func (m *UserArticleMutation) ArticleIDs() (ids []uuid.UUID)
- func (m *UserArticleMutation) ClearArticle()
- func (m *UserArticleMutation) ClearEdge(name string) error
- func (m *UserArticleMutation) ClearField(name string) error
- func (m *UserArticleMutation) ClearUser()
- func (m *UserArticleMutation) ClearedEdges() []string
- func (m *UserArticleMutation) ClearedFields() []string
- func (m UserArticleMutation) Client() *Client
- func (m *UserArticleMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserArticleMutation) EdgeCleared(name string) bool
- func (c *UserArticleMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (m *UserArticleMutation) Field(name string) (ent.Value, bool)
- func (m *UserArticleMutation) FieldCleared(name string) bool
- func (m *UserArticleMutation) Fields() []string
- func (m *UserArticleMutation) ID() (id uuid.UUID, exists bool)
- func (m *UserArticleMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *UserArticleMutation) OldArticleID(ctx context.Context) (v uuid.UUID, err error)
- func (m *UserArticleMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserArticleMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserArticleMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserArticleMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)
- func (m *UserArticleMutation) Op() Op
- func (c *UserArticleMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (m *UserArticleMutation) RemovedEdges() []string
- func (m *UserArticleMutation) RemovedIDs(name string) []ent.Value
- func (m *UserArticleMutation) ResetArticle()
- func (m *UserArticleMutation) ResetArticleID()
- func (m *UserArticleMutation) ResetCreatedAt()
- func (m *UserArticleMutation) ResetEdge(name string) error
- func (m *UserArticleMutation) ResetField(name string) error
- func (m *UserArticleMutation) ResetUpdatedAt()
- func (m *UserArticleMutation) ResetUser()
- func (m *UserArticleMutation) ResetUserID()
- func (m *UserArticleMutation) SetArticleID(u uuid.UUID)
- func (m *UserArticleMutation) SetCreatedAt(t time.Time)
- func (m *UserArticleMutation) SetField(name string, value ent.Value) error
- func (m *UserArticleMutation) SetID(id uuid.UUID)
- func (m *UserArticleMutation) SetOp(op Op)
- func (m *UserArticleMutation) SetUpdatedAt(t time.Time)
- func (m *UserArticleMutation) SetUserID(u uuid.UUID)
- func (m UserArticleMutation) Tx() (*Tx, error)
- func (m *UserArticleMutation) Type() string
- func (m *UserArticleMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserArticleMutation) UserCleared() bool
- func (m *UserArticleMutation) UserID() (r uuid.UUID, exists bool)
- func (m *UserArticleMutation) UserIDs() (ids []uuid.UUID)
- func (m *UserArticleMutation) Where(ps ...predicate.UserArticle)
- func (m *UserArticleMutation) WhereP(ps ...func(*sql.Selector))
- type UserArticleQuery
- func (uaq *UserArticleQuery) Aggregate(fns ...AggregateFunc) *UserArticleSelect
- func (uaq *UserArticleQuery) All(ctx context.Context) ([]*UserArticle, error)
- func (uaq *UserArticleQuery) AllX(ctx context.Context) []*UserArticle
- func (uaq *UserArticleQuery) Clone() *UserArticleQuery
- func (uaq *UserArticleQuery) Count(ctx context.Context) (int, error)
- func (uaq *UserArticleQuery) CountX(ctx context.Context) int
- func (c *UserArticleQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (uaq *UserArticleQuery) Exist(ctx context.Context) (bool, error)
- func (uaq *UserArticleQuery) ExistX(ctx context.Context) bool
- func (uaq *UserArticleQuery) First(ctx context.Context) (*UserArticle, error)
- func (uaq *UserArticleQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (uaq *UserArticleQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (uaq *UserArticleQuery) FirstX(ctx context.Context) *UserArticle
- func (uaq *UserArticleQuery) ForShare(opts ...sql.LockOption) *UserArticleQuery
- func (uaq *UserArticleQuery) ForUpdate(opts ...sql.LockOption) *UserArticleQuery
- func (uaq *UserArticleQuery) GroupBy(field string, fields ...string) *UserArticleGroupBy
- func (uaq *UserArticleQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (uaq *UserArticleQuery) IDsX(ctx context.Context) []uuid.UUID
- func (uaq *UserArticleQuery) Limit(limit int) *UserArticleQuery
- func (uaq *UserArticleQuery) Offset(offset int) *UserArticleQuery
- func (uaq *UserArticleQuery) Only(ctx context.Context) (*UserArticle, error)
- func (uaq *UserArticleQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (uaq *UserArticleQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (uaq *UserArticleQuery) OnlyX(ctx context.Context) *UserArticle
- func (uaq *UserArticleQuery) Order(o ...userarticle.OrderOption) *UserArticleQuery
- func (uaq *UserArticleQuery) QueryArticle() *ArticleQuery
- func (c *UserArticleQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (uaq *UserArticleQuery) QueryUser() *UserQuery
- func (uaq *UserArticleQuery) Select(fields ...string) *UserArticleSelect
- func (uaq *UserArticleQuery) Unique(unique bool) *UserArticleQuery
- func (uaq *UserArticleQuery) Where(ps ...predicate.UserArticle) *UserArticleQuery
- func (uaq *UserArticleQuery) WithArticle(opts ...func(*ArticleQuery)) *UserArticleQuery
- func (uaq *UserArticleQuery) WithUser(opts ...func(*UserQuery)) *UserArticleQuery
- type UserArticleSelect
- func (uas *UserArticleSelect) Aggregate(fns ...AggregateFunc) *UserArticleSelect
- func (s *UserArticleSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserArticleSelect) BoolX(ctx context.Context) bool
- func (s *UserArticleSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserArticleSelect) BoolsX(ctx context.Context) []bool
- func (c UserArticleSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (s *UserArticleSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserArticleSelect) Float64X(ctx context.Context) float64
- func (s *UserArticleSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserArticleSelect) Float64sX(ctx context.Context) []float64
- func (s *UserArticleSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserArticleSelect) IntX(ctx context.Context) int
- func (s *UserArticleSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserArticleSelect) IntsX(ctx context.Context) []int
- func (c UserArticleSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (uas *UserArticleSelect) Scan(ctx context.Context, v any) error
- func (s *UserArticleSelect) ScanX(ctx context.Context, v any)
- func (s *UserArticleSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserArticleSelect) StringX(ctx context.Context) string
- func (s *UserArticleSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserArticleSelect) StringsX(ctx context.Context) []string
- type UserArticleUpdate
- func (uau *UserArticleUpdate) ClearArticle() *UserArticleUpdate
- func (uau *UserArticleUpdate) ClearUser() *UserArticleUpdate
- func (uau *UserArticleUpdate) Exec(ctx context.Context) error
- func (c *UserArticleUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (uau *UserArticleUpdate) ExecX(ctx context.Context)
- func (uau *UserArticleUpdate) Mutation() *UserArticleMutation
- func (c *UserArticleUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (uau *UserArticleUpdate) Save(ctx context.Context) (int, error)
- func (uau *UserArticleUpdate) SaveX(ctx context.Context) int
- func (uau *UserArticleUpdate) SetArticle(a *Article) *UserArticleUpdate
- func (uau *UserArticleUpdate) SetArticleID(u uuid.UUID) *UserArticleUpdate
- func (uau *UserArticleUpdate) SetCreatedAt(t time.Time) *UserArticleUpdate
- func (uau *UserArticleUpdate) SetNillableCreatedAt(t *time.Time) *UserArticleUpdate
- func (uau *UserArticleUpdate) SetUpdatedAt(t time.Time) *UserArticleUpdate
- func (uau *UserArticleUpdate) SetUser(u *User) *UserArticleUpdate
- func (uau *UserArticleUpdate) SetUserID(u uuid.UUID) *UserArticleUpdate
- func (uau *UserArticleUpdate) Where(ps ...predicate.UserArticle) *UserArticleUpdate
- type UserArticleUpdateOne
- func (uauo *UserArticleUpdateOne) ClearArticle() *UserArticleUpdateOne
- func (uauo *UserArticleUpdateOne) ClearUser() *UserArticleUpdateOne
- func (uauo *UserArticleUpdateOne) Exec(ctx context.Context) error
- func (c *UserArticleUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (uauo *UserArticleUpdateOne) ExecX(ctx context.Context)
- func (uauo *UserArticleUpdateOne) Mutation() *UserArticleMutation
- func (c *UserArticleUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (uauo *UserArticleUpdateOne) Save(ctx context.Context) (*UserArticle, error)
- func (uauo *UserArticleUpdateOne) SaveX(ctx context.Context) *UserArticle
- func (uauo *UserArticleUpdateOne) Select(field string, fields ...string) *UserArticleUpdateOne
- func (uauo *UserArticleUpdateOne) SetArticle(a *Article) *UserArticleUpdateOne
- func (uauo *UserArticleUpdateOne) SetArticleID(u uuid.UUID) *UserArticleUpdateOne
- func (uauo *UserArticleUpdateOne) SetCreatedAt(t time.Time) *UserArticleUpdateOne
- func (uauo *UserArticleUpdateOne) SetNillableCreatedAt(t *time.Time) *UserArticleUpdateOne
- func (uauo *UserArticleUpdateOne) SetUpdatedAt(t time.Time) *UserArticleUpdateOne
- func (uauo *UserArticleUpdateOne) SetUser(u *User) *UserArticleUpdateOne
- func (uauo *UserArticleUpdateOne) SetUserID(u uuid.UUID) *UserArticleUpdateOne
- func (uauo *UserArticleUpdateOne) Where(ps ...predicate.UserArticle) *UserArticleUpdateOne
- type UserArticleUpsert
- func (u *UserArticleUpsert) SetArticleID(v uuid.UUID) *UserArticleUpsert
- func (u *UserArticleUpsert) SetCreatedAt(v time.Time) *UserArticleUpsert
- func (u *UserArticleUpsert) SetUpdatedAt(v time.Time) *UserArticleUpsert
- func (u *UserArticleUpsert) SetUserID(v uuid.UUID) *UserArticleUpsert
- func (u *UserArticleUpsert) UpdateArticleID() *UserArticleUpsert
- func (u *UserArticleUpsert) UpdateCreatedAt() *UserArticleUpsert
- func (u *UserArticleUpsert) UpdateUpdatedAt() *UserArticleUpsert
- func (u *UserArticleUpsert) UpdateUserID() *UserArticleUpsert
- type UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) DoNothing() *UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) Exec(ctx context.Context) error
- func (u *UserArticleUpsertBulk) ExecX(ctx context.Context)
- func (u *UserArticleUpsertBulk) Ignore() *UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) SetArticleID(v uuid.UUID) *UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) SetCreatedAt(v time.Time) *UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) SetUpdatedAt(v time.Time) *UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) SetUserID(v uuid.UUID) *UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) Update(set func(*UserArticleUpsert)) *UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) UpdateArticleID() *UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) UpdateCreatedAt() *UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) UpdateNewValues() *UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) UpdateUpdatedAt() *UserArticleUpsertBulk
- func (u *UserArticleUpsertBulk) UpdateUserID() *UserArticleUpsertBulk
- type UserArticleUpsertOne
- func (u *UserArticleUpsertOne) DoNothing() *UserArticleUpsertOne
- func (u *UserArticleUpsertOne) Exec(ctx context.Context) error
- func (u *UserArticleUpsertOne) ExecX(ctx context.Context)
- func (u *UserArticleUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *UserArticleUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *UserArticleUpsertOne) Ignore() *UserArticleUpsertOne
- func (u *UserArticleUpsertOne) SetArticleID(v uuid.UUID) *UserArticleUpsertOne
- func (u *UserArticleUpsertOne) SetCreatedAt(v time.Time) *UserArticleUpsertOne
- func (u *UserArticleUpsertOne) SetUpdatedAt(v time.Time) *UserArticleUpsertOne
- func (u *UserArticleUpsertOne) SetUserID(v uuid.UUID) *UserArticleUpsertOne
- func (u *UserArticleUpsertOne) Update(set func(*UserArticleUpsert)) *UserArticleUpsertOne
- func (u *UserArticleUpsertOne) UpdateArticleID() *UserArticleUpsertOne
- func (u *UserArticleUpsertOne) UpdateCreatedAt() *UserArticleUpsertOne
- func (u *UserArticleUpsertOne) UpdateNewValues() *UserArticleUpsertOne
- func (u *UserArticleUpsertOne) UpdateUpdatedAt() *UserArticleUpsertOne
- func (u *UserArticleUpsertOne) UpdateUserID() *UserArticleUpsertOne
- type UserArticles
- 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) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (c *UserClient) QueryUserArticles(u *User) *UserArticleQuery
- 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) AddUserArticleIDs(ids ...uuid.UUID) *UserCreate
- func (uc *UserCreate) AddUserArticles(u ...*UserArticle) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (c *UserCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, 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 (c *UserCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- 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) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableID(u *uuid.UUID) *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 (c *UserCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (ucb *UserCreateBulk) ExecX(ctx context.Context)
- func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk
- func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk
- func (c *UserCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)
- func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User
- type UserDelete
- func (ud *UserDelete) Exec(ctx context.Context) (int, error)
- func (c *UserDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (ud *UserDelete) ExecX(ctx context.Context) int
- func (c *UserDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddUserArticleIDs(ids ...uuid.UUID)
- 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) ClearUserArticles()
- 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 (c *UserMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) Op() Op
- func (c *UserMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (m *UserMutation) RemoveUserArticleIDs(ids ...uuid.UUID)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedUserArticlesIDs() (ids []uuid.UUID)
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) ResetUserArticles()
- 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) 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) UserArticlesCleared() bool
- func (m *UserMutation) UserArticlesIDs() (ids []uuid.UUID)
- 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 (c *UserQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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) ForShare(opts ...sql.LockOption) *UserQuery
- func (uq *UserQuery) ForUpdate(opts ...sql.LockOption) *UserQuery
- 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 ...user.OrderOption) *UserQuery
- func (c *UserQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (uq *UserQuery) QueryUserArticles() *UserArticleQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithUserArticles(opts ...func(*UserArticleQuery)) *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 (c UserSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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 (c UserSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- 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) AddUserArticleIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) AddUserArticles(u ...*UserArticle) *UserUpdate
- func (uu *UserUpdate) ClearUserArticles() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (c *UserUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (c *UserUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (uu *UserUpdate) RemoveUserArticleIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) RemoveUserArticles(u ...*UserArticle) *UserUpdate
- 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) SetNillableCreatedAt(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) AddUserArticleIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) AddUserArticles(u ...*UserArticle) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearUserArticles() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (c *UserUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (c *UserUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (uuo *UserUpdateOne) RemoveUserArticleIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveUserArticles(u ...*UserArticle) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type UserUpsert
- type UserUpsertBulk
- func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk
- func (u *UserUpsertBulk) Exec(ctx context.Context) error
- func (u *UserUpsertBulk) ExecX(ctx context.Context)
- func (u *UserUpsertBulk) Ignore() *UserUpsertBulk
- func (u *UserUpsertBulk) SetCreatedAt(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) 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) SetUpdatedAt(v time.Time) *UserUpsertOne
- func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne
- func (u *UserUpsertOne) UpdateCreatedAt() *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" TypeUser = "User" TypeUserArticle = "UserArticle" )
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"` // 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) ExecContext ¶
func (c *Article) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Article) QueryContext ¶
func (c *Article) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*Article) QueryTags ¶
func (a *Article) QueryTags() *ArticleTagQuery
QueryTags queries the "tags" edge of the Article entity.
func (*Article) QueryUserArticles ¶
func (a *Article) QueryUserArticles() *UserArticleQuery
QueryUserArticles queries the "user_articles" 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) ExecContext ¶
func (c *ArticleClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *ArticleClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*ArticleClient) QueryTags ¶
func (c *ArticleClient) QueryTags(a *Article) *ArticleTagQuery
QueryTags queries the tags edge of a Article.
func (*ArticleClient) QueryUserArticles ¶
func (c *ArticleClient) QueryUserArticles(a *Article) *UserArticleQuery
QueryUserArticles queries the user_articles 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) 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) AddUserArticleIDs ¶
func (ac *ArticleCreate) AddUserArticleIDs(ids ...uuid.UUID) *ArticleCreate
AddUserArticleIDs adds the "user_articles" edge to the UserArticle entity by IDs.
func (*ArticleCreate) AddUserArticles ¶
func (ac *ArticleCreate) AddUserArticles(u ...*UserArticle) *ArticleCreate
AddUserArticles adds the "user_articles" edges to the UserArticle entity.
func (*ArticleCreate) Exec ¶
func (ac *ArticleCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleCreate) ExecContext ¶
func (c *ArticleCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *ArticleCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) 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) 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) ExecContext ¶
func (c *ArticleCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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)
func (*ArticleCreateBulk) QueryContext ¶
func (c *ArticleCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) ExecContext ¶
func (c *ArticleDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*ArticleDelete) ExecX ¶
func (ad *ArticleDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ArticleDelete) QueryContext ¶
func (c *ArticleDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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"` // UserArticles holds the value of the user_articles edge. UserArticles []*UserArticle `json:"user_articles,omitempty"` // contains filtered or unexported fields }
ArticleEdges holds the relations/edges for other nodes in the graph.
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.
func (ArticleEdges) UserArticlesOrErr ¶
func (e ArticleEdges) UserArticlesOrErr() ([]*UserArticle, error)
UserArticlesOrErr returns the UserArticles value or an error if the edge was not loaded in eager-loading.
type ArticleGroupBy ¶
type ArticleGroupBy struct {
// contains filtered or unexported fields
}
ArticleGroupBy is the group-by builder for Article entities.
func (*ArticleGroupBy) Aggregate ¶
func (agb *ArticleGroupBy) Aggregate(fns ...AggregateFunc) *ArticleGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ArticleGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ArticleGroupBy) Scan ¶
func (agb *ArticleGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ArticleGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ArticleMutation ¶
type ArticleMutation struct {
// contains filtered or unexported fields
}
ArticleMutation represents an operation that mutates the Article nodes in the graph.
func (*ArticleMutation) AddField ¶
func (m *ArticleMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*ArticleMutation) AddTagIDs ¶
func (m *ArticleMutation) AddTagIDs(ids ...uuid.UUID)
AddTagIDs adds the "tags" edge to the ArticleTag entity by ids.
func (*ArticleMutation) AddUserArticleIDs ¶
func (m *ArticleMutation) AddUserArticleIDs(ids ...uuid.UUID)
AddUserArticleIDs adds the "user_articles" edge to the UserArticle entity by ids.
func (*ArticleMutation) AddedEdges ¶
func (m *ArticleMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ArticleMutation) AddedField ¶
func (m *ArticleMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*ArticleMutation) AddedFields ¶
func (m *ArticleMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ArticleMutation) AddedIDs ¶
func (m *ArticleMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ArticleMutation) ClearEdge ¶
func (m *ArticleMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*ArticleMutation) ClearField ¶
func (m *ArticleMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*ArticleMutation) ClearTags ¶
func (m *ArticleMutation) ClearTags()
ClearTags clears the "tags" edge to the ArticleTag entity.
func (*ArticleMutation) ClearUserArticles ¶
func (m *ArticleMutation) ClearUserArticles()
ClearUserArticles clears the "user_articles" edge to the UserArticle 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) 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) ExecContext ¶
func (c *ArticleMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) 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) QueryContext ¶
func (c *ArticleMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*ArticleMutation) RemoveTagIDs ¶
func (m *ArticleMutation) RemoveTagIDs(ids ...uuid.UUID)
RemoveTagIDs removes the "tags" edge to the ArticleTag entity by IDs.
func (*ArticleMutation) RemoveUserArticleIDs ¶
func (m *ArticleMutation) RemoveUserArticleIDs(ids ...uuid.UUID)
RemoveUserArticleIDs removes the "user_articles" edge to the UserArticle entity by IDs.
func (*ArticleMutation) RemovedEdges ¶
func (m *ArticleMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ArticleMutation) RemovedIDs ¶
func (m *ArticleMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*ArticleMutation) RemovedTagsIDs ¶
func (m *ArticleMutation) RemovedTagsIDs() (ids []uuid.UUID)
RemovedTags returns the removed IDs of the "tags" edge to the ArticleTag entity.
func (*ArticleMutation) RemovedUserArticlesIDs ¶
func (m *ArticleMutation) RemovedUserArticlesIDs() (ids []uuid.UUID)
RemovedUserArticles returns the removed IDs of the "user_articles" edge to the UserArticle entity.
func (*ArticleMutation) ResetCreatedAt ¶
func (m *ArticleMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_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) 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) ResetUserArticles ¶
func (m *ArticleMutation) ResetUserArticles()
ResetUserArticles resets all changes to the "user_articles" edge.
func (*ArticleMutation) SetCreatedAt ¶
func (m *ArticleMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_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) UserArticlesCleared ¶
func (m *ArticleMutation) UserArticlesCleared() bool
UserArticlesCleared reports if the "user_articles" edge to the UserArticle entity was cleared.
func (*ArticleMutation) UserArticlesIDs ¶
func (m *ArticleMutation) UserArticlesIDs() (ids []uuid.UUID)
UserArticlesIDs returns the "user_articles" edge IDs 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) ExecContext ¶
func (c *ArticleQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) ForShare ¶
func (aq *ArticleQuery) ForShare(opts ...sql.LockOption) *ArticleQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*ArticleQuery) ForUpdate ¶
func (aq *ArticleQuery) ForUpdate(opts ...sql.LockOption) *ArticleQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
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 ...article.OrderOption) *ArticleQuery
Order specifies how the records should be ordered.
func (*ArticleQuery) QueryContext ¶
func (c *ArticleQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*ArticleQuery) QueryTags ¶
func (aq *ArticleQuery) QueryTags() *ArticleTagQuery
QueryTags chains the current query on the "tags" edge.
func (*ArticleQuery) QueryUserArticles ¶
func (aq *ArticleQuery) QueryUserArticles() *UserArticleQuery
QueryUserArticles chains the current query on the "user_articles" 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) 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.
func (*ArticleQuery) WithUserArticles ¶
func (aq *ArticleQuery) WithUserArticles(opts ...func(*UserArticleQuery)) *ArticleQuery
WithUserArticles tells the query-builder to eager-load the nodes that are connected to the "user_articles" 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) ExecContext ¶
func (c ArticleSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c ArticleSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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"` // 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) ExecContext ¶
func (c *ArticleTag) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*ArticleTag) QueryArticle ¶
func (at *ArticleTag) QueryArticle() *ArticleQuery
QueryArticle queries the "article" edge of the ArticleTag entity.
func (*ArticleTag) QueryContext ¶
func (c *ArticleTag) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) ExecContext ¶
func (c *ArticleTagClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *ArticleTagClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) ExecContext ¶
func (c *ArticleTagCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *ArticleTagCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) SetID ¶
func (atc *ArticleTagCreate) SetID(u uuid.UUID) *ArticleTagCreate
SetID sets the "id" field.
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) SetTag ¶
func (atc *ArticleTagCreate) SetTag(s string) *ArticleTagCreate
SetTag sets the "tag" 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) ExecContext ¶
func (c *ArticleTagCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *ArticleTagCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) ExecContext ¶
func (c *ArticleTagDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*ArticleTagDelete) ExecX ¶
func (atd *ArticleTagDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ArticleTagDelete) QueryContext ¶
func (c *ArticleTagDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) 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) ExecContext ¶
func (c *ArticleTagMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) 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) QueryContext ¶
func (c *ArticleTagMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) 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) SetArticleID ¶
func (m *ArticleTagMutation) SetArticleID(u uuid.UUID)
SetArticleID sets the "article_id" 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) 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) 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) ExecContext ¶
func (c *ArticleTagQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) ForShare ¶
func (atq *ArticleTagQuery) ForShare(opts ...sql.LockOption) *ArticleTagQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*ArticleTagQuery) ForUpdate ¶
func (atq *ArticleTagQuery) ForUpdate(opts ...sql.LockOption) *ArticleTagQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
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 ...articletag.OrderOption) *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) QueryContext ¶
func (c *ArticleTagQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) ExecContext ¶
func (c ArticleTagSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c ArticleTagSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) ExecContext ¶
func (c *ArticleTagUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *ArticleTagUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) SetTag ¶
func (atu *ArticleTagUpdate) SetTag(s string) *ArticleTagUpdate
SetTag sets the "tag" 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) ExecContext ¶
func (c *ArticleTagUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *ArticleTagUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) SetTag ¶
func (atuo *ArticleTagUpdateOne) SetTag(s string) *ArticleTagUpdateOne
SetTag sets the "tag" 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) SetTag ¶
func (u *ArticleTagUpsert) SetTag(v string) *ArticleTagUpsert
SetTag sets the "tag" 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) UpdateTag ¶
func (u *ArticleTagUpsert) UpdateTag() *ArticleTagUpsert
UpdateTag sets the "tag" 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) SetTag ¶
func (u *ArticleTagUpsertBulk) SetTag(v string) *ArticleTagUpsertBulk
SetTag sets the "tag" 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) 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.
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) SetTag ¶
func (u *ArticleTagUpsertOne) SetTag(v string) *ArticleTagUpsertOne
SetTag sets the "tag" 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) 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.
type ArticleUpdate ¶
type ArticleUpdate struct {
// contains filtered or unexported fields
}
ArticleUpdate is the builder for updating Article entities.
func (*ArticleUpdate) AddTagIDs ¶
func (au *ArticleUpdate) AddTagIDs(ids ...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) AddUserArticleIDs ¶
func (au *ArticleUpdate) AddUserArticleIDs(ids ...uuid.UUID) *ArticleUpdate
AddUserArticleIDs adds the "user_articles" edge to the UserArticle entity by IDs.
func (*ArticleUpdate) AddUserArticles ¶
func (au *ArticleUpdate) AddUserArticles(u ...*UserArticle) *ArticleUpdate
AddUserArticles adds the "user_articles" edges to the UserArticle entity.
func (*ArticleUpdate) ClearTags ¶
func (au *ArticleUpdate) ClearTags() *ArticleUpdate
ClearTags clears all "tags" edges to the ArticleTag entity.
func (*ArticleUpdate) ClearUserArticles ¶
func (au *ArticleUpdate) ClearUserArticles() *ArticleUpdate
ClearUserArticles clears all "user_articles" edges to the UserArticle entity.
func (*ArticleUpdate) Exec ¶
func (au *ArticleUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ArticleUpdate) ExecContext ¶
func (c *ArticleUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *ArticleUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) RemoveUserArticleIDs ¶
func (au *ArticleUpdate) RemoveUserArticleIDs(ids ...uuid.UUID) *ArticleUpdate
RemoveUserArticleIDs removes the "user_articles" edge to UserArticle entities by IDs.
func (*ArticleUpdate) RemoveUserArticles ¶
func (au *ArticleUpdate) RemoveUserArticles(u ...*UserArticle) *ArticleUpdate
RemoveUserArticles removes "user_articles" edges to UserArticle 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) 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) 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) 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) AddUserArticleIDs ¶
func (auo *ArticleUpdateOne) AddUserArticleIDs(ids ...uuid.UUID) *ArticleUpdateOne
AddUserArticleIDs adds the "user_articles" edge to the UserArticle entity by IDs.
func (*ArticleUpdateOne) AddUserArticles ¶
func (auo *ArticleUpdateOne) AddUserArticles(u ...*UserArticle) *ArticleUpdateOne
AddUserArticles adds the "user_articles" edges to the UserArticle entity.
func (*ArticleUpdateOne) ClearTags ¶
func (auo *ArticleUpdateOne) ClearTags() *ArticleUpdateOne
ClearTags clears all "tags" edges to the ArticleTag entity.
func (*ArticleUpdateOne) ClearUserArticles ¶
func (auo *ArticleUpdateOne) ClearUserArticles() *ArticleUpdateOne
ClearUserArticles clears all "user_articles" edges to the UserArticle entity.
func (*ArticleUpdateOne) Exec ¶
func (auo *ArticleUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ArticleUpdateOne) ExecContext ¶
func (c *ArticleUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *ArticleUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) RemoveUserArticleIDs ¶
func (auo *ArticleUpdateOne) RemoveUserArticleIDs(ids ...uuid.UUID) *ArticleUpdateOne
RemoveUserArticleIDs removes the "user_articles" edge to UserArticle entities by IDs.
func (*ArticleUpdateOne) RemoveUserArticles ¶
func (auo *ArticleUpdateOne) RemoveUserArticles(u ...*UserArticle) *ArticleUpdateOne
RemoveUserArticles removes "user_articles" edges to UserArticle 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) 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) 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) SetCreatedAt ¶
func (u *ArticleUpsert) SetCreatedAt(v time.Time) *ArticleUpsert
SetCreatedAt sets the "created_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) 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) 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) 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) 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) 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) 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) 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 // User is the client for interacting with the User builders. User *UserClient // UserArticle is the client for interacting with the UserArticle builders. UserArticle *UserArticleClient // 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) ExecContext ¶
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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(...)`.
func (*Client) QueryContext ¶
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type 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 // User is the client for interacting with the User builders. User *UserClient // UserArticle is the client for interacting with the UserArticle builders. UserArticle *UserArticleClient // 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) ExecContext ¶
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
func (*Tx) QueryContext ¶
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
type User ¶
type User struct { // ID of the ent. ID uuid.UUID `json:"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 UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) ExecContext ¶
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*User) QueryContext ¶
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*User) QueryUserArticles ¶
func (u *User) QueryUserArticles() *UserArticleQuery
QueryUserArticles queries the "user_articles" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserArticle ¶
type UserArticle 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"` // 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 UserArticleQuery when eager-loading is set. Edges UserArticleEdges `json:"edges"` // contains filtered or unexported fields }
UserArticle is the model entity for the UserArticle schema.
func (*UserArticle) ExecContext ¶
func (c *UserArticle) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*UserArticle) QueryArticle ¶
func (ua *UserArticle) QueryArticle() *ArticleQuery
QueryArticle queries the "article" edge of the UserArticle entity.
func (*UserArticle) QueryContext ¶
func (c *UserArticle) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserArticle) QueryUser ¶
func (ua *UserArticle) QueryUser() *UserQuery
QueryUser queries the "user" edge of the UserArticle entity.
func (*UserArticle) String ¶
func (ua *UserArticle) String() string
String implements the fmt.Stringer.
func (*UserArticle) Unwrap ¶
func (ua *UserArticle) Unwrap() *UserArticle
Unwrap unwraps the UserArticle 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 (*UserArticle) Update ¶
func (ua *UserArticle) Update() *UserArticleUpdateOne
Update returns a builder for updating this UserArticle. Note that you need to call UserArticle.Unwrap() before calling this method if this UserArticle was returned from a transaction, and the transaction was committed or rolled back.
type UserArticleClient ¶
type UserArticleClient struct {
// contains filtered or unexported fields
}
UserArticleClient is a client for the UserArticle schema.
func NewUserArticleClient ¶
func NewUserArticleClient(c config) *UserArticleClient
NewUserArticleClient returns a client for the UserArticle from the given config.
func (*UserArticleClient) Create ¶
func (c *UserArticleClient) Create() *UserArticleCreate
Create returns a builder for creating a UserArticle entity.
func (*UserArticleClient) CreateBulk ¶
func (c *UserArticleClient) CreateBulk(builders ...*UserArticleCreate) *UserArticleCreateBulk
CreateBulk returns a builder for creating a bulk of UserArticle entities.
func (*UserArticleClient) Delete ¶
func (c *UserArticleClient) Delete() *UserArticleDelete
Delete returns a delete builder for UserArticle.
func (*UserArticleClient) DeleteOne ¶
func (c *UserArticleClient) DeleteOne(ua *UserArticle) *UserArticleDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserArticleClient) DeleteOneID ¶
func (c *UserArticleClient) DeleteOneID(id uuid.UUID) *UserArticleDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserArticleClient) ExecContext ¶
func (c *UserArticleClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*UserArticleClient) Get ¶
func (c *UserArticleClient) Get(ctx context.Context, id uuid.UUID) (*UserArticle, error)
Get returns a UserArticle entity by its id.
func (*UserArticleClient) GetX ¶
func (c *UserArticleClient) GetX(ctx context.Context, id uuid.UUID) *UserArticle
GetX is like Get, but panics if an error occurs.
func (*UserArticleClient) Hooks ¶
func (c *UserArticleClient) Hooks() []Hook
Hooks returns the client hooks.
func (*UserArticleClient) Intercept ¶
func (c *UserArticleClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `userarticle.Intercept(f(g(h())))`.
func (*UserArticleClient) Interceptors ¶
func (c *UserArticleClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserArticleClient) Query ¶
func (c *UserArticleClient) Query() *UserArticleQuery
Query returns a query builder for UserArticle.
func (*UserArticleClient) QueryArticle ¶
func (c *UserArticleClient) QueryArticle(ua *UserArticle) *ArticleQuery
QueryArticle queries the article edge of a UserArticle.
func (*UserArticleClient) QueryContext ¶
func (c *UserArticleClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserArticleClient) QueryUser ¶
func (c *UserArticleClient) QueryUser(ua *UserArticle) *UserQuery
QueryUser queries the user edge of a UserArticle.
func (*UserArticleClient) Update ¶
func (c *UserArticleClient) Update() *UserArticleUpdate
Update returns an update builder for UserArticle.
func (*UserArticleClient) UpdateOne ¶
func (c *UserArticleClient) UpdateOne(ua *UserArticle) *UserArticleUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserArticleClient) UpdateOneID ¶
func (c *UserArticleClient) UpdateOneID(id uuid.UUID) *UserArticleUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserArticleClient) Use ¶
func (c *UserArticleClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `userarticle.Hooks(f(g(h())))`.
type UserArticleCreate ¶
type UserArticleCreate struct {
// contains filtered or unexported fields
}
UserArticleCreate is the builder for creating a UserArticle entity.
func (*UserArticleCreate) Exec ¶
func (uac *UserArticleCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserArticleCreate) ExecContext ¶
func (c *UserArticleCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*UserArticleCreate) ExecX ¶
func (uac *UserArticleCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserArticleCreate) Mutation ¶
func (uac *UserArticleCreate) Mutation() *UserArticleMutation
Mutation returns the UserArticleMutation object of the builder.
func (*UserArticleCreate) OnConflict ¶
func (uac *UserArticleCreate) OnConflict(opts ...sql.ConflictOption) *UserArticleUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.UserArticle.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.UserArticleUpsert) { SetArticleID(v+v). }). Exec(ctx)
func (*UserArticleCreate) OnConflictColumns ¶
func (uac *UserArticleCreate) OnConflictColumns(columns ...string) *UserArticleUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.UserArticle.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*UserArticleCreate) QueryContext ¶
func (c *UserArticleCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserArticleCreate) Save ¶
func (uac *UserArticleCreate) Save(ctx context.Context) (*UserArticle, error)
Save creates the UserArticle in the database.
func (*UserArticleCreate) SaveX ¶
func (uac *UserArticleCreate) SaveX(ctx context.Context) *UserArticle
SaveX calls Save and panics if Save returns an error.
func (*UserArticleCreate) SetArticle ¶
func (uac *UserArticleCreate) SetArticle(a *Article) *UserArticleCreate
SetArticle sets the "article" edge to the Article entity.
func (*UserArticleCreate) SetArticleID ¶
func (uac *UserArticleCreate) SetArticleID(u uuid.UUID) *UserArticleCreate
SetArticleID sets the "article_id" field.
func (*UserArticleCreate) SetCreatedAt ¶
func (uac *UserArticleCreate) SetCreatedAt(t time.Time) *UserArticleCreate
SetCreatedAt sets the "created_at" field.
func (*UserArticleCreate) SetID ¶
func (uac *UserArticleCreate) SetID(u uuid.UUID) *UserArticleCreate
SetID sets the "id" field.
func (*UserArticleCreate) SetNillableCreatedAt ¶
func (uac *UserArticleCreate) SetNillableCreatedAt(t *time.Time) *UserArticleCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserArticleCreate) SetNillableID ¶
func (uac *UserArticleCreate) SetNillableID(u *uuid.UUID) *UserArticleCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*UserArticleCreate) SetNillableUpdatedAt ¶
func (uac *UserArticleCreate) SetNillableUpdatedAt(t *time.Time) *UserArticleCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserArticleCreate) SetUpdatedAt ¶
func (uac *UserArticleCreate) SetUpdatedAt(t time.Time) *UserArticleCreate
SetUpdatedAt sets the "updated_at" field.
func (*UserArticleCreate) SetUser ¶
func (uac *UserArticleCreate) SetUser(u *User) *UserArticleCreate
SetUser sets the "user" edge to the User entity.
func (*UserArticleCreate) SetUserID ¶
func (uac *UserArticleCreate) SetUserID(u uuid.UUID) *UserArticleCreate
SetUserID sets the "user_id" field.
type UserArticleCreateBulk ¶
type UserArticleCreateBulk struct {
// contains filtered or unexported fields
}
UserArticleCreateBulk is the builder for creating many UserArticle entities in bulk.
func (*UserArticleCreateBulk) Exec ¶
func (uacb *UserArticleCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserArticleCreateBulk) ExecContext ¶
func (c *UserArticleCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*UserArticleCreateBulk) ExecX ¶
func (uacb *UserArticleCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserArticleCreateBulk) OnConflict ¶
func (uacb *UserArticleCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserArticleUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.UserArticle.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.UserArticleUpsert) { SetArticleID(v+v). }). Exec(ctx)
func (*UserArticleCreateBulk) OnConflictColumns ¶
func (uacb *UserArticleCreateBulk) OnConflictColumns(columns ...string) *UserArticleUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.UserArticle.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*UserArticleCreateBulk) QueryContext ¶
func (c *UserArticleCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserArticleCreateBulk) Save ¶
func (uacb *UserArticleCreateBulk) Save(ctx context.Context) ([]*UserArticle, error)
Save creates the UserArticle entities in the database.
func (*UserArticleCreateBulk) SaveX ¶
func (uacb *UserArticleCreateBulk) SaveX(ctx context.Context) []*UserArticle
SaveX is like Save, but panics if an error occurs.
type UserArticleDelete ¶
type UserArticleDelete struct {
// contains filtered or unexported fields
}
UserArticleDelete is the builder for deleting a UserArticle entity.
func (*UserArticleDelete) Exec ¶
func (uad *UserArticleDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserArticleDelete) ExecContext ¶
func (c *UserArticleDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*UserArticleDelete) ExecX ¶
func (uad *UserArticleDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserArticleDelete) QueryContext ¶
func (c *UserArticleDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserArticleDelete) Where ¶
func (uad *UserArticleDelete) Where(ps ...predicate.UserArticle) *UserArticleDelete
Where appends a list predicates to the UserArticleDelete builder.
type UserArticleDeleteOne ¶
type UserArticleDeleteOne struct {
// contains filtered or unexported fields
}
UserArticleDeleteOne is the builder for deleting a single UserArticle entity.
func (*UserArticleDeleteOne) Exec ¶
func (uado *UserArticleDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserArticleDeleteOne) ExecX ¶
func (uado *UserArticleDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserArticleDeleteOne) Where ¶
func (uado *UserArticleDeleteOne) Where(ps ...predicate.UserArticle) *UserArticleDeleteOne
Where appends a list predicates to the UserArticleDelete builder.
type UserArticleEdges ¶
type UserArticleEdges struct { // Article holds the value of the article edge. Article *Article `json:"article,omitempty"` // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
UserArticleEdges holds the relations/edges for other nodes in the graph.
func (UserArticleEdges) ArticleOrErr ¶
func (e UserArticleEdges) 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.
func (UserArticleEdges) UserOrErr ¶
func (e UserArticleEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type UserArticleGroupBy ¶
type UserArticleGroupBy struct {
// contains filtered or unexported fields
}
UserArticleGroupBy is the group-by builder for UserArticle entities.
func (*UserArticleGroupBy) Aggregate ¶
func (uagb *UserArticleGroupBy) Aggregate(fns ...AggregateFunc) *UserArticleGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserArticleGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserArticleGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserArticleGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserArticleGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserArticleGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserArticleGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserArticleGroupBy) Scan ¶
func (uagb *UserArticleGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserArticleGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserArticleMutation ¶
type UserArticleMutation struct {
// contains filtered or unexported fields
}
UserArticleMutation represents an operation that mutates the UserArticle nodes in the graph.
func (*UserArticleMutation) AddField ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) AddedEdges ¶
func (m *UserArticleMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserArticleMutation) AddedField ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) AddedFields ¶
func (m *UserArticleMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserArticleMutation) AddedIDs ¶
func (m *UserArticleMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserArticleMutation) ArticleCleared ¶
func (m *UserArticleMutation) ArticleCleared() bool
ArticleCleared reports if the "article" edge to the Article entity was cleared.
func (*UserArticleMutation) ArticleID ¶
func (m *UserArticleMutation) ArticleID() (r uuid.UUID, exists bool)
ArticleID returns the value of the "article_id" field in the mutation.
func (*UserArticleMutation) ArticleIDs ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) ClearArticle ¶
func (m *UserArticleMutation) ClearArticle()
ClearArticle clears the "article" edge to the Article entity.
func (*UserArticleMutation) ClearEdge ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) ClearField ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) ClearUser ¶
func (m *UserArticleMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*UserArticleMutation) ClearedEdges ¶
func (m *UserArticleMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserArticleMutation) ClearedFields ¶
func (m *UserArticleMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserArticleMutation) Client ¶
func (m UserArticleMutation) 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 (*UserArticleMutation) CreatedAt ¶
func (m *UserArticleMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserArticleMutation) EdgeCleared ¶
func (m *UserArticleMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserArticleMutation) ExecContext ¶
func (c *UserArticleMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*UserArticleMutation) Field ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) FieldCleared ¶
func (m *UserArticleMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserArticleMutation) Fields ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) ID ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) 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 (*UserArticleMutation) OldArticleID ¶
OldArticleID returns the old "article_id" field's value of the UserArticle entity. If the UserArticle 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 (*UserArticleMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the UserArticle entity. If the UserArticle 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 (*UserArticleMutation) 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 (*UserArticleMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the UserArticle entity. If the UserArticle 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 (*UserArticleMutation) OldUserID ¶
OldUserID returns the old "user_id" field's value of the UserArticle entity. If the UserArticle 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 (*UserArticleMutation) Op ¶
func (m *UserArticleMutation) Op() Op
Op returns the operation name.
func (*UserArticleMutation) QueryContext ¶
func (c *UserArticleMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserArticleMutation) RemovedEdges ¶
func (m *UserArticleMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserArticleMutation) RemovedIDs ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) ResetArticle ¶
func (m *UserArticleMutation) ResetArticle()
ResetArticle resets all changes to the "article" edge.
func (*UserArticleMutation) ResetArticleID ¶
func (m *UserArticleMutation) ResetArticleID()
ResetArticleID resets all changes to the "article_id" field.
func (*UserArticleMutation) ResetCreatedAt ¶
func (m *UserArticleMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserArticleMutation) ResetEdge ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) ResetField ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) ResetUpdatedAt ¶
func (m *UserArticleMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserArticleMutation) ResetUser ¶
func (m *UserArticleMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*UserArticleMutation) ResetUserID ¶
func (m *UserArticleMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*UserArticleMutation) SetArticleID ¶
func (m *UserArticleMutation) SetArticleID(u uuid.UUID)
SetArticleID sets the "article_id" field.
func (*UserArticleMutation) SetCreatedAt ¶
func (m *UserArticleMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserArticleMutation) SetField ¶
func (m *UserArticleMutation) 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 (*UserArticleMutation) SetID ¶
func (m *UserArticleMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of UserArticle entities.
func (*UserArticleMutation) SetOp ¶
func (m *UserArticleMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserArticleMutation) SetUpdatedAt ¶
func (m *UserArticleMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*UserArticleMutation) SetUserID ¶
func (m *UserArticleMutation) SetUserID(u uuid.UUID)
SetUserID sets the "user_id" field.
func (UserArticleMutation) Tx ¶
func (m UserArticleMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserArticleMutation) Type ¶
func (m *UserArticleMutation) Type() string
Type returns the node type of this mutation (UserArticle).
func (*UserArticleMutation) UpdatedAt ¶
func (m *UserArticleMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserArticleMutation) UserCleared ¶
func (m *UserArticleMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*UserArticleMutation) UserID ¶
func (m *UserArticleMutation) UserID() (r uuid.UUID, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*UserArticleMutation) UserIDs ¶
func (m *UserArticleMutation) UserIDs() (ids []uuid.UUID)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*UserArticleMutation) Where ¶
func (m *UserArticleMutation) Where(ps ...predicate.UserArticle)
Where appends a list predicates to the UserArticleMutation builder.
func (*UserArticleMutation) WhereP ¶
func (m *UserArticleMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserArticleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserArticleQuery ¶
type UserArticleQuery struct {
// contains filtered or unexported fields
}
UserArticleQuery is the builder for querying UserArticle entities.
func (*UserArticleQuery) Aggregate ¶
func (uaq *UserArticleQuery) Aggregate(fns ...AggregateFunc) *UserArticleSelect
Aggregate returns a UserArticleSelect configured with the given aggregations.
func (*UserArticleQuery) All ¶
func (uaq *UserArticleQuery) All(ctx context.Context) ([]*UserArticle, error)
All executes the query and returns a list of UserArticles.
func (*UserArticleQuery) AllX ¶
func (uaq *UserArticleQuery) AllX(ctx context.Context) []*UserArticle
AllX is like All, but panics if an error occurs.
func (*UserArticleQuery) Clone ¶
func (uaq *UserArticleQuery) Clone() *UserArticleQuery
Clone returns a duplicate of the UserArticleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserArticleQuery) Count ¶
func (uaq *UserArticleQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*UserArticleQuery) CountX ¶
func (uaq *UserArticleQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*UserArticleQuery) ExecContext ¶
func (c *UserArticleQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*UserArticleQuery) Exist ¶
func (uaq *UserArticleQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*UserArticleQuery) ExistX ¶
func (uaq *UserArticleQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*UserArticleQuery) First ¶
func (uaq *UserArticleQuery) First(ctx context.Context) (*UserArticle, error)
First returns the first UserArticle entity from the query. Returns a *NotFoundError when no UserArticle was found.
func (*UserArticleQuery) FirstID ¶
FirstID returns the first UserArticle ID from the query. Returns a *NotFoundError when no UserArticle ID was found.
func (*UserArticleQuery) FirstIDX ¶
func (uaq *UserArticleQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*UserArticleQuery) FirstX ¶
func (uaq *UserArticleQuery) FirstX(ctx context.Context) *UserArticle
FirstX is like First, but panics if an error occurs.
func (*UserArticleQuery) ForShare ¶
func (uaq *UserArticleQuery) ForShare(opts ...sql.LockOption) *UserArticleQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*UserArticleQuery) ForUpdate ¶
func (uaq *UserArticleQuery) ForUpdate(opts ...sql.LockOption) *UserArticleQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
func (*UserArticleQuery) GroupBy ¶
func (uaq *UserArticleQuery) GroupBy(field string, fields ...string) *UserArticleGroupBy
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.UserArticle.Query(). GroupBy(userarticle.FieldArticleID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserArticleQuery) IDsX ¶
func (uaq *UserArticleQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*UserArticleQuery) Limit ¶
func (uaq *UserArticleQuery) Limit(limit int) *UserArticleQuery
Limit the number of records to be returned by this query.
func (*UserArticleQuery) Offset ¶
func (uaq *UserArticleQuery) Offset(offset int) *UserArticleQuery
Offset to start from.
func (*UserArticleQuery) Only ¶
func (uaq *UserArticleQuery) Only(ctx context.Context) (*UserArticle, error)
Only returns a single UserArticle entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserArticle entity is found. Returns a *NotFoundError when no UserArticle entities are found.
func (*UserArticleQuery) OnlyID ¶
OnlyID is like Only, but returns the only UserArticle ID in the query. Returns a *NotSingularError when more than one UserArticle ID is found. Returns a *NotFoundError when no entities are found.
func (*UserArticleQuery) OnlyIDX ¶
func (uaq *UserArticleQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*UserArticleQuery) OnlyX ¶
func (uaq *UserArticleQuery) OnlyX(ctx context.Context) *UserArticle
OnlyX is like Only, but panics if an error occurs.
func (*UserArticleQuery) Order ¶
func (uaq *UserArticleQuery) Order(o ...userarticle.OrderOption) *UserArticleQuery
Order specifies how the records should be ordered.
func (*UserArticleQuery) QueryArticle ¶
func (uaq *UserArticleQuery) QueryArticle() *ArticleQuery
QueryArticle chains the current query on the "article" edge.
func (*UserArticleQuery) QueryContext ¶
func (c *UserArticleQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserArticleQuery) QueryUser ¶
func (uaq *UserArticleQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*UserArticleQuery) Select ¶
func (uaq *UserArticleQuery) Select(fields ...string) *UserArticleSelect
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.UserArticle.Query(). Select(userarticle.FieldArticleID). Scan(ctx, &v)
func (*UserArticleQuery) Unique ¶
func (uaq *UserArticleQuery) Unique(unique bool) *UserArticleQuery
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 (*UserArticleQuery) Where ¶
func (uaq *UserArticleQuery) Where(ps ...predicate.UserArticle) *UserArticleQuery
Where adds a new predicate for the UserArticleQuery builder.
func (*UserArticleQuery) WithArticle ¶
func (uaq *UserArticleQuery) WithArticle(opts ...func(*ArticleQuery)) *UserArticleQuery
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.
func (*UserArticleQuery) WithUser ¶
func (uaq *UserArticleQuery) WithUser(opts ...func(*UserQuery)) *UserArticleQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type UserArticleSelect ¶
type UserArticleSelect struct { *UserArticleQuery // contains filtered or unexported fields }
UserArticleSelect is the builder for selecting fields of UserArticle entities.
func (*UserArticleSelect) Aggregate ¶
func (uas *UserArticleSelect) Aggregate(fns ...AggregateFunc) *UserArticleSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserArticleSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserArticleSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (UserArticleSelect) ExecContext ¶
func (c UserArticleSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*UserArticleSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserArticleSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserArticleSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserArticleSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (UserArticleSelect) QueryContext ¶
func (c UserArticleSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserArticleSelect) Scan ¶
func (uas *UserArticleSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserArticleSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserArticleUpdate ¶
type UserArticleUpdate struct {
// contains filtered or unexported fields
}
UserArticleUpdate is the builder for updating UserArticle entities.
func (*UserArticleUpdate) ClearArticle ¶
func (uau *UserArticleUpdate) ClearArticle() *UserArticleUpdate
ClearArticle clears the "article" edge to the Article entity.
func (*UserArticleUpdate) ClearUser ¶
func (uau *UserArticleUpdate) ClearUser() *UserArticleUpdate
ClearUser clears the "user" edge to the User entity.
func (*UserArticleUpdate) Exec ¶
func (uau *UserArticleUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserArticleUpdate) ExecContext ¶
func (c *UserArticleUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*UserArticleUpdate) ExecX ¶
func (uau *UserArticleUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserArticleUpdate) Mutation ¶
func (uau *UserArticleUpdate) Mutation() *UserArticleMutation
Mutation returns the UserArticleMutation object of the builder.
func (*UserArticleUpdate) QueryContext ¶
func (c *UserArticleUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserArticleUpdate) Save ¶
func (uau *UserArticleUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserArticleUpdate) SaveX ¶
func (uau *UserArticleUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserArticleUpdate) SetArticle ¶
func (uau *UserArticleUpdate) SetArticle(a *Article) *UserArticleUpdate
SetArticle sets the "article" edge to the Article entity.
func (*UserArticleUpdate) SetArticleID ¶
func (uau *UserArticleUpdate) SetArticleID(u uuid.UUID) *UserArticleUpdate
SetArticleID sets the "article_id" field.
func (*UserArticleUpdate) SetCreatedAt ¶
func (uau *UserArticleUpdate) SetCreatedAt(t time.Time) *UserArticleUpdate
SetCreatedAt sets the "created_at" field.
func (*UserArticleUpdate) SetNillableCreatedAt ¶
func (uau *UserArticleUpdate) SetNillableCreatedAt(t *time.Time) *UserArticleUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserArticleUpdate) SetUpdatedAt ¶
func (uau *UserArticleUpdate) SetUpdatedAt(t time.Time) *UserArticleUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserArticleUpdate) SetUser ¶
func (uau *UserArticleUpdate) SetUser(u *User) *UserArticleUpdate
SetUser sets the "user" edge to the User entity.
func (*UserArticleUpdate) SetUserID ¶
func (uau *UserArticleUpdate) SetUserID(u uuid.UUID) *UserArticleUpdate
SetUserID sets the "user_id" field.
func (*UserArticleUpdate) Where ¶
func (uau *UserArticleUpdate) Where(ps ...predicate.UserArticle) *UserArticleUpdate
Where appends a list predicates to the UserArticleUpdate builder.
type UserArticleUpdateOne ¶
type UserArticleUpdateOne struct {
// contains filtered or unexported fields
}
UserArticleUpdateOne is the builder for updating a single UserArticle entity.
func (*UserArticleUpdateOne) ClearArticle ¶
func (uauo *UserArticleUpdateOne) ClearArticle() *UserArticleUpdateOne
ClearArticle clears the "article" edge to the Article entity.
func (*UserArticleUpdateOne) ClearUser ¶
func (uauo *UserArticleUpdateOne) ClearUser() *UserArticleUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*UserArticleUpdateOne) Exec ¶
func (uauo *UserArticleUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserArticleUpdateOne) ExecContext ¶
func (c *UserArticleUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*UserArticleUpdateOne) ExecX ¶
func (uauo *UserArticleUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserArticleUpdateOne) Mutation ¶
func (uauo *UserArticleUpdateOne) Mutation() *UserArticleMutation
Mutation returns the UserArticleMutation object of the builder.
func (*UserArticleUpdateOne) QueryContext ¶
func (c *UserArticleUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserArticleUpdateOne) Save ¶
func (uauo *UserArticleUpdateOne) Save(ctx context.Context) (*UserArticle, error)
Save executes the query and returns the updated UserArticle entity.
func (*UserArticleUpdateOne) SaveX ¶
func (uauo *UserArticleUpdateOne) SaveX(ctx context.Context) *UserArticle
SaveX is like Save, but panics if an error occurs.
func (*UserArticleUpdateOne) Select ¶
func (uauo *UserArticleUpdateOne) Select(field string, fields ...string) *UserArticleUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserArticleUpdateOne) SetArticle ¶
func (uauo *UserArticleUpdateOne) SetArticle(a *Article) *UserArticleUpdateOne
SetArticle sets the "article" edge to the Article entity.
func (*UserArticleUpdateOne) SetArticleID ¶
func (uauo *UserArticleUpdateOne) SetArticleID(u uuid.UUID) *UserArticleUpdateOne
SetArticleID sets the "article_id" field.
func (*UserArticleUpdateOne) SetCreatedAt ¶
func (uauo *UserArticleUpdateOne) SetCreatedAt(t time.Time) *UserArticleUpdateOne
SetCreatedAt sets the "created_at" field.
func (*UserArticleUpdateOne) SetNillableCreatedAt ¶
func (uauo *UserArticleUpdateOne) SetNillableCreatedAt(t *time.Time) *UserArticleUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserArticleUpdateOne) SetUpdatedAt ¶
func (uauo *UserArticleUpdateOne) SetUpdatedAt(t time.Time) *UserArticleUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserArticleUpdateOne) SetUser ¶
func (uauo *UserArticleUpdateOne) SetUser(u *User) *UserArticleUpdateOne
SetUser sets the "user" edge to the User entity.
func (*UserArticleUpdateOne) SetUserID ¶
func (uauo *UserArticleUpdateOne) SetUserID(u uuid.UUID) *UserArticleUpdateOne
SetUserID sets the "user_id" field.
func (*UserArticleUpdateOne) Where ¶
func (uauo *UserArticleUpdateOne) Where(ps ...predicate.UserArticle) *UserArticleUpdateOne
Where appends a list predicates to the UserArticleUpdate builder.
type UserArticleUpsert ¶
UserArticleUpsert is the "OnConflict" setter.
func (*UserArticleUpsert) SetArticleID ¶
func (u *UserArticleUpsert) SetArticleID(v uuid.UUID) *UserArticleUpsert
SetArticleID sets the "article_id" field.
func (*UserArticleUpsert) SetCreatedAt ¶
func (u *UserArticleUpsert) SetCreatedAt(v time.Time) *UserArticleUpsert
SetCreatedAt sets the "created_at" field.
func (*UserArticleUpsert) SetUpdatedAt ¶
func (u *UserArticleUpsert) SetUpdatedAt(v time.Time) *UserArticleUpsert
SetUpdatedAt sets the "updated_at" field.
func (*UserArticleUpsert) SetUserID ¶
func (u *UserArticleUpsert) SetUserID(v uuid.UUID) *UserArticleUpsert
SetUserID sets the "user_id" field.
func (*UserArticleUpsert) UpdateArticleID ¶
func (u *UserArticleUpsert) UpdateArticleID() *UserArticleUpsert
UpdateArticleID sets the "article_id" field to the value that was provided on create.
func (*UserArticleUpsert) UpdateCreatedAt ¶
func (u *UserArticleUpsert) UpdateCreatedAt() *UserArticleUpsert
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*UserArticleUpsert) UpdateUpdatedAt ¶
func (u *UserArticleUpsert) UpdateUpdatedAt() *UserArticleUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*UserArticleUpsert) UpdateUserID ¶
func (u *UserArticleUpsert) UpdateUserID() *UserArticleUpsert
UpdateUserID sets the "user_id" field to the value that was provided on create.
type UserArticleUpsertBulk ¶
type UserArticleUpsertBulk struct {
// contains filtered or unexported fields
}
UserArticleUpsertBulk is the builder for "upsert"-ing a bulk of UserArticle nodes.
func (*UserArticleUpsertBulk) DoNothing ¶
func (u *UserArticleUpsertBulk) DoNothing() *UserArticleUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserArticleUpsertBulk) Exec ¶
func (u *UserArticleUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserArticleUpsertBulk) ExecX ¶
func (u *UserArticleUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserArticleUpsertBulk) Ignore ¶
func (u *UserArticleUpsertBulk) Ignore() *UserArticleUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.UserArticle.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserArticleUpsertBulk) SetArticleID ¶
func (u *UserArticleUpsertBulk) SetArticleID(v uuid.UUID) *UserArticleUpsertBulk
SetArticleID sets the "article_id" field.
func (*UserArticleUpsertBulk) SetCreatedAt ¶
func (u *UserArticleUpsertBulk) SetCreatedAt(v time.Time) *UserArticleUpsertBulk
SetCreatedAt sets the "created_at" field.
func (*UserArticleUpsertBulk) SetUpdatedAt ¶
func (u *UserArticleUpsertBulk) SetUpdatedAt(v time.Time) *UserArticleUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*UserArticleUpsertBulk) SetUserID ¶
func (u *UserArticleUpsertBulk) SetUserID(v uuid.UUID) *UserArticleUpsertBulk
SetUserID sets the "user_id" field.
func (*UserArticleUpsertBulk) Update ¶
func (u *UserArticleUpsertBulk) Update(set func(*UserArticleUpsert)) *UserArticleUpsertBulk
Update allows overriding fields `UPDATE` values. See the UserArticleCreateBulk.OnConflict documentation for more info.
func (*UserArticleUpsertBulk) UpdateArticleID ¶
func (u *UserArticleUpsertBulk) UpdateArticleID() *UserArticleUpsertBulk
UpdateArticleID sets the "article_id" field to the value that was provided on create.
func (*UserArticleUpsertBulk) UpdateCreatedAt ¶
func (u *UserArticleUpsertBulk) UpdateCreatedAt() *UserArticleUpsertBulk
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*UserArticleUpsertBulk) UpdateNewValues ¶
func (u *UserArticleUpsertBulk) UpdateNewValues() *UserArticleUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.UserArticle.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(userarticle.FieldID) }), ). Exec(ctx)
func (*UserArticleUpsertBulk) UpdateUpdatedAt ¶
func (u *UserArticleUpsertBulk) UpdateUpdatedAt() *UserArticleUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*UserArticleUpsertBulk) UpdateUserID ¶
func (u *UserArticleUpsertBulk) UpdateUserID() *UserArticleUpsertBulk
UpdateUserID sets the "user_id" field to the value that was provided on create.
type UserArticleUpsertOne ¶
type UserArticleUpsertOne struct {
// contains filtered or unexported fields
}
UserArticleUpsertOne is the builder for "upsert"-ing
one UserArticle node.
func (*UserArticleUpsertOne) DoNothing ¶
func (u *UserArticleUpsertOne) DoNothing() *UserArticleUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserArticleUpsertOne) Exec ¶
func (u *UserArticleUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*UserArticleUpsertOne) ExecX ¶
func (u *UserArticleUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserArticleUpsertOne) ID ¶
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*UserArticleUpsertOne) IDX ¶
func (u *UserArticleUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*UserArticleUpsertOne) Ignore ¶
func (u *UserArticleUpsertOne) Ignore() *UserArticleUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.UserArticle.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserArticleUpsertOne) SetArticleID ¶
func (u *UserArticleUpsertOne) SetArticleID(v uuid.UUID) *UserArticleUpsertOne
SetArticleID sets the "article_id" field.
func (*UserArticleUpsertOne) SetCreatedAt ¶
func (u *UserArticleUpsertOne) SetCreatedAt(v time.Time) *UserArticleUpsertOne
SetCreatedAt sets the "created_at" field.
func (*UserArticleUpsertOne) SetUpdatedAt ¶
func (u *UserArticleUpsertOne) SetUpdatedAt(v time.Time) *UserArticleUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*UserArticleUpsertOne) SetUserID ¶
func (u *UserArticleUpsertOne) SetUserID(v uuid.UUID) *UserArticleUpsertOne
SetUserID sets the "user_id" field.
func (*UserArticleUpsertOne) Update ¶
func (u *UserArticleUpsertOne) Update(set func(*UserArticleUpsert)) *UserArticleUpsertOne
Update allows overriding fields `UPDATE` values. See the UserArticleCreate.OnConflict documentation for more info.
func (*UserArticleUpsertOne) UpdateArticleID ¶
func (u *UserArticleUpsertOne) UpdateArticleID() *UserArticleUpsertOne
UpdateArticleID sets the "article_id" field to the value that was provided on create.
func (*UserArticleUpsertOne) UpdateCreatedAt ¶
func (u *UserArticleUpsertOne) UpdateCreatedAt() *UserArticleUpsertOne
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*UserArticleUpsertOne) UpdateNewValues ¶
func (u *UserArticleUpsertOne) UpdateNewValues() *UserArticleUpsertOne
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.UserArticle.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(userarticle.FieldID) }), ). Exec(ctx)
func (*UserArticleUpsertOne) UpdateUpdatedAt ¶
func (u *UserArticleUpsertOne) UpdateUpdatedAt() *UserArticleUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (*UserArticleUpsertOne) UpdateUserID ¶
func (u *UserArticleUpsertOne) UpdateUserID() *UserArticleUpsertOne
UpdateUserID sets the "user_id" field to the value that was provided on create.
type UserArticles ¶
type UserArticles []*UserArticle
UserArticles is a parsable slice of UserArticle.
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) ExecContext ¶
func (c *UserClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *UserClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserClient) QueryUserArticles ¶
func (c *UserClient) QueryUserArticles(u *User) *UserArticleQuery
QueryUserArticles queries the user_articles edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id 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) AddUserArticleIDs ¶
func (uc *UserCreate) AddUserArticleIDs(ids ...uuid.UUID) *UserCreate
AddUserArticleIDs adds the "user_articles" edge to the UserArticle entity by IDs.
func (*UserCreate) AddUserArticles ¶
func (uc *UserCreate) AddUserArticles(u ...*UserArticle) *UserCreate
AddUserArticles adds the "user_articles" edges to the UserArticle entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecContext ¶
func (c *UserCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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(). SetCreatedAt(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) { SetCreatedAt(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) QueryContext ¶
func (c *UserCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) 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) 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) ExecContext ¶
func (c *UserCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) { SetCreatedAt(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)
func (*UserCreateBulk) QueryContext ¶
func (c *UserCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) ExecContext ¶
func (c *UserDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) QueryContext ¶
func (c *UserDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct { // UserArticles holds the value of the user_articles edge. UserArticles []*UserArticle `json:"user_articles,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) UserArticlesOrErr ¶
func (e UserEdges) UserArticlesOrErr() ([]*UserArticle, error)
UserArticlesOrErr returns the UserArticles value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) 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) AddUserArticleIDs ¶
func (m *UserMutation) AddUserArticleIDs(ids ...uuid.UUID)
AddUserArticleIDs adds the "user_articles" edge to the UserArticle entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) 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) ClearUserArticles ¶
func (m *UserMutation) ClearUserArticles()
ClearUserArticles clears the "user_articles" edge to the UserArticle entity.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) 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) ExecContext ¶
func (c *UserMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) 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) 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) QueryContext ¶
func (c *UserMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserMutation) RemoveUserArticleIDs ¶
func (m *UserMutation) RemoveUserArticleIDs(ids ...uuid.UUID)
RemoveUserArticleIDs removes the "user_articles" edge to the UserArticle entity by IDs.
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) RemovedUserArticlesIDs ¶
func (m *UserMutation) RemovedUserArticlesIDs() (ids []uuid.UUID)
RemovedUserArticles returns the removed IDs of the "user_articles" edge to the UserArticle entity.
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) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) ResetUserArticles ¶
func (m *UserMutation) ResetUserArticles()
ResetUserArticles resets all changes to the "user_articles" edge.
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) 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) UserArticlesCleared ¶
func (m *UserMutation) UserArticlesCleared() bool
UserArticlesCleared reports if the "user_articles" edge to the UserArticle entity was cleared.
func (*UserMutation) UserArticlesIDs ¶
func (m *UserMutation) UserArticlesIDs() (ids []uuid.UUID)
UserArticlesIDs returns the "user_articles" edge IDs 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) ExecContext ¶
func (c *UserQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) ForShare ¶
func (uq *UserQuery) ForShare(opts ...sql.LockOption) *UserQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*UserQuery) ForUpdate ¶
func (uq *UserQuery) ForUpdate(opts ...sql.LockOption) *UserQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryContext ¶
func (c *UserQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserQuery) QueryUserArticles ¶
func (uq *UserQuery) QueryUserArticles() *UserArticleQuery
QueryUserArticles chains the current query on the "user_articles" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.User.Query(). Select(user.FieldCreatedAt). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithUserArticles ¶
func (uq *UserQuery) WithUserArticles(opts ...func(*UserArticleQuery)) *UserQuery
WithUserArticles tells the query-builder to eager-load the nodes that are connected to the "user_articles" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (UserSelect) ExecContext ¶
func (c UserSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c UserSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) AddUserArticleIDs ¶
func (uu *UserUpdate) AddUserArticleIDs(ids ...uuid.UUID) *UserUpdate
AddUserArticleIDs adds the "user_articles" edge to the UserArticle entity by IDs.
func (*UserUpdate) AddUserArticles ¶
func (uu *UserUpdate) AddUserArticles(u ...*UserArticle) *UserUpdate
AddUserArticles adds the "user_articles" edges to the UserArticle entity.
func (*UserUpdate) ClearUserArticles ¶
func (uu *UserUpdate) ClearUserArticles() *UserUpdate
ClearUserArticles clears all "user_articles" edges to the UserArticle entity.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecContext ¶
func (c *UserUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *UserUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserUpdate) RemoveUserArticleIDs ¶
func (uu *UserUpdate) RemoveUserArticleIDs(ids ...uuid.UUID) *UserUpdate
RemoveUserArticleIDs removes the "user_articles" edge to UserArticle entities by IDs.
func (*UserUpdate) RemoveUserArticles ¶
func (uu *UserUpdate) RemoveUserArticles(u ...*UserArticle) *UserUpdate
RemoveUserArticles removes "user_articles" edges to UserArticle entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetCreatedAt ¶
func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate
SetCreatedAt sets the "created_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) 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) AddUserArticleIDs ¶
func (uuo *UserUpdateOne) AddUserArticleIDs(ids ...uuid.UUID) *UserUpdateOne
AddUserArticleIDs adds the "user_articles" edge to the UserArticle entity by IDs.
func (*UserUpdateOne) AddUserArticles ¶
func (uuo *UserUpdateOne) AddUserArticles(u ...*UserArticle) *UserUpdateOne
AddUserArticles adds the "user_articles" edges to the UserArticle entity.
func (*UserUpdateOne) ClearUserArticles ¶
func (uuo *UserUpdateOne) ClearUserArticles() *UserUpdateOne
ClearUserArticles clears all "user_articles" edges to the UserArticle entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecContext ¶
func (c *UserUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *UserUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*UserUpdateOne) RemoveUserArticleIDs ¶
func (uuo *UserUpdateOne) RemoveUserArticleIDs(ids ...uuid.UUID) *UserUpdateOne
RemoveUserArticleIDs removes the "user_articles" edge to UserArticle entities by IDs.
func (*UserUpdateOne) RemoveUserArticles ¶
func (uuo *UserUpdateOne) RemoveUserArticles(u ...*UserArticle) *UserUpdateOne
RemoveUserArticles removes "user_articles" edges to UserArticle entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetCreatedAt ¶
func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne
SetCreatedAt sets the "created_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) 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) 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) 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) 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) 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) 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) 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
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go
- userarticle.go
- userarticle_create.go
- userarticle_delete.go
- userarticle_query.go
- userarticle_update.go