Documentation
¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type Comment
- func (c *Comment) QueryCommentAuthors() *UserQuery
- func (c *Comment) QueryCommentKudoes() *CommentKudoQuery
- func (c *Comment) QueryKudoedUsers() *UserQuery
- func (c *Comment) QueryThreads() *ThreadQuery
- func (c *Comment) String() string
- func (c *Comment) Unwrap() *Comment
- func (c *Comment) Update() *CommentUpdateOne
- func (c *Comment) Value(name string) (ent.Value, error)
- type CommentClient
- func (c *CommentClient) Create() *CommentCreate
- func (c *CommentClient) CreateBulk(builders ...*CommentCreate) *CommentCreateBulk
- func (c *CommentClient) Delete() *CommentDelete
- func (c *CommentClient) DeleteOne(co *Comment) *CommentDeleteOne
- func (c *CommentClient) DeleteOneID(id int) *CommentDeleteOne
- func (c *CommentClient) Get(ctx context.Context, id int) (*Comment, error)
- func (c *CommentClient) GetX(ctx context.Context, id int) *Comment
- func (c *CommentClient) Hooks() []Hook
- func (c *CommentClient) Intercept(interceptors ...Interceptor)
- func (c *CommentClient) Interceptors() []Interceptor
- func (c *CommentClient) MapCreateBulk(slice any, setFunc func(*CommentCreate, int)) *CommentCreateBulk
- func (c *CommentClient) Query() *CommentQuery
- func (c *CommentClient) QueryCommentAuthors(co *Comment) *UserQuery
- func (c *CommentClient) QueryCommentKudoes(co *Comment) *CommentKudoQuery
- func (c *CommentClient) QueryKudoedUsers(co *Comment) *UserQuery
- func (c *CommentClient) QueryThreads(co *Comment) *ThreadQuery
- func (c *CommentClient) Update() *CommentUpdate
- func (c *CommentClient) UpdateOne(co *Comment) *CommentUpdateOne
- func (c *CommentClient) UpdateOneID(id int) *CommentUpdateOne
- func (c *CommentClient) Use(hooks ...Hook)
- type CommentCreate
- func (cc *CommentCreate) AddKudoedUserIDs(ids ...uuid.UUID) *CommentCreate
- func (cc *CommentCreate) AddKudoedUsers(u ...*User) *CommentCreate
- func (cc *CommentCreate) Exec(ctx context.Context) error
- func (cc *CommentCreate) ExecX(ctx context.Context)
- func (cc *CommentCreate) Mutation() *CommentMutation
- func (cc *CommentCreate) Save(ctx context.Context) (*Comment, error)
- func (cc *CommentCreate) SaveX(ctx context.Context) *Comment
- func (cc *CommentCreate) SetCommentAuthors(u *User) *CommentCreate
- func (cc *CommentCreate) SetCommentAuthorsID(id uuid.UUID) *CommentCreate
- func (cc *CommentCreate) SetContent(s string) *CommentCreate
- func (cc *CommentCreate) SetCreatedAt(t time.Time) *CommentCreate
- func (cc *CommentCreate) SetCreatedBy(u uuid.UUID) *CommentCreate
- func (cc *CommentCreate) SetModifiedAt(t time.Time) *CommentCreate
- func (cc *CommentCreate) SetNillableCreatedAt(t *time.Time) *CommentCreate
- func (cc *CommentCreate) SetNillableModifiedAt(t *time.Time) *CommentCreate
- func (cc *CommentCreate) SetNillableParentID(i *int) *CommentCreate
- func (cc *CommentCreate) SetParentID(i int) *CommentCreate
- func (cc *CommentCreate) SetThreads(t *Thread) *CommentCreate
- func (cc *CommentCreate) SetThreadsID(id int) *CommentCreate
- type CommentCreateBulk
- type CommentDelete
- type CommentDeleteOne
- type CommentEdges
- type CommentGroupBy
- func (cgb *CommentGroupBy) Aggregate(fns ...AggregateFunc) *CommentGroupBy
- func (s *CommentGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CommentGroupBy) BoolX(ctx context.Context) bool
- func (s *CommentGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CommentGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CommentGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CommentGroupBy) Float64X(ctx context.Context) float64
- func (s *CommentGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CommentGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CommentGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CommentGroupBy) IntX(ctx context.Context) int
- func (s *CommentGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CommentGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CommentGroupBy) Scan(ctx context.Context, v any) error
- func (s *CommentGroupBy) ScanX(ctx context.Context, v any)
- func (s *CommentGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CommentGroupBy) StringX(ctx context.Context) string
- func (s *CommentGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CommentGroupBy) StringsX(ctx context.Context) []string
- type CommentKudo
- type CommentKudoClient
- func (c *CommentKudoClient) Create() *CommentKudoCreate
- func (c *CommentKudoClient) CreateBulk(builders ...*CommentKudoCreate) *CommentKudoCreateBulk
- func (c *CommentKudoClient) Delete() *CommentKudoDelete
- func (c *CommentKudoClient) Hooks() []Hook
- func (c *CommentKudoClient) Intercept(interceptors ...Interceptor)
- func (c *CommentKudoClient) Interceptors() []Interceptor
- func (c *CommentKudoClient) MapCreateBulk(slice any, setFunc func(*CommentKudoCreate, int)) *CommentKudoCreateBulk
- func (c *CommentKudoClient) Query() *CommentKudoQuery
- func (c *CommentKudoClient) QueryComment(ck *CommentKudo) *CommentQuery
- func (c *CommentKudoClient) QueryUser(ck *CommentKudo) *UserQuery
- func (c *CommentKudoClient) Update() *CommentKudoUpdate
- func (c *CommentKudoClient) UpdateOne(ck *CommentKudo) *CommentKudoUpdateOne
- func (c *CommentKudoClient) Use(hooks ...Hook)
- type CommentKudoCreate
- func (ckc *CommentKudoCreate) Exec(ctx context.Context) error
- func (ckc *CommentKudoCreate) ExecX(ctx context.Context)
- func (ckc *CommentKudoCreate) Mutation() *CommentKudoMutation
- func (ckc *CommentKudoCreate) Save(ctx context.Context) (*CommentKudo, error)
- func (ckc *CommentKudoCreate) SaveX(ctx context.Context) *CommentKudo
- func (ckc *CommentKudoCreate) SetComment(c *Comment) *CommentKudoCreate
- func (ckc *CommentKudoCreate) SetCommentID(i int) *CommentKudoCreate
- func (ckc *CommentKudoCreate) SetUser(u *User) *CommentKudoCreate
- func (ckc *CommentKudoCreate) SetUserID(u uuid.UUID) *CommentKudoCreate
- type CommentKudoCreateBulk
- type CommentKudoDelete
- type CommentKudoDeleteOne
- type CommentKudoEdges
- type CommentKudoGroupBy
- func (ckgb *CommentKudoGroupBy) Aggregate(fns ...AggregateFunc) *CommentKudoGroupBy
- func (s *CommentKudoGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CommentKudoGroupBy) BoolX(ctx context.Context) bool
- func (s *CommentKudoGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CommentKudoGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CommentKudoGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CommentKudoGroupBy) Float64X(ctx context.Context) float64
- func (s *CommentKudoGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CommentKudoGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CommentKudoGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CommentKudoGroupBy) IntX(ctx context.Context) int
- func (s *CommentKudoGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CommentKudoGroupBy) IntsX(ctx context.Context) []int
- func (ckgb *CommentKudoGroupBy) Scan(ctx context.Context, v any) error
- func (s *CommentKudoGroupBy) ScanX(ctx context.Context, v any)
- func (s *CommentKudoGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CommentKudoGroupBy) StringX(ctx context.Context) string
- func (s *CommentKudoGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CommentKudoGroupBy) StringsX(ctx context.Context) []string
- type CommentKudoMutation
- func (m *CommentKudoMutation) AddField(name string, value ent.Value) error
- func (m *CommentKudoMutation) AddedEdges() []string
- func (m *CommentKudoMutation) AddedField(name string) (ent.Value, bool)
- func (m *CommentKudoMutation) AddedFields() []string
- func (m *CommentKudoMutation) AddedIDs(name string) []ent.Value
- func (m *CommentKudoMutation) ClearComment()
- func (m *CommentKudoMutation) ClearEdge(name string) error
- func (m *CommentKudoMutation) ClearField(name string) error
- func (m *CommentKudoMutation) ClearUser()
- func (m *CommentKudoMutation) ClearedEdges() []string
- func (m *CommentKudoMutation) ClearedFields() []string
- func (m CommentKudoMutation) Client() *Client
- func (m *CommentKudoMutation) CommentCleared() bool
- func (m *CommentKudoMutation) CommentID() (r int, exists bool)
- func (m *CommentKudoMutation) CommentIDs() (ids []int)
- func (m *CommentKudoMutation) EdgeCleared(name string) bool
- func (m *CommentKudoMutation) Field(name string) (ent.Value, bool)
- func (m *CommentKudoMutation) FieldCleared(name string) bool
- func (m *CommentKudoMutation) Fields() []string
- func (m *CommentKudoMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CommentKudoMutation) Op() Op
- func (m *CommentKudoMutation) RemovedEdges() []string
- func (m *CommentKudoMutation) RemovedIDs(name string) []ent.Value
- func (m *CommentKudoMutation) ResetComment()
- func (m *CommentKudoMutation) ResetCommentID()
- func (m *CommentKudoMutation) ResetEdge(name string) error
- func (m *CommentKudoMutation) ResetField(name string) error
- func (m *CommentKudoMutation) ResetUser()
- func (m *CommentKudoMutation) ResetUserID()
- func (m *CommentKudoMutation) SetCommentID(i int)
- func (m *CommentKudoMutation) SetField(name string, value ent.Value) error
- func (m *CommentKudoMutation) SetOp(op Op)
- func (m *CommentKudoMutation) SetUserID(u uuid.UUID)
- func (m CommentKudoMutation) Tx() (*Tx, error)
- func (m *CommentKudoMutation) Type() string
- func (m *CommentKudoMutation) UserCleared() bool
- func (m *CommentKudoMutation) UserID() (r uuid.UUID, exists bool)
- func (m *CommentKudoMutation) UserIDs() (ids []uuid.UUID)
- func (m *CommentKudoMutation) Where(ps ...predicate.CommentKudo)
- func (m *CommentKudoMutation) WhereP(ps ...func(*sql.Selector))
- type CommentKudoQuery
- func (ckq *CommentKudoQuery) Aggregate(fns ...AggregateFunc) *CommentKudoSelect
- func (ckq *CommentKudoQuery) All(ctx context.Context) ([]*CommentKudo, error)
- func (ckq *CommentKudoQuery) AllX(ctx context.Context) []*CommentKudo
- func (ckq *CommentKudoQuery) Clone() *CommentKudoQuery
- func (ckq *CommentKudoQuery) Count(ctx context.Context) (int, error)
- func (ckq *CommentKudoQuery) CountX(ctx context.Context) int
- func (ckq *CommentKudoQuery) Exist(ctx context.Context) (bool, error)
- func (ckq *CommentKudoQuery) ExistX(ctx context.Context) bool
- func (ckq *CommentKudoQuery) First(ctx context.Context) (*CommentKudo, error)
- func (ckq *CommentKudoQuery) FirstX(ctx context.Context) *CommentKudo
- func (ckq *CommentKudoQuery) GroupBy(field string, fields ...string) *CommentKudoGroupBy
- func (ckq *CommentKudoQuery) Limit(limit int) *CommentKudoQuery
- func (ckq *CommentKudoQuery) Offset(offset int) *CommentKudoQuery
- func (ckq *CommentKudoQuery) Only(ctx context.Context) (*CommentKudo, error)
- func (ckq *CommentKudoQuery) OnlyX(ctx context.Context) *CommentKudo
- func (ckq *CommentKudoQuery) Order(o ...commentkudo.OrderOption) *CommentKudoQuery
- func (ckq *CommentKudoQuery) QueryComment() *CommentQuery
- func (ckq *CommentKudoQuery) QueryUser() *UserQuery
- func (ckq *CommentKudoQuery) Select(fields ...string) *CommentKudoSelect
- func (ckq *CommentKudoQuery) Unique(unique bool) *CommentKudoQuery
- func (ckq *CommentKudoQuery) Where(ps ...predicate.CommentKudo) *CommentKudoQuery
- func (ckq *CommentKudoQuery) WithComment(opts ...func(*CommentQuery)) *CommentKudoQuery
- func (ckq *CommentKudoQuery) WithUser(opts ...func(*UserQuery)) *CommentKudoQuery
- type CommentKudoSelect
- func (cks *CommentKudoSelect) Aggregate(fns ...AggregateFunc) *CommentKudoSelect
- func (s *CommentKudoSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CommentKudoSelect) BoolX(ctx context.Context) bool
- func (s *CommentKudoSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CommentKudoSelect) BoolsX(ctx context.Context) []bool
- func (s *CommentKudoSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CommentKudoSelect) Float64X(ctx context.Context) float64
- func (s *CommentKudoSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CommentKudoSelect) Float64sX(ctx context.Context) []float64
- func (s *CommentKudoSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CommentKudoSelect) IntX(ctx context.Context) int
- func (s *CommentKudoSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CommentKudoSelect) IntsX(ctx context.Context) []int
- func (cks *CommentKudoSelect) Scan(ctx context.Context, v any) error
- func (s *CommentKudoSelect) ScanX(ctx context.Context, v any)
- func (s *CommentKudoSelect) String(ctx context.Context) (_ string, err error)
- func (s *CommentKudoSelect) StringX(ctx context.Context) string
- func (s *CommentKudoSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CommentKudoSelect) StringsX(ctx context.Context) []string
- type CommentKudoUpdate
- func (cku *CommentKudoUpdate) Exec(ctx context.Context) error
- func (cku *CommentKudoUpdate) ExecX(ctx context.Context)
- func (cku *CommentKudoUpdate) Mutation() *CommentKudoMutation
- func (cku *CommentKudoUpdate) Save(ctx context.Context) (int, error)
- func (cku *CommentKudoUpdate) SaveX(ctx context.Context) int
- func (cku *CommentKudoUpdate) Where(ps ...predicate.CommentKudo) *CommentKudoUpdate
- type CommentKudoUpdateOne
- func (ckuo *CommentKudoUpdateOne) Exec(ctx context.Context) error
- func (ckuo *CommentKudoUpdateOne) ExecX(ctx context.Context)
- func (ckuo *CommentKudoUpdateOne) Mutation() *CommentKudoMutation
- func (ckuo *CommentKudoUpdateOne) Save(ctx context.Context) (*CommentKudo, error)
- func (ckuo *CommentKudoUpdateOne) SaveX(ctx context.Context) *CommentKudo
- func (ckuo *CommentKudoUpdateOne) Select(field string, fields ...string) *CommentKudoUpdateOne
- func (ckuo *CommentKudoUpdateOne) Where(ps ...predicate.CommentKudo) *CommentKudoUpdateOne
- type CommentKudos
- type CommentMutation
- func (m *CommentMutation) AddField(name string, value ent.Value) error
- func (m *CommentMutation) AddKudoedUserIDs(ids ...uuid.UUID)
- func (m *CommentMutation) AddParentID(i int)
- func (m *CommentMutation) AddedEdges() []string
- func (m *CommentMutation) AddedField(name string) (ent.Value, bool)
- func (m *CommentMutation) AddedFields() []string
- func (m *CommentMutation) AddedIDs(name string) []ent.Value
- func (m *CommentMutation) AddedParentID() (r int, exists bool)
- func (m *CommentMutation) ClearCommentAuthors()
- func (m *CommentMutation) ClearEdge(name string) error
- func (m *CommentMutation) ClearField(name string) error
- func (m *CommentMutation) ClearKudoedUsers()
- func (m *CommentMutation) ClearModifiedAt()
- func (m *CommentMutation) ClearThreads()
- func (m *CommentMutation) ClearedEdges() []string
- func (m *CommentMutation) ClearedFields() []string
- func (m CommentMutation) Client() *Client
- func (m *CommentMutation) CommentAuthorsCleared() bool
- func (m *CommentMutation) CommentAuthorsID() (id uuid.UUID, exists bool)
- func (m *CommentMutation) CommentAuthorsIDs() (ids []uuid.UUID)
- func (m *CommentMutation) Content() (r string, exists bool)
- func (m *CommentMutation) CreatedAt() (r time.Time, exists bool)
- func (m *CommentMutation) CreatedBy() (r uuid.UUID, exists bool)
- func (m *CommentMutation) EdgeCleared(name string) bool
- func (m *CommentMutation) Field(name string) (ent.Value, bool)
- func (m *CommentMutation) FieldCleared(name string) bool
- func (m *CommentMutation) Fields() []string
- func (m *CommentMutation) ID() (id int, exists bool)
- func (m *CommentMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CommentMutation) KudoedUsersCleared() bool
- func (m *CommentMutation) KudoedUsersIDs() (ids []uuid.UUID)
- func (m *CommentMutation) ModifiedAt() (r time.Time, exists bool)
- func (m *CommentMutation) ModifiedAtCleared() bool
- func (m *CommentMutation) OldContent(ctx context.Context) (v string, err error)
- func (m *CommentMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CommentMutation) OldCreatedBy(ctx context.Context) (v uuid.UUID, err error)
- func (m *CommentMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CommentMutation) OldModifiedAt(ctx context.Context) (v time.Time, err error)
- func (m *CommentMutation) OldParentID(ctx context.Context) (v int, err error)
- func (m *CommentMutation) Op() Op
- func (m *CommentMutation) ParentID() (r int, exists bool)
- func (m *CommentMutation) RemoveKudoedUserIDs(ids ...uuid.UUID)
- func (m *CommentMutation) RemovedEdges() []string
- func (m *CommentMutation) RemovedIDs(name string) []ent.Value
- func (m *CommentMutation) RemovedKudoedUsersIDs() (ids []uuid.UUID)
- func (m *CommentMutation) ResetCommentAuthors()
- func (m *CommentMutation) ResetContent()
- func (m *CommentMutation) ResetCreatedAt()
- func (m *CommentMutation) ResetCreatedBy()
- func (m *CommentMutation) ResetEdge(name string) error
- func (m *CommentMutation) ResetField(name string) error
- func (m *CommentMutation) ResetKudoedUsers()
- func (m *CommentMutation) ResetModifiedAt()
- func (m *CommentMutation) ResetParentID()
- func (m *CommentMutation) ResetThreads()
- func (m *CommentMutation) SetCommentAuthorsID(id uuid.UUID)
- func (m *CommentMutation) SetContent(s string)
- func (m *CommentMutation) SetCreatedAt(t time.Time)
- func (m *CommentMutation) SetCreatedBy(u uuid.UUID)
- func (m *CommentMutation) SetField(name string, value ent.Value) error
- func (m *CommentMutation) SetModifiedAt(t time.Time)
- func (m *CommentMutation) SetOp(op Op)
- func (m *CommentMutation) SetParentID(i int)
- func (m *CommentMutation) SetThreadsID(id int)
- func (m *CommentMutation) ThreadsCleared() bool
- func (m *CommentMutation) ThreadsID() (id int, exists bool)
- func (m *CommentMutation) ThreadsIDs() (ids []int)
- func (m CommentMutation) Tx() (*Tx, error)
- func (m *CommentMutation) Type() string
- func (m *CommentMutation) Where(ps ...predicate.Comment)
- func (m *CommentMutation) WhereP(ps ...func(*sql.Selector))
- type CommentQuery
- func (cq *CommentQuery) Aggregate(fns ...AggregateFunc) *CommentSelect
- func (cq *CommentQuery) All(ctx context.Context) ([]*Comment, error)
- func (cq *CommentQuery) AllX(ctx context.Context) []*Comment
- func (cq *CommentQuery) Clone() *CommentQuery
- func (cq *CommentQuery) Count(ctx context.Context) (int, error)
- func (cq *CommentQuery) CountX(ctx context.Context) int
- func (cq *CommentQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CommentQuery) ExistX(ctx context.Context) bool
- func (cq *CommentQuery) First(ctx context.Context) (*Comment, error)
- func (cq *CommentQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CommentQuery) FirstIDX(ctx context.Context) int
- func (cq *CommentQuery) FirstX(ctx context.Context) *Comment
- func (cq *CommentQuery) GroupBy(field string, fields ...string) *CommentGroupBy
- func (cq *CommentQuery) IDs(ctx context.Context) (ids []int, err error)
- func (cq *CommentQuery) IDsX(ctx context.Context) []int
- func (cq *CommentQuery) Limit(limit int) *CommentQuery
- func (cq *CommentQuery) Offset(offset int) *CommentQuery
- func (cq *CommentQuery) Only(ctx context.Context) (*Comment, error)
- func (cq *CommentQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CommentQuery) OnlyIDX(ctx context.Context) int
- func (cq *CommentQuery) OnlyX(ctx context.Context) *Comment
- func (cq *CommentQuery) Order(o ...comment.OrderOption) *CommentQuery
- func (cq *CommentQuery) QueryCommentAuthors() *UserQuery
- func (cq *CommentQuery) QueryCommentKudoes() *CommentKudoQuery
- func (cq *CommentQuery) QueryKudoedUsers() *UserQuery
- func (cq *CommentQuery) QueryThreads() *ThreadQuery
- func (cq *CommentQuery) Select(fields ...string) *CommentSelect
- func (cq *CommentQuery) Unique(unique bool) *CommentQuery
- func (cq *CommentQuery) Where(ps ...predicate.Comment) *CommentQuery
- func (cq *CommentQuery) WithCommentAuthors(opts ...func(*UserQuery)) *CommentQuery
- func (cq *CommentQuery) WithCommentKudoes(opts ...func(*CommentKudoQuery)) *CommentQuery
- func (cq *CommentQuery) WithKudoedUsers(opts ...func(*UserQuery)) *CommentQuery
- func (cq *CommentQuery) WithThreads(opts ...func(*ThreadQuery)) *CommentQuery
- type CommentSelect
- func (cs *CommentSelect) Aggregate(fns ...AggregateFunc) *CommentSelect
- func (s *CommentSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CommentSelect) BoolX(ctx context.Context) bool
- func (s *CommentSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CommentSelect) BoolsX(ctx context.Context) []bool
- func (s *CommentSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CommentSelect) Float64X(ctx context.Context) float64
- func (s *CommentSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CommentSelect) Float64sX(ctx context.Context) []float64
- func (s *CommentSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CommentSelect) IntX(ctx context.Context) int
- func (s *CommentSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CommentSelect) IntsX(ctx context.Context) []int
- func (cs *CommentSelect) Scan(ctx context.Context, v any) error
- func (s *CommentSelect) ScanX(ctx context.Context, v any)
- func (s *CommentSelect) String(ctx context.Context) (_ string, err error)
- func (s *CommentSelect) StringX(ctx context.Context) string
- func (s *CommentSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CommentSelect) StringsX(ctx context.Context) []string
- type CommentUpdate
- func (cu *CommentUpdate) AddKudoedUserIDs(ids ...uuid.UUID) *CommentUpdate
- func (cu *CommentUpdate) AddKudoedUsers(u ...*User) *CommentUpdate
- func (cu *CommentUpdate) AddParentID(i int) *CommentUpdate
- func (cu *CommentUpdate) ClearKudoedUsers() *CommentUpdate
- func (cu *CommentUpdate) ClearModifiedAt() *CommentUpdate
- func (cu *CommentUpdate) ClearThreads() *CommentUpdate
- func (cu *CommentUpdate) Exec(ctx context.Context) error
- func (cu *CommentUpdate) ExecX(ctx context.Context)
- func (cu *CommentUpdate) Mutation() *CommentMutation
- func (cu *CommentUpdate) RemoveKudoedUserIDs(ids ...uuid.UUID) *CommentUpdate
- func (cu *CommentUpdate) RemoveKudoedUsers(u ...*User) *CommentUpdate
- func (cu *CommentUpdate) Save(ctx context.Context) (int, error)
- func (cu *CommentUpdate) SaveX(ctx context.Context) int
- func (cu *CommentUpdate) SetContent(s string) *CommentUpdate
- func (cu *CommentUpdate) SetModifiedAt(t time.Time) *CommentUpdate
- func (cu *CommentUpdate) SetNillableContent(s *string) *CommentUpdate
- func (cu *CommentUpdate) SetNillableModifiedAt(t *time.Time) *CommentUpdate
- func (cu *CommentUpdate) SetNillableParentID(i *int) *CommentUpdate
- func (cu *CommentUpdate) SetParentID(i int) *CommentUpdate
- func (cu *CommentUpdate) SetThreads(t *Thread) *CommentUpdate
- func (cu *CommentUpdate) SetThreadsID(id int) *CommentUpdate
- func (cu *CommentUpdate) Where(ps ...predicate.Comment) *CommentUpdate
- type CommentUpdateOne
- func (cuo *CommentUpdateOne) AddKudoedUserIDs(ids ...uuid.UUID) *CommentUpdateOne
- func (cuo *CommentUpdateOne) AddKudoedUsers(u ...*User) *CommentUpdateOne
- func (cuo *CommentUpdateOne) AddParentID(i int) *CommentUpdateOne
- func (cuo *CommentUpdateOne) ClearKudoedUsers() *CommentUpdateOne
- func (cuo *CommentUpdateOne) ClearModifiedAt() *CommentUpdateOne
- func (cuo *CommentUpdateOne) ClearThreads() *CommentUpdateOne
- func (cuo *CommentUpdateOne) Exec(ctx context.Context) error
- func (cuo *CommentUpdateOne) ExecX(ctx context.Context)
- func (cuo *CommentUpdateOne) Mutation() *CommentMutation
- func (cuo *CommentUpdateOne) RemoveKudoedUserIDs(ids ...uuid.UUID) *CommentUpdateOne
- func (cuo *CommentUpdateOne) RemoveKudoedUsers(u ...*User) *CommentUpdateOne
- func (cuo *CommentUpdateOne) Save(ctx context.Context) (*Comment, error)
- func (cuo *CommentUpdateOne) SaveX(ctx context.Context) *Comment
- func (cuo *CommentUpdateOne) Select(field string, fields ...string) *CommentUpdateOne
- func (cuo *CommentUpdateOne) SetContent(s string) *CommentUpdateOne
- func (cuo *CommentUpdateOne) SetModifiedAt(t time.Time) *CommentUpdateOne
- func (cuo *CommentUpdateOne) SetNillableContent(s *string) *CommentUpdateOne
- func (cuo *CommentUpdateOne) SetNillableModifiedAt(t *time.Time) *CommentUpdateOne
- func (cuo *CommentUpdateOne) SetNillableParentID(i *int) *CommentUpdateOne
- func (cuo *CommentUpdateOne) SetParentID(i int) *CommentUpdateOne
- func (cuo *CommentUpdateOne) SetThreads(t *Thread) *CommentUpdateOne
- func (cuo *CommentUpdateOne) SetThreadsID(id int) *CommentUpdateOne
- func (cuo *CommentUpdateOne) Where(ps ...predicate.Comment) *CommentUpdateOne
- type Comments
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type Moderator
- type ModeratorClient
- func (c *ModeratorClient) Create() *ModeratorCreate
- func (c *ModeratorClient) CreateBulk(builders ...*ModeratorCreate) *ModeratorCreateBulk
- func (c *ModeratorClient) Delete() *ModeratorDelete
- func (c *ModeratorClient) Hooks() []Hook
- func (c *ModeratorClient) Intercept(interceptors ...Interceptor)
- func (c *ModeratorClient) Interceptors() []Interceptor
- func (c *ModeratorClient) MapCreateBulk(slice any, setFunc func(*ModeratorCreate, int)) *ModeratorCreateBulk
- func (c *ModeratorClient) Query() *ModeratorQuery
- func (c *ModeratorClient) QueryModerator(m *Moderator) *UserQuery
- func (c *ModeratorClient) QueryTopic(m *Moderator) *TopicQuery
- func (c *ModeratorClient) Update() *ModeratorUpdate
- func (c *ModeratorClient) UpdateOne(m *Moderator) *ModeratorUpdateOne
- func (c *ModeratorClient) Use(hooks ...Hook)
- type ModeratorCreate
- func (mc *ModeratorCreate) Exec(ctx context.Context) error
- func (mc *ModeratorCreate) ExecX(ctx context.Context)
- func (mc *ModeratorCreate) Mutation() *ModeratorMutation
- func (mc *ModeratorCreate) Save(ctx context.Context) (*Moderator, error)
- func (mc *ModeratorCreate) SaveX(ctx context.Context) *Moderator
- func (mc *ModeratorCreate) SetModerator(u *User) *ModeratorCreate
- func (mc *ModeratorCreate) SetModeratorID(u uuid.UUID) *ModeratorCreate
- func (mc *ModeratorCreate) SetTopic(t *Topic) *ModeratorCreate
- func (mc *ModeratorCreate) SetTopicID(i int) *ModeratorCreate
- type ModeratorCreateBulk
- type ModeratorDelete
- type ModeratorDeleteOne
- type ModeratorEdges
- type ModeratorGroupBy
- func (mgb *ModeratorGroupBy) Aggregate(fns ...AggregateFunc) *ModeratorGroupBy
- func (s *ModeratorGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ModeratorGroupBy) BoolX(ctx context.Context) bool
- func (s *ModeratorGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ModeratorGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ModeratorGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ModeratorGroupBy) Float64X(ctx context.Context) float64
- func (s *ModeratorGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ModeratorGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ModeratorGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ModeratorGroupBy) IntX(ctx context.Context) int
- func (s *ModeratorGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ModeratorGroupBy) IntsX(ctx context.Context) []int
- func (mgb *ModeratorGroupBy) Scan(ctx context.Context, v any) error
- func (s *ModeratorGroupBy) ScanX(ctx context.Context, v any)
- func (s *ModeratorGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ModeratorGroupBy) StringX(ctx context.Context) string
- func (s *ModeratorGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ModeratorGroupBy) StringsX(ctx context.Context) []string
- type ModeratorMutation
- func (m *ModeratorMutation) AddField(name string, value ent.Value) error
- func (m *ModeratorMutation) AddedEdges() []string
- func (m *ModeratorMutation) AddedField(name string) (ent.Value, bool)
- func (m *ModeratorMutation) AddedFields() []string
- func (m *ModeratorMutation) AddedIDs(name string) []ent.Value
- func (m *ModeratorMutation) ClearEdge(name string) error
- func (m *ModeratorMutation) ClearField(name string) error
- func (m *ModeratorMutation) ClearModerator()
- func (m *ModeratorMutation) ClearTopic()
- func (m *ModeratorMutation) ClearedEdges() []string
- func (m *ModeratorMutation) ClearedFields() []string
- func (m ModeratorMutation) Client() *Client
- func (m *ModeratorMutation) EdgeCleared(name string) bool
- func (m *ModeratorMutation) Field(name string) (ent.Value, bool)
- func (m *ModeratorMutation) FieldCleared(name string) bool
- func (m *ModeratorMutation) Fields() []string
- func (m *ModeratorMutation) ModeratorCleared() bool
- func (m *ModeratorMutation) ModeratorID() (r uuid.UUID, exists bool)
- func (m *ModeratorMutation) ModeratorIDs() (ids []uuid.UUID)
- func (m *ModeratorMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ModeratorMutation) Op() Op
- func (m *ModeratorMutation) RemovedEdges() []string
- func (m *ModeratorMutation) RemovedIDs(name string) []ent.Value
- func (m *ModeratorMutation) ResetEdge(name string) error
- func (m *ModeratorMutation) ResetField(name string) error
- func (m *ModeratorMutation) ResetModerator()
- func (m *ModeratorMutation) ResetModeratorID()
- func (m *ModeratorMutation) ResetTopic()
- func (m *ModeratorMutation) ResetTopicID()
- func (m *ModeratorMutation) SetField(name string, value ent.Value) error
- func (m *ModeratorMutation) SetModeratorID(u uuid.UUID)
- func (m *ModeratorMutation) SetOp(op Op)
- func (m *ModeratorMutation) SetTopicID(i int)
- func (m *ModeratorMutation) TopicCleared() bool
- func (m *ModeratorMutation) TopicID() (r int, exists bool)
- func (m *ModeratorMutation) TopicIDs() (ids []int)
- func (m ModeratorMutation) Tx() (*Tx, error)
- func (m *ModeratorMutation) Type() string
- func (m *ModeratorMutation) Where(ps ...predicate.Moderator)
- func (m *ModeratorMutation) WhereP(ps ...func(*sql.Selector))
- type ModeratorQuery
- func (mq *ModeratorQuery) Aggregate(fns ...AggregateFunc) *ModeratorSelect
- func (mq *ModeratorQuery) All(ctx context.Context) ([]*Moderator, error)
- func (mq *ModeratorQuery) AllX(ctx context.Context) []*Moderator
- func (mq *ModeratorQuery) Clone() *ModeratorQuery
- func (mq *ModeratorQuery) Count(ctx context.Context) (int, error)
- func (mq *ModeratorQuery) CountX(ctx context.Context) int
- func (mq *ModeratorQuery) Exist(ctx context.Context) (bool, error)
- func (mq *ModeratorQuery) ExistX(ctx context.Context) bool
- func (mq *ModeratorQuery) First(ctx context.Context) (*Moderator, error)
- func (mq *ModeratorQuery) FirstX(ctx context.Context) *Moderator
- func (mq *ModeratorQuery) GroupBy(field string, fields ...string) *ModeratorGroupBy
- func (mq *ModeratorQuery) Limit(limit int) *ModeratorQuery
- func (mq *ModeratorQuery) Offset(offset int) *ModeratorQuery
- func (mq *ModeratorQuery) Only(ctx context.Context) (*Moderator, error)
- func (mq *ModeratorQuery) OnlyX(ctx context.Context) *Moderator
- func (mq *ModeratorQuery) Order(o ...moderator.OrderOption) *ModeratorQuery
- func (mq *ModeratorQuery) QueryModerator() *UserQuery
- func (mq *ModeratorQuery) QueryTopic() *TopicQuery
- func (mq *ModeratorQuery) Select(fields ...string) *ModeratorSelect
- func (mq *ModeratorQuery) Unique(unique bool) *ModeratorQuery
- func (mq *ModeratorQuery) Where(ps ...predicate.Moderator) *ModeratorQuery
- func (mq *ModeratorQuery) WithModerator(opts ...func(*UserQuery)) *ModeratorQuery
- func (mq *ModeratorQuery) WithTopic(opts ...func(*TopicQuery)) *ModeratorQuery
- type ModeratorSelect
- func (ms *ModeratorSelect) Aggregate(fns ...AggregateFunc) *ModeratorSelect
- func (s *ModeratorSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ModeratorSelect) BoolX(ctx context.Context) bool
- func (s *ModeratorSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ModeratorSelect) BoolsX(ctx context.Context) []bool
- func (s *ModeratorSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ModeratorSelect) Float64X(ctx context.Context) float64
- func (s *ModeratorSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ModeratorSelect) Float64sX(ctx context.Context) []float64
- func (s *ModeratorSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ModeratorSelect) IntX(ctx context.Context) int
- func (s *ModeratorSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ModeratorSelect) IntsX(ctx context.Context) []int
- func (ms *ModeratorSelect) Scan(ctx context.Context, v any) error
- func (s *ModeratorSelect) ScanX(ctx context.Context, v any)
- func (s *ModeratorSelect) String(ctx context.Context) (_ string, err error)
- func (s *ModeratorSelect) StringX(ctx context.Context) string
- func (s *ModeratorSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ModeratorSelect) StringsX(ctx context.Context) []string
- type ModeratorUpdate
- func (mu *ModeratorUpdate) Exec(ctx context.Context) error
- func (mu *ModeratorUpdate) ExecX(ctx context.Context)
- func (mu *ModeratorUpdate) Mutation() *ModeratorMutation
- func (mu *ModeratorUpdate) Save(ctx context.Context) (int, error)
- func (mu *ModeratorUpdate) SaveX(ctx context.Context) int
- func (mu *ModeratorUpdate) Where(ps ...predicate.Moderator) *ModeratorUpdate
- type ModeratorUpdateOne
- func (muo *ModeratorUpdateOne) Exec(ctx context.Context) error
- func (muo *ModeratorUpdateOne) ExecX(ctx context.Context)
- func (muo *ModeratorUpdateOne) Mutation() *ModeratorMutation
- func (muo *ModeratorUpdateOne) Save(ctx context.Context) (*Moderator, error)
- func (muo *ModeratorUpdateOne) SaveX(ctx context.Context) *Moderator
- func (muo *ModeratorUpdateOne) Select(field string, fields ...string) *ModeratorUpdateOne
- func (muo *ModeratorUpdateOne) Where(ps ...predicate.Moderator) *ModeratorUpdateOne
- type Moderators
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tag
- type TagClient
- func (c *TagClient) Create() *TagCreate
- func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk
- func (c *TagClient) Delete() *TagDelete
- func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne
- func (c *TagClient) DeleteOneID(id int) *TagDeleteOne
- func (c *TagClient) Get(ctx context.Context, id int) (*Tag, error)
- func (c *TagClient) GetX(ctx context.Context, id int) *Tag
- func (c *TagClient) Hooks() []Hook
- func (c *TagClient) Intercept(interceptors ...Interceptor)
- func (c *TagClient) Interceptors() []Interceptor
- func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk
- func (c *TagClient) Query() *TagQuery
- func (c *TagClient) QueryTaggedThreads(t *Tag) *ThreadQuery
- func (c *TagClient) Update() *TagUpdate
- func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne
- func (c *TagClient) UpdateOneID(id int) *TagUpdateOne
- func (c *TagClient) Use(hooks ...Hook)
- type TagCreate
- func (tc *TagCreate) AddTaggedThreadIDs(ids ...int) *TagCreate
- func (tc *TagCreate) AddTaggedThreads(t ...*Thread) *TagCreate
- func (tc *TagCreate) Exec(ctx context.Context) error
- func (tc *TagCreate) ExecX(ctx context.Context)
- func (tc *TagCreate) Mutation() *TagMutation
- func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)
- func (tc *TagCreate) SaveX(ctx context.Context) *Tag
- func (tc *TagCreate) SetTagName(s string) *TagCreate
- type TagCreateBulk
- type TagDelete
- type TagDeleteOne
- type TagEdges
- type TagGroupBy
- func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy
- func (s *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TagGroupBy) BoolX(ctx context.Context) bool
- func (s *TagGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TagGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TagGroupBy) Float64X(ctx context.Context) float64
- func (s *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TagGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TagGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TagGroupBy) IntX(ctx context.Context) int
- func (s *TagGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TagGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error
- func (s *TagGroupBy) ScanX(ctx context.Context, v any)
- func (s *TagGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TagGroupBy) StringX(ctx context.Context) string
- func (s *TagGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TagGroupBy) StringsX(ctx context.Context) []string
- type TagMutation
- func (m *TagMutation) AddField(name string, value ent.Value) error
- func (m *TagMutation) AddTaggedThreadIDs(ids ...int)
- func (m *TagMutation) AddedEdges() []string
- func (m *TagMutation) AddedField(name string) (ent.Value, bool)
- func (m *TagMutation) AddedFields() []string
- func (m *TagMutation) AddedIDs(name string) []ent.Value
- func (m *TagMutation) ClearEdge(name string) error
- func (m *TagMutation) ClearField(name string) error
- func (m *TagMutation) ClearTaggedThreads()
- func (m *TagMutation) ClearedEdges() []string
- func (m *TagMutation) ClearedFields() []string
- func (m TagMutation) Client() *Client
- func (m *TagMutation) EdgeCleared(name string) bool
- func (m *TagMutation) Field(name string) (ent.Value, bool)
- func (m *TagMutation) FieldCleared(name string) bool
- func (m *TagMutation) Fields() []string
- func (m *TagMutation) ID() (id int, exists bool)
- func (m *TagMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TagMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TagMutation) OldTagName(ctx context.Context) (v string, err error)
- func (m *TagMutation) Op() Op
- func (m *TagMutation) RemoveTaggedThreadIDs(ids ...int)
- func (m *TagMutation) RemovedEdges() []string
- func (m *TagMutation) RemovedIDs(name string) []ent.Value
- func (m *TagMutation) RemovedTaggedThreadsIDs() (ids []int)
- func (m *TagMutation) ResetEdge(name string) error
- func (m *TagMutation) ResetField(name string) error
- func (m *TagMutation) ResetTagName()
- func (m *TagMutation) ResetTaggedThreads()
- func (m *TagMutation) SetField(name string, value ent.Value) error
- func (m *TagMutation) SetOp(op Op)
- func (m *TagMutation) SetTagName(s string)
- func (m *TagMutation) TagName() (r string, exists bool)
- func (m *TagMutation) TaggedThreadsCleared() bool
- func (m *TagMutation) TaggedThreadsIDs() (ids []int)
- func (m TagMutation) Tx() (*Tx, error)
- func (m *TagMutation) Type() string
- func (m *TagMutation) Where(ps ...predicate.Tag)
- func (m *TagMutation) WhereP(ps ...func(*sql.Selector))
- type TagQuery
- func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect
- func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)
- func (tq *TagQuery) AllX(ctx context.Context) []*Tag
- func (tq *TagQuery) Clone() *TagQuery
- func (tq *TagQuery) Count(ctx context.Context) (int, error)
- func (tq *TagQuery) CountX(ctx context.Context) int
- func (tq *TagQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TagQuery) ExistX(ctx context.Context) bool
- func (tq *TagQuery) First(ctx context.Context) (*Tag, error)
- func (tq *TagQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *TagQuery) FirstIDX(ctx context.Context) int
- func (tq *TagQuery) FirstX(ctx context.Context) *Tag
- func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy
- func (tq *TagQuery) IDs(ctx context.Context) (ids []int, err error)
- func (tq *TagQuery) IDsX(ctx context.Context) []int
- func (tq *TagQuery) Limit(limit int) *TagQuery
- func (tq *TagQuery) Offset(offset int) *TagQuery
- func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)
- func (tq *TagQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *TagQuery) OnlyIDX(ctx context.Context) int
- func (tq *TagQuery) OnlyX(ctx context.Context) *Tag
- func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery
- func (tq *TagQuery) QueryTaggedThreads() *ThreadQuery
- func (tq *TagQuery) Select(fields ...string) *TagSelect
- func (tq *TagQuery) Unique(unique bool) *TagQuery
- func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery
- func (tq *TagQuery) WithTaggedThreads(opts ...func(*ThreadQuery)) *TagQuery
- type TagSelect
- func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect
- func (s *TagSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TagSelect) BoolX(ctx context.Context) bool
- func (s *TagSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TagSelect) BoolsX(ctx context.Context) []bool
- func (s *TagSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TagSelect) Float64X(ctx context.Context) float64
- func (s *TagSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TagSelect) Float64sX(ctx context.Context) []float64
- func (s *TagSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TagSelect) IntX(ctx context.Context) int
- func (s *TagSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TagSelect) IntsX(ctx context.Context) []int
- func (ts *TagSelect) Scan(ctx context.Context, v any) error
- func (s *TagSelect) ScanX(ctx context.Context, v any)
- func (s *TagSelect) String(ctx context.Context) (_ string, err error)
- func (s *TagSelect) StringX(ctx context.Context) string
- func (s *TagSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TagSelect) StringsX(ctx context.Context) []string
- type TagUpdate
- func (tu *TagUpdate) AddTaggedThreadIDs(ids ...int) *TagUpdate
- func (tu *TagUpdate) AddTaggedThreads(t ...*Thread) *TagUpdate
- func (tu *TagUpdate) ClearTaggedThreads() *TagUpdate
- func (tu *TagUpdate) Exec(ctx context.Context) error
- func (tu *TagUpdate) ExecX(ctx context.Context)
- func (tu *TagUpdate) Mutation() *TagMutation
- func (tu *TagUpdate) RemoveTaggedThreadIDs(ids ...int) *TagUpdate
- func (tu *TagUpdate) RemoveTaggedThreads(t ...*Thread) *TagUpdate
- func (tu *TagUpdate) Save(ctx context.Context) (int, error)
- func (tu *TagUpdate) SaveX(ctx context.Context) int
- func (tu *TagUpdate) SetNillableTagName(s *string) *TagUpdate
- func (tu *TagUpdate) SetTagName(s string) *TagUpdate
- func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate
- type TagUpdateOne
- func (tuo *TagUpdateOne) AddTaggedThreadIDs(ids ...int) *TagUpdateOne
- func (tuo *TagUpdateOne) AddTaggedThreads(t ...*Thread) *TagUpdateOne
- func (tuo *TagUpdateOne) ClearTaggedThreads() *TagUpdateOne
- func (tuo *TagUpdateOne) Exec(ctx context.Context) error
- func (tuo *TagUpdateOne) ExecX(ctx context.Context)
- func (tuo *TagUpdateOne) Mutation() *TagMutation
- func (tuo *TagUpdateOne) RemoveTaggedThreadIDs(ids ...int) *TagUpdateOne
- func (tuo *TagUpdateOne) RemoveTaggedThreads(t ...*Thread) *TagUpdateOne
- func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)
- func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag
- func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne
- func (tuo *TagUpdateOne) SetNillableTagName(s *string) *TagUpdateOne
- func (tuo *TagUpdateOne) SetTagName(s string) *TagUpdateOne
- func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne
- type Tags
- type Thread
- func (t *Thread) QueryKudoedUsers() *UserQuery
- func (t *Thread) QueryTags() *TagQuery
- func (t *Thread) QueryThreadComments() *CommentQuery
- func (t *Thread) QueryThreadKudoes() *ThreadKudoQuery
- func (t *Thread) QueryTopics() *TopicQuery
- func (t *Thread) QueryUsers() *UserQuery
- func (t *Thread) String() string
- func (t *Thread) Unwrap() *Thread
- func (t *Thread) Update() *ThreadUpdateOne
- func (t *Thread) Value(name string) (ent.Value, error)
- type ThreadClient
- func (c *ThreadClient) Create() *ThreadCreate
- func (c *ThreadClient) CreateBulk(builders ...*ThreadCreate) *ThreadCreateBulk
- func (c *ThreadClient) Delete() *ThreadDelete
- func (c *ThreadClient) DeleteOne(t *Thread) *ThreadDeleteOne
- func (c *ThreadClient) DeleteOneID(id int) *ThreadDeleteOne
- func (c *ThreadClient) Get(ctx context.Context, id int) (*Thread, error)
- func (c *ThreadClient) GetX(ctx context.Context, id int) *Thread
- func (c *ThreadClient) Hooks() []Hook
- func (c *ThreadClient) Intercept(interceptors ...Interceptor)
- func (c *ThreadClient) Interceptors() []Interceptor
- func (c *ThreadClient) MapCreateBulk(slice any, setFunc func(*ThreadCreate, int)) *ThreadCreateBulk
- func (c *ThreadClient) Query() *ThreadQuery
- func (c *ThreadClient) QueryKudoedUsers(t *Thread) *UserQuery
- func (c *ThreadClient) QueryTags(t *Thread) *TagQuery
- func (c *ThreadClient) QueryThreadComments(t *Thread) *CommentQuery
- func (c *ThreadClient) QueryThreadKudoes(t *Thread) *ThreadKudoQuery
- func (c *ThreadClient) QueryTopics(t *Thread) *TopicQuery
- func (c *ThreadClient) QueryUsers(t *Thread) *UserQuery
- func (c *ThreadClient) Update() *ThreadUpdate
- func (c *ThreadClient) UpdateOne(t *Thread) *ThreadUpdateOne
- func (c *ThreadClient) UpdateOneID(id int) *ThreadUpdateOne
- func (c *ThreadClient) Use(hooks ...Hook)
- type ThreadCreate
- func (tc *ThreadCreate) AddKudoedUserIDs(ids ...uuid.UUID) *ThreadCreate
- func (tc *ThreadCreate) AddKudoedUsers(u ...*User) *ThreadCreate
- func (tc *ThreadCreate) AddTagIDs(ids ...int) *ThreadCreate
- func (tc *ThreadCreate) AddTags(t ...*Tag) *ThreadCreate
- func (tc *ThreadCreate) AddThreadCommentIDs(ids ...int) *ThreadCreate
- func (tc *ThreadCreate) AddThreadComments(c ...*Comment) *ThreadCreate
- func (tc *ThreadCreate) Exec(ctx context.Context) error
- func (tc *ThreadCreate) ExecX(ctx context.Context)
- func (tc *ThreadCreate) Mutation() *ThreadMutation
- func (tc *ThreadCreate) Save(ctx context.Context) (*Thread, error)
- func (tc *ThreadCreate) SaveX(ctx context.Context) *Thread
- func (tc *ThreadCreate) SetCreatedAt(t time.Time) *ThreadCreate
- func (tc *ThreadCreate) SetCreatedBy(u uuid.UUID) *ThreadCreate
- func (tc *ThreadCreate) SetDescription(s string) *ThreadCreate
- func (tc *ThreadCreate) SetModifiedAt(t time.Time) *ThreadCreate
- func (tc *ThreadCreate) SetNillableCreatedAt(t *time.Time) *ThreadCreate
- func (tc *ThreadCreate) SetNillableDescription(s *string) *ThreadCreate
- func (tc *ThreadCreate) SetNillableModifiedAt(t *time.Time) *ThreadCreate
- func (tc *ThreadCreate) SetSlug(s string) *ThreadCreate
- func (tc *ThreadCreate) SetTitle(s string) *ThreadCreate
- func (tc *ThreadCreate) SetTopics(t *Topic) *ThreadCreate
- func (tc *ThreadCreate) SetTopicsID(id int) *ThreadCreate
- func (tc *ThreadCreate) SetUsers(u *User) *ThreadCreate
- func (tc *ThreadCreate) SetUsersID(id uuid.UUID) *ThreadCreate
- type ThreadCreateBulk
- type ThreadDelete
- type ThreadDeleteOne
- type ThreadEdges
- func (e ThreadEdges) KudoedUsersOrErr() ([]*User, error)
- func (e ThreadEdges) TagsOrErr() ([]*Tag, error)
- func (e ThreadEdges) ThreadCommentsOrErr() ([]*Comment, error)
- func (e ThreadEdges) ThreadKudoesOrErr() ([]*ThreadKudo, error)
- func (e ThreadEdges) TopicsOrErr() (*Topic, error)
- func (e ThreadEdges) UsersOrErr() (*User, error)
- type ThreadGroupBy
- func (tgb *ThreadGroupBy) Aggregate(fns ...AggregateFunc) *ThreadGroupBy
- func (s *ThreadGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ThreadGroupBy) BoolX(ctx context.Context) bool
- func (s *ThreadGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ThreadGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ThreadGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ThreadGroupBy) Float64X(ctx context.Context) float64
- func (s *ThreadGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ThreadGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ThreadGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ThreadGroupBy) IntX(ctx context.Context) int
- func (s *ThreadGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ThreadGroupBy) IntsX(ctx context.Context) []int
- func (tgb *ThreadGroupBy) Scan(ctx context.Context, v any) error
- func (s *ThreadGroupBy) ScanX(ctx context.Context, v any)
- func (s *ThreadGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ThreadGroupBy) StringX(ctx context.Context) string
- func (s *ThreadGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ThreadGroupBy) StringsX(ctx context.Context) []string
- type ThreadKudo
- type ThreadKudoClient
- func (c *ThreadKudoClient) Create() *ThreadKudoCreate
- func (c *ThreadKudoClient) CreateBulk(builders ...*ThreadKudoCreate) *ThreadKudoCreateBulk
- func (c *ThreadKudoClient) Delete() *ThreadKudoDelete
- func (c *ThreadKudoClient) Hooks() []Hook
- func (c *ThreadKudoClient) Intercept(interceptors ...Interceptor)
- func (c *ThreadKudoClient) Interceptors() []Interceptor
- func (c *ThreadKudoClient) MapCreateBulk(slice any, setFunc func(*ThreadKudoCreate, int)) *ThreadKudoCreateBulk
- func (c *ThreadKudoClient) Query() *ThreadKudoQuery
- func (c *ThreadKudoClient) QueryThread(tk *ThreadKudo) *ThreadQuery
- func (c *ThreadKudoClient) QueryUser(tk *ThreadKudo) *UserQuery
- func (c *ThreadKudoClient) Update() *ThreadKudoUpdate
- func (c *ThreadKudoClient) UpdateOne(tk *ThreadKudo) *ThreadKudoUpdateOne
- func (c *ThreadKudoClient) Use(hooks ...Hook)
- type ThreadKudoCreate
- func (tkc *ThreadKudoCreate) Exec(ctx context.Context) error
- func (tkc *ThreadKudoCreate) ExecX(ctx context.Context)
- func (tkc *ThreadKudoCreate) Mutation() *ThreadKudoMutation
- func (tkc *ThreadKudoCreate) Save(ctx context.Context) (*ThreadKudo, error)
- func (tkc *ThreadKudoCreate) SaveX(ctx context.Context) *ThreadKudo
- func (tkc *ThreadKudoCreate) SetThread(t *Thread) *ThreadKudoCreate
- func (tkc *ThreadKudoCreate) SetThreadID(i int) *ThreadKudoCreate
- func (tkc *ThreadKudoCreate) SetUser(u *User) *ThreadKudoCreate
- func (tkc *ThreadKudoCreate) SetUserID(u uuid.UUID) *ThreadKudoCreate
- type ThreadKudoCreateBulk
- type ThreadKudoDelete
- type ThreadKudoDeleteOne
- type ThreadKudoEdges
- type ThreadKudoGroupBy
- func (tkgb *ThreadKudoGroupBy) Aggregate(fns ...AggregateFunc) *ThreadKudoGroupBy
- func (s *ThreadKudoGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ThreadKudoGroupBy) BoolX(ctx context.Context) bool
- func (s *ThreadKudoGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ThreadKudoGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ThreadKudoGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ThreadKudoGroupBy) Float64X(ctx context.Context) float64
- func (s *ThreadKudoGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ThreadKudoGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ThreadKudoGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ThreadKudoGroupBy) IntX(ctx context.Context) int
- func (s *ThreadKudoGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ThreadKudoGroupBy) IntsX(ctx context.Context) []int
- func (tkgb *ThreadKudoGroupBy) Scan(ctx context.Context, v any) error
- func (s *ThreadKudoGroupBy) ScanX(ctx context.Context, v any)
- func (s *ThreadKudoGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ThreadKudoGroupBy) StringX(ctx context.Context) string
- func (s *ThreadKudoGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ThreadKudoGroupBy) StringsX(ctx context.Context) []string
- type ThreadKudoMutation
- func (m *ThreadKudoMutation) AddField(name string, value ent.Value) error
- func (m *ThreadKudoMutation) AddedEdges() []string
- func (m *ThreadKudoMutation) AddedField(name string) (ent.Value, bool)
- func (m *ThreadKudoMutation) AddedFields() []string
- func (m *ThreadKudoMutation) AddedIDs(name string) []ent.Value
- func (m *ThreadKudoMutation) ClearEdge(name string) error
- func (m *ThreadKudoMutation) ClearField(name string) error
- func (m *ThreadKudoMutation) ClearThread()
- func (m *ThreadKudoMutation) ClearUser()
- func (m *ThreadKudoMutation) ClearedEdges() []string
- func (m *ThreadKudoMutation) ClearedFields() []string
- func (m ThreadKudoMutation) Client() *Client
- func (m *ThreadKudoMutation) EdgeCleared(name string) bool
- func (m *ThreadKudoMutation) Field(name string) (ent.Value, bool)
- func (m *ThreadKudoMutation) FieldCleared(name string) bool
- func (m *ThreadKudoMutation) Fields() []string
- func (m *ThreadKudoMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ThreadKudoMutation) Op() Op
- func (m *ThreadKudoMutation) RemovedEdges() []string
- func (m *ThreadKudoMutation) RemovedIDs(name string) []ent.Value
- func (m *ThreadKudoMutation) ResetEdge(name string) error
- func (m *ThreadKudoMutation) ResetField(name string) error
- func (m *ThreadKudoMutation) ResetThread()
- func (m *ThreadKudoMutation) ResetThreadID()
- func (m *ThreadKudoMutation) ResetUser()
- func (m *ThreadKudoMutation) ResetUserID()
- func (m *ThreadKudoMutation) SetField(name string, value ent.Value) error
- func (m *ThreadKudoMutation) SetOp(op Op)
- func (m *ThreadKudoMutation) SetThreadID(i int)
- func (m *ThreadKudoMutation) SetUserID(u uuid.UUID)
- func (m *ThreadKudoMutation) ThreadCleared() bool
- func (m *ThreadKudoMutation) ThreadID() (r int, exists bool)
- func (m *ThreadKudoMutation) ThreadIDs() (ids []int)
- func (m ThreadKudoMutation) Tx() (*Tx, error)
- func (m *ThreadKudoMutation) Type() string
- func (m *ThreadKudoMutation) UserCleared() bool
- func (m *ThreadKudoMutation) UserID() (r uuid.UUID, exists bool)
- func (m *ThreadKudoMutation) UserIDs() (ids []uuid.UUID)
- func (m *ThreadKudoMutation) Where(ps ...predicate.ThreadKudo)
- func (m *ThreadKudoMutation) WhereP(ps ...func(*sql.Selector))
- type ThreadKudoQuery
- func (tkq *ThreadKudoQuery) Aggregate(fns ...AggregateFunc) *ThreadKudoSelect
- func (tkq *ThreadKudoQuery) All(ctx context.Context) ([]*ThreadKudo, error)
- func (tkq *ThreadKudoQuery) AllX(ctx context.Context) []*ThreadKudo
- func (tkq *ThreadKudoQuery) Clone() *ThreadKudoQuery
- func (tkq *ThreadKudoQuery) Count(ctx context.Context) (int, error)
- func (tkq *ThreadKudoQuery) CountX(ctx context.Context) int
- func (tkq *ThreadKudoQuery) Exist(ctx context.Context) (bool, error)
- func (tkq *ThreadKudoQuery) ExistX(ctx context.Context) bool
- func (tkq *ThreadKudoQuery) First(ctx context.Context) (*ThreadKudo, error)
- func (tkq *ThreadKudoQuery) FirstX(ctx context.Context) *ThreadKudo
- func (tkq *ThreadKudoQuery) GroupBy(field string, fields ...string) *ThreadKudoGroupBy
- func (tkq *ThreadKudoQuery) Limit(limit int) *ThreadKudoQuery
- func (tkq *ThreadKudoQuery) Offset(offset int) *ThreadKudoQuery
- func (tkq *ThreadKudoQuery) Only(ctx context.Context) (*ThreadKudo, error)
- func (tkq *ThreadKudoQuery) OnlyX(ctx context.Context) *ThreadKudo
- func (tkq *ThreadKudoQuery) Order(o ...threadkudo.OrderOption) *ThreadKudoQuery
- func (tkq *ThreadKudoQuery) QueryThread() *ThreadQuery
- func (tkq *ThreadKudoQuery) QueryUser() *UserQuery
- func (tkq *ThreadKudoQuery) Select(fields ...string) *ThreadKudoSelect
- func (tkq *ThreadKudoQuery) Unique(unique bool) *ThreadKudoQuery
- func (tkq *ThreadKudoQuery) Where(ps ...predicate.ThreadKudo) *ThreadKudoQuery
- func (tkq *ThreadKudoQuery) WithThread(opts ...func(*ThreadQuery)) *ThreadKudoQuery
- func (tkq *ThreadKudoQuery) WithUser(opts ...func(*UserQuery)) *ThreadKudoQuery
- type ThreadKudoSelect
- func (tks *ThreadKudoSelect) Aggregate(fns ...AggregateFunc) *ThreadKudoSelect
- func (s *ThreadKudoSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ThreadKudoSelect) BoolX(ctx context.Context) bool
- func (s *ThreadKudoSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ThreadKudoSelect) BoolsX(ctx context.Context) []bool
- func (s *ThreadKudoSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ThreadKudoSelect) Float64X(ctx context.Context) float64
- func (s *ThreadKudoSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ThreadKudoSelect) Float64sX(ctx context.Context) []float64
- func (s *ThreadKudoSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ThreadKudoSelect) IntX(ctx context.Context) int
- func (s *ThreadKudoSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ThreadKudoSelect) IntsX(ctx context.Context) []int
- func (tks *ThreadKudoSelect) Scan(ctx context.Context, v any) error
- func (s *ThreadKudoSelect) ScanX(ctx context.Context, v any)
- func (s *ThreadKudoSelect) String(ctx context.Context) (_ string, err error)
- func (s *ThreadKudoSelect) StringX(ctx context.Context) string
- func (s *ThreadKudoSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ThreadKudoSelect) StringsX(ctx context.Context) []string
- type ThreadKudoUpdate
- func (tku *ThreadKudoUpdate) Exec(ctx context.Context) error
- func (tku *ThreadKudoUpdate) ExecX(ctx context.Context)
- func (tku *ThreadKudoUpdate) Mutation() *ThreadKudoMutation
- func (tku *ThreadKudoUpdate) Save(ctx context.Context) (int, error)
- func (tku *ThreadKudoUpdate) SaveX(ctx context.Context) int
- func (tku *ThreadKudoUpdate) Where(ps ...predicate.ThreadKudo) *ThreadKudoUpdate
- type ThreadKudoUpdateOne
- func (tkuo *ThreadKudoUpdateOne) Exec(ctx context.Context) error
- func (tkuo *ThreadKudoUpdateOne) ExecX(ctx context.Context)
- func (tkuo *ThreadKudoUpdateOne) Mutation() *ThreadKudoMutation
- func (tkuo *ThreadKudoUpdateOne) Save(ctx context.Context) (*ThreadKudo, error)
- func (tkuo *ThreadKudoUpdateOne) SaveX(ctx context.Context) *ThreadKudo
- func (tkuo *ThreadKudoUpdateOne) Select(field string, fields ...string) *ThreadKudoUpdateOne
- func (tkuo *ThreadKudoUpdateOne) Where(ps ...predicate.ThreadKudo) *ThreadKudoUpdateOne
- type ThreadKudos
- type ThreadMutation
- func (m *ThreadMutation) AddField(name string, value ent.Value) error
- func (m *ThreadMutation) AddKudoedUserIDs(ids ...uuid.UUID)
- func (m *ThreadMutation) AddTagIDs(ids ...int)
- func (m *ThreadMutation) AddThreadCommentIDs(ids ...int)
- func (m *ThreadMutation) AddedEdges() []string
- func (m *ThreadMutation) AddedField(name string) (ent.Value, bool)
- func (m *ThreadMutation) AddedFields() []string
- func (m *ThreadMutation) AddedIDs(name string) []ent.Value
- func (m *ThreadMutation) ClearDescription()
- func (m *ThreadMutation) ClearEdge(name string) error
- func (m *ThreadMutation) ClearField(name string) error
- func (m *ThreadMutation) ClearKudoedUsers()
- func (m *ThreadMutation) ClearModifiedAt()
- func (m *ThreadMutation) ClearTags()
- func (m *ThreadMutation) ClearThreadComments()
- func (m *ThreadMutation) ClearTopics()
- func (m *ThreadMutation) ClearUsers()
- func (m *ThreadMutation) ClearedEdges() []string
- func (m *ThreadMutation) ClearedFields() []string
- func (m ThreadMutation) Client() *Client
- func (m *ThreadMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ThreadMutation) CreatedBy() (r uuid.UUID, exists bool)
- func (m *ThreadMutation) Description() (r string, exists bool)
- func (m *ThreadMutation) DescriptionCleared() bool
- func (m *ThreadMutation) EdgeCleared(name string) bool
- func (m *ThreadMutation) Field(name string) (ent.Value, bool)
- func (m *ThreadMutation) FieldCleared(name string) bool
- func (m *ThreadMutation) Fields() []string
- func (m *ThreadMutation) ID() (id int, exists bool)
- func (m *ThreadMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ThreadMutation) KudoedUsersCleared() bool
- func (m *ThreadMutation) KudoedUsersIDs() (ids []uuid.UUID)
- func (m *ThreadMutation) ModifiedAt() (r time.Time, exists bool)
- func (m *ThreadMutation) ModifiedAtCleared() bool
- func (m *ThreadMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ThreadMutation) OldCreatedBy(ctx context.Context) (v uuid.UUID, err error)
- func (m *ThreadMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *ThreadMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ThreadMutation) OldModifiedAt(ctx context.Context) (v time.Time, err error)
- func (m *ThreadMutation) OldSlug(ctx context.Context) (v string, err error)
- func (m *ThreadMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *ThreadMutation) Op() Op
- func (m *ThreadMutation) RemoveKudoedUserIDs(ids ...uuid.UUID)
- func (m *ThreadMutation) RemoveTagIDs(ids ...int)
- func (m *ThreadMutation) RemoveThreadCommentIDs(ids ...int)
- func (m *ThreadMutation) RemovedEdges() []string
- func (m *ThreadMutation) RemovedIDs(name string) []ent.Value
- func (m *ThreadMutation) RemovedKudoedUsersIDs() (ids []uuid.UUID)
- func (m *ThreadMutation) RemovedTagsIDs() (ids []int)
- func (m *ThreadMutation) RemovedThreadCommentsIDs() (ids []int)
- func (m *ThreadMutation) ResetCreatedAt()
- func (m *ThreadMutation) ResetCreatedBy()
- func (m *ThreadMutation) ResetDescription()
- func (m *ThreadMutation) ResetEdge(name string) error
- func (m *ThreadMutation) ResetField(name string) error
- func (m *ThreadMutation) ResetKudoedUsers()
- func (m *ThreadMutation) ResetModifiedAt()
- func (m *ThreadMutation) ResetSlug()
- func (m *ThreadMutation) ResetTags()
- func (m *ThreadMutation) ResetThreadComments()
- func (m *ThreadMutation) ResetTitle()
- func (m *ThreadMutation) ResetTopics()
- func (m *ThreadMutation) ResetUsers()
- func (m *ThreadMutation) SetCreatedAt(t time.Time)
- func (m *ThreadMutation) SetCreatedBy(u uuid.UUID)
- func (m *ThreadMutation) SetDescription(s string)
- func (m *ThreadMutation) SetField(name string, value ent.Value) error
- func (m *ThreadMutation) SetModifiedAt(t time.Time)
- func (m *ThreadMutation) SetOp(op Op)
- func (m *ThreadMutation) SetSlug(s string)
- func (m *ThreadMutation) SetTitle(s string)
- func (m *ThreadMutation) SetTopicsID(id int)
- func (m *ThreadMutation) SetUsersID(id uuid.UUID)
- func (m *ThreadMutation) Slug() (r string, exists bool)
- func (m *ThreadMutation) TagsCleared() bool
- func (m *ThreadMutation) TagsIDs() (ids []int)
- func (m *ThreadMutation) ThreadCommentsCleared() bool
- func (m *ThreadMutation) ThreadCommentsIDs() (ids []int)
- func (m *ThreadMutation) Title() (r string, exists bool)
- func (m *ThreadMutation) TopicsCleared() bool
- func (m *ThreadMutation) TopicsID() (id int, exists bool)
- func (m *ThreadMutation) TopicsIDs() (ids []int)
- func (m ThreadMutation) Tx() (*Tx, error)
- func (m *ThreadMutation) Type() string
- func (m *ThreadMutation) UsersCleared() bool
- func (m *ThreadMutation) UsersID() (id uuid.UUID, exists bool)
- func (m *ThreadMutation) UsersIDs() (ids []uuid.UUID)
- func (m *ThreadMutation) Where(ps ...predicate.Thread)
- func (m *ThreadMutation) WhereP(ps ...func(*sql.Selector))
- type ThreadQuery
- func (tq *ThreadQuery) Aggregate(fns ...AggregateFunc) *ThreadSelect
- func (tq *ThreadQuery) All(ctx context.Context) ([]*Thread, error)
- func (tq *ThreadQuery) AllX(ctx context.Context) []*Thread
- func (tq *ThreadQuery) Clone() *ThreadQuery
- func (tq *ThreadQuery) Count(ctx context.Context) (int, error)
- func (tq *ThreadQuery) CountX(ctx context.Context) int
- func (tq *ThreadQuery) Exist(ctx context.Context) (bool, error)
- func (tq *ThreadQuery) ExistX(ctx context.Context) bool
- func (tq *ThreadQuery) First(ctx context.Context) (*Thread, error)
- func (tq *ThreadQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *ThreadQuery) FirstIDX(ctx context.Context) int
- func (tq *ThreadQuery) FirstX(ctx context.Context) *Thread
- func (tq *ThreadQuery) GroupBy(field string, fields ...string) *ThreadGroupBy
- func (tq *ThreadQuery) IDs(ctx context.Context) (ids []int, err error)
- func (tq *ThreadQuery) IDsX(ctx context.Context) []int
- func (tq *ThreadQuery) Limit(limit int) *ThreadQuery
- func (tq *ThreadQuery) Offset(offset int) *ThreadQuery
- func (tq *ThreadQuery) Only(ctx context.Context) (*Thread, error)
- func (tq *ThreadQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *ThreadQuery) OnlyIDX(ctx context.Context) int
- func (tq *ThreadQuery) OnlyX(ctx context.Context) *Thread
- func (tq *ThreadQuery) Order(o ...thread.OrderOption) *ThreadQuery
- func (tq *ThreadQuery) QueryKudoedUsers() *UserQuery
- func (tq *ThreadQuery) QueryTags() *TagQuery
- func (tq *ThreadQuery) QueryThreadComments() *CommentQuery
- func (tq *ThreadQuery) QueryThreadKudoes() *ThreadKudoQuery
- func (tq *ThreadQuery) QueryTopics() *TopicQuery
- func (tq *ThreadQuery) QueryUsers() *UserQuery
- func (tq *ThreadQuery) Select(fields ...string) *ThreadSelect
- func (tq *ThreadQuery) Unique(unique bool) *ThreadQuery
- func (tq *ThreadQuery) Where(ps ...predicate.Thread) *ThreadQuery
- func (tq *ThreadQuery) WithKudoedUsers(opts ...func(*UserQuery)) *ThreadQuery
- func (tq *ThreadQuery) WithTags(opts ...func(*TagQuery)) *ThreadQuery
- func (tq *ThreadQuery) WithThreadComments(opts ...func(*CommentQuery)) *ThreadQuery
- func (tq *ThreadQuery) WithThreadKudoes(opts ...func(*ThreadKudoQuery)) *ThreadQuery
- func (tq *ThreadQuery) WithTopics(opts ...func(*TopicQuery)) *ThreadQuery
- func (tq *ThreadQuery) WithUsers(opts ...func(*UserQuery)) *ThreadQuery
- type ThreadSelect
- func (ts *ThreadSelect) Aggregate(fns ...AggregateFunc) *ThreadSelect
- func (s *ThreadSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ThreadSelect) BoolX(ctx context.Context) bool
- func (s *ThreadSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ThreadSelect) BoolsX(ctx context.Context) []bool
- func (s *ThreadSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ThreadSelect) Float64X(ctx context.Context) float64
- func (s *ThreadSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ThreadSelect) Float64sX(ctx context.Context) []float64
- func (s *ThreadSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ThreadSelect) IntX(ctx context.Context) int
- func (s *ThreadSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ThreadSelect) IntsX(ctx context.Context) []int
- func (ts *ThreadSelect) Scan(ctx context.Context, v any) error
- func (s *ThreadSelect) ScanX(ctx context.Context, v any)
- func (s *ThreadSelect) String(ctx context.Context) (_ string, err error)
- func (s *ThreadSelect) StringX(ctx context.Context) string
- func (s *ThreadSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ThreadSelect) StringsX(ctx context.Context) []string
- type ThreadUpdate
- func (tu *ThreadUpdate) AddKudoedUserIDs(ids ...uuid.UUID) *ThreadUpdate
- func (tu *ThreadUpdate) AddKudoedUsers(u ...*User) *ThreadUpdate
- func (tu *ThreadUpdate) AddTagIDs(ids ...int) *ThreadUpdate
- func (tu *ThreadUpdate) AddTags(t ...*Tag) *ThreadUpdate
- func (tu *ThreadUpdate) AddThreadCommentIDs(ids ...int) *ThreadUpdate
- func (tu *ThreadUpdate) AddThreadComments(c ...*Comment) *ThreadUpdate
- func (tu *ThreadUpdate) ClearDescription() *ThreadUpdate
- func (tu *ThreadUpdate) ClearKudoedUsers() *ThreadUpdate
- func (tu *ThreadUpdate) ClearModifiedAt() *ThreadUpdate
- func (tu *ThreadUpdate) ClearTags() *ThreadUpdate
- func (tu *ThreadUpdate) ClearThreadComments() *ThreadUpdate
- func (tu *ThreadUpdate) ClearTopics() *ThreadUpdate
- func (tu *ThreadUpdate) Exec(ctx context.Context) error
- func (tu *ThreadUpdate) ExecX(ctx context.Context)
- func (tu *ThreadUpdate) Mutation() *ThreadMutation
- func (tu *ThreadUpdate) RemoveKudoedUserIDs(ids ...uuid.UUID) *ThreadUpdate
- func (tu *ThreadUpdate) RemoveKudoedUsers(u ...*User) *ThreadUpdate
- func (tu *ThreadUpdate) RemoveTagIDs(ids ...int) *ThreadUpdate
- func (tu *ThreadUpdate) RemoveTags(t ...*Tag) *ThreadUpdate
- func (tu *ThreadUpdate) RemoveThreadCommentIDs(ids ...int) *ThreadUpdate
- func (tu *ThreadUpdate) RemoveThreadComments(c ...*Comment) *ThreadUpdate
- func (tu *ThreadUpdate) Save(ctx context.Context) (int, error)
- func (tu *ThreadUpdate) SaveX(ctx context.Context) int
- func (tu *ThreadUpdate) SetDescription(s string) *ThreadUpdate
- func (tu *ThreadUpdate) SetModifiedAt(t time.Time) *ThreadUpdate
- func (tu *ThreadUpdate) SetNillableDescription(s *string) *ThreadUpdate
- func (tu *ThreadUpdate) SetNillableModifiedAt(t *time.Time) *ThreadUpdate
- func (tu *ThreadUpdate) SetNillableSlug(s *string) *ThreadUpdate
- func (tu *ThreadUpdate) SetNillableTitle(s *string) *ThreadUpdate
- func (tu *ThreadUpdate) SetSlug(s string) *ThreadUpdate
- func (tu *ThreadUpdate) SetTitle(s string) *ThreadUpdate
- func (tu *ThreadUpdate) SetTopics(t *Topic) *ThreadUpdate
- func (tu *ThreadUpdate) SetTopicsID(id int) *ThreadUpdate
- func (tu *ThreadUpdate) Where(ps ...predicate.Thread) *ThreadUpdate
- type ThreadUpdateOne
- func (tuo *ThreadUpdateOne) AddKudoedUserIDs(ids ...uuid.UUID) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) AddKudoedUsers(u ...*User) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) AddTagIDs(ids ...int) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) AddTags(t ...*Tag) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) AddThreadCommentIDs(ids ...int) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) AddThreadComments(c ...*Comment) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) ClearDescription() *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) ClearKudoedUsers() *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) ClearModifiedAt() *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) ClearTags() *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) ClearThreadComments() *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) ClearTopics() *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) Exec(ctx context.Context) error
- func (tuo *ThreadUpdateOne) ExecX(ctx context.Context)
- func (tuo *ThreadUpdateOne) Mutation() *ThreadMutation
- func (tuo *ThreadUpdateOne) RemoveKudoedUserIDs(ids ...uuid.UUID) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) RemoveKudoedUsers(u ...*User) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) RemoveTagIDs(ids ...int) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) RemoveTags(t ...*Tag) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) RemoveThreadCommentIDs(ids ...int) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) RemoveThreadComments(c ...*Comment) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) Save(ctx context.Context) (*Thread, error)
- func (tuo *ThreadUpdateOne) SaveX(ctx context.Context) *Thread
- func (tuo *ThreadUpdateOne) Select(field string, fields ...string) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) SetDescription(s string) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) SetModifiedAt(t time.Time) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) SetNillableDescription(s *string) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) SetNillableModifiedAt(t *time.Time) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) SetNillableSlug(s *string) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) SetNillableTitle(s *string) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) SetSlug(s string) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) SetTitle(s string) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) SetTopics(t *Topic) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) SetTopicsID(id int) *ThreadUpdateOne
- func (tuo *ThreadUpdateOne) Where(ps ...predicate.Thread) *ThreadUpdateOne
- type Threads
- type Topic
- func (t *Topic) QueryModerators() *ModeratorQuery
- func (t *Topic) QueryTopicModerators() *UserQuery
- func (t *Topic) QueryTopicThreads() *ThreadQuery
- func (t *Topic) String() string
- func (t *Topic) Unwrap() *Topic
- func (t *Topic) Update() *TopicUpdateOne
- func (t *Topic) Value(name string) (ent.Value, error)
- type TopicClient
- func (c *TopicClient) Create() *TopicCreate
- func (c *TopicClient) CreateBulk(builders ...*TopicCreate) *TopicCreateBulk
- func (c *TopicClient) Delete() *TopicDelete
- func (c *TopicClient) DeleteOne(t *Topic) *TopicDeleteOne
- func (c *TopicClient) DeleteOneID(id int) *TopicDeleteOne
- func (c *TopicClient) Get(ctx context.Context, id int) (*Topic, error)
- func (c *TopicClient) GetX(ctx context.Context, id int) *Topic
- func (c *TopicClient) Hooks() []Hook
- func (c *TopicClient) Intercept(interceptors ...Interceptor)
- func (c *TopicClient) Interceptors() []Interceptor
- func (c *TopicClient) MapCreateBulk(slice any, setFunc func(*TopicCreate, int)) *TopicCreateBulk
- func (c *TopicClient) Query() *TopicQuery
- func (c *TopicClient) QueryModerators(t *Topic) *ModeratorQuery
- func (c *TopicClient) QueryTopicModerators(t *Topic) *UserQuery
- func (c *TopicClient) QueryTopicThreads(t *Topic) *ThreadQuery
- func (c *TopicClient) Update() *TopicUpdate
- func (c *TopicClient) UpdateOne(t *Topic) *TopicUpdateOne
- func (c *TopicClient) UpdateOneID(id int) *TopicUpdateOne
- func (c *TopicClient) Use(hooks ...Hook)
- type TopicCreate
- func (tc *TopicCreate) AddTopicModeratorIDs(ids ...uuid.UUID) *TopicCreate
- func (tc *TopicCreate) AddTopicModerators(u ...*User) *TopicCreate
- func (tc *TopicCreate) AddTopicThreadIDs(ids ...int) *TopicCreate
- func (tc *TopicCreate) AddTopicThreads(t ...*Thread) *TopicCreate
- func (tc *TopicCreate) Exec(ctx context.Context) error
- func (tc *TopicCreate) ExecX(ctx context.Context)
- func (tc *TopicCreate) Mutation() *TopicMutation
- func (tc *TopicCreate) Save(ctx context.Context) (*Topic, error)
- func (tc *TopicCreate) SaveX(ctx context.Context) *Topic
- func (tc *TopicCreate) SetCreatedAt(t time.Time) *TopicCreate
- func (tc *TopicCreate) SetDescription(s string) *TopicCreate
- func (tc *TopicCreate) SetNillableCreatedAt(t *time.Time) *TopicCreate
- func (tc *TopicCreate) SetNillableDescription(s *string) *TopicCreate
- func (tc *TopicCreate) SetNillableProfilePicURL(s *string) *TopicCreate
- func (tc *TopicCreate) SetProfilePicURL(s string) *TopicCreate
- func (tc *TopicCreate) SetShortDescription(s string) *TopicCreate
- func (tc *TopicCreate) SetSlug(s string) *TopicCreate
- func (tc *TopicCreate) SetTitle(s string) *TopicCreate
- type TopicCreateBulk
- type TopicDelete
- type TopicDeleteOne
- type TopicEdges
- type TopicGroupBy
- func (tgb *TopicGroupBy) Aggregate(fns ...AggregateFunc) *TopicGroupBy
- func (s *TopicGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TopicGroupBy) BoolX(ctx context.Context) bool
- func (s *TopicGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TopicGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TopicGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TopicGroupBy) Float64X(ctx context.Context) float64
- func (s *TopicGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TopicGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TopicGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TopicGroupBy) IntX(ctx context.Context) int
- func (s *TopicGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TopicGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TopicGroupBy) Scan(ctx context.Context, v any) error
- func (s *TopicGroupBy) ScanX(ctx context.Context, v any)
- func (s *TopicGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TopicGroupBy) StringX(ctx context.Context) string
- func (s *TopicGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TopicGroupBy) StringsX(ctx context.Context) []string
- type TopicMutation
- func (m *TopicMutation) AddField(name string, value ent.Value) error
- func (m *TopicMutation) AddTopicModeratorIDs(ids ...uuid.UUID)
- func (m *TopicMutation) AddTopicThreadIDs(ids ...int)
- func (m *TopicMutation) AddedEdges() []string
- func (m *TopicMutation) AddedField(name string) (ent.Value, bool)
- func (m *TopicMutation) AddedFields() []string
- func (m *TopicMutation) AddedIDs(name string) []ent.Value
- func (m *TopicMutation) ClearDescription()
- func (m *TopicMutation) ClearEdge(name string) error
- func (m *TopicMutation) ClearField(name string) error
- func (m *TopicMutation) ClearProfilePicURL()
- func (m *TopicMutation) ClearTopicModerators()
- func (m *TopicMutation) ClearTopicThreads()
- func (m *TopicMutation) ClearedEdges() []string
- func (m *TopicMutation) ClearedFields() []string
- func (m TopicMutation) Client() *Client
- func (m *TopicMutation) CreatedAt() (r time.Time, exists bool)
- func (m *TopicMutation) Description() (r string, exists bool)
- func (m *TopicMutation) DescriptionCleared() bool
- func (m *TopicMutation) EdgeCleared(name string) bool
- func (m *TopicMutation) Field(name string) (ent.Value, bool)
- func (m *TopicMutation) FieldCleared(name string) bool
- func (m *TopicMutation) Fields() []string
- func (m *TopicMutation) ID() (id int, exists bool)
- func (m *TopicMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TopicMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TopicMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *TopicMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TopicMutation) OldProfilePicURL(ctx context.Context) (v string, err error)
- func (m *TopicMutation) OldShortDescription(ctx context.Context) (v string, err error)
- func (m *TopicMutation) OldSlug(ctx context.Context) (v string, err error)
- func (m *TopicMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *TopicMutation) Op() Op
- func (m *TopicMutation) ProfilePicURL() (r string, exists bool)
- func (m *TopicMutation) ProfilePicURLCleared() bool
- func (m *TopicMutation) RemoveTopicModeratorIDs(ids ...uuid.UUID)
- func (m *TopicMutation) RemoveTopicThreadIDs(ids ...int)
- func (m *TopicMutation) RemovedEdges() []string
- func (m *TopicMutation) RemovedIDs(name string) []ent.Value
- func (m *TopicMutation) RemovedTopicModeratorsIDs() (ids []uuid.UUID)
- func (m *TopicMutation) RemovedTopicThreadsIDs() (ids []int)
- func (m *TopicMutation) ResetCreatedAt()
- func (m *TopicMutation) ResetDescription()
- func (m *TopicMutation) ResetEdge(name string) error
- func (m *TopicMutation) ResetField(name string) error
- func (m *TopicMutation) ResetProfilePicURL()
- func (m *TopicMutation) ResetShortDescription()
- func (m *TopicMutation) ResetSlug()
- func (m *TopicMutation) ResetTitle()
- func (m *TopicMutation) ResetTopicModerators()
- func (m *TopicMutation) ResetTopicThreads()
- func (m *TopicMutation) SetCreatedAt(t time.Time)
- func (m *TopicMutation) SetDescription(s string)
- func (m *TopicMutation) SetField(name string, value ent.Value) error
- func (m *TopicMutation) SetOp(op Op)
- func (m *TopicMutation) SetProfilePicURL(s string)
- func (m *TopicMutation) SetShortDescription(s string)
- func (m *TopicMutation) SetSlug(s string)
- func (m *TopicMutation) SetTitle(s string)
- func (m *TopicMutation) ShortDescription() (r string, exists bool)
- func (m *TopicMutation) Slug() (r string, exists bool)
- func (m *TopicMutation) Title() (r string, exists bool)
- func (m *TopicMutation) TopicModeratorsCleared() bool
- func (m *TopicMutation) TopicModeratorsIDs() (ids []uuid.UUID)
- func (m *TopicMutation) TopicThreadsCleared() bool
- func (m *TopicMutation) TopicThreadsIDs() (ids []int)
- func (m TopicMutation) Tx() (*Tx, error)
- func (m *TopicMutation) Type() string
- func (m *TopicMutation) Where(ps ...predicate.Topic)
- func (m *TopicMutation) WhereP(ps ...func(*sql.Selector))
- type TopicQuery
- func (tq *TopicQuery) Aggregate(fns ...AggregateFunc) *TopicSelect
- func (tq *TopicQuery) All(ctx context.Context) ([]*Topic, error)
- func (tq *TopicQuery) AllX(ctx context.Context) []*Topic
- func (tq *TopicQuery) Clone() *TopicQuery
- func (tq *TopicQuery) Count(ctx context.Context) (int, error)
- func (tq *TopicQuery) CountX(ctx context.Context) int
- func (tq *TopicQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TopicQuery) ExistX(ctx context.Context) bool
- func (tq *TopicQuery) First(ctx context.Context) (*Topic, error)
- func (tq *TopicQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *TopicQuery) FirstIDX(ctx context.Context) int
- func (tq *TopicQuery) FirstX(ctx context.Context) *Topic
- func (tq *TopicQuery) GroupBy(field string, fields ...string) *TopicGroupBy
- func (tq *TopicQuery) IDs(ctx context.Context) (ids []int, err error)
- func (tq *TopicQuery) IDsX(ctx context.Context) []int
- func (tq *TopicQuery) Limit(limit int) *TopicQuery
- func (tq *TopicQuery) Offset(offset int) *TopicQuery
- func (tq *TopicQuery) Only(ctx context.Context) (*Topic, error)
- func (tq *TopicQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *TopicQuery) OnlyIDX(ctx context.Context) int
- func (tq *TopicQuery) OnlyX(ctx context.Context) *Topic
- func (tq *TopicQuery) Order(o ...topic.OrderOption) *TopicQuery
- func (tq *TopicQuery) QueryModerators() *ModeratorQuery
- func (tq *TopicQuery) QueryTopicModerators() *UserQuery
- func (tq *TopicQuery) QueryTopicThreads() *ThreadQuery
- func (tq *TopicQuery) Select(fields ...string) *TopicSelect
- func (tq *TopicQuery) Unique(unique bool) *TopicQuery
- func (tq *TopicQuery) Where(ps ...predicate.Topic) *TopicQuery
- func (tq *TopicQuery) WithModerators(opts ...func(*ModeratorQuery)) *TopicQuery
- func (tq *TopicQuery) WithTopicModerators(opts ...func(*UserQuery)) *TopicQuery
- func (tq *TopicQuery) WithTopicThreads(opts ...func(*ThreadQuery)) *TopicQuery
- type TopicSelect
- func (ts *TopicSelect) Aggregate(fns ...AggregateFunc) *TopicSelect
- func (s *TopicSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TopicSelect) BoolX(ctx context.Context) bool
- func (s *TopicSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TopicSelect) BoolsX(ctx context.Context) []bool
- func (s *TopicSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TopicSelect) Float64X(ctx context.Context) float64
- func (s *TopicSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TopicSelect) Float64sX(ctx context.Context) []float64
- func (s *TopicSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TopicSelect) IntX(ctx context.Context) int
- func (s *TopicSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TopicSelect) IntsX(ctx context.Context) []int
- func (ts *TopicSelect) Scan(ctx context.Context, v any) error
- func (s *TopicSelect) ScanX(ctx context.Context, v any)
- func (s *TopicSelect) String(ctx context.Context) (_ string, err error)
- func (s *TopicSelect) StringX(ctx context.Context) string
- func (s *TopicSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TopicSelect) StringsX(ctx context.Context) []string
- type TopicUpdate
- func (tu *TopicUpdate) AddTopicModeratorIDs(ids ...uuid.UUID) *TopicUpdate
- func (tu *TopicUpdate) AddTopicModerators(u ...*User) *TopicUpdate
- func (tu *TopicUpdate) AddTopicThreadIDs(ids ...int) *TopicUpdate
- func (tu *TopicUpdate) AddTopicThreads(t ...*Thread) *TopicUpdate
- func (tu *TopicUpdate) ClearDescription() *TopicUpdate
- func (tu *TopicUpdate) ClearProfilePicURL() *TopicUpdate
- func (tu *TopicUpdate) ClearTopicModerators() *TopicUpdate
- func (tu *TopicUpdate) ClearTopicThreads() *TopicUpdate
- func (tu *TopicUpdate) Exec(ctx context.Context) error
- func (tu *TopicUpdate) ExecX(ctx context.Context)
- func (tu *TopicUpdate) Mutation() *TopicMutation
- func (tu *TopicUpdate) RemoveTopicModeratorIDs(ids ...uuid.UUID) *TopicUpdate
- func (tu *TopicUpdate) RemoveTopicModerators(u ...*User) *TopicUpdate
- func (tu *TopicUpdate) RemoveTopicThreadIDs(ids ...int) *TopicUpdate
- func (tu *TopicUpdate) RemoveTopicThreads(t ...*Thread) *TopicUpdate
- func (tu *TopicUpdate) Save(ctx context.Context) (int, error)
- func (tu *TopicUpdate) SaveX(ctx context.Context) int
- func (tu *TopicUpdate) SetDescription(s string) *TopicUpdate
- func (tu *TopicUpdate) SetNillableDescription(s *string) *TopicUpdate
- func (tu *TopicUpdate) SetNillableProfilePicURL(s *string) *TopicUpdate
- func (tu *TopicUpdate) SetNillableShortDescription(s *string) *TopicUpdate
- func (tu *TopicUpdate) SetNillableSlug(s *string) *TopicUpdate
- func (tu *TopicUpdate) SetNillableTitle(s *string) *TopicUpdate
- func (tu *TopicUpdate) SetProfilePicURL(s string) *TopicUpdate
- func (tu *TopicUpdate) SetShortDescription(s string) *TopicUpdate
- func (tu *TopicUpdate) SetSlug(s string) *TopicUpdate
- func (tu *TopicUpdate) SetTitle(s string) *TopicUpdate
- func (tu *TopicUpdate) Where(ps ...predicate.Topic) *TopicUpdate
- type TopicUpdateOne
- func (tuo *TopicUpdateOne) AddTopicModeratorIDs(ids ...uuid.UUID) *TopicUpdateOne
- func (tuo *TopicUpdateOne) AddTopicModerators(u ...*User) *TopicUpdateOne
- func (tuo *TopicUpdateOne) AddTopicThreadIDs(ids ...int) *TopicUpdateOne
- func (tuo *TopicUpdateOne) AddTopicThreads(t ...*Thread) *TopicUpdateOne
- func (tuo *TopicUpdateOne) ClearDescription() *TopicUpdateOne
- func (tuo *TopicUpdateOne) ClearProfilePicURL() *TopicUpdateOne
- func (tuo *TopicUpdateOne) ClearTopicModerators() *TopicUpdateOne
- func (tuo *TopicUpdateOne) ClearTopicThreads() *TopicUpdateOne
- func (tuo *TopicUpdateOne) Exec(ctx context.Context) error
- func (tuo *TopicUpdateOne) ExecX(ctx context.Context)
- func (tuo *TopicUpdateOne) Mutation() *TopicMutation
- func (tuo *TopicUpdateOne) RemoveTopicModeratorIDs(ids ...uuid.UUID) *TopicUpdateOne
- func (tuo *TopicUpdateOne) RemoveTopicModerators(u ...*User) *TopicUpdateOne
- func (tuo *TopicUpdateOne) RemoveTopicThreadIDs(ids ...int) *TopicUpdateOne
- func (tuo *TopicUpdateOne) RemoveTopicThreads(t ...*Thread) *TopicUpdateOne
- func (tuo *TopicUpdateOne) Save(ctx context.Context) (*Topic, error)
- func (tuo *TopicUpdateOne) SaveX(ctx context.Context) *Topic
- func (tuo *TopicUpdateOne) Select(field string, fields ...string) *TopicUpdateOne
- func (tuo *TopicUpdateOne) SetDescription(s string) *TopicUpdateOne
- func (tuo *TopicUpdateOne) SetNillableDescription(s *string) *TopicUpdateOne
- func (tuo *TopicUpdateOne) SetNillableProfilePicURL(s *string) *TopicUpdateOne
- func (tuo *TopicUpdateOne) SetNillableShortDescription(s *string) *TopicUpdateOne
- func (tuo *TopicUpdateOne) SetNillableSlug(s *string) *TopicUpdateOne
- func (tuo *TopicUpdateOne) SetNillableTitle(s *string) *TopicUpdateOne
- func (tuo *TopicUpdateOne) SetProfilePicURL(s string) *TopicUpdateOne
- func (tuo *TopicUpdateOne) SetShortDescription(s string) *TopicUpdateOne
- func (tuo *TopicUpdateOne) SetSlug(s string) *TopicUpdateOne
- func (tuo *TopicUpdateOne) SetTitle(s string) *TopicUpdateOne
- func (tuo *TopicUpdateOne) Where(ps ...predicate.Topic) *TopicUpdateOne
- type Topics
- type TraverseFunc
- type Traverser
- type Tx
- type User
- func (u *User) QueryCommentKudoes() *CommentKudoQuery
- func (u *User) QueryKudoedComments() *CommentQuery
- func (u *User) QueryKudoedThreads() *ThreadQuery
- func (u *User) QueryModeratedTopics() *TopicQuery
- func (u *User) QueryModerators() *ModeratorQuery
- func (u *User) QueryThreadKudoes() *ThreadKudoQuery
- func (u *User) QueryUserComments() *CommentQuery
- func (u *User) QueryUserThreads() *ThreadQuery
- func (u *User) String() string
- func (u *User) Unwrap() *User
- func (u *User) Update() *UserUpdateOne
- func (u *User) Value(name string) (ent.Value, error)
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryCommentKudoes(u *User) *CommentKudoQuery
- func (c *UserClient) QueryKudoedComments(u *User) *CommentQuery
- func (c *UserClient) QueryKudoedThreads(u *User) *ThreadQuery
- func (c *UserClient) QueryModeratedTopics(u *User) *TopicQuery
- func (c *UserClient) QueryModerators(u *User) *ModeratorQuery
- func (c *UserClient) QueryThreadKudoes(u *User) *ThreadKudoQuery
- func (c *UserClient) QueryUserComments(u *User) *CommentQuery
- func (c *UserClient) QueryUserThreads(u *User) *ThreadQuery
- 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) AddKudoedCommentIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddKudoedComments(c ...*Comment) *UserCreate
- func (uc *UserCreate) AddKudoedThreadIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddKudoedThreads(t ...*Thread) *UserCreate
- func (uc *UserCreate) AddModeratedTopicIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddModeratedTopics(t ...*Topic) *UserCreate
- func (uc *UserCreate) AddUserCommentIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddUserComments(c ...*Comment) *UserCreate
- func (uc *UserCreate) AddUserThreadIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddUserThreads(t ...*Thread) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- 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) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetEmailVerified(b bool) *UserCreate
- func (uc *UserCreate) SetFirstName(s string) *UserCreate
- func (uc *UserCreate) SetHash(b []byte) *UserCreate
- func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
- func (uc *UserCreate) SetLastName(s string) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableEmailVerified(b *bool) *UserCreate
- func (uc *UserCreate) SetNillableFirstName(s *string) *UserCreate
- func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate
- func (uc *UserCreate) SetNillableLastName(s *string) *UserCreate
- func (uc *UserCreate) SetUsername(s string) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- func (e UserEdges) CommentKudoesOrErr() ([]*CommentKudo, error)
- func (e UserEdges) KudoedCommentsOrErr() ([]*Comment, error)
- func (e UserEdges) KudoedThreadsOrErr() ([]*Thread, error)
- func (e UserEdges) ModeratedTopicsOrErr() ([]*Topic, error)
- func (e UserEdges) ModeratorsOrErr() ([]*Moderator, error)
- func (e UserEdges) ThreadKudoesOrErr() ([]*ThreadKudo, error)
- func (e UserEdges) UserCommentsOrErr() ([]*Comment, error)
- func (e UserEdges) UserThreadsOrErr() ([]*Thread, error)
- 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) AddKudoedCommentIDs(ids ...int)
- func (m *UserMutation) AddKudoedThreadIDs(ids ...int)
- func (m *UserMutation) AddModeratedTopicIDs(ids ...int)
- func (m *UserMutation) AddUserCommentIDs(ids ...int)
- func (m *UserMutation) AddUserThreadIDs(ids ...int)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearFirstName()
- func (m *UserMutation) ClearKudoedComments()
- func (m *UserMutation) ClearKudoedThreads()
- func (m *UserMutation) ClearLastName()
- func (m *UserMutation) ClearModeratedTopics()
- func (m *UserMutation) ClearUserComments()
- func (m *UserMutation) ClearUserThreads()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) EmailVerified() (r bool, exists bool)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) FirstName() (r string, exists bool)
- func (m *UserMutation) FirstNameCleared() bool
- func (m *UserMutation) Hash() (r []byte, exists bool)
- func (m *UserMutation) ID() (id uuid.UUID, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *UserMutation) KudoedCommentsCleared() bool
- func (m *UserMutation) KudoedCommentsIDs() (ids []int)
- func (m *UserMutation) KudoedThreadsCleared() bool
- func (m *UserMutation) KudoedThreadsIDs() (ids []int)
- func (m *UserMutation) LastName() (r string, exists bool)
- func (m *UserMutation) LastNameCleared() bool
- func (m *UserMutation) ModeratedTopicsCleared() bool
- func (m *UserMutation) ModeratedTopicsIDs() (ids []int)
- func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldEmailVerified(ctx context.Context) (v bool, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldHash(ctx context.Context) (v []byte, err error)
- func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) RemoveKudoedCommentIDs(ids ...int)
- func (m *UserMutation) RemoveKudoedThreadIDs(ids ...int)
- func (m *UserMutation) RemoveModeratedTopicIDs(ids ...int)
- func (m *UserMutation) RemoveUserCommentIDs(ids ...int)
- func (m *UserMutation) RemoveUserThreadIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedKudoedCommentsIDs() (ids []int)
- func (m *UserMutation) RemovedKudoedThreadsIDs() (ids []int)
- func (m *UserMutation) RemovedModeratedTopicsIDs() (ids []int)
- func (m *UserMutation) RemovedUserCommentsIDs() (ids []int)
- func (m *UserMutation) RemovedUserThreadsIDs() (ids []int)
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetEmailVerified()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetFirstName()
- func (m *UserMutation) ResetHash()
- func (m *UserMutation) ResetKudoedComments()
- func (m *UserMutation) ResetKudoedThreads()
- func (m *UserMutation) ResetLastName()
- func (m *UserMutation) ResetModeratedTopics()
- func (m *UserMutation) ResetUserComments()
- func (m *UserMutation) ResetUserThreads()
- func (m *UserMutation) ResetUsername()
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetEmailVerified(b bool)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetFirstName(s string)
- func (m *UserMutation) SetHash(b []byte)
- func (m *UserMutation) SetID(id uuid.UUID)
- func (m *UserMutation) SetLastName(s string)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetUsername(s string)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UserCommentsCleared() bool
- func (m *UserMutation) UserCommentsIDs() (ids []int)
- func (m *UserMutation) UserThreadsCleared() bool
- func (m *UserMutation) UserThreadsIDs() (ids []int)
- func (m *UserMutation) Username() (r string, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (uq *UserQuery) QueryCommentKudoes() *CommentKudoQuery
- func (uq *UserQuery) QueryKudoedComments() *CommentQuery
- func (uq *UserQuery) QueryKudoedThreads() *ThreadQuery
- func (uq *UserQuery) QueryModeratedTopics() *TopicQuery
- func (uq *UserQuery) QueryModerators() *ModeratorQuery
- func (uq *UserQuery) QueryThreadKudoes() *ThreadKudoQuery
- func (uq *UserQuery) QueryUserComments() *CommentQuery
- func (uq *UserQuery) QueryUserThreads() *ThreadQuery
- 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) WithCommentKudoes(opts ...func(*CommentKudoQuery)) *UserQuery
- func (uq *UserQuery) WithKudoedComments(opts ...func(*CommentQuery)) *UserQuery
- func (uq *UserQuery) WithKudoedThreads(opts ...func(*ThreadQuery)) *UserQuery
- func (uq *UserQuery) WithModeratedTopics(opts ...func(*TopicQuery)) *UserQuery
- func (uq *UserQuery) WithModerators(opts ...func(*ModeratorQuery)) *UserQuery
- func (uq *UserQuery) WithThreadKudoes(opts ...func(*ThreadKudoQuery)) *UserQuery
- func (uq *UserQuery) WithUserComments(opts ...func(*CommentQuery)) *UserQuery
- func (uq *UserQuery) WithUserThreads(opts ...func(*ThreadQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddKudoedCommentIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddKudoedComments(c ...*Comment) *UserUpdate
- func (uu *UserUpdate) AddKudoedThreadIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddKudoedThreads(t ...*Thread) *UserUpdate
- func (uu *UserUpdate) AddModeratedTopicIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddModeratedTopics(t ...*Topic) *UserUpdate
- func (uu *UserUpdate) AddUserCommentIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddUserComments(c ...*Comment) *UserUpdate
- func (uu *UserUpdate) AddUserThreadIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddUserThreads(t ...*Thread) *UserUpdate
- func (uu *UserUpdate) ClearFirstName() *UserUpdate
- func (uu *UserUpdate) ClearKudoedComments() *UserUpdate
- func (uu *UserUpdate) ClearKudoedThreads() *UserUpdate
- func (uu *UserUpdate) ClearLastName() *UserUpdate
- func (uu *UserUpdate) ClearModeratedTopics() *UserUpdate
- func (uu *UserUpdate) ClearUserComments() *UserUpdate
- func (uu *UserUpdate) ClearUserThreads() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveKudoedCommentIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveKudoedComments(c ...*Comment) *UserUpdate
- func (uu *UserUpdate) RemoveKudoedThreadIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveKudoedThreads(t ...*Thread) *UserUpdate
- func (uu *UserUpdate) RemoveModeratedTopicIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveModeratedTopics(t ...*Topic) *UserUpdate
- func (uu *UserUpdate) RemoveUserCommentIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveUserComments(c ...*Comment) *UserUpdate
- func (uu *UserUpdate) RemoveUserThreadIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveUserThreads(t ...*Thread) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetEmailVerified(b bool) *UserUpdate
- func (uu *UserUpdate) SetFirstName(s string) *UserUpdate
- func (uu *UserUpdate) SetHash(b []byte) *UserUpdate
- func (uu *UserUpdate) SetLastName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableEmailVerified(b *bool) *UserUpdate
- func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableUsername(s *string) *UserUpdate
- func (uu *UserUpdate) SetUsername(s string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddKudoedCommentIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddKudoedComments(c ...*Comment) *UserUpdateOne
- func (uuo *UserUpdateOne) AddKudoedThreadIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddKudoedThreads(t ...*Thread) *UserUpdateOne
- func (uuo *UserUpdateOne) AddModeratedTopicIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddModeratedTopics(t ...*Topic) *UserUpdateOne
- func (uuo *UserUpdateOne) AddUserCommentIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddUserComments(c ...*Comment) *UserUpdateOne
- func (uuo *UserUpdateOne) AddUserThreadIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddUserThreads(t ...*Thread) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearFirstName() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearKudoedComments() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearKudoedThreads() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearLastName() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearModeratedTopics() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearUserComments() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearUserThreads() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveKudoedCommentIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveKudoedComments(c ...*Comment) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveKudoedThreadIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveKudoedThreads(t ...*Thread) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveModeratedTopicIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveModeratedTopics(t ...*Topic) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveUserCommentIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveUserComments(c ...*Comment) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveUserThreadIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveUserThreads(t ...*Thread) *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) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmailVerified(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetHash(b []byte) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmailVerified(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableUsername(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- 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. TypeComment = "Comment" TypeCommentKudo = "CommentKudo" TypeModerator = "Moderator" TypeTag = "Tag" TypeThread = "Thread" TypeThreadKudo = "ThreadKudo" TypeTopic = "Topic" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Comment is the client for interacting with the Comment builders. Comment *CommentClient // CommentKudo is the client for interacting with the CommentKudo builders. CommentKudo *CommentKudoClient // Moderator is the client for interacting with the Moderator builders. Moderator *ModeratorClient // Tag is the client for interacting with the Tag builders. Tag *TagClient // Thread is the client for interacting with the Thread builders. Thread *ThreadClient // ThreadKudo is the client for interacting with the ThreadKudo builders. ThreadKudo *ThreadKudoClient // Topic is the client for interacting with the Topic builders. Topic *TopicClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Comment. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type Comment ¶
type Comment struct { // ID of the ent. ID int `json:"id,omitempty"` // ParentID holds the value of the "parent_id" field. ParentID int `json:"parent_id,omitempty"` // Content holds the value of the "content" field. Content string `json:"content,omitempty"` // ModifiedAt holds the value of the "modified_at" field. ModifiedAt time.Time `json:"modified_at,omitempty"` // CreatedBy holds the value of the "created_by" field. CreatedBy uuid.UUID `json:"created_by,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CommentQuery when eager-loading is set. Edges CommentEdges `json:"edges"` // contains filtered or unexported fields }
Comment is the model entity for the Comment schema.
func (*Comment) QueryCommentAuthors ¶
QueryCommentAuthors queries the "comment_authors" edge of the Comment entity.
func (*Comment) QueryCommentKudoes ¶
func (c *Comment) QueryCommentKudoes() *CommentKudoQuery
QueryCommentKudoes queries the "comment_kudoes" edge of the Comment entity.
func (*Comment) QueryKudoedUsers ¶
QueryKudoedUsers queries the "kudoed_users" edge of the Comment entity.
func (*Comment) QueryThreads ¶
func (c *Comment) QueryThreads() *ThreadQuery
QueryThreads queries the "threads" edge of the Comment entity.
func (*Comment) Unwrap ¶
Unwrap unwraps the Comment 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 (*Comment) Update ¶
func (c *Comment) Update() *CommentUpdateOne
Update returns a builder for updating this Comment. Note that you need to call Comment.Unwrap() before calling this method if this Comment was returned from a transaction, and the transaction was committed or rolled back.
type CommentClient ¶
type CommentClient struct {
// contains filtered or unexported fields
}
CommentClient is a client for the Comment schema.
func NewCommentClient ¶
func NewCommentClient(c config) *CommentClient
NewCommentClient returns a client for the Comment from the given config.
func (*CommentClient) Create ¶
func (c *CommentClient) Create() *CommentCreate
Create returns a builder for creating a Comment entity.
func (*CommentClient) CreateBulk ¶
func (c *CommentClient) CreateBulk(builders ...*CommentCreate) *CommentCreateBulk
CreateBulk returns a builder for creating a bulk of Comment entities.
func (*CommentClient) Delete ¶
func (c *CommentClient) Delete() *CommentDelete
Delete returns a delete builder for Comment.
func (*CommentClient) DeleteOne ¶
func (c *CommentClient) DeleteOne(co *Comment) *CommentDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CommentClient) DeleteOneID ¶
func (c *CommentClient) DeleteOneID(id int) *CommentDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CommentClient) GetX ¶
func (c *CommentClient) GetX(ctx context.Context, id int) *Comment
GetX is like Get, but panics if an error occurs.
func (*CommentClient) Hooks ¶
func (c *CommentClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CommentClient) Intercept ¶
func (c *CommentClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `comment.Intercept(f(g(h())))`.
func (*CommentClient) Interceptors ¶
func (c *CommentClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CommentClient) MapCreateBulk ¶
func (c *CommentClient) MapCreateBulk(slice any, setFunc func(*CommentCreate, int)) *CommentCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*CommentClient) Query ¶
func (c *CommentClient) Query() *CommentQuery
Query returns a query builder for Comment.
func (*CommentClient) QueryCommentAuthors ¶
func (c *CommentClient) QueryCommentAuthors(co *Comment) *UserQuery
QueryCommentAuthors queries the comment_authors edge of a Comment.
func (*CommentClient) QueryCommentKudoes ¶
func (c *CommentClient) QueryCommentKudoes(co *Comment) *CommentKudoQuery
QueryCommentKudoes queries the comment_kudoes edge of a Comment.
func (*CommentClient) QueryKudoedUsers ¶
func (c *CommentClient) QueryKudoedUsers(co *Comment) *UserQuery
QueryKudoedUsers queries the kudoed_users edge of a Comment.
func (*CommentClient) QueryThreads ¶
func (c *CommentClient) QueryThreads(co *Comment) *ThreadQuery
QueryThreads queries the threads edge of a Comment.
func (*CommentClient) Update ¶
func (c *CommentClient) Update() *CommentUpdate
Update returns an update builder for Comment.
func (*CommentClient) UpdateOne ¶
func (c *CommentClient) UpdateOne(co *Comment) *CommentUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CommentClient) UpdateOneID ¶
func (c *CommentClient) UpdateOneID(id int) *CommentUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CommentClient) Use ¶
func (c *CommentClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `comment.Hooks(f(g(h())))`.
type CommentCreate ¶
type CommentCreate struct {
// contains filtered or unexported fields
}
CommentCreate is the builder for creating a Comment entity.
func (*CommentCreate) AddKudoedUserIDs ¶
func (cc *CommentCreate) AddKudoedUserIDs(ids ...uuid.UUID) *CommentCreate
AddKudoedUserIDs adds the "kudoed_users" edge to the User entity by IDs.
func (*CommentCreate) AddKudoedUsers ¶
func (cc *CommentCreate) AddKudoedUsers(u ...*User) *CommentCreate
AddKudoedUsers adds the "kudoed_users" edges to the User entity.
func (*CommentCreate) Exec ¶
func (cc *CommentCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CommentCreate) ExecX ¶
func (cc *CommentCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CommentCreate) Mutation ¶
func (cc *CommentCreate) Mutation() *CommentMutation
Mutation returns the CommentMutation object of the builder.
func (*CommentCreate) Save ¶
func (cc *CommentCreate) Save(ctx context.Context) (*Comment, error)
Save creates the Comment in the database.
func (*CommentCreate) SaveX ¶
func (cc *CommentCreate) SaveX(ctx context.Context) *Comment
SaveX calls Save and panics if Save returns an error.
func (*CommentCreate) SetCommentAuthors ¶
func (cc *CommentCreate) SetCommentAuthors(u *User) *CommentCreate
SetCommentAuthors sets the "comment_authors" edge to the User entity.
func (*CommentCreate) SetCommentAuthorsID ¶
func (cc *CommentCreate) SetCommentAuthorsID(id uuid.UUID) *CommentCreate
SetCommentAuthorsID sets the "comment_authors" edge to the User entity by ID.
func (*CommentCreate) SetContent ¶
func (cc *CommentCreate) SetContent(s string) *CommentCreate
SetContent sets the "content" field.
func (*CommentCreate) SetCreatedAt ¶
func (cc *CommentCreate) SetCreatedAt(t time.Time) *CommentCreate
SetCreatedAt sets the "created_at" field.
func (*CommentCreate) SetCreatedBy ¶
func (cc *CommentCreate) SetCreatedBy(u uuid.UUID) *CommentCreate
SetCreatedBy sets the "created_by" field.
func (*CommentCreate) SetModifiedAt ¶
func (cc *CommentCreate) SetModifiedAt(t time.Time) *CommentCreate
SetModifiedAt sets the "modified_at" field.
func (*CommentCreate) SetNillableCreatedAt ¶
func (cc *CommentCreate) SetNillableCreatedAt(t *time.Time) *CommentCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*CommentCreate) SetNillableModifiedAt ¶
func (cc *CommentCreate) SetNillableModifiedAt(t *time.Time) *CommentCreate
SetNillableModifiedAt sets the "modified_at" field if the given value is not nil.
func (*CommentCreate) SetNillableParentID ¶
func (cc *CommentCreate) SetNillableParentID(i *int) *CommentCreate
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*CommentCreate) SetParentID ¶
func (cc *CommentCreate) SetParentID(i int) *CommentCreate
SetParentID sets the "parent_id" field.
func (*CommentCreate) SetThreads ¶
func (cc *CommentCreate) SetThreads(t *Thread) *CommentCreate
SetThreads sets the "threads" edge to the Thread entity.
func (*CommentCreate) SetThreadsID ¶
func (cc *CommentCreate) SetThreadsID(id int) *CommentCreate
SetThreadsID sets the "threads" edge to the Thread entity by ID.
type CommentCreateBulk ¶
type CommentCreateBulk struct {
// contains filtered or unexported fields
}
CommentCreateBulk is the builder for creating many Comment entities in bulk.
func (*CommentCreateBulk) Exec ¶
func (ccb *CommentCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CommentCreateBulk) ExecX ¶
func (ccb *CommentCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CommentDelete ¶
type CommentDelete struct {
// contains filtered or unexported fields
}
CommentDelete is the builder for deleting a Comment entity.
func (*CommentDelete) Exec ¶
func (cd *CommentDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CommentDelete) ExecX ¶
func (cd *CommentDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CommentDelete) Where ¶
func (cd *CommentDelete) Where(ps ...predicate.Comment) *CommentDelete
Where appends a list predicates to the CommentDelete builder.
type CommentDeleteOne ¶
type CommentDeleteOne struct {
// contains filtered or unexported fields
}
CommentDeleteOne is the builder for deleting a single Comment entity.
func (*CommentDeleteOne) Exec ¶
func (cdo *CommentDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CommentDeleteOne) ExecX ¶
func (cdo *CommentDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CommentDeleteOne) Where ¶
func (cdo *CommentDeleteOne) Where(ps ...predicate.Comment) *CommentDeleteOne
Where appends a list predicates to the CommentDelete builder.
type CommentEdges ¶
type CommentEdges struct { // Threads holds the value of the threads edge. Threads *Thread `json:"threads,omitempty"` // CommentAuthors holds the value of the comment_authors edge. CommentAuthors *User `json:"comment_authors,omitempty"` // KudoedUsers holds the value of the kudoed_users edge. KudoedUsers []*User `json:"kudoed_users,omitempty"` // CommentKudoes holds the value of the comment_kudoes edge. CommentKudoes []*CommentKudo `json:"comment_kudoes,omitempty"` // contains filtered or unexported fields }
CommentEdges holds the relations/edges for other nodes in the graph.
func (CommentEdges) CommentAuthorsOrErr ¶
func (e CommentEdges) CommentAuthorsOrErr() (*User, error)
CommentAuthorsOrErr returns the CommentAuthors value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (CommentEdges) CommentKudoesOrErr ¶
func (e CommentEdges) CommentKudoesOrErr() ([]*CommentKudo, error)
CommentKudoesOrErr returns the CommentKudoes value or an error if the edge was not loaded in eager-loading.
func (CommentEdges) KudoedUsersOrErr ¶
func (e CommentEdges) KudoedUsersOrErr() ([]*User, error)
KudoedUsersOrErr returns the KudoedUsers value or an error if the edge was not loaded in eager-loading.
func (CommentEdges) ThreadsOrErr ¶
func (e CommentEdges) ThreadsOrErr() (*Thread, error)
ThreadsOrErr returns the Threads value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type CommentGroupBy ¶
type CommentGroupBy struct {
// contains filtered or unexported fields
}
CommentGroupBy is the group-by builder for Comment entities.
func (*CommentGroupBy) Aggregate ¶
func (cgb *CommentGroupBy) Aggregate(fns ...AggregateFunc) *CommentGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CommentGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CommentGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CommentGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CommentGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CommentGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CommentGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CommentGroupBy) Scan ¶
func (cgb *CommentGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CommentGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CommentKudo ¶
type CommentKudo struct { // UserID holds the value of the "user_id" field. UserID uuid.UUID `json:"user_id,omitempty"` // CommentID holds the value of the "comment_id" field. CommentID int `json:"comment_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CommentKudoQuery when eager-loading is set. Edges CommentKudoEdges `json:"edges"` // contains filtered or unexported fields }
CommentKudo is the model entity for the CommentKudo schema.
func (*CommentKudo) QueryComment ¶
func (ck *CommentKudo) QueryComment() *CommentQuery
QueryComment queries the "comment" edge of the CommentKudo entity.
func (*CommentKudo) QueryUser ¶
func (ck *CommentKudo) QueryUser() *UserQuery
QueryUser queries the "user" edge of the CommentKudo entity.
func (*CommentKudo) String ¶
func (ck *CommentKudo) String() string
String implements the fmt.Stringer.
func (*CommentKudo) Unwrap ¶
func (ck *CommentKudo) Unwrap() *CommentKudo
Unwrap unwraps the CommentKudo 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 (*CommentKudo) Update ¶
func (ck *CommentKudo) Update() *CommentKudoUpdateOne
Update returns a builder for updating this CommentKudo. Note that you need to call CommentKudo.Unwrap() before calling this method if this CommentKudo was returned from a transaction, and the transaction was committed or rolled back.
type CommentKudoClient ¶
type CommentKudoClient struct {
// contains filtered or unexported fields
}
CommentKudoClient is a client for the CommentKudo schema.
func NewCommentKudoClient ¶
func NewCommentKudoClient(c config) *CommentKudoClient
NewCommentKudoClient returns a client for the CommentKudo from the given config.
func (*CommentKudoClient) Create ¶
func (c *CommentKudoClient) Create() *CommentKudoCreate
Create returns a builder for creating a CommentKudo entity.
func (*CommentKudoClient) CreateBulk ¶
func (c *CommentKudoClient) CreateBulk(builders ...*CommentKudoCreate) *CommentKudoCreateBulk
CreateBulk returns a builder for creating a bulk of CommentKudo entities.
func (*CommentKudoClient) Delete ¶
func (c *CommentKudoClient) Delete() *CommentKudoDelete
Delete returns a delete builder for CommentKudo.
func (*CommentKudoClient) Hooks ¶
func (c *CommentKudoClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CommentKudoClient) Intercept ¶
func (c *CommentKudoClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `commentkudo.Intercept(f(g(h())))`.
func (*CommentKudoClient) Interceptors ¶
func (c *CommentKudoClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CommentKudoClient) MapCreateBulk ¶
func (c *CommentKudoClient) MapCreateBulk(slice any, setFunc func(*CommentKudoCreate, int)) *CommentKudoCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*CommentKudoClient) Query ¶
func (c *CommentKudoClient) Query() *CommentKudoQuery
Query returns a query builder for CommentKudo.
func (*CommentKudoClient) QueryComment ¶
func (c *CommentKudoClient) QueryComment(ck *CommentKudo) *CommentQuery
QueryComment queries the comment edge of a CommentKudo.
func (*CommentKudoClient) QueryUser ¶
func (c *CommentKudoClient) QueryUser(ck *CommentKudo) *UserQuery
QueryUser queries the user edge of a CommentKudo.
func (*CommentKudoClient) Update ¶
func (c *CommentKudoClient) Update() *CommentKudoUpdate
Update returns an update builder for CommentKudo.
func (*CommentKudoClient) UpdateOne ¶
func (c *CommentKudoClient) UpdateOne(ck *CommentKudo) *CommentKudoUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CommentKudoClient) Use ¶
func (c *CommentKudoClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `commentkudo.Hooks(f(g(h())))`.
type CommentKudoCreate ¶
type CommentKudoCreate struct {
// contains filtered or unexported fields
}
CommentKudoCreate is the builder for creating a CommentKudo entity.
func (*CommentKudoCreate) Exec ¶
func (ckc *CommentKudoCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CommentKudoCreate) ExecX ¶
func (ckc *CommentKudoCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CommentKudoCreate) Mutation ¶
func (ckc *CommentKudoCreate) Mutation() *CommentKudoMutation
Mutation returns the CommentKudoMutation object of the builder.
func (*CommentKudoCreate) Save ¶
func (ckc *CommentKudoCreate) Save(ctx context.Context) (*CommentKudo, error)
Save creates the CommentKudo in the database.
func (*CommentKudoCreate) SaveX ¶
func (ckc *CommentKudoCreate) SaveX(ctx context.Context) *CommentKudo
SaveX calls Save and panics if Save returns an error.
func (*CommentKudoCreate) SetComment ¶
func (ckc *CommentKudoCreate) SetComment(c *Comment) *CommentKudoCreate
SetComment sets the "comment" edge to the Comment entity.
func (*CommentKudoCreate) SetCommentID ¶
func (ckc *CommentKudoCreate) SetCommentID(i int) *CommentKudoCreate
SetCommentID sets the "comment_id" field.
func (*CommentKudoCreate) SetUser ¶
func (ckc *CommentKudoCreate) SetUser(u *User) *CommentKudoCreate
SetUser sets the "user" edge to the User entity.
func (*CommentKudoCreate) SetUserID ¶
func (ckc *CommentKudoCreate) SetUserID(u uuid.UUID) *CommentKudoCreate
SetUserID sets the "user_id" field.
type CommentKudoCreateBulk ¶
type CommentKudoCreateBulk struct {
// contains filtered or unexported fields
}
CommentKudoCreateBulk is the builder for creating many CommentKudo entities in bulk.
func (*CommentKudoCreateBulk) Exec ¶
func (ckcb *CommentKudoCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CommentKudoCreateBulk) ExecX ¶
func (ckcb *CommentKudoCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CommentKudoCreateBulk) Save ¶
func (ckcb *CommentKudoCreateBulk) Save(ctx context.Context) ([]*CommentKudo, error)
Save creates the CommentKudo entities in the database.
func (*CommentKudoCreateBulk) SaveX ¶
func (ckcb *CommentKudoCreateBulk) SaveX(ctx context.Context) []*CommentKudo
SaveX is like Save, but panics if an error occurs.
type CommentKudoDelete ¶
type CommentKudoDelete struct {
// contains filtered or unexported fields
}
CommentKudoDelete is the builder for deleting a CommentKudo entity.
func (*CommentKudoDelete) Exec ¶
func (ckd *CommentKudoDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CommentKudoDelete) ExecX ¶
func (ckd *CommentKudoDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CommentKudoDelete) Where ¶
func (ckd *CommentKudoDelete) Where(ps ...predicate.CommentKudo) *CommentKudoDelete
Where appends a list predicates to the CommentKudoDelete builder.
type CommentKudoDeleteOne ¶
type CommentKudoDeleteOne struct {
// contains filtered or unexported fields
}
CommentKudoDeleteOne is the builder for deleting a single CommentKudo entity.
func (*CommentKudoDeleteOne) Exec ¶
func (ckdo *CommentKudoDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CommentKudoDeleteOne) ExecX ¶
func (ckdo *CommentKudoDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CommentKudoDeleteOne) Where ¶
func (ckdo *CommentKudoDeleteOne) Where(ps ...predicate.CommentKudo) *CommentKudoDeleteOne
Where appends a list predicates to the CommentKudoDelete builder.
type CommentKudoEdges ¶
type CommentKudoEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // Comment holds the value of the comment edge. Comment *Comment `json:"comment,omitempty"` // contains filtered or unexported fields }
CommentKudoEdges holds the relations/edges for other nodes in the graph.
func (CommentKudoEdges) CommentOrErr ¶
func (e CommentKudoEdges) CommentOrErr() (*Comment, error)
CommentOrErr returns the Comment value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (CommentKudoEdges) UserOrErr ¶
func (e CommentKudoEdges) 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 CommentKudoGroupBy ¶
type CommentKudoGroupBy struct {
// contains filtered or unexported fields
}
CommentKudoGroupBy is the group-by builder for CommentKudo entities.
func (*CommentKudoGroupBy) Aggregate ¶
func (ckgb *CommentKudoGroupBy) Aggregate(fns ...AggregateFunc) *CommentKudoGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CommentKudoGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CommentKudoGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CommentKudoGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CommentKudoGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CommentKudoGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CommentKudoGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CommentKudoGroupBy) Scan ¶
func (ckgb *CommentKudoGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CommentKudoGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CommentKudoMutation ¶
type CommentKudoMutation struct {
// contains filtered or unexported fields
}
CommentKudoMutation represents an operation that mutates the CommentKudo nodes in the graph.
func (*CommentKudoMutation) AddField ¶
func (m *CommentKudoMutation) 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 (*CommentKudoMutation) AddedEdges ¶
func (m *CommentKudoMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CommentKudoMutation) AddedField ¶
func (m *CommentKudoMutation) 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 (*CommentKudoMutation) AddedFields ¶
func (m *CommentKudoMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CommentKudoMutation) AddedIDs ¶
func (m *CommentKudoMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CommentKudoMutation) ClearComment ¶
func (m *CommentKudoMutation) ClearComment()
ClearComment clears the "comment" edge to the Comment entity.
func (*CommentKudoMutation) ClearEdge ¶
func (m *CommentKudoMutation) 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 (*CommentKudoMutation) ClearField ¶
func (m *CommentKudoMutation) 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 (*CommentKudoMutation) ClearUser ¶
func (m *CommentKudoMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*CommentKudoMutation) ClearedEdges ¶
func (m *CommentKudoMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CommentKudoMutation) ClearedFields ¶
func (m *CommentKudoMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CommentKudoMutation) Client ¶
func (m CommentKudoMutation) 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 (*CommentKudoMutation) CommentCleared ¶
func (m *CommentKudoMutation) CommentCleared() bool
CommentCleared reports if the "comment" edge to the Comment entity was cleared.
func (*CommentKudoMutation) CommentID ¶
func (m *CommentKudoMutation) CommentID() (r int, exists bool)
CommentID returns the value of the "comment_id" field in the mutation.
func (*CommentKudoMutation) CommentIDs ¶
func (m *CommentKudoMutation) CommentIDs() (ids []int)
CommentIDs returns the "comment" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CommentID instead. It exists only for internal usage by the builders.
func (*CommentKudoMutation) EdgeCleared ¶
func (m *CommentKudoMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CommentKudoMutation) Field ¶
func (m *CommentKudoMutation) 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 (*CommentKudoMutation) FieldCleared ¶
func (m *CommentKudoMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CommentKudoMutation) Fields ¶
func (m *CommentKudoMutation) 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 (*CommentKudoMutation) 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 (*CommentKudoMutation) Op ¶
func (m *CommentKudoMutation) Op() Op
Op returns the operation name.
func (*CommentKudoMutation) RemovedEdges ¶
func (m *CommentKudoMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CommentKudoMutation) RemovedIDs ¶
func (m *CommentKudoMutation) 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 (*CommentKudoMutation) ResetComment ¶
func (m *CommentKudoMutation) ResetComment()
ResetComment resets all changes to the "comment" edge.
func (*CommentKudoMutation) ResetCommentID ¶
func (m *CommentKudoMutation) ResetCommentID()
ResetCommentID resets all changes to the "comment_id" field.
func (*CommentKudoMutation) ResetEdge ¶
func (m *CommentKudoMutation) 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 (*CommentKudoMutation) ResetField ¶
func (m *CommentKudoMutation) 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 (*CommentKudoMutation) ResetUser ¶
func (m *CommentKudoMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*CommentKudoMutation) ResetUserID ¶
func (m *CommentKudoMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*CommentKudoMutation) SetCommentID ¶
func (m *CommentKudoMutation) SetCommentID(i int)
SetCommentID sets the "comment_id" field.
func (*CommentKudoMutation) SetField ¶
func (m *CommentKudoMutation) 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 (*CommentKudoMutation) SetOp ¶
func (m *CommentKudoMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CommentKudoMutation) SetUserID ¶
func (m *CommentKudoMutation) SetUserID(u uuid.UUID)
SetUserID sets the "user_id" field.
func (CommentKudoMutation) Tx ¶
func (m CommentKudoMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CommentKudoMutation) Type ¶
func (m *CommentKudoMutation) Type() string
Type returns the node type of this mutation (CommentKudo).
func (*CommentKudoMutation) UserCleared ¶
func (m *CommentKudoMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*CommentKudoMutation) UserID ¶
func (m *CommentKudoMutation) UserID() (r uuid.UUID, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*CommentKudoMutation) UserIDs ¶
func (m *CommentKudoMutation) 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 (*CommentKudoMutation) Where ¶
func (m *CommentKudoMutation) Where(ps ...predicate.CommentKudo)
Where appends a list predicates to the CommentKudoMutation builder.
func (*CommentKudoMutation) WhereP ¶
func (m *CommentKudoMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CommentKudoMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CommentKudoQuery ¶
type CommentKudoQuery struct {
// contains filtered or unexported fields
}
CommentKudoQuery is the builder for querying CommentKudo entities.
func (*CommentKudoQuery) Aggregate ¶
func (ckq *CommentKudoQuery) Aggregate(fns ...AggregateFunc) *CommentKudoSelect
Aggregate returns a CommentKudoSelect configured with the given aggregations.
func (*CommentKudoQuery) All ¶
func (ckq *CommentKudoQuery) All(ctx context.Context) ([]*CommentKudo, error)
All executes the query and returns a list of CommentKudos.
func (*CommentKudoQuery) AllX ¶
func (ckq *CommentKudoQuery) AllX(ctx context.Context) []*CommentKudo
AllX is like All, but panics if an error occurs.
func (*CommentKudoQuery) Clone ¶
func (ckq *CommentKudoQuery) Clone() *CommentKudoQuery
Clone returns a duplicate of the CommentKudoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CommentKudoQuery) Count ¶
func (ckq *CommentKudoQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CommentKudoQuery) CountX ¶
func (ckq *CommentKudoQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CommentKudoQuery) Exist ¶
func (ckq *CommentKudoQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CommentKudoQuery) ExistX ¶
func (ckq *CommentKudoQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CommentKudoQuery) First ¶
func (ckq *CommentKudoQuery) First(ctx context.Context) (*CommentKudo, error)
First returns the first CommentKudo entity from the query. Returns a *NotFoundError when no CommentKudo was found.
func (*CommentKudoQuery) FirstX ¶
func (ckq *CommentKudoQuery) FirstX(ctx context.Context) *CommentKudo
FirstX is like First, but panics if an error occurs.
func (*CommentKudoQuery) GroupBy ¶
func (ckq *CommentKudoQuery) GroupBy(field string, fields ...string) *CommentKudoGroupBy
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 { UserID uuid.UUID `json:"user_id,omitempty"` Count int `json:"count,omitempty"` } client.CommentKudo.Query(). GroupBy(commentkudo.FieldUserID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CommentKudoQuery) Limit ¶
func (ckq *CommentKudoQuery) Limit(limit int) *CommentKudoQuery
Limit the number of records to be returned by this query.
func (*CommentKudoQuery) Offset ¶
func (ckq *CommentKudoQuery) Offset(offset int) *CommentKudoQuery
Offset to start from.
func (*CommentKudoQuery) Only ¶
func (ckq *CommentKudoQuery) Only(ctx context.Context) (*CommentKudo, error)
Only returns a single CommentKudo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one CommentKudo entity is found. Returns a *NotFoundError when no CommentKudo entities are found.
func (*CommentKudoQuery) OnlyX ¶
func (ckq *CommentKudoQuery) OnlyX(ctx context.Context) *CommentKudo
OnlyX is like Only, but panics if an error occurs.
func (*CommentKudoQuery) Order ¶
func (ckq *CommentKudoQuery) Order(o ...commentkudo.OrderOption) *CommentKudoQuery
Order specifies how the records should be ordered.
func (*CommentKudoQuery) QueryComment ¶
func (ckq *CommentKudoQuery) QueryComment() *CommentQuery
QueryComment chains the current query on the "comment" edge.
func (*CommentKudoQuery) QueryUser ¶
func (ckq *CommentKudoQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*CommentKudoQuery) Select ¶
func (ckq *CommentKudoQuery) Select(fields ...string) *CommentKudoSelect
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 { UserID uuid.UUID `json:"user_id,omitempty"` } client.CommentKudo.Query(). Select(commentkudo.FieldUserID). Scan(ctx, &v)
func (*CommentKudoQuery) Unique ¶
func (ckq *CommentKudoQuery) Unique(unique bool) *CommentKudoQuery
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 (*CommentKudoQuery) Where ¶
func (ckq *CommentKudoQuery) Where(ps ...predicate.CommentKudo) *CommentKudoQuery
Where adds a new predicate for the CommentKudoQuery builder.
func (*CommentKudoQuery) WithComment ¶
func (ckq *CommentKudoQuery) WithComment(opts ...func(*CommentQuery)) *CommentKudoQuery
WithComment tells the query-builder to eager-load the nodes that are connected to the "comment" edge. The optional arguments are used to configure the query builder of the edge.
func (*CommentKudoQuery) WithUser ¶
func (ckq *CommentKudoQuery) WithUser(opts ...func(*UserQuery)) *CommentKudoQuery
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 CommentKudoSelect ¶
type CommentKudoSelect struct { *CommentKudoQuery // contains filtered or unexported fields }
CommentKudoSelect is the builder for selecting fields of CommentKudo entities.
func (*CommentKudoSelect) Aggregate ¶
func (cks *CommentKudoSelect) Aggregate(fns ...AggregateFunc) *CommentKudoSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CommentKudoSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CommentKudoSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CommentKudoSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CommentKudoSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CommentKudoSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CommentKudoSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CommentKudoSelect) Scan ¶
func (cks *CommentKudoSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CommentKudoSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CommentKudoUpdate ¶
type CommentKudoUpdate struct {
// contains filtered or unexported fields
}
CommentKudoUpdate is the builder for updating CommentKudo entities.
func (*CommentKudoUpdate) Exec ¶
func (cku *CommentKudoUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CommentKudoUpdate) ExecX ¶
func (cku *CommentKudoUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CommentKudoUpdate) Mutation ¶
func (cku *CommentKudoUpdate) Mutation() *CommentKudoMutation
Mutation returns the CommentKudoMutation object of the builder.
func (*CommentKudoUpdate) Save ¶
func (cku *CommentKudoUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CommentKudoUpdate) SaveX ¶
func (cku *CommentKudoUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CommentKudoUpdate) Where ¶
func (cku *CommentKudoUpdate) Where(ps ...predicate.CommentKudo) *CommentKudoUpdate
Where appends a list predicates to the CommentKudoUpdate builder.
type CommentKudoUpdateOne ¶
type CommentKudoUpdateOne struct {
// contains filtered or unexported fields
}
CommentKudoUpdateOne is the builder for updating a single CommentKudo entity.
func (*CommentKudoUpdateOne) Exec ¶
func (ckuo *CommentKudoUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CommentKudoUpdateOne) ExecX ¶
func (ckuo *CommentKudoUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CommentKudoUpdateOne) Mutation ¶
func (ckuo *CommentKudoUpdateOne) Mutation() *CommentKudoMutation
Mutation returns the CommentKudoMutation object of the builder.
func (*CommentKudoUpdateOne) Save ¶
func (ckuo *CommentKudoUpdateOne) Save(ctx context.Context) (*CommentKudo, error)
Save executes the query and returns the updated CommentKudo entity.
func (*CommentKudoUpdateOne) SaveX ¶
func (ckuo *CommentKudoUpdateOne) SaveX(ctx context.Context) *CommentKudo
SaveX is like Save, but panics if an error occurs.
func (*CommentKudoUpdateOne) Select ¶
func (ckuo *CommentKudoUpdateOne) Select(field string, fields ...string) *CommentKudoUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CommentKudoUpdateOne) Where ¶
func (ckuo *CommentKudoUpdateOne) Where(ps ...predicate.CommentKudo) *CommentKudoUpdateOne
Where appends a list predicates to the CommentKudoUpdate builder.
type CommentKudos ¶
type CommentKudos []*CommentKudo
CommentKudos is a parsable slice of CommentKudo.
type CommentMutation ¶
type CommentMutation struct {
// contains filtered or unexported fields
}
CommentMutation represents an operation that mutates the Comment nodes in the graph.
func (*CommentMutation) AddField ¶
func (m *CommentMutation) 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 (*CommentMutation) AddKudoedUserIDs ¶
func (m *CommentMutation) AddKudoedUserIDs(ids ...uuid.UUID)
AddKudoedUserIDs adds the "kudoed_users" edge to the User entity by ids.
func (*CommentMutation) AddParentID ¶
func (m *CommentMutation) AddParentID(i int)
AddParentID adds i to the "parent_id" field.
func (*CommentMutation) AddedEdges ¶
func (m *CommentMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CommentMutation) AddedField ¶
func (m *CommentMutation) 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 (*CommentMutation) AddedFields ¶
func (m *CommentMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CommentMutation) AddedIDs ¶
func (m *CommentMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CommentMutation) AddedParentID ¶
func (m *CommentMutation) AddedParentID() (r int, exists bool)
AddedParentID returns the value that was added to the "parent_id" field in this mutation.
func (*CommentMutation) ClearCommentAuthors ¶
func (m *CommentMutation) ClearCommentAuthors()
ClearCommentAuthors clears the "comment_authors" edge to the User entity.
func (*CommentMutation) ClearEdge ¶
func (m *CommentMutation) 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 (*CommentMutation) ClearField ¶
func (m *CommentMutation) 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 (*CommentMutation) ClearKudoedUsers ¶
func (m *CommentMutation) ClearKudoedUsers()
ClearKudoedUsers clears the "kudoed_users" edge to the User entity.
func (*CommentMutation) ClearModifiedAt ¶
func (m *CommentMutation) ClearModifiedAt()
ClearModifiedAt clears the value of the "modified_at" field.
func (*CommentMutation) ClearThreads ¶
func (m *CommentMutation) ClearThreads()
ClearThreads clears the "threads" edge to the Thread entity.
func (*CommentMutation) ClearedEdges ¶
func (m *CommentMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CommentMutation) ClearedFields ¶
func (m *CommentMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CommentMutation) Client ¶
func (m CommentMutation) 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 (*CommentMutation) CommentAuthorsCleared ¶
func (m *CommentMutation) CommentAuthorsCleared() bool
CommentAuthorsCleared reports if the "comment_authors" edge to the User entity was cleared.
func (*CommentMutation) CommentAuthorsID ¶
func (m *CommentMutation) CommentAuthorsID() (id uuid.UUID, exists bool)
CommentAuthorsID returns the "comment_authors" edge ID in the mutation.
func (*CommentMutation) CommentAuthorsIDs ¶
func (m *CommentMutation) CommentAuthorsIDs() (ids []uuid.UUID)
CommentAuthorsIDs returns the "comment_authors" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CommentAuthorsID instead. It exists only for internal usage by the builders.
func (*CommentMutation) Content ¶
func (m *CommentMutation) Content() (r string, exists bool)
Content returns the value of the "content" field in the mutation.
func (*CommentMutation) CreatedAt ¶
func (m *CommentMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*CommentMutation) CreatedBy ¶
func (m *CommentMutation) CreatedBy() (r uuid.UUID, exists bool)
CreatedBy returns the value of the "created_by" field in the mutation.
func (*CommentMutation) EdgeCleared ¶
func (m *CommentMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CommentMutation) Field ¶
func (m *CommentMutation) 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 (*CommentMutation) FieldCleared ¶
func (m *CommentMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CommentMutation) Fields ¶
func (m *CommentMutation) 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 (*CommentMutation) ID ¶
func (m *CommentMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CommentMutation) IDs ¶
func (m *CommentMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CommentMutation) KudoedUsersCleared ¶
func (m *CommentMutation) KudoedUsersCleared() bool
KudoedUsersCleared reports if the "kudoed_users" edge to the User entity was cleared.
func (*CommentMutation) KudoedUsersIDs ¶
func (m *CommentMutation) KudoedUsersIDs() (ids []uuid.UUID)
KudoedUsersIDs returns the "kudoed_users" edge IDs in the mutation.
func (*CommentMutation) ModifiedAt ¶
func (m *CommentMutation) ModifiedAt() (r time.Time, exists bool)
ModifiedAt returns the value of the "modified_at" field in the mutation.
func (*CommentMutation) ModifiedAtCleared ¶
func (m *CommentMutation) ModifiedAtCleared() bool
ModifiedAtCleared returns if the "modified_at" field was cleared in this mutation.
func (*CommentMutation) OldContent ¶
func (m *CommentMutation) OldContent(ctx context.Context) (v string, err error)
OldContent returns the old "content" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldCreatedBy ¶
OldCreatedBy returns the old "created_by" field's value of the Comment entity. If the Comment 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 (*CommentMutation) 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 (*CommentMutation) OldModifiedAt ¶
OldModifiedAt returns the old "modified_at" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldParentID ¶
func (m *CommentMutation) OldParentID(ctx context.Context) (v int, err error)
OldParentID returns the old "parent_id" field's value of the Comment entity. If the Comment 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 (*CommentMutation) ParentID ¶
func (m *CommentMutation) ParentID() (r int, exists bool)
ParentID returns the value of the "parent_id" field in the mutation.
func (*CommentMutation) RemoveKudoedUserIDs ¶
func (m *CommentMutation) RemoveKudoedUserIDs(ids ...uuid.UUID)
RemoveKudoedUserIDs removes the "kudoed_users" edge to the User entity by IDs.
func (*CommentMutation) RemovedEdges ¶
func (m *CommentMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CommentMutation) RemovedIDs ¶
func (m *CommentMutation) 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 (*CommentMutation) RemovedKudoedUsersIDs ¶
func (m *CommentMutation) RemovedKudoedUsersIDs() (ids []uuid.UUID)
RemovedKudoedUsers returns the removed IDs of the "kudoed_users" edge to the User entity.
func (*CommentMutation) ResetCommentAuthors ¶
func (m *CommentMutation) ResetCommentAuthors()
ResetCommentAuthors resets all changes to the "comment_authors" edge.
func (*CommentMutation) ResetContent ¶
func (m *CommentMutation) ResetContent()
ResetContent resets all changes to the "content" field.
func (*CommentMutation) ResetCreatedAt ¶
func (m *CommentMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*CommentMutation) ResetCreatedBy ¶
func (m *CommentMutation) ResetCreatedBy()
ResetCreatedBy resets all changes to the "created_by" field.
func (*CommentMutation) ResetEdge ¶
func (m *CommentMutation) 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 (*CommentMutation) ResetField ¶
func (m *CommentMutation) 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 (*CommentMutation) ResetKudoedUsers ¶
func (m *CommentMutation) ResetKudoedUsers()
ResetKudoedUsers resets all changes to the "kudoed_users" edge.
func (*CommentMutation) ResetModifiedAt ¶
func (m *CommentMutation) ResetModifiedAt()
ResetModifiedAt resets all changes to the "modified_at" field.
func (*CommentMutation) ResetParentID ¶
func (m *CommentMutation) ResetParentID()
ResetParentID resets all changes to the "parent_id" field.
func (*CommentMutation) ResetThreads ¶
func (m *CommentMutation) ResetThreads()
ResetThreads resets all changes to the "threads" edge.
func (*CommentMutation) SetCommentAuthorsID ¶
func (m *CommentMutation) SetCommentAuthorsID(id uuid.UUID)
SetCommentAuthorsID sets the "comment_authors" edge to the User entity by id.
func (*CommentMutation) SetContent ¶
func (m *CommentMutation) SetContent(s string)
SetContent sets the "content" field.
func (*CommentMutation) SetCreatedAt ¶
func (m *CommentMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*CommentMutation) SetCreatedBy ¶
func (m *CommentMutation) SetCreatedBy(u uuid.UUID)
SetCreatedBy sets the "created_by" field.
func (*CommentMutation) SetField ¶
func (m *CommentMutation) 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 (*CommentMutation) SetModifiedAt ¶
func (m *CommentMutation) SetModifiedAt(t time.Time)
SetModifiedAt sets the "modified_at" field.
func (*CommentMutation) SetOp ¶
func (m *CommentMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CommentMutation) SetParentID ¶
func (m *CommentMutation) SetParentID(i int)
SetParentID sets the "parent_id" field.
func (*CommentMutation) SetThreadsID ¶
func (m *CommentMutation) SetThreadsID(id int)
SetThreadsID sets the "threads" edge to the Thread entity by id.
func (*CommentMutation) ThreadsCleared ¶
func (m *CommentMutation) ThreadsCleared() bool
ThreadsCleared reports if the "threads" edge to the Thread entity was cleared.
func (*CommentMutation) ThreadsID ¶
func (m *CommentMutation) ThreadsID() (id int, exists bool)
ThreadsID returns the "threads" edge ID in the mutation.
func (*CommentMutation) ThreadsIDs ¶
func (m *CommentMutation) ThreadsIDs() (ids []int)
ThreadsIDs returns the "threads" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ThreadsID instead. It exists only for internal usage by the builders.
func (CommentMutation) Tx ¶
func (m CommentMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CommentMutation) Type ¶
func (m *CommentMutation) Type() string
Type returns the node type of this mutation (Comment).
func (*CommentMutation) Where ¶
func (m *CommentMutation) Where(ps ...predicate.Comment)
Where appends a list predicates to the CommentMutation builder.
func (*CommentMutation) WhereP ¶
func (m *CommentMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CommentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CommentQuery ¶
type CommentQuery struct {
// contains filtered or unexported fields
}
CommentQuery is the builder for querying Comment entities.
func (*CommentQuery) Aggregate ¶
func (cq *CommentQuery) Aggregate(fns ...AggregateFunc) *CommentSelect
Aggregate returns a CommentSelect configured with the given aggregations.
func (*CommentQuery) All ¶
func (cq *CommentQuery) All(ctx context.Context) ([]*Comment, error)
All executes the query and returns a list of Comments.
func (*CommentQuery) AllX ¶
func (cq *CommentQuery) AllX(ctx context.Context) []*Comment
AllX is like All, but panics if an error occurs.
func (*CommentQuery) Clone ¶
func (cq *CommentQuery) Clone() *CommentQuery
Clone returns a duplicate of the CommentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CommentQuery) Count ¶
func (cq *CommentQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CommentQuery) CountX ¶
func (cq *CommentQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CommentQuery) Exist ¶
func (cq *CommentQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CommentQuery) ExistX ¶
func (cq *CommentQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CommentQuery) First ¶
func (cq *CommentQuery) First(ctx context.Context) (*Comment, error)
First returns the first Comment entity from the query. Returns a *NotFoundError when no Comment was found.
func (*CommentQuery) FirstID ¶
func (cq *CommentQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Comment ID from the query. Returns a *NotFoundError when no Comment ID was found.
func (*CommentQuery) FirstIDX ¶
func (cq *CommentQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*CommentQuery) FirstX ¶
func (cq *CommentQuery) FirstX(ctx context.Context) *Comment
FirstX is like First, but panics if an error occurs.
func (*CommentQuery) GroupBy ¶
func (cq *CommentQuery) GroupBy(field string, fields ...string) *CommentGroupBy
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 { ParentID int `json:"parent_id,omitempty"` Count int `json:"count,omitempty"` } client.Comment.Query(). GroupBy(comment.FieldParentID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CommentQuery) IDs ¶
func (cq *CommentQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Comment IDs.
func (*CommentQuery) IDsX ¶
func (cq *CommentQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*CommentQuery) Limit ¶
func (cq *CommentQuery) Limit(limit int) *CommentQuery
Limit the number of records to be returned by this query.
func (*CommentQuery) Offset ¶
func (cq *CommentQuery) Offset(offset int) *CommentQuery
Offset to start from.
func (*CommentQuery) Only ¶
func (cq *CommentQuery) Only(ctx context.Context) (*Comment, error)
Only returns a single Comment entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Comment entity is found. Returns a *NotFoundError when no Comment entities are found.
func (*CommentQuery) OnlyID ¶
func (cq *CommentQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Comment ID in the query. Returns a *NotSingularError when more than one Comment ID is found. Returns a *NotFoundError when no entities are found.
func (*CommentQuery) OnlyIDX ¶
func (cq *CommentQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CommentQuery) OnlyX ¶
func (cq *CommentQuery) OnlyX(ctx context.Context) *Comment
OnlyX is like Only, but panics if an error occurs.
func (*CommentQuery) Order ¶
func (cq *CommentQuery) Order(o ...comment.OrderOption) *CommentQuery
Order specifies how the records should be ordered.
func (*CommentQuery) QueryCommentAuthors ¶
func (cq *CommentQuery) QueryCommentAuthors() *UserQuery
QueryCommentAuthors chains the current query on the "comment_authors" edge.
func (*CommentQuery) QueryCommentKudoes ¶
func (cq *CommentQuery) QueryCommentKudoes() *CommentKudoQuery
QueryCommentKudoes chains the current query on the "comment_kudoes" edge.
func (*CommentQuery) QueryKudoedUsers ¶
func (cq *CommentQuery) QueryKudoedUsers() *UserQuery
QueryKudoedUsers chains the current query on the "kudoed_users" edge.
func (*CommentQuery) QueryThreads ¶
func (cq *CommentQuery) QueryThreads() *ThreadQuery
QueryThreads chains the current query on the "threads" edge.
func (*CommentQuery) Select ¶
func (cq *CommentQuery) Select(fields ...string) *CommentSelect
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 { ParentID int `json:"parent_id,omitempty"` } client.Comment.Query(). Select(comment.FieldParentID). Scan(ctx, &v)
func (*CommentQuery) Unique ¶
func (cq *CommentQuery) Unique(unique bool) *CommentQuery
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 (*CommentQuery) Where ¶
func (cq *CommentQuery) Where(ps ...predicate.Comment) *CommentQuery
Where adds a new predicate for the CommentQuery builder.
func (*CommentQuery) WithCommentAuthors ¶
func (cq *CommentQuery) WithCommentAuthors(opts ...func(*UserQuery)) *CommentQuery
WithCommentAuthors tells the query-builder to eager-load the nodes that are connected to the "comment_authors" edge. The optional arguments are used to configure the query builder of the edge.
func (*CommentQuery) WithCommentKudoes ¶
func (cq *CommentQuery) WithCommentKudoes(opts ...func(*CommentKudoQuery)) *CommentQuery
WithCommentKudoes tells the query-builder to eager-load the nodes that are connected to the "comment_kudoes" edge. The optional arguments are used to configure the query builder of the edge.
func (*CommentQuery) WithKudoedUsers ¶
func (cq *CommentQuery) WithKudoedUsers(opts ...func(*UserQuery)) *CommentQuery
WithKudoedUsers tells the query-builder to eager-load the nodes that are connected to the "kudoed_users" edge. The optional arguments are used to configure the query builder of the edge.
func (*CommentQuery) WithThreads ¶
func (cq *CommentQuery) WithThreads(opts ...func(*ThreadQuery)) *CommentQuery
WithThreads tells the query-builder to eager-load the nodes that are connected to the "threads" edge. The optional arguments are used to configure the query builder of the edge.
type CommentSelect ¶
type CommentSelect struct { *CommentQuery // contains filtered or unexported fields }
CommentSelect is the builder for selecting fields of Comment entities.
func (*CommentSelect) Aggregate ¶
func (cs *CommentSelect) Aggregate(fns ...AggregateFunc) *CommentSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CommentSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CommentSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CommentSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CommentSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CommentSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CommentSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CommentSelect) Scan ¶
func (cs *CommentSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CommentSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CommentUpdate ¶
type CommentUpdate struct {
// contains filtered or unexported fields
}
CommentUpdate is the builder for updating Comment entities.
func (*CommentUpdate) AddKudoedUserIDs ¶
func (cu *CommentUpdate) AddKudoedUserIDs(ids ...uuid.UUID) *CommentUpdate
AddKudoedUserIDs adds the "kudoed_users" edge to the User entity by IDs.
func (*CommentUpdate) AddKudoedUsers ¶
func (cu *CommentUpdate) AddKudoedUsers(u ...*User) *CommentUpdate
AddKudoedUsers adds the "kudoed_users" edges to the User entity.
func (*CommentUpdate) AddParentID ¶
func (cu *CommentUpdate) AddParentID(i int) *CommentUpdate
AddParentID adds i to the "parent_id" field.
func (*CommentUpdate) ClearKudoedUsers ¶
func (cu *CommentUpdate) ClearKudoedUsers() *CommentUpdate
ClearKudoedUsers clears all "kudoed_users" edges to the User entity.
func (*CommentUpdate) ClearModifiedAt ¶
func (cu *CommentUpdate) ClearModifiedAt() *CommentUpdate
ClearModifiedAt clears the value of the "modified_at" field.
func (*CommentUpdate) ClearThreads ¶
func (cu *CommentUpdate) ClearThreads() *CommentUpdate
ClearThreads clears the "threads" edge to the Thread entity.
func (*CommentUpdate) Exec ¶
func (cu *CommentUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CommentUpdate) ExecX ¶
func (cu *CommentUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CommentUpdate) Mutation ¶
func (cu *CommentUpdate) Mutation() *CommentMutation
Mutation returns the CommentMutation object of the builder.
func (*CommentUpdate) RemoveKudoedUserIDs ¶
func (cu *CommentUpdate) RemoveKudoedUserIDs(ids ...uuid.UUID) *CommentUpdate
RemoveKudoedUserIDs removes the "kudoed_users" edge to User entities by IDs.
func (*CommentUpdate) RemoveKudoedUsers ¶
func (cu *CommentUpdate) RemoveKudoedUsers(u ...*User) *CommentUpdate
RemoveKudoedUsers removes "kudoed_users" edges to User entities.
func (*CommentUpdate) Save ¶
func (cu *CommentUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CommentUpdate) SaveX ¶
func (cu *CommentUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CommentUpdate) SetContent ¶
func (cu *CommentUpdate) SetContent(s string) *CommentUpdate
SetContent sets the "content" field.
func (*CommentUpdate) SetModifiedAt ¶
func (cu *CommentUpdate) SetModifiedAt(t time.Time) *CommentUpdate
SetModifiedAt sets the "modified_at" field.
func (*CommentUpdate) SetNillableContent ¶
func (cu *CommentUpdate) SetNillableContent(s *string) *CommentUpdate
SetNillableContent sets the "content" field if the given value is not nil.
func (*CommentUpdate) SetNillableModifiedAt ¶
func (cu *CommentUpdate) SetNillableModifiedAt(t *time.Time) *CommentUpdate
SetNillableModifiedAt sets the "modified_at" field if the given value is not nil.
func (*CommentUpdate) SetNillableParentID ¶
func (cu *CommentUpdate) SetNillableParentID(i *int) *CommentUpdate
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*CommentUpdate) SetParentID ¶
func (cu *CommentUpdate) SetParentID(i int) *CommentUpdate
SetParentID sets the "parent_id" field.
func (*CommentUpdate) SetThreads ¶
func (cu *CommentUpdate) SetThreads(t *Thread) *CommentUpdate
SetThreads sets the "threads" edge to the Thread entity.
func (*CommentUpdate) SetThreadsID ¶
func (cu *CommentUpdate) SetThreadsID(id int) *CommentUpdate
SetThreadsID sets the "threads" edge to the Thread entity by ID.
func (*CommentUpdate) Where ¶
func (cu *CommentUpdate) Where(ps ...predicate.Comment) *CommentUpdate
Where appends a list predicates to the CommentUpdate builder.
type CommentUpdateOne ¶
type CommentUpdateOne struct {
// contains filtered or unexported fields
}
CommentUpdateOne is the builder for updating a single Comment entity.
func (*CommentUpdateOne) AddKudoedUserIDs ¶
func (cuo *CommentUpdateOne) AddKudoedUserIDs(ids ...uuid.UUID) *CommentUpdateOne
AddKudoedUserIDs adds the "kudoed_users" edge to the User entity by IDs.
func (*CommentUpdateOne) AddKudoedUsers ¶
func (cuo *CommentUpdateOne) AddKudoedUsers(u ...*User) *CommentUpdateOne
AddKudoedUsers adds the "kudoed_users" edges to the User entity.
func (*CommentUpdateOne) AddParentID ¶
func (cuo *CommentUpdateOne) AddParentID(i int) *CommentUpdateOne
AddParentID adds i to the "parent_id" field.
func (*CommentUpdateOne) ClearKudoedUsers ¶
func (cuo *CommentUpdateOne) ClearKudoedUsers() *CommentUpdateOne
ClearKudoedUsers clears all "kudoed_users" edges to the User entity.
func (*CommentUpdateOne) ClearModifiedAt ¶
func (cuo *CommentUpdateOne) ClearModifiedAt() *CommentUpdateOne
ClearModifiedAt clears the value of the "modified_at" field.
func (*CommentUpdateOne) ClearThreads ¶
func (cuo *CommentUpdateOne) ClearThreads() *CommentUpdateOne
ClearThreads clears the "threads" edge to the Thread entity.
func (*CommentUpdateOne) Exec ¶
func (cuo *CommentUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CommentUpdateOne) ExecX ¶
func (cuo *CommentUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CommentUpdateOne) Mutation ¶
func (cuo *CommentUpdateOne) Mutation() *CommentMutation
Mutation returns the CommentMutation object of the builder.
func (*CommentUpdateOne) RemoveKudoedUserIDs ¶
func (cuo *CommentUpdateOne) RemoveKudoedUserIDs(ids ...uuid.UUID) *CommentUpdateOne
RemoveKudoedUserIDs removes the "kudoed_users" edge to User entities by IDs.
func (*CommentUpdateOne) RemoveKudoedUsers ¶
func (cuo *CommentUpdateOne) RemoveKudoedUsers(u ...*User) *CommentUpdateOne
RemoveKudoedUsers removes "kudoed_users" edges to User entities.
func (*CommentUpdateOne) Save ¶
func (cuo *CommentUpdateOne) Save(ctx context.Context) (*Comment, error)
Save executes the query and returns the updated Comment entity.
func (*CommentUpdateOne) SaveX ¶
func (cuo *CommentUpdateOne) SaveX(ctx context.Context) *Comment
SaveX is like Save, but panics if an error occurs.
func (*CommentUpdateOne) Select ¶
func (cuo *CommentUpdateOne) Select(field string, fields ...string) *CommentUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CommentUpdateOne) SetContent ¶
func (cuo *CommentUpdateOne) SetContent(s string) *CommentUpdateOne
SetContent sets the "content" field.
func (*CommentUpdateOne) SetModifiedAt ¶
func (cuo *CommentUpdateOne) SetModifiedAt(t time.Time) *CommentUpdateOne
SetModifiedAt sets the "modified_at" field.
func (*CommentUpdateOne) SetNillableContent ¶
func (cuo *CommentUpdateOne) SetNillableContent(s *string) *CommentUpdateOne
SetNillableContent sets the "content" field if the given value is not nil.
func (*CommentUpdateOne) SetNillableModifiedAt ¶
func (cuo *CommentUpdateOne) SetNillableModifiedAt(t *time.Time) *CommentUpdateOne
SetNillableModifiedAt sets the "modified_at" field if the given value is not nil.
func (*CommentUpdateOne) SetNillableParentID ¶
func (cuo *CommentUpdateOne) SetNillableParentID(i *int) *CommentUpdateOne
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*CommentUpdateOne) SetParentID ¶
func (cuo *CommentUpdateOne) SetParentID(i int) *CommentUpdateOne
SetParentID sets the "parent_id" field.
func (*CommentUpdateOne) SetThreads ¶
func (cuo *CommentUpdateOne) SetThreads(t *Thread) *CommentUpdateOne
SetThreads sets the "threads" edge to the Thread entity.
func (*CommentUpdateOne) SetThreadsID ¶
func (cuo *CommentUpdateOne) SetThreadsID(id int) *CommentUpdateOne
SetThreadsID sets the "threads" edge to the Thread entity by ID.
func (*CommentUpdateOne) Where ¶
func (cuo *CommentUpdateOne) Where(ps ...predicate.Comment) *CommentUpdateOne
Where appends a list predicates to the CommentUpdate builder.
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 Moderator ¶
type Moderator struct { // ModeratorID holds the value of the "moderator_id" field. ModeratorID uuid.UUID `json:"moderator_id,omitempty"` // TopicID holds the value of the "topic_id" field. TopicID int `json:"topic_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ModeratorQuery when eager-loading is set. Edges ModeratorEdges `json:"edges"` // contains filtered or unexported fields }
Moderator is the model entity for the Moderator schema.
func (*Moderator) QueryModerator ¶
QueryModerator queries the "moderator" edge of the Moderator entity.
func (*Moderator) QueryTopic ¶
func (m *Moderator) QueryTopic() *TopicQuery
QueryTopic queries the "topic" edge of the Moderator entity.
func (*Moderator) Unwrap ¶
Unwrap unwraps the Moderator 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 (*Moderator) Update ¶
func (m *Moderator) Update() *ModeratorUpdateOne
Update returns a builder for updating this Moderator. Note that you need to call Moderator.Unwrap() before calling this method if this Moderator was returned from a transaction, and the transaction was committed or rolled back.
type ModeratorClient ¶
type ModeratorClient struct {
// contains filtered or unexported fields
}
ModeratorClient is a client for the Moderator schema.
func NewModeratorClient ¶
func NewModeratorClient(c config) *ModeratorClient
NewModeratorClient returns a client for the Moderator from the given config.
func (*ModeratorClient) Create ¶
func (c *ModeratorClient) Create() *ModeratorCreate
Create returns a builder for creating a Moderator entity.
func (*ModeratorClient) CreateBulk ¶
func (c *ModeratorClient) CreateBulk(builders ...*ModeratorCreate) *ModeratorCreateBulk
CreateBulk returns a builder for creating a bulk of Moderator entities.
func (*ModeratorClient) Delete ¶
func (c *ModeratorClient) Delete() *ModeratorDelete
Delete returns a delete builder for Moderator.
func (*ModeratorClient) Hooks ¶
func (c *ModeratorClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ModeratorClient) Intercept ¶
func (c *ModeratorClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `moderator.Intercept(f(g(h())))`.
func (*ModeratorClient) Interceptors ¶
func (c *ModeratorClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ModeratorClient) MapCreateBulk ¶
func (c *ModeratorClient) MapCreateBulk(slice any, setFunc func(*ModeratorCreate, int)) *ModeratorCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*ModeratorClient) Query ¶
func (c *ModeratorClient) Query() *ModeratorQuery
Query returns a query builder for Moderator.
func (*ModeratorClient) QueryModerator ¶
func (c *ModeratorClient) QueryModerator(m *Moderator) *UserQuery
QueryModerator queries the moderator edge of a Moderator.
func (*ModeratorClient) QueryTopic ¶
func (c *ModeratorClient) QueryTopic(m *Moderator) *TopicQuery
QueryTopic queries the topic edge of a Moderator.
func (*ModeratorClient) Update ¶
func (c *ModeratorClient) Update() *ModeratorUpdate
Update returns an update builder for Moderator.
func (*ModeratorClient) UpdateOne ¶
func (c *ModeratorClient) UpdateOne(m *Moderator) *ModeratorUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ModeratorClient) Use ¶
func (c *ModeratorClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `moderator.Hooks(f(g(h())))`.
type ModeratorCreate ¶
type ModeratorCreate struct {
// contains filtered or unexported fields
}
ModeratorCreate is the builder for creating a Moderator entity.
func (*ModeratorCreate) Exec ¶
func (mc *ModeratorCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ModeratorCreate) ExecX ¶
func (mc *ModeratorCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ModeratorCreate) Mutation ¶
func (mc *ModeratorCreate) Mutation() *ModeratorMutation
Mutation returns the ModeratorMutation object of the builder.
func (*ModeratorCreate) Save ¶
func (mc *ModeratorCreate) Save(ctx context.Context) (*Moderator, error)
Save creates the Moderator in the database.
func (*ModeratorCreate) SaveX ¶
func (mc *ModeratorCreate) SaveX(ctx context.Context) *Moderator
SaveX calls Save and panics if Save returns an error.
func (*ModeratorCreate) SetModerator ¶
func (mc *ModeratorCreate) SetModerator(u *User) *ModeratorCreate
SetModerator sets the "moderator" edge to the User entity.
func (*ModeratorCreate) SetModeratorID ¶
func (mc *ModeratorCreate) SetModeratorID(u uuid.UUID) *ModeratorCreate
SetModeratorID sets the "moderator_id" field.
func (*ModeratorCreate) SetTopic ¶
func (mc *ModeratorCreate) SetTopic(t *Topic) *ModeratorCreate
SetTopic sets the "topic" edge to the Topic entity.
func (*ModeratorCreate) SetTopicID ¶
func (mc *ModeratorCreate) SetTopicID(i int) *ModeratorCreate
SetTopicID sets the "topic_id" field.
type ModeratorCreateBulk ¶
type ModeratorCreateBulk struct {
// contains filtered or unexported fields
}
ModeratorCreateBulk is the builder for creating many Moderator entities in bulk.
func (*ModeratorCreateBulk) Exec ¶
func (mcb *ModeratorCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ModeratorCreateBulk) ExecX ¶
func (mcb *ModeratorCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ModeratorDelete ¶
type ModeratorDelete struct {
// contains filtered or unexported fields
}
ModeratorDelete is the builder for deleting a Moderator entity.
func (*ModeratorDelete) Exec ¶
func (md *ModeratorDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ModeratorDelete) ExecX ¶
func (md *ModeratorDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ModeratorDelete) Where ¶
func (md *ModeratorDelete) Where(ps ...predicate.Moderator) *ModeratorDelete
Where appends a list predicates to the ModeratorDelete builder.
type ModeratorDeleteOne ¶
type ModeratorDeleteOne struct {
// contains filtered or unexported fields
}
ModeratorDeleteOne is the builder for deleting a single Moderator entity.
func (*ModeratorDeleteOne) Exec ¶
func (mdo *ModeratorDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ModeratorDeleteOne) ExecX ¶
func (mdo *ModeratorDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ModeratorDeleteOne) Where ¶
func (mdo *ModeratorDeleteOne) Where(ps ...predicate.Moderator) *ModeratorDeleteOne
Where appends a list predicates to the ModeratorDelete builder.
type ModeratorEdges ¶
type ModeratorEdges struct { // Moderator holds the value of the moderator edge. Moderator *User `json:"moderator,omitempty"` // Topic holds the value of the topic edge. Topic *Topic `json:"topic,omitempty"` // contains filtered or unexported fields }
ModeratorEdges holds the relations/edges for other nodes in the graph.
func (ModeratorEdges) ModeratorOrErr ¶
func (e ModeratorEdges) ModeratorOrErr() (*User, error)
ModeratorOrErr returns the Moderator value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ModeratorEdges) TopicOrErr ¶
func (e ModeratorEdges) TopicOrErr() (*Topic, error)
TopicOrErr returns the Topic value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ModeratorGroupBy ¶
type ModeratorGroupBy struct {
// contains filtered or unexported fields
}
ModeratorGroupBy is the group-by builder for Moderator entities.
func (*ModeratorGroupBy) Aggregate ¶
func (mgb *ModeratorGroupBy) Aggregate(fns ...AggregateFunc) *ModeratorGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ModeratorGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ModeratorGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ModeratorGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ModeratorGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ModeratorGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ModeratorGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ModeratorGroupBy) Scan ¶
func (mgb *ModeratorGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ModeratorGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ModeratorMutation ¶
type ModeratorMutation struct {
// contains filtered or unexported fields
}
ModeratorMutation represents an operation that mutates the Moderator nodes in the graph.
func (*ModeratorMutation) AddField ¶
func (m *ModeratorMutation) 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 (*ModeratorMutation) AddedEdges ¶
func (m *ModeratorMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ModeratorMutation) AddedField ¶
func (m *ModeratorMutation) 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 (*ModeratorMutation) AddedFields ¶
func (m *ModeratorMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ModeratorMutation) AddedIDs ¶
func (m *ModeratorMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ModeratorMutation) ClearEdge ¶
func (m *ModeratorMutation) 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 (*ModeratorMutation) ClearField ¶
func (m *ModeratorMutation) 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 (*ModeratorMutation) ClearModerator ¶
func (m *ModeratorMutation) ClearModerator()
ClearModerator clears the "moderator" edge to the User entity.
func (*ModeratorMutation) ClearTopic ¶
func (m *ModeratorMutation) ClearTopic()
ClearTopic clears the "topic" edge to the Topic entity.
func (*ModeratorMutation) ClearedEdges ¶
func (m *ModeratorMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ModeratorMutation) ClearedFields ¶
func (m *ModeratorMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ModeratorMutation) Client ¶
func (m ModeratorMutation) 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 (*ModeratorMutation) EdgeCleared ¶
func (m *ModeratorMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ModeratorMutation) Field ¶
func (m *ModeratorMutation) 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 (*ModeratorMutation) FieldCleared ¶
func (m *ModeratorMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ModeratorMutation) Fields ¶
func (m *ModeratorMutation) 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 (*ModeratorMutation) ModeratorCleared ¶
func (m *ModeratorMutation) ModeratorCleared() bool
ModeratorCleared reports if the "moderator" edge to the User entity was cleared.
func (*ModeratorMutation) ModeratorID ¶
func (m *ModeratorMutation) ModeratorID() (r uuid.UUID, exists bool)
ModeratorID returns the value of the "moderator_id" field in the mutation.
func (*ModeratorMutation) ModeratorIDs ¶
func (m *ModeratorMutation) ModeratorIDs() (ids []uuid.UUID)
ModeratorIDs returns the "moderator" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ModeratorID instead. It exists only for internal usage by the builders.
func (*ModeratorMutation) 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 (*ModeratorMutation) RemovedEdges ¶
func (m *ModeratorMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ModeratorMutation) RemovedIDs ¶
func (m *ModeratorMutation) 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 (*ModeratorMutation) ResetEdge ¶
func (m *ModeratorMutation) 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 (*ModeratorMutation) ResetField ¶
func (m *ModeratorMutation) 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 (*ModeratorMutation) ResetModerator ¶
func (m *ModeratorMutation) ResetModerator()
ResetModerator resets all changes to the "moderator" edge.
func (*ModeratorMutation) ResetModeratorID ¶
func (m *ModeratorMutation) ResetModeratorID()
ResetModeratorID resets all changes to the "moderator_id" field.
func (*ModeratorMutation) ResetTopic ¶
func (m *ModeratorMutation) ResetTopic()
ResetTopic resets all changes to the "topic" edge.
func (*ModeratorMutation) ResetTopicID ¶
func (m *ModeratorMutation) ResetTopicID()
ResetTopicID resets all changes to the "topic_id" field.
func (*ModeratorMutation) SetField ¶
func (m *ModeratorMutation) 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 (*ModeratorMutation) SetModeratorID ¶
func (m *ModeratorMutation) SetModeratorID(u uuid.UUID)
SetModeratorID sets the "moderator_id" field.
func (*ModeratorMutation) SetOp ¶
func (m *ModeratorMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ModeratorMutation) SetTopicID ¶
func (m *ModeratorMutation) SetTopicID(i int)
SetTopicID sets the "topic_id" field.
func (*ModeratorMutation) TopicCleared ¶
func (m *ModeratorMutation) TopicCleared() bool
TopicCleared reports if the "topic" edge to the Topic entity was cleared.
func (*ModeratorMutation) TopicID ¶
func (m *ModeratorMutation) TopicID() (r int, exists bool)
TopicID returns the value of the "topic_id" field in the mutation.
func (*ModeratorMutation) TopicIDs ¶
func (m *ModeratorMutation) TopicIDs() (ids []int)
TopicIDs returns the "topic" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TopicID instead. It exists only for internal usage by the builders.
func (ModeratorMutation) Tx ¶
func (m ModeratorMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ModeratorMutation) Type ¶
func (m *ModeratorMutation) Type() string
Type returns the node type of this mutation (Moderator).
func (*ModeratorMutation) Where ¶
func (m *ModeratorMutation) Where(ps ...predicate.Moderator)
Where appends a list predicates to the ModeratorMutation builder.
func (*ModeratorMutation) WhereP ¶
func (m *ModeratorMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ModeratorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ModeratorQuery ¶
type ModeratorQuery struct {
// contains filtered or unexported fields
}
ModeratorQuery is the builder for querying Moderator entities.
func (*ModeratorQuery) Aggregate ¶
func (mq *ModeratorQuery) Aggregate(fns ...AggregateFunc) *ModeratorSelect
Aggregate returns a ModeratorSelect configured with the given aggregations.
func (*ModeratorQuery) All ¶
func (mq *ModeratorQuery) All(ctx context.Context) ([]*Moderator, error)
All executes the query and returns a list of Moderators.
func (*ModeratorQuery) AllX ¶
func (mq *ModeratorQuery) AllX(ctx context.Context) []*Moderator
AllX is like All, but panics if an error occurs.
func (*ModeratorQuery) Clone ¶
func (mq *ModeratorQuery) Clone() *ModeratorQuery
Clone returns a duplicate of the ModeratorQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ModeratorQuery) Count ¶
func (mq *ModeratorQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ModeratorQuery) CountX ¶
func (mq *ModeratorQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ModeratorQuery) Exist ¶
func (mq *ModeratorQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ModeratorQuery) ExistX ¶
func (mq *ModeratorQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ModeratorQuery) First ¶
func (mq *ModeratorQuery) First(ctx context.Context) (*Moderator, error)
First returns the first Moderator entity from the query. Returns a *NotFoundError when no Moderator was found.
func (*ModeratorQuery) FirstX ¶
func (mq *ModeratorQuery) FirstX(ctx context.Context) *Moderator
FirstX is like First, but panics if an error occurs.
func (*ModeratorQuery) GroupBy ¶
func (mq *ModeratorQuery) GroupBy(field string, fields ...string) *ModeratorGroupBy
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 { ModeratorID uuid.UUID `json:"moderator_id,omitempty"` Count int `json:"count,omitempty"` } client.Moderator.Query(). GroupBy(moderator.FieldModeratorID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ModeratorQuery) Limit ¶
func (mq *ModeratorQuery) Limit(limit int) *ModeratorQuery
Limit the number of records to be returned by this query.
func (*ModeratorQuery) Offset ¶
func (mq *ModeratorQuery) Offset(offset int) *ModeratorQuery
Offset to start from.
func (*ModeratorQuery) Only ¶
func (mq *ModeratorQuery) Only(ctx context.Context) (*Moderator, error)
Only returns a single Moderator entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Moderator entity is found. Returns a *NotFoundError when no Moderator entities are found.
func (*ModeratorQuery) OnlyX ¶
func (mq *ModeratorQuery) OnlyX(ctx context.Context) *Moderator
OnlyX is like Only, but panics if an error occurs.
func (*ModeratorQuery) Order ¶
func (mq *ModeratorQuery) Order(o ...moderator.OrderOption) *ModeratorQuery
Order specifies how the records should be ordered.
func (*ModeratorQuery) QueryModerator ¶
func (mq *ModeratorQuery) QueryModerator() *UserQuery
QueryModerator chains the current query on the "moderator" edge.
func (*ModeratorQuery) QueryTopic ¶
func (mq *ModeratorQuery) QueryTopic() *TopicQuery
QueryTopic chains the current query on the "topic" edge.
func (*ModeratorQuery) Select ¶
func (mq *ModeratorQuery) Select(fields ...string) *ModeratorSelect
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 { ModeratorID uuid.UUID `json:"moderator_id,omitempty"` } client.Moderator.Query(). Select(moderator.FieldModeratorID). Scan(ctx, &v)
func (*ModeratorQuery) Unique ¶
func (mq *ModeratorQuery) Unique(unique bool) *ModeratorQuery
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 (*ModeratorQuery) Where ¶
func (mq *ModeratorQuery) Where(ps ...predicate.Moderator) *ModeratorQuery
Where adds a new predicate for the ModeratorQuery builder.
func (*ModeratorQuery) WithModerator ¶
func (mq *ModeratorQuery) WithModerator(opts ...func(*UserQuery)) *ModeratorQuery
WithModerator tells the query-builder to eager-load the nodes that are connected to the "moderator" edge. The optional arguments are used to configure the query builder of the edge.
func (*ModeratorQuery) WithTopic ¶
func (mq *ModeratorQuery) WithTopic(opts ...func(*TopicQuery)) *ModeratorQuery
WithTopic tells the query-builder to eager-load the nodes that are connected to the "topic" edge. The optional arguments are used to configure the query builder of the edge.
type ModeratorSelect ¶
type ModeratorSelect struct { *ModeratorQuery // contains filtered or unexported fields }
ModeratorSelect is the builder for selecting fields of Moderator entities.
func (*ModeratorSelect) Aggregate ¶
func (ms *ModeratorSelect) Aggregate(fns ...AggregateFunc) *ModeratorSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ModeratorSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ModeratorSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ModeratorSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ModeratorSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ModeratorSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ModeratorSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ModeratorSelect) Scan ¶
func (ms *ModeratorSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ModeratorSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ModeratorUpdate ¶
type ModeratorUpdate struct {
// contains filtered or unexported fields
}
ModeratorUpdate is the builder for updating Moderator entities.
func (*ModeratorUpdate) Exec ¶
func (mu *ModeratorUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ModeratorUpdate) ExecX ¶
func (mu *ModeratorUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ModeratorUpdate) Mutation ¶
func (mu *ModeratorUpdate) Mutation() *ModeratorMutation
Mutation returns the ModeratorMutation object of the builder.
func (*ModeratorUpdate) Save ¶
func (mu *ModeratorUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ModeratorUpdate) SaveX ¶
func (mu *ModeratorUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ModeratorUpdate) Where ¶
func (mu *ModeratorUpdate) Where(ps ...predicate.Moderator) *ModeratorUpdate
Where appends a list predicates to the ModeratorUpdate builder.
type ModeratorUpdateOne ¶
type ModeratorUpdateOne struct {
// contains filtered or unexported fields
}
ModeratorUpdateOne is the builder for updating a single Moderator entity.
func (*ModeratorUpdateOne) Exec ¶
func (muo *ModeratorUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ModeratorUpdateOne) ExecX ¶
func (muo *ModeratorUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ModeratorUpdateOne) Mutation ¶
func (muo *ModeratorUpdateOne) Mutation() *ModeratorMutation
Mutation returns the ModeratorMutation object of the builder.
func (*ModeratorUpdateOne) Save ¶
func (muo *ModeratorUpdateOne) Save(ctx context.Context) (*Moderator, error)
Save executes the query and returns the updated Moderator entity.
func (*ModeratorUpdateOne) SaveX ¶
func (muo *ModeratorUpdateOne) SaveX(ctx context.Context) *Moderator
SaveX is like Save, but panics if an error occurs.
func (*ModeratorUpdateOne) Select ¶
func (muo *ModeratorUpdateOne) Select(field string, fields ...string) *ModeratorUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ModeratorUpdateOne) Where ¶
func (muo *ModeratorUpdateOne) Where(ps ...predicate.Moderator) *ModeratorUpdateOne
Where appends a list predicates to the ModeratorUpdate builder.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type Tag ¶
type Tag struct { // ID of the ent. ID int `json:"id,omitempty"` // TagName holds the value of the "tag_name" field. TagName string `json:"tag_name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TagQuery when eager-loading is set. Edges TagEdges `json:"edges"` // contains filtered or unexported fields }
Tag is the model entity for the Tag schema.
func (*Tag) QueryTaggedThreads ¶
func (t *Tag) QueryTaggedThreads() *ThreadQuery
QueryTaggedThreads queries the "tagged_threads" edge of the Tag entity.
func (*Tag) Unwrap ¶
Unwrap unwraps the Tag entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Tag) Update ¶
func (t *Tag) Update() *TagUpdateOne
Update returns a builder for updating this Tag. Note that you need to call Tag.Unwrap() before calling this method if this Tag was returned from a transaction, and the transaction was committed or rolled back.
type TagClient ¶
type TagClient struct {
// contains filtered or unexported fields
}
TagClient is a client for the Tag schema.
func NewTagClient ¶
func NewTagClient(c config) *TagClient
NewTagClient returns a client for the Tag from the given config.
func (*TagClient) CreateBulk ¶
func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk
CreateBulk returns a builder for creating a bulk of Tag entities.
func (*TagClient) DeleteOne ¶
func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TagClient) DeleteOneID ¶
func (c *TagClient) DeleteOneID(id int) *TagDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TagClient) Intercept ¶
func (c *TagClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tag.Intercept(f(g(h())))`.
func (*TagClient) Interceptors ¶
func (c *TagClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TagClient) MapCreateBulk ¶
func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*TagClient) QueryTaggedThreads ¶
func (c *TagClient) QueryTaggedThreads(t *Tag) *ThreadQuery
QueryTaggedThreads queries the tagged_threads edge of a Tag.
func (*TagClient) UpdateOne ¶
func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TagClient) UpdateOneID ¶
func (c *TagClient) UpdateOneID(id int) *TagUpdateOne
UpdateOneID returns an update builder for the given id.
type TagCreate ¶
type TagCreate struct {
// contains filtered or unexported fields
}
TagCreate is the builder for creating a Tag entity.
func (*TagCreate) AddTaggedThreadIDs ¶
AddTaggedThreadIDs adds the "tagged_threads" edge to the Thread entity by IDs.
func (*TagCreate) AddTaggedThreads ¶
AddTaggedThreads adds the "tagged_threads" edges to the Thread entity.
func (*TagCreate) Mutation ¶
func (tc *TagCreate) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagCreate) SetTagName ¶
SetTagName sets the "tag_name" field.
type TagCreateBulk ¶
type TagCreateBulk struct {
// contains filtered or unexported fields
}
TagCreateBulk is the builder for creating many Tag entities in bulk.
func (*TagCreateBulk) Exec ¶
func (tcb *TagCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TagCreateBulk) ExecX ¶
func (tcb *TagCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TagDelete ¶
type TagDelete struct {
// contains filtered or unexported fields
}
TagDelete is the builder for deleting a Tag entity.
func (*TagDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type TagDeleteOne ¶
type TagDeleteOne struct {
// contains filtered or unexported fields
}
TagDeleteOne is the builder for deleting a single Tag entity.
func (*TagDeleteOne) Exec ¶
func (tdo *TagDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TagDeleteOne) ExecX ¶
func (tdo *TagDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagDeleteOne) Where ¶
func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne
Where appends a list predicates to the TagDelete builder.
type TagEdges ¶
type TagEdges struct { // TaggedThreads holds the value of the tagged_threads edge. TaggedThreads []*Thread `json:"tagged_threads,omitempty"` // contains filtered or unexported fields }
TagEdges holds the relations/edges for other nodes in the graph.
func (TagEdges) TaggedThreadsOrErr ¶
TaggedThreadsOrErr returns the TaggedThreads value or an error if the edge was not loaded in eager-loading.
type TagGroupBy ¶
type TagGroupBy struct {
// contains filtered or unexported fields
}
TagGroupBy is the group-by builder for Tag entities.
func (*TagGroupBy) Aggregate ¶
func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TagGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TagGroupBy) Scan ¶
func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TagGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TagMutation ¶
type TagMutation struct {
// contains filtered or unexported fields
}
TagMutation represents an operation that mutates the Tag nodes in the graph.
func (*TagMutation) AddField ¶
func (m *TagMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*TagMutation) AddTaggedThreadIDs ¶
func (m *TagMutation) AddTaggedThreadIDs(ids ...int)
AddTaggedThreadIDs adds the "tagged_threads" edge to the Thread entity by ids.
func (*TagMutation) AddedEdges ¶
func (m *TagMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TagMutation) AddedField ¶
func (m *TagMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*TagMutation) AddedFields ¶
func (m *TagMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TagMutation) AddedIDs ¶
func (m *TagMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TagMutation) ClearEdge ¶
func (m *TagMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*TagMutation) ClearField ¶
func (m *TagMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*TagMutation) ClearTaggedThreads ¶
func (m *TagMutation) ClearTaggedThreads()
ClearTaggedThreads clears the "tagged_threads" edge to the Thread entity.
func (*TagMutation) ClearedEdges ¶
func (m *TagMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TagMutation) ClearedFields ¶
func (m *TagMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TagMutation) Client ¶
func (m TagMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*TagMutation) EdgeCleared ¶
func (m *TagMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TagMutation) Field ¶
func (m *TagMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*TagMutation) FieldCleared ¶
func (m *TagMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TagMutation) Fields ¶
func (m *TagMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*TagMutation) ID ¶
func (m *TagMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*TagMutation) IDs ¶
func (m *TagMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*TagMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*TagMutation) OldTagName ¶
func (m *TagMutation) OldTagName(ctx context.Context) (v string, err error)
OldTagName returns the old "tag_name" field's value of the Tag entity. If the Tag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*TagMutation) RemoveTaggedThreadIDs ¶
func (m *TagMutation) RemoveTaggedThreadIDs(ids ...int)
RemoveTaggedThreadIDs removes the "tagged_threads" edge to the Thread entity by IDs.
func (*TagMutation) RemovedEdges ¶
func (m *TagMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TagMutation) RemovedIDs ¶
func (m *TagMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*TagMutation) RemovedTaggedThreadsIDs ¶
func (m *TagMutation) RemovedTaggedThreadsIDs() (ids []int)
RemovedTaggedThreads returns the removed IDs of the "tagged_threads" edge to the Thread entity.
func (*TagMutation) ResetEdge ¶
func (m *TagMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*TagMutation) ResetField ¶
func (m *TagMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*TagMutation) ResetTagName ¶
func (m *TagMutation) ResetTagName()
ResetTagName resets all changes to the "tag_name" field.
func (*TagMutation) ResetTaggedThreads ¶
func (m *TagMutation) ResetTaggedThreads()
ResetTaggedThreads resets all changes to the "tagged_threads" edge.
func (*TagMutation) SetField ¶
func (m *TagMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*TagMutation) SetOp ¶
func (m *TagMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TagMutation) SetTagName ¶
func (m *TagMutation) SetTagName(s string)
SetTagName sets the "tag_name" field.
func (*TagMutation) TagName ¶
func (m *TagMutation) TagName() (r string, exists bool)
TagName returns the value of the "tag_name" field in the mutation.
func (*TagMutation) TaggedThreadsCleared ¶
func (m *TagMutation) TaggedThreadsCleared() bool
TaggedThreadsCleared reports if the "tagged_threads" edge to the Thread entity was cleared.
func (*TagMutation) TaggedThreadsIDs ¶
func (m *TagMutation) TaggedThreadsIDs() (ids []int)
TaggedThreadsIDs returns the "tagged_threads" edge IDs in the mutation.
func (TagMutation) Tx ¶
func (m TagMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TagMutation) Type ¶
func (m *TagMutation) Type() string
Type returns the node type of this mutation (Tag).
func (*TagMutation) Where ¶
func (m *TagMutation) Where(ps ...predicate.Tag)
Where appends a list predicates to the TagMutation builder.
func (*TagMutation) WhereP ¶
func (m *TagMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TagQuery ¶
type TagQuery struct {
// contains filtered or unexported fields
}
TagQuery is the builder for querying Tag entities.
func (*TagQuery) Aggregate ¶
func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect
Aggregate returns a TagSelect configured with the given aggregations.
func (*TagQuery) Clone ¶
Clone returns a duplicate of the TagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TagQuery) First ¶
First returns the first Tag entity from the query. Returns a *NotFoundError when no Tag was found.
func (*TagQuery) FirstID ¶
FirstID returns the first Tag ID from the query. Returns a *NotFoundError when no Tag ID was found.
func (*TagQuery) GroupBy ¶
func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { TagName string `json:"tag_name,omitempty"` Count int `json:"count,omitempty"` } client.Tag.Query(). GroupBy(tag.FieldTagName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TagQuery) Only ¶
Only returns a single Tag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tag entity is found. Returns a *NotFoundError when no Tag entities are found.
func (*TagQuery) OnlyID ¶
OnlyID is like Only, but returns the only Tag ID in the query. Returns a *NotSingularError when more than one Tag ID is found. Returns a *NotFoundError when no entities are found.
func (*TagQuery) Order ¶
func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery
Order specifies how the records should be ordered.
func (*TagQuery) QueryTaggedThreads ¶
func (tq *TagQuery) QueryTaggedThreads() *ThreadQuery
QueryTaggedThreads chains the current query on the "tagged_threads" edge.
func (*TagQuery) Select ¶
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { TagName string `json:"tag_name,omitempty"` } client.Tag.Query(). Select(tag.FieldTagName). Scan(ctx, &v)
func (*TagQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*TagQuery) WithTaggedThreads ¶
func (tq *TagQuery) WithTaggedThreads(opts ...func(*ThreadQuery)) *TagQuery
WithTaggedThreads tells the query-builder to eager-load the nodes that are connected to the "tagged_threads" edge. The optional arguments are used to configure the query builder of the edge.
type TagSelect ¶
type TagSelect struct { *TagQuery // contains filtered or unexported fields }
TagSelect is the builder for selecting fields of Tag entities.
func (*TagSelect) Aggregate ¶
func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TagSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TagSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TagSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TagSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TagSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TagSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TagSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TagUpdate ¶
type TagUpdate struct {
// contains filtered or unexported fields
}
TagUpdate is the builder for updating Tag entities.
func (*TagUpdate) AddTaggedThreadIDs ¶
AddTaggedThreadIDs adds the "tagged_threads" edge to the Thread entity by IDs.
func (*TagUpdate) AddTaggedThreads ¶
AddTaggedThreads adds the "tagged_threads" edges to the Thread entity.
func (*TagUpdate) ClearTaggedThreads ¶
ClearTaggedThreads clears all "tagged_threads" edges to the Thread entity.
func (*TagUpdate) Mutation ¶
func (tu *TagUpdate) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagUpdate) RemoveTaggedThreadIDs ¶
RemoveTaggedThreadIDs removes the "tagged_threads" edge to Thread entities by IDs.
func (*TagUpdate) RemoveTaggedThreads ¶
RemoveTaggedThreads removes "tagged_threads" edges to Thread entities.
func (*TagUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*TagUpdate) SetNillableTagName ¶
SetNillableTagName sets the "tag_name" field if the given value is not nil.
func (*TagUpdate) SetTagName ¶
SetTagName sets the "tag_name" field.
type TagUpdateOne ¶
type TagUpdateOne struct {
// contains filtered or unexported fields
}
TagUpdateOne is the builder for updating a single Tag entity.
func (*TagUpdateOne) AddTaggedThreadIDs ¶
func (tuo *TagUpdateOne) AddTaggedThreadIDs(ids ...int) *TagUpdateOne
AddTaggedThreadIDs adds the "tagged_threads" edge to the Thread entity by IDs.
func (*TagUpdateOne) AddTaggedThreads ¶
func (tuo *TagUpdateOne) AddTaggedThreads(t ...*Thread) *TagUpdateOne
AddTaggedThreads adds the "tagged_threads" edges to the Thread entity.
func (*TagUpdateOne) ClearTaggedThreads ¶
func (tuo *TagUpdateOne) ClearTaggedThreads() *TagUpdateOne
ClearTaggedThreads clears all "tagged_threads" edges to the Thread entity.
func (*TagUpdateOne) Exec ¶
func (tuo *TagUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TagUpdateOne) ExecX ¶
func (tuo *TagUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TagUpdateOne) Mutation ¶
func (tuo *TagUpdateOne) Mutation() *TagMutation
Mutation returns the TagMutation object of the builder.
func (*TagUpdateOne) RemoveTaggedThreadIDs ¶
func (tuo *TagUpdateOne) RemoveTaggedThreadIDs(ids ...int) *TagUpdateOne
RemoveTaggedThreadIDs removes the "tagged_threads" edge to Thread entities by IDs.
func (*TagUpdateOne) RemoveTaggedThreads ¶
func (tuo *TagUpdateOne) RemoveTaggedThreads(t ...*Thread) *TagUpdateOne
RemoveTaggedThreads removes "tagged_threads" edges to Thread entities.
func (*TagUpdateOne) Save ¶
func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)
Save executes the query and returns the updated Tag entity.
func (*TagUpdateOne) SaveX ¶
func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag
SaveX is like Save, but panics if an error occurs.
func (*TagUpdateOne) Select ¶
func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TagUpdateOne) SetNillableTagName ¶
func (tuo *TagUpdateOne) SetNillableTagName(s *string) *TagUpdateOne
SetNillableTagName sets the "tag_name" field if the given value is not nil.
func (*TagUpdateOne) SetTagName ¶
func (tuo *TagUpdateOne) SetTagName(s string) *TagUpdateOne
SetTagName sets the "tag_name" field.
func (*TagUpdateOne) Where ¶
func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne
Where appends a list predicates to the TagUpdate builder.
type Thread ¶
type Thread struct { // ID of the ent. ID int `json:"id,omitempty"` // Title holds the value of the "title" field. Title string `json:"title,omitempty"` // Slug holds the value of the "slug" field. Slug string `json:"slug,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // ModifiedAt holds the value of the "modified_at" field. ModifiedAt time.Time `json:"modified_at,omitempty"` // CreatedBy holds the value of the "created_by" field. CreatedBy uuid.UUID `json:"created_by,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ThreadQuery when eager-loading is set. Edges ThreadEdges `json:"edges"` // contains filtered or unexported fields }
Thread is the model entity for the Thread schema.
func (*Thread) QueryKudoedUsers ¶
QueryKudoedUsers queries the "kudoed_users" edge of the Thread entity.
func (*Thread) QueryThreadComments ¶
func (t *Thread) QueryThreadComments() *CommentQuery
QueryThreadComments queries the "thread_comments" edge of the Thread entity.
func (*Thread) QueryThreadKudoes ¶
func (t *Thread) QueryThreadKudoes() *ThreadKudoQuery
QueryThreadKudoes queries the "thread_kudoes" edge of the Thread entity.
func (*Thread) QueryTopics ¶
func (t *Thread) QueryTopics() *TopicQuery
QueryTopics queries the "topics" edge of the Thread entity.
func (*Thread) QueryUsers ¶
QueryUsers queries the "users" edge of the Thread entity.
func (*Thread) Unwrap ¶
Unwrap unwraps the Thread 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 (*Thread) Update ¶
func (t *Thread) Update() *ThreadUpdateOne
Update returns a builder for updating this Thread. Note that you need to call Thread.Unwrap() before calling this method if this Thread was returned from a transaction, and the transaction was committed or rolled back.
type ThreadClient ¶
type ThreadClient struct {
// contains filtered or unexported fields
}
ThreadClient is a client for the Thread schema.
func NewThreadClient ¶
func NewThreadClient(c config) *ThreadClient
NewThreadClient returns a client for the Thread from the given config.
func (*ThreadClient) Create ¶
func (c *ThreadClient) Create() *ThreadCreate
Create returns a builder for creating a Thread entity.
func (*ThreadClient) CreateBulk ¶
func (c *ThreadClient) CreateBulk(builders ...*ThreadCreate) *ThreadCreateBulk
CreateBulk returns a builder for creating a bulk of Thread entities.
func (*ThreadClient) Delete ¶
func (c *ThreadClient) Delete() *ThreadDelete
Delete returns a delete builder for Thread.
func (*ThreadClient) DeleteOne ¶
func (c *ThreadClient) DeleteOne(t *Thread) *ThreadDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ThreadClient) DeleteOneID ¶
func (c *ThreadClient) DeleteOneID(id int) *ThreadDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ThreadClient) GetX ¶
func (c *ThreadClient) GetX(ctx context.Context, id int) *Thread
GetX is like Get, but panics if an error occurs.
func (*ThreadClient) Intercept ¶
func (c *ThreadClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `thread.Intercept(f(g(h())))`.
func (*ThreadClient) Interceptors ¶
func (c *ThreadClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ThreadClient) MapCreateBulk ¶
func (c *ThreadClient) MapCreateBulk(slice any, setFunc func(*ThreadCreate, int)) *ThreadCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*ThreadClient) Query ¶
func (c *ThreadClient) Query() *ThreadQuery
Query returns a query builder for Thread.
func (*ThreadClient) QueryKudoedUsers ¶
func (c *ThreadClient) QueryKudoedUsers(t *Thread) *UserQuery
QueryKudoedUsers queries the kudoed_users edge of a Thread.
func (*ThreadClient) QueryTags ¶
func (c *ThreadClient) QueryTags(t *Thread) *TagQuery
QueryTags queries the tags edge of a Thread.
func (*ThreadClient) QueryThreadComments ¶
func (c *ThreadClient) QueryThreadComments(t *Thread) *CommentQuery
QueryThreadComments queries the thread_comments edge of a Thread.
func (*ThreadClient) QueryThreadKudoes ¶
func (c *ThreadClient) QueryThreadKudoes(t *Thread) *ThreadKudoQuery
QueryThreadKudoes queries the thread_kudoes edge of a Thread.
func (*ThreadClient) QueryTopics ¶
func (c *ThreadClient) QueryTopics(t *Thread) *TopicQuery
QueryTopics queries the topics edge of a Thread.
func (*ThreadClient) QueryUsers ¶
func (c *ThreadClient) QueryUsers(t *Thread) *UserQuery
QueryUsers queries the users edge of a Thread.
func (*ThreadClient) Update ¶
func (c *ThreadClient) Update() *ThreadUpdate
Update returns an update builder for Thread.
func (*ThreadClient) UpdateOne ¶
func (c *ThreadClient) UpdateOne(t *Thread) *ThreadUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ThreadClient) UpdateOneID ¶
func (c *ThreadClient) UpdateOneID(id int) *ThreadUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ThreadClient) Use ¶
func (c *ThreadClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `thread.Hooks(f(g(h())))`.
type ThreadCreate ¶
type ThreadCreate struct {
// contains filtered or unexported fields
}
ThreadCreate is the builder for creating a Thread entity.
func (*ThreadCreate) AddKudoedUserIDs ¶
func (tc *ThreadCreate) AddKudoedUserIDs(ids ...uuid.UUID) *ThreadCreate
AddKudoedUserIDs adds the "kudoed_users" edge to the User entity by IDs.
func (*ThreadCreate) AddKudoedUsers ¶
func (tc *ThreadCreate) AddKudoedUsers(u ...*User) *ThreadCreate
AddKudoedUsers adds the "kudoed_users" edges to the User entity.
func (*ThreadCreate) AddTagIDs ¶
func (tc *ThreadCreate) AddTagIDs(ids ...int) *ThreadCreate
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*ThreadCreate) AddTags ¶
func (tc *ThreadCreate) AddTags(t ...*Tag) *ThreadCreate
AddTags adds the "tags" edges to the Tag entity.
func (*ThreadCreate) AddThreadCommentIDs ¶
func (tc *ThreadCreate) AddThreadCommentIDs(ids ...int) *ThreadCreate
AddThreadCommentIDs adds the "thread_comments" edge to the Comment entity by IDs.
func (*ThreadCreate) AddThreadComments ¶
func (tc *ThreadCreate) AddThreadComments(c ...*Comment) *ThreadCreate
AddThreadComments adds the "thread_comments" edges to the Comment entity.
func (*ThreadCreate) Exec ¶
func (tc *ThreadCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ThreadCreate) ExecX ¶
func (tc *ThreadCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ThreadCreate) Mutation ¶
func (tc *ThreadCreate) Mutation() *ThreadMutation
Mutation returns the ThreadMutation object of the builder.
func (*ThreadCreate) Save ¶
func (tc *ThreadCreate) Save(ctx context.Context) (*Thread, error)
Save creates the Thread in the database.
func (*ThreadCreate) SaveX ¶
func (tc *ThreadCreate) SaveX(ctx context.Context) *Thread
SaveX calls Save and panics if Save returns an error.
func (*ThreadCreate) SetCreatedAt ¶
func (tc *ThreadCreate) SetCreatedAt(t time.Time) *ThreadCreate
SetCreatedAt sets the "created_at" field.
func (*ThreadCreate) SetCreatedBy ¶
func (tc *ThreadCreate) SetCreatedBy(u uuid.UUID) *ThreadCreate
SetCreatedBy sets the "created_by" field.
func (*ThreadCreate) SetDescription ¶
func (tc *ThreadCreate) SetDescription(s string) *ThreadCreate
SetDescription sets the "description" field.
func (*ThreadCreate) SetModifiedAt ¶
func (tc *ThreadCreate) SetModifiedAt(t time.Time) *ThreadCreate
SetModifiedAt sets the "modified_at" field.
func (*ThreadCreate) SetNillableCreatedAt ¶
func (tc *ThreadCreate) SetNillableCreatedAt(t *time.Time) *ThreadCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ThreadCreate) SetNillableDescription ¶
func (tc *ThreadCreate) SetNillableDescription(s *string) *ThreadCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ThreadCreate) SetNillableModifiedAt ¶
func (tc *ThreadCreate) SetNillableModifiedAt(t *time.Time) *ThreadCreate
SetNillableModifiedAt sets the "modified_at" field if the given value is not nil.
func (*ThreadCreate) SetSlug ¶
func (tc *ThreadCreate) SetSlug(s string) *ThreadCreate
SetSlug sets the "slug" field.
func (*ThreadCreate) SetTitle ¶
func (tc *ThreadCreate) SetTitle(s string) *ThreadCreate
SetTitle sets the "title" field.
func (*ThreadCreate) SetTopics ¶
func (tc *ThreadCreate) SetTopics(t *Topic) *ThreadCreate
SetTopics sets the "topics" edge to the Topic entity.
func (*ThreadCreate) SetTopicsID ¶
func (tc *ThreadCreate) SetTopicsID(id int) *ThreadCreate
SetTopicsID sets the "topics" edge to the Topic entity by ID.
func (*ThreadCreate) SetUsers ¶
func (tc *ThreadCreate) SetUsers(u *User) *ThreadCreate
SetUsers sets the "users" edge to the User entity.
func (*ThreadCreate) SetUsersID ¶
func (tc *ThreadCreate) SetUsersID(id uuid.UUID) *ThreadCreate
SetUsersID sets the "users" edge to the User entity by ID.
type ThreadCreateBulk ¶
type ThreadCreateBulk struct {
// contains filtered or unexported fields
}
ThreadCreateBulk is the builder for creating many Thread entities in bulk.
func (*ThreadCreateBulk) Exec ¶
func (tcb *ThreadCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ThreadCreateBulk) ExecX ¶
func (tcb *ThreadCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ThreadDelete ¶
type ThreadDelete struct {
// contains filtered or unexported fields
}
ThreadDelete is the builder for deleting a Thread entity.
func (*ThreadDelete) Exec ¶
func (td *ThreadDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ThreadDelete) ExecX ¶
func (td *ThreadDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ThreadDelete) Where ¶
func (td *ThreadDelete) Where(ps ...predicate.Thread) *ThreadDelete
Where appends a list predicates to the ThreadDelete builder.
type ThreadDeleteOne ¶
type ThreadDeleteOne struct {
// contains filtered or unexported fields
}
ThreadDeleteOne is the builder for deleting a single Thread entity.
func (*ThreadDeleteOne) Exec ¶
func (tdo *ThreadDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ThreadDeleteOne) ExecX ¶
func (tdo *ThreadDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ThreadDeleteOne) Where ¶
func (tdo *ThreadDeleteOne) Where(ps ...predicate.Thread) *ThreadDeleteOne
Where appends a list predicates to the ThreadDelete builder.
type ThreadEdges ¶
type ThreadEdges struct { // ThreadComments holds the value of the thread_comments edge. ThreadComments []*Comment `json:"thread_comments,omitempty"` // Tags holds the value of the tags edge. Tags []*Tag `json:"tags,omitempty"` // Topics holds the value of the topics edge. Topics *Topic `json:"topics,omitempty"` // Users holds the value of the users edge. Users *User `json:"users,omitempty"` // KudoedUsers holds the value of the kudoed_users edge. KudoedUsers []*User `json:"kudoed_users,omitempty"` // ThreadKudoes holds the value of the thread_kudoes edge. ThreadKudoes []*ThreadKudo `json:"thread_kudoes,omitempty"` // contains filtered or unexported fields }
ThreadEdges holds the relations/edges for other nodes in the graph.
func (ThreadEdges) KudoedUsersOrErr ¶
func (e ThreadEdges) KudoedUsersOrErr() ([]*User, error)
KudoedUsersOrErr returns the KudoedUsers value or an error if the edge was not loaded in eager-loading.
func (ThreadEdges) TagsOrErr ¶
func (e ThreadEdges) TagsOrErr() ([]*Tag, error)
TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading.
func (ThreadEdges) ThreadCommentsOrErr ¶
func (e ThreadEdges) ThreadCommentsOrErr() ([]*Comment, error)
ThreadCommentsOrErr returns the ThreadComments value or an error if the edge was not loaded in eager-loading.
func (ThreadEdges) ThreadKudoesOrErr ¶
func (e ThreadEdges) ThreadKudoesOrErr() ([]*ThreadKudo, error)
ThreadKudoesOrErr returns the ThreadKudoes value or an error if the edge was not loaded in eager-loading.
func (ThreadEdges) TopicsOrErr ¶
func (e ThreadEdges) TopicsOrErr() (*Topic, error)
TopicsOrErr returns the Topics value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ThreadEdges) UsersOrErr ¶
func (e ThreadEdges) UsersOrErr() (*User, error)
UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ThreadGroupBy ¶
type ThreadGroupBy struct {
// contains filtered or unexported fields
}
ThreadGroupBy is the group-by builder for Thread entities.
func (*ThreadGroupBy) Aggregate ¶
func (tgb *ThreadGroupBy) Aggregate(fns ...AggregateFunc) *ThreadGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ThreadGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ThreadGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ThreadGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ThreadGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ThreadGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ThreadGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ThreadGroupBy) Scan ¶
func (tgb *ThreadGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ThreadGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ThreadKudo ¶
type ThreadKudo struct { // UserID holds the value of the "user_id" field. UserID uuid.UUID `json:"user_id,omitempty"` // ThreadID holds the value of the "thread_id" field. ThreadID int `json:"thread_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ThreadKudoQuery when eager-loading is set. Edges ThreadKudoEdges `json:"edges"` // contains filtered or unexported fields }
ThreadKudo is the model entity for the ThreadKudo schema.
func (*ThreadKudo) QueryThread ¶
func (tk *ThreadKudo) QueryThread() *ThreadQuery
QueryThread queries the "thread" edge of the ThreadKudo entity.
func (*ThreadKudo) QueryUser ¶
func (tk *ThreadKudo) QueryUser() *UserQuery
QueryUser queries the "user" edge of the ThreadKudo entity.
func (*ThreadKudo) String ¶
func (tk *ThreadKudo) String() string
String implements the fmt.Stringer.
func (*ThreadKudo) Unwrap ¶
func (tk *ThreadKudo) Unwrap() *ThreadKudo
Unwrap unwraps the ThreadKudo 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 (*ThreadKudo) Update ¶
func (tk *ThreadKudo) Update() *ThreadKudoUpdateOne
Update returns a builder for updating this ThreadKudo. Note that you need to call ThreadKudo.Unwrap() before calling this method if this ThreadKudo was returned from a transaction, and the transaction was committed or rolled back.
type ThreadKudoClient ¶
type ThreadKudoClient struct {
// contains filtered or unexported fields
}
ThreadKudoClient is a client for the ThreadKudo schema.
func NewThreadKudoClient ¶
func NewThreadKudoClient(c config) *ThreadKudoClient
NewThreadKudoClient returns a client for the ThreadKudo from the given config.
func (*ThreadKudoClient) Create ¶
func (c *ThreadKudoClient) Create() *ThreadKudoCreate
Create returns a builder for creating a ThreadKudo entity.
func (*ThreadKudoClient) CreateBulk ¶
func (c *ThreadKudoClient) CreateBulk(builders ...*ThreadKudoCreate) *ThreadKudoCreateBulk
CreateBulk returns a builder for creating a bulk of ThreadKudo entities.
func (*ThreadKudoClient) Delete ¶
func (c *ThreadKudoClient) Delete() *ThreadKudoDelete
Delete returns a delete builder for ThreadKudo.
func (*ThreadKudoClient) Hooks ¶
func (c *ThreadKudoClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ThreadKudoClient) Intercept ¶
func (c *ThreadKudoClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `threadkudo.Intercept(f(g(h())))`.
func (*ThreadKudoClient) Interceptors ¶
func (c *ThreadKudoClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ThreadKudoClient) MapCreateBulk ¶
func (c *ThreadKudoClient) MapCreateBulk(slice any, setFunc func(*ThreadKudoCreate, int)) *ThreadKudoCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*ThreadKudoClient) Query ¶
func (c *ThreadKudoClient) Query() *ThreadKudoQuery
Query returns a query builder for ThreadKudo.
func (*ThreadKudoClient) QueryThread ¶
func (c *ThreadKudoClient) QueryThread(tk *ThreadKudo) *ThreadQuery
QueryThread queries the thread edge of a ThreadKudo.
func (*ThreadKudoClient) QueryUser ¶
func (c *ThreadKudoClient) QueryUser(tk *ThreadKudo) *UserQuery
QueryUser queries the user edge of a ThreadKudo.
func (*ThreadKudoClient) Update ¶
func (c *ThreadKudoClient) Update() *ThreadKudoUpdate
Update returns an update builder for ThreadKudo.
func (*ThreadKudoClient) UpdateOne ¶
func (c *ThreadKudoClient) UpdateOne(tk *ThreadKudo) *ThreadKudoUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ThreadKudoClient) Use ¶
func (c *ThreadKudoClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `threadkudo.Hooks(f(g(h())))`.
type ThreadKudoCreate ¶
type ThreadKudoCreate struct {
// contains filtered or unexported fields
}
ThreadKudoCreate is the builder for creating a ThreadKudo entity.
func (*ThreadKudoCreate) Exec ¶
func (tkc *ThreadKudoCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ThreadKudoCreate) ExecX ¶
func (tkc *ThreadKudoCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ThreadKudoCreate) Mutation ¶
func (tkc *ThreadKudoCreate) Mutation() *ThreadKudoMutation
Mutation returns the ThreadKudoMutation object of the builder.
func (*ThreadKudoCreate) Save ¶
func (tkc *ThreadKudoCreate) Save(ctx context.Context) (*ThreadKudo, error)
Save creates the ThreadKudo in the database.
func (*ThreadKudoCreate) SaveX ¶
func (tkc *ThreadKudoCreate) SaveX(ctx context.Context) *ThreadKudo
SaveX calls Save and panics if Save returns an error.
func (*ThreadKudoCreate) SetThread ¶
func (tkc *ThreadKudoCreate) SetThread(t *Thread) *ThreadKudoCreate
SetThread sets the "thread" edge to the Thread entity.
func (*ThreadKudoCreate) SetThreadID ¶
func (tkc *ThreadKudoCreate) SetThreadID(i int) *ThreadKudoCreate
SetThreadID sets the "thread_id" field.
func (*ThreadKudoCreate) SetUser ¶
func (tkc *ThreadKudoCreate) SetUser(u *User) *ThreadKudoCreate
SetUser sets the "user" edge to the User entity.
func (*ThreadKudoCreate) SetUserID ¶
func (tkc *ThreadKudoCreate) SetUserID(u uuid.UUID) *ThreadKudoCreate
SetUserID sets the "user_id" field.
type ThreadKudoCreateBulk ¶
type ThreadKudoCreateBulk struct {
// contains filtered or unexported fields
}
ThreadKudoCreateBulk is the builder for creating many ThreadKudo entities in bulk.
func (*ThreadKudoCreateBulk) Exec ¶
func (tkcb *ThreadKudoCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ThreadKudoCreateBulk) ExecX ¶
func (tkcb *ThreadKudoCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ThreadKudoCreateBulk) Save ¶
func (tkcb *ThreadKudoCreateBulk) Save(ctx context.Context) ([]*ThreadKudo, error)
Save creates the ThreadKudo entities in the database.
func (*ThreadKudoCreateBulk) SaveX ¶
func (tkcb *ThreadKudoCreateBulk) SaveX(ctx context.Context) []*ThreadKudo
SaveX is like Save, but panics if an error occurs.
type ThreadKudoDelete ¶
type ThreadKudoDelete struct {
// contains filtered or unexported fields
}
ThreadKudoDelete is the builder for deleting a ThreadKudo entity.
func (*ThreadKudoDelete) Exec ¶
func (tkd *ThreadKudoDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ThreadKudoDelete) ExecX ¶
func (tkd *ThreadKudoDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ThreadKudoDelete) Where ¶
func (tkd *ThreadKudoDelete) Where(ps ...predicate.ThreadKudo) *ThreadKudoDelete
Where appends a list predicates to the ThreadKudoDelete builder.
type ThreadKudoDeleteOne ¶
type ThreadKudoDeleteOne struct {
// contains filtered or unexported fields
}
ThreadKudoDeleteOne is the builder for deleting a single ThreadKudo entity.
func (*ThreadKudoDeleteOne) Exec ¶
func (tkdo *ThreadKudoDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ThreadKudoDeleteOne) ExecX ¶
func (tkdo *ThreadKudoDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ThreadKudoDeleteOne) Where ¶
func (tkdo *ThreadKudoDeleteOne) Where(ps ...predicate.ThreadKudo) *ThreadKudoDeleteOne
Where appends a list predicates to the ThreadKudoDelete builder.
type ThreadKudoEdges ¶
type ThreadKudoEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // Thread holds the value of the thread edge. Thread *Thread `json:"thread,omitempty"` // contains filtered or unexported fields }
ThreadKudoEdges holds the relations/edges for other nodes in the graph.
func (ThreadKudoEdges) ThreadOrErr ¶
func (e ThreadKudoEdges) ThreadOrErr() (*Thread, error)
ThreadOrErr returns the Thread value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ThreadKudoEdges) UserOrErr ¶
func (e ThreadKudoEdges) 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 ThreadKudoGroupBy ¶
type ThreadKudoGroupBy struct {
// contains filtered or unexported fields
}
ThreadKudoGroupBy is the group-by builder for ThreadKudo entities.
func (*ThreadKudoGroupBy) Aggregate ¶
func (tkgb *ThreadKudoGroupBy) Aggregate(fns ...AggregateFunc) *ThreadKudoGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ThreadKudoGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ThreadKudoGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ThreadKudoGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ThreadKudoGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ThreadKudoGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ThreadKudoGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ThreadKudoGroupBy) Scan ¶
func (tkgb *ThreadKudoGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ThreadKudoGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ThreadKudoMutation ¶
type ThreadKudoMutation struct {
// contains filtered or unexported fields
}
ThreadKudoMutation represents an operation that mutates the ThreadKudo nodes in the graph.
func (*ThreadKudoMutation) AddField ¶
func (m *ThreadKudoMutation) 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 (*ThreadKudoMutation) AddedEdges ¶
func (m *ThreadKudoMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ThreadKudoMutation) AddedField ¶
func (m *ThreadKudoMutation) 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 (*ThreadKudoMutation) AddedFields ¶
func (m *ThreadKudoMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ThreadKudoMutation) AddedIDs ¶
func (m *ThreadKudoMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ThreadKudoMutation) ClearEdge ¶
func (m *ThreadKudoMutation) 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 (*ThreadKudoMutation) ClearField ¶
func (m *ThreadKudoMutation) 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 (*ThreadKudoMutation) ClearThread ¶
func (m *ThreadKudoMutation) ClearThread()
ClearThread clears the "thread" edge to the Thread entity.
func (*ThreadKudoMutation) ClearUser ¶
func (m *ThreadKudoMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*ThreadKudoMutation) ClearedEdges ¶
func (m *ThreadKudoMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ThreadKudoMutation) ClearedFields ¶
func (m *ThreadKudoMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ThreadKudoMutation) Client ¶
func (m ThreadKudoMutation) 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 (*ThreadKudoMutation) EdgeCleared ¶
func (m *ThreadKudoMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ThreadKudoMutation) Field ¶
func (m *ThreadKudoMutation) 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 (*ThreadKudoMutation) FieldCleared ¶
func (m *ThreadKudoMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ThreadKudoMutation) Fields ¶
func (m *ThreadKudoMutation) 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 (*ThreadKudoMutation) 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 (*ThreadKudoMutation) RemovedEdges ¶
func (m *ThreadKudoMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ThreadKudoMutation) RemovedIDs ¶
func (m *ThreadKudoMutation) 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 (*ThreadKudoMutation) ResetEdge ¶
func (m *ThreadKudoMutation) 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 (*ThreadKudoMutation) ResetField ¶
func (m *ThreadKudoMutation) 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 (*ThreadKudoMutation) ResetThread ¶
func (m *ThreadKudoMutation) ResetThread()
ResetThread resets all changes to the "thread" edge.
func (*ThreadKudoMutation) ResetThreadID ¶
func (m *ThreadKudoMutation) ResetThreadID()
ResetThreadID resets all changes to the "thread_id" field.
func (*ThreadKudoMutation) ResetUser ¶
func (m *ThreadKudoMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*ThreadKudoMutation) ResetUserID ¶
func (m *ThreadKudoMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*ThreadKudoMutation) SetField ¶
func (m *ThreadKudoMutation) 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 (*ThreadKudoMutation) SetOp ¶
func (m *ThreadKudoMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ThreadKudoMutation) SetThreadID ¶
func (m *ThreadKudoMutation) SetThreadID(i int)
SetThreadID sets the "thread_id" field.
func (*ThreadKudoMutation) SetUserID ¶
func (m *ThreadKudoMutation) SetUserID(u uuid.UUID)
SetUserID sets the "user_id" field.
func (*ThreadKudoMutation) ThreadCleared ¶
func (m *ThreadKudoMutation) ThreadCleared() bool
ThreadCleared reports if the "thread" edge to the Thread entity was cleared.
func (*ThreadKudoMutation) ThreadID ¶
func (m *ThreadKudoMutation) ThreadID() (r int, exists bool)
ThreadID returns the value of the "thread_id" field in the mutation.
func (*ThreadKudoMutation) ThreadIDs ¶
func (m *ThreadKudoMutation) ThreadIDs() (ids []int)
ThreadIDs returns the "thread" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ThreadID instead. It exists only for internal usage by the builders.
func (ThreadKudoMutation) Tx ¶
func (m ThreadKudoMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ThreadKudoMutation) Type ¶
func (m *ThreadKudoMutation) Type() string
Type returns the node type of this mutation (ThreadKudo).
func (*ThreadKudoMutation) UserCleared ¶
func (m *ThreadKudoMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*ThreadKudoMutation) UserID ¶
func (m *ThreadKudoMutation) UserID() (r uuid.UUID, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*ThreadKudoMutation) UserIDs ¶
func (m *ThreadKudoMutation) 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 (*ThreadKudoMutation) Where ¶
func (m *ThreadKudoMutation) Where(ps ...predicate.ThreadKudo)
Where appends a list predicates to the ThreadKudoMutation builder.
func (*ThreadKudoMutation) WhereP ¶
func (m *ThreadKudoMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ThreadKudoMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ThreadKudoQuery ¶
type ThreadKudoQuery struct {
// contains filtered or unexported fields
}
ThreadKudoQuery is the builder for querying ThreadKudo entities.
func (*ThreadKudoQuery) Aggregate ¶
func (tkq *ThreadKudoQuery) Aggregate(fns ...AggregateFunc) *ThreadKudoSelect
Aggregate returns a ThreadKudoSelect configured with the given aggregations.
func (*ThreadKudoQuery) All ¶
func (tkq *ThreadKudoQuery) All(ctx context.Context) ([]*ThreadKudo, error)
All executes the query and returns a list of ThreadKudos.
func (*ThreadKudoQuery) AllX ¶
func (tkq *ThreadKudoQuery) AllX(ctx context.Context) []*ThreadKudo
AllX is like All, but panics if an error occurs.
func (*ThreadKudoQuery) Clone ¶
func (tkq *ThreadKudoQuery) Clone() *ThreadKudoQuery
Clone returns a duplicate of the ThreadKudoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ThreadKudoQuery) Count ¶
func (tkq *ThreadKudoQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ThreadKudoQuery) CountX ¶
func (tkq *ThreadKudoQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ThreadKudoQuery) Exist ¶
func (tkq *ThreadKudoQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ThreadKudoQuery) ExistX ¶
func (tkq *ThreadKudoQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ThreadKudoQuery) First ¶
func (tkq *ThreadKudoQuery) First(ctx context.Context) (*ThreadKudo, error)
First returns the first ThreadKudo entity from the query. Returns a *NotFoundError when no ThreadKudo was found.
func (*ThreadKudoQuery) FirstX ¶
func (tkq *ThreadKudoQuery) FirstX(ctx context.Context) *ThreadKudo
FirstX is like First, but panics if an error occurs.
func (*ThreadKudoQuery) GroupBy ¶
func (tkq *ThreadKudoQuery) GroupBy(field string, fields ...string) *ThreadKudoGroupBy
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 { UserID uuid.UUID `json:"user_id,omitempty"` Count int `json:"count,omitempty"` } client.ThreadKudo.Query(). GroupBy(threadkudo.FieldUserID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ThreadKudoQuery) Limit ¶
func (tkq *ThreadKudoQuery) Limit(limit int) *ThreadKudoQuery
Limit the number of records to be returned by this query.
func (*ThreadKudoQuery) Offset ¶
func (tkq *ThreadKudoQuery) Offset(offset int) *ThreadKudoQuery
Offset to start from.
func (*ThreadKudoQuery) Only ¶
func (tkq *ThreadKudoQuery) Only(ctx context.Context) (*ThreadKudo, error)
Only returns a single ThreadKudo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ThreadKudo entity is found. Returns a *NotFoundError when no ThreadKudo entities are found.
func (*ThreadKudoQuery) OnlyX ¶
func (tkq *ThreadKudoQuery) OnlyX(ctx context.Context) *ThreadKudo
OnlyX is like Only, but panics if an error occurs.
func (*ThreadKudoQuery) Order ¶
func (tkq *ThreadKudoQuery) Order(o ...threadkudo.OrderOption) *ThreadKudoQuery
Order specifies how the records should be ordered.
func (*ThreadKudoQuery) QueryThread ¶
func (tkq *ThreadKudoQuery) QueryThread() *ThreadQuery
QueryThread chains the current query on the "thread" edge.
func (*ThreadKudoQuery) QueryUser ¶
func (tkq *ThreadKudoQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*ThreadKudoQuery) Select ¶
func (tkq *ThreadKudoQuery) Select(fields ...string) *ThreadKudoSelect
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 { UserID uuid.UUID `json:"user_id,omitempty"` } client.ThreadKudo.Query(). Select(threadkudo.FieldUserID). Scan(ctx, &v)
func (*ThreadKudoQuery) Unique ¶
func (tkq *ThreadKudoQuery) Unique(unique bool) *ThreadKudoQuery
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 (*ThreadKudoQuery) Where ¶
func (tkq *ThreadKudoQuery) Where(ps ...predicate.ThreadKudo) *ThreadKudoQuery
Where adds a new predicate for the ThreadKudoQuery builder.
func (*ThreadKudoQuery) WithThread ¶
func (tkq *ThreadKudoQuery) WithThread(opts ...func(*ThreadQuery)) *ThreadKudoQuery
WithThread tells the query-builder to eager-load the nodes that are connected to the "thread" edge. The optional arguments are used to configure the query builder of the edge.
func (*ThreadKudoQuery) WithUser ¶
func (tkq *ThreadKudoQuery) WithUser(opts ...func(*UserQuery)) *ThreadKudoQuery
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 ThreadKudoSelect ¶
type ThreadKudoSelect struct { *ThreadKudoQuery // contains filtered or unexported fields }
ThreadKudoSelect is the builder for selecting fields of ThreadKudo entities.
func (*ThreadKudoSelect) Aggregate ¶
func (tks *ThreadKudoSelect) Aggregate(fns ...AggregateFunc) *ThreadKudoSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ThreadKudoSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ThreadKudoSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ThreadKudoSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ThreadKudoSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ThreadKudoSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ThreadKudoSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ThreadKudoSelect) Scan ¶
func (tks *ThreadKudoSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ThreadKudoSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ThreadKudoUpdate ¶
type ThreadKudoUpdate struct {
// contains filtered or unexported fields
}
ThreadKudoUpdate is the builder for updating ThreadKudo entities.
func (*ThreadKudoUpdate) Exec ¶
func (tku *ThreadKudoUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ThreadKudoUpdate) ExecX ¶
func (tku *ThreadKudoUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ThreadKudoUpdate) Mutation ¶
func (tku *ThreadKudoUpdate) Mutation() *ThreadKudoMutation
Mutation returns the ThreadKudoMutation object of the builder.
func (*ThreadKudoUpdate) Save ¶
func (tku *ThreadKudoUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ThreadKudoUpdate) SaveX ¶
func (tku *ThreadKudoUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ThreadKudoUpdate) Where ¶
func (tku *ThreadKudoUpdate) Where(ps ...predicate.ThreadKudo) *ThreadKudoUpdate
Where appends a list predicates to the ThreadKudoUpdate builder.
type ThreadKudoUpdateOne ¶
type ThreadKudoUpdateOne struct {
// contains filtered or unexported fields
}
ThreadKudoUpdateOne is the builder for updating a single ThreadKudo entity.
func (*ThreadKudoUpdateOne) Exec ¶
func (tkuo *ThreadKudoUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ThreadKudoUpdateOne) ExecX ¶
func (tkuo *ThreadKudoUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ThreadKudoUpdateOne) Mutation ¶
func (tkuo *ThreadKudoUpdateOne) Mutation() *ThreadKudoMutation
Mutation returns the ThreadKudoMutation object of the builder.
func (*ThreadKudoUpdateOne) Save ¶
func (tkuo *ThreadKudoUpdateOne) Save(ctx context.Context) (*ThreadKudo, error)
Save executes the query and returns the updated ThreadKudo entity.
func (*ThreadKudoUpdateOne) SaveX ¶
func (tkuo *ThreadKudoUpdateOne) SaveX(ctx context.Context) *ThreadKudo
SaveX is like Save, but panics if an error occurs.
func (*ThreadKudoUpdateOne) Select ¶
func (tkuo *ThreadKudoUpdateOne) Select(field string, fields ...string) *ThreadKudoUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ThreadKudoUpdateOne) Where ¶
func (tkuo *ThreadKudoUpdateOne) Where(ps ...predicate.ThreadKudo) *ThreadKudoUpdateOne
Where appends a list predicates to the ThreadKudoUpdate builder.
type ThreadMutation ¶
type ThreadMutation struct {
// contains filtered or unexported fields
}
ThreadMutation represents an operation that mutates the Thread nodes in the graph.
func (*ThreadMutation) AddField ¶
func (m *ThreadMutation) 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 (*ThreadMutation) AddKudoedUserIDs ¶
func (m *ThreadMutation) AddKudoedUserIDs(ids ...uuid.UUID)
AddKudoedUserIDs adds the "kudoed_users" edge to the User entity by ids.
func (*ThreadMutation) AddTagIDs ¶
func (m *ThreadMutation) AddTagIDs(ids ...int)
AddTagIDs adds the "tags" edge to the Tag entity by ids.
func (*ThreadMutation) AddThreadCommentIDs ¶
func (m *ThreadMutation) AddThreadCommentIDs(ids ...int)
AddThreadCommentIDs adds the "thread_comments" edge to the Comment entity by ids.
func (*ThreadMutation) AddedEdges ¶
func (m *ThreadMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ThreadMutation) AddedField ¶
func (m *ThreadMutation) 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 (*ThreadMutation) AddedFields ¶
func (m *ThreadMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ThreadMutation) AddedIDs ¶
func (m *ThreadMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ThreadMutation) ClearDescription ¶
func (m *ThreadMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*ThreadMutation) ClearEdge ¶
func (m *ThreadMutation) 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 (*ThreadMutation) ClearField ¶
func (m *ThreadMutation) 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 (*ThreadMutation) ClearKudoedUsers ¶
func (m *ThreadMutation) ClearKudoedUsers()
ClearKudoedUsers clears the "kudoed_users" edge to the User entity.
func (*ThreadMutation) ClearModifiedAt ¶
func (m *ThreadMutation) ClearModifiedAt()
ClearModifiedAt clears the value of the "modified_at" field.
func (*ThreadMutation) ClearTags ¶
func (m *ThreadMutation) ClearTags()
ClearTags clears the "tags" edge to the Tag entity.
func (*ThreadMutation) ClearThreadComments ¶
func (m *ThreadMutation) ClearThreadComments()
ClearThreadComments clears the "thread_comments" edge to the Comment entity.
func (*ThreadMutation) ClearTopics ¶
func (m *ThreadMutation) ClearTopics()
ClearTopics clears the "topics" edge to the Topic entity.
func (*ThreadMutation) ClearUsers ¶
func (m *ThreadMutation) ClearUsers()
ClearUsers clears the "users" edge to the User entity.
func (*ThreadMutation) ClearedEdges ¶
func (m *ThreadMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ThreadMutation) ClearedFields ¶
func (m *ThreadMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ThreadMutation) Client ¶
func (m ThreadMutation) 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 (*ThreadMutation) CreatedAt ¶
func (m *ThreadMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ThreadMutation) CreatedBy ¶
func (m *ThreadMutation) CreatedBy() (r uuid.UUID, exists bool)
CreatedBy returns the value of the "created_by" field in the mutation.
func (*ThreadMutation) Description ¶
func (m *ThreadMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*ThreadMutation) DescriptionCleared ¶
func (m *ThreadMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*ThreadMutation) EdgeCleared ¶
func (m *ThreadMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ThreadMutation) Field ¶
func (m *ThreadMutation) 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 (*ThreadMutation) FieldCleared ¶
func (m *ThreadMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ThreadMutation) Fields ¶
func (m *ThreadMutation) 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 (*ThreadMutation) ID ¶
func (m *ThreadMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*ThreadMutation) IDs ¶
func (m *ThreadMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*ThreadMutation) KudoedUsersCleared ¶
func (m *ThreadMutation) KudoedUsersCleared() bool
KudoedUsersCleared reports if the "kudoed_users" edge to the User entity was cleared.
func (*ThreadMutation) KudoedUsersIDs ¶
func (m *ThreadMutation) KudoedUsersIDs() (ids []uuid.UUID)
KudoedUsersIDs returns the "kudoed_users" edge IDs in the mutation.
func (*ThreadMutation) ModifiedAt ¶
func (m *ThreadMutation) ModifiedAt() (r time.Time, exists bool)
ModifiedAt returns the value of the "modified_at" field in the mutation.
func (*ThreadMutation) ModifiedAtCleared ¶
func (m *ThreadMutation) ModifiedAtCleared() bool
ModifiedAtCleared returns if the "modified_at" field was cleared in this mutation.
func (*ThreadMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldCreatedBy ¶
OldCreatedBy returns the old "created_by" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldDescription ¶
func (m *ThreadMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) 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 (*ThreadMutation) OldModifiedAt ¶
OldModifiedAt returns the old "modified_at" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldSlug ¶
func (m *ThreadMutation) OldSlug(ctx context.Context) (v string, err error)
OldSlug returns the old "slug" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) OldTitle ¶
func (m *ThreadMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the Thread entity. If the Thread 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 (*ThreadMutation) RemoveKudoedUserIDs ¶
func (m *ThreadMutation) RemoveKudoedUserIDs(ids ...uuid.UUID)
RemoveKudoedUserIDs removes the "kudoed_users" edge to the User entity by IDs.
func (*ThreadMutation) RemoveTagIDs ¶
func (m *ThreadMutation) RemoveTagIDs(ids ...int)
RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.
func (*ThreadMutation) RemoveThreadCommentIDs ¶
func (m *ThreadMutation) RemoveThreadCommentIDs(ids ...int)
RemoveThreadCommentIDs removes the "thread_comments" edge to the Comment entity by IDs.
func (*ThreadMutation) RemovedEdges ¶
func (m *ThreadMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ThreadMutation) RemovedIDs ¶
func (m *ThreadMutation) 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 (*ThreadMutation) RemovedKudoedUsersIDs ¶
func (m *ThreadMutation) RemovedKudoedUsersIDs() (ids []uuid.UUID)
RemovedKudoedUsers returns the removed IDs of the "kudoed_users" edge to the User entity.
func (*ThreadMutation) RemovedTagsIDs ¶
func (m *ThreadMutation) RemovedTagsIDs() (ids []int)
RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.
func (*ThreadMutation) RemovedThreadCommentsIDs ¶
func (m *ThreadMutation) RemovedThreadCommentsIDs() (ids []int)
RemovedThreadComments returns the removed IDs of the "thread_comments" edge to the Comment entity.
func (*ThreadMutation) ResetCreatedAt ¶
func (m *ThreadMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ThreadMutation) ResetCreatedBy ¶
func (m *ThreadMutation) ResetCreatedBy()
ResetCreatedBy resets all changes to the "created_by" field.
func (*ThreadMutation) ResetDescription ¶
func (m *ThreadMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*ThreadMutation) ResetEdge ¶
func (m *ThreadMutation) 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 (*ThreadMutation) ResetField ¶
func (m *ThreadMutation) 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 (*ThreadMutation) ResetKudoedUsers ¶
func (m *ThreadMutation) ResetKudoedUsers()
ResetKudoedUsers resets all changes to the "kudoed_users" edge.
func (*ThreadMutation) ResetModifiedAt ¶
func (m *ThreadMutation) ResetModifiedAt()
ResetModifiedAt resets all changes to the "modified_at" field.
func (*ThreadMutation) ResetSlug ¶
func (m *ThreadMutation) ResetSlug()
ResetSlug resets all changes to the "slug" field.
func (*ThreadMutation) ResetTags ¶
func (m *ThreadMutation) ResetTags()
ResetTags resets all changes to the "tags" edge.
func (*ThreadMutation) ResetThreadComments ¶
func (m *ThreadMutation) ResetThreadComments()
ResetThreadComments resets all changes to the "thread_comments" edge.
func (*ThreadMutation) ResetTitle ¶
func (m *ThreadMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*ThreadMutation) ResetTopics ¶
func (m *ThreadMutation) ResetTopics()
ResetTopics resets all changes to the "topics" edge.
func (*ThreadMutation) ResetUsers ¶
func (m *ThreadMutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*ThreadMutation) SetCreatedAt ¶
func (m *ThreadMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ThreadMutation) SetCreatedBy ¶
func (m *ThreadMutation) SetCreatedBy(u uuid.UUID)
SetCreatedBy sets the "created_by" field.
func (*ThreadMutation) SetDescription ¶
func (m *ThreadMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*ThreadMutation) SetField ¶
func (m *ThreadMutation) 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 (*ThreadMutation) SetModifiedAt ¶
func (m *ThreadMutation) SetModifiedAt(t time.Time)
SetModifiedAt sets the "modified_at" field.
func (*ThreadMutation) SetOp ¶
func (m *ThreadMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ThreadMutation) SetSlug ¶
func (m *ThreadMutation) SetSlug(s string)
SetSlug sets the "slug" field.
func (*ThreadMutation) SetTitle ¶
func (m *ThreadMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*ThreadMutation) SetTopicsID ¶
func (m *ThreadMutation) SetTopicsID(id int)
SetTopicsID sets the "topics" edge to the Topic entity by id.
func (*ThreadMutation) SetUsersID ¶
func (m *ThreadMutation) SetUsersID(id uuid.UUID)
SetUsersID sets the "users" edge to the User entity by id.
func (*ThreadMutation) Slug ¶
func (m *ThreadMutation) Slug() (r string, exists bool)
Slug returns the value of the "slug" field in the mutation.
func (*ThreadMutation) TagsCleared ¶
func (m *ThreadMutation) TagsCleared() bool
TagsCleared reports if the "tags" edge to the Tag entity was cleared.
func (*ThreadMutation) TagsIDs ¶
func (m *ThreadMutation) TagsIDs() (ids []int)
TagsIDs returns the "tags" edge IDs in the mutation.
func (*ThreadMutation) ThreadCommentsCleared ¶
func (m *ThreadMutation) ThreadCommentsCleared() bool
ThreadCommentsCleared reports if the "thread_comments" edge to the Comment entity was cleared.
func (*ThreadMutation) ThreadCommentsIDs ¶
func (m *ThreadMutation) ThreadCommentsIDs() (ids []int)
ThreadCommentsIDs returns the "thread_comments" edge IDs in the mutation.
func (*ThreadMutation) Title ¶
func (m *ThreadMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (*ThreadMutation) TopicsCleared ¶
func (m *ThreadMutation) TopicsCleared() bool
TopicsCleared reports if the "topics" edge to the Topic entity was cleared.
func (*ThreadMutation) TopicsID ¶
func (m *ThreadMutation) TopicsID() (id int, exists bool)
TopicsID returns the "topics" edge ID in the mutation.
func (*ThreadMutation) TopicsIDs ¶
func (m *ThreadMutation) TopicsIDs() (ids []int)
TopicsIDs returns the "topics" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TopicsID instead. It exists only for internal usage by the builders.
func (ThreadMutation) Tx ¶
func (m ThreadMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ThreadMutation) Type ¶
func (m *ThreadMutation) Type() string
Type returns the node type of this mutation (Thread).
func (*ThreadMutation) UsersCleared ¶
func (m *ThreadMutation) UsersCleared() bool
UsersCleared reports if the "users" edge to the User entity was cleared.
func (*ThreadMutation) UsersID ¶
func (m *ThreadMutation) UsersID() (id uuid.UUID, exists bool)
UsersID returns the "users" edge ID in the mutation.
func (*ThreadMutation) UsersIDs ¶
func (m *ThreadMutation) UsersIDs() (ids []uuid.UUID)
UsersIDs returns the "users" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UsersID instead. It exists only for internal usage by the builders.
func (*ThreadMutation) Where ¶
func (m *ThreadMutation) Where(ps ...predicate.Thread)
Where appends a list predicates to the ThreadMutation builder.
func (*ThreadMutation) WhereP ¶
func (m *ThreadMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ThreadMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ThreadQuery ¶
type ThreadQuery struct {
// contains filtered or unexported fields
}
ThreadQuery is the builder for querying Thread entities.
func (*ThreadQuery) Aggregate ¶
func (tq *ThreadQuery) Aggregate(fns ...AggregateFunc) *ThreadSelect
Aggregate returns a ThreadSelect configured with the given aggregations.
func (*ThreadQuery) All ¶
func (tq *ThreadQuery) All(ctx context.Context) ([]*Thread, error)
All executes the query and returns a list of Threads.
func (*ThreadQuery) AllX ¶
func (tq *ThreadQuery) AllX(ctx context.Context) []*Thread
AllX is like All, but panics if an error occurs.
func (*ThreadQuery) Clone ¶
func (tq *ThreadQuery) Clone() *ThreadQuery
Clone returns a duplicate of the ThreadQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ThreadQuery) Count ¶
func (tq *ThreadQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ThreadQuery) CountX ¶
func (tq *ThreadQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ThreadQuery) Exist ¶
func (tq *ThreadQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ThreadQuery) ExistX ¶
func (tq *ThreadQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ThreadQuery) First ¶
func (tq *ThreadQuery) First(ctx context.Context) (*Thread, error)
First returns the first Thread entity from the query. Returns a *NotFoundError when no Thread was found.
func (*ThreadQuery) FirstID ¶
func (tq *ThreadQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Thread ID from the query. Returns a *NotFoundError when no Thread ID was found.
func (*ThreadQuery) FirstIDX ¶
func (tq *ThreadQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ThreadQuery) FirstX ¶
func (tq *ThreadQuery) FirstX(ctx context.Context) *Thread
FirstX is like First, but panics if an error occurs.
func (*ThreadQuery) GroupBy ¶
func (tq *ThreadQuery) GroupBy(field string, fields ...string) *ThreadGroupBy
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.Thread.Query(). GroupBy(thread.FieldTitle). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ThreadQuery) IDs ¶
func (tq *ThreadQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Thread IDs.
func (*ThreadQuery) IDsX ¶
func (tq *ThreadQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ThreadQuery) Limit ¶
func (tq *ThreadQuery) Limit(limit int) *ThreadQuery
Limit the number of records to be returned by this query.
func (*ThreadQuery) Offset ¶
func (tq *ThreadQuery) Offset(offset int) *ThreadQuery
Offset to start from.
func (*ThreadQuery) Only ¶
func (tq *ThreadQuery) Only(ctx context.Context) (*Thread, error)
Only returns a single Thread entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Thread entity is found. Returns a *NotFoundError when no Thread entities are found.
func (*ThreadQuery) OnlyID ¶
func (tq *ThreadQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Thread ID in the query. Returns a *NotSingularError when more than one Thread ID is found. Returns a *NotFoundError when no entities are found.
func (*ThreadQuery) OnlyIDX ¶
func (tq *ThreadQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ThreadQuery) OnlyX ¶
func (tq *ThreadQuery) OnlyX(ctx context.Context) *Thread
OnlyX is like Only, but panics if an error occurs.
func (*ThreadQuery) Order ¶
func (tq *ThreadQuery) Order(o ...thread.OrderOption) *ThreadQuery
Order specifies how the records should be ordered.
func (*ThreadQuery) QueryKudoedUsers ¶
func (tq *ThreadQuery) QueryKudoedUsers() *UserQuery
QueryKudoedUsers chains the current query on the "kudoed_users" edge.
func (*ThreadQuery) QueryTags ¶
func (tq *ThreadQuery) QueryTags() *TagQuery
QueryTags chains the current query on the "tags" edge.
func (*ThreadQuery) QueryThreadComments ¶
func (tq *ThreadQuery) QueryThreadComments() *CommentQuery
QueryThreadComments chains the current query on the "thread_comments" edge.
func (*ThreadQuery) QueryThreadKudoes ¶
func (tq *ThreadQuery) QueryThreadKudoes() *ThreadKudoQuery
QueryThreadKudoes chains the current query on the "thread_kudoes" edge.
func (*ThreadQuery) QueryTopics ¶
func (tq *ThreadQuery) QueryTopics() *TopicQuery
QueryTopics chains the current query on the "topics" edge.
func (*ThreadQuery) QueryUsers ¶
func (tq *ThreadQuery) QueryUsers() *UserQuery
QueryUsers chains the current query on the "users" edge.
func (*ThreadQuery) Select ¶
func (tq *ThreadQuery) Select(fields ...string) *ThreadSelect
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.Thread.Query(). Select(thread.FieldTitle). Scan(ctx, &v)
func (*ThreadQuery) Unique ¶
func (tq *ThreadQuery) Unique(unique bool) *ThreadQuery
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 (*ThreadQuery) Where ¶
func (tq *ThreadQuery) Where(ps ...predicate.Thread) *ThreadQuery
Where adds a new predicate for the ThreadQuery builder.
func (*ThreadQuery) WithKudoedUsers ¶
func (tq *ThreadQuery) WithKudoedUsers(opts ...func(*UserQuery)) *ThreadQuery
WithKudoedUsers tells the query-builder to eager-load the nodes that are connected to the "kudoed_users" edge. The optional arguments are used to configure the query builder of the edge.
func (*ThreadQuery) WithTags ¶
func (tq *ThreadQuery) WithTags(opts ...func(*TagQuery)) *ThreadQuery
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 (*ThreadQuery) WithThreadComments ¶
func (tq *ThreadQuery) WithThreadComments(opts ...func(*CommentQuery)) *ThreadQuery
WithThreadComments tells the query-builder to eager-load the nodes that are connected to the "thread_comments" edge. The optional arguments are used to configure the query builder of the edge.
func (*ThreadQuery) WithThreadKudoes ¶
func (tq *ThreadQuery) WithThreadKudoes(opts ...func(*ThreadKudoQuery)) *ThreadQuery
WithThreadKudoes tells the query-builder to eager-load the nodes that are connected to the "thread_kudoes" edge. The optional arguments are used to configure the query builder of the edge.
func (*ThreadQuery) WithTopics ¶
func (tq *ThreadQuery) WithTopics(opts ...func(*TopicQuery)) *ThreadQuery
WithTopics tells the query-builder to eager-load the nodes that are connected to the "topics" edge. The optional arguments are used to configure the query builder of the edge.
func (*ThreadQuery) WithUsers ¶
func (tq *ThreadQuery) WithUsers(opts ...func(*UserQuery)) *ThreadQuery
WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.
type ThreadSelect ¶
type ThreadSelect struct { *ThreadQuery // contains filtered or unexported fields }
ThreadSelect is the builder for selecting fields of Thread entities.
func (*ThreadSelect) Aggregate ¶
func (ts *ThreadSelect) Aggregate(fns ...AggregateFunc) *ThreadSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ThreadSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ThreadSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ThreadSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ThreadSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ThreadSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ThreadSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ThreadSelect) Scan ¶
func (ts *ThreadSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ThreadSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ThreadUpdate ¶
type ThreadUpdate struct {
// contains filtered or unexported fields
}
ThreadUpdate is the builder for updating Thread entities.
func (*ThreadUpdate) AddKudoedUserIDs ¶
func (tu *ThreadUpdate) AddKudoedUserIDs(ids ...uuid.UUID) *ThreadUpdate
AddKudoedUserIDs adds the "kudoed_users" edge to the User entity by IDs.
func (*ThreadUpdate) AddKudoedUsers ¶
func (tu *ThreadUpdate) AddKudoedUsers(u ...*User) *ThreadUpdate
AddKudoedUsers adds the "kudoed_users" edges to the User entity.
func (*ThreadUpdate) AddTagIDs ¶
func (tu *ThreadUpdate) AddTagIDs(ids ...int) *ThreadUpdate
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*ThreadUpdate) AddTags ¶
func (tu *ThreadUpdate) AddTags(t ...*Tag) *ThreadUpdate
AddTags adds the "tags" edges to the Tag entity.
func (*ThreadUpdate) AddThreadCommentIDs ¶
func (tu *ThreadUpdate) AddThreadCommentIDs(ids ...int) *ThreadUpdate
AddThreadCommentIDs adds the "thread_comments" edge to the Comment entity by IDs.
func (*ThreadUpdate) AddThreadComments ¶
func (tu *ThreadUpdate) AddThreadComments(c ...*Comment) *ThreadUpdate
AddThreadComments adds the "thread_comments" edges to the Comment entity.
func (*ThreadUpdate) ClearDescription ¶
func (tu *ThreadUpdate) ClearDescription() *ThreadUpdate
ClearDescription clears the value of the "description" field.
func (*ThreadUpdate) ClearKudoedUsers ¶
func (tu *ThreadUpdate) ClearKudoedUsers() *ThreadUpdate
ClearKudoedUsers clears all "kudoed_users" edges to the User entity.
func (*ThreadUpdate) ClearModifiedAt ¶
func (tu *ThreadUpdate) ClearModifiedAt() *ThreadUpdate
ClearModifiedAt clears the value of the "modified_at" field.
func (*ThreadUpdate) ClearTags ¶
func (tu *ThreadUpdate) ClearTags() *ThreadUpdate
ClearTags clears all "tags" edges to the Tag entity.
func (*ThreadUpdate) ClearThreadComments ¶
func (tu *ThreadUpdate) ClearThreadComments() *ThreadUpdate
ClearThreadComments clears all "thread_comments" edges to the Comment entity.
func (*ThreadUpdate) ClearTopics ¶
func (tu *ThreadUpdate) ClearTopics() *ThreadUpdate
ClearTopics clears the "topics" edge to the Topic entity.
func (*ThreadUpdate) Exec ¶
func (tu *ThreadUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ThreadUpdate) ExecX ¶
func (tu *ThreadUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ThreadUpdate) Mutation ¶
func (tu *ThreadUpdate) Mutation() *ThreadMutation
Mutation returns the ThreadMutation object of the builder.
func (*ThreadUpdate) RemoveKudoedUserIDs ¶
func (tu *ThreadUpdate) RemoveKudoedUserIDs(ids ...uuid.UUID) *ThreadUpdate
RemoveKudoedUserIDs removes the "kudoed_users" edge to User entities by IDs.
func (*ThreadUpdate) RemoveKudoedUsers ¶
func (tu *ThreadUpdate) RemoveKudoedUsers(u ...*User) *ThreadUpdate
RemoveKudoedUsers removes "kudoed_users" edges to User entities.
func (*ThreadUpdate) RemoveTagIDs ¶
func (tu *ThreadUpdate) RemoveTagIDs(ids ...int) *ThreadUpdate
RemoveTagIDs removes the "tags" edge to Tag entities by IDs.
func (*ThreadUpdate) RemoveTags ¶
func (tu *ThreadUpdate) RemoveTags(t ...*Tag) *ThreadUpdate
RemoveTags removes "tags" edges to Tag entities.
func (*ThreadUpdate) RemoveThreadCommentIDs ¶
func (tu *ThreadUpdate) RemoveThreadCommentIDs(ids ...int) *ThreadUpdate
RemoveThreadCommentIDs removes the "thread_comments" edge to Comment entities by IDs.
func (*ThreadUpdate) RemoveThreadComments ¶
func (tu *ThreadUpdate) RemoveThreadComments(c ...*Comment) *ThreadUpdate
RemoveThreadComments removes "thread_comments" edges to Comment entities.
func (*ThreadUpdate) Save ¶
func (tu *ThreadUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ThreadUpdate) SaveX ¶
func (tu *ThreadUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ThreadUpdate) SetDescription ¶
func (tu *ThreadUpdate) SetDescription(s string) *ThreadUpdate
SetDescription sets the "description" field.
func (*ThreadUpdate) SetModifiedAt ¶
func (tu *ThreadUpdate) SetModifiedAt(t time.Time) *ThreadUpdate
SetModifiedAt sets the "modified_at" field.
func (*ThreadUpdate) SetNillableDescription ¶
func (tu *ThreadUpdate) SetNillableDescription(s *string) *ThreadUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ThreadUpdate) SetNillableModifiedAt ¶
func (tu *ThreadUpdate) SetNillableModifiedAt(t *time.Time) *ThreadUpdate
SetNillableModifiedAt sets the "modified_at" field if the given value is not nil.
func (*ThreadUpdate) SetNillableSlug ¶
func (tu *ThreadUpdate) SetNillableSlug(s *string) *ThreadUpdate
SetNillableSlug sets the "slug" field if the given value is not nil.
func (*ThreadUpdate) SetNillableTitle ¶
func (tu *ThreadUpdate) SetNillableTitle(s *string) *ThreadUpdate
SetNillableTitle sets the "title" field if the given value is not nil.
func (*ThreadUpdate) SetSlug ¶
func (tu *ThreadUpdate) SetSlug(s string) *ThreadUpdate
SetSlug sets the "slug" field.
func (*ThreadUpdate) SetTitle ¶
func (tu *ThreadUpdate) SetTitle(s string) *ThreadUpdate
SetTitle sets the "title" field.
func (*ThreadUpdate) SetTopics ¶
func (tu *ThreadUpdate) SetTopics(t *Topic) *ThreadUpdate
SetTopics sets the "topics" edge to the Topic entity.
func (*ThreadUpdate) SetTopicsID ¶
func (tu *ThreadUpdate) SetTopicsID(id int) *ThreadUpdate
SetTopicsID sets the "topics" edge to the Topic entity by ID.
func (*ThreadUpdate) Where ¶
func (tu *ThreadUpdate) Where(ps ...predicate.Thread) *ThreadUpdate
Where appends a list predicates to the ThreadUpdate builder.
type ThreadUpdateOne ¶
type ThreadUpdateOne struct {
// contains filtered or unexported fields
}
ThreadUpdateOne is the builder for updating a single Thread entity.
func (*ThreadUpdateOne) AddKudoedUserIDs ¶
func (tuo *ThreadUpdateOne) AddKudoedUserIDs(ids ...uuid.UUID) *ThreadUpdateOne
AddKudoedUserIDs adds the "kudoed_users" edge to the User entity by IDs.
func (*ThreadUpdateOne) AddKudoedUsers ¶
func (tuo *ThreadUpdateOne) AddKudoedUsers(u ...*User) *ThreadUpdateOne
AddKudoedUsers adds the "kudoed_users" edges to the User entity.
func (*ThreadUpdateOne) AddTagIDs ¶
func (tuo *ThreadUpdateOne) AddTagIDs(ids ...int) *ThreadUpdateOne
AddTagIDs adds the "tags" edge to the Tag entity by IDs.
func (*ThreadUpdateOne) AddTags ¶
func (tuo *ThreadUpdateOne) AddTags(t ...*Tag) *ThreadUpdateOne
AddTags adds the "tags" edges to the Tag entity.
func (*ThreadUpdateOne) AddThreadCommentIDs ¶
func (tuo *ThreadUpdateOne) AddThreadCommentIDs(ids ...int) *ThreadUpdateOne
AddThreadCommentIDs adds the "thread_comments" edge to the Comment entity by IDs.
func (*ThreadUpdateOne) AddThreadComments ¶
func (tuo *ThreadUpdateOne) AddThreadComments(c ...*Comment) *ThreadUpdateOne
AddThreadComments adds the "thread_comments" edges to the Comment entity.
func (*ThreadUpdateOne) ClearDescription ¶
func (tuo *ThreadUpdateOne) ClearDescription() *ThreadUpdateOne
ClearDescription clears the value of the "description" field.
func (*ThreadUpdateOne) ClearKudoedUsers ¶
func (tuo *ThreadUpdateOne) ClearKudoedUsers() *ThreadUpdateOne
ClearKudoedUsers clears all "kudoed_users" edges to the User entity.
func (*ThreadUpdateOne) ClearModifiedAt ¶
func (tuo *ThreadUpdateOne) ClearModifiedAt() *ThreadUpdateOne
ClearModifiedAt clears the value of the "modified_at" field.
func (*ThreadUpdateOne) ClearTags ¶
func (tuo *ThreadUpdateOne) ClearTags() *ThreadUpdateOne
ClearTags clears all "tags" edges to the Tag entity.
func (*ThreadUpdateOne) ClearThreadComments ¶
func (tuo *ThreadUpdateOne) ClearThreadComments() *ThreadUpdateOne
ClearThreadComments clears all "thread_comments" edges to the Comment entity.
func (*ThreadUpdateOne) ClearTopics ¶
func (tuo *ThreadUpdateOne) ClearTopics() *ThreadUpdateOne
ClearTopics clears the "topics" edge to the Topic entity.
func (*ThreadUpdateOne) Exec ¶
func (tuo *ThreadUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ThreadUpdateOne) ExecX ¶
func (tuo *ThreadUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ThreadUpdateOne) Mutation ¶
func (tuo *ThreadUpdateOne) Mutation() *ThreadMutation
Mutation returns the ThreadMutation object of the builder.
func (*ThreadUpdateOne) RemoveKudoedUserIDs ¶
func (tuo *ThreadUpdateOne) RemoveKudoedUserIDs(ids ...uuid.UUID) *ThreadUpdateOne
RemoveKudoedUserIDs removes the "kudoed_users" edge to User entities by IDs.
func (*ThreadUpdateOne) RemoveKudoedUsers ¶
func (tuo *ThreadUpdateOne) RemoveKudoedUsers(u ...*User) *ThreadUpdateOne
RemoveKudoedUsers removes "kudoed_users" edges to User entities.
func (*ThreadUpdateOne) RemoveTagIDs ¶
func (tuo *ThreadUpdateOne) RemoveTagIDs(ids ...int) *ThreadUpdateOne
RemoveTagIDs removes the "tags" edge to Tag entities by IDs.
func (*ThreadUpdateOne) RemoveTags ¶
func (tuo *ThreadUpdateOne) RemoveTags(t ...*Tag) *ThreadUpdateOne
RemoveTags removes "tags" edges to Tag entities.
func (*ThreadUpdateOne) RemoveThreadCommentIDs ¶
func (tuo *ThreadUpdateOne) RemoveThreadCommentIDs(ids ...int) *ThreadUpdateOne
RemoveThreadCommentIDs removes the "thread_comments" edge to Comment entities by IDs.
func (*ThreadUpdateOne) RemoveThreadComments ¶
func (tuo *ThreadUpdateOne) RemoveThreadComments(c ...*Comment) *ThreadUpdateOne
RemoveThreadComments removes "thread_comments" edges to Comment entities.
func (*ThreadUpdateOne) Save ¶
func (tuo *ThreadUpdateOne) Save(ctx context.Context) (*Thread, error)
Save executes the query and returns the updated Thread entity.
func (*ThreadUpdateOne) SaveX ¶
func (tuo *ThreadUpdateOne) SaveX(ctx context.Context) *Thread
SaveX is like Save, but panics if an error occurs.
func (*ThreadUpdateOne) Select ¶
func (tuo *ThreadUpdateOne) Select(field string, fields ...string) *ThreadUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ThreadUpdateOne) SetDescription ¶
func (tuo *ThreadUpdateOne) SetDescription(s string) *ThreadUpdateOne
SetDescription sets the "description" field.
func (*ThreadUpdateOne) SetModifiedAt ¶
func (tuo *ThreadUpdateOne) SetModifiedAt(t time.Time) *ThreadUpdateOne
SetModifiedAt sets the "modified_at" field.
func (*ThreadUpdateOne) SetNillableDescription ¶
func (tuo *ThreadUpdateOne) SetNillableDescription(s *string) *ThreadUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ThreadUpdateOne) SetNillableModifiedAt ¶
func (tuo *ThreadUpdateOne) SetNillableModifiedAt(t *time.Time) *ThreadUpdateOne
SetNillableModifiedAt sets the "modified_at" field if the given value is not nil.
func (*ThreadUpdateOne) SetNillableSlug ¶
func (tuo *ThreadUpdateOne) SetNillableSlug(s *string) *ThreadUpdateOne
SetNillableSlug sets the "slug" field if the given value is not nil.
func (*ThreadUpdateOne) SetNillableTitle ¶
func (tuo *ThreadUpdateOne) SetNillableTitle(s *string) *ThreadUpdateOne
SetNillableTitle sets the "title" field if the given value is not nil.
func (*ThreadUpdateOne) SetSlug ¶
func (tuo *ThreadUpdateOne) SetSlug(s string) *ThreadUpdateOne
SetSlug sets the "slug" field.
func (*ThreadUpdateOne) SetTitle ¶
func (tuo *ThreadUpdateOne) SetTitle(s string) *ThreadUpdateOne
SetTitle sets the "title" field.
func (*ThreadUpdateOne) SetTopics ¶
func (tuo *ThreadUpdateOne) SetTopics(t *Topic) *ThreadUpdateOne
SetTopics sets the "topics" edge to the Topic entity.
func (*ThreadUpdateOne) SetTopicsID ¶
func (tuo *ThreadUpdateOne) SetTopicsID(id int) *ThreadUpdateOne
SetTopicsID sets the "topics" edge to the Topic entity by ID.
func (*ThreadUpdateOne) Where ¶
func (tuo *ThreadUpdateOne) Where(ps ...predicate.Thread) *ThreadUpdateOne
Where appends a list predicates to the ThreadUpdate builder.
type Topic ¶
type Topic struct { // ID of the ent. ID int `json:"id,omitempty"` // Title holds the value of the "title" field. Title string `json:"title,omitempty"` // Slug holds the value of the "slug" field. Slug string `json:"slug,omitempty"` // ShortDescription holds the value of the "short_description" field. ShortDescription string `json:"short_description,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // ProfilePicURL holds the value of the "profile_pic_url" field. ProfilePicURL string `json:"profile_pic_url,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TopicQuery when eager-loading is set. Edges TopicEdges `json:"edges"` // contains filtered or unexported fields }
Topic is the model entity for the Topic schema.
func (*Topic) QueryModerators ¶
func (t *Topic) QueryModerators() *ModeratorQuery
QueryModerators queries the "moderators" edge of the Topic entity.
func (*Topic) QueryTopicModerators ¶
QueryTopicModerators queries the "topic_moderators" edge of the Topic entity.
func (*Topic) QueryTopicThreads ¶
func (t *Topic) QueryTopicThreads() *ThreadQuery
QueryTopicThreads queries the "topic_threads" edge of the Topic entity.
func (*Topic) Unwrap ¶
Unwrap unwraps the Topic 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 (*Topic) Update ¶
func (t *Topic) Update() *TopicUpdateOne
Update returns a builder for updating this Topic. Note that you need to call Topic.Unwrap() before calling this method if this Topic was returned from a transaction, and the transaction was committed or rolled back.
type TopicClient ¶
type TopicClient struct {
// contains filtered or unexported fields
}
TopicClient is a client for the Topic schema.
func NewTopicClient ¶
func NewTopicClient(c config) *TopicClient
NewTopicClient returns a client for the Topic from the given config.
func (*TopicClient) Create ¶
func (c *TopicClient) Create() *TopicCreate
Create returns a builder for creating a Topic entity.
func (*TopicClient) CreateBulk ¶
func (c *TopicClient) CreateBulk(builders ...*TopicCreate) *TopicCreateBulk
CreateBulk returns a builder for creating a bulk of Topic entities.
func (*TopicClient) Delete ¶
func (c *TopicClient) Delete() *TopicDelete
Delete returns a delete builder for Topic.
func (*TopicClient) DeleteOne ¶
func (c *TopicClient) DeleteOne(t *Topic) *TopicDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TopicClient) DeleteOneID ¶
func (c *TopicClient) DeleteOneID(id int) *TopicDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TopicClient) GetX ¶
func (c *TopicClient) GetX(ctx context.Context, id int) *Topic
GetX is like Get, but panics if an error occurs.
func (*TopicClient) Intercept ¶
func (c *TopicClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `topic.Intercept(f(g(h())))`.
func (*TopicClient) Interceptors ¶
func (c *TopicClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TopicClient) MapCreateBulk ¶
func (c *TopicClient) MapCreateBulk(slice any, setFunc func(*TopicCreate, int)) *TopicCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*TopicClient) Query ¶
func (c *TopicClient) Query() *TopicQuery
Query returns a query builder for Topic.
func (*TopicClient) QueryModerators ¶
func (c *TopicClient) QueryModerators(t *Topic) *ModeratorQuery
QueryModerators queries the moderators edge of a Topic.
func (*TopicClient) QueryTopicModerators ¶
func (c *TopicClient) QueryTopicModerators(t *Topic) *UserQuery
QueryTopicModerators queries the topic_moderators edge of a Topic.
func (*TopicClient) QueryTopicThreads ¶
func (c *TopicClient) QueryTopicThreads(t *Topic) *ThreadQuery
QueryTopicThreads queries the topic_threads edge of a Topic.
func (*TopicClient) Update ¶
func (c *TopicClient) Update() *TopicUpdate
Update returns an update builder for Topic.
func (*TopicClient) UpdateOne ¶
func (c *TopicClient) UpdateOne(t *Topic) *TopicUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TopicClient) UpdateOneID ¶
func (c *TopicClient) UpdateOneID(id int) *TopicUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TopicClient) Use ¶
func (c *TopicClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `topic.Hooks(f(g(h())))`.
type TopicCreate ¶
type TopicCreate struct {
// contains filtered or unexported fields
}
TopicCreate is the builder for creating a Topic entity.
func (*TopicCreate) AddTopicModeratorIDs ¶
func (tc *TopicCreate) AddTopicModeratorIDs(ids ...uuid.UUID) *TopicCreate
AddTopicModeratorIDs adds the "topic_moderators" edge to the User entity by IDs.
func (*TopicCreate) AddTopicModerators ¶
func (tc *TopicCreate) AddTopicModerators(u ...*User) *TopicCreate
AddTopicModerators adds the "topic_moderators" edges to the User entity.
func (*TopicCreate) AddTopicThreadIDs ¶
func (tc *TopicCreate) AddTopicThreadIDs(ids ...int) *TopicCreate
AddTopicThreadIDs adds the "topic_threads" edge to the Thread entity by IDs.
func (*TopicCreate) AddTopicThreads ¶
func (tc *TopicCreate) AddTopicThreads(t ...*Thread) *TopicCreate
AddTopicThreads adds the "topic_threads" edges to the Thread entity.
func (*TopicCreate) Exec ¶
func (tc *TopicCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TopicCreate) ExecX ¶
func (tc *TopicCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TopicCreate) Mutation ¶
func (tc *TopicCreate) Mutation() *TopicMutation
Mutation returns the TopicMutation object of the builder.
func (*TopicCreate) Save ¶
func (tc *TopicCreate) Save(ctx context.Context) (*Topic, error)
Save creates the Topic in the database.
func (*TopicCreate) SaveX ¶
func (tc *TopicCreate) SaveX(ctx context.Context) *Topic
SaveX calls Save and panics if Save returns an error.
func (*TopicCreate) SetCreatedAt ¶
func (tc *TopicCreate) SetCreatedAt(t time.Time) *TopicCreate
SetCreatedAt sets the "created_at" field.
func (*TopicCreate) SetDescription ¶
func (tc *TopicCreate) SetDescription(s string) *TopicCreate
SetDescription sets the "description" field.
func (*TopicCreate) SetNillableCreatedAt ¶
func (tc *TopicCreate) SetNillableCreatedAt(t *time.Time) *TopicCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*TopicCreate) SetNillableDescription ¶
func (tc *TopicCreate) SetNillableDescription(s *string) *TopicCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*TopicCreate) SetNillableProfilePicURL ¶
func (tc *TopicCreate) SetNillableProfilePicURL(s *string) *TopicCreate
SetNillableProfilePicURL sets the "profile_pic_url" field if the given value is not nil.
func (*TopicCreate) SetProfilePicURL ¶
func (tc *TopicCreate) SetProfilePicURL(s string) *TopicCreate
SetProfilePicURL sets the "profile_pic_url" field.
func (*TopicCreate) SetShortDescription ¶
func (tc *TopicCreate) SetShortDescription(s string) *TopicCreate
SetShortDescription sets the "short_description" field.
func (*TopicCreate) SetSlug ¶
func (tc *TopicCreate) SetSlug(s string) *TopicCreate
SetSlug sets the "slug" field.
func (*TopicCreate) SetTitle ¶
func (tc *TopicCreate) SetTitle(s string) *TopicCreate
SetTitle sets the "title" field.
type TopicCreateBulk ¶
type TopicCreateBulk struct {
// contains filtered or unexported fields
}
TopicCreateBulk is the builder for creating many Topic entities in bulk.
func (*TopicCreateBulk) Exec ¶
func (tcb *TopicCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TopicCreateBulk) ExecX ¶
func (tcb *TopicCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TopicDelete ¶
type TopicDelete struct {
// contains filtered or unexported fields
}
TopicDelete is the builder for deleting a Topic entity.
func (*TopicDelete) Exec ¶
func (td *TopicDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TopicDelete) ExecX ¶
func (td *TopicDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TopicDelete) Where ¶
func (td *TopicDelete) Where(ps ...predicate.Topic) *TopicDelete
Where appends a list predicates to the TopicDelete builder.
type TopicDeleteOne ¶
type TopicDeleteOne struct {
// contains filtered or unexported fields
}
TopicDeleteOne is the builder for deleting a single Topic entity.
func (*TopicDeleteOne) Exec ¶
func (tdo *TopicDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TopicDeleteOne) ExecX ¶
func (tdo *TopicDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TopicDeleteOne) Where ¶
func (tdo *TopicDeleteOne) Where(ps ...predicate.Topic) *TopicDeleteOne
Where appends a list predicates to the TopicDelete builder.
type TopicEdges ¶
type TopicEdges struct { // TopicThreads holds the value of the topic_threads edge. TopicThreads []*Thread `json:"topic_threads,omitempty"` // TopicModerators holds the value of the topic_moderators edge. TopicModerators []*User `json:"topic_moderators,omitempty"` // Moderators holds the value of the moderators edge. Moderators []*Moderator `json:"moderators,omitempty"` // contains filtered or unexported fields }
TopicEdges holds the relations/edges for other nodes in the graph.
func (TopicEdges) ModeratorsOrErr ¶
func (e TopicEdges) ModeratorsOrErr() ([]*Moderator, error)
ModeratorsOrErr returns the Moderators value or an error if the edge was not loaded in eager-loading.
func (TopicEdges) TopicModeratorsOrErr ¶
func (e TopicEdges) TopicModeratorsOrErr() ([]*User, error)
TopicModeratorsOrErr returns the TopicModerators value or an error if the edge was not loaded in eager-loading.
func (TopicEdges) TopicThreadsOrErr ¶
func (e TopicEdges) TopicThreadsOrErr() ([]*Thread, error)
TopicThreadsOrErr returns the TopicThreads value or an error if the edge was not loaded in eager-loading.
type TopicGroupBy ¶
type TopicGroupBy struct {
// contains filtered or unexported fields
}
TopicGroupBy is the group-by builder for Topic entities.
func (*TopicGroupBy) Aggregate ¶
func (tgb *TopicGroupBy) Aggregate(fns ...AggregateFunc) *TopicGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TopicGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TopicGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TopicGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TopicGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TopicGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TopicGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TopicGroupBy) Scan ¶
func (tgb *TopicGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TopicGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TopicMutation ¶
type TopicMutation struct {
// contains filtered or unexported fields
}
TopicMutation represents an operation that mutates the Topic nodes in the graph.
func (*TopicMutation) AddField ¶
func (m *TopicMutation) 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 (*TopicMutation) AddTopicModeratorIDs ¶
func (m *TopicMutation) AddTopicModeratorIDs(ids ...uuid.UUID)
AddTopicModeratorIDs adds the "topic_moderators" edge to the User entity by ids.
func (*TopicMutation) AddTopicThreadIDs ¶
func (m *TopicMutation) AddTopicThreadIDs(ids ...int)
AddTopicThreadIDs adds the "topic_threads" edge to the Thread entity by ids.
func (*TopicMutation) AddedEdges ¶
func (m *TopicMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TopicMutation) AddedField ¶
func (m *TopicMutation) 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 (*TopicMutation) AddedFields ¶
func (m *TopicMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TopicMutation) AddedIDs ¶
func (m *TopicMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TopicMutation) ClearDescription ¶
func (m *TopicMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*TopicMutation) ClearEdge ¶
func (m *TopicMutation) 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 (*TopicMutation) ClearField ¶
func (m *TopicMutation) 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 (*TopicMutation) ClearProfilePicURL ¶
func (m *TopicMutation) ClearProfilePicURL()
ClearProfilePicURL clears the value of the "profile_pic_url" field.
func (*TopicMutation) ClearTopicModerators ¶
func (m *TopicMutation) ClearTopicModerators()
ClearTopicModerators clears the "topic_moderators" edge to the User entity.
func (*TopicMutation) ClearTopicThreads ¶
func (m *TopicMutation) ClearTopicThreads()
ClearTopicThreads clears the "topic_threads" edge to the Thread entity.
func (*TopicMutation) ClearedEdges ¶
func (m *TopicMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TopicMutation) ClearedFields ¶
func (m *TopicMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TopicMutation) Client ¶
func (m TopicMutation) 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 (*TopicMutation) CreatedAt ¶
func (m *TopicMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*TopicMutation) Description ¶
func (m *TopicMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*TopicMutation) DescriptionCleared ¶
func (m *TopicMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*TopicMutation) EdgeCleared ¶
func (m *TopicMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TopicMutation) Field ¶
func (m *TopicMutation) 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 (*TopicMutation) FieldCleared ¶
func (m *TopicMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TopicMutation) Fields ¶
func (m *TopicMutation) 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 (*TopicMutation) ID ¶
func (m *TopicMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*TopicMutation) IDs ¶
func (m *TopicMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*TopicMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Topic entity. If the Topic 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 (*TopicMutation) OldDescription ¶
func (m *TopicMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Topic entity. If the Topic 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 (*TopicMutation) 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 (*TopicMutation) OldProfilePicURL ¶
func (m *TopicMutation) OldProfilePicURL(ctx context.Context) (v string, err error)
OldProfilePicURL returns the old "profile_pic_url" field's value of the Topic entity. If the Topic 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 (*TopicMutation) OldShortDescription ¶
func (m *TopicMutation) OldShortDescription(ctx context.Context) (v string, err error)
OldShortDescription returns the old "short_description" field's value of the Topic entity. If the Topic 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 (*TopicMutation) OldSlug ¶
func (m *TopicMutation) OldSlug(ctx context.Context) (v string, err error)
OldSlug returns the old "slug" field's value of the Topic entity. If the Topic 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 (*TopicMutation) OldTitle ¶
func (m *TopicMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the Topic entity. If the Topic 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 (*TopicMutation) ProfilePicURL ¶
func (m *TopicMutation) ProfilePicURL() (r string, exists bool)
ProfilePicURL returns the value of the "profile_pic_url" field in the mutation.
func (*TopicMutation) ProfilePicURLCleared ¶
func (m *TopicMutation) ProfilePicURLCleared() bool
ProfilePicURLCleared returns if the "profile_pic_url" field was cleared in this mutation.
func (*TopicMutation) RemoveTopicModeratorIDs ¶
func (m *TopicMutation) RemoveTopicModeratorIDs(ids ...uuid.UUID)
RemoveTopicModeratorIDs removes the "topic_moderators" edge to the User entity by IDs.
func (*TopicMutation) RemoveTopicThreadIDs ¶
func (m *TopicMutation) RemoveTopicThreadIDs(ids ...int)
RemoveTopicThreadIDs removes the "topic_threads" edge to the Thread entity by IDs.
func (*TopicMutation) RemovedEdges ¶
func (m *TopicMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TopicMutation) RemovedIDs ¶
func (m *TopicMutation) 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 (*TopicMutation) RemovedTopicModeratorsIDs ¶
func (m *TopicMutation) RemovedTopicModeratorsIDs() (ids []uuid.UUID)
RemovedTopicModerators returns the removed IDs of the "topic_moderators" edge to the User entity.
func (*TopicMutation) RemovedTopicThreadsIDs ¶
func (m *TopicMutation) RemovedTopicThreadsIDs() (ids []int)
RemovedTopicThreads returns the removed IDs of the "topic_threads" edge to the Thread entity.
func (*TopicMutation) ResetCreatedAt ¶
func (m *TopicMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*TopicMutation) ResetDescription ¶
func (m *TopicMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*TopicMutation) ResetEdge ¶
func (m *TopicMutation) 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 (*TopicMutation) ResetField ¶
func (m *TopicMutation) 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 (*TopicMutation) ResetProfilePicURL ¶
func (m *TopicMutation) ResetProfilePicURL()
ResetProfilePicURL resets all changes to the "profile_pic_url" field.
func (*TopicMutation) ResetShortDescription ¶
func (m *TopicMutation) ResetShortDescription()
ResetShortDescription resets all changes to the "short_description" field.
func (*TopicMutation) ResetSlug ¶
func (m *TopicMutation) ResetSlug()
ResetSlug resets all changes to the "slug" field.
func (*TopicMutation) ResetTitle ¶
func (m *TopicMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*TopicMutation) ResetTopicModerators ¶
func (m *TopicMutation) ResetTopicModerators()
ResetTopicModerators resets all changes to the "topic_moderators" edge.
func (*TopicMutation) ResetTopicThreads ¶
func (m *TopicMutation) ResetTopicThreads()
ResetTopicThreads resets all changes to the "topic_threads" edge.
func (*TopicMutation) SetCreatedAt ¶
func (m *TopicMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*TopicMutation) SetDescription ¶
func (m *TopicMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*TopicMutation) SetField ¶
func (m *TopicMutation) 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 (*TopicMutation) SetOp ¶
func (m *TopicMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TopicMutation) SetProfilePicURL ¶
func (m *TopicMutation) SetProfilePicURL(s string)
SetProfilePicURL sets the "profile_pic_url" field.
func (*TopicMutation) SetShortDescription ¶
func (m *TopicMutation) SetShortDescription(s string)
SetShortDescription sets the "short_description" field.
func (*TopicMutation) SetSlug ¶
func (m *TopicMutation) SetSlug(s string)
SetSlug sets the "slug" field.
func (*TopicMutation) SetTitle ¶
func (m *TopicMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*TopicMutation) ShortDescription ¶
func (m *TopicMutation) ShortDescription() (r string, exists bool)
ShortDescription returns the value of the "short_description" field in the mutation.
func (*TopicMutation) Slug ¶
func (m *TopicMutation) Slug() (r string, exists bool)
Slug returns the value of the "slug" field in the mutation.
func (*TopicMutation) Title ¶
func (m *TopicMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (*TopicMutation) TopicModeratorsCleared ¶
func (m *TopicMutation) TopicModeratorsCleared() bool
TopicModeratorsCleared reports if the "topic_moderators" edge to the User entity was cleared.
func (*TopicMutation) TopicModeratorsIDs ¶
func (m *TopicMutation) TopicModeratorsIDs() (ids []uuid.UUID)
TopicModeratorsIDs returns the "topic_moderators" edge IDs in the mutation.
func (*TopicMutation) TopicThreadsCleared ¶
func (m *TopicMutation) TopicThreadsCleared() bool
TopicThreadsCleared reports if the "topic_threads" edge to the Thread entity was cleared.
func (*TopicMutation) TopicThreadsIDs ¶
func (m *TopicMutation) TopicThreadsIDs() (ids []int)
TopicThreadsIDs returns the "topic_threads" edge IDs in the mutation.
func (TopicMutation) Tx ¶
func (m TopicMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TopicMutation) Type ¶
func (m *TopicMutation) Type() string
Type returns the node type of this mutation (Topic).
func (*TopicMutation) Where ¶
func (m *TopicMutation) Where(ps ...predicate.Topic)
Where appends a list predicates to the TopicMutation builder.
func (*TopicMutation) WhereP ¶
func (m *TopicMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TopicMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TopicQuery ¶
type TopicQuery struct {
// contains filtered or unexported fields
}
TopicQuery is the builder for querying Topic entities.
func (*TopicQuery) Aggregate ¶
func (tq *TopicQuery) Aggregate(fns ...AggregateFunc) *TopicSelect
Aggregate returns a TopicSelect configured with the given aggregations.
func (*TopicQuery) All ¶
func (tq *TopicQuery) All(ctx context.Context) ([]*Topic, error)
All executes the query and returns a list of Topics.
func (*TopicQuery) AllX ¶
func (tq *TopicQuery) AllX(ctx context.Context) []*Topic
AllX is like All, but panics if an error occurs.
func (*TopicQuery) Clone ¶
func (tq *TopicQuery) Clone() *TopicQuery
Clone returns a duplicate of the TopicQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TopicQuery) Count ¶
func (tq *TopicQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TopicQuery) CountX ¶
func (tq *TopicQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TopicQuery) Exist ¶
func (tq *TopicQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TopicQuery) ExistX ¶
func (tq *TopicQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TopicQuery) First ¶
func (tq *TopicQuery) First(ctx context.Context) (*Topic, error)
First returns the first Topic entity from the query. Returns a *NotFoundError when no Topic was found.
func (*TopicQuery) FirstID ¶
func (tq *TopicQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Topic ID from the query. Returns a *NotFoundError when no Topic ID was found.
func (*TopicQuery) FirstIDX ¶
func (tq *TopicQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*TopicQuery) FirstX ¶
func (tq *TopicQuery) FirstX(ctx context.Context) *Topic
FirstX is like First, but panics if an error occurs.
func (*TopicQuery) GroupBy ¶
func (tq *TopicQuery) GroupBy(field string, fields ...string) *TopicGroupBy
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.Topic.Query(). GroupBy(topic.FieldTitle). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TopicQuery) IDs ¶
func (tq *TopicQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Topic IDs.
func (*TopicQuery) IDsX ¶
func (tq *TopicQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*TopicQuery) Limit ¶
func (tq *TopicQuery) Limit(limit int) *TopicQuery
Limit the number of records to be returned by this query.
func (*TopicQuery) Offset ¶
func (tq *TopicQuery) Offset(offset int) *TopicQuery
Offset to start from.
func (*TopicQuery) Only ¶
func (tq *TopicQuery) Only(ctx context.Context) (*Topic, error)
Only returns a single Topic entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Topic entity is found. Returns a *NotFoundError when no Topic entities are found.
func (*TopicQuery) OnlyID ¶
func (tq *TopicQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Topic ID in the query. Returns a *NotSingularError when more than one Topic ID is found. Returns a *NotFoundError when no entities are found.
func (*TopicQuery) OnlyIDX ¶
func (tq *TopicQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TopicQuery) OnlyX ¶
func (tq *TopicQuery) OnlyX(ctx context.Context) *Topic
OnlyX is like Only, but panics if an error occurs.
func (*TopicQuery) Order ¶
func (tq *TopicQuery) Order(o ...topic.OrderOption) *TopicQuery
Order specifies how the records should be ordered.
func (*TopicQuery) QueryModerators ¶
func (tq *TopicQuery) QueryModerators() *ModeratorQuery
QueryModerators chains the current query on the "moderators" edge.
func (*TopicQuery) QueryTopicModerators ¶
func (tq *TopicQuery) QueryTopicModerators() *UserQuery
QueryTopicModerators chains the current query on the "topic_moderators" edge.
func (*TopicQuery) QueryTopicThreads ¶
func (tq *TopicQuery) QueryTopicThreads() *ThreadQuery
QueryTopicThreads chains the current query on the "topic_threads" edge.
func (*TopicQuery) Select ¶
func (tq *TopicQuery) Select(fields ...string) *TopicSelect
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.Topic.Query(). Select(topic.FieldTitle). Scan(ctx, &v)
func (*TopicQuery) Unique ¶
func (tq *TopicQuery) Unique(unique bool) *TopicQuery
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 (*TopicQuery) Where ¶
func (tq *TopicQuery) Where(ps ...predicate.Topic) *TopicQuery
Where adds a new predicate for the TopicQuery builder.
func (*TopicQuery) WithModerators ¶
func (tq *TopicQuery) WithModerators(opts ...func(*ModeratorQuery)) *TopicQuery
WithModerators tells the query-builder to eager-load the nodes that are connected to the "moderators" edge. The optional arguments are used to configure the query builder of the edge.
func (*TopicQuery) WithTopicModerators ¶
func (tq *TopicQuery) WithTopicModerators(opts ...func(*UserQuery)) *TopicQuery
WithTopicModerators tells the query-builder to eager-load the nodes that are connected to the "topic_moderators" edge. The optional arguments are used to configure the query builder of the edge.
func (*TopicQuery) WithTopicThreads ¶
func (tq *TopicQuery) WithTopicThreads(opts ...func(*ThreadQuery)) *TopicQuery
WithTopicThreads tells the query-builder to eager-load the nodes that are connected to the "topic_threads" edge. The optional arguments are used to configure the query builder of the edge.
type TopicSelect ¶
type TopicSelect struct { *TopicQuery // contains filtered or unexported fields }
TopicSelect is the builder for selecting fields of Topic entities.
func (*TopicSelect) Aggregate ¶
func (ts *TopicSelect) Aggregate(fns ...AggregateFunc) *TopicSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TopicSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TopicSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TopicSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TopicSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TopicSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TopicSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TopicSelect) Scan ¶
func (ts *TopicSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TopicSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TopicUpdate ¶
type TopicUpdate struct {
// contains filtered or unexported fields
}
TopicUpdate is the builder for updating Topic entities.
func (*TopicUpdate) AddTopicModeratorIDs ¶
func (tu *TopicUpdate) AddTopicModeratorIDs(ids ...uuid.UUID) *TopicUpdate
AddTopicModeratorIDs adds the "topic_moderators" edge to the User entity by IDs.
func (*TopicUpdate) AddTopicModerators ¶
func (tu *TopicUpdate) AddTopicModerators(u ...*User) *TopicUpdate
AddTopicModerators adds the "topic_moderators" edges to the User entity.
func (*TopicUpdate) AddTopicThreadIDs ¶
func (tu *TopicUpdate) AddTopicThreadIDs(ids ...int) *TopicUpdate
AddTopicThreadIDs adds the "topic_threads" edge to the Thread entity by IDs.
func (*TopicUpdate) AddTopicThreads ¶
func (tu *TopicUpdate) AddTopicThreads(t ...*Thread) *TopicUpdate
AddTopicThreads adds the "topic_threads" edges to the Thread entity.
func (*TopicUpdate) ClearDescription ¶
func (tu *TopicUpdate) ClearDescription() *TopicUpdate
ClearDescription clears the value of the "description" field.
func (*TopicUpdate) ClearProfilePicURL ¶
func (tu *TopicUpdate) ClearProfilePicURL() *TopicUpdate
ClearProfilePicURL clears the value of the "profile_pic_url" field.
func (*TopicUpdate) ClearTopicModerators ¶
func (tu *TopicUpdate) ClearTopicModerators() *TopicUpdate
ClearTopicModerators clears all "topic_moderators" edges to the User entity.
func (*TopicUpdate) ClearTopicThreads ¶
func (tu *TopicUpdate) ClearTopicThreads() *TopicUpdate
ClearTopicThreads clears all "topic_threads" edges to the Thread entity.
func (*TopicUpdate) Exec ¶
func (tu *TopicUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TopicUpdate) ExecX ¶
func (tu *TopicUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TopicUpdate) Mutation ¶
func (tu *TopicUpdate) Mutation() *TopicMutation
Mutation returns the TopicMutation object of the builder.
func (*TopicUpdate) RemoveTopicModeratorIDs ¶
func (tu *TopicUpdate) RemoveTopicModeratorIDs(ids ...uuid.UUID) *TopicUpdate
RemoveTopicModeratorIDs removes the "topic_moderators" edge to User entities by IDs.
func (*TopicUpdate) RemoveTopicModerators ¶
func (tu *TopicUpdate) RemoveTopicModerators(u ...*User) *TopicUpdate
RemoveTopicModerators removes "topic_moderators" edges to User entities.
func (*TopicUpdate) RemoveTopicThreadIDs ¶
func (tu *TopicUpdate) RemoveTopicThreadIDs(ids ...int) *TopicUpdate
RemoveTopicThreadIDs removes the "topic_threads" edge to Thread entities by IDs.
func (*TopicUpdate) RemoveTopicThreads ¶
func (tu *TopicUpdate) RemoveTopicThreads(t ...*Thread) *TopicUpdate
RemoveTopicThreads removes "topic_threads" edges to Thread entities.
func (*TopicUpdate) Save ¶
func (tu *TopicUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TopicUpdate) SaveX ¶
func (tu *TopicUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TopicUpdate) SetDescription ¶
func (tu *TopicUpdate) SetDescription(s string) *TopicUpdate
SetDescription sets the "description" field.
func (*TopicUpdate) SetNillableDescription ¶
func (tu *TopicUpdate) SetNillableDescription(s *string) *TopicUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*TopicUpdate) SetNillableProfilePicURL ¶
func (tu *TopicUpdate) SetNillableProfilePicURL(s *string) *TopicUpdate
SetNillableProfilePicURL sets the "profile_pic_url" field if the given value is not nil.
func (*TopicUpdate) SetNillableShortDescription ¶
func (tu *TopicUpdate) SetNillableShortDescription(s *string) *TopicUpdate
SetNillableShortDescription sets the "short_description" field if the given value is not nil.
func (*TopicUpdate) SetNillableSlug ¶
func (tu *TopicUpdate) SetNillableSlug(s *string) *TopicUpdate
SetNillableSlug sets the "slug" field if the given value is not nil.
func (*TopicUpdate) SetNillableTitle ¶
func (tu *TopicUpdate) SetNillableTitle(s *string) *TopicUpdate
SetNillableTitle sets the "title" field if the given value is not nil.
func (*TopicUpdate) SetProfilePicURL ¶
func (tu *TopicUpdate) SetProfilePicURL(s string) *TopicUpdate
SetProfilePicURL sets the "profile_pic_url" field.
func (*TopicUpdate) SetShortDescription ¶
func (tu *TopicUpdate) SetShortDescription(s string) *TopicUpdate
SetShortDescription sets the "short_description" field.
func (*TopicUpdate) SetSlug ¶
func (tu *TopicUpdate) SetSlug(s string) *TopicUpdate
SetSlug sets the "slug" field.
func (*TopicUpdate) SetTitle ¶
func (tu *TopicUpdate) SetTitle(s string) *TopicUpdate
SetTitle sets the "title" field.
func (*TopicUpdate) Where ¶
func (tu *TopicUpdate) Where(ps ...predicate.Topic) *TopicUpdate
Where appends a list predicates to the TopicUpdate builder.
type TopicUpdateOne ¶
type TopicUpdateOne struct {
// contains filtered or unexported fields
}
TopicUpdateOne is the builder for updating a single Topic entity.
func (*TopicUpdateOne) AddTopicModeratorIDs ¶
func (tuo *TopicUpdateOne) AddTopicModeratorIDs(ids ...uuid.UUID) *TopicUpdateOne
AddTopicModeratorIDs adds the "topic_moderators" edge to the User entity by IDs.
func (*TopicUpdateOne) AddTopicModerators ¶
func (tuo *TopicUpdateOne) AddTopicModerators(u ...*User) *TopicUpdateOne
AddTopicModerators adds the "topic_moderators" edges to the User entity.
func (*TopicUpdateOne) AddTopicThreadIDs ¶
func (tuo *TopicUpdateOne) AddTopicThreadIDs(ids ...int) *TopicUpdateOne
AddTopicThreadIDs adds the "topic_threads" edge to the Thread entity by IDs.
func (*TopicUpdateOne) AddTopicThreads ¶
func (tuo *TopicUpdateOne) AddTopicThreads(t ...*Thread) *TopicUpdateOne
AddTopicThreads adds the "topic_threads" edges to the Thread entity.
func (*TopicUpdateOne) ClearDescription ¶
func (tuo *TopicUpdateOne) ClearDescription() *TopicUpdateOne
ClearDescription clears the value of the "description" field.
func (*TopicUpdateOne) ClearProfilePicURL ¶
func (tuo *TopicUpdateOne) ClearProfilePicURL() *TopicUpdateOne
ClearProfilePicURL clears the value of the "profile_pic_url" field.
func (*TopicUpdateOne) ClearTopicModerators ¶
func (tuo *TopicUpdateOne) ClearTopicModerators() *TopicUpdateOne
ClearTopicModerators clears all "topic_moderators" edges to the User entity.
func (*TopicUpdateOne) ClearTopicThreads ¶
func (tuo *TopicUpdateOne) ClearTopicThreads() *TopicUpdateOne
ClearTopicThreads clears all "topic_threads" edges to the Thread entity.
func (*TopicUpdateOne) Exec ¶
func (tuo *TopicUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TopicUpdateOne) ExecX ¶
func (tuo *TopicUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TopicUpdateOne) Mutation ¶
func (tuo *TopicUpdateOne) Mutation() *TopicMutation
Mutation returns the TopicMutation object of the builder.
func (*TopicUpdateOne) RemoveTopicModeratorIDs ¶
func (tuo *TopicUpdateOne) RemoveTopicModeratorIDs(ids ...uuid.UUID) *TopicUpdateOne
RemoveTopicModeratorIDs removes the "topic_moderators" edge to User entities by IDs.
func (*TopicUpdateOne) RemoveTopicModerators ¶
func (tuo *TopicUpdateOne) RemoveTopicModerators(u ...*User) *TopicUpdateOne
RemoveTopicModerators removes "topic_moderators" edges to User entities.
func (*TopicUpdateOne) RemoveTopicThreadIDs ¶
func (tuo *TopicUpdateOne) RemoveTopicThreadIDs(ids ...int) *TopicUpdateOne
RemoveTopicThreadIDs removes the "topic_threads" edge to Thread entities by IDs.
func (*TopicUpdateOne) RemoveTopicThreads ¶
func (tuo *TopicUpdateOne) RemoveTopicThreads(t ...*Thread) *TopicUpdateOne
RemoveTopicThreads removes "topic_threads" edges to Thread entities.
func (*TopicUpdateOne) Save ¶
func (tuo *TopicUpdateOne) Save(ctx context.Context) (*Topic, error)
Save executes the query and returns the updated Topic entity.
func (*TopicUpdateOne) SaveX ¶
func (tuo *TopicUpdateOne) SaveX(ctx context.Context) *Topic
SaveX is like Save, but panics if an error occurs.
func (*TopicUpdateOne) Select ¶
func (tuo *TopicUpdateOne) Select(field string, fields ...string) *TopicUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TopicUpdateOne) SetDescription ¶
func (tuo *TopicUpdateOne) SetDescription(s string) *TopicUpdateOne
SetDescription sets the "description" field.
func (*TopicUpdateOne) SetNillableDescription ¶
func (tuo *TopicUpdateOne) SetNillableDescription(s *string) *TopicUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*TopicUpdateOne) SetNillableProfilePicURL ¶
func (tuo *TopicUpdateOne) SetNillableProfilePicURL(s *string) *TopicUpdateOne
SetNillableProfilePicURL sets the "profile_pic_url" field if the given value is not nil.
func (*TopicUpdateOne) SetNillableShortDescription ¶
func (tuo *TopicUpdateOne) SetNillableShortDescription(s *string) *TopicUpdateOne
SetNillableShortDescription sets the "short_description" field if the given value is not nil.
func (*TopicUpdateOne) SetNillableSlug ¶
func (tuo *TopicUpdateOne) SetNillableSlug(s *string) *TopicUpdateOne
SetNillableSlug sets the "slug" field if the given value is not nil.
func (*TopicUpdateOne) SetNillableTitle ¶
func (tuo *TopicUpdateOne) SetNillableTitle(s *string) *TopicUpdateOne
SetNillableTitle sets the "title" field if the given value is not nil.
func (*TopicUpdateOne) SetProfilePicURL ¶
func (tuo *TopicUpdateOne) SetProfilePicURL(s string) *TopicUpdateOne
SetProfilePicURL sets the "profile_pic_url" field.
func (*TopicUpdateOne) SetShortDescription ¶
func (tuo *TopicUpdateOne) SetShortDescription(s string) *TopicUpdateOne
SetShortDescription sets the "short_description" field.
func (*TopicUpdateOne) SetSlug ¶
func (tuo *TopicUpdateOne) SetSlug(s string) *TopicUpdateOne
SetSlug sets the "slug" field.
func (*TopicUpdateOne) SetTitle ¶
func (tuo *TopicUpdateOne) SetTitle(s string) *TopicUpdateOne
SetTitle sets the "title" field.
func (*TopicUpdateOne) Where ¶
func (tuo *TopicUpdateOne) Where(ps ...predicate.Topic) *TopicUpdateOne
Where appends a list predicates to the TopicUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Comment is the client for interacting with the Comment builders. Comment *CommentClient // CommentKudo is the client for interacting with the CommentKudo builders. CommentKudo *CommentKudoClient // Moderator is the client for interacting with the Moderator builders. Moderator *ModeratorClient // Tag is the client for interacting with the Tag builders. Tag *TagClient // Thread is the client for interacting with the Thread builders. Thread *ThreadClient // ThreadKudo is the client for interacting with the ThreadKudo builders. ThreadKudo *ThreadKudoClient // Topic is the client for interacting with the Topic builders. Topic *TopicClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Email holds the value of the "email" field. Email string `json:"email,omitempty"` // Username holds the value of the "username" field. Username string `json:"username,omitempty"` // FirstName holds the value of the "first_name" field. FirstName string `json:"first_name,omitempty"` // LastName holds the value of the "last_name" field. LastName string `json:"last_name,omitempty"` // Hash holds the value of the "hash" field. Hash []byte `json:"-"` // EmailVerified holds the value of the "email_verified" field. EmailVerified bool `json:"email_verified,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_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) QueryCommentKudoes ¶
func (u *User) QueryCommentKudoes() *CommentKudoQuery
QueryCommentKudoes queries the "comment_kudoes" edge of the User entity.
func (*User) QueryKudoedComments ¶
func (u *User) QueryKudoedComments() *CommentQuery
QueryKudoedComments queries the "kudoed_comments" edge of the User entity.
func (*User) QueryKudoedThreads ¶
func (u *User) QueryKudoedThreads() *ThreadQuery
QueryKudoedThreads queries the "kudoed_threads" edge of the User entity.
func (*User) QueryModeratedTopics ¶
func (u *User) QueryModeratedTopics() *TopicQuery
QueryModeratedTopics queries the "moderated_topics" edge of the User entity.
func (*User) QueryModerators ¶
func (u *User) QueryModerators() *ModeratorQuery
QueryModerators queries the "moderators" edge of the User entity.
func (*User) QueryThreadKudoes ¶
func (u *User) QueryThreadKudoes() *ThreadKudoQuery
QueryThreadKudoes queries the "thread_kudoes" edge of the User entity.
func (*User) QueryUserComments ¶
func (u *User) QueryUserComments() *CommentQuery
QueryUserComments queries the "user_comments" edge of the User entity.
func (*User) QueryUserThreads ¶
func (u *User) QueryUserThreads() *ThreadQuery
QueryUserThreads queries the "user_threads" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryCommentKudoes ¶
func (c *UserClient) QueryCommentKudoes(u *User) *CommentKudoQuery
QueryCommentKudoes queries the comment_kudoes edge of a User.
func (*UserClient) QueryKudoedComments ¶
func (c *UserClient) QueryKudoedComments(u *User) *CommentQuery
QueryKudoedComments queries the kudoed_comments edge of a User.
func (*UserClient) QueryKudoedThreads ¶
func (c *UserClient) QueryKudoedThreads(u *User) *ThreadQuery
QueryKudoedThreads queries the kudoed_threads edge of a User.
func (*UserClient) QueryModeratedTopics ¶
func (c *UserClient) QueryModeratedTopics(u *User) *TopicQuery
QueryModeratedTopics queries the moderated_topics edge of a User.
func (*UserClient) QueryModerators ¶
func (c *UserClient) QueryModerators(u *User) *ModeratorQuery
QueryModerators queries the moderators edge of a User.
func (*UserClient) QueryThreadKudoes ¶
func (c *UserClient) QueryThreadKudoes(u *User) *ThreadKudoQuery
QueryThreadKudoes queries the thread_kudoes edge of a User.
func (*UserClient) QueryUserComments ¶
func (c *UserClient) QueryUserComments(u *User) *CommentQuery
QueryUserComments queries the user_comments edge of a User.
func (*UserClient) QueryUserThreads ¶
func (c *UserClient) QueryUserThreads(u *User) *ThreadQuery
QueryUserThreads queries the user_threads 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) AddKudoedCommentIDs ¶
func (uc *UserCreate) AddKudoedCommentIDs(ids ...int) *UserCreate
AddKudoedCommentIDs adds the "kudoed_comments" edge to the Comment entity by IDs.
func (*UserCreate) AddKudoedComments ¶
func (uc *UserCreate) AddKudoedComments(c ...*Comment) *UserCreate
AddKudoedComments adds the "kudoed_comments" edges to the Comment entity.
func (*UserCreate) AddKudoedThreadIDs ¶
func (uc *UserCreate) AddKudoedThreadIDs(ids ...int) *UserCreate
AddKudoedThreadIDs adds the "kudoed_threads" edge to the Thread entity by IDs.
func (*UserCreate) AddKudoedThreads ¶
func (uc *UserCreate) AddKudoedThreads(t ...*Thread) *UserCreate
AddKudoedThreads adds the "kudoed_threads" edges to the Thread entity.
func (*UserCreate) AddModeratedTopicIDs ¶
func (uc *UserCreate) AddModeratedTopicIDs(ids ...int) *UserCreate
AddModeratedTopicIDs adds the "moderated_topics" edge to the Topic entity by IDs.
func (*UserCreate) AddModeratedTopics ¶
func (uc *UserCreate) AddModeratedTopics(t ...*Topic) *UserCreate
AddModeratedTopics adds the "moderated_topics" edges to the Topic entity.
func (*UserCreate) AddUserCommentIDs ¶
func (uc *UserCreate) AddUserCommentIDs(ids ...int) *UserCreate
AddUserCommentIDs adds the "user_comments" edge to the Comment entity by IDs.
func (*UserCreate) AddUserComments ¶
func (uc *UserCreate) AddUserComments(c ...*Comment) *UserCreate
AddUserComments adds the "user_comments" edges to the Comment entity.
func (*UserCreate) AddUserThreadIDs ¶
func (uc *UserCreate) AddUserThreadIDs(ids ...int) *UserCreate
AddUserThreadIDs adds the "user_threads" edge to the Thread entity by IDs.
func (*UserCreate) AddUserThreads ¶
func (uc *UserCreate) AddUserThreads(t ...*Thread) *UserCreate
AddUserThreads adds the "user_threads" edges to the Thread entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) 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) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetEmailVerified ¶
func (uc *UserCreate) SetEmailVerified(b bool) *UserCreate
SetEmailVerified sets the "email_verified" field.
func (*UserCreate) SetFirstName ¶
func (uc *UserCreate) SetFirstName(s string) *UserCreate
SetFirstName sets the "first_name" field.
func (*UserCreate) SetHash ¶
func (uc *UserCreate) SetHash(b []byte) *UserCreate
SetHash sets the "hash" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetLastName ¶
func (uc *UserCreate) SetLastName(s string) *UserCreate
SetLastName sets the "last_name" 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) SetNillableEmailVerified ¶
func (uc *UserCreate) SetNillableEmailVerified(b *bool) *UserCreate
SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (*UserCreate) SetNillableFirstName ¶
func (uc *UserCreate) SetNillableFirstName(s *string) *UserCreate
SetNillableFirstName sets the "first_name" 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) SetNillableLastName ¶
func (uc *UserCreate) SetNillableLastName(s *string) *UserCreate
SetNillableLastName sets the "last_name" field if the given value is not nil.
func (*UserCreate) SetUsername ¶
func (uc *UserCreate) SetUsername(s string) *UserCreate
SetUsername sets the "username" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct { // UserThreads holds the value of the user_threads edge. UserThreads []*Thread `json:"user_threads,omitempty"` // KudoedThreads holds the value of the kudoed_threads edge. KudoedThreads []*Thread `json:"kudoed_threads,omitempty"` // UserComments holds the value of the user_comments edge. UserComments []*Comment `json:"user_comments,omitempty"` // KudoedComments holds the value of the kudoed_comments edge. KudoedComments []*Comment `json:"kudoed_comments,omitempty"` // ModeratedTopics holds the value of the moderated_topics edge. ModeratedTopics []*Topic `json:"moderated_topics,omitempty"` // ThreadKudoes holds the value of the thread_kudoes edge. ThreadKudoes []*ThreadKudo `json:"thread_kudoes,omitempty"` // CommentKudoes holds the value of the comment_kudoes edge. CommentKudoes []*CommentKudo `json:"comment_kudoes,omitempty"` // Moderators holds the value of the moderators edge. Moderators []*Moderator `json:"moderators,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) CommentKudoesOrErr ¶
func (e UserEdges) CommentKudoesOrErr() ([]*CommentKudo, error)
CommentKudoesOrErr returns the CommentKudoes value or an error if the edge was not loaded in eager-loading.
func (UserEdges) KudoedCommentsOrErr ¶
KudoedCommentsOrErr returns the KudoedComments value or an error if the edge was not loaded in eager-loading.
func (UserEdges) KudoedThreadsOrErr ¶
KudoedThreadsOrErr returns the KudoedThreads value or an error if the edge was not loaded in eager-loading.
func (UserEdges) ModeratedTopicsOrErr ¶
ModeratedTopicsOrErr returns the ModeratedTopics value or an error if the edge was not loaded in eager-loading.
func (UserEdges) ModeratorsOrErr ¶
ModeratorsOrErr returns the Moderators value or an error if the edge was not loaded in eager-loading.
func (UserEdges) ThreadKudoesOrErr ¶
func (e UserEdges) ThreadKudoesOrErr() ([]*ThreadKudo, error)
ThreadKudoesOrErr returns the ThreadKudoes value or an error if the edge was not loaded in eager-loading.
func (UserEdges) UserCommentsOrErr ¶
UserCommentsOrErr returns the UserComments value or an error if the edge was not loaded in eager-loading.
func (UserEdges) UserThreadsOrErr ¶
UserThreadsOrErr returns the UserThreads 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) AddKudoedCommentIDs ¶
func (m *UserMutation) AddKudoedCommentIDs(ids ...int)
AddKudoedCommentIDs adds the "kudoed_comments" edge to the Comment entity by ids.
func (*UserMutation) AddKudoedThreadIDs ¶
func (m *UserMutation) AddKudoedThreadIDs(ids ...int)
AddKudoedThreadIDs adds the "kudoed_threads" edge to the Thread entity by ids.
func (*UserMutation) AddModeratedTopicIDs ¶
func (m *UserMutation) AddModeratedTopicIDs(ids ...int)
AddModeratedTopicIDs adds the "moderated_topics" edge to the Topic entity by ids.
func (*UserMutation) AddUserCommentIDs ¶
func (m *UserMutation) AddUserCommentIDs(ids ...int)
AddUserCommentIDs adds the "user_comments" edge to the Comment entity by ids.
func (*UserMutation) AddUserThreadIDs ¶
func (m *UserMutation) AddUserThreadIDs(ids ...int)
AddUserThreadIDs adds the "user_threads" edge to the Thread 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) ClearFirstName ¶
func (m *UserMutation) ClearFirstName()
ClearFirstName clears the value of the "first_name" field.
func (*UserMutation) ClearKudoedComments ¶
func (m *UserMutation) ClearKudoedComments()
ClearKudoedComments clears the "kudoed_comments" edge to the Comment entity.
func (*UserMutation) ClearKudoedThreads ¶
func (m *UserMutation) ClearKudoedThreads()
ClearKudoedThreads clears the "kudoed_threads" edge to the Thread entity.
func (*UserMutation) ClearLastName ¶
func (m *UserMutation) ClearLastName()
ClearLastName clears the value of the "last_name" field.
func (*UserMutation) ClearModeratedTopics ¶
func (m *UserMutation) ClearModeratedTopics()
ClearModeratedTopics clears the "moderated_topics" edge to the Topic entity.
func (*UserMutation) ClearUserComments ¶
func (m *UserMutation) ClearUserComments()
ClearUserComments clears the "user_comments" edge to the Comment entity.
func (*UserMutation) ClearUserThreads ¶
func (m *UserMutation) ClearUserThreads()
ClearUserThreads clears the "user_threads" edge to the Thread 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) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) EmailVerified ¶
func (m *UserMutation) EmailVerified() (r bool, exists bool)
EmailVerified returns the value of the "email_verified" field in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) FirstName ¶
func (m *UserMutation) FirstName() (r string, exists bool)
FirstName returns the value of the "first_name" field in the mutation.
func (*UserMutation) FirstNameCleared ¶
func (m *UserMutation) FirstNameCleared() bool
FirstNameCleared returns if the "first_name" field was cleared in this mutation.
func (*UserMutation) Hash ¶
func (m *UserMutation) Hash() (r []byte, exists bool)
Hash returns the value of the "hash" field in the mutation.
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) KudoedCommentsCleared ¶
func (m *UserMutation) KudoedCommentsCleared() bool
KudoedCommentsCleared reports if the "kudoed_comments" edge to the Comment entity was cleared.
func (*UserMutation) KudoedCommentsIDs ¶
func (m *UserMutation) KudoedCommentsIDs() (ids []int)
KudoedCommentsIDs returns the "kudoed_comments" edge IDs in the mutation.
func (*UserMutation) KudoedThreadsCleared ¶
func (m *UserMutation) KudoedThreadsCleared() bool
KudoedThreadsCleared reports if the "kudoed_threads" edge to the Thread entity was cleared.
func (*UserMutation) KudoedThreadsIDs ¶
func (m *UserMutation) KudoedThreadsIDs() (ids []int)
KudoedThreadsIDs returns the "kudoed_threads" edge IDs in the mutation.
func (*UserMutation) LastName ¶
func (m *UserMutation) LastName() (r string, exists bool)
LastName returns the value of the "last_name" field in the mutation.
func (*UserMutation) LastNameCleared ¶
func (m *UserMutation) LastNameCleared() bool
LastNameCleared returns if the "last_name" field was cleared in this mutation.
func (*UserMutation) ModeratedTopicsCleared ¶
func (m *UserMutation) ModeratedTopicsCleared() bool
ModeratedTopicsCleared reports if the "moderated_topics" edge to the Topic entity was cleared.
func (*UserMutation) ModeratedTopicsIDs ¶
func (m *UserMutation) ModeratedTopicsIDs() (ids []int)
ModeratedTopicsIDs returns the "moderated_topics" edge IDs in the mutation.
func (*UserMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldEmailVerified ¶
func (m *UserMutation) OldEmailVerified(ctx context.Context) (v bool, err error)
OldEmailVerified returns the old "email_verified" 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) OldFirstName ¶
func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)
OldFirstName returns the old "first_name" 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) OldHash ¶
func (m *UserMutation) OldHash(ctx context.Context) (v []byte, err error)
OldHash returns the old "hash" 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) OldLastName ¶
func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)
OldLastName returns the old "last_name" 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) OldUsername ¶
func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" 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) RemoveKudoedCommentIDs ¶
func (m *UserMutation) RemoveKudoedCommentIDs(ids ...int)
RemoveKudoedCommentIDs removes the "kudoed_comments" edge to the Comment entity by IDs.
func (*UserMutation) RemoveKudoedThreadIDs ¶
func (m *UserMutation) RemoveKudoedThreadIDs(ids ...int)
RemoveKudoedThreadIDs removes the "kudoed_threads" edge to the Thread entity by IDs.
func (*UserMutation) RemoveModeratedTopicIDs ¶
func (m *UserMutation) RemoveModeratedTopicIDs(ids ...int)
RemoveModeratedTopicIDs removes the "moderated_topics" edge to the Topic entity by IDs.
func (*UserMutation) RemoveUserCommentIDs ¶
func (m *UserMutation) RemoveUserCommentIDs(ids ...int)
RemoveUserCommentIDs removes the "user_comments" edge to the Comment entity by IDs.
func (*UserMutation) RemoveUserThreadIDs ¶
func (m *UserMutation) RemoveUserThreadIDs(ids ...int)
RemoveUserThreadIDs removes the "user_threads" edge to the Thread 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) RemovedKudoedCommentsIDs ¶
func (m *UserMutation) RemovedKudoedCommentsIDs() (ids []int)
RemovedKudoedComments returns the removed IDs of the "kudoed_comments" edge to the Comment entity.
func (*UserMutation) RemovedKudoedThreadsIDs ¶
func (m *UserMutation) RemovedKudoedThreadsIDs() (ids []int)
RemovedKudoedThreads returns the removed IDs of the "kudoed_threads" edge to the Thread entity.
func (*UserMutation) RemovedModeratedTopicsIDs ¶
func (m *UserMutation) RemovedModeratedTopicsIDs() (ids []int)
RemovedModeratedTopics returns the removed IDs of the "moderated_topics" edge to the Topic entity.
func (*UserMutation) RemovedUserCommentsIDs ¶
func (m *UserMutation) RemovedUserCommentsIDs() (ids []int)
RemovedUserComments returns the removed IDs of the "user_comments" edge to the Comment entity.
func (*UserMutation) RemovedUserThreadsIDs ¶
func (m *UserMutation) RemovedUserThreadsIDs() (ids []int)
RemovedUserThreads returns the removed IDs of the "user_threads" edge to the Thread 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) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetEmailVerified ¶
func (m *UserMutation) ResetEmailVerified()
ResetEmailVerified resets all changes to the "email_verified" field.
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) ResetFirstName ¶
func (m *UserMutation) ResetFirstName()
ResetFirstName resets all changes to the "first_name" field.
func (*UserMutation) ResetHash ¶
func (m *UserMutation) ResetHash()
ResetHash resets all changes to the "hash" field.
func (*UserMutation) ResetKudoedComments ¶
func (m *UserMutation) ResetKudoedComments()
ResetKudoedComments resets all changes to the "kudoed_comments" edge.
func (*UserMutation) ResetKudoedThreads ¶
func (m *UserMutation) ResetKudoedThreads()
ResetKudoedThreads resets all changes to the "kudoed_threads" edge.
func (*UserMutation) ResetLastName ¶
func (m *UserMutation) ResetLastName()
ResetLastName resets all changes to the "last_name" field.
func (*UserMutation) ResetModeratedTopics ¶
func (m *UserMutation) ResetModeratedTopics()
ResetModeratedTopics resets all changes to the "moderated_topics" edge.
func (*UserMutation) ResetUserComments ¶
func (m *UserMutation) ResetUserComments()
ResetUserComments resets all changes to the "user_comments" edge.
func (*UserMutation) ResetUserThreads ¶
func (m *UserMutation) ResetUserThreads()
ResetUserThreads resets all changes to the "user_threads" edge.
func (*UserMutation) ResetUsername ¶
func (m *UserMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetEmailVerified ¶
func (m *UserMutation) SetEmailVerified(b bool)
SetEmailVerified sets the "email_verified" 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) SetFirstName ¶
func (m *UserMutation) SetFirstName(s string)
SetFirstName sets the "first_name" field.
func (*UserMutation) SetHash ¶
func (m *UserMutation) SetHash(b []byte)
SetHash sets the "hash" field.
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) SetLastName ¶
func (m *UserMutation) SetLastName(s string)
SetLastName sets the "last_name" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetUsername ¶
func (m *UserMutation) SetUsername(s string)
SetUsername sets the "username" 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) UserCommentsCleared ¶
func (m *UserMutation) UserCommentsCleared() bool
UserCommentsCleared reports if the "user_comments" edge to the Comment entity was cleared.
func (*UserMutation) UserCommentsIDs ¶
func (m *UserMutation) UserCommentsIDs() (ids []int)
UserCommentsIDs returns the "user_comments" edge IDs in the mutation.
func (*UserMutation) UserThreadsCleared ¶
func (m *UserMutation) UserThreadsCleared() bool
UserThreadsCleared reports if the "user_threads" edge to the Thread entity was cleared.
func (*UserMutation) UserThreadsIDs ¶
func (m *UserMutation) UserThreadsIDs() (ids []int)
UserThreadsIDs returns the "user_threads" edge IDs in the mutation.
func (*UserMutation) Username ¶
func (m *UserMutation) Username() (r string, exists bool)
Username returns the value of the "username" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Email string `json:"email,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldEmail). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryCommentKudoes ¶
func (uq *UserQuery) QueryCommentKudoes() *CommentKudoQuery
QueryCommentKudoes chains the current query on the "comment_kudoes" edge.
func (*UserQuery) QueryKudoedComments ¶
func (uq *UserQuery) QueryKudoedComments() *CommentQuery
QueryKudoedComments chains the current query on the "kudoed_comments" edge.
func (*UserQuery) QueryKudoedThreads ¶
func (uq *UserQuery) QueryKudoedThreads() *ThreadQuery
QueryKudoedThreads chains the current query on the "kudoed_threads" edge.
func (*UserQuery) QueryModeratedTopics ¶
func (uq *UserQuery) QueryModeratedTopics() *TopicQuery
QueryModeratedTopics chains the current query on the "moderated_topics" edge.
func (*UserQuery) QueryModerators ¶
func (uq *UserQuery) QueryModerators() *ModeratorQuery
QueryModerators chains the current query on the "moderators" edge.
func (*UserQuery) QueryThreadKudoes ¶
func (uq *UserQuery) QueryThreadKudoes() *ThreadKudoQuery
QueryThreadKudoes chains the current query on the "thread_kudoes" edge.
func (*UserQuery) QueryUserComments ¶
func (uq *UserQuery) QueryUserComments() *CommentQuery
QueryUserComments chains the current query on the "user_comments" edge.
func (*UserQuery) QueryUserThreads ¶
func (uq *UserQuery) QueryUserThreads() *ThreadQuery
QueryUserThreads chains the current query on the "user_threads" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Email string `json:"email,omitempty"` } client.User.Query(). Select(user.FieldEmail). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithCommentKudoes ¶
func (uq *UserQuery) WithCommentKudoes(opts ...func(*CommentKudoQuery)) *UserQuery
WithCommentKudoes tells the query-builder to eager-load the nodes that are connected to the "comment_kudoes" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithKudoedComments ¶
func (uq *UserQuery) WithKudoedComments(opts ...func(*CommentQuery)) *UserQuery
WithKudoedComments tells the query-builder to eager-load the nodes that are connected to the "kudoed_comments" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithKudoedThreads ¶
func (uq *UserQuery) WithKudoedThreads(opts ...func(*ThreadQuery)) *UserQuery
WithKudoedThreads tells the query-builder to eager-load the nodes that are connected to the "kudoed_threads" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithModeratedTopics ¶
func (uq *UserQuery) WithModeratedTopics(opts ...func(*TopicQuery)) *UserQuery
WithModeratedTopics tells the query-builder to eager-load the nodes that are connected to the "moderated_topics" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithModerators ¶
func (uq *UserQuery) WithModerators(opts ...func(*ModeratorQuery)) *UserQuery
WithModerators tells the query-builder to eager-load the nodes that are connected to the "moderators" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithThreadKudoes ¶
func (uq *UserQuery) WithThreadKudoes(opts ...func(*ThreadKudoQuery)) *UserQuery
WithThreadKudoes tells the query-builder to eager-load the nodes that are connected to the "thread_kudoes" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithUserComments ¶
func (uq *UserQuery) WithUserComments(opts ...func(*CommentQuery)) *UserQuery
WithUserComments tells the query-builder to eager-load the nodes that are connected to the "user_comments" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithUserThreads ¶
func (uq *UserQuery) WithUserThreads(opts ...func(*ThreadQuery)) *UserQuery
WithUserThreads tells the query-builder to eager-load the nodes that are connected to the "user_threads" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddKudoedCommentIDs ¶
func (uu *UserUpdate) AddKudoedCommentIDs(ids ...int) *UserUpdate
AddKudoedCommentIDs adds the "kudoed_comments" edge to the Comment entity by IDs.
func (*UserUpdate) AddKudoedComments ¶
func (uu *UserUpdate) AddKudoedComments(c ...*Comment) *UserUpdate
AddKudoedComments adds the "kudoed_comments" edges to the Comment entity.
func (*UserUpdate) AddKudoedThreadIDs ¶
func (uu *UserUpdate) AddKudoedThreadIDs(ids ...int) *UserUpdate
AddKudoedThreadIDs adds the "kudoed_threads" edge to the Thread entity by IDs.
func (*UserUpdate) AddKudoedThreads ¶
func (uu *UserUpdate) AddKudoedThreads(t ...*Thread) *UserUpdate
AddKudoedThreads adds the "kudoed_threads" edges to the Thread entity.
func (*UserUpdate) AddModeratedTopicIDs ¶
func (uu *UserUpdate) AddModeratedTopicIDs(ids ...int) *UserUpdate
AddModeratedTopicIDs adds the "moderated_topics" edge to the Topic entity by IDs.
func (*UserUpdate) AddModeratedTopics ¶
func (uu *UserUpdate) AddModeratedTopics(t ...*Topic) *UserUpdate
AddModeratedTopics adds the "moderated_topics" edges to the Topic entity.
func (*UserUpdate) AddUserCommentIDs ¶
func (uu *UserUpdate) AddUserCommentIDs(ids ...int) *UserUpdate
AddUserCommentIDs adds the "user_comments" edge to the Comment entity by IDs.
func (*UserUpdate) AddUserComments ¶
func (uu *UserUpdate) AddUserComments(c ...*Comment) *UserUpdate
AddUserComments adds the "user_comments" edges to the Comment entity.
func (*UserUpdate) AddUserThreadIDs ¶
func (uu *UserUpdate) AddUserThreadIDs(ids ...int) *UserUpdate
AddUserThreadIDs adds the "user_threads" edge to the Thread entity by IDs.
func (*UserUpdate) AddUserThreads ¶
func (uu *UserUpdate) AddUserThreads(t ...*Thread) *UserUpdate
AddUserThreads adds the "user_threads" edges to the Thread entity.
func (*UserUpdate) ClearFirstName ¶
func (uu *UserUpdate) ClearFirstName() *UserUpdate
ClearFirstName clears the value of the "first_name" field.
func (*UserUpdate) ClearKudoedComments ¶
func (uu *UserUpdate) ClearKudoedComments() *UserUpdate
ClearKudoedComments clears all "kudoed_comments" edges to the Comment entity.
func (*UserUpdate) ClearKudoedThreads ¶
func (uu *UserUpdate) ClearKudoedThreads() *UserUpdate
ClearKudoedThreads clears all "kudoed_threads" edges to the Thread entity.
func (*UserUpdate) ClearLastName ¶
func (uu *UserUpdate) ClearLastName() *UserUpdate
ClearLastName clears the value of the "last_name" field.
func (*UserUpdate) ClearModeratedTopics ¶
func (uu *UserUpdate) ClearModeratedTopics() *UserUpdate
ClearModeratedTopics clears all "moderated_topics" edges to the Topic entity.
func (*UserUpdate) ClearUserComments ¶
func (uu *UserUpdate) ClearUserComments() *UserUpdate
ClearUserComments clears all "user_comments" edges to the Comment entity.
func (*UserUpdate) ClearUserThreads ¶
func (uu *UserUpdate) ClearUserThreads() *UserUpdate
ClearUserThreads clears all "user_threads" edges to the Thread entity.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveKudoedCommentIDs ¶
func (uu *UserUpdate) RemoveKudoedCommentIDs(ids ...int) *UserUpdate
RemoveKudoedCommentIDs removes the "kudoed_comments" edge to Comment entities by IDs.
func (*UserUpdate) RemoveKudoedComments ¶
func (uu *UserUpdate) RemoveKudoedComments(c ...*Comment) *UserUpdate
RemoveKudoedComments removes "kudoed_comments" edges to Comment entities.
func (*UserUpdate) RemoveKudoedThreadIDs ¶
func (uu *UserUpdate) RemoveKudoedThreadIDs(ids ...int) *UserUpdate
RemoveKudoedThreadIDs removes the "kudoed_threads" edge to Thread entities by IDs.
func (*UserUpdate) RemoveKudoedThreads ¶
func (uu *UserUpdate) RemoveKudoedThreads(t ...*Thread) *UserUpdate
RemoveKudoedThreads removes "kudoed_threads" edges to Thread entities.
func (*UserUpdate) RemoveModeratedTopicIDs ¶
func (uu *UserUpdate) RemoveModeratedTopicIDs(ids ...int) *UserUpdate
RemoveModeratedTopicIDs removes the "moderated_topics" edge to Topic entities by IDs.
func (*UserUpdate) RemoveModeratedTopics ¶
func (uu *UserUpdate) RemoveModeratedTopics(t ...*Topic) *UserUpdate
RemoveModeratedTopics removes "moderated_topics" edges to Topic entities.
func (*UserUpdate) RemoveUserCommentIDs ¶
func (uu *UserUpdate) RemoveUserCommentIDs(ids ...int) *UserUpdate
RemoveUserCommentIDs removes the "user_comments" edge to Comment entities by IDs.
func (*UserUpdate) RemoveUserComments ¶
func (uu *UserUpdate) RemoveUserComments(c ...*Comment) *UserUpdate
RemoveUserComments removes "user_comments" edges to Comment entities.
func (*UserUpdate) RemoveUserThreadIDs ¶
func (uu *UserUpdate) RemoveUserThreadIDs(ids ...int) *UserUpdate
RemoveUserThreadIDs removes the "user_threads" edge to Thread entities by IDs.
func (*UserUpdate) RemoveUserThreads ¶
func (uu *UserUpdate) RemoveUserThreads(t ...*Thread) *UserUpdate
RemoveUserThreads removes "user_threads" edges to Thread 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) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetEmailVerified ¶
func (uu *UserUpdate) SetEmailVerified(b bool) *UserUpdate
SetEmailVerified sets the "email_verified" field.
func (*UserUpdate) SetFirstName ¶
func (uu *UserUpdate) SetFirstName(s string) *UserUpdate
SetFirstName sets the "first_name" field.
func (*UserUpdate) SetHash ¶
func (uu *UserUpdate) SetHash(b []byte) *UserUpdate
SetHash sets the "hash" field.
func (*UserUpdate) SetLastName ¶
func (uu *UserUpdate) SetLastName(s string) *UserUpdate
SetLastName sets the "last_name" field.
func (*UserUpdate) SetNillableEmail ¶
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetNillableEmailVerified ¶
func (uu *UserUpdate) SetNillableEmailVerified(b *bool) *UserUpdate
SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (*UserUpdate) SetNillableFirstName ¶
func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate
SetNillableFirstName sets the "first_name" field if the given value is not nil.
func (*UserUpdate) SetNillableLastName ¶
func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate
SetNillableLastName sets the "last_name" field if the given value is not nil.
func (*UserUpdate) SetNillableUsername ¶
func (uu *UserUpdate) SetNillableUsername(s *string) *UserUpdate
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UserUpdate) SetUsername ¶
func (uu *UserUpdate) SetUsername(s string) *UserUpdate
SetUsername sets the "username" 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) AddKudoedCommentIDs ¶
func (uuo *UserUpdateOne) AddKudoedCommentIDs(ids ...int) *UserUpdateOne
AddKudoedCommentIDs adds the "kudoed_comments" edge to the Comment entity by IDs.
func (*UserUpdateOne) AddKudoedComments ¶
func (uuo *UserUpdateOne) AddKudoedComments(c ...*Comment) *UserUpdateOne
AddKudoedComments adds the "kudoed_comments" edges to the Comment entity.
func (*UserUpdateOne) AddKudoedThreadIDs ¶
func (uuo *UserUpdateOne) AddKudoedThreadIDs(ids ...int) *UserUpdateOne
AddKudoedThreadIDs adds the "kudoed_threads" edge to the Thread entity by IDs.
func (*UserUpdateOne) AddKudoedThreads ¶
func (uuo *UserUpdateOne) AddKudoedThreads(t ...*Thread) *UserUpdateOne
AddKudoedThreads adds the "kudoed_threads" edges to the Thread entity.
func (*UserUpdateOne) AddModeratedTopicIDs ¶
func (uuo *UserUpdateOne) AddModeratedTopicIDs(ids ...int) *UserUpdateOne
AddModeratedTopicIDs adds the "moderated_topics" edge to the Topic entity by IDs.
func (*UserUpdateOne) AddModeratedTopics ¶
func (uuo *UserUpdateOne) AddModeratedTopics(t ...*Topic) *UserUpdateOne
AddModeratedTopics adds the "moderated_topics" edges to the Topic entity.
func (*UserUpdateOne) AddUserCommentIDs ¶
func (uuo *UserUpdateOne) AddUserCommentIDs(ids ...int) *UserUpdateOne
AddUserCommentIDs adds the "user_comments" edge to the Comment entity by IDs.
func (*UserUpdateOne) AddUserComments ¶
func (uuo *UserUpdateOne) AddUserComments(c ...*Comment) *UserUpdateOne
AddUserComments adds the "user_comments" edges to the Comment entity.
func (*UserUpdateOne) AddUserThreadIDs ¶
func (uuo *UserUpdateOne) AddUserThreadIDs(ids ...int) *UserUpdateOne
AddUserThreadIDs adds the "user_threads" edge to the Thread entity by IDs.
func (*UserUpdateOne) AddUserThreads ¶
func (uuo *UserUpdateOne) AddUserThreads(t ...*Thread) *UserUpdateOne
AddUserThreads adds the "user_threads" edges to the Thread entity.
func (*UserUpdateOne) ClearFirstName ¶
func (uuo *UserUpdateOne) ClearFirstName() *UserUpdateOne
ClearFirstName clears the value of the "first_name" field.
func (*UserUpdateOne) ClearKudoedComments ¶
func (uuo *UserUpdateOne) ClearKudoedComments() *UserUpdateOne
ClearKudoedComments clears all "kudoed_comments" edges to the Comment entity.
func (*UserUpdateOne) ClearKudoedThreads ¶
func (uuo *UserUpdateOne) ClearKudoedThreads() *UserUpdateOne
ClearKudoedThreads clears all "kudoed_threads" edges to the Thread entity.
func (*UserUpdateOne) ClearLastName ¶
func (uuo *UserUpdateOne) ClearLastName() *UserUpdateOne
ClearLastName clears the value of the "last_name" field.
func (*UserUpdateOne) ClearModeratedTopics ¶
func (uuo *UserUpdateOne) ClearModeratedTopics() *UserUpdateOne
ClearModeratedTopics clears all "moderated_topics" edges to the Topic entity.
func (*UserUpdateOne) ClearUserComments ¶
func (uuo *UserUpdateOne) ClearUserComments() *UserUpdateOne
ClearUserComments clears all "user_comments" edges to the Comment entity.
func (*UserUpdateOne) ClearUserThreads ¶
func (uuo *UserUpdateOne) ClearUserThreads() *UserUpdateOne
ClearUserThreads clears all "user_threads" edges to the Thread entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveKudoedCommentIDs ¶
func (uuo *UserUpdateOne) RemoveKudoedCommentIDs(ids ...int) *UserUpdateOne
RemoveKudoedCommentIDs removes the "kudoed_comments" edge to Comment entities by IDs.
func (*UserUpdateOne) RemoveKudoedComments ¶
func (uuo *UserUpdateOne) RemoveKudoedComments(c ...*Comment) *UserUpdateOne
RemoveKudoedComments removes "kudoed_comments" edges to Comment entities.
func (*UserUpdateOne) RemoveKudoedThreadIDs ¶
func (uuo *UserUpdateOne) RemoveKudoedThreadIDs(ids ...int) *UserUpdateOne
RemoveKudoedThreadIDs removes the "kudoed_threads" edge to Thread entities by IDs.
func (*UserUpdateOne) RemoveKudoedThreads ¶
func (uuo *UserUpdateOne) RemoveKudoedThreads(t ...*Thread) *UserUpdateOne
RemoveKudoedThreads removes "kudoed_threads" edges to Thread entities.
func (*UserUpdateOne) RemoveModeratedTopicIDs ¶
func (uuo *UserUpdateOne) RemoveModeratedTopicIDs(ids ...int) *UserUpdateOne
RemoveModeratedTopicIDs removes the "moderated_topics" edge to Topic entities by IDs.
func (*UserUpdateOne) RemoveModeratedTopics ¶
func (uuo *UserUpdateOne) RemoveModeratedTopics(t ...*Topic) *UserUpdateOne
RemoveModeratedTopics removes "moderated_topics" edges to Topic entities.
func (*UserUpdateOne) RemoveUserCommentIDs ¶
func (uuo *UserUpdateOne) RemoveUserCommentIDs(ids ...int) *UserUpdateOne
RemoveUserCommentIDs removes the "user_comments" edge to Comment entities by IDs.
func (*UserUpdateOne) RemoveUserComments ¶
func (uuo *UserUpdateOne) RemoveUserComments(c ...*Comment) *UserUpdateOne
RemoveUserComments removes "user_comments" edges to Comment entities.
func (*UserUpdateOne) RemoveUserThreadIDs ¶
func (uuo *UserUpdateOne) RemoveUserThreadIDs(ids ...int) *UserUpdateOne
RemoveUserThreadIDs removes the "user_threads" edge to Thread entities by IDs.
func (*UserUpdateOne) RemoveUserThreads ¶
func (uuo *UserUpdateOne) RemoveUserThreads(t ...*Thread) *UserUpdateOne
RemoveUserThreads removes "user_threads" edges to Thread 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) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetEmailVerified ¶
func (uuo *UserUpdateOne) SetEmailVerified(b bool) *UserUpdateOne
SetEmailVerified sets the "email_verified" field.
func (*UserUpdateOne) SetFirstName ¶
func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne
SetFirstName sets the "first_name" field.
func (*UserUpdateOne) SetHash ¶
func (uuo *UserUpdateOne) SetHash(b []byte) *UserUpdateOne
SetHash sets the "hash" field.
func (*UserUpdateOne) SetLastName ¶
func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne
SetLastName sets the "last_name" field.
func (*UserUpdateOne) SetNillableEmail ¶
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetNillableEmailVerified ¶
func (uuo *UserUpdateOne) SetNillableEmailVerified(b *bool) *UserUpdateOne
SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (*UserUpdateOne) SetNillableFirstName ¶
func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne
SetNillableFirstName sets the "first_name" field if the given value is not nil.
func (*UserUpdateOne) SetNillableLastName ¶
func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne
SetNillableLastName sets the "last_name" field if the given value is not nil.
func (*UserUpdateOne) SetNillableUsername ¶
func (uuo *UserUpdateOne) SetNillableUsername(s *string) *UserUpdateOne
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UserUpdateOne) SetUsername ¶
func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne
SetUsername sets the "username" field.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files
¶
- client.go
- comment.go
- comment_create.go
- comment_delete.go
- comment_query.go
- comment_update.go
- commentkudo.go
- commentkudo_create.go
- commentkudo_delete.go
- commentkudo_query.go
- commentkudo_update.go
- ent.go
- generate.go
- moderator.go
- moderator_create.go
- moderator_delete.go
- moderator_query.go
- moderator_update.go
- mutation.go
- runtime.go
- tag.go
- tag_create.go
- tag_delete.go
- tag_query.go
- tag_update.go
- thread.go
- thread_create.go
- thread_delete.go
- thread_query.go
- thread_update.go
- threadkudo.go
- threadkudo_create.go
- threadkudo_delete.go
- threadkudo_query.go
- threadkudo_update.go
- topic.go
- topic_create.go
- topic_delete.go
- topic_query.go
- topic_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go