ent

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 24 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.
	TypeAttachment = "Attachment"
	TypeComment    = "Comment"
	TypeMessage    = "Message"
	TypeReaction   = "Reaction"
	TypeToolUsage  = "ToolUsage"
)

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 Attachment

type Attachment struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Filename holds the value of the "filename" field.
	Filename string `json:"filename,omitempty"`
	// MimeType holds the value of the "mime_type" field.
	MimeType string `json:"mime_type,omitempty"`
	// SizeBytes holds the value of the "size_bytes" field.
	SizeBytes int64 `json:"size_bytes,omitempty"`
	// relative path: {YYYY-MM}/{message_id}/{filename}
	Path string `json:"path,omitempty"`
	// ThumbnailPath holds the value of the "thumbnail_path" field.
	ThumbnailPath *string `json:"thumbnail_path,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AttachmentQuery when eager-loading is set.
	Edges AttachmentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Attachment is the model entity for the Attachment schema.

func (*Attachment) QueryMessage

func (_m *Attachment) QueryMessage() *MessageQuery

QueryMessage queries the "message" edge of the Attachment entity.

func (*Attachment) String

func (_m *Attachment) String() string

String implements the fmt.Stringer.

func (*Attachment) Unwrap

func (_m *Attachment) Unwrap() *Attachment

Unwrap unwraps the Attachment 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 (*Attachment) Update

func (_m *Attachment) Update() *AttachmentUpdateOne

Update returns a builder for updating this Attachment. Note that you need to call Attachment.Unwrap() before calling this method if this Attachment was returned from a transaction, and the transaction was committed or rolled back.

func (*Attachment) Value

func (_m *Attachment) Value(name string) (ent.Value, error)

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

type AttachmentClient

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

AttachmentClient is a client for the Attachment schema.

func NewAttachmentClient

func NewAttachmentClient(c config) *AttachmentClient

NewAttachmentClient returns a client for the Attachment from the given config.

func (*AttachmentClient) Create

func (c *AttachmentClient) Create() *AttachmentCreate

Create returns a builder for creating a Attachment entity.

func (*AttachmentClient) CreateBulk

func (c *AttachmentClient) CreateBulk(builders ...*AttachmentCreate) *AttachmentCreateBulk

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

func (*AttachmentClient) Delete

func (c *AttachmentClient) Delete() *AttachmentDelete

Delete returns a delete builder for Attachment.

func (*AttachmentClient) DeleteOne

func (c *AttachmentClient) DeleteOne(_m *Attachment) *AttachmentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AttachmentClient) DeleteOneID

func (c *AttachmentClient) DeleteOneID(id uuid.UUID) *AttachmentDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*AttachmentClient) Get

Get returns a Attachment entity by its id.

func (*AttachmentClient) GetX

func (c *AttachmentClient) GetX(ctx context.Context, id uuid.UUID) *Attachment

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

func (*AttachmentClient) Hooks

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

Hooks returns the client hooks.

func (*AttachmentClient) Intercept

func (c *AttachmentClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `attachment.Intercept(f(g(h())))`.

func (*AttachmentClient) Interceptors

func (c *AttachmentClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*AttachmentClient) MapCreateBulk

func (c *AttachmentClient) MapCreateBulk(slice any, setFunc func(*AttachmentCreate, int)) *AttachmentCreateBulk

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 (*AttachmentClient) Query

func (c *AttachmentClient) Query() *AttachmentQuery

Query returns a query builder for Attachment.

func (*AttachmentClient) QueryMessage

func (c *AttachmentClient) QueryMessage(_m *Attachment) *MessageQuery

QueryMessage queries the message edge of a Attachment.

func (*AttachmentClient) Update

func (c *AttachmentClient) Update() *AttachmentUpdate

Update returns an update builder for Attachment.

func (*AttachmentClient) UpdateOne

func (c *AttachmentClient) UpdateOne(_m *Attachment) *AttachmentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AttachmentClient) UpdateOneID

func (c *AttachmentClient) UpdateOneID(id uuid.UUID) *AttachmentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AttachmentClient) Use

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

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

type AttachmentCreate

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

AttachmentCreate is the builder for creating a Attachment entity.

func (*AttachmentCreate) Exec

func (_c *AttachmentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachmentCreate) ExecX

func (_c *AttachmentCreate) ExecX(ctx context.Context)

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

func (*AttachmentCreate) Mutation

func (_c *AttachmentCreate) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentCreate) Save

func (_c *AttachmentCreate) Save(ctx context.Context) (*Attachment, error)

Save creates the Attachment in the database.

func (*AttachmentCreate) SaveX

func (_c *AttachmentCreate) SaveX(ctx context.Context) *Attachment

SaveX calls Save and panics if Save returns an error.

func (*AttachmentCreate) SetFilename

func (_c *AttachmentCreate) SetFilename(v string) *AttachmentCreate

SetFilename sets the "filename" field.

func (*AttachmentCreate) SetID

SetID sets the "id" field.

func (*AttachmentCreate) SetMessage

func (_c *AttachmentCreate) SetMessage(v *Message) *AttachmentCreate

SetMessage sets the "message" edge to the Message entity.

func (*AttachmentCreate) SetMessageID

func (_c *AttachmentCreate) SetMessageID(id uuid.UUID) *AttachmentCreate

SetMessageID sets the "message" edge to the Message entity by ID.

func (*AttachmentCreate) SetMimeType

func (_c *AttachmentCreate) SetMimeType(v string) *AttachmentCreate

SetMimeType sets the "mime_type" field.

func (*AttachmentCreate) SetNillableID

func (_c *AttachmentCreate) SetNillableID(v *uuid.UUID) *AttachmentCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*AttachmentCreate) SetNillableThumbnailPath

func (_c *AttachmentCreate) SetNillableThumbnailPath(v *string) *AttachmentCreate

SetNillableThumbnailPath sets the "thumbnail_path" field if the given value is not nil.

func (*AttachmentCreate) SetPath

func (_c *AttachmentCreate) SetPath(v string) *AttachmentCreate

SetPath sets the "path" field.

func (*AttachmentCreate) SetSizeBytes

func (_c *AttachmentCreate) SetSizeBytes(v int64) *AttachmentCreate

SetSizeBytes sets the "size_bytes" field.

func (*AttachmentCreate) SetThumbnailPath

func (_c *AttachmentCreate) SetThumbnailPath(v string) *AttachmentCreate

SetThumbnailPath sets the "thumbnail_path" field.

type AttachmentCreateBulk

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

AttachmentCreateBulk is the builder for creating many Attachment entities in bulk.

func (*AttachmentCreateBulk) Exec

func (_c *AttachmentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachmentCreateBulk) ExecX

func (_c *AttachmentCreateBulk) ExecX(ctx context.Context)

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

func (*AttachmentCreateBulk) Save

func (_c *AttachmentCreateBulk) Save(ctx context.Context) ([]*Attachment, error)

Save creates the Attachment entities in the database.

func (*AttachmentCreateBulk) SaveX

func (_c *AttachmentCreateBulk) SaveX(ctx context.Context) []*Attachment

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

type AttachmentDelete

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

AttachmentDelete is the builder for deleting a Attachment entity.

func (*AttachmentDelete) Exec

func (_d *AttachmentDelete) Exec(ctx context.Context) (int, error)

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

func (*AttachmentDelete) ExecX

func (_d *AttachmentDelete) ExecX(ctx context.Context) int

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

func (*AttachmentDelete) Where

Where appends a list predicates to the AttachmentDelete builder.

type AttachmentDeleteOne

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

AttachmentDeleteOne is the builder for deleting a single Attachment entity.

func (*AttachmentDeleteOne) Exec

func (_d *AttachmentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AttachmentDeleteOne) ExecX

func (_d *AttachmentDeleteOne) ExecX(ctx context.Context)

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

func (*AttachmentDeleteOne) Where

Where appends a list predicates to the AttachmentDelete builder.

type AttachmentEdges

type AttachmentEdges struct {
	// Message holds the value of the message edge.
	Message *Message `json:"message,omitempty"`
	// contains filtered or unexported fields
}

AttachmentEdges holds the relations/edges for other nodes in the graph.

func (AttachmentEdges) MessageOrErr

func (e AttachmentEdges) MessageOrErr() (*Message, error)

MessageOrErr returns the Message value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type AttachmentGroupBy

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

AttachmentGroupBy is the group-by builder for Attachment entities.

func (*AttachmentGroupBy) Aggregate

func (_g *AttachmentGroupBy) Aggregate(fns ...AggregateFunc) *AttachmentGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*AttachmentGroupBy) Bool

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

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

func (*AttachmentGroupBy) BoolX

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

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

func (*AttachmentGroupBy) Bools

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

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

func (*AttachmentGroupBy) BoolsX

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

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

func (*AttachmentGroupBy) Float64

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

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

func (*AttachmentGroupBy) Float64X

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

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

func (*AttachmentGroupBy) Float64s

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

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

func (*AttachmentGroupBy) Float64sX

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

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

func (*AttachmentGroupBy) Int

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

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

func (*AttachmentGroupBy) IntX

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

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

func (*AttachmentGroupBy) Ints

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

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

func (*AttachmentGroupBy) IntsX

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

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

func (*AttachmentGroupBy) Scan

func (_g *AttachmentGroupBy) Scan(ctx context.Context, v any) error

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

func (*AttachmentGroupBy) ScanX

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

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

func (*AttachmentGroupBy) String

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

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

func (*AttachmentGroupBy) StringX

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

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

func (*AttachmentGroupBy) Strings

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

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

func (*AttachmentGroupBy) StringsX

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

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

type AttachmentMutation

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

AttachmentMutation represents an operation that mutates the Attachment nodes in the graph.

func (*AttachmentMutation) AddField

func (m *AttachmentMutation) 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 (*AttachmentMutation) AddSizeBytes

func (m *AttachmentMutation) AddSizeBytes(i int64)

AddSizeBytes adds i to the "size_bytes" field.

func (*AttachmentMutation) AddedEdges

func (m *AttachmentMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*AttachmentMutation) AddedField

func (m *AttachmentMutation) 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 (*AttachmentMutation) AddedFields

func (m *AttachmentMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*AttachmentMutation) AddedIDs

func (m *AttachmentMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*AttachmentMutation) AddedSizeBytes

func (m *AttachmentMutation) AddedSizeBytes() (r int64, exists bool)

AddedSizeBytes returns the value that was added to the "size_bytes" field in this mutation.

func (*AttachmentMutation) ClearEdge

func (m *AttachmentMutation) 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 (*AttachmentMutation) ClearField

func (m *AttachmentMutation) 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 (*AttachmentMutation) ClearMessage

func (m *AttachmentMutation) ClearMessage()

ClearMessage clears the "message" edge to the Message entity.

func (*AttachmentMutation) ClearThumbnailPath

func (m *AttachmentMutation) ClearThumbnailPath()

ClearThumbnailPath clears the value of the "thumbnail_path" field.

func (*AttachmentMutation) ClearedEdges

func (m *AttachmentMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*AttachmentMutation) ClearedFields

func (m *AttachmentMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (AttachmentMutation) Client

func (m AttachmentMutation) 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 (*AttachmentMutation) EdgeCleared

func (m *AttachmentMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*AttachmentMutation) Field

func (m *AttachmentMutation) 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 (*AttachmentMutation) FieldCleared

func (m *AttachmentMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*AttachmentMutation) Fields

func (m *AttachmentMutation) 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 (*AttachmentMutation) Filename

func (m *AttachmentMutation) Filename() (r string, exists bool)

Filename returns the value of the "filename" field in the mutation.

func (*AttachmentMutation) ID

func (m *AttachmentMutation) 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 (*AttachmentMutation) IDs

func (m *AttachmentMutation) 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 (*AttachmentMutation) MessageCleared

func (m *AttachmentMutation) MessageCleared() bool

MessageCleared reports if the "message" edge to the Message entity was cleared.

func (*AttachmentMutation) MessageID

func (m *AttachmentMutation) MessageID() (id uuid.UUID, exists bool)

MessageID returns the "message" edge ID in the mutation.

func (*AttachmentMutation) MessageIDs

func (m *AttachmentMutation) MessageIDs() (ids []uuid.UUID)

MessageIDs returns the "message" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MessageID instead. It exists only for internal usage by the builders.

func (*AttachmentMutation) MimeType

func (m *AttachmentMutation) MimeType() (r string, exists bool)

MimeType returns the value of the "mime_type" field in the mutation.

func (*AttachmentMutation) OldField

func (m *AttachmentMutation) 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 (*AttachmentMutation) OldFilename

func (m *AttachmentMutation) OldFilename(ctx context.Context) (v string, err error)

OldFilename returns the old "filename" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldMimeType

func (m *AttachmentMutation) OldMimeType(ctx context.Context) (v string, err error)

OldMimeType returns the old "mime_type" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldPath

func (m *AttachmentMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldSizeBytes

func (m *AttachmentMutation) OldSizeBytes(ctx context.Context) (v int64, err error)

OldSizeBytes returns the old "size_bytes" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldThumbnailPath

func (m *AttachmentMutation) OldThumbnailPath(ctx context.Context) (v *string, err error)

OldThumbnailPath returns the old "thumbnail_path" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) Op

func (m *AttachmentMutation) Op() Op

Op returns the operation name.

func (*AttachmentMutation) Path

func (m *AttachmentMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*AttachmentMutation) RemovedEdges

func (m *AttachmentMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*AttachmentMutation) RemovedIDs

func (m *AttachmentMutation) 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 (*AttachmentMutation) ResetEdge

func (m *AttachmentMutation) 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 (*AttachmentMutation) ResetField

func (m *AttachmentMutation) 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 (*AttachmentMutation) ResetFilename

func (m *AttachmentMutation) ResetFilename()

ResetFilename resets all changes to the "filename" field.

func (*AttachmentMutation) ResetMessage

func (m *AttachmentMutation) ResetMessage()

ResetMessage resets all changes to the "message" edge.

func (*AttachmentMutation) ResetMimeType

func (m *AttachmentMutation) ResetMimeType()

ResetMimeType resets all changes to the "mime_type" field.

func (*AttachmentMutation) ResetPath

func (m *AttachmentMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*AttachmentMutation) ResetSizeBytes

func (m *AttachmentMutation) ResetSizeBytes()

ResetSizeBytes resets all changes to the "size_bytes" field.

func (*AttachmentMutation) ResetThumbnailPath

func (m *AttachmentMutation) ResetThumbnailPath()

ResetThumbnailPath resets all changes to the "thumbnail_path" field.

func (*AttachmentMutation) SetField

func (m *AttachmentMutation) 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 (*AttachmentMutation) SetFilename

func (m *AttachmentMutation) SetFilename(s string)

SetFilename sets the "filename" field.

func (*AttachmentMutation) SetID

func (m *AttachmentMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Attachment entities.

func (*AttachmentMutation) SetMessageID

func (m *AttachmentMutation) SetMessageID(id uuid.UUID)

SetMessageID sets the "message" edge to the Message entity by id.

func (*AttachmentMutation) SetMimeType

func (m *AttachmentMutation) SetMimeType(s string)

SetMimeType sets the "mime_type" field.

func (*AttachmentMutation) SetOp

func (m *AttachmentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AttachmentMutation) SetPath

func (m *AttachmentMutation) SetPath(s string)

SetPath sets the "path" field.

func (*AttachmentMutation) SetSizeBytes

func (m *AttachmentMutation) SetSizeBytes(i int64)

SetSizeBytes sets the "size_bytes" field.

func (*AttachmentMutation) SetThumbnailPath

func (m *AttachmentMutation) SetThumbnailPath(s string)

SetThumbnailPath sets the "thumbnail_path" field.

func (*AttachmentMutation) SizeBytes

func (m *AttachmentMutation) SizeBytes() (r int64, exists bool)

SizeBytes returns the value of the "size_bytes" field in the mutation.

func (*AttachmentMutation) ThumbnailPath

func (m *AttachmentMutation) ThumbnailPath() (r string, exists bool)

ThumbnailPath returns the value of the "thumbnail_path" field in the mutation.

func (*AttachmentMutation) ThumbnailPathCleared

func (m *AttachmentMutation) ThumbnailPathCleared() bool

ThumbnailPathCleared returns if the "thumbnail_path" field was cleared in this mutation.

func (AttachmentMutation) Tx

func (m AttachmentMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*AttachmentMutation) Type

func (m *AttachmentMutation) Type() string

Type returns the node type of this mutation (Attachment).

func (*AttachmentMutation) Where

func (m *AttachmentMutation) Where(ps ...predicate.Attachment)

Where appends a list predicates to the AttachmentMutation builder.

func (*AttachmentMutation) WhereP

func (m *AttachmentMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the AttachmentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type AttachmentQuery

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

AttachmentQuery is the builder for querying Attachment entities.

func (*AttachmentQuery) Aggregate

func (_q *AttachmentQuery) Aggregate(fns ...AggregateFunc) *AttachmentSelect

Aggregate returns a AttachmentSelect configured with the given aggregations.

func (*AttachmentQuery) All

func (_q *AttachmentQuery) All(ctx context.Context) ([]*Attachment, error)

All executes the query and returns a list of Attachments.

func (*AttachmentQuery) AllX

func (_q *AttachmentQuery) AllX(ctx context.Context) []*Attachment

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

func (*AttachmentQuery) Clone

func (_q *AttachmentQuery) Clone() *AttachmentQuery

Clone returns a duplicate of the AttachmentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*AttachmentQuery) Count

func (_q *AttachmentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AttachmentQuery) CountX

func (_q *AttachmentQuery) CountX(ctx context.Context) int

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

func (*AttachmentQuery) Exist

func (_q *AttachmentQuery) Exist(ctx context.Context) (bool, error)

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

func (*AttachmentQuery) ExistX

func (_q *AttachmentQuery) ExistX(ctx context.Context) bool

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

func (*AttachmentQuery) First

func (_q *AttachmentQuery) First(ctx context.Context) (*Attachment, error)

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

func (*AttachmentQuery) FirstID

func (_q *AttachmentQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AttachmentQuery) FirstIDX

func (_q *AttachmentQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AttachmentQuery) FirstX

func (_q *AttachmentQuery) FirstX(ctx context.Context) *Attachment

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

func (*AttachmentQuery) GroupBy

func (_q *AttachmentQuery) GroupBy(field string, fields ...string) *AttachmentGroupBy

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 {
	Filename string `json:"filename,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Attachment.Query().
	GroupBy(attachment.FieldFilename).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AttachmentQuery) IDs

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

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

func (*AttachmentQuery) IDsX

func (_q *AttachmentQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AttachmentQuery) Limit

func (_q *AttachmentQuery) Limit(limit int) *AttachmentQuery

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

func (*AttachmentQuery) Offset

func (_q *AttachmentQuery) Offset(offset int) *AttachmentQuery

Offset to start from.

func (*AttachmentQuery) Only

func (_q *AttachmentQuery) Only(ctx context.Context) (*Attachment, error)

Only returns a single Attachment entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Attachment entity is found. Returns a *NotFoundError when no Attachment entities are found.

func (*AttachmentQuery) OnlyID

func (_q *AttachmentQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Attachment ID in the query. Returns a *NotSingularError when more than one Attachment ID is found. Returns a *NotFoundError when no entities are found.

func (*AttachmentQuery) OnlyIDX

func (_q *AttachmentQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AttachmentQuery) OnlyX

func (_q *AttachmentQuery) OnlyX(ctx context.Context) *Attachment

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

func (*AttachmentQuery) Order

Order specifies how the records should be ordered.

func (*AttachmentQuery) QueryMessage

func (_q *AttachmentQuery) QueryMessage() *MessageQuery

QueryMessage chains the current query on the "message" edge.

func (*AttachmentQuery) Select

func (_q *AttachmentQuery) Select(fields ...string) *AttachmentSelect

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 {
	Filename string `json:"filename,omitempty"`
}

client.Attachment.Query().
	Select(attachment.FieldFilename).
	Scan(ctx, &v)

func (*AttachmentQuery) Unique

func (_q *AttachmentQuery) Unique(unique bool) *AttachmentQuery

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 (*AttachmentQuery) Where

Where adds a new predicate for the AttachmentQuery builder.

func (*AttachmentQuery) WithMessage

func (_q *AttachmentQuery) WithMessage(opts ...func(*MessageQuery)) *AttachmentQuery

WithMessage tells the query-builder to eager-load the nodes that are connected to the "message" edge. The optional arguments are used to configure the query builder of the edge.

type AttachmentSelect

type AttachmentSelect struct {
	*AttachmentQuery
	// contains filtered or unexported fields
}

AttachmentSelect is the builder for selecting fields of Attachment entities.

func (*AttachmentSelect) Aggregate

func (_s *AttachmentSelect) Aggregate(fns ...AggregateFunc) *AttachmentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AttachmentSelect) Bool

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

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

func (*AttachmentSelect) BoolX

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

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

func (*AttachmentSelect) Bools

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

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

func (*AttachmentSelect) BoolsX

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

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

func (*AttachmentSelect) Float64

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

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

func (*AttachmentSelect) Float64X

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

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

func (*AttachmentSelect) Float64s

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

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

func (*AttachmentSelect) Float64sX

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

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

func (*AttachmentSelect) Int

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

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

func (*AttachmentSelect) IntX

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

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

func (*AttachmentSelect) Ints

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

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

func (*AttachmentSelect) IntsX

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

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

func (*AttachmentSelect) Scan

func (_s *AttachmentSelect) Scan(ctx context.Context, v any) error

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

func (*AttachmentSelect) ScanX

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

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

func (*AttachmentSelect) String

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

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

func (*AttachmentSelect) StringX

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

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

func (*AttachmentSelect) Strings

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

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

func (*AttachmentSelect) StringsX

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

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

type AttachmentUpdate

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

AttachmentUpdate is the builder for updating Attachment entities.

func (*AttachmentUpdate) AddSizeBytes

func (_u *AttachmentUpdate) AddSizeBytes(v int64) *AttachmentUpdate

AddSizeBytes adds value to the "size_bytes" field.

func (*AttachmentUpdate) ClearMessage

func (_u *AttachmentUpdate) ClearMessage() *AttachmentUpdate

ClearMessage clears the "message" edge to the Message entity.

func (*AttachmentUpdate) ClearThumbnailPath

func (_u *AttachmentUpdate) ClearThumbnailPath() *AttachmentUpdate

ClearThumbnailPath clears the value of the "thumbnail_path" field.

func (*AttachmentUpdate) Exec

func (_u *AttachmentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachmentUpdate) ExecX

func (_u *AttachmentUpdate) ExecX(ctx context.Context)

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

func (*AttachmentUpdate) Mutation

func (_u *AttachmentUpdate) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentUpdate) Save

func (_u *AttachmentUpdate) Save(ctx context.Context) (int, error)

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

func (*AttachmentUpdate) SaveX

func (_u *AttachmentUpdate) SaveX(ctx context.Context) int

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

func (*AttachmentUpdate) SetFilename

func (_u *AttachmentUpdate) SetFilename(v string) *AttachmentUpdate

SetFilename sets the "filename" field.

func (*AttachmentUpdate) SetMessage

func (_u *AttachmentUpdate) SetMessage(v *Message) *AttachmentUpdate

SetMessage sets the "message" edge to the Message entity.

func (*AttachmentUpdate) SetMessageID

func (_u *AttachmentUpdate) SetMessageID(id uuid.UUID) *AttachmentUpdate

SetMessageID sets the "message" edge to the Message entity by ID.

func (*AttachmentUpdate) SetMimeType

func (_u *AttachmentUpdate) SetMimeType(v string) *AttachmentUpdate

SetMimeType sets the "mime_type" field.

func (*AttachmentUpdate) SetNillableFilename

func (_u *AttachmentUpdate) SetNillableFilename(v *string) *AttachmentUpdate

SetNillableFilename sets the "filename" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableMimeType

func (_u *AttachmentUpdate) SetNillableMimeType(v *string) *AttachmentUpdate

SetNillableMimeType sets the "mime_type" field if the given value is not nil.

func (*AttachmentUpdate) SetNillablePath

func (_u *AttachmentUpdate) SetNillablePath(v *string) *AttachmentUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableSizeBytes

func (_u *AttachmentUpdate) SetNillableSizeBytes(v *int64) *AttachmentUpdate

SetNillableSizeBytes sets the "size_bytes" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableThumbnailPath

func (_u *AttachmentUpdate) SetNillableThumbnailPath(v *string) *AttachmentUpdate

SetNillableThumbnailPath sets the "thumbnail_path" field if the given value is not nil.

func (*AttachmentUpdate) SetPath

func (_u *AttachmentUpdate) SetPath(v string) *AttachmentUpdate

SetPath sets the "path" field.

func (*AttachmentUpdate) SetSizeBytes

func (_u *AttachmentUpdate) SetSizeBytes(v int64) *AttachmentUpdate

SetSizeBytes sets the "size_bytes" field.

func (*AttachmentUpdate) SetThumbnailPath

func (_u *AttachmentUpdate) SetThumbnailPath(v string) *AttachmentUpdate

SetThumbnailPath sets the "thumbnail_path" field.

func (*AttachmentUpdate) Where

Where appends a list predicates to the AttachmentUpdate builder.

type AttachmentUpdateOne

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

AttachmentUpdateOne is the builder for updating a single Attachment entity.

func (*AttachmentUpdateOne) AddSizeBytes

func (_u *AttachmentUpdateOne) AddSizeBytes(v int64) *AttachmentUpdateOne

AddSizeBytes adds value to the "size_bytes" field.

func (*AttachmentUpdateOne) ClearMessage

func (_u *AttachmentUpdateOne) ClearMessage() *AttachmentUpdateOne

ClearMessage clears the "message" edge to the Message entity.

func (*AttachmentUpdateOne) ClearThumbnailPath

func (_u *AttachmentUpdateOne) ClearThumbnailPath() *AttachmentUpdateOne

ClearThumbnailPath clears the value of the "thumbnail_path" field.

func (*AttachmentUpdateOne) Exec

func (_u *AttachmentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AttachmentUpdateOne) ExecX

func (_u *AttachmentUpdateOne) ExecX(ctx context.Context)

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

func (*AttachmentUpdateOne) Mutation

func (_u *AttachmentUpdateOne) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentUpdateOne) Save

Save executes the query and returns the updated Attachment entity.

func (*AttachmentUpdateOne) SaveX

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

func (*AttachmentUpdateOne) Select

func (_u *AttachmentUpdateOne) Select(field string, fields ...string) *AttachmentUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*AttachmentUpdateOne) SetFilename

func (_u *AttachmentUpdateOne) SetFilename(v string) *AttachmentUpdateOne

SetFilename sets the "filename" field.

func (*AttachmentUpdateOne) SetMessage

func (_u *AttachmentUpdateOne) SetMessage(v *Message) *AttachmentUpdateOne

SetMessage sets the "message" edge to the Message entity.

func (*AttachmentUpdateOne) SetMessageID

func (_u *AttachmentUpdateOne) SetMessageID(id uuid.UUID) *AttachmentUpdateOne

SetMessageID sets the "message" edge to the Message entity by ID.

func (*AttachmentUpdateOne) SetMimeType

func (_u *AttachmentUpdateOne) SetMimeType(v string) *AttachmentUpdateOne

SetMimeType sets the "mime_type" field.

func (*AttachmentUpdateOne) SetNillableFilename

func (_u *AttachmentUpdateOne) SetNillableFilename(v *string) *AttachmentUpdateOne

SetNillableFilename sets the "filename" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableMimeType

func (_u *AttachmentUpdateOne) SetNillableMimeType(v *string) *AttachmentUpdateOne

SetNillableMimeType sets the "mime_type" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillablePath

func (_u *AttachmentUpdateOne) SetNillablePath(v *string) *AttachmentUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableSizeBytes

func (_u *AttachmentUpdateOne) SetNillableSizeBytes(v *int64) *AttachmentUpdateOne

SetNillableSizeBytes sets the "size_bytes" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableThumbnailPath

func (_u *AttachmentUpdateOne) SetNillableThumbnailPath(v *string) *AttachmentUpdateOne

SetNillableThumbnailPath sets the "thumbnail_path" field if the given value is not nil.

func (*AttachmentUpdateOne) SetPath

SetPath sets the "path" field.

func (*AttachmentUpdateOne) SetSizeBytes

func (_u *AttachmentUpdateOne) SetSizeBytes(v int64) *AttachmentUpdateOne

SetSizeBytes sets the "size_bytes" field.

func (*AttachmentUpdateOne) SetThumbnailPath

func (_u *AttachmentUpdateOne) SetThumbnailPath(v string) *AttachmentUpdateOne

SetThumbnailPath sets the "thumbnail_path" field.

func (*AttachmentUpdateOne) Where

Where appends a list predicates to the AttachmentUpdate builder.

type Attachments

type Attachments []*Attachment

Attachments is a parsable slice of Attachment.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Attachment is the client for interacting with the Attachment builders.
	Attachment *AttachmentClient
	// Comment is the client for interacting with the Comment builders.
	Comment *CommentClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Reaction is the client for interacting with the Reaction builders.
	Reaction *ReactionClient
	// ToolUsage is the client for interacting with the ToolUsage builders.
	ToolUsage *ToolUsageClient
	// 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().
	Attachment.
	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 added in v1.7.0

type Comment struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// taskwarrior task UUID
	Target string `json:"target,omitempty"`
	// Author holds the value of the "author" field.
	Author string `json:"author,omitempty"`
	// Body holds the value of the "body" field.
	Body string `json:"body,omitempty"`
	// Round holds the value of the "round" field.
	Round int `json:"round,omitempty"`
	// Team holds the value of the "team" field.
	Team string `json:"team,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Comment is the model entity for the Comment schema.

func (*Comment) String added in v1.7.0

func (_m *Comment) String() string

String implements the fmt.Stringer.

func (*Comment) Unwrap added in v1.7.0

func (_m *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 added in v1.7.0

func (_m *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 added in v1.7.0

func (_m *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 added in v1.7.0

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

CommentClient is a client for the Comment schema.

func NewCommentClient added in v1.7.0

func NewCommentClient(c config) *CommentClient

NewCommentClient returns a client for the Comment from the given config.

func (*CommentClient) Create added in v1.7.0

func (c *CommentClient) Create() *CommentCreate

Create returns a builder for creating a Comment entity.

func (*CommentClient) CreateBulk added in v1.7.0

func (c *CommentClient) CreateBulk(builders ...*CommentCreate) *CommentCreateBulk

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

func (*CommentClient) Delete added in v1.7.0

func (c *CommentClient) Delete() *CommentDelete

Delete returns a delete builder for Comment.

func (*CommentClient) DeleteOne added in v1.7.0

func (c *CommentClient) DeleteOne(_m *Comment) *CommentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CommentClient) DeleteOneID added in v1.7.0

func (c *CommentClient) DeleteOneID(id uuid.UUID) *CommentDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CommentClient) Get added in v1.7.0

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

Get returns a Comment entity by its id.

func (*CommentClient) GetX added in v1.7.0

func (c *CommentClient) GetX(ctx context.Context, id uuid.UUID) *Comment

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

func (*CommentClient) Hooks added in v1.7.0

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

Hooks returns the client hooks.

func (*CommentClient) Intercept added in v1.7.0

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 added in v1.7.0

func (c *CommentClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*CommentClient) MapCreateBulk added in v1.7.0

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 added in v1.7.0

func (c *CommentClient) Query() *CommentQuery

Query returns a query builder for Comment.

func (*CommentClient) Update added in v1.7.0

func (c *CommentClient) Update() *CommentUpdate

Update returns an update builder for Comment.

func (*CommentClient) UpdateOne added in v1.7.0

func (c *CommentClient) UpdateOne(_m *Comment) *CommentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CommentClient) UpdateOneID added in v1.7.0

func (c *CommentClient) UpdateOneID(id uuid.UUID) *CommentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CommentClient) Use added in v1.7.0

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 added in v1.7.0

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

CommentCreate is the builder for creating a Comment entity.

func (*CommentCreate) Exec added in v1.7.0

func (_c *CommentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentCreate) ExecX added in v1.7.0

func (_c *CommentCreate) ExecX(ctx context.Context)

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

func (*CommentCreate) Mutation added in v1.7.0

func (_c *CommentCreate) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentCreate) Save added in v1.7.0

func (_c *CommentCreate) Save(ctx context.Context) (*Comment, error)

Save creates the Comment in the database.

func (*CommentCreate) SaveX added in v1.7.0

func (_c *CommentCreate) SaveX(ctx context.Context) *Comment

SaveX calls Save and panics if Save returns an error.

func (*CommentCreate) SetAuthor added in v1.7.0

func (_c *CommentCreate) SetAuthor(v string) *CommentCreate

SetAuthor sets the "author" field.

func (*CommentCreate) SetBody added in v1.7.0

func (_c *CommentCreate) SetBody(v string) *CommentCreate

SetBody sets the "body" field.

func (*CommentCreate) SetCreatedAt added in v1.7.0

func (_c *CommentCreate) SetCreatedAt(v time.Time) *CommentCreate

SetCreatedAt sets the "created_at" field.

func (*CommentCreate) SetID added in v1.7.0

func (_c *CommentCreate) SetID(v uuid.UUID) *CommentCreate

SetID sets the "id" field.

func (*CommentCreate) SetNillableCreatedAt added in v1.7.0

func (_c *CommentCreate) SetNillableCreatedAt(v *time.Time) *CommentCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*CommentCreate) SetNillableID added in v1.7.0

func (_c *CommentCreate) SetNillableID(v *uuid.UUID) *CommentCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*CommentCreate) SetRound added in v1.7.0

func (_c *CommentCreate) SetRound(v int) *CommentCreate

SetRound sets the "round" field.

func (*CommentCreate) SetTarget added in v1.7.0

func (_c *CommentCreate) SetTarget(v string) *CommentCreate

SetTarget sets the "target" field.

func (*CommentCreate) SetTeam added in v1.7.0

func (_c *CommentCreate) SetTeam(v string) *CommentCreate

SetTeam sets the "team" field.

type CommentCreateBulk added in v1.7.0

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

CommentCreateBulk is the builder for creating many Comment entities in bulk.

func (*CommentCreateBulk) Exec added in v1.7.0

func (_c *CommentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentCreateBulk) ExecX added in v1.7.0

func (_c *CommentCreateBulk) ExecX(ctx context.Context)

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

func (*CommentCreateBulk) Save added in v1.7.0

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

Save creates the Comment entities in the database.

func (*CommentCreateBulk) SaveX added in v1.7.0

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

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

type CommentDelete added in v1.7.0

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

CommentDelete is the builder for deleting a Comment entity.

func (*CommentDelete) Exec added in v1.7.0

func (_d *CommentDelete) Exec(ctx context.Context) (int, error)

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

func (*CommentDelete) ExecX added in v1.7.0

func (_d *CommentDelete) ExecX(ctx context.Context) int

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

func (*CommentDelete) Where added in v1.7.0

func (_d *CommentDelete) Where(ps ...predicate.Comment) *CommentDelete

Where appends a list predicates to the CommentDelete builder.

type CommentDeleteOne added in v1.7.0

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

CommentDeleteOne is the builder for deleting a single Comment entity.

func (*CommentDeleteOne) Exec added in v1.7.0

func (_d *CommentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CommentDeleteOne) ExecX added in v1.7.0

func (_d *CommentDeleteOne) ExecX(ctx context.Context)

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

func (*CommentDeleteOne) Where added in v1.7.0

Where appends a list predicates to the CommentDelete builder.

type CommentGroupBy added in v1.7.0

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

CommentGroupBy is the group-by builder for Comment entities.

func (*CommentGroupBy) Aggregate added in v1.7.0

func (_g *CommentGroupBy) Aggregate(fns ...AggregateFunc) *CommentGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*CommentGroupBy) Bool added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentGroupBy) Bools added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentGroupBy) Float64 added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentGroupBy) Float64s added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentGroupBy) Int added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentGroupBy) Ints added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentGroupBy) Scan added in v1.7.0

func (_g *CommentGroupBy) Scan(ctx context.Context, v any) error

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

func (*CommentGroupBy) ScanX added in v1.7.0

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

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

func (*CommentGroupBy) String added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentGroupBy) Strings added in v1.7.0

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 added in v1.7.0

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

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

type CommentMutation added in v1.7.0

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

CommentMutation represents an operation that mutates the Comment nodes in the graph.

func (*CommentMutation) AddField added in v1.7.0

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) AddRound added in v1.7.0

func (m *CommentMutation) AddRound(i int)

AddRound adds i to the "round" field.

func (*CommentMutation) AddedEdges added in v1.7.0

func (m *CommentMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*CommentMutation) AddedField added in v1.7.0

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 added in v1.7.0

func (m *CommentMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*CommentMutation) AddedIDs added in v1.7.0

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) AddedRound added in v1.7.0

func (m *CommentMutation) AddedRound() (r int, exists bool)

AddedRound returns the value that was added to the "round" field in this mutation.

func (*CommentMutation) Author added in v1.7.0

func (m *CommentMutation) Author() (r string, exists bool)

Author returns the value of the "author" field in the mutation.

func (*CommentMutation) Body added in v1.7.0

func (m *CommentMutation) Body() (r string, exists bool)

Body returns the value of the "body" field in the mutation.

func (*CommentMutation) ClearEdge added in v1.7.0

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 added in v1.7.0

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) ClearedEdges added in v1.7.0

func (m *CommentMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*CommentMutation) ClearedFields added in v1.7.0

func (m *CommentMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (CommentMutation) Client added in v1.7.0

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) CreatedAt added in v1.7.0

func (m *CommentMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*CommentMutation) EdgeCleared added in v1.7.0

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 added in v1.7.0

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 added in v1.7.0

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 added in v1.7.0

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 added in v1.7.0

func (m *CommentMutation) 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 (*CommentMutation) IDs added in v1.7.0

func (m *CommentMutation) 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 (*CommentMutation) OldAuthor added in v1.7.0

func (m *CommentMutation) OldAuthor(ctx context.Context) (v string, err error)

OldAuthor returns the old "author" 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) OldBody added in v1.7.0

func (m *CommentMutation) OldBody(ctx context.Context) (v string, err error)

OldBody returns the old "body" 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 added in v1.7.0

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) OldField added in v1.7.0

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) OldRound added in v1.7.0

func (m *CommentMutation) OldRound(ctx context.Context) (v int, err error)

OldRound returns the old "round" 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) OldTarget added in v1.7.0

func (m *CommentMutation) OldTarget(ctx context.Context) (v string, err error)

OldTarget returns the old "target" 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) OldTeam added in v1.7.0

func (m *CommentMutation) OldTeam(ctx context.Context) (v string, err error)

OldTeam returns the old "team" 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 added in v1.7.0

func (m *CommentMutation) Op() Op

Op returns the operation name.

func (*CommentMutation) RemovedEdges added in v1.7.0

func (m *CommentMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*CommentMutation) RemovedIDs added in v1.7.0

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) ResetAuthor added in v1.7.0

func (m *CommentMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" field.

func (*CommentMutation) ResetBody added in v1.7.0

func (m *CommentMutation) ResetBody()

ResetBody resets all changes to the "body" field.

func (*CommentMutation) ResetCreatedAt added in v1.7.0

func (m *CommentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CommentMutation) ResetEdge added in v1.7.0

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 added in v1.7.0

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) ResetRound added in v1.7.0

func (m *CommentMutation) ResetRound()

ResetRound resets all changes to the "round" field.

func (*CommentMutation) ResetTarget added in v1.7.0

func (m *CommentMutation) ResetTarget()

ResetTarget resets all changes to the "target" field.

func (*CommentMutation) ResetTeam added in v1.7.0

func (m *CommentMutation) ResetTeam()

ResetTeam resets all changes to the "team" field.

func (*CommentMutation) Round added in v1.7.0

func (m *CommentMutation) Round() (r int, exists bool)

Round returns the value of the "round" field in the mutation.

func (*CommentMutation) SetAuthor added in v1.7.0

func (m *CommentMutation) SetAuthor(s string)

SetAuthor sets the "author" field.

func (*CommentMutation) SetBody added in v1.7.0

func (m *CommentMutation) SetBody(s string)

SetBody sets the "body" field.

func (*CommentMutation) SetCreatedAt added in v1.7.0

func (m *CommentMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*CommentMutation) SetField added in v1.7.0

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) SetID added in v1.7.0

func (m *CommentMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Comment entities.

func (*CommentMutation) SetOp added in v1.7.0

func (m *CommentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CommentMutation) SetRound added in v1.7.0

func (m *CommentMutation) SetRound(i int)

SetRound sets the "round" field.

func (*CommentMutation) SetTarget added in v1.7.0

func (m *CommentMutation) SetTarget(s string)

SetTarget sets the "target" field.

func (*CommentMutation) SetTeam added in v1.7.0

func (m *CommentMutation) SetTeam(s string)

SetTeam sets the "team" field.

func (*CommentMutation) Target added in v1.7.0

func (m *CommentMutation) Target() (r string, exists bool)

Target returns the value of the "target" field in the mutation.

func (*CommentMutation) Team added in v1.7.0

func (m *CommentMutation) Team() (r string, exists bool)

Team returns the value of the "team" field in the mutation.

func (CommentMutation) Tx added in v1.7.0

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 added in v1.7.0

func (m *CommentMutation) Type() string

Type returns the node type of this mutation (Comment).

func (*CommentMutation) Where added in v1.7.0

func (m *CommentMutation) Where(ps ...predicate.Comment)

Where appends a list predicates to the CommentMutation builder.

func (*CommentMutation) WhereP added in v1.7.0

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 added in v1.7.0

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

CommentQuery is the builder for querying Comment entities.

func (*CommentQuery) Aggregate added in v1.7.0

func (_q *CommentQuery) Aggregate(fns ...AggregateFunc) *CommentSelect

Aggregate returns a CommentSelect configured with the given aggregations.

func (*CommentQuery) All added in v1.7.0

func (_q *CommentQuery) All(ctx context.Context) ([]*Comment, error)

All executes the query and returns a list of Comments.

func (*CommentQuery) AllX added in v1.7.0

func (_q *CommentQuery) AllX(ctx context.Context) []*Comment

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

func (*CommentQuery) Clone added in v1.7.0

func (_q *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 added in v1.7.0

func (_q *CommentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CommentQuery) CountX added in v1.7.0

func (_q *CommentQuery) CountX(ctx context.Context) int

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

func (*CommentQuery) Exist added in v1.7.0

func (_q *CommentQuery) Exist(ctx context.Context) (bool, error)

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

func (*CommentQuery) ExistX added in v1.7.0

func (_q *CommentQuery) ExistX(ctx context.Context) bool

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

func (*CommentQuery) First added in v1.7.0

func (_q *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 added in v1.7.0

func (_q *CommentQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CommentQuery) FirstIDX added in v1.7.0

func (_q *CommentQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CommentQuery) FirstX added in v1.7.0

func (_q *CommentQuery) FirstX(ctx context.Context) *Comment

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

func (*CommentQuery) GroupBy added in v1.7.0

func (_q *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 {
	Target string `json:"target,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Comment.Query().
	GroupBy(comment.FieldTarget).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CommentQuery) IDs added in v1.7.0

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

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

func (*CommentQuery) IDsX added in v1.7.0

func (_q *CommentQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CommentQuery) Limit added in v1.7.0

func (_q *CommentQuery) Limit(limit int) *CommentQuery

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

func (*CommentQuery) Offset added in v1.7.0

func (_q *CommentQuery) Offset(offset int) *CommentQuery

Offset to start from.

func (*CommentQuery) Only added in v1.7.0

func (_q *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 added in v1.7.0

func (_q *CommentQuery) OnlyID(ctx context.Context) (id uuid.UUID, 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 added in v1.7.0

func (_q *CommentQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CommentQuery) OnlyX added in v1.7.0

func (_q *CommentQuery) OnlyX(ctx context.Context) *Comment

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

func (*CommentQuery) Order added in v1.7.0

func (_q *CommentQuery) Order(o ...comment.OrderOption) *CommentQuery

Order specifies how the records should be ordered.

func (*CommentQuery) Select added in v1.7.0

func (_q *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 {
	Target string `json:"target,omitempty"`
}

client.Comment.Query().
	Select(comment.FieldTarget).
	Scan(ctx, &v)

func (*CommentQuery) Unique added in v1.7.0

func (_q *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 added in v1.7.0

func (_q *CommentQuery) Where(ps ...predicate.Comment) *CommentQuery

Where adds a new predicate for the CommentQuery builder.

type CommentSelect added in v1.7.0

type CommentSelect struct {
	*CommentQuery
	// contains filtered or unexported fields
}

CommentSelect is the builder for selecting fields of Comment entities.

func (*CommentSelect) Aggregate added in v1.7.0

func (_s *CommentSelect) Aggregate(fns ...AggregateFunc) *CommentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CommentSelect) Bool added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentSelect) Bools added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentSelect) Float64 added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentSelect) Float64s added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentSelect) Int added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentSelect) Ints added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentSelect) Scan added in v1.7.0

func (_s *CommentSelect) Scan(ctx context.Context, v any) error

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

func (*CommentSelect) ScanX added in v1.7.0

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

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

func (*CommentSelect) String added in v1.7.0

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 added in v1.7.0

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

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

func (*CommentSelect) Strings added in v1.7.0

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 added in v1.7.0

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

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

type CommentUpdate added in v1.7.0

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

CommentUpdate is the builder for updating Comment entities.

func (*CommentUpdate) AddRound added in v1.7.0

func (_u *CommentUpdate) AddRound(v int) *CommentUpdate

AddRound adds value to the "round" field.

func (*CommentUpdate) Exec added in v1.7.0

func (_u *CommentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentUpdate) ExecX added in v1.7.0

func (_u *CommentUpdate) ExecX(ctx context.Context)

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

func (*CommentUpdate) Mutation added in v1.7.0

func (_u *CommentUpdate) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentUpdate) Save added in v1.7.0

func (_u *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 added in v1.7.0

func (_u *CommentUpdate) SaveX(ctx context.Context) int

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

func (*CommentUpdate) SetAuthor added in v1.7.0

func (_u *CommentUpdate) SetAuthor(v string) *CommentUpdate

SetAuthor sets the "author" field.

func (*CommentUpdate) SetBody added in v1.7.0

func (_u *CommentUpdate) SetBody(v string) *CommentUpdate

SetBody sets the "body" field.

func (*CommentUpdate) SetNillableAuthor added in v1.7.0

func (_u *CommentUpdate) SetNillableAuthor(v *string) *CommentUpdate

SetNillableAuthor sets the "author" field if the given value is not nil.

func (*CommentUpdate) SetNillableBody added in v1.7.0

func (_u *CommentUpdate) SetNillableBody(v *string) *CommentUpdate

SetNillableBody sets the "body" field if the given value is not nil.

func (*CommentUpdate) SetNillableRound added in v1.7.0

func (_u *CommentUpdate) SetNillableRound(v *int) *CommentUpdate

SetNillableRound sets the "round" field if the given value is not nil.

func (*CommentUpdate) SetNillableTarget added in v1.7.0

func (_u *CommentUpdate) SetNillableTarget(v *string) *CommentUpdate

SetNillableTarget sets the "target" field if the given value is not nil.

func (*CommentUpdate) SetNillableTeam added in v1.7.0

func (_u *CommentUpdate) SetNillableTeam(v *string) *CommentUpdate

SetNillableTeam sets the "team" field if the given value is not nil.

func (*CommentUpdate) SetRound added in v1.7.0

func (_u *CommentUpdate) SetRound(v int) *CommentUpdate

SetRound sets the "round" field.

func (*CommentUpdate) SetTarget added in v1.7.0

func (_u *CommentUpdate) SetTarget(v string) *CommentUpdate

SetTarget sets the "target" field.

func (*CommentUpdate) SetTeam added in v1.7.0

func (_u *CommentUpdate) SetTeam(v string) *CommentUpdate

SetTeam sets the "team" field.

func (*CommentUpdate) Where added in v1.7.0

func (_u *CommentUpdate) Where(ps ...predicate.Comment) *CommentUpdate

Where appends a list predicates to the CommentUpdate builder.

type CommentUpdateOne added in v1.7.0

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

CommentUpdateOne is the builder for updating a single Comment entity.

func (*CommentUpdateOne) AddRound added in v1.7.0

func (_u *CommentUpdateOne) AddRound(v int) *CommentUpdateOne

AddRound adds value to the "round" field.

func (*CommentUpdateOne) Exec added in v1.7.0

func (_u *CommentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CommentUpdateOne) ExecX added in v1.7.0

func (_u *CommentUpdateOne) ExecX(ctx context.Context)

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

func (*CommentUpdateOne) Mutation added in v1.7.0

func (_u *CommentUpdateOne) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentUpdateOne) Save added in v1.7.0

func (_u *CommentUpdateOne) Save(ctx context.Context) (*Comment, error)

Save executes the query and returns the updated Comment entity.

func (*CommentUpdateOne) SaveX added in v1.7.0

func (_u *CommentUpdateOne) SaveX(ctx context.Context) *Comment

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

func (*CommentUpdateOne) Select added in v1.7.0

func (_u *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) SetAuthor added in v1.7.0

func (_u *CommentUpdateOne) SetAuthor(v string) *CommentUpdateOne

SetAuthor sets the "author" field.

func (*CommentUpdateOne) SetBody added in v1.7.0

func (_u *CommentUpdateOne) SetBody(v string) *CommentUpdateOne

SetBody sets the "body" field.

func (*CommentUpdateOne) SetNillableAuthor added in v1.7.0

func (_u *CommentUpdateOne) SetNillableAuthor(v *string) *CommentUpdateOne

SetNillableAuthor sets the "author" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableBody added in v1.7.0

func (_u *CommentUpdateOne) SetNillableBody(v *string) *CommentUpdateOne

SetNillableBody sets the "body" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableRound added in v1.7.0

func (_u *CommentUpdateOne) SetNillableRound(v *int) *CommentUpdateOne

SetNillableRound sets the "round" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableTarget added in v1.7.0

func (_u *CommentUpdateOne) SetNillableTarget(v *string) *CommentUpdateOne

SetNillableTarget sets the "target" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableTeam added in v1.7.0

func (_u *CommentUpdateOne) SetNillableTeam(v *string) *CommentUpdateOne

SetNillableTeam sets the "team" field if the given value is not nil.

func (*CommentUpdateOne) SetRound added in v1.7.0

func (_u *CommentUpdateOne) SetRound(v int) *CommentUpdateOne

SetRound sets the "round" field.

func (*CommentUpdateOne) SetTarget added in v1.7.0

func (_u *CommentUpdateOne) SetTarget(v string) *CommentUpdateOne

SetTarget sets the "target" field.

func (*CommentUpdateOne) SetTeam added in v1.7.0

func (_u *CommentUpdateOne) SetTeam(v string) *CommentUpdateOne

SetTeam sets the "team" field.

func (*CommentUpdateOne) Where added in v1.7.0

Where appends a list predicates to the CommentUpdate builder.

type Comments added in v1.7.0

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 Message

type Message struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Sender holds the value of the "sender" field.
	Sender string `json:"sender,omitempty"`
	// use 'broadcast' for broadcast messages
	Recipient string `json:"recipient,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// MessageType holds the value of the "message_type" field.
	MessageType message.MessageType `json:"message_type,omitempty"`
	// Team holds the value of the "team" field.
	Team string `json:"team,omitempty"`
	// Channel holds the value of the "channel" field.
	Channel message.Channel `json:"channel,omitempty"`
	// optional — nil for human messages
	Runtime string `json:"runtime,omitempty"`
	// ReplyToID holds the value of the "reply_to_id" field.
	ReplyToID *uuid.UUID `json:"reply_to_id,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 MessageQuery when eager-loading is set.
	Edges MessageEdges `json:"edges"`
	// contains filtered or unexported fields
}

Message is the model entity for the Message schema.

func (*Message) QueryAttachments

func (_m *Message) QueryAttachments() *AttachmentQuery

QueryAttachments queries the "attachments" edge of the Message entity.

func (*Message) QueryReactions

func (_m *Message) QueryReactions() *ReactionQuery

QueryReactions queries the "reactions" edge of the Message entity.

func (*Message) String

func (_m *Message) String() string

String implements the fmt.Stringer.

func (*Message) Unwrap

func (_m *Message) Unwrap() *Message

Unwrap unwraps the Message 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 (*Message) Update

func (_m *Message) Update() *MessageUpdateOne

Update returns a builder for updating this Message. Note that you need to call Message.Unwrap() before calling this method if this Message was returned from a transaction, and the transaction was committed or rolled back.

func (*Message) Value

func (_m *Message) Value(name string) (ent.Value, error)

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

type MessageClient

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

MessageClient is a client for the Message schema.

func NewMessageClient

func NewMessageClient(c config) *MessageClient

NewMessageClient returns a client for the Message from the given config.

func (*MessageClient) Create

func (c *MessageClient) Create() *MessageCreate

Create returns a builder for creating a Message entity.

func (*MessageClient) CreateBulk

func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk

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

func (*MessageClient) Delete

func (c *MessageClient) Delete() *MessageDelete

Delete returns a delete builder for Message.

func (*MessageClient) DeleteOne

func (c *MessageClient) DeleteOne(_m *Message) *MessageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MessageClient) DeleteOneID

func (c *MessageClient) DeleteOneID(id uuid.UUID) *MessageDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MessageClient) Get

func (c *MessageClient) Get(ctx context.Context, id uuid.UUID) (*Message, error)

Get returns a Message entity by its id.

func (*MessageClient) GetX

func (c *MessageClient) GetX(ctx context.Context, id uuid.UUID) *Message

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

func (*MessageClient) Hooks

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

Hooks returns the client hooks.

func (*MessageClient) Intercept

func (c *MessageClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `message.Intercept(f(g(h())))`.

func (*MessageClient) Interceptors

func (c *MessageClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MessageClient) MapCreateBulk

func (c *MessageClient) MapCreateBulk(slice any, setFunc func(*MessageCreate, int)) *MessageCreateBulk

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 (*MessageClient) Query

func (c *MessageClient) Query() *MessageQuery

Query returns a query builder for Message.

func (*MessageClient) QueryAttachments

func (c *MessageClient) QueryAttachments(_m *Message) *AttachmentQuery

QueryAttachments queries the attachments edge of a Message.

func (*MessageClient) QueryReactions

func (c *MessageClient) QueryReactions(_m *Message) *ReactionQuery

QueryReactions queries the reactions edge of a Message.

func (*MessageClient) Update

func (c *MessageClient) Update() *MessageUpdate

Update returns an update builder for Message.

func (*MessageClient) UpdateOne

func (c *MessageClient) UpdateOne(_m *Message) *MessageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MessageClient) UpdateOneID

func (c *MessageClient) UpdateOneID(id uuid.UUID) *MessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MessageClient) Use

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

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

type MessageCreate

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

MessageCreate is the builder for creating a Message entity.

func (*MessageCreate) AddAttachmentIDs

func (_c *MessageCreate) AddAttachmentIDs(ids ...uuid.UUID) *MessageCreate

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*MessageCreate) AddAttachments

func (_c *MessageCreate) AddAttachments(v ...*Attachment) *MessageCreate

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*MessageCreate) AddReactionIDs

func (_c *MessageCreate) AddReactionIDs(ids ...uuid.UUID) *MessageCreate

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*MessageCreate) AddReactions

func (_c *MessageCreate) AddReactions(v ...*Reaction) *MessageCreate

AddReactions adds the "reactions" edges to the Reaction entity.

func (*MessageCreate) Exec

func (_c *MessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreate) ExecX

func (_c *MessageCreate) ExecX(ctx context.Context)

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

func (*MessageCreate) Mutation

func (_c *MessageCreate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageCreate) Save

func (_c *MessageCreate) Save(ctx context.Context) (*Message, error)

Save creates the Message in the database.

func (*MessageCreate) SaveX

func (_c *MessageCreate) SaveX(ctx context.Context) *Message

SaveX calls Save and panics if Save returns an error.

func (*MessageCreate) SetChannel

func (_c *MessageCreate) SetChannel(v message.Channel) *MessageCreate

SetChannel sets the "channel" field.

func (*MessageCreate) SetContent

func (_c *MessageCreate) SetContent(v string) *MessageCreate

SetContent sets the "content" field.

func (*MessageCreate) SetCreatedAt

func (_c *MessageCreate) SetCreatedAt(v time.Time) *MessageCreate

SetCreatedAt sets the "created_at" field.

func (*MessageCreate) SetID

func (_c *MessageCreate) SetID(v uuid.UUID) *MessageCreate

SetID sets the "id" field.

func (*MessageCreate) SetMessageType

func (_c *MessageCreate) SetMessageType(v message.MessageType) *MessageCreate

SetMessageType sets the "message_type" field.

func (*MessageCreate) SetNillableCreatedAt

func (_c *MessageCreate) SetNillableCreatedAt(v *time.Time) *MessageCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MessageCreate) SetNillableID

func (_c *MessageCreate) SetNillableID(v *uuid.UUID) *MessageCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*MessageCreate) SetNillableMessageType

func (_c *MessageCreate) SetNillableMessageType(v *message.MessageType) *MessageCreate

SetNillableMessageType sets the "message_type" field if the given value is not nil.

func (*MessageCreate) SetNillableReplyToID

func (_c *MessageCreate) SetNillableReplyToID(v *uuid.UUID) *MessageCreate

SetNillableReplyToID sets the "reply_to_id" field if the given value is not nil.

func (*MessageCreate) SetNillableRuntime

func (_c *MessageCreate) SetNillableRuntime(v *string) *MessageCreate

SetNillableRuntime sets the "runtime" field if the given value is not nil.

func (*MessageCreate) SetRecipient

func (_c *MessageCreate) SetRecipient(v string) *MessageCreate

SetRecipient sets the "recipient" field.

func (*MessageCreate) SetReplyToID

func (_c *MessageCreate) SetReplyToID(v uuid.UUID) *MessageCreate

SetReplyToID sets the "reply_to_id" field.

func (*MessageCreate) SetRuntime

func (_c *MessageCreate) SetRuntime(v string) *MessageCreate

SetRuntime sets the "runtime" field.

func (*MessageCreate) SetSender

func (_c *MessageCreate) SetSender(v string) *MessageCreate

SetSender sets the "sender" field.

func (*MessageCreate) SetTeam

func (_c *MessageCreate) SetTeam(v string) *MessageCreate

SetTeam sets the "team" field.

type MessageCreateBulk

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

MessageCreateBulk is the builder for creating many Message entities in bulk.

func (*MessageCreateBulk) Exec

func (_c *MessageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreateBulk) ExecX

func (_c *MessageCreateBulk) ExecX(ctx context.Context)

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

func (*MessageCreateBulk) Save

func (_c *MessageCreateBulk) Save(ctx context.Context) ([]*Message, error)

Save creates the Message entities in the database.

func (*MessageCreateBulk) SaveX

func (_c *MessageCreateBulk) SaveX(ctx context.Context) []*Message

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

type MessageDelete

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

MessageDelete is the builder for deleting a Message entity.

func (*MessageDelete) Exec

func (_d *MessageDelete) Exec(ctx context.Context) (int, error)

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

func (*MessageDelete) ExecX

func (_d *MessageDelete) ExecX(ctx context.Context) int

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

func (*MessageDelete) Where

func (_d *MessageDelete) Where(ps ...predicate.Message) *MessageDelete

Where appends a list predicates to the MessageDelete builder.

type MessageDeleteOne

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

MessageDeleteOne is the builder for deleting a single Message entity.

func (*MessageDeleteOne) Exec

func (_d *MessageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MessageDeleteOne) ExecX

func (_d *MessageDeleteOne) ExecX(ctx context.Context)

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

func (*MessageDeleteOne) Where

Where appends a list predicates to the MessageDelete builder.

type MessageEdges

type MessageEdges struct {
	// Attachments holds the value of the attachments edge.
	Attachments []*Attachment `json:"attachments,omitempty"`
	// Reactions holds the value of the reactions edge.
	Reactions []*Reaction `json:"reactions,omitempty"`
	// contains filtered or unexported fields
}

MessageEdges holds the relations/edges for other nodes in the graph.

func (MessageEdges) AttachmentsOrErr

func (e MessageEdges) AttachmentsOrErr() ([]*Attachment, error)

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

func (MessageEdges) ReactionsOrErr

func (e MessageEdges) ReactionsOrErr() ([]*Reaction, error)

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

type MessageGroupBy

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

MessageGroupBy is the group-by builder for Message entities.

func (*MessageGroupBy) Aggregate

func (_g *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MessageGroupBy) Bool

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

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

func (*MessageGroupBy) BoolX

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

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

func (*MessageGroupBy) Bools

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

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

func (*MessageGroupBy) BoolsX

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

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

func (*MessageGroupBy) Float64

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

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

func (*MessageGroupBy) Float64X

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

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

func (*MessageGroupBy) Float64s

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

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

func (*MessageGroupBy) Float64sX

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

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

func (*MessageGroupBy) Int

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

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

func (*MessageGroupBy) IntX

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

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

func (*MessageGroupBy) Ints

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

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

func (*MessageGroupBy) IntsX

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

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

func (*MessageGroupBy) Scan

func (_g *MessageGroupBy) Scan(ctx context.Context, v any) error

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

func (*MessageGroupBy) ScanX

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

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

func (*MessageGroupBy) String

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

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

func (*MessageGroupBy) StringX

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

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

func (*MessageGroupBy) Strings

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

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

func (*MessageGroupBy) StringsX

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

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

type MessageMutation

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

MessageMutation represents an operation that mutates the Message nodes in the graph.

func (*MessageMutation) AddAttachmentIDs

func (m *MessageMutation) AddAttachmentIDs(ids ...uuid.UUID)

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by ids.

func (*MessageMutation) AddField

func (m *MessageMutation) 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 (*MessageMutation) AddReactionIDs

func (m *MessageMutation) AddReactionIDs(ids ...uuid.UUID)

AddReactionIDs adds the "reactions" edge to the Reaction entity by ids.

func (*MessageMutation) AddedEdges

func (m *MessageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MessageMutation) AddedField

func (m *MessageMutation) 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 (*MessageMutation) AddedFields

func (m *MessageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MessageMutation) AddedIDs

func (m *MessageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MessageMutation) AttachmentsCleared

func (m *MessageMutation) AttachmentsCleared() bool

AttachmentsCleared reports if the "attachments" edge to the Attachment entity was cleared.

func (*MessageMutation) AttachmentsIDs

func (m *MessageMutation) AttachmentsIDs() (ids []uuid.UUID)

AttachmentsIDs returns the "attachments" edge IDs in the mutation.

func (*MessageMutation) Channel

func (m *MessageMutation) Channel() (r message.Channel, exists bool)

Channel returns the value of the "channel" field in the mutation.

func (*MessageMutation) ClearAttachments

func (m *MessageMutation) ClearAttachments()

ClearAttachments clears the "attachments" edge to the Attachment entity.

func (*MessageMutation) ClearEdge

func (m *MessageMutation) 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 (*MessageMutation) ClearField

func (m *MessageMutation) 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 (*MessageMutation) ClearReactions

func (m *MessageMutation) ClearReactions()

ClearReactions clears the "reactions" edge to the Reaction entity.

func (*MessageMutation) ClearReplyToID

func (m *MessageMutation) ClearReplyToID()

ClearReplyToID clears the value of the "reply_to_id" field.

func (*MessageMutation) ClearRuntime

func (m *MessageMutation) ClearRuntime()

ClearRuntime clears the value of the "runtime" field.

func (*MessageMutation) ClearedEdges

func (m *MessageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MessageMutation) ClearedFields

func (m *MessageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MessageMutation) Client

func (m MessageMutation) 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 (*MessageMutation) Content

func (m *MessageMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*MessageMutation) CreatedAt

func (m *MessageMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MessageMutation) EdgeCleared

func (m *MessageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MessageMutation) Field

func (m *MessageMutation) 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 (*MessageMutation) FieldCleared

func (m *MessageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MessageMutation) Fields

func (m *MessageMutation) 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 (*MessageMutation) ID

func (m *MessageMutation) 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 (*MessageMutation) IDs

func (m *MessageMutation) 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 (*MessageMutation) MessageType

func (m *MessageMutation) MessageType() (r message.MessageType, exists bool)

MessageType returns the value of the "message_type" field in the mutation.

func (*MessageMutation) OldChannel

func (m *MessageMutation) OldChannel(ctx context.Context) (v message.Channel, err error)

OldChannel returns the old "channel" field's value of the Message entity. If the Message 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 (*MessageMutation) OldContent

func (m *MessageMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Message entity. If the Message 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 (*MessageMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Message entity. If the Message 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 (*MessageMutation) OldField

func (m *MessageMutation) 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 (*MessageMutation) OldMessageType

func (m *MessageMutation) OldMessageType(ctx context.Context) (v message.MessageType, err error)

OldMessageType returns the old "message_type" field's value of the Message entity. If the Message 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 (*MessageMutation) OldRecipient

func (m *MessageMutation) OldRecipient(ctx context.Context) (v string, err error)

OldRecipient returns the old "recipient" field's value of the Message entity. If the Message 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 (*MessageMutation) OldReplyToID

func (m *MessageMutation) OldReplyToID(ctx context.Context) (v *uuid.UUID, err error)

OldReplyToID returns the old "reply_to_id" field's value of the Message entity. If the Message 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 (*MessageMutation) OldRuntime

func (m *MessageMutation) OldRuntime(ctx context.Context) (v string, err error)

OldRuntime returns the old "runtime" field's value of the Message entity. If the Message 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 (*MessageMutation) OldSender

func (m *MessageMutation) OldSender(ctx context.Context) (v string, err error)

OldSender returns the old "sender" field's value of the Message entity. If the Message 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 (*MessageMutation) OldTeam

func (m *MessageMutation) OldTeam(ctx context.Context) (v string, err error)

OldTeam returns the old "team" field's value of the Message entity. If the Message 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 (*MessageMutation) Op

func (m *MessageMutation) Op() Op

Op returns the operation name.

func (*MessageMutation) ReactionsCleared

func (m *MessageMutation) ReactionsCleared() bool

ReactionsCleared reports if the "reactions" edge to the Reaction entity was cleared.

func (*MessageMutation) ReactionsIDs

func (m *MessageMutation) ReactionsIDs() (ids []uuid.UUID)

ReactionsIDs returns the "reactions" edge IDs in the mutation.

func (*MessageMutation) Recipient

func (m *MessageMutation) Recipient() (r string, exists bool)

Recipient returns the value of the "recipient" field in the mutation.

func (*MessageMutation) RemoveAttachmentIDs

func (m *MessageMutation) RemoveAttachmentIDs(ids ...uuid.UUID)

RemoveAttachmentIDs removes the "attachments" edge to the Attachment entity by IDs.

func (*MessageMutation) RemoveReactionIDs

func (m *MessageMutation) RemoveReactionIDs(ids ...uuid.UUID)

RemoveReactionIDs removes the "reactions" edge to the Reaction entity by IDs.

func (*MessageMutation) RemovedAttachmentsIDs

func (m *MessageMutation) RemovedAttachmentsIDs() (ids []uuid.UUID)

RemovedAttachments returns the removed IDs of the "attachments" edge to the Attachment entity.

func (*MessageMutation) RemovedEdges

func (m *MessageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MessageMutation) RemovedIDs

func (m *MessageMutation) 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 (*MessageMutation) RemovedReactionsIDs

func (m *MessageMutation) RemovedReactionsIDs() (ids []uuid.UUID)

RemovedReactions returns the removed IDs of the "reactions" edge to the Reaction entity.

func (*MessageMutation) ReplyToID

func (m *MessageMutation) ReplyToID() (r uuid.UUID, exists bool)

ReplyToID returns the value of the "reply_to_id" field in the mutation.

func (*MessageMutation) ReplyToIDCleared

func (m *MessageMutation) ReplyToIDCleared() bool

ReplyToIDCleared returns if the "reply_to_id" field was cleared in this mutation.

func (*MessageMutation) ResetAttachments

func (m *MessageMutation) ResetAttachments()

ResetAttachments resets all changes to the "attachments" edge.

func (*MessageMutation) ResetChannel

func (m *MessageMutation) ResetChannel()

ResetChannel resets all changes to the "channel" field.

func (*MessageMutation) ResetContent

func (m *MessageMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*MessageMutation) ResetCreatedAt

func (m *MessageMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MessageMutation) ResetEdge

func (m *MessageMutation) 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 (*MessageMutation) ResetField

func (m *MessageMutation) 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 (*MessageMutation) ResetMessageType

func (m *MessageMutation) ResetMessageType()

ResetMessageType resets all changes to the "message_type" field.

func (*MessageMutation) ResetReactions

func (m *MessageMutation) ResetReactions()

ResetReactions resets all changes to the "reactions" edge.

func (*MessageMutation) ResetRecipient

func (m *MessageMutation) ResetRecipient()

ResetRecipient resets all changes to the "recipient" field.

func (*MessageMutation) ResetReplyToID

func (m *MessageMutation) ResetReplyToID()

ResetReplyToID resets all changes to the "reply_to_id" field.

func (*MessageMutation) ResetRuntime

func (m *MessageMutation) ResetRuntime()

ResetRuntime resets all changes to the "runtime" field.

func (*MessageMutation) ResetSender

func (m *MessageMutation) ResetSender()

ResetSender resets all changes to the "sender" field.

func (*MessageMutation) ResetTeam

func (m *MessageMutation) ResetTeam()

ResetTeam resets all changes to the "team" field.

func (*MessageMutation) Runtime

func (m *MessageMutation) Runtime() (r string, exists bool)

Runtime returns the value of the "runtime" field in the mutation.

func (*MessageMutation) RuntimeCleared

func (m *MessageMutation) RuntimeCleared() bool

RuntimeCleared returns if the "runtime" field was cleared in this mutation.

func (*MessageMutation) Sender

func (m *MessageMutation) Sender() (r string, exists bool)

Sender returns the value of the "sender" field in the mutation.

func (*MessageMutation) SetChannel

func (m *MessageMutation) SetChannel(value message.Channel)

SetChannel sets the "channel" field.

func (*MessageMutation) SetContent

func (m *MessageMutation) SetContent(s string)

SetContent sets the "content" field.

func (*MessageMutation) SetCreatedAt

func (m *MessageMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MessageMutation) SetField

func (m *MessageMutation) 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 (*MessageMutation) SetID

func (m *MessageMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Message entities.

func (*MessageMutation) SetMessageType

func (m *MessageMutation) SetMessageType(mt message.MessageType)

SetMessageType sets the "message_type" field.

func (*MessageMutation) SetOp

func (m *MessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MessageMutation) SetRecipient

func (m *MessageMutation) SetRecipient(s string)

SetRecipient sets the "recipient" field.

func (*MessageMutation) SetReplyToID

func (m *MessageMutation) SetReplyToID(u uuid.UUID)

SetReplyToID sets the "reply_to_id" field.

func (*MessageMutation) SetRuntime

func (m *MessageMutation) SetRuntime(s string)

SetRuntime sets the "runtime" field.

func (*MessageMutation) SetSender

func (m *MessageMutation) SetSender(s string)

SetSender sets the "sender" field.

func (*MessageMutation) SetTeam

func (m *MessageMutation) SetTeam(s string)

SetTeam sets the "team" field.

func (*MessageMutation) Team

func (m *MessageMutation) Team() (r string, exists bool)

Team returns the value of the "team" field in the mutation.

func (MessageMutation) Tx

func (m MessageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MessageMutation) Type

func (m *MessageMutation) Type() string

Type returns the node type of this mutation (Message).

func (*MessageMutation) Where

func (m *MessageMutation) Where(ps ...predicate.Message)

Where appends a list predicates to the MessageMutation builder.

func (*MessageMutation) WhereP

func (m *MessageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MessageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MessageQuery

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

MessageQuery is the builder for querying Message entities.

func (*MessageQuery) Aggregate

func (_q *MessageQuery) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate returns a MessageSelect configured with the given aggregations.

func (*MessageQuery) All

func (_q *MessageQuery) All(ctx context.Context) ([]*Message, error)

All executes the query and returns a list of Messages.

func (*MessageQuery) AllX

func (_q *MessageQuery) AllX(ctx context.Context) []*Message

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

func (*MessageQuery) Clone

func (_q *MessageQuery) Clone() *MessageQuery

Clone returns a duplicate of the MessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MessageQuery) Count

func (_q *MessageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MessageQuery) CountX

func (_q *MessageQuery) CountX(ctx context.Context) int

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

func (*MessageQuery) Exist

func (_q *MessageQuery) Exist(ctx context.Context) (bool, error)

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

func (*MessageQuery) ExistX

func (_q *MessageQuery) ExistX(ctx context.Context) bool

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

func (*MessageQuery) First

func (_q *MessageQuery) First(ctx context.Context) (*Message, error)

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

func (*MessageQuery) FirstID

func (_q *MessageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*MessageQuery) FirstIDX

func (_q *MessageQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*MessageQuery) FirstX

func (_q *MessageQuery) FirstX(ctx context.Context) *Message

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

func (*MessageQuery) GroupBy

func (_q *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy

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 {
	Sender string `json:"sender,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Message.Query().
	GroupBy(message.FieldSender).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MessageQuery) IDs

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

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

func (*MessageQuery) IDsX

func (_q *MessageQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*MessageQuery) Limit

func (_q *MessageQuery) Limit(limit int) *MessageQuery

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

func (*MessageQuery) Offset

func (_q *MessageQuery) Offset(offset int) *MessageQuery

Offset to start from.

func (*MessageQuery) Only

func (_q *MessageQuery) Only(ctx context.Context) (*Message, error)

Only returns a single Message entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Message entity is found. Returns a *NotFoundError when no Message entities are found.

func (*MessageQuery) OnlyID

func (_q *MessageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Message ID in the query. Returns a *NotSingularError when more than one Message ID is found. Returns a *NotFoundError when no entities are found.

func (*MessageQuery) OnlyIDX

func (_q *MessageQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*MessageQuery) OnlyX

func (_q *MessageQuery) OnlyX(ctx context.Context) *Message

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

func (*MessageQuery) Order

func (_q *MessageQuery) Order(o ...message.OrderOption) *MessageQuery

Order specifies how the records should be ordered.

func (*MessageQuery) QueryAttachments

func (_q *MessageQuery) QueryAttachments() *AttachmentQuery

QueryAttachments chains the current query on the "attachments" edge.

func (*MessageQuery) QueryReactions

func (_q *MessageQuery) QueryReactions() *ReactionQuery

QueryReactions chains the current query on the "reactions" edge.

func (*MessageQuery) Select

func (_q *MessageQuery) Select(fields ...string) *MessageSelect

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 {
	Sender string `json:"sender,omitempty"`
}

client.Message.Query().
	Select(message.FieldSender).
	Scan(ctx, &v)

func (*MessageQuery) Unique

func (_q *MessageQuery) Unique(unique bool) *MessageQuery

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 (*MessageQuery) Where

func (_q *MessageQuery) Where(ps ...predicate.Message) *MessageQuery

Where adds a new predicate for the MessageQuery builder.

func (*MessageQuery) WithAttachments

func (_q *MessageQuery) WithAttachments(opts ...func(*AttachmentQuery)) *MessageQuery

WithAttachments tells the query-builder to eager-load the nodes that are connected to the "attachments" edge. The optional arguments are used to configure the query builder of the edge.

func (*MessageQuery) WithReactions

func (_q *MessageQuery) WithReactions(opts ...func(*ReactionQuery)) *MessageQuery

WithReactions tells the query-builder to eager-load the nodes that are connected to the "reactions" edge. The optional arguments are used to configure the query builder of the edge.

type MessageSelect

type MessageSelect struct {
	*MessageQuery
	// contains filtered or unexported fields
}

MessageSelect is the builder for selecting fields of Message entities.

func (*MessageSelect) Aggregate

func (_s *MessageSelect) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MessageSelect) Bool

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

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

func (*MessageSelect) BoolX

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

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

func (*MessageSelect) Bools

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

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

func (*MessageSelect) BoolsX

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

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

func (*MessageSelect) Float64

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

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

func (*MessageSelect) Float64X

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

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

func (*MessageSelect) Float64s

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

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

func (*MessageSelect) Float64sX

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

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

func (*MessageSelect) Int

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

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

func (*MessageSelect) IntX

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

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

func (*MessageSelect) Ints

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

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

func (*MessageSelect) IntsX

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

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

func (*MessageSelect) Scan

func (_s *MessageSelect) Scan(ctx context.Context, v any) error

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

func (*MessageSelect) ScanX

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

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

func (*MessageSelect) String

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

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

func (*MessageSelect) StringX

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

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

func (*MessageSelect) Strings

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

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

func (*MessageSelect) StringsX

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

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

type MessageUpdate

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

MessageUpdate is the builder for updating Message entities.

func (*MessageUpdate) AddAttachmentIDs

func (_u *MessageUpdate) AddAttachmentIDs(ids ...uuid.UUID) *MessageUpdate

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*MessageUpdate) AddAttachments

func (_u *MessageUpdate) AddAttachments(v ...*Attachment) *MessageUpdate

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*MessageUpdate) AddReactionIDs

func (_u *MessageUpdate) AddReactionIDs(ids ...uuid.UUID) *MessageUpdate

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*MessageUpdate) AddReactions

func (_u *MessageUpdate) AddReactions(v ...*Reaction) *MessageUpdate

AddReactions adds the "reactions" edges to the Reaction entity.

func (*MessageUpdate) ClearAttachments

func (_u *MessageUpdate) ClearAttachments() *MessageUpdate

ClearAttachments clears all "attachments" edges to the Attachment entity.

func (*MessageUpdate) ClearReactions

func (_u *MessageUpdate) ClearReactions() *MessageUpdate

ClearReactions clears all "reactions" edges to the Reaction entity.

func (*MessageUpdate) ClearReplyToID

func (_u *MessageUpdate) ClearReplyToID() *MessageUpdate

ClearReplyToID clears the value of the "reply_to_id" field.

func (*MessageUpdate) ClearRuntime

func (_u *MessageUpdate) ClearRuntime() *MessageUpdate

ClearRuntime clears the value of the "runtime" field.

func (*MessageUpdate) Exec

func (_u *MessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageUpdate) ExecX

func (_u *MessageUpdate) ExecX(ctx context.Context)

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

func (*MessageUpdate) Mutation

func (_u *MessageUpdate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdate) RemoveAttachmentIDs

func (_u *MessageUpdate) RemoveAttachmentIDs(ids ...uuid.UUID) *MessageUpdate

RemoveAttachmentIDs removes the "attachments" edge to Attachment entities by IDs.

func (*MessageUpdate) RemoveAttachments

func (_u *MessageUpdate) RemoveAttachments(v ...*Attachment) *MessageUpdate

RemoveAttachments removes "attachments" edges to Attachment entities.

func (*MessageUpdate) RemoveReactionIDs

func (_u *MessageUpdate) RemoveReactionIDs(ids ...uuid.UUID) *MessageUpdate

RemoveReactionIDs removes the "reactions" edge to Reaction entities by IDs.

func (*MessageUpdate) RemoveReactions

func (_u *MessageUpdate) RemoveReactions(v ...*Reaction) *MessageUpdate

RemoveReactions removes "reactions" edges to Reaction entities.

func (*MessageUpdate) Save

func (_u *MessageUpdate) Save(ctx context.Context) (int, error)

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

func (*MessageUpdate) SaveX

func (_u *MessageUpdate) SaveX(ctx context.Context) int

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

func (*MessageUpdate) SetChannel

func (_u *MessageUpdate) SetChannel(v message.Channel) *MessageUpdate

SetChannel sets the "channel" field.

func (*MessageUpdate) SetContent

func (_u *MessageUpdate) SetContent(v string) *MessageUpdate

SetContent sets the "content" field.

func (*MessageUpdate) SetMessageType

func (_u *MessageUpdate) SetMessageType(v message.MessageType) *MessageUpdate

SetMessageType sets the "message_type" field.

func (*MessageUpdate) SetNillableChannel

func (_u *MessageUpdate) SetNillableChannel(v *message.Channel) *MessageUpdate

SetNillableChannel sets the "channel" field if the given value is not nil.

func (*MessageUpdate) SetNillableContent

func (_u *MessageUpdate) SetNillableContent(v *string) *MessageUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*MessageUpdate) SetNillableMessageType

func (_u *MessageUpdate) SetNillableMessageType(v *message.MessageType) *MessageUpdate

SetNillableMessageType sets the "message_type" field if the given value is not nil.

func (*MessageUpdate) SetNillableRecipient

func (_u *MessageUpdate) SetNillableRecipient(v *string) *MessageUpdate

SetNillableRecipient sets the "recipient" field if the given value is not nil.

func (*MessageUpdate) SetNillableReplyToID

func (_u *MessageUpdate) SetNillableReplyToID(v *uuid.UUID) *MessageUpdate

SetNillableReplyToID sets the "reply_to_id" field if the given value is not nil.

func (*MessageUpdate) SetNillableRuntime

func (_u *MessageUpdate) SetNillableRuntime(v *string) *MessageUpdate

SetNillableRuntime sets the "runtime" field if the given value is not nil.

func (*MessageUpdate) SetNillableSender

func (_u *MessageUpdate) SetNillableSender(v *string) *MessageUpdate

SetNillableSender sets the "sender" field if the given value is not nil.

func (*MessageUpdate) SetNillableTeam

func (_u *MessageUpdate) SetNillableTeam(v *string) *MessageUpdate

SetNillableTeam sets the "team" field if the given value is not nil.

func (*MessageUpdate) SetRecipient

func (_u *MessageUpdate) SetRecipient(v string) *MessageUpdate

SetRecipient sets the "recipient" field.

func (*MessageUpdate) SetReplyToID

func (_u *MessageUpdate) SetReplyToID(v uuid.UUID) *MessageUpdate

SetReplyToID sets the "reply_to_id" field.

func (*MessageUpdate) SetRuntime

func (_u *MessageUpdate) SetRuntime(v string) *MessageUpdate

SetRuntime sets the "runtime" field.

func (*MessageUpdate) SetSender

func (_u *MessageUpdate) SetSender(v string) *MessageUpdate

SetSender sets the "sender" field.

func (*MessageUpdate) SetTeam

func (_u *MessageUpdate) SetTeam(v string) *MessageUpdate

SetTeam sets the "team" field.

func (*MessageUpdate) Where

func (_u *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate

Where appends a list predicates to the MessageUpdate builder.

type MessageUpdateOne

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

MessageUpdateOne is the builder for updating a single Message entity.

func (*MessageUpdateOne) AddAttachmentIDs

func (_u *MessageUpdateOne) AddAttachmentIDs(ids ...uuid.UUID) *MessageUpdateOne

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*MessageUpdateOne) AddAttachments

func (_u *MessageUpdateOne) AddAttachments(v ...*Attachment) *MessageUpdateOne

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*MessageUpdateOne) AddReactionIDs

func (_u *MessageUpdateOne) AddReactionIDs(ids ...uuid.UUID) *MessageUpdateOne

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*MessageUpdateOne) AddReactions

func (_u *MessageUpdateOne) AddReactions(v ...*Reaction) *MessageUpdateOne

AddReactions adds the "reactions" edges to the Reaction entity.

func (*MessageUpdateOne) ClearAttachments

func (_u *MessageUpdateOne) ClearAttachments() *MessageUpdateOne

ClearAttachments clears all "attachments" edges to the Attachment entity.

func (*MessageUpdateOne) ClearReactions

func (_u *MessageUpdateOne) ClearReactions() *MessageUpdateOne

ClearReactions clears all "reactions" edges to the Reaction entity.

func (*MessageUpdateOne) ClearReplyToID

func (_u *MessageUpdateOne) ClearReplyToID() *MessageUpdateOne

ClearReplyToID clears the value of the "reply_to_id" field.

func (*MessageUpdateOne) ClearRuntime

func (_u *MessageUpdateOne) ClearRuntime() *MessageUpdateOne

ClearRuntime clears the value of the "runtime" field.

func (*MessageUpdateOne) Exec

func (_u *MessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MessageUpdateOne) ExecX

func (_u *MessageUpdateOne) ExecX(ctx context.Context)

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

func (*MessageUpdateOne) Mutation

func (_u *MessageUpdateOne) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdateOne) RemoveAttachmentIDs

func (_u *MessageUpdateOne) RemoveAttachmentIDs(ids ...uuid.UUID) *MessageUpdateOne

RemoveAttachmentIDs removes the "attachments" edge to Attachment entities by IDs.

func (*MessageUpdateOne) RemoveAttachments

func (_u *MessageUpdateOne) RemoveAttachments(v ...*Attachment) *MessageUpdateOne

RemoveAttachments removes "attachments" edges to Attachment entities.

func (*MessageUpdateOne) RemoveReactionIDs

func (_u *MessageUpdateOne) RemoveReactionIDs(ids ...uuid.UUID) *MessageUpdateOne

RemoveReactionIDs removes the "reactions" edge to Reaction entities by IDs.

func (*MessageUpdateOne) RemoveReactions

func (_u *MessageUpdateOne) RemoveReactions(v ...*Reaction) *MessageUpdateOne

RemoveReactions removes "reactions" edges to Reaction entities.

func (*MessageUpdateOne) Save

func (_u *MessageUpdateOne) Save(ctx context.Context) (*Message, error)

Save executes the query and returns the updated Message entity.

func (*MessageUpdateOne) SaveX

func (_u *MessageUpdateOne) SaveX(ctx context.Context) *Message

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

func (*MessageUpdateOne) Select

func (_u *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MessageUpdateOne) SetChannel

func (_u *MessageUpdateOne) SetChannel(v message.Channel) *MessageUpdateOne

SetChannel sets the "channel" field.

func (*MessageUpdateOne) SetContent

func (_u *MessageUpdateOne) SetContent(v string) *MessageUpdateOne

SetContent sets the "content" field.

func (*MessageUpdateOne) SetMessageType

func (_u *MessageUpdateOne) SetMessageType(v message.MessageType) *MessageUpdateOne

SetMessageType sets the "message_type" field.

func (*MessageUpdateOne) SetNillableChannel

func (_u *MessageUpdateOne) SetNillableChannel(v *message.Channel) *MessageUpdateOne

SetNillableChannel sets the "channel" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableContent

func (_u *MessageUpdateOne) SetNillableContent(v *string) *MessageUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableMessageType

func (_u *MessageUpdateOne) SetNillableMessageType(v *message.MessageType) *MessageUpdateOne

SetNillableMessageType sets the "message_type" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableRecipient

func (_u *MessageUpdateOne) SetNillableRecipient(v *string) *MessageUpdateOne

SetNillableRecipient sets the "recipient" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableReplyToID

func (_u *MessageUpdateOne) SetNillableReplyToID(v *uuid.UUID) *MessageUpdateOne

SetNillableReplyToID sets the "reply_to_id" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableRuntime

func (_u *MessageUpdateOne) SetNillableRuntime(v *string) *MessageUpdateOne

SetNillableRuntime sets the "runtime" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableSender

func (_u *MessageUpdateOne) SetNillableSender(v *string) *MessageUpdateOne

SetNillableSender sets the "sender" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableTeam

func (_u *MessageUpdateOne) SetNillableTeam(v *string) *MessageUpdateOne

SetNillableTeam sets the "team" field if the given value is not nil.

func (*MessageUpdateOne) SetRecipient

func (_u *MessageUpdateOne) SetRecipient(v string) *MessageUpdateOne

SetRecipient sets the "recipient" field.

func (*MessageUpdateOne) SetReplyToID

func (_u *MessageUpdateOne) SetReplyToID(v uuid.UUID) *MessageUpdateOne

SetReplyToID sets the "reply_to_id" field.

func (*MessageUpdateOne) SetRuntime

func (_u *MessageUpdateOne) SetRuntime(v string) *MessageUpdateOne

SetRuntime sets the "runtime" field.

func (*MessageUpdateOne) SetSender

func (_u *MessageUpdateOne) SetSender(v string) *MessageUpdateOne

SetSender sets the "sender" field.

func (*MessageUpdateOne) SetTeam

func (_u *MessageUpdateOne) SetTeam(v string) *MessageUpdateOne

SetTeam sets the "team" field.

func (*MessageUpdateOne) Where

Where appends a list predicates to the MessageUpdate builder.

type Messages

type Messages []*Message

Messages is a parsable slice of Message.

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 Reaction

type Reaction struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Emoji holds the value of the "emoji" field.
	Emoji string `json:"emoji,omitempty"`
	// FromAgent holds the value of the "from_agent" field.
	FromAgent string `json:"from_agent,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 ReactionQuery when eager-loading is set.
	Edges ReactionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Reaction is the model entity for the Reaction schema.

func (*Reaction) QueryMessage

func (_m *Reaction) QueryMessage() *MessageQuery

QueryMessage queries the "message" edge of the Reaction entity.

func (*Reaction) String

func (_m *Reaction) String() string

String implements the fmt.Stringer.

func (*Reaction) Unwrap

func (_m *Reaction) Unwrap() *Reaction

Unwrap unwraps the Reaction 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 (*Reaction) Update

func (_m *Reaction) Update() *ReactionUpdateOne

Update returns a builder for updating this Reaction. Note that you need to call Reaction.Unwrap() before calling this method if this Reaction was returned from a transaction, and the transaction was committed or rolled back.

func (*Reaction) Value

func (_m *Reaction) Value(name string) (ent.Value, error)

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

type ReactionClient

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

ReactionClient is a client for the Reaction schema.

func NewReactionClient

func NewReactionClient(c config) *ReactionClient

NewReactionClient returns a client for the Reaction from the given config.

func (*ReactionClient) Create

func (c *ReactionClient) Create() *ReactionCreate

Create returns a builder for creating a Reaction entity.

func (*ReactionClient) CreateBulk

func (c *ReactionClient) CreateBulk(builders ...*ReactionCreate) *ReactionCreateBulk

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

func (*ReactionClient) Delete

func (c *ReactionClient) Delete() *ReactionDelete

Delete returns a delete builder for Reaction.

func (*ReactionClient) DeleteOne

func (c *ReactionClient) DeleteOne(_m *Reaction) *ReactionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ReactionClient) DeleteOneID

func (c *ReactionClient) DeleteOneID(id uuid.UUID) *ReactionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ReactionClient) Get

func (c *ReactionClient) Get(ctx context.Context, id uuid.UUID) (*Reaction, error)

Get returns a Reaction entity by its id.

func (*ReactionClient) GetX

func (c *ReactionClient) GetX(ctx context.Context, id uuid.UUID) *Reaction

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

func (*ReactionClient) Hooks

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

Hooks returns the client hooks.

func (*ReactionClient) Intercept

func (c *ReactionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `reaction.Intercept(f(g(h())))`.

func (*ReactionClient) Interceptors

func (c *ReactionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ReactionClient) MapCreateBulk

func (c *ReactionClient) MapCreateBulk(slice any, setFunc func(*ReactionCreate, int)) *ReactionCreateBulk

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 (*ReactionClient) Query

func (c *ReactionClient) Query() *ReactionQuery

Query returns a query builder for Reaction.

func (*ReactionClient) QueryMessage

func (c *ReactionClient) QueryMessage(_m *Reaction) *MessageQuery

QueryMessage queries the message edge of a Reaction.

func (*ReactionClient) Update

func (c *ReactionClient) Update() *ReactionUpdate

Update returns an update builder for Reaction.

func (*ReactionClient) UpdateOne

func (c *ReactionClient) UpdateOne(_m *Reaction) *ReactionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReactionClient) UpdateOneID

func (c *ReactionClient) UpdateOneID(id uuid.UUID) *ReactionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ReactionClient) Use

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

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

type ReactionCreate

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

ReactionCreate is the builder for creating a Reaction entity.

func (*ReactionCreate) Exec

func (_c *ReactionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionCreate) ExecX

func (_c *ReactionCreate) ExecX(ctx context.Context)

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

func (*ReactionCreate) Mutation

func (_c *ReactionCreate) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionCreate) Save

func (_c *ReactionCreate) Save(ctx context.Context) (*Reaction, error)

Save creates the Reaction in the database.

func (*ReactionCreate) SaveX

func (_c *ReactionCreate) SaveX(ctx context.Context) *Reaction

SaveX calls Save and panics if Save returns an error.

func (*ReactionCreate) SetCreatedAt

func (_c *ReactionCreate) SetCreatedAt(v time.Time) *ReactionCreate

SetCreatedAt sets the "created_at" field.

func (*ReactionCreate) SetEmoji

func (_c *ReactionCreate) SetEmoji(v string) *ReactionCreate

SetEmoji sets the "emoji" field.

func (*ReactionCreate) SetFromAgent

func (_c *ReactionCreate) SetFromAgent(v string) *ReactionCreate

SetFromAgent sets the "from_agent" field.

func (*ReactionCreate) SetID

func (_c *ReactionCreate) SetID(v uuid.UUID) *ReactionCreate

SetID sets the "id" field.

func (*ReactionCreate) SetMessage

func (_c *ReactionCreate) SetMessage(v *Message) *ReactionCreate

SetMessage sets the "message" edge to the Message entity.

func (*ReactionCreate) SetMessageID

func (_c *ReactionCreate) SetMessageID(id uuid.UUID) *ReactionCreate

SetMessageID sets the "message" edge to the Message entity by ID.

func (*ReactionCreate) SetNillableCreatedAt

func (_c *ReactionCreate) SetNillableCreatedAt(v *time.Time) *ReactionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ReactionCreate) SetNillableID

func (_c *ReactionCreate) SetNillableID(v *uuid.UUID) *ReactionCreate

SetNillableID sets the "id" field if the given value is not nil.

type ReactionCreateBulk

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

ReactionCreateBulk is the builder for creating many Reaction entities in bulk.

func (*ReactionCreateBulk) Exec

func (_c *ReactionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionCreateBulk) ExecX

func (_c *ReactionCreateBulk) ExecX(ctx context.Context)

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

func (*ReactionCreateBulk) Save

func (_c *ReactionCreateBulk) Save(ctx context.Context) ([]*Reaction, error)

Save creates the Reaction entities in the database.

func (*ReactionCreateBulk) SaveX

func (_c *ReactionCreateBulk) SaveX(ctx context.Context) []*Reaction

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

type ReactionDelete

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

ReactionDelete is the builder for deleting a Reaction entity.

func (*ReactionDelete) Exec

func (_d *ReactionDelete) Exec(ctx context.Context) (int, error)

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

func (*ReactionDelete) ExecX

func (_d *ReactionDelete) ExecX(ctx context.Context) int

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

func (*ReactionDelete) Where

func (_d *ReactionDelete) Where(ps ...predicate.Reaction) *ReactionDelete

Where appends a list predicates to the ReactionDelete builder.

type ReactionDeleteOne

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

ReactionDeleteOne is the builder for deleting a single Reaction entity.

func (*ReactionDeleteOne) Exec

func (_d *ReactionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReactionDeleteOne) ExecX

func (_d *ReactionDeleteOne) ExecX(ctx context.Context)

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

func (*ReactionDeleteOne) Where

Where appends a list predicates to the ReactionDelete builder.

type ReactionEdges

type ReactionEdges struct {
	// Message holds the value of the message edge.
	Message *Message `json:"message,omitempty"`
	// contains filtered or unexported fields
}

ReactionEdges holds the relations/edges for other nodes in the graph.

func (ReactionEdges) MessageOrErr

func (e ReactionEdges) MessageOrErr() (*Message, error)

MessageOrErr returns the Message value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ReactionGroupBy

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

ReactionGroupBy is the group-by builder for Reaction entities.

func (*ReactionGroupBy) Aggregate

func (_g *ReactionGroupBy) Aggregate(fns ...AggregateFunc) *ReactionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ReactionGroupBy) Bool

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

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

func (*ReactionGroupBy) BoolX

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

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

func (*ReactionGroupBy) Bools

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

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

func (*ReactionGroupBy) BoolsX

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

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

func (*ReactionGroupBy) Float64

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

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

func (*ReactionGroupBy) Float64X

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

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

func (*ReactionGroupBy) Float64s

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

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

func (*ReactionGroupBy) Float64sX

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

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

func (*ReactionGroupBy) Int

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

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

func (*ReactionGroupBy) IntX

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

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

func (*ReactionGroupBy) Ints

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

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

func (*ReactionGroupBy) IntsX

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

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

func (*ReactionGroupBy) Scan

func (_g *ReactionGroupBy) Scan(ctx context.Context, v any) error

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

func (*ReactionGroupBy) ScanX

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

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

func (*ReactionGroupBy) String

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

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

func (*ReactionGroupBy) StringX

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

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

func (*ReactionGroupBy) Strings

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

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

func (*ReactionGroupBy) StringsX

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

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

type ReactionMutation

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

ReactionMutation represents an operation that mutates the Reaction nodes in the graph.

func (*ReactionMutation) AddField

func (m *ReactionMutation) 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 (*ReactionMutation) AddedEdges

func (m *ReactionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ReactionMutation) AddedField

func (m *ReactionMutation) 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 (*ReactionMutation) AddedFields

func (m *ReactionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ReactionMutation) AddedIDs

func (m *ReactionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ReactionMutation) ClearEdge

func (m *ReactionMutation) 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 (*ReactionMutation) ClearField

func (m *ReactionMutation) 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 (*ReactionMutation) ClearMessage

func (m *ReactionMutation) ClearMessage()

ClearMessage clears the "message" edge to the Message entity.

func (*ReactionMutation) ClearedEdges

func (m *ReactionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ReactionMutation) ClearedFields

func (m *ReactionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ReactionMutation) Client

func (m ReactionMutation) 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 (*ReactionMutation) CreatedAt

func (m *ReactionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ReactionMutation) EdgeCleared

func (m *ReactionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ReactionMutation) Emoji

func (m *ReactionMutation) Emoji() (r string, exists bool)

Emoji returns the value of the "emoji" field in the mutation.

func (*ReactionMutation) Field

func (m *ReactionMutation) 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 (*ReactionMutation) FieldCleared

func (m *ReactionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ReactionMutation) Fields

func (m *ReactionMutation) 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 (*ReactionMutation) FromAgent

func (m *ReactionMutation) FromAgent() (r string, exists bool)

FromAgent returns the value of the "from_agent" field in the mutation.

func (*ReactionMutation) ID

func (m *ReactionMutation) 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 (*ReactionMutation) IDs

func (m *ReactionMutation) 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 (*ReactionMutation) MessageCleared

func (m *ReactionMutation) MessageCleared() bool

MessageCleared reports if the "message" edge to the Message entity was cleared.

func (*ReactionMutation) MessageID

func (m *ReactionMutation) MessageID() (id uuid.UUID, exists bool)

MessageID returns the "message" edge ID in the mutation.

func (*ReactionMutation) MessageIDs

func (m *ReactionMutation) MessageIDs() (ids []uuid.UUID)

MessageIDs returns the "message" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MessageID instead. It exists only for internal usage by the builders.

func (*ReactionMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Reaction entity. If the Reaction 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 (*ReactionMutation) OldEmoji

func (m *ReactionMutation) OldEmoji(ctx context.Context) (v string, err error)

OldEmoji returns the old "emoji" field's value of the Reaction entity. If the Reaction 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 (*ReactionMutation) OldField

func (m *ReactionMutation) 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 (*ReactionMutation) OldFromAgent

func (m *ReactionMutation) OldFromAgent(ctx context.Context) (v string, err error)

OldFromAgent returns the old "from_agent" field's value of the Reaction entity. If the Reaction 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 (*ReactionMutation) Op

func (m *ReactionMutation) Op() Op

Op returns the operation name.

func (*ReactionMutation) RemovedEdges

func (m *ReactionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ReactionMutation) RemovedIDs

func (m *ReactionMutation) 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 (*ReactionMutation) ResetCreatedAt

func (m *ReactionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ReactionMutation) ResetEdge

func (m *ReactionMutation) 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 (*ReactionMutation) ResetEmoji

func (m *ReactionMutation) ResetEmoji()

ResetEmoji resets all changes to the "emoji" field.

func (*ReactionMutation) ResetField

func (m *ReactionMutation) 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 (*ReactionMutation) ResetFromAgent

func (m *ReactionMutation) ResetFromAgent()

ResetFromAgent resets all changes to the "from_agent" field.

func (*ReactionMutation) ResetMessage

func (m *ReactionMutation) ResetMessage()

ResetMessage resets all changes to the "message" edge.

func (*ReactionMutation) SetCreatedAt

func (m *ReactionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ReactionMutation) SetEmoji

func (m *ReactionMutation) SetEmoji(s string)

SetEmoji sets the "emoji" field.

func (*ReactionMutation) SetField

func (m *ReactionMutation) 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 (*ReactionMutation) SetFromAgent

func (m *ReactionMutation) SetFromAgent(s string)

SetFromAgent sets the "from_agent" field.

func (*ReactionMutation) SetID

func (m *ReactionMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Reaction entities.

func (*ReactionMutation) SetMessageID

func (m *ReactionMutation) SetMessageID(id uuid.UUID)

SetMessageID sets the "message" edge to the Message entity by id.

func (*ReactionMutation) SetOp

func (m *ReactionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (ReactionMutation) Tx

func (m ReactionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ReactionMutation) Type

func (m *ReactionMutation) Type() string

Type returns the node type of this mutation (Reaction).

func (*ReactionMutation) Where

func (m *ReactionMutation) Where(ps ...predicate.Reaction)

Where appends a list predicates to the ReactionMutation builder.

func (*ReactionMutation) WhereP

func (m *ReactionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ReactionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ReactionQuery

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

ReactionQuery is the builder for querying Reaction entities.

func (*ReactionQuery) Aggregate

func (_q *ReactionQuery) Aggregate(fns ...AggregateFunc) *ReactionSelect

Aggregate returns a ReactionSelect configured with the given aggregations.

func (*ReactionQuery) All

func (_q *ReactionQuery) All(ctx context.Context) ([]*Reaction, error)

All executes the query and returns a list of Reactions.

func (*ReactionQuery) AllX

func (_q *ReactionQuery) AllX(ctx context.Context) []*Reaction

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

func (*ReactionQuery) Clone

func (_q *ReactionQuery) Clone() *ReactionQuery

Clone returns a duplicate of the ReactionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ReactionQuery) Count

func (_q *ReactionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReactionQuery) CountX

func (_q *ReactionQuery) CountX(ctx context.Context) int

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

func (*ReactionQuery) Exist

func (_q *ReactionQuery) Exist(ctx context.Context) (bool, error)

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

func (*ReactionQuery) ExistX

func (_q *ReactionQuery) ExistX(ctx context.Context) bool

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

func (*ReactionQuery) First

func (_q *ReactionQuery) First(ctx context.Context) (*Reaction, error)

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

func (*ReactionQuery) FirstID

func (_q *ReactionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ReactionQuery) FirstIDX

func (_q *ReactionQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ReactionQuery) FirstX

func (_q *ReactionQuery) FirstX(ctx context.Context) *Reaction

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

func (*ReactionQuery) GroupBy

func (_q *ReactionQuery) GroupBy(field string, fields ...string) *ReactionGroupBy

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 {
	Emoji string `json:"emoji,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Reaction.Query().
	GroupBy(reaction.FieldEmoji).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReactionQuery) IDs

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

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

func (*ReactionQuery) IDsX

func (_q *ReactionQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ReactionQuery) Limit

func (_q *ReactionQuery) Limit(limit int) *ReactionQuery

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

func (*ReactionQuery) Offset

func (_q *ReactionQuery) Offset(offset int) *ReactionQuery

Offset to start from.

func (*ReactionQuery) Only

func (_q *ReactionQuery) Only(ctx context.Context) (*Reaction, error)

Only returns a single Reaction entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Reaction entity is found. Returns a *NotFoundError when no Reaction entities are found.

func (*ReactionQuery) OnlyID

func (_q *ReactionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Reaction ID in the query. Returns a *NotSingularError when more than one Reaction ID is found. Returns a *NotFoundError when no entities are found.

func (*ReactionQuery) OnlyIDX

func (_q *ReactionQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ReactionQuery) OnlyX

func (_q *ReactionQuery) OnlyX(ctx context.Context) *Reaction

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

func (*ReactionQuery) Order

Order specifies how the records should be ordered.

func (*ReactionQuery) QueryMessage

func (_q *ReactionQuery) QueryMessage() *MessageQuery

QueryMessage chains the current query on the "message" edge.

func (*ReactionQuery) Select

func (_q *ReactionQuery) Select(fields ...string) *ReactionSelect

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 {
	Emoji string `json:"emoji,omitempty"`
}

client.Reaction.Query().
	Select(reaction.FieldEmoji).
	Scan(ctx, &v)

func (*ReactionQuery) Unique

func (_q *ReactionQuery) Unique(unique bool) *ReactionQuery

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 (*ReactionQuery) Where

func (_q *ReactionQuery) Where(ps ...predicate.Reaction) *ReactionQuery

Where adds a new predicate for the ReactionQuery builder.

func (*ReactionQuery) WithMessage

func (_q *ReactionQuery) WithMessage(opts ...func(*MessageQuery)) *ReactionQuery

WithMessage tells the query-builder to eager-load the nodes that are connected to the "message" edge. The optional arguments are used to configure the query builder of the edge.

type ReactionSelect

type ReactionSelect struct {
	*ReactionQuery
	// contains filtered or unexported fields
}

ReactionSelect is the builder for selecting fields of Reaction entities.

func (*ReactionSelect) Aggregate

func (_s *ReactionSelect) Aggregate(fns ...AggregateFunc) *ReactionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ReactionSelect) Bool

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

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

func (*ReactionSelect) BoolX

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

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

func (*ReactionSelect) Bools

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

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

func (*ReactionSelect) BoolsX

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

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

func (*ReactionSelect) Float64

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

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

func (*ReactionSelect) Float64X

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

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

func (*ReactionSelect) Float64s

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

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

func (*ReactionSelect) Float64sX

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

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

func (*ReactionSelect) Int

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

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

func (*ReactionSelect) IntX

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

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

func (*ReactionSelect) Ints

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

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

func (*ReactionSelect) IntsX

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

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

func (*ReactionSelect) Scan

func (_s *ReactionSelect) Scan(ctx context.Context, v any) error

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

func (*ReactionSelect) ScanX

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

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

func (*ReactionSelect) String

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

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

func (*ReactionSelect) StringX

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

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

func (*ReactionSelect) Strings

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

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

func (*ReactionSelect) StringsX

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

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

type ReactionUpdate

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

ReactionUpdate is the builder for updating Reaction entities.

func (*ReactionUpdate) ClearMessage

func (_u *ReactionUpdate) ClearMessage() *ReactionUpdate

ClearMessage clears the "message" edge to the Message entity.

func (*ReactionUpdate) Exec

func (_u *ReactionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionUpdate) ExecX

func (_u *ReactionUpdate) ExecX(ctx context.Context)

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

func (*ReactionUpdate) Mutation

func (_u *ReactionUpdate) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionUpdate) Save

func (_u *ReactionUpdate) Save(ctx context.Context) (int, error)

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

func (*ReactionUpdate) SaveX

func (_u *ReactionUpdate) SaveX(ctx context.Context) int

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

func (*ReactionUpdate) SetEmoji

func (_u *ReactionUpdate) SetEmoji(v string) *ReactionUpdate

SetEmoji sets the "emoji" field.

func (*ReactionUpdate) SetFromAgent

func (_u *ReactionUpdate) SetFromAgent(v string) *ReactionUpdate

SetFromAgent sets the "from_agent" field.

func (*ReactionUpdate) SetMessage

func (_u *ReactionUpdate) SetMessage(v *Message) *ReactionUpdate

SetMessage sets the "message" edge to the Message entity.

func (*ReactionUpdate) SetMessageID

func (_u *ReactionUpdate) SetMessageID(id uuid.UUID) *ReactionUpdate

SetMessageID sets the "message" edge to the Message entity by ID.

func (*ReactionUpdate) SetNillableEmoji

func (_u *ReactionUpdate) SetNillableEmoji(v *string) *ReactionUpdate

SetNillableEmoji sets the "emoji" field if the given value is not nil.

func (*ReactionUpdate) SetNillableFromAgent

func (_u *ReactionUpdate) SetNillableFromAgent(v *string) *ReactionUpdate

SetNillableFromAgent sets the "from_agent" field if the given value is not nil.

func (*ReactionUpdate) Where

func (_u *ReactionUpdate) Where(ps ...predicate.Reaction) *ReactionUpdate

Where appends a list predicates to the ReactionUpdate builder.

type ReactionUpdateOne

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

ReactionUpdateOne is the builder for updating a single Reaction entity.

func (*ReactionUpdateOne) ClearMessage

func (_u *ReactionUpdateOne) ClearMessage() *ReactionUpdateOne

ClearMessage clears the "message" edge to the Message entity.

func (*ReactionUpdateOne) Exec

func (_u *ReactionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReactionUpdateOne) ExecX

func (_u *ReactionUpdateOne) ExecX(ctx context.Context)

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

func (*ReactionUpdateOne) Mutation

func (_u *ReactionUpdateOne) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionUpdateOne) Save

func (_u *ReactionUpdateOne) Save(ctx context.Context) (*Reaction, error)

Save executes the query and returns the updated Reaction entity.

func (*ReactionUpdateOne) SaveX

func (_u *ReactionUpdateOne) SaveX(ctx context.Context) *Reaction

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

func (*ReactionUpdateOne) Select

func (_u *ReactionUpdateOne) Select(field string, fields ...string) *ReactionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ReactionUpdateOne) SetEmoji

func (_u *ReactionUpdateOne) SetEmoji(v string) *ReactionUpdateOne

SetEmoji sets the "emoji" field.

func (*ReactionUpdateOne) SetFromAgent

func (_u *ReactionUpdateOne) SetFromAgent(v string) *ReactionUpdateOne

SetFromAgent sets the "from_agent" field.

func (*ReactionUpdateOne) SetMessage

func (_u *ReactionUpdateOne) SetMessage(v *Message) *ReactionUpdateOne

SetMessage sets the "message" edge to the Message entity.

func (*ReactionUpdateOne) SetMessageID

func (_u *ReactionUpdateOne) SetMessageID(id uuid.UUID) *ReactionUpdateOne

SetMessageID sets the "message" edge to the Message entity by ID.

func (*ReactionUpdateOne) SetNillableEmoji

func (_u *ReactionUpdateOne) SetNillableEmoji(v *string) *ReactionUpdateOne

SetNillableEmoji sets the "emoji" field if the given value is not nil.

func (*ReactionUpdateOne) SetNillableFromAgent

func (_u *ReactionUpdateOne) SetNillableFromAgent(v *string) *ReactionUpdateOne

SetNillableFromAgent sets the "from_agent" field if the given value is not nil.

func (*ReactionUpdateOne) Where

Where appends a list predicates to the ReactionUpdate builder.

type Reactions

type Reactions []*Reaction

Reactions is a parsable slice of Reaction.

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 ToolUsage added in v1.1.0

type ToolUsage struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Agent holds the value of the "agent" field.
	Agent string `json:"agent,omitempty"`
	// Team holds the value of the "team" field.
	Team string `json:"team,omitempty"`
	// Command holds the value of the "command" field.
	Command string `json:"command,omitempty"`
	// Subcommand holds the value of the "subcommand" field.
	Subcommand string `json:"subcommand,omitempty"`
	// Target holds the value of the "target" field.
	Target string `json:"target,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

ToolUsage is the model entity for the ToolUsage schema.

func (*ToolUsage) String added in v1.1.0

func (_m *ToolUsage) String() string

String implements the fmt.Stringer.

func (*ToolUsage) Unwrap added in v1.1.0

func (_m *ToolUsage) Unwrap() *ToolUsage

Unwrap unwraps the ToolUsage 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 (*ToolUsage) Update added in v1.1.0

func (_m *ToolUsage) Update() *ToolUsageUpdateOne

Update returns a builder for updating this ToolUsage. Note that you need to call ToolUsage.Unwrap() before calling this method if this ToolUsage was returned from a transaction, and the transaction was committed or rolled back.

func (*ToolUsage) Value added in v1.1.0

func (_m *ToolUsage) Value(name string) (ent.Value, error)

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

type ToolUsageClient added in v1.1.0

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

ToolUsageClient is a client for the ToolUsage schema.

func NewToolUsageClient added in v1.1.0

func NewToolUsageClient(c config) *ToolUsageClient

NewToolUsageClient returns a client for the ToolUsage from the given config.

func (*ToolUsageClient) Create added in v1.1.0

func (c *ToolUsageClient) Create() *ToolUsageCreate

Create returns a builder for creating a ToolUsage entity.

func (*ToolUsageClient) CreateBulk added in v1.1.0

func (c *ToolUsageClient) CreateBulk(builders ...*ToolUsageCreate) *ToolUsageCreateBulk

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

func (*ToolUsageClient) Delete added in v1.1.0

func (c *ToolUsageClient) Delete() *ToolUsageDelete

Delete returns a delete builder for ToolUsage.

func (*ToolUsageClient) DeleteOne added in v1.1.0

func (c *ToolUsageClient) DeleteOne(_m *ToolUsage) *ToolUsageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ToolUsageClient) DeleteOneID added in v1.1.0

func (c *ToolUsageClient) DeleteOneID(id uuid.UUID) *ToolUsageDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ToolUsageClient) Get added in v1.1.0

func (c *ToolUsageClient) Get(ctx context.Context, id uuid.UUID) (*ToolUsage, error)

Get returns a ToolUsage entity by its id.

func (*ToolUsageClient) GetX added in v1.1.0

func (c *ToolUsageClient) GetX(ctx context.Context, id uuid.UUID) *ToolUsage

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

func (*ToolUsageClient) Hooks added in v1.1.0

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

Hooks returns the client hooks.

func (*ToolUsageClient) Intercept added in v1.1.0

func (c *ToolUsageClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `toolusage.Intercept(f(g(h())))`.

func (*ToolUsageClient) Interceptors added in v1.1.0

func (c *ToolUsageClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ToolUsageClient) MapCreateBulk added in v1.1.0

func (c *ToolUsageClient) MapCreateBulk(slice any, setFunc func(*ToolUsageCreate, int)) *ToolUsageCreateBulk

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 (*ToolUsageClient) Query added in v1.1.0

func (c *ToolUsageClient) Query() *ToolUsageQuery

Query returns a query builder for ToolUsage.

func (*ToolUsageClient) Update added in v1.1.0

func (c *ToolUsageClient) Update() *ToolUsageUpdate

Update returns an update builder for ToolUsage.

func (*ToolUsageClient) UpdateOne added in v1.1.0

func (c *ToolUsageClient) UpdateOne(_m *ToolUsage) *ToolUsageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ToolUsageClient) UpdateOneID added in v1.1.0

func (c *ToolUsageClient) UpdateOneID(id uuid.UUID) *ToolUsageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ToolUsageClient) Use added in v1.1.0

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

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

type ToolUsageCreate added in v1.1.0

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

ToolUsageCreate is the builder for creating a ToolUsage entity.

func (*ToolUsageCreate) Exec added in v1.1.0

func (_c *ToolUsageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ToolUsageCreate) ExecX added in v1.1.0

func (_c *ToolUsageCreate) ExecX(ctx context.Context)

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

func (*ToolUsageCreate) Mutation added in v1.1.0

func (_c *ToolUsageCreate) Mutation() *ToolUsageMutation

Mutation returns the ToolUsageMutation object of the builder.

func (*ToolUsageCreate) Save added in v1.1.0

func (_c *ToolUsageCreate) Save(ctx context.Context) (*ToolUsage, error)

Save creates the ToolUsage in the database.

func (*ToolUsageCreate) SaveX added in v1.1.0

func (_c *ToolUsageCreate) SaveX(ctx context.Context) *ToolUsage

SaveX calls Save and panics if Save returns an error.

func (*ToolUsageCreate) SetAgent added in v1.1.0

func (_c *ToolUsageCreate) SetAgent(v string) *ToolUsageCreate

SetAgent sets the "agent" field.

func (*ToolUsageCreate) SetCommand added in v1.1.0

func (_c *ToolUsageCreate) SetCommand(v string) *ToolUsageCreate

SetCommand sets the "command" field.

func (*ToolUsageCreate) SetCreatedAt added in v1.1.0

func (_c *ToolUsageCreate) SetCreatedAt(v time.Time) *ToolUsageCreate

SetCreatedAt sets the "created_at" field.

func (*ToolUsageCreate) SetID added in v1.1.0

func (_c *ToolUsageCreate) SetID(v uuid.UUID) *ToolUsageCreate

SetID sets the "id" field.

func (*ToolUsageCreate) SetNillableCreatedAt added in v1.1.0

func (_c *ToolUsageCreate) SetNillableCreatedAt(v *time.Time) *ToolUsageCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ToolUsageCreate) SetNillableID added in v1.1.0

func (_c *ToolUsageCreate) SetNillableID(v *uuid.UUID) *ToolUsageCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ToolUsageCreate) SetNillableTarget added in v1.1.0

func (_c *ToolUsageCreate) SetNillableTarget(v *string) *ToolUsageCreate

SetNillableTarget sets the "target" field if the given value is not nil.

func (*ToolUsageCreate) SetSubcommand added in v1.1.0

func (_c *ToolUsageCreate) SetSubcommand(v string) *ToolUsageCreate

SetSubcommand sets the "subcommand" field.

func (*ToolUsageCreate) SetTarget added in v1.1.0

func (_c *ToolUsageCreate) SetTarget(v string) *ToolUsageCreate

SetTarget sets the "target" field.

func (*ToolUsageCreate) SetTeam added in v1.1.0

func (_c *ToolUsageCreate) SetTeam(v string) *ToolUsageCreate

SetTeam sets the "team" field.

type ToolUsageCreateBulk added in v1.1.0

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

ToolUsageCreateBulk is the builder for creating many ToolUsage entities in bulk.

func (*ToolUsageCreateBulk) Exec added in v1.1.0

func (_c *ToolUsageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ToolUsageCreateBulk) ExecX added in v1.1.0

func (_c *ToolUsageCreateBulk) ExecX(ctx context.Context)

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

func (*ToolUsageCreateBulk) Save added in v1.1.0

func (_c *ToolUsageCreateBulk) Save(ctx context.Context) ([]*ToolUsage, error)

Save creates the ToolUsage entities in the database.

func (*ToolUsageCreateBulk) SaveX added in v1.1.0

func (_c *ToolUsageCreateBulk) SaveX(ctx context.Context) []*ToolUsage

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

type ToolUsageDelete added in v1.1.0

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

ToolUsageDelete is the builder for deleting a ToolUsage entity.

func (*ToolUsageDelete) Exec added in v1.1.0

func (_d *ToolUsageDelete) Exec(ctx context.Context) (int, error)

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

func (*ToolUsageDelete) ExecX added in v1.1.0

func (_d *ToolUsageDelete) ExecX(ctx context.Context) int

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

func (*ToolUsageDelete) Where added in v1.1.0

Where appends a list predicates to the ToolUsageDelete builder.

type ToolUsageDeleteOne added in v1.1.0

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

ToolUsageDeleteOne is the builder for deleting a single ToolUsage entity.

func (*ToolUsageDeleteOne) Exec added in v1.1.0

func (_d *ToolUsageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ToolUsageDeleteOne) ExecX added in v1.1.0

func (_d *ToolUsageDeleteOne) ExecX(ctx context.Context)

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

func (*ToolUsageDeleteOne) Where added in v1.1.0

Where appends a list predicates to the ToolUsageDelete builder.

type ToolUsageGroupBy added in v1.1.0

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

ToolUsageGroupBy is the group-by builder for ToolUsage entities.

func (*ToolUsageGroupBy) Aggregate added in v1.1.0

func (_g *ToolUsageGroupBy) Aggregate(fns ...AggregateFunc) *ToolUsageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ToolUsageGroupBy) Bool added in v1.1.0

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

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

func (*ToolUsageGroupBy) BoolX added in v1.1.0

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

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

func (*ToolUsageGroupBy) Bools added in v1.1.0

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

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

func (*ToolUsageGroupBy) BoolsX added in v1.1.0

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

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

func (*ToolUsageGroupBy) Float64 added in v1.1.0

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

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

func (*ToolUsageGroupBy) Float64X added in v1.1.0

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

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

func (*ToolUsageGroupBy) Float64s added in v1.1.0

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

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

func (*ToolUsageGroupBy) Float64sX added in v1.1.0

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

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

func (*ToolUsageGroupBy) Int added in v1.1.0

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

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

func (*ToolUsageGroupBy) IntX added in v1.1.0

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

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

func (*ToolUsageGroupBy) Ints added in v1.1.0

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

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

func (*ToolUsageGroupBy) IntsX added in v1.1.0

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

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

func (*ToolUsageGroupBy) Scan added in v1.1.0

func (_g *ToolUsageGroupBy) Scan(ctx context.Context, v any) error

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

func (*ToolUsageGroupBy) ScanX added in v1.1.0

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

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

func (*ToolUsageGroupBy) String added in v1.1.0

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

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

func (*ToolUsageGroupBy) StringX added in v1.1.0

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

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

func (*ToolUsageGroupBy) Strings added in v1.1.0

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

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

func (*ToolUsageGroupBy) StringsX added in v1.1.0

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

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

type ToolUsageMutation added in v1.1.0

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

ToolUsageMutation represents an operation that mutates the ToolUsage nodes in the graph.

func (*ToolUsageMutation) AddField added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) AddedEdges added in v1.1.0

func (m *ToolUsageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ToolUsageMutation) AddedField added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) AddedFields added in v1.1.0

func (m *ToolUsageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ToolUsageMutation) AddedIDs added in v1.1.0

func (m *ToolUsageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ToolUsageMutation) Agent added in v1.1.0

func (m *ToolUsageMutation) Agent() (r string, exists bool)

Agent returns the value of the "agent" field in the mutation.

func (*ToolUsageMutation) ClearEdge added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) ClearField added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) ClearTarget added in v1.1.0

func (m *ToolUsageMutation) ClearTarget()

ClearTarget clears the value of the "target" field.

func (*ToolUsageMutation) ClearedEdges added in v1.1.0

func (m *ToolUsageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ToolUsageMutation) ClearedFields added in v1.1.0

func (m *ToolUsageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ToolUsageMutation) Client added in v1.1.0

func (m ToolUsageMutation) 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 (*ToolUsageMutation) Command added in v1.1.0

func (m *ToolUsageMutation) Command() (r string, exists bool)

Command returns the value of the "command" field in the mutation.

func (*ToolUsageMutation) CreatedAt added in v1.1.0

func (m *ToolUsageMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ToolUsageMutation) EdgeCleared added in v1.1.0

func (m *ToolUsageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ToolUsageMutation) Field added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) FieldCleared added in v1.1.0

func (m *ToolUsageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ToolUsageMutation) Fields added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) ID added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) IDs added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) OldAgent added in v1.1.0

func (m *ToolUsageMutation) OldAgent(ctx context.Context) (v string, err error)

OldAgent returns the old "agent" field's value of the ToolUsage entity. If the ToolUsage 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 (*ToolUsageMutation) OldCommand added in v1.1.0

func (m *ToolUsageMutation) OldCommand(ctx context.Context) (v string, err error)

OldCommand returns the old "command" field's value of the ToolUsage entity. If the ToolUsage 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 (*ToolUsageMutation) OldCreatedAt added in v1.1.0

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

OldCreatedAt returns the old "created_at" field's value of the ToolUsage entity. If the ToolUsage 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 (*ToolUsageMutation) OldField added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) OldSubcommand added in v1.1.0

func (m *ToolUsageMutation) OldSubcommand(ctx context.Context) (v string, err error)

OldSubcommand returns the old "subcommand" field's value of the ToolUsage entity. If the ToolUsage 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 (*ToolUsageMutation) OldTarget added in v1.1.0

func (m *ToolUsageMutation) OldTarget(ctx context.Context) (v string, err error)

OldTarget returns the old "target" field's value of the ToolUsage entity. If the ToolUsage 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 (*ToolUsageMutation) OldTeam added in v1.1.0

func (m *ToolUsageMutation) OldTeam(ctx context.Context) (v string, err error)

OldTeam returns the old "team" field's value of the ToolUsage entity. If the ToolUsage 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 (*ToolUsageMutation) Op added in v1.1.0

func (m *ToolUsageMutation) Op() Op

Op returns the operation name.

func (*ToolUsageMutation) RemovedEdges added in v1.1.0

func (m *ToolUsageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ToolUsageMutation) RemovedIDs added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) ResetAgent added in v1.1.0

func (m *ToolUsageMutation) ResetAgent()

ResetAgent resets all changes to the "agent" field.

func (*ToolUsageMutation) ResetCommand added in v1.1.0

func (m *ToolUsageMutation) ResetCommand()

ResetCommand resets all changes to the "command" field.

func (*ToolUsageMutation) ResetCreatedAt added in v1.1.0

func (m *ToolUsageMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ToolUsageMutation) ResetEdge added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) ResetField added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) ResetSubcommand added in v1.1.0

func (m *ToolUsageMutation) ResetSubcommand()

ResetSubcommand resets all changes to the "subcommand" field.

func (*ToolUsageMutation) ResetTarget added in v1.1.0

func (m *ToolUsageMutation) ResetTarget()

ResetTarget resets all changes to the "target" field.

func (*ToolUsageMutation) ResetTeam added in v1.1.0

func (m *ToolUsageMutation) ResetTeam()

ResetTeam resets all changes to the "team" field.

func (*ToolUsageMutation) SetAgent added in v1.1.0

func (m *ToolUsageMutation) SetAgent(s string)

SetAgent sets the "agent" field.

func (*ToolUsageMutation) SetCommand added in v1.1.0

func (m *ToolUsageMutation) SetCommand(s string)

SetCommand sets the "command" field.

func (*ToolUsageMutation) SetCreatedAt added in v1.1.0

func (m *ToolUsageMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ToolUsageMutation) SetField added in v1.1.0

func (m *ToolUsageMutation) 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 (*ToolUsageMutation) SetID added in v1.1.0

func (m *ToolUsageMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ToolUsage entities.

func (*ToolUsageMutation) SetOp added in v1.1.0

func (m *ToolUsageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ToolUsageMutation) SetSubcommand added in v1.1.0

func (m *ToolUsageMutation) SetSubcommand(s string)

SetSubcommand sets the "subcommand" field.

func (*ToolUsageMutation) SetTarget added in v1.1.0

func (m *ToolUsageMutation) SetTarget(s string)

SetTarget sets the "target" field.

func (*ToolUsageMutation) SetTeam added in v1.1.0

func (m *ToolUsageMutation) SetTeam(s string)

SetTeam sets the "team" field.

func (*ToolUsageMutation) Subcommand added in v1.1.0

func (m *ToolUsageMutation) Subcommand() (r string, exists bool)

Subcommand returns the value of the "subcommand" field in the mutation.

func (*ToolUsageMutation) Target added in v1.1.0

func (m *ToolUsageMutation) Target() (r string, exists bool)

Target returns the value of the "target" field in the mutation.

func (*ToolUsageMutation) TargetCleared added in v1.1.0

func (m *ToolUsageMutation) TargetCleared() bool

TargetCleared returns if the "target" field was cleared in this mutation.

func (*ToolUsageMutation) Team added in v1.1.0

func (m *ToolUsageMutation) Team() (r string, exists bool)

Team returns the value of the "team" field in the mutation.

func (ToolUsageMutation) Tx added in v1.1.0

func (m ToolUsageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ToolUsageMutation) Type added in v1.1.0

func (m *ToolUsageMutation) Type() string

Type returns the node type of this mutation (ToolUsage).

func (*ToolUsageMutation) Where added in v1.1.0

func (m *ToolUsageMutation) Where(ps ...predicate.ToolUsage)

Where appends a list predicates to the ToolUsageMutation builder.

func (*ToolUsageMutation) WhereP added in v1.1.0

func (m *ToolUsageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ToolUsageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ToolUsageQuery added in v1.1.0

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

ToolUsageQuery is the builder for querying ToolUsage entities.

func (*ToolUsageQuery) Aggregate added in v1.1.0

func (_q *ToolUsageQuery) Aggregate(fns ...AggregateFunc) *ToolUsageSelect

Aggregate returns a ToolUsageSelect configured with the given aggregations.

func (*ToolUsageQuery) All added in v1.1.0

func (_q *ToolUsageQuery) All(ctx context.Context) ([]*ToolUsage, error)

All executes the query and returns a list of ToolUsages.

func (*ToolUsageQuery) AllX added in v1.1.0

func (_q *ToolUsageQuery) AllX(ctx context.Context) []*ToolUsage

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

func (*ToolUsageQuery) Clone added in v1.1.0

func (_q *ToolUsageQuery) Clone() *ToolUsageQuery

Clone returns a duplicate of the ToolUsageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ToolUsageQuery) Count added in v1.1.0

func (_q *ToolUsageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ToolUsageQuery) CountX added in v1.1.0

func (_q *ToolUsageQuery) CountX(ctx context.Context) int

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

func (*ToolUsageQuery) Exist added in v1.1.0

func (_q *ToolUsageQuery) Exist(ctx context.Context) (bool, error)

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

func (*ToolUsageQuery) ExistX added in v1.1.0

func (_q *ToolUsageQuery) ExistX(ctx context.Context) bool

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

func (*ToolUsageQuery) First added in v1.1.0

func (_q *ToolUsageQuery) First(ctx context.Context) (*ToolUsage, error)

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

func (*ToolUsageQuery) FirstID added in v1.1.0

func (_q *ToolUsageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ToolUsageQuery) FirstIDX added in v1.1.0

func (_q *ToolUsageQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ToolUsageQuery) FirstX added in v1.1.0

func (_q *ToolUsageQuery) FirstX(ctx context.Context) *ToolUsage

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

func (*ToolUsageQuery) GroupBy added in v1.1.0

func (_q *ToolUsageQuery) GroupBy(field string, fields ...string) *ToolUsageGroupBy

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 {
	Agent string `json:"agent,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ToolUsage.Query().
	GroupBy(toolusage.FieldAgent).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ToolUsageQuery) IDs added in v1.1.0

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

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

func (*ToolUsageQuery) IDsX added in v1.1.0

func (_q *ToolUsageQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ToolUsageQuery) Limit added in v1.1.0

func (_q *ToolUsageQuery) Limit(limit int) *ToolUsageQuery

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

func (*ToolUsageQuery) Offset added in v1.1.0

func (_q *ToolUsageQuery) Offset(offset int) *ToolUsageQuery

Offset to start from.

func (*ToolUsageQuery) Only added in v1.1.0

func (_q *ToolUsageQuery) Only(ctx context.Context) (*ToolUsage, error)

Only returns a single ToolUsage entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ToolUsage entity is found. Returns a *NotFoundError when no ToolUsage entities are found.

func (*ToolUsageQuery) OnlyID added in v1.1.0

func (_q *ToolUsageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only ToolUsage ID in the query. Returns a *NotSingularError when more than one ToolUsage ID is found. Returns a *NotFoundError when no entities are found.

func (*ToolUsageQuery) OnlyIDX added in v1.1.0

func (_q *ToolUsageQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ToolUsageQuery) OnlyX added in v1.1.0

func (_q *ToolUsageQuery) OnlyX(ctx context.Context) *ToolUsage

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

func (*ToolUsageQuery) Order added in v1.1.0

Order specifies how the records should be ordered.

func (*ToolUsageQuery) Select added in v1.1.0

func (_q *ToolUsageQuery) Select(fields ...string) *ToolUsageSelect

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 {
	Agent string `json:"agent,omitempty"`
}

client.ToolUsage.Query().
	Select(toolusage.FieldAgent).
	Scan(ctx, &v)

func (*ToolUsageQuery) Unique added in v1.1.0

func (_q *ToolUsageQuery) Unique(unique bool) *ToolUsageQuery

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 (*ToolUsageQuery) Where added in v1.1.0

Where adds a new predicate for the ToolUsageQuery builder.

type ToolUsageSelect added in v1.1.0

type ToolUsageSelect struct {
	*ToolUsageQuery
	// contains filtered or unexported fields
}

ToolUsageSelect is the builder for selecting fields of ToolUsage entities.

func (*ToolUsageSelect) Aggregate added in v1.1.0

func (_s *ToolUsageSelect) Aggregate(fns ...AggregateFunc) *ToolUsageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ToolUsageSelect) Bool added in v1.1.0

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

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

func (*ToolUsageSelect) BoolX added in v1.1.0

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

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

func (*ToolUsageSelect) Bools added in v1.1.0

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

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

func (*ToolUsageSelect) BoolsX added in v1.1.0

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

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

func (*ToolUsageSelect) Float64 added in v1.1.0

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

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

func (*ToolUsageSelect) Float64X added in v1.1.0

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

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

func (*ToolUsageSelect) Float64s added in v1.1.0

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

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

func (*ToolUsageSelect) Float64sX added in v1.1.0

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

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

func (*ToolUsageSelect) Int added in v1.1.0

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

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

func (*ToolUsageSelect) IntX added in v1.1.0

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

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

func (*ToolUsageSelect) Ints added in v1.1.0

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

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

func (*ToolUsageSelect) IntsX added in v1.1.0

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

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

func (*ToolUsageSelect) Scan added in v1.1.0

func (_s *ToolUsageSelect) Scan(ctx context.Context, v any) error

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

func (*ToolUsageSelect) ScanX added in v1.1.0

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

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

func (*ToolUsageSelect) String added in v1.1.0

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

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

func (*ToolUsageSelect) StringX added in v1.1.0

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

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

func (*ToolUsageSelect) Strings added in v1.1.0

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

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

func (*ToolUsageSelect) StringsX added in v1.1.0

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

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

type ToolUsageUpdate added in v1.1.0

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

ToolUsageUpdate is the builder for updating ToolUsage entities.

func (*ToolUsageUpdate) ClearTarget added in v1.1.0

func (_u *ToolUsageUpdate) ClearTarget() *ToolUsageUpdate

ClearTarget clears the value of the "target" field.

func (*ToolUsageUpdate) Exec added in v1.1.0

func (_u *ToolUsageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ToolUsageUpdate) ExecX added in v1.1.0

func (_u *ToolUsageUpdate) ExecX(ctx context.Context)

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

func (*ToolUsageUpdate) Mutation added in v1.1.0

func (_u *ToolUsageUpdate) Mutation() *ToolUsageMutation

Mutation returns the ToolUsageMutation object of the builder.

func (*ToolUsageUpdate) Save added in v1.1.0

func (_u *ToolUsageUpdate) Save(ctx context.Context) (int, error)

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

func (*ToolUsageUpdate) SaveX added in v1.1.0

func (_u *ToolUsageUpdate) SaveX(ctx context.Context) int

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

func (*ToolUsageUpdate) SetAgent added in v1.1.0

func (_u *ToolUsageUpdate) SetAgent(v string) *ToolUsageUpdate

SetAgent sets the "agent" field.

func (*ToolUsageUpdate) SetCommand added in v1.1.0

func (_u *ToolUsageUpdate) SetCommand(v string) *ToolUsageUpdate

SetCommand sets the "command" field.

func (*ToolUsageUpdate) SetNillableAgent added in v1.1.0

func (_u *ToolUsageUpdate) SetNillableAgent(v *string) *ToolUsageUpdate

SetNillableAgent sets the "agent" field if the given value is not nil.

func (*ToolUsageUpdate) SetNillableCommand added in v1.1.0

func (_u *ToolUsageUpdate) SetNillableCommand(v *string) *ToolUsageUpdate

SetNillableCommand sets the "command" field if the given value is not nil.

func (*ToolUsageUpdate) SetNillableSubcommand added in v1.1.0

func (_u *ToolUsageUpdate) SetNillableSubcommand(v *string) *ToolUsageUpdate

SetNillableSubcommand sets the "subcommand" field if the given value is not nil.

func (*ToolUsageUpdate) SetNillableTarget added in v1.1.0

func (_u *ToolUsageUpdate) SetNillableTarget(v *string) *ToolUsageUpdate

SetNillableTarget sets the "target" field if the given value is not nil.

func (*ToolUsageUpdate) SetNillableTeam added in v1.1.0

func (_u *ToolUsageUpdate) SetNillableTeam(v *string) *ToolUsageUpdate

SetNillableTeam sets the "team" field if the given value is not nil.

func (*ToolUsageUpdate) SetSubcommand added in v1.1.0

func (_u *ToolUsageUpdate) SetSubcommand(v string) *ToolUsageUpdate

SetSubcommand sets the "subcommand" field.

func (*ToolUsageUpdate) SetTarget added in v1.1.0

func (_u *ToolUsageUpdate) SetTarget(v string) *ToolUsageUpdate

SetTarget sets the "target" field.

func (*ToolUsageUpdate) SetTeam added in v1.1.0

func (_u *ToolUsageUpdate) SetTeam(v string) *ToolUsageUpdate

SetTeam sets the "team" field.

func (*ToolUsageUpdate) Where added in v1.1.0

Where appends a list predicates to the ToolUsageUpdate builder.

type ToolUsageUpdateOne added in v1.1.0

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

ToolUsageUpdateOne is the builder for updating a single ToolUsage entity.

func (*ToolUsageUpdateOne) ClearTarget added in v1.1.0

func (_u *ToolUsageUpdateOne) ClearTarget() *ToolUsageUpdateOne

ClearTarget clears the value of the "target" field.

func (*ToolUsageUpdateOne) Exec added in v1.1.0

func (_u *ToolUsageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ToolUsageUpdateOne) ExecX added in v1.1.0

func (_u *ToolUsageUpdateOne) ExecX(ctx context.Context)

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

func (*ToolUsageUpdateOne) Mutation added in v1.1.0

func (_u *ToolUsageUpdateOne) Mutation() *ToolUsageMutation

Mutation returns the ToolUsageMutation object of the builder.

func (*ToolUsageUpdateOne) Save added in v1.1.0

func (_u *ToolUsageUpdateOne) Save(ctx context.Context) (*ToolUsage, error)

Save executes the query and returns the updated ToolUsage entity.

func (*ToolUsageUpdateOne) SaveX added in v1.1.0

func (_u *ToolUsageUpdateOne) SaveX(ctx context.Context) *ToolUsage

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

func (*ToolUsageUpdateOne) Select added in v1.1.0

func (_u *ToolUsageUpdateOne) Select(field string, fields ...string) *ToolUsageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ToolUsageUpdateOne) SetAgent added in v1.1.0

func (_u *ToolUsageUpdateOne) SetAgent(v string) *ToolUsageUpdateOne

SetAgent sets the "agent" field.

func (*ToolUsageUpdateOne) SetCommand added in v1.1.0

func (_u *ToolUsageUpdateOne) SetCommand(v string) *ToolUsageUpdateOne

SetCommand sets the "command" field.

func (*ToolUsageUpdateOne) SetNillableAgent added in v1.1.0

func (_u *ToolUsageUpdateOne) SetNillableAgent(v *string) *ToolUsageUpdateOne

SetNillableAgent sets the "agent" field if the given value is not nil.

func (*ToolUsageUpdateOne) SetNillableCommand added in v1.1.0

func (_u *ToolUsageUpdateOne) SetNillableCommand(v *string) *ToolUsageUpdateOne

SetNillableCommand sets the "command" field if the given value is not nil.

func (*ToolUsageUpdateOne) SetNillableSubcommand added in v1.1.0

func (_u *ToolUsageUpdateOne) SetNillableSubcommand(v *string) *ToolUsageUpdateOne

SetNillableSubcommand sets the "subcommand" field if the given value is not nil.

func (*ToolUsageUpdateOne) SetNillableTarget added in v1.1.0

func (_u *ToolUsageUpdateOne) SetNillableTarget(v *string) *ToolUsageUpdateOne

SetNillableTarget sets the "target" field if the given value is not nil.

func (*ToolUsageUpdateOne) SetNillableTeam added in v1.1.0

func (_u *ToolUsageUpdateOne) SetNillableTeam(v *string) *ToolUsageUpdateOne

SetNillableTeam sets the "team" field if the given value is not nil.

func (*ToolUsageUpdateOne) SetSubcommand added in v1.1.0

func (_u *ToolUsageUpdateOne) SetSubcommand(v string) *ToolUsageUpdateOne

SetSubcommand sets the "subcommand" field.

func (*ToolUsageUpdateOne) SetTarget added in v1.1.0

func (_u *ToolUsageUpdateOne) SetTarget(v string) *ToolUsageUpdateOne

SetTarget sets the "target" field.

func (*ToolUsageUpdateOne) SetTeam added in v1.1.0

SetTeam sets the "team" field.

func (*ToolUsageUpdateOne) Where added in v1.1.0

Where appends a list predicates to the ToolUsageUpdate builder.

type ToolUsages added in v1.1.0

type ToolUsages []*ToolUsage

ToolUsages is a parsable slice of ToolUsage.

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 {

	// Attachment is the client for interacting with the Attachment builders.
	Attachment *AttachmentClient
	// Comment is the client for interacting with the Comment builders.
	Comment *CommentClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Reaction is the client for interacting with the Reaction builders.
	Reaction *ReactionClient
	// ToolUsage is the client for interacting with the ToolUsage builders.
	ToolUsage *ToolUsageClient
	// 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 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