ent

package
v0.0.0-...-a746138 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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 Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

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

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

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) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

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(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

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

func (c *Comment) QueryCommentAuthors() *UserQuery

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

func (c *Comment) QueryKudoedUsers() *UserQuery

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) String

func (c *Comment) String() string

String implements the fmt.Stringer.

func (*Comment) Unwrap

func (c *Comment) Unwrap() *Comment

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.

func (*Comment) Value

func (c *Comment) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Comment. This includes values selected through modifiers, order, etc.

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) Get

func (c *CommentClient) Get(ctx context.Context, id int) (*Comment, error)

Get returns a Comment 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.

func (*CommentCreateBulk) Save

func (ccb *CommentCreateBulk) Save(ctx context.Context) ([]*Comment, error)

Save creates the Comment entities in the database.

func (*CommentCreateBulk) SaveX

func (ccb *CommentCreateBulk) SaveX(ctx context.Context) []*Comment

SaveX is like Save, 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

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

func (s *CommentGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) BoolX

func (s *CommentGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CommentGroupBy) Bools

func (s *CommentGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) BoolsX

func (s *CommentGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CommentGroupBy) Float64

func (s *CommentGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) Float64X

func (s *CommentGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CommentGroupBy) Float64s

func (s *CommentGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) Float64sX

func (s *CommentGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CommentGroupBy) Int

func (s *CommentGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) IntX

func (s *CommentGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CommentGroupBy) Ints

func (s *CommentGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) IntsX

func (s *CommentGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *CommentGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CommentGroupBy) String

func (s *CommentGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) StringX

func (s *CommentGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CommentGroupBy) Strings

func (s *CommentGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) StringsX

func (s *CommentGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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.

func (*CommentKudo) Value

func (ck *CommentKudo) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the CommentKudo. This includes values selected through modifiers, order, etc.

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

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

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

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

func (s *CommentKudoGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CommentKudoGroupBy) BoolX

func (s *CommentKudoGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CommentKudoGroupBy) Bools

func (s *CommentKudoGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CommentKudoGroupBy) BoolsX

func (s *CommentKudoGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CommentKudoGroupBy) Float64

func (s *CommentKudoGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CommentKudoGroupBy) Float64X

func (s *CommentKudoGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CommentKudoGroupBy) Float64s

func (s *CommentKudoGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CommentKudoGroupBy) Float64sX

func (s *CommentKudoGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CommentKudoGroupBy) Int

func (s *CommentKudoGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CommentKudoGroupBy) IntX

func (s *CommentKudoGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CommentKudoGroupBy) Ints

func (s *CommentKudoGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CommentKudoGroupBy) IntsX

func (s *CommentKudoGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *CommentKudoGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CommentKudoGroupBy) String

func (s *CommentKudoGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CommentKudoGroupBy) StringX

func (s *CommentKudoGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CommentKudoGroupBy) Strings

func (s *CommentKudoGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CommentKudoGroupBy) StringsX

func (s *CommentKudoGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

func (m *CommentKudoMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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

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

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

func (s *CommentKudoSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CommentKudoSelect) BoolX

func (s *CommentKudoSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CommentKudoSelect) Bools

func (s *CommentKudoSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CommentKudoSelect) BoolsX

func (s *CommentKudoSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CommentKudoSelect) Float64

func (s *CommentKudoSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CommentKudoSelect) Float64X

func (s *CommentKudoSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CommentKudoSelect) Float64s

func (s *CommentKudoSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CommentKudoSelect) Float64sX

func (s *CommentKudoSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CommentKudoSelect) Int

func (s *CommentKudoSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CommentKudoSelect) IntX

func (s *CommentKudoSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CommentKudoSelect) Ints

func (s *CommentKudoSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CommentKudoSelect) IntsX

func (s *CommentKudoSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *CommentKudoSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CommentKudoSelect) String

func (s *CommentKudoSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CommentKudoSelect) StringX

func (s *CommentKudoSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CommentKudoSelect) Strings

func (s *CommentKudoSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CommentKudoSelect) StringsX

func (s *CommentKudoSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

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

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

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

func (m *CommentMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

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

func (m *CommentMutation) OldCreatedBy(ctx context.Context) (v uuid.UUID, err error)

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

func (m *CommentMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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

func (m *CommentMutation) OldModifiedAt(ctx context.Context) (v time.Time, err error)

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) Op

func (m *CommentMutation) Op() Op

Op returns the operation name.

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

func (s *CommentSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CommentSelect) BoolX

func (s *CommentSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CommentSelect) Bools

func (s *CommentSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CommentSelect) BoolsX

func (s *CommentSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CommentSelect) Float64

func (s *CommentSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CommentSelect) Float64X

func (s *CommentSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CommentSelect) Float64s

func (s *CommentSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CommentSelect) Float64sX

func (s *CommentSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CommentSelect) Int

func (s *CommentSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CommentSelect) IntX

func (s *CommentSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CommentSelect) Ints

func (s *CommentSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CommentSelect) IntsX

func (s *CommentSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *CommentSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CommentSelect) String

func (s *CommentSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CommentSelect) StringX

func (s *CommentSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CommentSelect) Strings

func (s *CommentSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CommentSelect) StringsX

func (s *CommentSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

Where appends a list predicates to the CommentUpdate builder.

type Comments

type Comments []*Comment

Comments is a parsable slice of Comment.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

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.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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 Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

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 Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

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

func (m *Moderator) QueryModerator() *UserQuery

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) String

func (m *Moderator) String() string

String implements the fmt.Stringer.

func (*Moderator) Unwrap

func (m *Moderator) Unwrap() *Moderator

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.

func (*Moderator) Value

func (m *Moderator) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Moderator. This includes values selected through modifiers, order, etc.

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.

func (*ModeratorCreateBulk) Save

func (mcb *ModeratorCreateBulk) Save(ctx context.Context) ([]*Moderator, error)

Save creates the Moderator entities in the database.

func (*ModeratorCreateBulk) SaveX

func (mcb *ModeratorCreateBulk) SaveX(ctx context.Context) []*Moderator

SaveX is like Save, 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

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

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

func (s *ModeratorGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ModeratorGroupBy) BoolX

func (s *ModeratorGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ModeratorGroupBy) Bools

func (s *ModeratorGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ModeratorGroupBy) BoolsX

func (s *ModeratorGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ModeratorGroupBy) Float64

func (s *ModeratorGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ModeratorGroupBy) Float64X

func (s *ModeratorGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ModeratorGroupBy) Float64s

func (s *ModeratorGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ModeratorGroupBy) Float64sX

func (s *ModeratorGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ModeratorGroupBy) Int

func (s *ModeratorGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ModeratorGroupBy) IntX

func (s *ModeratorGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ModeratorGroupBy) Ints

func (s *ModeratorGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ModeratorGroupBy) IntsX

func (s *ModeratorGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *ModeratorGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ModeratorGroupBy) String

func (s *ModeratorGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ModeratorGroupBy) StringX

func (s *ModeratorGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ModeratorGroupBy) Strings

func (s *ModeratorGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ModeratorGroupBy) StringsX

func (s *ModeratorGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

func (m *ModeratorMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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) Op

func (m *ModeratorMutation) Op() Op

Op returns the operation name.

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

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

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

func (s *ModeratorSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ModeratorSelect) BoolX

func (s *ModeratorSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ModeratorSelect) Bools

func (s *ModeratorSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ModeratorSelect) BoolsX

func (s *ModeratorSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ModeratorSelect) Float64

func (s *ModeratorSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ModeratorSelect) Float64X

func (s *ModeratorSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ModeratorSelect) Float64s

func (s *ModeratorSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ModeratorSelect) Float64sX

func (s *ModeratorSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ModeratorSelect) Int

func (s *ModeratorSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ModeratorSelect) IntX

func (s *ModeratorSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ModeratorSelect) Ints

func (s *ModeratorSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ModeratorSelect) IntsX

func (s *ModeratorSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *ModeratorSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ModeratorSelect) String

func (s *ModeratorSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ModeratorSelect) StringX

func (s *ModeratorSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ModeratorSelect) Strings

func (s *ModeratorSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ModeratorSelect) StringsX

func (s *ModeratorSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

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

Where appends a list predicates to the ModeratorUpdate builder.

type Moderators

type Moderators []*Moderator

Moderators is a parsable slice of Moderator.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

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 Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

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

type RollbackFunc func(context.Context, *Tx) error

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.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

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

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

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) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

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.

func (*Tag) Value

func (t *Tag) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Tag. This includes values selected through modifiers, order, etc.

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) Create

func (c *TagClient) Create() *TagCreate

Create returns a builder for creating a Tag entity.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

CreateBulk returns a builder for creating a bulk of Tag entities.

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

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) Get

func (c *TagClient) Get(ctx context.Context, id int) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id int) *Tag

GetX is like Get, but panics if an error occurs.

func (*TagClient) Hooks

func (c *TagClient) Hooks() []Hook

Hooks returns the client hooks.

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) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryTaggedThreads

func (c *TagClient) QueryTaggedThreads(t *Tag) *ThreadQuery

QueryTaggedThreads queries the tagged_threads edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for 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.

func (*TagClient) Use

func (c *TagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tag.Hooks(f(g(h())))`.

type TagCreate

type TagCreate struct {
	// contains filtered or unexported fields
}

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) AddTaggedThreadIDs

func (tc *TagCreate) AddTaggedThreadIDs(ids ...int) *TagCreate

AddTaggedThreadIDs adds the "tagged_threads" edge to the Thread entity by IDs.

func (*TagCreate) AddTaggedThreads

func (tc *TagCreate) AddTaggedThreads(t ...*Thread) *TagCreate

AddTaggedThreads adds the "tagged_threads" edges to the Thread entity.

func (*TagCreate) Exec

func (tc *TagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreate) ExecX

func (tc *TagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetTagName

func (tc *TagCreate) SetTagName(s string) *TagCreate

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.

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

SaveX is like Save, 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

func (td *TagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TagDelete) ExecX

func (td *TagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where appends a list predicates to the TagDelete builder.

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

func (e TagEdges) TaggedThreadsOrErr() ([]*Thread, error)

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

func (s *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolX

func (s *TagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagGroupBy) Bools

func (s *TagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolsX

func (s *TagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagGroupBy) Float64

func (s *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64X

func (s *TagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagGroupBy) Float64s

func (s *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64sX

func (s *TagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagGroupBy) Int

func (s *TagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntX

func (s *TagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagGroupBy) Ints

func (s *TagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntsX

func (s *TagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *TagGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TagGroupBy) String

func (s *TagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringX

func (s *TagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagGroupBy) Strings

func (s *TagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringsX

func (s *TagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

func (m *TagMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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) Op

func (m *TagMutation) Op() Op

Op returns the operation name.

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) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

AllX is like All, but panics if an error occurs.

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

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) Count

func (tq *TagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagQuery) CountX

func (tq *TagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TagQuery) Exist

func (tq *TagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TagQuery) ExistX

func (tq *TagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

First returns the first Tag entity from the query. Returns a *NotFoundError when no Tag was found.

func (*TagQuery) FirstID

func (tq *TagQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Tag ID from the query. Returns a *NotFoundError when no Tag ID was found.

func (*TagQuery) FirstIDX

func (tq *TagQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

FirstX is like First, but panics if an error occurs.

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) IDs

func (tq *TagQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Tag IDs.

func (*TagQuery) IDsX

func (tq *TagQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TagQuery) Limit

func (tq *TagQuery) Limit(limit int) *TagQuery

Limit the number of records to be returned by this query.

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset to start from.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

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

func (tq *TagQuery) OnlyID(ctx context.Context) (id int, err error)

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) OnlyIDX

func (tq *TagQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

OnlyX is like Only, but panics if an error occurs.

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

func (tq *TagQuery) Select(fields ...string) *TagSelect

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

func (tq *TagQuery) Unique(unique bool) *TagQuery

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) Where

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the TagQuery builder.

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

func (s *TagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolX

func (s *TagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagSelect) Bools

func (s *TagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolsX

func (s *TagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagSelect) Float64

func (s *TagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64X

func (s *TagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagSelect) Float64s

func (s *TagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64sX

func (s *TagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagSelect) Int

func (s *TagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntX

func (s *TagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagSelect) Ints

func (s *TagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntsX

func (s *TagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagSelect) Scan

func (ts *TagSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TagSelect) ScanX

func (s *TagSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TagSelect) String

func (s *TagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringX

func (s *TagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagSelect) Strings

func (s *TagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringsX

func (s *TagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagUpdate

type TagUpdate struct {
	// contains filtered or unexported fields
}

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddTaggedThreadIDs

func (tu *TagUpdate) AddTaggedThreadIDs(ids ...int) *TagUpdate

AddTaggedThreadIDs adds the "tagged_threads" edge to the Thread entity by IDs.

func (*TagUpdate) AddTaggedThreads

func (tu *TagUpdate) AddTaggedThreads(t ...*Thread) *TagUpdate

AddTaggedThreads adds the "tagged_threads" edges to the Thread entity.

func (*TagUpdate) ClearTaggedThreads

func (tu *TagUpdate) ClearTaggedThreads() *TagUpdate

ClearTaggedThreads clears all "tagged_threads" edges to the Thread entity.

func (*TagUpdate) Exec

func (tu *TagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpdate) ExecX

func (tu *TagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) RemoveTaggedThreadIDs

func (tu *TagUpdate) RemoveTaggedThreadIDs(ids ...int) *TagUpdate

RemoveTaggedThreadIDs removes the "tagged_threads" edge to Thread entities by IDs.

func (*TagUpdate) RemoveTaggedThreads

func (tu *TagUpdate) RemoveTaggedThreads(t ...*Thread) *TagUpdate

RemoveTaggedThreads removes "tagged_threads" edges to Thread entities.

func (*TagUpdate) Save

func (tu *TagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TagUpdate) SaveX

func (tu *TagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TagUpdate) SetNillableTagName

func (tu *TagUpdate) SetNillableTagName(s *string) *TagUpdate

SetNillableTagName sets the "tag_name" field if the given value is not nil.

func (*TagUpdate) SetTagName

func (tu *TagUpdate) SetTagName(s string) *TagUpdate

SetTagName sets the "tag_name" field.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where appends a list predicates to the TagUpdate builder.

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 Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

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

func (t *Thread) QueryKudoedUsers() *UserQuery

QueryKudoedUsers queries the "kudoed_users" edge of the Thread entity.

func (*Thread) QueryTags

func (t *Thread) QueryTags() *TagQuery

QueryTags queries the "tags" 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

func (t *Thread) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Thread entity.

func (*Thread) String

func (t *Thread) String() string

String implements the fmt.Stringer.

func (*Thread) Unwrap

func (t *Thread) Unwrap() *Thread

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.

func (*Thread) Value

func (t *Thread) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Thread. This includes values selected through modifiers, order, etc.

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) Get

func (c *ThreadClient) Get(ctx context.Context, id int) (*Thread, error)

Get returns a Thread 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) Hooks

func (c *ThreadClient) Hooks() []Hook

Hooks returns the client hooks.

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.

func (*ThreadCreateBulk) Save

func (tcb *ThreadCreateBulk) Save(ctx context.Context) ([]*Thread, error)

Save creates the Thread entities in the database.

func (*ThreadCreateBulk) SaveX

func (tcb *ThreadCreateBulk) SaveX(ctx context.Context) []*Thread

SaveX is like Save, 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

func (s *ThreadGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) BoolX

func (s *ThreadGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ThreadGroupBy) Bools

func (s *ThreadGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) BoolsX

func (s *ThreadGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ThreadGroupBy) Float64

func (s *ThreadGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) Float64X

func (s *ThreadGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ThreadGroupBy) Float64s

func (s *ThreadGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) Float64sX

func (s *ThreadGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ThreadGroupBy) Int

func (s *ThreadGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) IntX

func (s *ThreadGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ThreadGroupBy) Ints

func (s *ThreadGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) IntsX

func (s *ThreadGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *ThreadGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ThreadGroupBy) String

func (s *ThreadGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) StringX

func (s *ThreadGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ThreadGroupBy) Strings

func (s *ThreadGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ThreadGroupBy) StringsX

func (s *ThreadGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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.

func (*ThreadKudo) Value

func (tk *ThreadKudo) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ThreadKudo. This includes values selected through modifiers, order, etc.

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

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

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

func (s *ThreadKudoGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ThreadKudoGroupBy) BoolX

func (s *ThreadKudoGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ThreadKudoGroupBy) Bools

func (s *ThreadKudoGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ThreadKudoGroupBy) BoolsX

func (s *ThreadKudoGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ThreadKudoGroupBy) Float64

func (s *ThreadKudoGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ThreadKudoGroupBy) Float64X

func (s *ThreadKudoGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ThreadKudoGroupBy) Float64s

func (s *ThreadKudoGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ThreadKudoGroupBy) Float64sX

func (s *ThreadKudoGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ThreadKudoGroupBy) Int

func (s *ThreadKudoGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ThreadKudoGroupBy) IntX

func (s *ThreadKudoGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ThreadKudoGroupBy) Ints

func (s *ThreadKudoGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ThreadKudoGroupBy) IntsX

func (s *ThreadKudoGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *ThreadKudoGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ThreadKudoGroupBy) String

func (s *ThreadKudoGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ThreadKudoGroupBy) StringX

func (s *ThreadKudoGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ThreadKudoGroupBy) Strings

func (s *ThreadKudoGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ThreadKudoGroupBy) StringsX

func (s *ThreadKudoGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

func (m *ThreadKudoMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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) Op

func (m *ThreadKudoMutation) Op() Op

Op returns the operation name.

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

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

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

func (s *ThreadKudoSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ThreadKudoSelect) BoolX

func (s *ThreadKudoSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ThreadKudoSelect) Bools

func (s *ThreadKudoSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ThreadKudoSelect) BoolsX

func (s *ThreadKudoSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ThreadKudoSelect) Float64

func (s *ThreadKudoSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ThreadKudoSelect) Float64X

func (s *ThreadKudoSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ThreadKudoSelect) Float64s

func (s *ThreadKudoSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ThreadKudoSelect) Float64sX

func (s *ThreadKudoSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ThreadKudoSelect) Int

func (s *ThreadKudoSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ThreadKudoSelect) IntX

func (s *ThreadKudoSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ThreadKudoSelect) Ints

func (s *ThreadKudoSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ThreadKudoSelect) IntsX

func (s *ThreadKudoSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *ThreadKudoSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ThreadKudoSelect) String

func (s *ThreadKudoSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ThreadKudoSelect) StringX

func (s *ThreadKudoSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ThreadKudoSelect) Strings

func (s *ThreadKudoSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ThreadKudoSelect) StringsX

func (s *ThreadKudoSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

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

Where appends a list predicates to the ThreadKudoUpdate builder.

type ThreadKudos

type ThreadKudos []*ThreadKudo

ThreadKudos is a parsable slice of ThreadKudo.

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

func (m *ThreadMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

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

func (m *ThreadMutation) OldCreatedBy(ctx context.Context) (v uuid.UUID, err error)

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

func (m *ThreadMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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

func (m *ThreadMutation) OldModifiedAt(ctx context.Context) (v time.Time, err error)

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) Op

func (m *ThreadMutation) Op() Op

Op returns the operation name.

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

func (s *ThreadSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) BoolX

func (s *ThreadSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ThreadSelect) Bools

func (s *ThreadSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) BoolsX

func (s *ThreadSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ThreadSelect) Float64

func (s *ThreadSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) Float64X

func (s *ThreadSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ThreadSelect) Float64s

func (s *ThreadSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) Float64sX

func (s *ThreadSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ThreadSelect) Int

func (s *ThreadSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) IntX

func (s *ThreadSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ThreadSelect) Ints

func (s *ThreadSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) IntsX

func (s *ThreadSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *ThreadSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ThreadSelect) String

func (s *ThreadSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) StringX

func (s *ThreadSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ThreadSelect) Strings

func (s *ThreadSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ThreadSelect) StringsX

func (s *ThreadSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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 Threads

type Threads []*Thread

Threads is a parsable slice of Thread.

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

func (t *Topic) QueryTopicModerators() *UserQuery

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) String

func (t *Topic) String() string

String implements the fmt.Stringer.

func (*Topic) Unwrap

func (t *Topic) Unwrap() *Topic

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.

func (*Topic) Value

func (t *Topic) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Topic. This includes values selected through modifiers, order, etc.

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) Get

func (c *TopicClient) Get(ctx context.Context, id int) (*Topic, error)

Get returns a Topic 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) Hooks

func (c *TopicClient) Hooks() []Hook

Hooks returns the client hooks.

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.

func (*TopicCreateBulk) Save

func (tcb *TopicCreateBulk) Save(ctx context.Context) ([]*Topic, error)

Save creates the Topic entities in the database.

func (*TopicCreateBulk) SaveX

func (tcb *TopicCreateBulk) SaveX(ctx context.Context) []*Topic

SaveX is like Save, 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

func (s *TopicGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TopicGroupBy) BoolX

func (s *TopicGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TopicGroupBy) Bools

func (s *TopicGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TopicGroupBy) BoolsX

func (s *TopicGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TopicGroupBy) Float64

func (s *TopicGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TopicGroupBy) Float64X

func (s *TopicGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TopicGroupBy) Float64s

func (s *TopicGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TopicGroupBy) Float64sX

func (s *TopicGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TopicGroupBy) Int

func (s *TopicGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TopicGroupBy) IntX

func (s *TopicGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TopicGroupBy) Ints

func (s *TopicGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TopicGroupBy) IntsX

func (s *TopicGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *TopicGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TopicGroupBy) String

func (s *TopicGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TopicGroupBy) StringX

func (s *TopicGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TopicGroupBy) Strings

func (s *TopicGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TopicGroupBy) StringsX

func (s *TopicGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

func (m *TopicMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

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

func (m *TopicMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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) Op

func (m *TopicMutation) Op() Op

Op returns the operation name.

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

func (s *TopicSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TopicSelect) BoolX

func (s *TopicSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TopicSelect) Bools

func (s *TopicSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TopicSelect) BoolsX

func (s *TopicSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TopicSelect) Float64

func (s *TopicSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TopicSelect) Float64X

func (s *TopicSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TopicSelect) Float64s

func (s *TopicSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TopicSelect) Float64sX

func (s *TopicSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TopicSelect) Int

func (s *TopicSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TopicSelect) IntX

func (s *TopicSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TopicSelect) Ints

func (s *TopicSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TopicSelect) IntsX

func (s *TopicSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *TopicSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TopicSelect) String

func (s *TopicSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TopicSelect) StringX

func (s *TopicSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TopicSelect) Strings

func (s *TopicSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TopicSelect) StringsX

func (s *TopicSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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 Topics

type Topics []*Topic

Topics is a parsable slice of Topic.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

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

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

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) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

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.

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

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) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

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.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, 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

func (e UserEdges) KudoedCommentsOrErr() ([]*Comment, error)

KudoedCommentsOrErr returns the KudoedComments value or an error if the edge was not loaded in eager-loading.

func (UserEdges) KudoedThreadsOrErr

func (e UserEdges) KudoedThreadsOrErr() ([]*Thread, error)

KudoedThreadsOrErr returns the KudoedThreads value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ModeratedTopicsOrErr

func (e UserEdges) ModeratedTopicsOrErr() ([]*Topic, error)

ModeratedTopicsOrErr returns the ModeratedTopics value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ModeratorsOrErr

func (e UserEdges) ModeratorsOrErr() ([]*Moderator, error)

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

func (e UserEdges) UserCommentsOrErr() ([]*Comment, error)

UserCommentsOrErr returns the UserComments value or an error if the edge was not loaded in eager-loading.

func (UserEdges) UserThreadsOrErr

func (e UserEdges) UserThreadsOrErr() ([]*Thread, error)

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

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*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

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

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

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

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) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

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) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

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

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

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

func (uq *UserQuery) Unique(unique bool) *UserQuery

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) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

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

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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 Users

type Users []*User

Users is a parsable slice of User.

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.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL